-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: migrate from npm to Bun #1629
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
base: next
Are you sure you want to change the base?
Changes from all commits
906731c
b9e429a
9b3fc96
f6bacd0
28ef5d0
83f65c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| #!/usr/bin/env node | ||
| import assert from 'node:assert/strict'; | ||
| import { spawnSync } from 'node:child_process'; | ||
| import { readFileSync } from 'node:fs'; | ||
| import { dirname, join } from 'node:path'; | ||
| import { fileURLToPath } from 'node:url'; | ||
|
|
@@ -30,4 +31,22 @@ assert(pkg.version, 'package.json must have a version field'); | |
| const tag = `${pkg.name}@${pkg.version}`; | ||
|
|
||
| // Create and push the tag if it doesn't exist | ||
| createAndPushTag(tag); | ||
| const tagCreated = createAndPushTag(tag); | ||
|
|
||
| // Trigger extension release workflow via workflow_dispatch | ||
| // (push events from GITHUB_TOKEN don't trigger workflows, but workflow_dispatch does) | ||
| if (tagCreated) { | ||
| console.log(`Triggering extension-release workflow for ${tag}...`); | ||
| const result = spawnSync( | ||
| 'gh', | ||
| ['workflow', 'run', 'extension-release.yml', '--ref', tag], | ||
| { encoding: 'utf8', stdio: 'inherit' } | ||
| ); | ||
| if (result.status === 0) { | ||
| console.log(`β Triggered extension release workflow for ${tag}`); | ||
| } else { | ||
| console.warn( | ||
| `β οΈ Failed to trigger extension release workflow (non-critical)` | ||
| ); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extension publish failure is silently ignoredMedium Severity
Additional Locations (1) |
||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Workflow dispatch lacks required
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ env: | |
| DO_NOT_TRACK: 1 | ||
| NODE_ENV: development | ||
| NODE_VERSION: 20 | ||
| BUN_VERSION: 1.3.12 | ||
|
|
||
| jobs: | ||
| # Single install job that caches node_modules for all other jobs | ||
|
|
@@ -32,16 +33,20 @@ jobs: | |
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
|
|
||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: ${{ env.BUN_VERSION }} | ||
|
|
||
| - name: Cache node_modules | ||
| id: cache-node-modules | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: node_modules | ||
| key: node-modules-${{ runner.os }}-node${{ env.NODE_VERSION }}-${{ hashFiles('package-lock.json') }} | ||
| key: node-modules-${{ runner.os }}-bun${{ env.BUN_VERSION }}-${{ hashFiles('bun.lock') }} | ||
|
|
||
| - name: Install dependencies | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| run: npm ci | ||
| run: bun install | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CI no longer enforces lockfile consistencyMedium Severity Replacing Additional Locations (2) |
||
| timeout-minutes: 5 | ||
|
|
||
| # Fast checks that can run in parallel | ||
|
|
@@ -56,20 +61,24 @@ jobs: | |
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
|
|
||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: ${{ env.BUN_VERSION }} | ||
|
|
||
| - name: Restore node_modules cache | ||
| id: cache-node-modules | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: node_modules | ||
| key: node-modules-${{ runner.os }}-node${{ env.NODE_VERSION }}-${{ hashFiles('package-lock.json') }} | ||
| key: node-modules-${{ runner.os }}-bun${{ env.BUN_VERSION }}-${{ hashFiles('bun.lock') }} | ||
|
|
||
| - name: Install dependencies | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| run: npm ci | ||
| run: bun install | ||
| timeout-minutes: 5 | ||
|
|
||
| - name: Format Check | ||
| run: npm run format-check | ||
| run: bun run format-check | ||
| env: | ||
| FORCE_COLOR: 1 | ||
|
|
||
|
|
@@ -93,7 +102,6 @@ jobs: | |
| if: steps.changes.outputs.changesets == 'true' | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: "npm" | ||
|
|
||
| - name: Validate changeset package references | ||
| if: steps.changes.outputs.changesets == 'true' | ||
|
|
@@ -116,20 +124,24 @@ jobs: | |
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
|
|
||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: ${{ env.BUN_VERSION }} | ||
|
|
||
| - name: Restore node_modules cache | ||
| id: cache-node-modules | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: node_modules | ||
| key: node-modules-${{ runner.os }}-node${{ env.NODE_VERSION }}-${{ hashFiles('package-lock.json') }} | ||
| key: node-modules-${{ runner.os }}-bun${{ env.BUN_VERSION }}-${{ hashFiles('bun.lock') }} | ||
|
|
||
| - name: Install dependencies | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| run: npm ci | ||
| run: bun install | ||
| timeout-minutes: 5 | ||
|
|
||
| - name: Typecheck | ||
| run: npm run turbo:typecheck | ||
| run: bun run turbo:typecheck | ||
| env: | ||
| FORCE_COLOR: 1 | ||
|
|
||
|
|
@@ -145,20 +157,24 @@ jobs: | |
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
|
|
||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: ${{ env.BUN_VERSION }} | ||
|
|
||
| - name: Restore node_modules cache | ||
| id: cache-node-modules | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: node_modules | ||
| key: node-modules-${{ runner.os }}-node${{ env.NODE_VERSION }}-${{ hashFiles('package-lock.json') }} | ||
| key: node-modules-${{ runner.os }}-bun${{ env.BUN_VERSION }}-${{ hashFiles('bun.lock') }} | ||
|
|
||
| - name: Install dependencies | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| run: npm ci | ||
| run: bun install | ||
| timeout-minutes: 5 | ||
|
|
||
| - name: Build | ||
| run: npm run turbo:build | ||
| run: bun run turbo:build | ||
| env: | ||
| NODE_ENV: production | ||
| FORCE_COLOR: 1 | ||
|
|
@@ -186,16 +202,20 @@ jobs: | |
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
|
|
||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: ${{ env.BUN_VERSION }} | ||
|
|
||
| - name: Restore node_modules cache | ||
| id: cache-node-modules | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: node_modules | ||
| key: node-modules-${{ runner.os }}-node${{ env.NODE_VERSION }}-${{ hashFiles('package-lock.json') }} | ||
| key: node-modules-${{ runner.os }}-bun${{ env.BUN_VERSION }}-${{ hashFiles('bun.lock') }} | ||
|
|
||
| - name: Install dependencies | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| run: npm ci | ||
| run: bun install | ||
| timeout-minutes: 5 | ||
|
|
||
| - name: Download build artifacts | ||
|
|
@@ -205,8 +225,7 @@ jobs: | |
| path: dist/ | ||
|
|
||
| - name: Run Tests | ||
| run: | | ||
| npm run test:coverage -- --coverageThreshold '{"global":{"branches":0,"functions":0,"lines":0,"statements":0}}' --detectOpenHandles --forceExit | ||
| run: bun run turbo:test | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CI tests silently drop coverage collectionMedium Severity The CI test command changed from Additional Locations (1)Reviewed by Cursor Bugbot for commit 83f65c2. Configure here. |
||
| env: | ||
| NODE_ENV: test | ||
| CI: true | ||
|
|
||


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.
Extension release failures are silently ignored
Medium Severity
When
gh workflow runfails,tag-extension.mjsonly logs a warning and continues. Since tag pushes created byGITHUB_TOKENdo not trigger workflows, this can completerelease.mjssuccessfully while skippingextension-release.yml, leaving the extension unpublished with no failing CI signal.