-
- Notifications
You must be signed in to change notification settings - Fork 1.3k
chore(build:dts): fix building dts on Windows #2552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for vue-router canceled.
|
WalkthroughReplaces a shell-based DTS append step with a Node.js script in the build:dts pipeline. Adds add-dts-module-augmentation.mjs to extract module augmentation from src/globalExtensions.ts and append it to dist/vue-router.d.ts after api-extractor runs. No public API signatures were changed. Changes
Sequence Diagram(s)sequenceDiagram autonumber participant Dev as npm script participant AE as api-extractor participant Script as add-dts-module-augmentation.mjs participant Src as src/globalExtensions.ts participant Dts as dist/vue-router.d.ts Dev->>AE: Run api-extractor (--local --verbose) AE-->>Dev: Emit vue-router.d.ts Dev->>Script: node add-dts-module-augmentation.mjs Script->>Src: Read file alt Marker found (/**) Script->>Dts: Read current contents Script->>Dts: Append augmentation block + newline Dts-->>Script: Write complete Script-->>Dev: Done else Marker missing Script-->>Dev: Throw Error("Augmentation marker not found") end Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## main #2552 +/- ## ======================================= Coverage 94.80% 94.80% ======================================= Files 34 34 Lines 3004 3004 Branches 846 846 ======================================= Hits 2848 2848 Misses 153 153 Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/router/add-dts-module-augmentation.js
(1 hunks)packages/router/package.json
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (1)
packages/router/add-dts-module-augmentation.js (1)
1-25
: Make patcher robust, idempotent, file‑relative — anchor on "declare module" (verified)
- Confirmed: packages/router/src/globalExtensions.ts contains a
declare module
block; use it as the primary anchor and fall back to the second/**
JSDoc if needed.- Change packages/router/add-dts-module-augmentation.js to:
- be idempotent (skip if augmentation already present),
- use file‑relative paths (compute dirname),
- use consistent "utf8" encoding, avoid trailing-space noise, and ensure safe newline separation,
- add top‑level .catch that logs the stack and sets process.exitCode = 1.
- Verify module system in packages/router/package.json ("type"): if ESM, keep import syntax and compute dirname via fileURLToPath(import.meta.url); if CJS, convert the script to .cjs or use require.
the tail is no longer there 🎉 |
Replaced
tail -n +10
with node script to allow generate dts on Windows.Summary by CodeRabbit