Skip to content

Commit

Permalink
perf: migrate to bun (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Jun 25, 2024
1 parent 564d818 commit f064723
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 11,954 deletions.
34 changes: 8 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,44 +19,26 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18

- name: Load cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1

- name: Install
run: npm ci
run: bun install --frozen-lockfile

- name: Lint
run: npm run format
run: bun run format

test:
name: Test
timeout-minutes: 10
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18

- name: Load cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1

- name: Install
run: npm ci
run: bun install --frozen-lockfile

- name: Test
run: npm run test:cov
run: bun test --coverage
19 changes: 5 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18

- name: Load cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1

- name: Install
run: npm ci
run: bun install --frozen-lockfile

- name: Build extension
run: npm run build
run: bun run build

- name: Bundle extension
run: npm run bundle
run: bun run bundle

- name: Bundle source
run: git archive --format=zip ${{ github.event.release.tag_name }} --output out/replace_maps_source.zip
Expand Down
7 changes: 3 additions & 4 deletions AMO-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@

## Prequisites

- Node 18
- npm
- [Bun](https://bun.sh/)

## Installation

```shell
npm ci
bun install --frozen-lockfile
```

This uses the `package-lock.json` file for installation to avoid package changes and have reproducible builds.

## Building

```shell
npm run build && npm run bundle
bun run build && bun run bundle
```

This transpiles and minifies the TypeScript, copies static resources and bundles the output to `out/replace_maps.zip`.
Binary file added bun.lockb
Binary file not shown.
Loading

0 comments on commit f064723

Please sign in to comment.