Alex2Node/test
David 128ca35c2a test: find the imports of the builds with the compiler's scanner
The test that compares the imports of dist/ with "dependencies" matched a regular expression against the whole
file. tsc keeps comments in its output, so a usage line in a doc comment (import { ActionMapping } from
"alex2node") counted as an import and failed the commit gate with a message about dependencies.

ts.preProcessFile lists the imports instead. Stripping comments with two more expressions was tried first and
reads strings wrong: in `"src/*.ts"; require("real-one"); "*/"` it drops the require, and it never saw
import("lazy-one"); the scanner returns both. The declarations are scanned too: a .d.ts that imports a package the
consumer does not get breaks the consumer's type check.

Checked in a scratch copy: a doc comment and a string with an import in them pass; require("left-pad") in
dist/cjs, an aedes import in a declaration and an unused declared dependency each fail. npm test: 30 pass in
8.9-10.0 s.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-28 14:44:34 +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 test: find the imports of the builds with the compiler's scanner 2026-09-28 14:44:34 +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