Alex2Node/test
David d96c6b8372 build: refuse unknown arguments; name the fix when typescript is missing
Two failures of scripts/build.mjs did not say what to change. `node scripts/build.mjs --outt /some/dir` ignored
the misspelt flag, exited 0 and replaced the tracked dist/. Without devDependencies (npm install --omit=dev in a
clone runs "prepare") the script died with a stack trace, because typescript was resolved at module level,
outside the try block.

The script now takes no arguments or `--out <dir>` and answers anything else with one line and the usage, exit 1.
A missing compiler gives "build: typescript is not installed: run npm install (it is a devDependency)". The body
moved into build(args), so the staging directory and the compiler path are no longer module-level variables.

Two tests on a temporary package: three refused argument lists, and a package without node_modules; both compare
the package before and after. No change to dist/. npm test: 30 pass in 9.5-10.2 s (load average 7 on 4 cores).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-28 14:42:33 +00:00
..
fixtures build: the ES module build gets its own declarations 2026-09-28 14:31:34 +00:00
helpers test: read an ErrorResponse off the broker; every answer has its own messageId 2026-09-28 14:26:44 +00:00
build.test.js build: refuse unknown arguments; name the fix when typescript is missing 2026-09-28 14:42:33 +00:00
change-report.test.js test: read an ErrorResponse off the broker; every answer has its own messageId 2026-09-28 14:26:44 +00:00
connection.test.js build: dual CJS/ESM output, ES2020 target, Node 18 floor 2026-09-28 13:58:17 +00:00
directives.test.js test: read an ErrorResponse off the broker; every answer has its own messageId 2026-09-28 14:26:44 +00:00
discovery.test.js build: dual CJS/ESM output, ES2020 target, Node 18 floor 2026-09-28 13:58:17 +00:00
packaging.test.js build: stage beside dist/, not inside it 2026-09-28 14:40:36 +00:00
packaging.test.mjs test: read an ErrorResponse off the broker; every answer has its own messageId 2026-09-28 14:26:44 +00:00
typings.test.js build: dual CJS/ESM output, ES2020 target, Node 18 floor 2026-09-28 13:58:17 +00:00