chore: typescript build file - #130
Conversation
- converted the `build.js` configuration file of the extension to a `build.ts` file, which is also type checked (tsconfig) - migrated to `tsx` to run that file instead of `node`, installed `tsx` as a dev dependency
- fixed the broken version badge in the readme of the vscode extension
- added the instructions language slug in the colors.json file to properly display them in the frontend (dashboard), same color as markdown files
- bumped the extension version to `v0.0.62`
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 39 minutes and 41 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR updates the VS Code extension's build infrastructure and standardizes module imports: converting the build script from CommonJS to ES modules, switching npm build scripts to use tsx for TypeScript execution, updating TypeScript dependencies, standardizing vscode imports across 14 utility files from namespace to default import style, updating documentation, and adding a new color configuration entry. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/vscode-extension/package.json (1)
115-118: Dropnpx— calltsxdirectly from the npm script.Since
tsxis already declared indevDependencies, npm scripts resolve it fromnode_modules/.binwithout needingnpx. Usingnpxadds a per-invocation lookup/install check and, in some npm configurations, can fall through to fetching from the registry if the local binary isn't found. Callingtsxdirectly is faster and more deterministic forcompile,watch, andpackage.♻️ Proposed change
- "compile": "npx tsx build.ts", + "compile": "tsx build.ts", "build": "tsc --build", - "watch": "npx tsx build.ts --watch", - "package": "npx tsx build.ts --production", + "watch": "tsx build.ts --watch", + "package": "tsx build.ts --production",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/vscode-extension/package.json` around lines 115 - 118, Update the npm scripts "compile", "watch", and "package" to invoke the local tsx binary directly instead of prefixing with npx; specifically remove the "npx " prefix from the "compile", "watch", and "package" script values so they call "tsx build.ts", "tsx build.ts --watch", and "tsx build.ts --production" respectively, relying on the devDependency-resolved binary.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/vscode-extension/build.ts`:
- Line 154: The esbuild config currently sets target: "esnext" which can emit
unsupported runtime features for VS Code's Electron/Node; update the build
configuration in build.ts where the esbuild build options include target to use
a pin compatible with VS Code's runtime (replace "esnext" with "node22") so
esbuild will downlevel syntax to match Node 22.21.1/Electron 34; ensure this
aligns with tsconfig (ES2022) and adjust any other esbuild option blocks that
reference target to the same "node22" value.
---
Nitpick comments:
In `@apps/vscode-extension/package.json`:
- Around line 115-118: Update the npm scripts "compile", "watch", and "package"
to invoke the local tsx binary directly instead of prefixing with npx;
specifically remove the "npx " prefix from the "compile", "watch", and "package"
script values so they call "tsx build.ts", "tsx build.ts --watch", and "tsx
build.ts --production" respectively, relying on the devDependency-resolved
binary.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2567cdde-ae79-43bd-99cd-6584ee652871
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (17)
apps/vscode-extension/README.mdapps/vscode-extension/build.tsapps/vscode-extension/package.jsonapps/vscode-extension/src/utils/auth/login.tsapps/vscode-extension/src/utils/auth/store-jwt-token.tsapps/vscode-extension/src/utils/commands/init-extension-commands.tsapps/vscode-extension/src/utils/dashboard/open-dashboard.tsapps/vscode-extension/src/utils/dashboard/serve-dashboard/serve-dashboard-dev.tsapps/vscode-extension/src/utils/dashboard/serve-dashboard/serve-dashboard-prod.tsapps/vscode-extension/src/utils/dashboard/serve-dashboard/serve-dashboard.tsapps/vscode-extension/src/utils/files/get-current-file-properties.tsapps/vscode-extension/src/utils/files/update-current-file-obj.tsapps/vscode-extension/src/utils/global-state/get-global-state-data.tsapps/vscode-extension/src/utils/periodic-sync-data.tsapps/vscode-extension/src/utils/time/calculate-time.tsapps/vscode-extension/tsconfig.jsonpackages/ui/src/colors.json
- switched the target to `node22` in the `build.ts` esbuild configuration file
Commits
chore: typescript build file
build.jsconfiguration file of the extension to abuild.tsfile, which is also type checked (tsconfig)tsxto run that file instead ofnode, installedtsxas a dev dependencyfix: badge
feat: instructions identification
chore: extension version
v0.0.62Summary by CodeRabbit
Release Notes
Chores
Documentation
New Features