Skip to content

Commit

Permalink
refactor: monorepo (#461)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
privatenumber and github-actions authored Apr 7, 2024
1 parent 534e926 commit f4c7c53
Show file tree
Hide file tree
Showing 132 changed files with 4,973 additions and 2,586 deletions.
14 changes: 7 additions & 7 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@
## Commands
### Get the benchmarks for a file given a minfier
```sh
$ pnpm benchmark --minifier <minifier> <code-path>
$ pnpm bench --minifier <minifier> <artifact>
```

Example:
```
$ pnpm benchmark --minifier esbuild ./node_modules/vue/dist/vue.runtime.common.dev.js
$ pnpm bench --minifier esbuild vue
```

### Benchmark all artifacts & minifiers

```sh
$ pnpm benchmark-all
$ pnpm bench-all
```

#### Limit by minifier
```sh
$ pnpm benchmark-all --minifier esbuild
$ pnpm bench-all --minifier esbuild
```

#### Limit by artifact
```sh
$ pnpm benchmark-all --artifact artifact-name
$ pnpm bench-all --artifact vue
```

### Benchmark all artifacts & minifiers and update README.md
```sh
$ pnpm update-benchmarks-readme
$ pnpm update-readme
```

## Artifacts

All artifacts used for benchmarking are in [`/scripts/update-benchmarks-readme/artifact-paths.ts`](/scripts/update-benchmarks-readme/artifact-paths.ts).
All artifacts used for benchmarking are in [`/packages/artifacts/artifacts/`](/packages/artifacts/artifacts/).
Binary file added .github/logo-original.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/logo-transparent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/logo.webp
Binary file not shown.
70 changes: 35 additions & 35 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,38 @@ jobs:

steps:

- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
repository: ${{ github.repository }}

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: true

- name: Setup Composer
uses: php-actions/composer@v6

- name: Benchmark
run: pnpm update-benchmarks-readme

- name: Commit README.md
run: |
git config user.name github-actions
git config user.email [email protected]
git commit -nam "chore: updated benchmarks"
git push
- name: Upload minification results
uses: actions/upload-artifact@v3
with:
name: minification-results
path: results/
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
repository: ${{ github.repository }}

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
run_install: true

- name: Setup Composer
uses: php-actions/composer@v6
with:
working_dir: packages/minifiers

- name: Benchmark
run: pnpm bench-all

- name: Update README
run: pnpm update-readme

- name: Commit README.md
run: |
git config user.name Hiroki Osame
git config user.email [email protected]
git add -u
git diff-index --quiet HEAD || git commit -nm "chore: updated benchmarks"
git push
35 changes: 19 additions & 16 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,22 @@ jobs:
timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: true

- name: Lint
run: pnpm lint
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
run_install: true

- name: Lint
run: pnpm lint

- name: Type check
run: pnpm type-check
1 change: 1 addition & 0 deletions @types/ts-reset.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@total-typescript/ts-reset';
355 changes: 175 additions & 180 deletions README.md

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions lib/@types/tdewolff-minify.d.ts

This file was deleted.

36 changes: 0 additions & 36 deletions lib/benchmark-artifacts.ts

This file was deleted.

94 changes: 0 additions & 94 deletions lib/benchmark-minifiers.ts

This file was deleted.

67 changes: 0 additions & 67 deletions lib/benchmark.ts

This file was deleted.

6 changes: 0 additions & 6 deletions lib/get-artifacts/artifacts/antd/index.ts

This file was deleted.

6 changes: 0 additions & 6 deletions lib/get-artifacts/artifacts/d3/index.ts

This file was deleted.

6 changes: 0 additions & 6 deletions lib/get-artifacts/artifacts/echarts/index.ts

This file was deleted.

6 changes: 0 additions & 6 deletions lib/get-artifacts/artifacts/jquery/index.ts

This file was deleted.

6 changes: 0 additions & 6 deletions lib/get-artifacts/artifacts/lodash/index.ts

This file was deleted.

Loading

0 comments on commit f4c7c53

Please sign in to comment.