fix: add a files allowlist so packages stop shipping their tests - #434
ianwremmel-ai-agent wants to merge 4 commits into
Conversation
Plan
Review triage, round 2Acted on:
Dismissed:
Conflict resolution, 2026-09-09
Regenerating produced exactly one delta — Green on the merged tree: |
Pre-push review triageTwo adversarial passes on Codex (GPT-5.x), one spec-aware and one spec-blind. Two findings, both dismissed: Yarn Classic ignores the
VerificationPer package, against a staged copy with a synthetic
|
|
View your CI Pipeline Execution ↗ for commit f5f7ffa
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #434 +/- ##
=======================================
Coverage 60.64% 60.64%
=======================================
Files 28 28
Lines 1601 1601
Branches 354 363 +9
=======================================
Hits 971 971
Misses 626 626
Partials 4 4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Blocked on a red
|
|
Re-ran the five failed
The three options in my previous comment stand unchanged. Still waiting on a |
The escalation has an answer: hold behind CLC-1138My two previous comments asked whether to merge red, hold, or fold a #437 is still draft and red, so nothing here can go green yet. When it merges I Current state of this head (
|
No package declared `files`, and the root `.npmignore` excludes only `node_modules`, so every tarball carried whatever was on disk: test files, `__snapshots__`, `tsconfig.json`, and `dist/tsconfig.tsbuildinfo`. The `@clc/nx:package-json` executor now writes a `files` allowlist, and the 35 package.json files it owns are regenerated. `src` is published for every package rather than only the ten that serve `./src/index.mjs` as their `import` condition. `tsconfig.references.json` sets `declarationMap` and tsc does not inline sources, so every `dist/types/*.d.ts.map` points at `../../src/*`; dropping `src` from the `.ts`-source packages would leave those maps dangling. The tests inside `src` are excluded by pattern instead. Two packages publish a root asset that no project `type` implies: `foundation-intermediate-representation/schema.graphqls`, which `.graphqlrc.js` loads straight out of `node_modules`, and `foundation-plugin-cloudformation/json-schemas`. A new `extraFiles` option carries them; `create-nodes.mjs` detects them the same way it already detects `src/index.mjs` and `.foundationrc.*`, so the value is part of the nx cache key. Verified per package against a staged copy with a synthetic version: `npm pack --dry-run` drops nothing but tests, `__snapshots__`, `tsconfig.json` and `*.tsbuildinfo`, and still lists every target named by `exports`, `bin` and `executors.json`. `publint` no longer reports internal test or config files for any package.
6eda895 to
92a5333
Compare
Rebased onto current
|
The hold behind CLC-1138 has no automatic end, so I am handing this backNothing about this branch has changed since the rebase to The chain under this PR:
So the thing this PR waits for waits on a thing that waits on a human. Every What needs a decisionOne of:
I am not choosing between these; both are operator calls. State of this branch, unchanged and complete
The branch and its worktree stay in place. A resumed run picks this up from the |
…allowlist-so-packages-stop-shipping-their-tests
|
Merged The five Main replaced that script in 9cb01ad. The branch now carries the fixed version Because main had concurrently edited the two files this change touches
Two adversarial review passes ran on the merge result. Both findings are
Verification that the allowlist keeps what it must: |
Green and ready for reviewEvery check on
No Copilot review: What this changes
Verified against all three |
There was a problem hiding this comment.
🟢 Approval recommended
The changes consistently introduce a files allowlist via the generator/executor pathway and include the needed escape hatch for package-root schema assets without introducing behavioral risk beyond publish contents.
Pull request overview
Adds an npm publish allowlist (files) across the repo’s packages by teaching the @clc/nx:package-json executor to emit a consistent files list (and a small “extra files” escape hatch), then regenerating all managed package.json files so published tarballs stop including tests, snapshots, tsconfig files, and *.tsbuildinfo artifacts.
Changes:
- Extend
@clc/nx:package-jsonto write afilesallowlist (plusextraFilessupport) and exclude*.test.*,__snapshots__, and*.tsbuildinfo. - Update Nx node generation to pass
extraFilesfor packages that must publish package-root schema inputs. - Regenerate package manifests to include the new
filesallowlist (and required tool/cli ancillary files).
File summaries
| File | Description |
|---|---|
| packages/@code-like-a-carpenter/workbench-config/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/wait-for/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/tooling-common/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/tool-tool/package.json | Adds files allowlist including Nx tool assets (executors.json, tools/). |
| packages/@code-like-a-carpenter/tool-stack/package.json | Adds files allowlist including Nx tool assets (executors.json, tools/). |
| packages/@code-like-a-carpenter/tool-json-schema/package.json | Adds files allowlist including Nx tool assets (executors.json, tools/). |
| packages/@code-like-a-carpenter/tool-inliner/package.json | Adds files allowlist including Nx tool assets (executors.json, tools/). |
| packages/@code-like-a-carpenter/tool-foundation/package.json | Adds files allowlist including Nx tool assets (executors.json, tools/). |
| packages/@code-like-a-carpenter/tool-deps/package.json | Adds files allowlist including Nx tool assets (executors.json, tools/). |
| packages/@code-like-a-carpenter/telemetry/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/sentry/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/parallel/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/logger/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/lambda-handlers/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/interact/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/graphql-codegen-helpers/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/foundation-transform-environment/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/foundation-runtime/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/foundation-plugin-typescript/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/foundation-plugin-cloudformation/package.json | Adds files allowlist including json-schemas/ for published schemas. |
| packages/@code-like-a-carpenter/foundation-parser/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/foundation-intermediate-representation/package.json | Adds files allowlist including schema.graphqls in published output. |
| packages/@code-like-a-carpenter/exception/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/errors/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/env/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/dotenv/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/contract-tests/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/cli/package.json | Adds files allowlist including cli.mjs for the published bin entrypoint. |
| packages/@code-like-a-carpenter/cli-plugin-example/package.json | Adds files allowlist including cli.mjs for the published bin entrypoint. |
| packages/@code-like-a-carpenter/cli-core/package.json | Adds files allowlist including cli.mjs for the published bin entrypoint. |
| packages/@code-like-a-carpenter/aws-env-loader/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@code-like-a-carpenter/assert/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@clc/test-helpers/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@clc/dependencies/package.json | Adds files allowlist to prevent publishing tests/build metadata. |
| packages/@clc/nx/src/create-nodes.mjs | Computes/passes extraFiles so package-root schema inputs survive the allowlist. |
| packages/@clc/nx/executors/package-json/schema.json | Adds extraFiles option to executor schema. |
| packages/@clc/nx/executors/package-json/schema.d.json.mts | Adds extraFiles typing/docs to executor options interface. |
| packages/@clc/nx/executors/package-json/executor.mjs | Writes pkg.files allowlist and supports extraFiles. |
Review details
- Files reviewed: 38/38 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…allowlist-so-packages-stop-shipping-their-tests # Conflicts: # packages/@clc/nx/src/create-nodes.mjs
Conflict with
|
Ticket: https://linear.app/code-like-a-carpenter/issue/CLC-1132/add-a-files-allowlist-so-packages-stop-shipping-their-tests
No package declares
files, and the root.npmignoreexcludes onlynode_modules, so every tarball carries whatever happens to be on disk — test files,__snapshots__,tsconfig.json, anddist/tsconfig.tsbuildinfo.This makes the
@clc/nx:package-jsonexecutor write afilesallowlist, and regenerates the 35 package.json files it owns.