Skip to content
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

Replace pnpm in README to selected package manager #6585

Open
Netail opened this issue Nov 26, 2023 · 20 comments · May be fixed by #6747
Open

Replace pnpm in README to selected package manager #6585

Netail opened this issue Nov 26, 2023 · 20 comments · May be fixed by #6747
Assignees
Labels
area: examples Improvements or additions to examples good first issue Good for newcomers pkg: create-turbo Issues related to npx create-turbo

Comments

@Netail
Copy link

Netail commented Nov 26, 2023

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

@Netail Netail added needs: triage New issues get this label. Remove it after triage story labels Nov 26, 2023
@NicholasLYang NicholasLYang added the good first issue Good for newcomers label Nov 27, 2023
@mehulkar
Copy link
Contributor

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

@mehulkar mehulkar added area: examples Improvements or additions to examples pkg: create-turbo Issues related to npx create-turbo and removed needs: triage New issues get this label. Remove it after triage labels Nov 27, 2023
@NicholasLYang
Copy link
Contributor

Agreed, I think this could be a really nice first issue

@DependerKumarSoni
Copy link

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

@mehulkar
Copy link
Contributor

mehulkar commented Dec 1, 2023

@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!

@tknickman
Copy link
Member

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.

@DependerKumarSoni
Copy link

@mehulkar
Thanks for assigning this issue to me.

Please let me know if I am thinking in the right direction:

  1. The user runs the npx create-turbo@latest command.
  2. There comes a prompt on the terminal to enter the project name, which later updates that name to the package.json.
  3. 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 add name to root package.json (or even specific workspaces, etc)

@anthonyshew
Copy link
Contributor

@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. 👍

@tknickman
Copy link
Member

@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!

@DependerKumarSoni
Copy link

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.

@anthonyshew
Copy link
Contributor

@DependerKumarSoni Letting AI give a better answer than I probably could myself: https://sdk.vercel.ai/s/vMcNAHx 😄

@DependerKumarSoni
Copy link

DependerKumarSoni commented Dec 8, 2023

@Netail
I've updated the code by implementing a regex-based replace statement.
PR link: #6747
Kindly share your feedback and suggest any additional improvements.

@DependerKumarSoni
Copy link

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.

@tknickman
Copy link
Member

@DependerKumarSoni to test locally you can run turbo build --filter=create-turbo... and then directly execute packages/create-turbo/dist/cli.js

@DependerKumarSoni
Copy link

@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: make
Exit 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_upcasting has 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 default

warning: 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 for turborepo-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 with RUST_BACKTRACE=1 environment 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: make
Exit status 2
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.
 >ELIFECYCLE  Command failed with exit code 1.

@DependerKumarSoni
Copy link

@tknickman
I have already pushed the updated code to #6747.
I request you to provide me with some feedback.

@anthonyshew anthonyshew removed the story label Feb 21, 2024
@Netail
Copy link
Author

Netail commented Jun 12, 2024

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

@anthonyshew
Copy link
Contributor

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!

@igAbhinav007
Copy link

I have submitted a pull request addressing this issue: #9632. Please feel free to review it, and let me know if any further changes are needed.

@Netail
Copy link
Author

Netail commented Dec 19, 2024

I think some kind of generator/transformer would be preferred instead of listing all possible options in the same codeblock. Something similar to @DependerKumarSoni 's PR

@igAbhinav007
Copy link

I've made a pull request(#9633) which I think will resolve this issue.

@anthonyshew anthonyshew linked a pull request Dec 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: examples Improvements or additions to examples good first issue Good for newcomers pkg: create-turbo Issues related to npx create-turbo
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants