Skip to content

Commit

Permalink
feat: rewrite for bundle size and add "convert to best" (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahsnider authored Jun 27, 2021
1 parent 7f4dce1 commit 16fffb1
Show file tree
Hide file tree
Showing 65 changed files with 9,016 additions and 9,567 deletions.
8 changes: 0 additions & 8 deletions .eslintrc.js

This file was deleted.

1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.yarn/** linguist-vendored
65 changes: 50 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ jobs:
steps:
- name: Checkout git repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Get Yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
Expand All @@ -30,16 +34,18 @@ jobs:
with:
name: dist
path: dist
- name: Check ECMAScript compatibility
run: yarn run compat
lint:
name: Lint source
unit-test:
name: Unit tests

runs-on: ubuntu-latest

steps:
- name: Checkout git repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Get Yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
Expand All @@ -52,16 +58,24 @@ jobs:
${{ runner.os }}-yarn-
- name: Install dependencies with Yarn
run: yarn install --immutable
- name: Lint
run: yarn run lint
unit-test:
name: Unit tests
- name: Run tests
run: yarn test
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
legacy-test:
name: Legacy Node.js tests

runs-on: ubuntu-latest

steps:
- name: Checkout git repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Get Yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
Expand All @@ -74,12 +88,19 @@ jobs:
${{ runner.os }}-yarn-
- name: Install dependencies with Yarn
run: yarn install --immutable
- name: Run tests
run: yarn test --ci --coverage --maxWorkers=2
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
- name: Build
run: yarn run build
- name: Download Node.js v0.9.1
run: |
wget https://nodejs.org/dist/v0.9.1/node-v0.9.1-linux-x64.tar.gz
tar xf node-v0.9.1-linux-x64.tar.gz
mkdir -p $HOME/.local/bin
cp ./node-v0.9.1-linux-x64/bin/node $HOME/.local/bin/node-0.9.1
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Run tests on modern Node.js
run: node ./src/test/legacy.js
- name: Run tests on Node.js v0.9.1
run: node-0.9.1 ./src/test/legacy.js
size:
name: Calculate bundle size

Expand All @@ -91,6 +112,10 @@ jobs:
steps:
- name: Checkout git repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Get Yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
Expand All @@ -115,6 +140,10 @@ jobs:
steps:
- name: Checkout git repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Get Yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
Expand All @@ -134,11 +163,17 @@ jobs:

runs-on: ubuntu-latest

needs: [lint, unit-test, style, size]
if: ${{ github.ref == 'refs/heads/master' }}

needs: [unit-test, legacy-test, style, size]

steps:
- name: Checkout git repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Get Yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
Expand Down
29 changes: 26 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# Icon must end with two \r
Icon


# Thumbnails
._*

Expand Down Expand Up @@ -52,6 +53,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Expand Down Expand Up @@ -88,8 +90,8 @@ build/Release
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo
Expand Down Expand Up @@ -118,12 +120,15 @@ typings/
# dotenv environment variables file
.env
.env.test
.env.production

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
Expand Down Expand Up @@ -153,6 +158,13 @@ dist
# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
Expand All @@ -161,9 +173,13 @@ dist
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

### Windows ###
# Windows thumbnail cache files
Expand Down Expand Up @@ -195,11 +211,18 @@ $RECYCLE.BIN/

# Yarn
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*

# Generated docs
# Rollup
.rollup.cache

# TypeScript compiler
tsc_output

# TypeDoc
docs_out
1 change: 0 additions & 1 deletion .npmignore

This file was deleted.

30 changes: 27 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# Icon must end with two \r
Icon


# Thumbnails
._*

Expand Down Expand Up @@ -52,6 +53,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Expand Down Expand Up @@ -88,8 +90,8 @@ build/Release
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo
Expand Down Expand Up @@ -118,12 +120,15 @@ typings/
# dotenv environment variables file
.env
.env.test
.env.production

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
Expand Down Expand Up @@ -153,6 +158,13 @@ dist
# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
Expand All @@ -161,9 +173,13 @@ dist
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

### Windows ###
# Windows thumbnail cache files
Expand Down Expand Up @@ -197,5 +213,13 @@ $RECYCLE.BIN/
.yarn/*
.pnp.*

# Generated docs
# Rollup
.rollup.cache

# TypeScript compiler
tsc_output

src/generated

# TypeDoc
docs_out
3 changes: 1 addition & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-2.4.2.cjs
nodeLinker: node-modules
Loading

0 comments on commit 16fffb1

Please sign in to comment.