Update to Yarn 3 (#13140)

This commit is contained in:
Nicolò Ribaudo 2021-09-16 22:23:46 +02:00 committed by GitHub
parent 137fecc765
commit 2ffb19828f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 2126 additions and 1453 deletions

View File

@ -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
@ -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
@ -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:

View File

@ -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: |

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

631
.yarn/releases/yarn-3.0.2.cjs vendored Executable file

File diff suppressed because one or more lines are too long

View File

@ -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"

View File

@ -35,4 +35,4 @@ releaseTool:
unsafeHttpWhitelist:
- localhost
yarnPath: .yarn/releases/yarn-2.4.1.cjs
yarnPath: .yarn/releases/yarn-3.0.2.cjs

View File

@ -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
@ -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-"

View File

@ -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",

View File

@ -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",

View File

@ -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

View File

@ -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.
@ -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

View File

@ -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

View File

@ -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)

2702
yarn.lock

File diff suppressed because it is too large Load Diff