Replace pnpm in README to selected package manager
Which project is this feature idea for?
Turborepo
Describe the feature you'd like to request
Replace the pnpm commands in the README from the basic turborepo example (which is used by npx create-turbo@latest) with the selected package manager from the CLI command
Describe the solution you'd like
Replace the pnpm commands in the README with the selected package manager
Describe alternatives you've considered
List commands for all package managers in the README
This could be as simple as modifying the README, or only including a template README with placeholders that gets processed by create-turbo. Could open up the ability to let the user add name to root package.json (or even specific workspaces, etc). cc @anthonyshew
Agreed, I think this could be a really nice first issue
Hi Team,
I feel interested in this good first issue and want to begin my open-source contribution with TurboRepo. Will you please assign this to me?
Please let me know if this is the place where the feature is requested: https://github.com/vercel/turbo/tree/main/examples/basic
with regards, Depender K. Soni
@DependerKumarSoni yes, that's the right place along with the create-turbo package source code: https://github.com/vercel/turbo/tree/main/packages/create-turbo
I'll assign to you, thank you!
I think the best way to do this would be a new transformer here: https://github.com/vercel/turbo/tree/main/packages/create-turbo/src/transforms
It could go into the package manager transformer as well, but I wouldn't be opposed to keeping that isolated and making a new, docs related transformer.
@mehulkar Thanks for assigning this issue to me.
Please let me know if I am thinking in the right direction:
- The user runs the
npx create-turbo@latestcommand. - There comes a prompt on the terminal to enter the project name, which later updates that name to the package.json.
- Another prompt asks for the package manager (npm, pnpm, yarn, bun) and updates the README.md file accordingly.
This could be as simple as modifying the README, or only including a template README with placeholders that get processed by
create-turbo. Could open up the ability to let the user addnameto root package.json (or even specific workspaces, etc)
@DependerKumarSoni, I'd recommend keeping your PR as small as possible. Let's focus it on getting the README transform done.
We won't need to any more prompts than what create-turbo does today. The existing "Select a package manager" step should tell the transform how to update the README commands.
The other work Mehul has mentioned has some design implications that I'd like to think about more deeply so let's keep that as future work. 👍
@DependerKumarSoni we already add the specified name to the root package.json for the basic example, so that doesn't need to be done. That's handled here: https://github.com/vercel/turbo/blob/main/packages/create-turbo/src/transforms/official-starter.ts#L56C20-L60
We discussed doing this for all examples, but originally decided against it. If we want to change that in the future it's a simple change here!
I've made some changes to the code that I believe should work fine. Could you please guide me on how best to test it? As per https://github.com/vercel/turbo/tree/main/packages/create-turbo, I pushed the code to Github in my forked repo. But didn't understand how to proceed further.
@DependerKumarSoni Letting AI give a better answer than I probably could myself: https://sdk.vercel.ai/s/vMcNAHx 😄
@Netail I've updated the code by implementing a regex-based replace statement. PR link: https://github.com/vercel/turbo/pull/6747 Kindly share your feedback and suggest any additional improvements.
Hi team, PR #6747 has a rust-docs failure. Can you share details on the issues and any improvements needed? Also, there's a 'Code owner review required' message – guidance on the next steps would be great.
@DependerKumarSoni to test locally you can run turbo build --filter=create-turbo... and then directly execute packages/create-turbo/dist/cli.js
@tknickman I tried running turbo build --filter=create-turbo... but it shows the following error:
maccy@Dependers-MacBook-Pro turbo % pnpm run build --filter=create-turbo...
[email protected] build pnpm -- turbo run build --filter=docs
[email protected] turbo /Users/maccy/Desktop/GitHub/turbo pnpm run build:turbo && node turbow.js "run" "build" "--filter=docs"
[email protected] build:turbo /Users/maccy/Desktop/GitHub/turbo pnpm run --filter=cli build
[email protected] build /Users/maccy/Desktop/GitHub/turbo/cli make
/bin/sh: go: command not found /bin/sh: go: command not found cargo build -p turbo make: cargo: No such file or directory make: *** [turbo] Error 1 /Users/maccy/Desktop/GitHub/turbo/cli: >ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL [email protected] build:
makeExit status 2 >ELIFECYCLE Command failed with exit code 1. ELIFECYCLE Command failed with exit code 1.
Then I created a new git clone of my forked repo and ran the same command after pnpm install. Got this:
/bin/sh: go: command not found /bin/sh: go: command not found cargo build -p turbo Compiling zstd-safe v6.0.5+zstd.1.5.4 Compiling zstd-sys v2.0.8+zstd.1.5.5 Compiling libgit2-sys v0.14.2+1.5.1 warning: the feature
trait_upcastinghas been stable since 1.76.0-nightly and no longer requires an attribute to enable --> crates/turborepo-lockfiles/src/lib.rs:1:12 | 1 | #![feature(trait_upcasting)] | ^^^^^^^^^^^^^^^ | = note:#[warn(stable_features)]on by defaultwarning:
turborepo-lockfiles(lib) generated 1 warning Compiling turborepo-lib v0.1.0 (/Users/maccy/Desktop/GitHub/turbo/crates/turborepo-lib) Compiling tracing-appender v0.2.2 error: failed to run custom build command forturborepo-lib v0.1.0 (/Users/maccy/Desktop/GitHub/turbo/crates/turborepo->lib)Caused by: process didn't exit successfully:
/Users/maccy/Desktop/GitHub/turbo/target/debug/build/turborepo-lib->36cc3e6c1d12a8d6/build-script-build(exit status: 101) --- stdout cargo:rerun-if-changed=turbod.proto cargo:rerun-if-changed=../../cli/internal/turbodprotocol--- stderr thread 'main' panicked at crates/turborepo-lib/build.rs:34:23: schema compiler command: Error { kind: Failed, extra: "Failed to execute
capnp --version: No such file or directory (os >error 2). Please verify that version 0.5.2 or higher of the capnp executable is installed on your system. See >https://capnproto.org/install.html" } note: run withRUST_BACKTRACE=1environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... make: *** [turbo] Error 101 /Users/maccy/Desktop/GitHub/turbo/cli: ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL [email protected] build:makeExit status 2 ELIFECYCLE Command failed with exit code 1. ELIFECYCLE Command failed with exit code 1. >ELIFECYCLE Command failed with exit code 1.
@tknickman I have already pushed the updated code to #6747. I request you to provide me with some feedback.
Any update on this? I see the story label got removed, but when generating a new turbo repo with npx create-turbo it still show pnpm dev in the develop section while I selected a different package manager
It looks like #6747 is close but has stalled.
@DependerKumarSoni, are you still able to work on it? Apologies for the delays on our side. Tom is on parental leave!