Repository navigation
fix(plugins): exclude scaffold tests from published packages - #129393
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 8:54 PM ET / September 17, 2026, 00:54 UTC (Revision 5). ClawSweeper reviewWhat this changesThe PR excludes independent tests from generated tool-plugin builds while preserving imported production modules, declarations, and feature-plugin browser checks. Merge readiness✅ Ready for maintainer review The fix remains necessary on current main and v2026.9.4. The refreshed patch preserves feature compilation, adds meaningful package-boundary coverage, and has no blocking correctness findings. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s plugin authoring CLI generates source files, build configuration, and package metadata. TypeScript compiler roots determine which files reach the distribution directory that npm packages. flowchart LR
A[Plugin init command] --> B[Scaffold type]
B --> C[Tool or provider entrypoint]
B --> D[Feature backend and browser sources]
C --> E[TypeScript compilation]
D --> E
E --> F[Distribution files]
F --> G[Published package]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource 0, Tests +56, Docs +4. Total +60 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep compiler-root selection in the scaffold owner so new tool packages contain their production module graph while feature browser sources remain checked. Do we have a high-confidence way to reproduce the issue? Yes, from source: generate a tool scaffold, compile its broad source glob, and inspect dist or the npm inventory for emitted test files. This review did not execute that flow. Is this the best way to solve the issue? Yes. Narrowing the generated tool compiler root fixes the producer directly, preserves imported helpers, and leaves provider and feature behavior intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4e44dbfb428a. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
374c943 to
b910862
Compare
|
Merged via squash.
|
…w#129393) * fix(plugins): exclude scaffold tests from published packages * fix(plugins): preserve feature compilation and verify scaffold packages
What Problem This Solves
Generated tool plugin builds compile their Vitest tests into
dist, which includes those development-only files in the published package.User Impact
Tool packages contain the production module graph and its declarations. Imported production helpers remain included, and feature scaffolds retain TypeScript checking for their separate browser entry.
Why This Change Was Made
Use the production entrypoint as the compiler root for tool and provider scaffolds. Preserve the feature scaffold's broader compiler roots: that scaffold was added after this PR and has a browser entry that the backend does not import.
Evidence
index.test.jsandindex.test.d.tsalongside the tool's production files.npm pack --dry-run --json --ignore-scripts --offlineinventories. Dependency-free consumer fixtures prove imported production helper output and tool declarations remain included while independent test files stay out of the package.b910862992b57217b6cf42031d75a142ea7b21a6: run 35167998221.