Skip to content

Commit 6fff5e5

Browse files
baozhoutaoclaude
andauthored
fix: keyed-text-bounds gate skips git-ignored tmp/, scaffold test moves under node_modules (#17421)
check:keyed-text-bounds walked packages/cli/tmp/, a git-ignored directory, so a scaffold test killed before its afterAll cleanup ran left behind an os-init-shaped .object.ts the gate cannot parse, redding the gate for a reason unrelated to the author's diff. - Add 'tmp' to SKIP_DIRS, the walk's existing filter point, alongside the other build/tooling-litter directories it already skips. The walk stays repo-wide minus SKIP_DIRS; only the skip list grew by one entry. - Move init-scaffold-authoring-rules.test.ts's scaffold temp root from this package's tmp/ to under its own node_modules/, matching the placement generate-scaffold-validates.test.ts already documents for the same @objectstack/spec resolution reason. node_modules is already skipped by the gate regardless of the SKIP_DIRS change above. The gate's refusal for an unrecognised declaration shape on a keyed column is unchanged -- this only narrows which files are walked. Claude-Session: https://claude.ai/code/session_012GKcPZbMoGq7WPzKLfRBTU Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5d527f7 commit 6fff5e5

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

‎packages/cli/test/init-scaffold-authoring-rules.test.ts‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,16 @@
3030
* (`writeTemplateSrcFiles`) and checked through the command's own self-test
3131
* (`validateScaffold`), so neither half can drift from what `init` really does.
3232
*
33-
* Temp projects are created under this package's git-ignored `tmp/` (not
34-
* `os.tmpdir()`) because the rendered config imports `@objectstack/spec`,
35-
* which only resolves where Node can walk up into this package's
36-
* `node_modules`. Keeping them out of `test/` also keeps generated `.ts` away
37-
* from any glob that collects sources.
33+
* Temp projects are created under this package's own `node_modules` (not
34+
* `os.tmpdir()`, and not this package's `tmp/`) because the rendered config
35+
* imports `@objectstack/spec`, which only resolves where Node can walk up
36+
* into this package's `node_modules` -- the same reasoning
37+
* `generate-scaffold-validates.test.ts` documents for its own materialized
38+
* scaffolds. `node_modules` is git-ignored and already excluded from every
39+
* source-walking gate, so a run killed before `afterAll` runs (a timeout, the
40+
* container's foreground cap, `ctrl-c`) leaves inert litter behind instead of
41+
* files a repo-wide scan can trip over. Keeping them out of `test/` also
42+
* keeps generated `.ts` away from any glob that collects sources.
3843
*/
3944

4045
import { describe, it, expect, afterAll } from 'vitest';
@@ -46,7 +51,7 @@ import { TEMPLATES, sanitizeNamespace, writeTemplateSrcFiles } from '../src/comm
4651
import { validateScaffold, SCAFFOLD_RULE_COMMAND } from '../src/utils/scaffold-validate.js';
4752

4853
const HERE = path.dirname(fileURLToPath(import.meta.url));
49-
const TMP_ROOT = path.resolve(HERE, '../tmp');
54+
const TMP_ROOT = path.resolve(HERE, '../node_modules/.init-scaffold-authoring-rules');
5055
const PROJECT_NAME = 'my-app';
5156

5257
const roots: string[] = [];

‎scripts/check-keyed-text-bounds.mjs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ const MIN_KEYED_TEXT_COLUMNS = 140;
359359

360360
const SKIP_DIRS = new Set([
361361
'.git', 'node_modules', 'dist', 'build', 'coverage', '.turbo', '.next', '.cache', '.changeset',
362+
'tmp',
362363
]);
363364

364365
/** Where shipped object declarations are discovered. */

0 commit comments

Comments
 (0)