diff --git a/.claude/rules/architecture-map.md b/.claude/rules/architecture-map.md index 25d7f392..95a8da54 100644 --- a/.claude/rules/architecture-map.md +++ b/.claude/rules/architecture-map.md @@ -63,7 +63,9 @@ shell (or, in parallel, in per-test `.result` files aggregated at the end). | `state.sh` | counters, per-test payload encode/decode, TAP conversion | | `env.sh` | all `BASHUNIT_*` defaults/config files, scratch dirs (`_BASHUNIT_RUN_OUTPUT_DIR` + EXIT-trap cleanup) | | `parallel.sh` | worker temp tree, aggregation, stop-on-failure flag file | -| `console_header.sh` / `console_results.sh` | header/totals rendering, deferred failed/skipped/incomplete/risky blocks (scratch files under the run dir) | +| `console/index.sh` | aggregator only — sources the `src/console/` module below | +| `console/colors.sh` | the `_BASHUNIT_COLOR_*` palette and `bashunit::sgr` | +| `console/header.sh` / `console/results.sh` | header/totals rendering, deferred failed/skipped/incomplete/risky blocks (scratch files under the run dir) | | `assert/index.sh` | aggregator only — sources the `src/assert/` module below, plus `skip_todo.sh` and `test_doubles.sh` | | `assert/core.sh` | `assert::should_skip`, `assert::fail_with`, `assert::join_to_slot` and the comparison assertions the other files build on | | `assert/{arrays,assertions,dates,duration,files,folders,json,once,snapshot}.sh` | the per-topic assertions; the per-assertion path must stay fork-free | diff --git a/.editorconfig b/.editorconfig index 45fce408..0173d7b2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -26,7 +26,7 @@ indent_size = 2 [{Makefile,**.mk,.git*}] indent_style = tab -[{tests/acceptance/**.sh,src/console_header.sh,docs/command-line.md}] +[{tests/acceptance/**.sh,src/console/header.sh,docs/command-line.md}] indent_size = unset [.claude/**.md] diff --git a/bashunit b/bashunit index ae6cf529..1db3b96e 100755 --- a/bashunit +++ b/bashunit @@ -76,9 +76,7 @@ source "$BASHUNIT_ROOT_DIR/src/env.sh" source "$BASHUNIT_ROOT_DIR/src/coverage/index.sh" source "$BASHUNIT_ROOT_DIR/src/clock.sh" source "$BASHUNIT_ROOT_DIR/src/state.sh" -source "$BASHUNIT_ROOT_DIR/src/colors.sh" -source "$BASHUNIT_ROOT_DIR/src/console_header.sh" -source "$BASHUNIT_ROOT_DIR/src/console_results.sh" +source "$BASHUNIT_ROOT_DIR/src/console/index.sh" source "$BASHUNIT_ROOT_DIR/src/helpers.sh" source "$BASHUNIT_ROOT_DIR/src/test_title.sh" source "$BASHUNIT_ROOT_DIR/src/upgrade.sh" diff --git a/src/colors.sh b/src/console/colors.sh similarity index 100% rename from src/colors.sh rename to src/console/colors.sh diff --git a/src/console_header.sh b/src/console/header.sh similarity index 100% rename from src/console_header.sh rename to src/console/header.sh diff --git a/src/console/index.sh b/src/console/index.sh new file mode 100644 index 00000000..9b4fc5b1 --- /dev/null +++ b/src/console/index.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# Entry point for the src/console/ module: only `source` lines and comments +# belong here. build.sh emits a file's body before recursing into its `source` +# lines, so any statement here would run before its dependencies in the built +# binary (adrs/adr-010-src-module-directories.md). +# +# colors.sh first: it defines the _BASHUNIT_COLOR_* palette that header.sh and +# results.sh render with. Order matches the entrypoint's before this module +# existed. +source "$BASHUNIT_ROOT_DIR/src/console/colors.sh" +source "$BASHUNIT_ROOT_DIR/src/console/header.sh" +source "$BASHUNIT_ROOT_DIR/src/console/results.sh" diff --git a/src/console_results.sh b/src/console/results.sh similarity index 100% rename from src/console_results.sh rename to src/console/results.sh