-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ESM imports and tree-shaking (#363)
chore(packaging): update import styles to use file suffixes to support ESM and tree-shaking
- Loading branch information
Showing
714 changed files
with
17,196 additions
and
3,481 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
.eslintrc.cjs | ||
gulp | ||
jest.config.js | ||
jestconfigs | ||
targets | ||
integration |
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,56 @@ | ||
name: Bundle | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
test-tree-shaking-pull-request: | ||
name: ${{ matrix.bundler }} ${{ matrix.target }} ${{ matrix.module }} | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
bundler: [esbuild, rollup, webpack] | ||
target: [es5, es2015, esnext] | ||
module: [cjs, esm, umd] | ||
include: | ||
- {bundler: esbuild, target: ix} | ||
- {bundler: rollup, target: ix} | ||
- {bundler: webpack, target: ix} | ||
steps: | ||
- name: Setup node v20.x | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Construct cache keys | ||
run: | | ||
echo node_modules_key='["${{ runner.os }}", "node_modules", "20.x", "${{ hashFiles('package.json', 'yarn.lock') }}"]' >> $GITHUB_ENV; | ||
echo targets_key='["${{ runner.os }}", "targets", "20.x", "ix", "", "${{ hashFiles('package.json', 'yarn.lock', 'tsconfig.json', 'src/**/*', 'tsconfigs/**/*') }}"]' >> $GITHUB_ENV; | ||
- name: Cache targets | ||
uses: actions/cache@v4 | ||
with: | ||
key: ${{ join(fromJSON(env.targets_key), '-') }} | ||
path: targets | ||
|
||
- name: Cache node_modules | ||
uses: actions/cache@v4 | ||
with: | ||
key: ${{ join(fromJSON(env.node_modules_key), '-') }} | ||
path: node_modules | ||
|
||
- name: Test ${{ matrix.bundler }} tree-shaking | ||
env: | ||
t: "${{ matrix.target }}" | ||
m: "${{ matrix.module }}" | ||
run: | | ||
integration/make-files-to-bundle.sh | ||
if test "${t}" != ix; then | ||
yarn build ${t:+-t ${t}} ${m:+-m ${m}} | ||
fi | ||
yarn gulp bundle${t:+:${t}}${m:+:${m}}:${{ matrix.bundler }} |
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,43 @@ | ||
name: Lint | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
lint-pull-request: | ||
name: Lint | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Setup node v20.x | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Construct cache keys | ||
run: | | ||
echo node_modules_key='["${{ runner.os }}", "node_modules", "20.x", "${{ hashFiles('package.json', 'yarn.lock') }}"]' >> $GITHUB_ENV; | ||
- name: Cache node_modules | ||
uses: actions/cache@v4 | ||
with: | ||
key: ${{ join(fromJSON(env.node_modules_key), '-') }} | ||
path: node_modules | ||
|
||
- name: Check if source or test files changed | ||
id: files_changed | ||
uses: tj-actions/changed-files@v44 | ||
with: | ||
files: | | ||
src/**/* | ||
spec/**/* | ||
- name: Lint files | ||
if: ${{ steps.files_changed.outputs.any_modified == 'true' }} | ||
run: | | ||
yarn --ignore-engines --non-interactive | ||
yarn lint:ci |
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.