-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare for compiling Babel to native ESM (#13414)
* Move dynamic import in `@babel/core` to a CJS file * Allow compiling to ESM * Add `USE_ESM` compile-time flag * Fix `@babel/eslint-parser` * Provide CJS bundle of `@babel/parser` * Minor test fixes * Add CommonJS proxy to `@babel/core` for backward compat * Test ESM on CI * TODO: skip failing packages * Add missing `devDependency` to `@babel/helper-remap-async-to-generator` * Update contributing.md * Apply suggestions from self-review * Update Gulpfile.mjs * Prettier * Explicitly use node in makefile
- Loading branch information
1 parent
ea99182
commit 2b163d8
Showing
28 changed files
with
477 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: E2E tests (esm) | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
e2e-publish: | ||
name: Publish to local Verdaccio registry | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Use Node.js latest | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "*" | ||
cache: "yarn" | ||
- name: Use ESM | ||
run: make use-esm | ||
- name: Publish | ||
run: ./scripts/integration-tests/publish-local.sh | ||
env: | ||
USE_ESM: true | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: verdaccio-workspace | ||
path: /tmp/verdaccio-workspace | ||
|
||
e2e-tests: | ||
name: Test | ||
needs: e2e-publish | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
project: | ||
- create-react-app | ||
steps: | ||
- name: Get yarn1 cache directory path | ||
id: yarn1-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Use Node.js latest | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "*" | ||
- name: Get yarn3 cache directory path | ||
id: yarn3-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn config get cacheFolder)" | ||
- name: Use yarn1 cache | ||
uses: actions/cache@v3 | ||
id: yarn1-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn1-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn1-e2e-breaking-${{ matrix.project }}-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: ${{ runner.os }}-yarn1-e2e-breaking-${{ matrix.project }}- | ||
- name: Use yarn3 cache | ||
uses: actions/cache@v3 | ||
id: yarn3-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn3-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn3-e2e-breaking-${{ matrix.project }}-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: ${{ runner.os }}-yarn3-e2e-breaking-${{ matrix.project }}- | ||
- name: Clean babel cache | ||
run: | | ||
rm -rf ${{ steps.yarn1-cache-dir-path.outputs.dir }}/*babel* | ||
rm -rf ${{ steps.yarn3-cache-dir-path.outputs.dir }}/*babel* | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: verdaccio-workspace | ||
path: /tmp/verdaccio-workspace | ||
- name: Test | ||
run: ./scripts/integration-tests/e2e-${{ matrix.project }}.sh | ||
env: | ||
USE_ESM: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.