-
-
Notifications
You must be signed in to change notification settings - Fork 0
Migrate package management from pnpm to Bun and refresh vulnerable dependencies #47
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: 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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -15,28 +15,27 @@ jobs: | |||||
| - name: Checkout code | ||||||
| uses: actions/checkout@v6 | ||||||
|
|
||||||
| - name: Setup pnpm | ||||||
| uses: pnpm/action-setup@v5 | ||||||
| - name: Setup Bun | ||||||
| uses: oven-sh/setup-bun@v2 | ||||||
| with: | ||||||
| version: 9.15.4 | ||||||
| bun-version: 1.3.11 | ||||||
|
|
||||||
| - name: Setup Node.js | ||||||
| uses: actions/setup-node@v6 | ||||||
| with: | ||||||
| node-version: '22' | ||||||
| cache: 'pnpm' | ||||||
|
|
||||||
| - name: Install dependencies | ||||||
| run: pnpm install --frozen-lockfile | ||||||
| run: bun install | ||||||
|
||||||
| run: bun install | |
| run: bun install --frozen-lockfile |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -13,32 +13,31 @@ jobs: | |||||
| - name: Checkout code | ||||||
| uses: actions/checkout@v6 | ||||||
|
|
||||||
| - name: Setup pnpm | ||||||
| uses: pnpm/action-setup@v5 | ||||||
| - name: Setup Bun | ||||||
| uses: oven-sh/setup-bun@v2 | ||||||
| with: | ||||||
| version: 9.15.4 | ||||||
| bun-version: 1.3.11 | ||||||
|
|
||||||
| - name: Setup Node.js | ||||||
| uses: actions/setup-node@v6 | ||||||
| with: | ||||||
|
Comment on lines
13
to
23
|
||||||
| node-version: '22' | ||||||
| cache: 'pnpm' | ||||||
|
|
||||||
| - name: Install dependencies | ||||||
| run: pnpm install --frozen-lockfile | ||||||
| run: bun install | ||||||
|
||||||
| run: bun install | |
| run: bun install --frozen-lockfile |
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -34,10 +34,9 @@ RUN apk update && apk upgrade && \ | |||||||||||
| apk add --no-cache dumb-init && \ | ||||||||||||
| rm -rf /var/cache/apk/* | ||||||||||||
|
|
||||||||||||
| # Enable and install pnpm via corepack | ||||||||||||
| # Note: Version must match packageManager field in package.json (currently 9.15.4) | ||||||||||||
| RUN corepack enable && \ | ||||||||||||
| corepack prepare pnpm@9.15.4 --activate | ||||||||||||
| # Install Bun for dependency management | ||||||||||||
| # Note: Version must match packageManager field in package.json (currently 1.3.11) | ||||||||||||
| RUN npm install --global bun@1.3.11 | ||||||||||||
|
|
||||||||||||
|
Comment on lines
+37
to
40
|
||||||||||||
| # Set working directory for all subsequent stages | ||||||||||||
| WORKDIR /usr/src/app | ||||||||||||
|
|
@@ -51,10 +50,8 @@ FROM base AS deps | |||||||||||
| # Use bind mounts and cache for faster builds | ||||||||||||
| # Downloads dependencies without copying package files into the layer | ||||||||||||
| RUN --mount=type=bind,source=package.json,target=package.json \ | ||||||||||||
| --mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \ | ||||||||||||
| --mount=type=bind,source=.npmrc,target=.npmrc \ | ||||||||||||
| --mount=type=cache,id=s/${RAILWAY_SERVICE_ID}-pnpm-store,target=/root/.local/share/pnpm/store \ | ||||||||||||
| pnpm install --prod --frozen-lockfile | ||||||||||||
| --mount=type=cache,id=s/${RAILWAY_SERVICE_ID}-bun-cache,target=/root/.bun/install/cache \ | ||||||||||||
| bun install --production | ||||||||||||
|
|
||||||||||||
|
Comment on lines
52
to
55
|
||||||||||||
| # ============================================================================= | ||||||||||||
| # STAGE 3: Build Application | ||||||||||||
|
|
@@ -64,14 +61,12 @@ FROM deps AS build | |||||||||||
|
|
||||||||||||
| # Install all dependencies (including devDependencies for building) | ||||||||||||
| RUN --mount=type=bind,source=package.json,target=package.json \ | ||||||||||||
| --mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \ | ||||||||||||
| --mount=type=bind,source=.npmrc,target=.npmrc \ | ||||||||||||
| --mount=type=cache,id=s/${RAILWAY_SERVICE_ID}-pnpm-store,target=/root/.local/share/pnpm/store \ | ||||||||||||
| pnpm install --frozen-lockfile | ||||||||||||
| --mount=type=cache,id=s/${RAILWAY_SERVICE_ID}-bun-cache,target=/root/.bun/install/cache \ | ||||||||||||
| bun install | ||||||||||||
|
Comment on lines
+64
to
+65
|
||||||||||||
| --mount=type=cache,id=s/${RAILWAY_SERVICE_ID}-bun-cache,target=/root/.bun/install/cache \ | |
| bun install | |
| --mount=type=bind,source=bun.lockb,target=bun.lockb,readonly \ | |
| --mount=type=cache,id=s/${RAILWAY_SERVICE_ID}-bun-cache,target=/root/.bun/install/cache \ | |
| bun install --frozen-lockfile |
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.
actions/checkout@v6/actions/setup-node@v6are not valid released major versions, so this workflow will fail. Update them to supported majors (e.g., v4).