Replies: 17 comments 30 replies
-
We're aware of this limitation. Serializing to the binary Bun lockfile format is a non-trivial task and not imminently forthcoming. For now, if you want to use cd ./path/to/bun/project
bunx @turbo/workspaces@latest convert ./ yarn --skip-install
turbo prune If you don't want any of the automated changes to be permanent you can then proceed to revert all changes in the repository. Note that the output pruned repository must use the package manager you select ( |
Beta Was this translation helpful? Give feedback.
-
Doesn't bun support the yarn lockfile format? Why the need to switch package manager even after converting a bun.lockb to a yarn lockfile? P.S would love for this issue to get attention, this is the last blocker for us to move over to bun as our package manager. |
Beta Was this translation helpful? Give feedback.
-
Bun supports serializing the There's some chatter around |
Beta Was this translation helpful? Give feedback.
-
Bun supports a human readable lock file now Maybe an easy fix would be to have an option for turbo to read specific lock files the same way bun does |
Beta Was this translation helpful? Give feedback.
-
Is there any update on this guys? We would also like to use Turborepo alongside bun, but this issue is quite important for us. I'd be happy to help in any way I can |
Beta Was this translation helpful? Give feedback.
-
+1 to this problem |
Beta Was this translation helpful? Give feedback.
-
YES please 🙏 |
Beta Was this translation helpful? Give feedback.
-
I am also very interested in this being supported. My team would love to use bun alongside turbo but this is the main bottleneck preventing us from doing so. |
Beta Was this translation helpful? Give feedback.
-
This would be lot appreciated for us too. |
Beta Was this translation helpful? Give feedback.
-
This is the only thing blocking my company from switching to bun |
Beta Was this translation helpful? Give feedback.
-
I am unsure if this actually fixed the problem as I didnt have time to test that the lock file works. But what seemed to have worked for me was doing
(Dont mind the npm stuf it seems bun install -g does not really work inside docker for me because the it doesent seem to add the commands to path inside docker only) From what I understand the reason for this not being supported is that prune actually generates a new lockfile from the old one with only a certain package's dependencies in it and it cannot currently parse the .lockb format. Bun currently supports installing from lockb (and from package-lock.json if you are on canary as of this moment). Here is the open issue related to it supporting yarn.lock file: oven-sh/bun#6409. As soon as they support installing from a yarn.lock file this should become a non problem because bun install can generate a yarn.lock file with TLDR: (be on bun canary) => install with bun install -y always or add the I didnt yet have time to fully test this theory but if someone has time and manages to do so please let me know I would appreciate it alot. Otherwise I will try to come back to you when I properly pull this off ( which will take some time as I am new to docker and devops in general ). |
Beta Was this translation helpful? Give feedback.
-
@XenoWad01 any updates? |
Beta Was this translation helpful? Give feedback.
-
When deploying docker files to Fly.io, using a Turborepo, having the prune command makes life a lot easier. Especially as your monorepo grows in size |
Beta Was this translation helpful? Give feedback.
-
Bun supports yarn.lock for very long time. It is a shame that it is not supported in turbo =( |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
as a workaround, I am using
|
Beta Was this translation helpful? Give feedback.
-
For anyone looking for make this "work" in the run up to Bun adding their new JSON lock files (when turbo will add support) hopefully in Q3, you can use this approach. ARG BUN_VERSION=1.1.26
ARG YARN_PKG_MANAGER="this.packageManager=\"[email protected]\""
ARG BUN_PKG_MANAGER="this.packageManager=\"bun@${BUN_VERSION}\""
FROM oven/bun:${BUN_VERSION} as bun
WORKDIR /app
FROM oven/bun:${BUN_VERSION}-alpine as bun-alpine
WORKDIR /app
# ================= TURBO PRUNE ===================
FROM bun as pruned
ARG YARN_PKG_MANAGER
COPY . .
RUN bunx json -I -f package.json -e ${YARN_PKG_MANAGER}
RUN bunx turbo prune --scope="example-service" --docker
# =============== INSTALL & BUILD =================
FROM bun as builder
ARG BUN_PKG_MANAGER
COPY --from=pruned /app/out/full/ .
RUN bunx json -I -f package.json -e ${BUN_PKG_MANAGER}
RUN bun install --production
RUN bunx clean-modules -y "**/*.ts" "**/@types/**"
RUN bunx turbo build --filter="example-service..."
# ================== RELEASE ======================
FROM bun-alpine AS release
USER bun
COPY --from=builder /app .
EXPOSE 3000/tcp
WORKDIR /app/apps/example-service
ENTRYPOINT [ "bun", "dist/main.js" ] This is for a Nest.js monorepo with internal packages that aren't compiled. The build script in the
|
Beta Was this translation helpful? Give feedback.
-
Which project is this feature idea for?
Turborepo
Describe the feature you'd like to request
Support
turbo prune
when using bun.Describe the solution you'd like
Running
turbo prune
should work with bun the same as with npm.Describe alternatives you've considered
Not using bun or not using turbo
Beta Was this translation helpful? Give feedback.
All reactions