Skip to content

Commit 7bf5c18

Browse files
committed
Add bun support, fix yarn install error
1 parent 2bf3458 commit 7bf5c18

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

.diploi/helm/app.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ spec:
4242
- /bin/sh
4343
- -c
4444
- |
45-
if [ -f yarn.lock ]; then
46-
yarn --frozen-lockfile || yarn install
45+
if [ -f bun.lock ]; then
46+
bun install --frozen-lockfile || bun install
47+
elif [ -f yarn.lock ]; then
48+
yarn install --frozen-lockfile || yarn install
4749
elif [ -f package-lock.json ]; then
4850
npm ci || npm install
4951
elif [ -f pnpm-lock.yaml ]; then

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ RUN corepack enable
1414
ENV PNPM_HOME="/pnpm"
1515
ENV PATH="$PNPM_HOME:$PATH"
1616

17+
COPY --from=oven/bun:1.3.11 /usr/local/bin/bun /usr/local/bin/bun
18+
1719
# Install dependencies only when needed
1820
FROM base AS deps
1921
ARG FOLDER
@@ -23,7 +25,8 @@ WORKDIR ${FOLDER}
2325

2426
# Install dependencies based on the preferred package manager
2527
RUN \
26-
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
28+
if [ -f bun.lockb ] || [ -f bun.lock ]; then bun install --frozen-lockfile || bun install;
29+
elif [ -f yarn.lock ]; then yarn install --frozen-lockfile || yarn install; \
2730
elif [ -f package-lock.json ]; then npm ci || npm i; \
2831
elif [ -f pnpm-lock.yaml ]; then pnpm i --frozen-lockfile || pnpm i; \
2932
else echo "Lockfile not found." && exit 1; \
@@ -37,7 +40,8 @@ WORKDIR ${FOLDER}
3740
COPY --from=deps ${FOLDER}/node_modules ./node_modules
3841

3942
RUN \
40-
if [ -f yarn.lock ]; then yarn run build; \
43+
if [ -f bun.lockb ] || [ -f bun.lock ]; then bun run build; \
44+
elif [ -f yarn.lock ]; then yarn run build; \
4145
elif [ -f package-lock.json ]; then npm run build; \
4246
elif [ -f pnpm-lock.yaml ]; then pnpm run build; \
4347
else echo "Lockfile not found." && exit 1; \

Dockerfile.dev

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ ENV PATH="$PNPM_HOME:$PATH"
1313
RUN mkdir -p /home/codespace/.pnpm-store /pnpm \
1414
&& chown -R 1000:1000 /home/codespace/.pnpm-store /pnpm
1515

16+
COPY --from=oven/bun:1.3.11 /usr/local/bin/bun /usr/local/bin/bun
17+
1618
COPY . /app
1719
WORKDIR ${FOLDER}
1820

0 commit comments

Comments
 (0)