-
-
Notifications
You must be signed in to change notification settings - Fork 553
chore: migrate from Yarn to Bun #3020
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: feature/package-exports-dev
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -23,28 +23,18 @@ jobs: | |
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 24 | ||
|
|
||
| - name: Enable Corepack | ||
| run: corepack enable | ||
|
|
||
| - name: Cache Yarn dependencies | ||
| uses: actions/cache@v5 | ||
| with: | ||
| path: .yarn/cache | ||
| key: yarn-${{ hashFiles('**/yarn.lock') }} | ||
| restore-keys: | | ||
| yarn- | ||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v2 | ||
|
|
||
| - name: Install dependencies | ||
| run: yarn install --immutable | ||
| run: bun install --frozen-lockfile | ||
|
|
||
| - name: Run build | ||
| run: yarn build | ||
| run: bun run build | ||
|
|
||
| - name: Configure npm authentication | ||
| run: | | ||
| yarn config set npmRegistryServer "https://registry.npmjs.org" | ||
| yarn config set npmAuthToken ${{ secrets.NPM_TOKEN }} | ||
| echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc | ||
|
|
||
| - name: Fail if unsafe lifecycle scripts exist | ||
| run: | | ||
|
|
@@ -61,7 +51,15 @@ jobs: | |
| echo "No unsafe lifecycle scripts detected." | ||
|
|
||
| - name: Publish workspaces to npm | ||
| run: yarn workspaces foreach --all --no-private -v npm publish --access public --tolerate-republish | ||
| run: | | ||
| for pkg in packages/*/package.json; do | ||
| dir=$(dirname "$pkg") | ||
| if ! jq -e '.private' "$pkg" > /dev/null 2>&1 || [ "$(jq -r '.private' "$pkg")" = "false" ] || [ "$(jq -r '.private' "$pkg")" = "null" ]; then | ||
| echo "Publishing $(jq -r '.name' "$pkg")..." | ||
| cd "$dir" && npm publish --access public || true | ||
| cd - | ||
|
Comment on lines
+54
to
+60
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. 🧩 Analysis chain🏁 Script executed: find . -name "release-publish.yaml" -o -name "release-publish.yml" | head -20Repository: orval-labs/orval Length of output: 100 🏁 Script executed: cat -n .github/workflows/release-publish.yaml | head -80Repository: orval-labs/orval Length of output: 3252 🏁 Script executed: # Verify there are no other error handlers or conditions after the publish step
cat -n .github/workflows/release-publish.yaml | sed -n '53,80p'Repository: orval-labs/orval Length of output: 1309 🏁 Script executed: # Check if there are any on-error handlers or continue-on-error flags
grep -n "continue-on-error\|if:\|on-error" .github/workflows/release-publish.yamlRepository: orval-labs/orval Length of output: 174 Don't swallow publish failures. 🔧 Suggested fix - name: Publish workspaces to npm
run: |
+ failed=0
for pkg in packages/*/package.json; do
dir=$(dirname "$pkg")
if ! jq -e '.private' "$pkg" > /dev/null 2>&1 || [ "$(jq -r '.private' "$pkg")" = "false" ] || [ "$(jq -r '.private' "$pkg")" = "null" ]; then
echo "Publishing $(jq -r '.name' "$pkg")..."
- cd "$dir" && npm publish --access public || true
- cd -
+ if ! (cd "$dir" && npm publish --access public); then
+ echo "Publish failed for $(jq -r '.name' "$pkg")"
+ failed=1
+ fi
fi
done
+ exit $failed🤖 Prompt for AI Agents |
||
| fi | ||
| done | ||
|
|
||
| - name: Extract version | ||
| id: version | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| yarn commitlint --edit | ||
| bun run commitlint --edit |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1 +1 @@ | ||||||||||||
| yarn format:staged | ||||||||||||
| bun run format:staged | ||||||||||||
|
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. Restore Husky shim/shebang to keep hooks reliable. 🔧 Suggested fix+#!/usr/bin/env sh
+. "$(dirname -- "$0")/_/husky.sh"
+
bun run format:staged📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ node_modules | |
| **/dist | ||
| .husky | ||
| mockServiceWorker.js | ||
| yarn.lock | ||
| bun.lockb | ||
| .svelte-kit | ||
| .prettierignore | ||
|
|
||
|
|
||
This file was deleted.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: orval-labs/orval
Length of output: 1783
Verify version bump coverage for all intended workspaces.
The loop only covers
packages/*/package.jsonand the root, but the workspace configuration defines three globs:packages/*,samples/**, andtests. This misses:samples/(e.g.,samples/hono/hono-with-fetch-client/hono-app/package.json)tests/package.jsonworkspaceUse
find . -name package.json -not -path '*/node_modules/*'to ensure all workspaces are version-bumped, or derive the list from theworkspacesfield inpackage.json.🤖 Prompt for AI Agents