You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[finding] managed-extension-fields.test.ts seeds its source scan from import.meta, costing plugin-auth's TEST_DEBT its only TS1470 — the package already has an idiom that avoids it #9694
Observation-class finding, measured while implementing #8122 (PR #9693). Nothing is broken and no gate is red — this is one frozen error in a shrink-only ledger that the package's own established idiom would remove. Filed unassigned, no pm:queue.
Measured
packages/plugins/plugin-auth excludes **/*.test.ts from its tsconfig.json, so its test layer is accounted for by a TEST_DEBT entry in scripts/check-type-check-coverage.mjs — 111 frozen raw errors, shrink-only.
Reproducing that measurement on main (an equivalent tsc project over the package with the test exclusion lifted, which returns exactly the ledger's recorded 111), one of those 111 errors is a TS1470:
src/managed-extension-fields.test.ts(281,36): error TS1470: The 'import.meta'
meta-property is not allowed in files which will build into CommonJS output.
It comes from the seed on line 281:
const HERE = dirname(fileURLToPath(import.meta.url));
Why it is a finding rather than nothing
The package documents this exact hazard and already carries the fix, in two sibling test files (rate-limit-storage-isolation.test.ts:53, member-role-canonical.test.ts:66), with the reason written out:
plugin-auth is CJS-typed (no "type": "module", it publishes dist/index.js as CommonJS), so under module: NodeNextimport.meta is a TS1470 in this package however well it runs under vitest.
They seed from a findUp walk to the package root instead. So the repo has already decided which spelling this package uses; one file predates or missed that decision.
This was not noticed abstractly: PR #9693 needed the same source-scan seed in a second test file, and using import.meta.url there moved the ledger 111 to 112 — the ratchet doing its job. That PR uses the findUp idiom, so it lands at 111. The D7 file's copy stays as the only TS1470 in the package.
Suggested direction (not a decision)
Convert managed-extension-fields.test.ts:281 to the same findUp idiom and lower the @objectstack/plugin-auth TEST_DEBT entry 111 to 110, rewriting the entry's note in the same edit (its composition line names TS2493 x42, TS18048 x24, ... and would otherwise describe a tally that no longer holds — the shape #7038 was filed for).
⚠️ Two things worth checking before treating it as a one-liner:
Whether the wider fix is preferable: a sibling tsconfig.test.json carrying its own module semantics (the packages/spec pattern AGENTS.md describes) would make import.meta legal in this package's tests and retire the class rather than one instance. That is a larger change — it graduates the package's whole test layer into a tsc program and interacts with the 111 debt entry wholesale — and is a triage call, not a drive-by.
The narrow fix is worth roughly one error; the reason to file it at all is that the package currently teaches both spellings, and the wrong one is in the file most likely to be copied from — it is the sibling gate that #8122 and #7820 both point at as the pattern to follow.
Backlinks: #8122 / PR #9693 (where it was measured), #7820 (the file's tripwire), #8612 (the same ledger shape in @objectstack/cli).
Observation-class finding, measured while implementing #8122 (PR #9693). Nothing is broken and no gate is red — this is one frozen error in a shrink-only ledger that the package's own established idiom would remove. Filed unassigned, no
pm:queue.Measured
packages/plugins/plugin-authexcludes**/*.test.tsfrom itstsconfig.json, so its test layer is accounted for by aTEST_DEBTentry inscripts/check-type-check-coverage.mjs— 111 frozen raw errors, shrink-only.Reproducing that measurement on
main(an equivalent tsc project over the package with the test exclusion lifted, which returns exactly the ledger's recorded 111), one of those 111 errors is a TS1470:It comes from the seed on line 281:
Why it is a finding rather than nothing
The package documents this exact hazard and already carries the fix, in two sibling test files (
rate-limit-storage-isolation.test.ts:53,member-role-canonical.test.ts:66), with the reason written out:They seed from a
findUpwalk to the package root instead. So the repo has already decided which spelling this package uses; one file predates or missed that decision.This was not noticed abstractly: PR #9693 needed the same source-scan seed in a second test file, and using
import.meta.urlthere moved the ledger 111 to 112 — the ratchet doing its job. That PR uses thefindUpidiom, so it lands at 111. The D7 file's copy stays as the only TS1470 in the package.Suggested direction (not a decision)
Convert
managed-extension-fields.test.ts:281to the samefindUpidiom and lower the@objectstack/plugin-authTEST_DEBT entry 111 to 110, rewriting the entry'snotein the same edit (its composition line namesTS2493 x42, TS18048 x24, ...and would otherwise describe a tally that no longer holds — the shape #7038 was filed for).tsconfig.test.jsoncarrying its own module semantics (thepackages/specpattern AGENTS.md describes) would makeimport.metalegal in this package's tests and retire the class rather than one instance. That is a larger change — it graduates the package's whole test layer into a tsc program and interacts with the 111 debt entry wholesale — and is a triage call, not a drive-by.The narrow fix is worth roughly one error; the reason to file it at all is that the package currently teaches both spellings, and the wrong one is in the file most likely to be copied from — it is the sibling gate that #8122 and #7820 both point at as the pattern to follow.
Backlinks: #8122 / PR #9693 (where it was measured), #7820 (the file's tripwire), #8612 (the same ledger shape in
@objectstack/cli).