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.
| Location | Role today |
|---|---|
.moon/tasks/ts-lib.yml | inheritedBy 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.ts | Fails 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. |
Proposed
Section titled “Proposed”.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.
Approach
Section titled “Approach”- Confirm
T-076AandT-9FH9have landed thetypecheck,lint,lint:fix,format,format:check,test,buildpackage.jsonscripts across every TS library — the aspect’s tasks have nothing to delegate to otherwise. - Edit
.moon/tasks/ts-lib.yml: removestack: 'backend'frominheritedBy; addtypecheck,lint,lint-fix,fmt,fmt-check,test,buildtasks, eachcommand: 'bun run <script>'withtoolchains: 'system'; redefinecheckto drop itscommandand becomedeps: ['~:typecheck', '~:fmt-check', '~:lint']only. Update the file’s own doc comment, which currently explains thestack: backendexclusion by name. - Walk the 40 library
moon.ymlfiles (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 currenttasks:block against the target vocabulary before deleting. - For
fleet,markdown-util,vault-contracts, confirm withmoon task <project>:test --json(or equivalent resolved-command output) that the project’s declared extrainputsare present alongside whatevertestcommand the aspect now supplies, not silently dropped. - Run
bun scripts/guard-ts-lib-checks.tsand confirm it still exits 0 against the 30stack: backendprojects it inspects (the file itself is not touched — the task’s scope note says “unchanged”). - Spot-check delegation with
moon task <target>(prints the resolved command) on one backend library and one frontend library’stypecheck,check, andtesttargets.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
.moon/tasks/ts-lib.yml | modify | Drop 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.yml | modify | Strip 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.yml | modify | Strip local tasks now covered by the aspect (all 6 are backend libraries with no exception listed in Proposed). |
solutions/determined/packages/*/moon.yml | modify | Strip local tasks now covered by the aspect; keep photo-annotator’s cli, vault-contracts’s extra-inputs test and bespoke lint. |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1:
grep -c "stack:" .moon/tasks/ts-lib.ymlreturns0, and the file’stasks:block definescheck,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.ymlfiles still contain atasks:key with anything beyond the documented exceptions, and 36 contain none. - AC-4:
bun scripts/guard-ts-lib-checks.tsexits0. - AC-5:
moon task fleet-ts:test,moon task markdown-util-ts:test, andmoon task vault-contracts:testeach still show the project’s own extrainputs(e.g./packages/fleet-parity/parity.json) present in the resolved task, not dropped. - AC-6:
moon run :check :testreports at least 40 TS library projects covered bycheck, up from 30 before this task.
Out of scope
Section titled “Out of scope”- Adding the
typecheck/lint/format/test/buildpackage.jsonscripts themselves — that isT-076AandT-9FH9. - The Rust aspect’s
$projectcollapse andlint-fixaddition — that is task 7 in the milestone plan. - The tool/product aspects (
sdlc,determined-root, Nuxt products/experiences) and theinstalloperation — task 8. - The conformance guard (
scripts/guard-project-shape.ts) — task 11.
Dependencies
Section titled “Dependencies”T-VAF5— the standard defining the baseline task vocabulary this aspect implements.T-076A— lands thepackage.jsonscript vocabulary inpackages/, apps, and sites, which the aspect’s tasks delegate to.T-9FH9— lands the same script vocabulary acrosssolutions/.
Depends on
Section titled “Depends on”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