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

Add yarn 3 to create redwood app template #4761

Merged
merged 21 commits into from Mar 18, 2022
Merged

Conversation

jtoar
Copy link
Contributor

@jtoar jtoar commented Mar 15, 2022

This PR adds yarn 3 to the create-redwood-app template. This speeds up the ⠏ Running 'yarn install'... (This could take a while) step significantly.

Note that you can still use yarn 1:

yarn create redwood-app --yarn1
  • what do we want to do with CI? Should the smoke test still be on yarn 1?
    • we'll deploy a few of the projects in the deploy repo using yarn 1
  • yarn 3 has the create command too, but we still check for yarn compatibility, so it doesn't work. should we tweak or remove the check for yarn compatibility?
    • change the engine requirements to allow yarn 3
  • this works locally and CI seems to be passing, but publishing an experimental release or merging and testing canary are still probably necessary
    • got the ok to merge when ready
  • test project

@jtoar jtoar added the release:feature This PR introduces a new feature label Mar 15, 2022
@jtoar jtoar self-assigned this Mar 15, 2022
@jtoar jtoar marked this pull request as ready for review March 15, 2022 13:30
@thedavidprice
Copy link
Contributor

@jtoar I'd suggest we move completely to Yarn 3 and do not specifically test for compatibility. We should strongly encourage everyone to migrate their projects to Yarn 3.

In this PR, that means:

  1. CRWA Template at Yarn 3
  2. Test Project fixture at Yarn 3
  3. Smoke Test at Yarn 3

Did I miss anything?

@thedavidprice
Copy link
Contributor

updated from main including Auth Smoke Tests via #4673

@thedavidprice
Copy link
Contributor

@jtoar I started working on changes to build:test-project to update the fixture to use Yarn 3. See 72992df

  • added new command option yarn1 that will set version classic (default = false)
  • updated yarn install commands to be Yarn 3 compatible

Rebuilding the Test-project fixture

I think tried (unsuccessfully) to rebuild the __fixture__/test-project by running:

yarn build:test-project --rebuildFixture

Note: at the very beginning of the process, the console will output the temp directory, which you can copy and open to examine the building process. It will be a timestamp-named dir at a path like /var/folders/wl/drx1fhwd2pjdmlyypfdt9kqc0000gn/T/redwood-test-project/

The initial yarn install task is successful. But as soon as it tries to run tailwind yarn workspace web add ..., yarn fails. I commented out the tailwind steps, which then failed at the following yarn rw ... command. The error is always the same if I try the command from the temp test-project directory:

➤ YN0000: ┌ Link step
➤ YN0001: │ Error: ENOENT: no such file or directory, lstat '/private/var/folders/wl/drx1fhwd2pjdmlyypfdt9kqc0000gn/T/redwood-test-project/2022-03-16T00-01-49.102Z/node_modules/@redwoodjs/core/node_modules/@babel/cli/node_modules/semver'
➤ YN0000: └ Completed in 0s 683ms
➤ YN0000: Failed with errors in 1s 957ms

Perhaps it's now an error running a yarn 3 command inside a Yarn 3 process?

@jtoar
Copy link
Contributor Author

jtoar commented Mar 16, 2022

The smoke test's failing on yarn rw data-migrate up:https://github.com/redwoodjs/redwood/runs/5569052576?check_suite_focus=true#step:21:27. So far can't reproduce it locally

run: |
yarn rw prisma generate
yarn rw prisma migrate reset --force
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtoar let's see if this one passes, but because I use this for Telemetry as well, let's not replace any of the specific commands. In this case, just add this to the dm up step, eg:

run: |
          yarn rw prisma migrate reset --force
          yarn rw dataMigrate up

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't work; trying dm up before install

Copy link
Contributor

@thedavidprice thedavidprice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtoar the code and updates look good. However, I still can't get the build:test-project commands to work.

I just tried yarn build:test-project --rebuildFixture and ran into the same error I reported previously with Tailwind and/or any following yarn command.

If I cd into the temporary directory, I can't get any yarn commands to work, including yarn install. Always the same error about

➤ YN0001: │ Error: ENOENT: no such file or directory, lstat '/private/var/folders/wl/drx1fhwd2pjdmlyypfdt9kqc0000gn/T/redwood-test-project/2022-03-16T18-44-41.739Z/node_modules/@redwoodjs/core/node_modules/@babel/cli/node_modules/semver'

Did you ever get the commands to work locally?

@thedavidprice
Copy link
Contributor

Update here via @jtoar:

it looks like you can get into a bad install state via yarn rwfw project:copy (on yarn 3 at least) IF you try to install after running it:

➤ YN0000: ┌ Link step
➤ YN0001: │ Error: ENOENT: no such file or directory, lstat '/Users/dom/prjcts/rwjs-test-project/node_modules/@redwoodjs/core/node_modules/@babel/cli/node_modules/semver'
➤ YN0000: └ Completed in 0s 429ms

you can fix it by changing the nmMode in .yarnrc.yml to classic but I’m not sure if that’s a viable fix yet or not. tbd!

So this is not specific to the work here. Instead it's something broken with project:copy (but strangely not project:sync)

I'm going to run a local sanity check and then hopefully proceed with this PR as is. Dom will work on project:copy fix in follow-up.

@netlify
Copy link

netlify bot commented Mar 18, 2022

✅ Deploy Preview for redwoodjs-docs canceled.

🔨 Explore the source changes: 4a44530

🔍 Inspect the deploy log: https://app.netlify.com/sites/redwoodjs-docs/deploys/6234fcb0fc67310008bd8895

@thedavidprice thedavidprice merged commit 1521edb into main Mar 18, 2022
@thedavidprice thedavidprice deleted the ds-add-yarn3-to-crwa branch March 18, 2022 21:42
@jtoar jtoar added this to the next-release milestone Mar 18, 2022
@thedavidprice
Copy link
Contributor

I'm going to run a local sanity check and then hopefully proceed with this PR as is. Dom will work on project:copy fix in follow-up.

I could not get this workaround to, well, work on the build:test-project

@thedavidprice
Copy link
Contributor

@jtoar Confirming that create-redwood-app@canary is working great!! 🚀

@thedavidprice thedavidprice modified the milestones: next-release, v0.50.0 Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:feature This PR introduces a new feature
Projects
No open projects
Status: Archived
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants