Skip to content

Commit

Permalink
fix(cli): auto-generate .yarnrc.yml to disable pnp for tsx support (#…
Browse files Browse the repository at this point in the history
…2003)

<!-- Please make sure there is an issue that this PR is correlated to. -->

## Changes

<!-- If there are frontend changes, please include screenshots. -->
  • Loading branch information
NathanFlurry committed Feb 8, 2025
1 parent 995d761 commit f7d5c49
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/toolchain/cli/src/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ impl Opts {
fs::write(project_path.join(script_name), script_body).await?;
fs::write(project_path.join(test_name), test_body).await?;

// Yarn P'n'P doesn't play nice with TSX and older Node versions (https://github.com/privatenumber/tsx/issues/166)
let yarnrc_body = "nodeLinker: node-modules\n";
fs::write(project_path.join(".yarnrc.yml"), yarnrc_body).await?;

let readme_body = readme_body.replace("__NAME__", &prompt.project_name);
fs::write(project_path.join("README.md"), readme_body).await?;

Expand Down

0 comments on commit f7d5c49

Please sign in to comment.