diff --git a/.changeset/generated-at-any-depth.md b/.changeset/generated-at-any-depth.md new file mode 100644 index 00000000..0440245c --- /dev/null +++ b/.changeset/generated-at-any-depth.md @@ -0,0 +1,11 @@ +--- +"@taskless/cli": patch +--- + +The deprecated-path guard now skips `generated/` at any depth. + +`typeScriptSources` excluded only a top-level `src/generated`, so a nested +generated directory would have had every deprecated path in its transcript +reported as a call site. The exclusion exists because a generated directory is +the schema's own transcript rather than a call site, and that reasoning does not +depend on how deep it sits. diff --git a/packages/cli/test/api-deprecated-paths.test.ts b/packages/cli/test/api-deprecated-paths.test.ts index 61fcffa0..be97e040 100644 --- a/packages/cli/test/api-deprecated-paths.test.ts +++ b/packages/cli/test/api-deprecated-paths.test.ts @@ -58,8 +58,12 @@ async function typeScriptSources(directory: string): Promise { .map((entry) => join(entry.parentPath, entry.name)) .filter( // `generated/` is the schema's own transcript: it necessarily names every - // path, deprecated ones included, and is not a call site. - (file) => !relative(directory, file).startsWith(`generated${sep}`) + // path, deprecated ones included, and is not a call site. Matched at any + // depth, because that reasoning is about what a generated directory IS + // and does not depend on where it sits. `startsWith` reached only a + // top-level `src/generated`, which is a no-op today and would have + // reported a nested one as a wall of false offenders. + (file) => !relative(directory, file).split(sep).includes("generated") ); }