Measured while converting the last seven unconverted importers in #15783 (PR #15862), which added the first .mts consumer of scripts/import-prerequisite.mjs.
What happens
prerequisiteNotMetText derives the name it prints from the importer's path:
const gate = fileURLToPath(importerUrl).split('/').pop().replace(/\.mjs$/, '');
Only .mjs is stripped. Every consumer until now was .mjs, so this was invisible. With a .mts consumer the refusal prints the extension:
$ node scripts/check-exported-any-returns.mts ; echo EXIT=$?
check-exported-any-returns.mts: PREREQUISITE NOT MET — the dependency `typescript` is not installed
EXIT=3
against the sibling shape on the same tree, same run:
$ node scripts/check-comment-mask-corpus.mjs ; echo EXIT=$?
check-comment-mask-corpus: PREREQUISITE NOT MET — the dependency `@typescript-eslint/parser` is not installed
EXIT=3
Why it is small, and why it is still worth a row
Cosmetic: the exit code, the named package, the "nothing was measured" clause and the node PATH.log command line are all correct, and the command line the text hands the reader keeps its real extension either way (/tmp/check-exported-any-returns.mts.log is a writable path). Nothing reads that name programmatically as far as this observation goes — that was not swept.
What it costs is that the printed identifier stops being the gate's NAME and becomes a filename, in the one message a reader is meant to quote back. The population is derivable rather than recalled: any consumer of import-prerequisite.mjs authored in TypeScript. Today that is one.
Re-check
git grep -n "replace(/\\\\.mjs\\$/" -- scripts/import-prerequisite.mjs
- In a worktree with no
node_modules: node scripts/check-exported-any-returns.mts > /tmp/g.log 2>&1; echo EXIT=$? — capture BEFORE any pipe.
Not asserted
No claim about which spelling is right. .mts could be stripped alongside .mjs, or the extension could be kept deliberately for a .mts gate that a reader will invoke with the extension. That is a decision, not a defect with one answer.
Related
#15783 (the class, and the card that produced this observation) - PR #15862 - #11557 - #13983 (the exit code of this same frame)
Generated by Claude Code
Measured while converting the last seven unconverted importers in #15783 (PR #15862), which added the first
.mtsconsumer ofscripts/import-prerequisite.mjs.What happens
prerequisiteNotMetTextderives the name it prints from the importer's path:Only
.mjsis stripped. Every consumer until now was.mjs, so this was invisible. With a.mtsconsumer the refusal prints the extension:against the sibling shape on the same tree, same run:
Why it is small, and why it is still worth a row
Cosmetic: the exit code, the named package, the "nothing was measured" clause and the
node PATH.logcommand line are all correct, and the command line the text hands the reader keeps its real extension either way (/tmp/check-exported-any-returns.mts.logis a writable path). Nothing reads that name programmatically as far as this observation goes — that was not swept.What it costs is that the printed identifier stops being the gate's NAME and becomes a filename, in the one message a reader is meant to quote back. The population is derivable rather than recalled: any consumer of
import-prerequisite.mjsauthored in TypeScript. Today that is one.Re-check
git grep -n "replace(/\\\\.mjs\\$/" -- scripts/import-prerequisite.mjsnode_modules:node scripts/check-exported-any-returns.mts > /tmp/g.log 2>&1; echo EXIT=$?— capture BEFORE any pipe.Not asserted
No claim about which spelling is right.
.mtscould be stripped alongside.mjs, or the extension could be kept deliberately for a.mtsgate that a reader will invoke with the extension. That is a decision, not a defect with one answer.Related
#15783 (the class, and the card that produced this observation) - PR #15862 - #11557 - #13983 (the exit code of this same frame)
Generated by Claude Code