diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e23184c662..d924907d6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: - name: Check or update Yarn cache env: YARN_ENABLE_SCRIPTS: false # disable post-install scripts - YARN_NODE_LINKER: pnp # use pnp linker for better performance: it's meant to update yarn cache only + 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 @@ -65,6 +65,8 @@ jobs: name: Build Babel Artifacts needs: prepare-yarn-cache runs-on: ubuntu-latest + env: + YARN_NODE_LINKER: pnp # use pnp linker for better linking performance and stricter checks steps: - name: Checkout code uses: actions/checkout@v2 @@ -132,7 +134,7 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 - - name: Use Node.js latest + - name: Use Node.js latest # Run yarn on latest node uses: actions/setup-node@v2-beta with: node-version: "*" # Build Babel on latest node LTS versions @@ -145,7 +147,7 @@ jobs: key: yarn-${{ hashFiles('yarn.lock') }} - name: Install run: | - BABEL_ENV=test-legacy make -j bootstrap-only + yarn install - name: Downgrade Jest for node <= 8 if: matrix.node-version == '6' || matrix.node-version == '8' run: | @@ -159,13 +161,15 @@ jobs: - name: Generate runtime helpers run: | make build-plugin-transform-runtime-dist - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js ${{ matrix.node-version }} # Checkout node version for test executor uses: actions/setup-node@v2-beta with: node-version: ${{ matrix.node-version }} - name: Test on node.js ${{ matrix.node-version }} # Hack: --color has supports-color@5 returned true for GitHub CI # Remove once `chalk` is bumped to 4.0. + + # Todo(Babel 8): Jest execution path is hardcoded because Yarn 2 does not support node 6 run: | BABEL_ENV=test node ./node_modules/.bin/jest --ci --color diff --git a/Gulpfile.js b/Gulpfile.js index 258dff03de..25c74e2801 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -239,6 +239,13 @@ function buildRollup(packages, targetBrowsers) { const bundle = await rollup.rollup({ input, external, + onwarn(warning, warn) { + if (warning.code !== "CIRCULAR_DEPENDENCY") { + warn(warning); + // https://github.com/babel/babel/pull/12011#discussion_r540434534 + throw new Error("Rollup aborted due to warnings above"); + } + }, plugins: [ rollupBabelSource(), rollupReplace({ @@ -257,10 +264,6 @@ function buildRollup(packages, targetBrowsers) { extensions: [".mjs", ".cjs", ".ts", ".js", ".json"], browser: nodeResolveBrowser, preferBuiltins: true, - //todo: remove when semver and source-map are bumped to latest versions - dedupe(importee) { - return ["semver", "source-map"].includes(importee); - }, }), rollupCommonJs({ include: [ diff --git a/babel.config.js b/babel.config.js index a044be1480..4e27b68dd4 100644 --- a/babel.config.js +++ b/babel.config.js @@ -49,7 +49,7 @@ module.exports = function (api) { ignoreLib = false; // rollup-commonjs will converts node_modules to ESM unambiguousSources.push( - "**/node_modules", + "/**/node_modules", "packages/babel-preset-env/data", "packages/babel-compat-data" ); diff --git a/package.json b/package.json index 8da8391507..51af7db773 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "jest": "^26.6.1", "lerna-changelog": "^0.5.0", "lint-staged": "^9.2.0", + "lodash": "^4.17.20", "mergeiterator": "^1.2.5", "prettier": "^2.0.5", "rollup": "^2.26.5", diff --git a/yarn.lock b/yarn.lock index 74dd95f770..e3e68a44b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4851,6 +4851,7 @@ __metadata: jest: ^26.6.1 lerna-changelog: ^0.5.0 lint-staged: ^9.2.0 + lodash: ^4.17.20 mergeiterator: ^1.2.5 prettier: ^2.0.5 rollup: ^2.26.5 @@ -9693,7 +9694,7 @@ fsevents@^1.2.7: languageName: node linkType: hard -"lodash@npm:^4.17.14, lodash@npm:^4.17.15, lodash@npm:^4.17.19": +"lodash@npm:^4.17.14, lodash@npm:^4.17.15, lodash@npm:^4.17.19, lodash@npm:^4.17.20": version: 4.17.20 resolution: "lodash@npm:4.17.20" checksum: c62101d2500c383b5f174a7e9e6fe8098149ddd6e9ccfa85f36d4789446195f5c4afd3cfba433026bcaf3da271256566b04a2bf2618e5a39f6e67f8c12030cb6