Skip to content

Commit

Permalink
Update to Yarn 3 (#13140)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Sep 16, 2021
1 parent 137fecc commit 2ffb198
Show file tree
Hide file tree
Showing 17 changed files with 2,126 additions and 1,453 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -28,7 +28,7 @@ jobs:
YARN_ENABLE_SCRIPTS: false # disable post-install scripts
YARN_NODE_LINKER: pnp # use pnp linker for better linking performance: it's meant to update yarn cache only
run: |
yarn install --immutable --skip-builds
yarn install --mode=skip-build
yarn-validate:
name: Validate Yarn dependencies and constraints
Expand Down Expand Up @@ -327,6 +327,10 @@ jobs:
"
- name: Install
run: yarn install
env:
# The "Support self-references on old Node.js" step mutates the
# package.json file, causing a yarn.lock update.
YARN_ENABLE_IMMUTABLE_INSTALLS: false
- uses: actions/download-artifact@v2
with:
name: babel-artifact
Expand All @@ -344,7 +348,7 @@ jobs:
with:
node-version: 10
- name: Test Node.js 10
run: yarn test:runtime:node
run: node test/runtime-integration/node.cjs
- name: Use Node.js 12.0
uses: actions/setup-node@v2-beta
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-parser-tests.yml
Expand Up @@ -38,7 +38,7 @@ jobs:
echo ${{ steps.test262.outputs.sha1 }} | ./scripts/parser-tests/bump-test262-version.sh
- name: Build babel parser
run: |
yarn install --immutable --skip-builds
yarn install --immutable --mode=skip-build
yarn gulp build-rollup
- name: Update test262 allow list
run: |
Expand Down
76 changes: 58 additions & 18 deletions .yarn/plugins/@yarnpkg/plugin-babel-release-tool.cjs

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions .yarn/plugins/@yarnpkg/plugin-conditions.cjs

Large diffs are not rendered by default.

56 changes: 50 additions & 6 deletions .yarn/plugins/@yarnpkg/plugin-constraints.cjs

Large diffs are not rendered by default.

55 changes: 0 additions & 55 deletions .yarn/releases/yarn-2.4.1.cjs

This file was deleted.

631 changes: 631 additions & 0 deletions .yarn/releases/yarn-3.0.2.cjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .yarnrc
@@ -1,3 +1,3 @@
# Use Yarn 2
# Use Yarn 3
# This path should always match the one in .yarnrc.yml
yarn-path ".yarn/releases/yarn-2.4.1.cjs"
yarn-path ".yarn/releases/yarn-3.0.2.cjs"
2 changes: 1 addition & 1 deletion .yarnrc.yml
Expand Up @@ -35,4 +35,4 @@ releaseTool:
unsafeHttpWhitelist:
- localhost

yarnPath: .yarn/releases/yarn-2.4.1.cjs
yarnPath: .yarn/releases/yarn-3.0.2.cjs
9 changes: 0 additions & 9 deletions Makefile
Expand Up @@ -181,7 +181,6 @@ prepublish-prepare-dts:
$(MAKE) build-typescript-legacy-typings

prepublish:
$(MAKE) check-yarn-bug-1882
$(MAKE) bootstrap-only
$(MAKE) prepublish-build
IS_PUBLISH=true $(MAKE) test
Expand Down Expand Up @@ -213,19 +212,11 @@ publish:
$(YARN) release-tool publish
$(MAKE) clean

check-yarn-bug-1882:
ifneq ("$(shell grep 3155328e5 .yarn/releases/yarn-*.cjs -c)", "0")
@echo "Your version of yarn is affected by https://github.com/yarnpkg/berry/issues/1882"
@echo "Please run \`sed -i -e "s/3155328e5/4567890e5/g" .yarn/releases/yarn-*.cjs\`"
@exit 1
endif

publish-test:
ifneq ("$(I_AM_USING_VERDACCIO)", "I_AM_SURE")
echo "You probably don't know what you are doing"
exit 1
endif
$(MAKE) check-yarn-bug-1882
$(YARN) release-tool version $(VERSION) --all --yes --tag-version-prefix="version-e2e-test-"
$(MAKE) prepublish-build
YARN_NPM_PUBLISH_REGISTRY=http://localhost:4873 $(YARN) release-tool publish --yes --tag-version-prefix="version-e2e-test-"
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -16,6 +16,7 @@
"test:runtime:bundlers": "node test/runtime-integration/bundlers.cjs",
"test:runtime:node": "node test/runtime-integration/node.cjs"
},
"packageManager": "yarn@3.0.2",
"devDependencies": {
"@babel/cli": "^7.14.8",
"@babel/core": "^7.15.0",
Expand Down
2 changes: 1 addition & 1 deletion renovate.json
Expand Up @@ -64,7 +64,7 @@
"schedule": ["before 00:05 on Friday"],
"postUpgradeTasks": {
"commands": [
"yarn install --immutable --skip-builds",
"yarn install --immutable --mode=skip-build",
"yarn gulp build-rollup",
"make test-test262-update-allowlist",
"make test-flow-update-allowlist",
Expand Down
2 changes: 1 addition & 1 deletion scripts/integration-tests/e2e-babel-old-version.sh
Expand Up @@ -64,6 +64,6 @@ node -e "

# Update deps, build and test
rm yarn.lock
make -j test-ci
YARN_ENABLE_IMMUTABLE_INSTALLS=false make -j test-ci

cleanup
5 changes: 3 additions & 2 deletions scripts/integration-tests/e2e-babel.sh
Expand Up @@ -26,6 +26,7 @@ if [ "$BABEL_8_BREAKING" = true ] ; then
fi

startLocalRegistry "$PWD"/scripts/integration-tests/verdaccio-config.yml

# We only bump dependencies in the top-level package.json, because workspaces
# already use the workspace: protocol so will get the version in the monorepo
# and not from npm.
Expand All @@ -36,11 +37,11 @@ if [ "$BABEL_8_BREAKING" = true ] ; then
# Jest hangs forever in the Babel 8 e2e test when using multiple workers,
# but we don't know yet why. Until we figure it out (see
# https://github.com/babel/babel/pull/13618) we can use --runInBand.
make -j build-standalone-ci
YARN_ENABLE_IMMUTABLE_INSTALLS=false make -j build-standalone-ci
BABEL_ENV=test yarn jest --ci --runInBand
make -j test-clean
else
make -j test-ci
YARN_ENABLE_IMMUTABLE_INSTALLS=false make -j test-ci
fi

cleanup
7 changes: 7 additions & 0 deletions scripts/integration-tests/e2e-jest.sh
Expand Up @@ -48,6 +48,13 @@ if [ "$BABEL_8_BREAKING" = true ] ; then
# Jest depends on @types/babel__traverse for Babel 7, and they contain the removed Noop node
sed -i 's/t.Noop/any/g' node_modules/@types/babel__traverse/index.d.ts
sed -i 's/t.Noop/any/g' node_modules/@types/babel__traverse/ts4.1/index.d.ts

node -e "
var pkg = require('./package.json');
pkg.resolutions || (pkg.resolutions = {});
pkg.resolutions['@types/babel__traverse/@babel/types'] = 'latest';
fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2));
"
fi

yarn build
Expand Down
4 changes: 2 additions & 2 deletions scripts/integration-tests/utils/local-registry.sh
Expand Up @@ -9,8 +9,8 @@ function startLocalRegistry {
# Start local registry
tmp_registry_log=`mktemp`
echo "Registry output file: $tmp_registry_log"
(cd && nohup npx ${VERDACCIO_PACKAGE:-$default_verdaccio_package} -c $1 &>$tmp_registry_log &)
yarn global add verdaccio-memory@~9.7.2
(cd && nohup npx verdaccio@~5.1.2 -c $1 &>$tmp_registry_log &)
YARN_IGNORE_PATH=1 yarn global add verdaccio-memory@~10.0.0
# Wait for Verdaccio to boot
grep -q "http address" <(tail -f $tmp_registry_log)

Expand Down

0 comments on commit 2ffb198

Please sign in to comment.