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

Use npm v7 with workspaces for local development and testing #11304

Merged
merged 1 commit into from
Sep 1, 2021

Conversation

lukekarrys
Copy link
Contributor

This PR uses npm v7 (with its support of workspaces) for local development and testing. This should only affect local development, and not the generated output from create-react-app. So if I made changes that do affect the output, it is likely a mistake. 😄

Lerna

lerna is still being used for changelog generation and publishing. These two tasks could be replaced with individual tools/scripts, now that npm is responsible for installing and linking dependencies.

@facebook-github-bot
Copy link

Hi @lukekarrys!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@lukekarrys
Copy link
Contributor Author

I was running into the same issue as #11306, so I included a similar commit (01f8557) in order to get tests passing further.

@merceyz
Copy link
Contributor

merceyz commented Aug 23, 2021

Could you elaborate on why this change is necessary? What is gained from this migration compared to what's already in place?

@mrmckeb
Copy link
Contributor

mrmckeb commented Aug 25, 2021

@merceyz We've been working with the npm team recently, and they've graciously donated time to help us improve internal tooling (this PR is part of that work), and to also improve end user experience (as in #11322) - and of course we'll be giving them our feedback along the way.

@merceyz
Copy link
Contributor

merceyz commented Aug 25, 2021

That doesn't answer my questions but alright

@dan-kez
Copy link

dan-kez commented Sep 2, 2021

Hey all! I believe there may be an issue with how build:prod is being invoked as a part of this build.

For example in this e2e build in a recent babel PR we can see the following error

(Copied below for ease of reading)

$ npm run build:prod -w react-error-overlay
npm ERR! missing script: build:prod
npm ERR! 
npm ERR! Did you mean this?
npm ERR!     build

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2021-09-02T13_13_45_399Z-debug.log
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

cc @lukekarrys

edit: apologies just found this fix here babel/babel#13724. Please ignore

@lukekarrys
Copy link
Contributor Author

@dan-kez Are you using npm@7? The workspaces support used by this repo is only available in npm 7. I added a note to the contributing docs about this, but a better check with a clearer error message would help in this case.

@lukekarrys
Copy link
Contributor Author

Also if you're using node 14 in a CI environment, you'll need to manually install npm 7 like I did here: https://github.com/facebook/create-react-app/pull/11304/files#diff-5c3fa597431eda03ac3339ae6bf7f05e1a50d6fc7333679ec38e21b337cb6721R14-R15

@dan-kez
Copy link

dan-kez commented Sep 2, 2021

@dan-kez Are you using npm@7? The workspaces support used by this repo is only available in npm 7. I added a note to the contributing docs about this, but a better check with a clearer error message would help in this case.

It looks like this was the issue. nicolo-ribaudo fixed this in babel/babel#13724

Thanks for the prompt response and apologies for posting before digging into it further!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants