Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli/test/i18n-coverage.test.ts
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.

import { describe, it, expect } from 'vitest';
import { computeI18nCoverage } from '../src/utils/i18n-coverage';
import { computeI18nCoverage } from '../src/utils/i18n-coverage.js';

const baseConfig: any = {
objects: [
Expand Down
7 changes: 2 additions & 5 deletions packages/cli/test/i18n-extract.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ import {
collectExpectedEntries,
extractTranslations,
renderTranslationModule,
} from '../src/utils/i18n-extract';
} from '../src/utils/i18n-extract.js';

const config: any = {
objects: [
Expand DownExpand Up@@ -163,11 +163,8 @@ describe('collectExpectedEntries', () => {
],
};
const entries = collectExpectedEntries(cfg);
// Structural annotation: the module import is outside this file's tsc
// program reach (frozen TS2835 debt), so the parameter would otherwise be
// an implicitly-any addition to the package's TEST_DEBT ledger.
const byPath = Object.fromEntries(
entries.map((e: { path: string[] }) => [e.path.join('.'), e]),
entries.map((e) => [e.path.join('.'), e]),
);
const opt = (p: string) => byPath[`objects.w.fields.${p}`];

Expand Down
44 changes: 31 additions & 13 deletions scripts/check-type-check-coverage.mjs
Original file line numberDiff line numberDiff line change
Expand Up@@ -539,7 +539,8 @@ const EXEMPT = {
// the fix: widen a hidden test layer's `include` one file at a time and
// measure each addition, because a wholesale glob can bill the layer for a
// non-test file it never asked to cover.)
// `@objectstack/cli` (188 raw across 56 files) is deliberately NOT part of that
// `@objectstack/cli` (146 raw across 65 files, after #8612 repaired the first
// two of its 59 missing import extensions) is deliberately NOT part of that
// graduation -- it is a programme rather than a sitting, and its entry stands.
const TEST_DEBT = {
'@objectstack/plugin-approvals': {
Expand DownExpand Up@@ -597,20 +598,37 @@ const TEST_DEBT = {
+ '`GET /meta/:type/:name` envelope convergence). Nothing else in the package moved.',
},
'@objectstack/cli': {
errors: 188,
note: 'TS7006 x100 (implicit any), TS2835 x59 (NodeNext extensions), TS2339 x24, TS2307 x3, TS18046 x2. '
errors: 146,
note: 'TS7006 x60 (implicit any), TS2835 x57 (NodeNext extensions), TS2339 x24, TS2307 x3, TS18046 x2. '
+ 'The package #7353 was really about, and the largest single thing the exclude-shaped detector could '
+ 'not see: `tsconfig.json` says `include: ["src"]` and has no `exclude` AT ALL, so there was never an '
+ 'exclusion to notice, and the 56 test files in the sibling `test/` tree were read by nothing -- not '
+ 'this gate, not `pnpm typecheck`, not CI. The other 54 test files DO sit under `src` and always '
+ 'compiled; 188 is the outside-`test/` layer only, which is why the file count reads 56 and not 110. '
+ 'Read the top-of-ledger NodeNext note before sizing this: TS2835 plus the TS7006 cascade it causes '
+ 'are 159 of the 188 and are one repair, not 159. Concentrated rather than spread -- '
+ 'test/i18n-coverage.test.ts x35, test/data-model-rules.test.ts x26, '
+ 'test/i18n-declared-surface-gate.test.ts x19, test/i18n-section-coverage.test.ts x18, '
+ 'test/commands.test.ts x15 are 113 of it. Measured at b9f930b with the closure built. RECORDED '
+ 'EXACTLY, no bootstrap margin: this layer has never been gated, so the first new error in it should '
+ 'go red rather than be absorbed.',
+ 'exclusion to notice, and the test files in the sibling `test/` tree are read by nothing -- not '
+ '`pnpm --filter @objectstack/cli typecheck`, which exits 0 on this package today, not CI, only this '
+ 'ledger. 65 hidden files now, up from 56 at #7353 while the layer itself stayed frozen; the other 57 '
+ 'test files sit under `src` and always compiled, which is why the file count reads 65 and not 122. '
+ 'Lowered 188 -> 146 (#8612), both numbers measured on main at 35086781b with the closure built and '
+ 'the two import extensions as the ONLY difference between the two trees, so the -42 is FULLY '
+ 'ATTRIBUTED with no unexplained remainder: test/i18n-coverage.test.ts 35 -> 0 '
+ '(1 TS2835 + 34 TS7006) and test/i18n-extract.test.ts 7 -> 0 (1 TS2835 + 6 TS7006), from adding the '
+ '`.js` extension to one import each. Outside those two files the before and after diagnostic sets '
+ 'are identical line for line, and nothing new appeared anywhere. '
+ 'WHAT THE PILE IS NOW MADE OF, and it is not a nearly-graduated one: 57 of the 59 extension-less '
+ 'relative imports this layer carried are still there, spread over 24 files, and every one of the 60 '
+ 'surviving TS7006 sits in a file that also carries a TS2835 -- there is no implicit-any anywhere in '
+ 'this layer without a broken import above it. Read the top-of-ledger NodeNext note before sizing it: '
+ 'TS2835 plus the cascade it causes are 117 of the 146 and are 57 repairs, not 117. Concentrated '
+ 'rather than spread -- test/data-model-rules.test.ts x26, test/i18n-declared-surface-gate.test.ts '
+ 'x19, test/i18n-section-coverage.test.ts x18, test/commands.test.ts x15, '
+ 'test/remote-api-commands.test.ts x12 are 90 of it. '
+ 'One thing #8612 learned that the next extension fix here should expect: collapsing a cascade can '
+ 'EXPOSE errors rather than only remove them. Fixing the i18n-extract import took that file from 7 '
+ 'errors to 4 NEW TS2339, because it carried an `(e: { path: string[] })` parameter annotation '
+ 'written to dodge the implicit-any while the import was broken, and that annotation narrowed the '
+ 'real `ExpectedEntry` away; deleting the annotation took the file to 0. Those workaround '
+ 'annotations are part of this debt and are invisible to the count until the import above them '
+ 'resolves, so budget for a repair being bigger than its TS2835 line suggests. '
+ 'RECORDED EXACTLY, no bootstrap margin: this layer has never been gated, so the first new error in '
+ 'it should go red rather than be absorbed.',
},
'@objectstack/rest': {
errors: 155,
Expand Down
Loading