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

Setting up via create-turbo should have yarn checks #241

Closed
ShubhamKushwah opened this issue Dec 13, 2021 · 4 comments · Fixed by #255
Closed

Setting up via create-turbo should have yarn checks #241

ShubhamKushwah opened this issue Dec 13, 2021 · 4 comments · Fixed by #255
Labels
good first issue Good for newcomers

Comments

@ShubhamKushwah
Copy link

ShubhamKushwah commented Dec 13, 2021

Describe the feature you'd like to request

Scenario:
Uninstall yarn completely from the system, and run

npx create-turbo@latest yourapp

It will fail at the second step where it should install the packages via yarn. Because yarn isn't there.

And it gives an unhelpful error:

Installing dependencies...
  Aborting installation.
    yarn install has failed.

Describe the solution you'd like

Instead of giving that error, there can be 3 approaches:

  1. Tell the user exactly that yarn isn't found on their system, so either set up the project using npm. Just make it like: Press Y to setup with npm instead, or they can quit and restart with npm.
  2. the Second approach would be to say: Command yarn not found. Press 1 to install it, or press 2 to set up with npm instead.
  3. Third way would be to simply install yarn automatically. Just put a message saying Installing yarn...

Describe alternatives you've considered

The alternative is to understand why yarn install would fail, which could be because of many reasons I guess. Then figure out that you don't have yarn installed, so install it first, then go back to the Turborepo setup.

@jaredpalmer
Copy link
Contributor

Agree

@m19c
Copy link

m19c commented Dec 14, 2021

I would like to work on it.

@iDarkLightning
Copy link

I am getting this exact same issue for NPM as well, npm install has failed as opposed to yarn install has failed.

@fkapsahili
Copy link

In my case this was the error when I ran yarn install after bootstrapping:
error turborepo-basic-shared@0.0.0: The engine "node" is incompatible with this module. Expected version ">=14.0.0". Got "12.16.2"

So i had to update Node.js.

sokra pushed a commit that referenced this issue Oct 25, 2022
This implements snapshot testing, which writes all chunks to the filesystem. Hopefully these'll be a little quicker to test than the evaluation tests, which require us to spin up a browser to execute. The snapshots will detect if a file is expected (in the output dir) but it's not output by turbopack, if a file is output but was not expected, or if the contents has changed.

It also supports a `TURBOPACK_SNAPSHOT_UPDATE=1` env, which will pass all tests, update all files to the latest outputs, and delete any files that shouldn't exist.

The test structure follows a `*/*/input` directory structure. Eg,
```
large-feature-group
└── explicit-feature
    ├── input
    │   └── index.js
    │   └── any-other-files...
    │   └── node_modules/...
    └── output
        └── snapshot_large_feature_group_explicit_feature_input_index.js
        └── snapshot_large_feature_group_explicit_feature_input_node_modules_foo_index.js.js
```

The `*/*/output` is the output chunks we expect turbopack to generate.


A few things are still left todo:
- Diffing of the files isn't supported, which would be very helpful for finding changes.
- I didn't handle static assets, and CSS could be broken.
- It only supports `index.js` as the entry point, but we should support many entrypoints (and different filenames and extensions) via an `options.json`.
- We only perform Browser transformations, but we should support any via an `options.json`.
- I don't know if a nested directory structure is possible for output chunks, so it only supports `output/*` files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
6 participants
@m19c @jaredpalmer @ShubhamKushwah @fkapsahili @iDarkLightning and others