Skip to content

T-0DSA-the-typescript-aspect-delegates-and-spans-both-stacks

State: closed/done · Impact: high · Complexity: medium

.moon/tasks/ts-lib.yml ANDs stack: backend into its scope, so the 10 frontend TS libraries inherit nothing and each hand-rolls its own tasks — 9 distinct moon.yml shapes for what should be one. This task drops that condition and gives the aspect the full task vocabulary (typecheck, lint, lint-fix, fmt, fmt-check, test, build, plus the deps-only check aggregate), every task delegating to a bun run script so the aspect never needs to know whether a package’s own script runs tsc, vue-tsc, or nuxt prepare && vue-tsc. The result is one aspect spanning both stacks and 36 of 40 library moon.yml files dropping their tasks: block entirely.

LocationRole today
.moon/tasks/ts-lib.ymlinheritedBy ANDs language: typescript, layer: library, stack: backend. Supplies exactly one task, check, running bunx tsc --noEmit -p tsconfig.json directly (no delegation to a package script).
packages/ts/*/moon.yml (glob, 30 files)20 backend libraries inherit check from the aspect as-is; the 10 frontend libraries here (dashboard-client, json-canvas-vue, obsidian-editor, ui, and others) are excluded by stack: backend and each declares its own check/test tasks locally.
solutions/augmented/packages/ts/*/moon.yml (glob, 6 files)Backend libraries; inherit the aspect’s check today.
solutions/determined/packages/*/moon.yml (glob, 5 files)4 backend libraries (app-state, obsidian-astro, photo-annotator, vault-path) inherit the aspect’s check; vault-contracts is also backend and inherits check, but keeps a local test (extra inputs only) and a bespoke lint.
scripts/guard-ts-lib-checks.tsFails a build when a stack: backend TS library redefines check without options.merge: 'replace' — moon appends same-named tasks by default, and a doubled tsc … -p tsconfig.json tsc … throws TS5042. Filters on stack: backend explicitly, so it inspects 30 projects, not the 40 this task ends up covering.

.moon/tasks/ts-lib.yml’s inheritedBy drops stack: backend, so all 40 language: typescript + layer: library projects — backend and frontend — inherit it. It supplies the full vocabulary from the standard (T-VAF5): typecheck, lint, lint-fix, fmt, fmt-check, test, build, each a thin command: 'bun run <script>' delegating to the package’s own package.json script. check is redefined as the deps-only aggregate (deps: ['~:typecheck', '~:fmt-check', '~:lint']), matching the Rust aspect’s check shape and ending the asymmetry where check meant the tsc run for the 30 backend libraries and nothing at all for the 10 frontend ones.

36 of the 40 library moon.yml files lose their tasks: block entirely and become four lines of metadata (layer, stack, language, plus the header comment). The 4 that keep something keep only their genuinely-own task: dashboard-client (generate, plus its bespoke drift-checking check override), obsidian-editor (bench-check), ui (install-browsers, test-colour), photo-annotator (cli). Three more (fleet, markdown-util, vault-contracts) keep a test task that declares only extra inputs on top of what the aspect would supply were test inheritable that way — moon appends local inputs to an inherited task’s declared inputs, so this is additive, not an override. vault-contracts additionally keeps its own bespoke lint (a repo-specific drift script, bun … vault-contracts/src/check.ts), which is unrelated to the aspect’s lint and stays.

  1. Confirm T-076A and T-9FH9 have landed the typecheck, lint, lint:fix, format, format:check, test, build package.json scripts across every TS library — the aspect’s tasks have nothing to delegate to otherwise.
  2. Edit .moon/tasks/ts-lib.yml: remove stack: 'backend' from inheritedBy; add typecheck, lint, lint-fix, fmt, fmt-check, test, build tasks, each command: 'bun run <script>' with toolchains: 'system'; redefine check to drop its command and become deps: ['~:typecheck', '~:fmt-check', '~:lint'] only. Update the file’s own doc comment, which currently explains the stack: backend exclusion by name.
  3. Walk the 40 library moon.yml files (the three globs in Today) and strip any local task now fully covered by the aspect. Verify, don’t assume, which of the 7 exceptions in Proposed keep what: read each file’s current tasks: block against the target vocabulary before deleting.
  4. For fleet, markdown-util, vault-contracts, confirm with moon task <project>:test --json (or equivalent resolved-command output) that the project’s declared extra inputs are present alongside whatever test command the aspect now supplies, not silently dropped.
  5. Run bun scripts/guard-ts-lib-checks.ts and confirm it still exits 0 against the 30 stack: backend projects it inspects (the file itself is not touched — the task’s scope note says “unchanged”).
  6. Spot-check delegation with moon task <target> (prints the resolved command) on one backend library and one frontend library’s typecheck, check, and test targets.
LocationKindChange
.moon/tasks/ts-lib.ymlmodifyDrop stack: 'backend' from inheritedBy; add typecheck, lint, lint-fix, fmt, fmt-check, test, build tasks delegating to bun run <script>; redefine check as the deps-only aggregate.
packages/ts/*/moon.ymlmodifyStrip local check/test tasks now covered by the aspect; keep only the genuinely-own tasks named in Proposed for dashboard-client, obsidian-editor, ui, fleet, markdown-util.
solutions/augmented/packages/ts/*/moon.ymlmodifyStrip local tasks now covered by the aspect (all 6 are backend libraries with no exception listed in Proposed).
solutions/determined/packages/*/moon.ymlmodifyStrip local tasks now covered by the aspect; keep photo-annotator’s cli, vault-contracts’s extra-inputs test and bespoke lint.
  • AC-1: grep -c "stack:" .moon/tasks/ts-lib.yml returns 0, and the file’s tasks: block defines check, typecheck, lint, lint-fix, fmt, fmt-check, test, build.
  • AC-2: moon task <frontend-lib>:typecheck (e.g. json-canvas-vue) resolves to a non-empty command — proving a frontend library now inherits from the aspect, where before it inherited nothing.
  • AC-3: Across the three globs in Today (40 files total), exactly 4 moon.yml files still contain a tasks: key with anything beyond the documented exceptions, and 36 contain none.
  • AC-4: bun scripts/guard-ts-lib-checks.ts exits 0.
  • AC-5: moon task fleet-ts:test, moon task markdown-util-ts:test, and moon task vault-contracts:test each still show the project’s own extra inputs (e.g. /packages/fleet-parity/parity.json) present in the resolved task, not dropped.
  • AC-6: moon run :check :test reports at least 40 TS library projects covered by check, up from 30 before this task.
  • Adding the typecheck/lint/format/test/build package.json scripts themselves — that is T-076A and T-9FH9.
  • The Rust aspect’s $project collapse and lint-fix addition — that is task 7 in the milestone plan.
  • The tool/product aspects (sdlc, determined-root, Nuxt products/experiences) and the install operation — task 8.
  • The conformance guard (scripts/guard-project-shape.ts) — task 11.
  • T-VAF5 — the standard defining the baseline task vocabulary this aspect implements.
  • T-076A — lands the package.json script vocabulary in packages/, apps, and sites, which the aspect’s tasks delegate to.
  • T-9FH9 — lands the same script vocabulary across solutions/.

T-VAF5-a-standard-for-the-baseline-task-vocabulary, T-076A-the-script-vocabulary-lands-in-packages-apps-and-sites, T-9FH9-the-script-vocabulary-lands-across-solutions


← Back to Tasks