Skip to content

Commit

Permalink
Update to Yarn 3
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Jul 26, 2021
1 parent 224a35c commit 2d106ce
Show file tree
Hide file tree
Showing 12 changed files with 2,001 additions and 1,422 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 --skip-builds
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
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.0.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.0-rc.1.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.0.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.0",
"devDependencies": {
"@babel/cli": "^7.14.5",
"@babel/core": "^7.14.6",
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
2 changes: 1 addition & 1 deletion scripts/integration-tests/e2e-babel.sh
Expand Up @@ -32,6 +32,6 @@ startLocalRegistry "$PWD"/scripts/integration-tests/verdaccio-config.yml
node "$PWD"/scripts/integration-tests/utils/bump-babel-dependencies.js

# Update deps, build and test
make -j test-ci
YARN_ENABLE_IMMUTABLE_INSTALLS=false make -j test-ci

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
2 changes: 1 addition & 1 deletion scripts/integration-tests/utils/local-registry.sh
Expand Up @@ -10,7 +10,7 @@ function startLocalRegistry {
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
npm install --global verdaccio-memory@~9.7.2
# Wait for Verdaccio to boot
grep -q "http address" <(tail -f $tmp_registry_log)

Expand Down

0 comments on commit 2d106ce

Please sign in to comment.