feat(dts)!: move temporary declarations to .rstack - #1895
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟡 Changes recommended
There are a couple of concrete correctness/backwards-compatibility issues (ensuring .rstack/declarations/.gitignore creation and keeping .rslib ignored to prevent accidental commits) that should be addressed before merging.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the declaration-bundling workflow to store temporary generated declaration files under .rstack/declarations (instead of .rslib/declarations), aligning with the .rstack directory while avoiding interference with other .rstack contents (hooks/cache), and documents the breaking change.
Changes:
- Move temp declaration output directory from
.rslib/declarationsto.rstack/declarationsacross code, tests, and docs. - Add unit coverage to ensure
.rstack/declarationscleanup doesn’t affect sibling.rstackcontents. - Update
.gitignorerules to ignore the new temp declaration directory.
File summaries
| File | Description |
|---|---|
| website/docs/zh/guide/upgrade/v0-to-v1.mdx | Documents the breaking directory move for temporary declaration files (ZH). |
| website/docs/zh/config/lib/dts.mdx | Updates .rslib/declarations references to .rstack/declarations (ZH). |
| website/docs/en/guide/upgrade/v0-to-v1.mdx | Documents the breaking directory move for temporary declaration files (EN). |
| website/docs/en/config/lib/dts.mdx | Updates .rslib/declarations references to .rstack/declarations (EN). |
| tests/scripts/shared.ts | Updates test helper to create temp declaration files under .rstack/declarations. |
| tests/integration/dts/isolated/index.test.ts | Updates expected stale temp declaration paths to .rstack/declarations. |
| tests/integration/dts/bundle/index.test.ts | Renames cleanup test to reflect new temp declaration location/intent. |
| tests/integration/dts-tsgo/bundle/index.test.ts | Renames cleanup test to reflect new temp declaration location/intent. |
| packages/plugin-dts/tests/utils.test.ts | Adds coverage ensuring .rstack/declarations management doesn’t touch sibling .rstack dirs. |
| packages/plugin-dts/src/utils.ts | Implements .rstack/declarations path and temp dir cleanup helpers. |
| packages/plugin-dts/src/index.ts | Updates cleanup comment to match new behavior. |
| packages/plugin-dts/README.md | Updates documentation to mention .rstack/declarations. |
| .gitignore | Switches ignore rule to .rstack/declarations. |
Review details
- Files reviewed: 12/13 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
.rslib/declarationsto.rstack/declarations, while preserving existing.rstackhooks and cache data..rslibdirectory can be safely removed after upgrading.Checklist