Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
sily lib sync
Browse files Browse the repository at this point in the history
  • Loading branch information
al1-ce committed May 3, 2024
1 parent 40ce75d commit 61c15f6
Show file tree
Hide file tree
Showing 13 changed files with 120 additions and 183 deletions.
6 changes: 3 additions & 3 deletions dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors "Alisa Lain"
copyright "Copyright © 2023, Alisa Lain"
license "MIT"

dependency "sily" version="~>3.0.0"
dependency "sily" version="~>4"
dependency "speedy-stdio" version="0.2.0" optional=true
targetType "library"
targetPath "lib"
Expand All @@ -13,7 +13,7 @@ importPaths "terminal/"

subPackage {
name "logger"
dependency "sily" version="~>3.0.0"
dependency "sily" version="~>4"
dependency "sily-terminal" version="*"
targetType "library"
targetPath "lib"
Expand All @@ -23,7 +23,7 @@ subPackage {

subPackage {
name "tui"
dependency "sily" version="~>3.0.0"
dependency "sily" version="~>4"
dependency "sily-terminal:logger" version="*"
dependency "sily-terminal" version="*"
dependency "speedy-stdio" version="0.2.0" optional=true
Expand Down
2 changes: 1 addition & 1 deletion dub.selections.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"fileVersion": 1,
"versions": {
"sily": "2.2.0"
"sily": "3.0.0"
}
}
74 changes: 74 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# #!/usr/bin/env -S just --justfile
# just reference: https://just.systems/man/en/
# monolith flavor: ~/.config/nvim/readme/build.md
#
# set positional-arguments

test file:
#!/bin/bash
if [[ -f "test/{{file}}.d" ]]; then
dub run --single "test/{{file}}.d"
else
echo "Missing test/{{file}}.d"
fi

# Cheatsheet:
# Set a variable (variable case is arbitrary)
# SINGLE := "--single"
#
# Export variable
# export MYHOME := "/new/home"
#
# Join paths:
# PATHS := "path/to" / "file" + ".txt"
#
# Conditions
# foo := if "2" == "2" { "Good!" } else { "1984" }
#
# String literals
# escaped_string := "\"\\" # will eval to "\
# raw_string := '\"\\' # will eval to \"\\
# exec_string := `ls` # will be set to result of inner command
#
# Hide configuration from just --list, prepend _ or add [private]
# [private]
# _test: build_d
#
# Alias to a recipe (just noecho)
# alias noecho := _echo
#
# Silence commands or recipes by prepending @ (i.e hide "dub build"):
# @build_d_custom:
# @dub build
#
# Continue even on fail by adding "-"
# test:
# -cat notexists.txt
# echo "Still executes"
#
# Configuration using variable from above (and positional argument $1)
# buildFile FILENAME:
# dub build {{SINGLE}} $1
#
# Set env ([linux] makes recipe be usable only in linux)
# [linux]
# @test_d:
# #!/bin/bash
#
# A command's arguments can be passed to dependency (also default arguments)
# push target="debug": (build target)
#
# Use + (1 ore more) or * (0 or more) to make argument variadic. Must be last
# ntest +FILES="justfile1 justfile2":
#
# Run set configurations (recipe requirements)
# all: build_d build_d_custom _echo
#
# This example will run in order "a", "b", "c", "d"
# b: a && c d
#
# Each recipe line is executed by a new shell (use shebang to prevent)
# foo:
# pwd # This `pwd` will print the same directory…
# cd bar
# pwd # …as this `pwd`!
4 changes: 2 additions & 2 deletions logger/sily/logger/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,8 @@ void block(dstring title, dstring message, int width = -1, int _align = -1, bool
}

if (__logFormatEnabled) {
foreach (line; titles) writef("%*s\033[1;7m %*-s\033[m\n", _alignSize, "", maxLen, line);
foreach (line; lines) writef("%*s\033[3;7;2m %*-s\033[m\n", _alignSize, "", maxLen, line);
foreach (line; titles) writef("%*s\033[1;4;7m %*-s\033[m\n", _alignSize, "", maxLen, line);
foreach (line; lines) writef("%*s\033[7m %*-s\033[m\n", _alignSize, "", maxLen, line);
} else {
foreach (line; titles) writef("%*s %*-s\n", _alignSize, "", maxLen, line);
foreach (line; lines) writef("%*s %*-s\n", _alignSize, "", maxLen, line);
Expand Down
8 changes: 5 additions & 3 deletions test/conio → test/conio.d
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/usr/bin/env dub
/+ dub.sdl:
name "coniotest"
dependency "sily" path="/g/sily-dlang/"
dependency "sily-terminal:logger" path="/g/sily-terminal/"
dependency "sily-terminal" path="/g/sily-terminal/"
dependency "sily" version="~>4"
dependency "sily-terminal:logger" path="../"
dependency "sily-terminal" path="../"
targetType "executable"
targetPath "../bin/"
+/

import std.stdio: writef;
Expand Down
7 changes: 5 additions & 2 deletions test/format → test/format.d
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/usr/bin/env dub
/+ dub.sdl:
name "testfmt"
dependency "sily" path="/g:/sily-dlang/"
dependency "sily-terminal" path="/g:/sily-terminal/"
dependency "sily" version="~>4"
dependency "sily-terminal:logger" path="../"
dependency "sily-terminal" path="../"
targetType "executable"
targetPath "../bin/"
+/

import std.stdio: writeln, write, readln;
Expand Down
149 changes: 0 additions & 149 deletions test/log

This file was deleted.

15 changes: 9 additions & 6 deletions test/log.d
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/usr/bin/env dub
/+ dub.sdl:
name "logtest"
dependency "sily" path="/g:/sily-dlang/"
dependency "sily-terminal:logger" path="/g:/sily-terminal/"
dependency "sily" version="~>4"
dependency "sily-terminal:logger" path="../"
dependency "sily-terminal" path="../"
targetType "executable"
targetPath "../bin/"
+/
module test.log;

Expand All @@ -22,8 +25,8 @@ void main() {
log("Testing normal log");
hr('=');
message("LogLevel: off");
globalLogLevel = LogLevel.off;
log!(LogLevel.off)("Using off level with off to display at any time");
// globalLogLevel = LogLevel.off;
// log!(LogLevel.off)("Using off level with off to display at any time");
// log("Should not see");
// hr();
// message("LogLevel: fatal");
Expand All @@ -43,7 +46,7 @@ void main() {
// log!(LogLevel.fatal)("Should not see fatal");
// hr();
message("LogLevel: all");
globalLogLevel = LogLevel.all;
// globalLogLevel = LogLevel.all;


// writef("\033[2J");
Expand Down Expand Up @@ -145,4 +148,4 @@ void main() {
// center(get5x6("Epic Titles II: Now On TV"));
center(get5x6("Sphinx of black quartz, judge my vow."));
writeln("");
}
}
Binary file removed test/logtest
Binary file not shown.
7 changes: 5 additions & 2 deletions test/pixelfont.d
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/usr/bin/env dub
/+ dub.sdl:
name "pixelfont"
dependency "sily" path="/g/sily-dlang/"
dependency "sily-terminal:logger" path="/g/sily-terminal/"
dependency "sily" version="~>4"
dependency "sily-terminal:logger" path="../"
dependency "sily-terminal" path="../"
targetType "executable"
targetPath "../bin/"
+/
import std.stdio: writeln;

Expand Down
8 changes: 5 additions & 3 deletions test/raw → test/raw.d
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/usr/bin/env dub
/+ dub.sdl:
name "coniotest"
dependency "sily" path="/g/sily-dlang/"
dependency "sily-terminal:logger" path="/g/sily-terminal/"
dependency "sily-terminal" path="/g/sily-terminal/"
dependency "sily" version="~>4"
dependency "sily-terminal:logger" path="../"
dependency "sily-terminal" path="../"
targetType "executable"
targetPath "../bin/"
+/

import std.stdio: writef;
Expand Down
8 changes: 5 additions & 3 deletions test/termio → test/termio.d
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/usr/bin/env dub
/+ dub.sdl:
name "termiotest"
dependency "sily" path="/g:/sily-dlang/"
dependency "sily-terminal:logger" path="/g:/sily-terminal/"
dependency "sily-terminal" path="/g:/sily-terminal/"
dependency "sily" version="~>4"
dependency "sily-terminal:logger" path="../"
dependency "sily-terminal" path="../"
targetType "executable"
targetPath "../bin/"
+/
module test.termio;

Expand Down
Loading

0 comments on commit 61c15f6

Please sign in to comment.