Skip to content

Commit d29f157

Browse files
authored
chore: Switch from pnpm to bun (#36)
1 parent ed5a04d commit d29f157

File tree

14 files changed

+46
-7085
lines changed

14 files changed

+46
-7085
lines changed

.gitattributes

-1
This file was deleted.

.github/workflows/submit.yml

+7-13
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,27 @@ jobs:
2222
with:
2323
fetch-depth: 0
2424

25-
- uses: pnpm/action-setup@v2
26-
with:
27-
version: 8
28-
29-
- uses: actions/setup-node@v4
30-
with:
31-
node-version: 18
25+
- uses: oven-sh/setup-bun@v2
3226

3327
- name: Configure Git
3428
run: |
3529
git config user.email "github-actions@users.noreply.github.com"
3630
git config user.name "GitHub Actions"
3731
3832
- name: Install dependencies
39-
run: pnpm install
33+
run: bun install
4034

4135
- name: Bump Version
4236
id: version
4337
run: |
44-
pnpx changelogen@latest --bump
45-
NEW_VERSION=$(node -pe 'require("./package.json").version')
38+
bunx changelogen@latest --bump
39+
NEW_VERSION=$(bun --print 'require("./package.json").version')
4640
echo "newVersion=$NEW_VERSION" >> "$GITHUB_OUTPUT"
4741
4842
- name: Build and Zip
4943
run: |
50-
pnpm zip
51-
pnpm zip:firefox
44+
bun run zip
45+
bun run zip:firefox
5246
5347
- name: Upload Artifacts
5448
uses: actions/upload-artifact@v4
@@ -59,7 +53,7 @@ jobs:
5953

6054
- name: Submit
6155
run: |
62-
pnpm wxt submit \
56+
bun wxt submit \
6357
--chrome-zip .output/*-chrome.zip \
6458
--firefox-zip .output/*-firefox.zip --firefox-sources-zip .output/*-sources.zip
6559
env:

.github/workflows/validate.yml

+5-14
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,16 @@ jobs:
1313
- name: Checkout
1414
uses: actions/checkout@v3
1515

16-
- name: Setup PNPM
17-
uses: pnpm/action-setup@v2
18-
with:
19-
version: 8
20-
21-
- name: Setup NodeJS
22-
uses: actions/setup-node@v3
23-
with:
24-
node-version: 18
25-
cache: "pnpm"
16+
- uses: oven-sh/setup-bun@v2
2617

2718
- name: Install dependencies
28-
run: pnpm install
19+
run: bun install
2920

3021
- name: Run Checks
31-
run: pnpm check
22+
run: bun check
3223

3324
- name: Build
34-
run: pnpm build
25+
run: bun run build
3526

3627
- name: Tests
37-
run: pnpm test:coverage
28+
run: bun run test:coverage

.prettierignore

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ dist
22
dist-*
33
artifacts
44
coverage
5-
pnpm-lock.yaml
65
.wxt
76
.output
87
coverage

README.md

+10-35
Original file line numberDiff line numberDiff line change
@@ -27,60 +27,35 @@ That's it. Very simple, targeted extension for fixing 1 problem with GitHub.
2727

2828
## Development
2929

30-
You must use [PNPM](https://pnpm.io/) with this repo. To install it, run `corepack enable` or `npm i -g pnpm`.
30+
You must use [Bun](https://bun.sh/) with this repo.
3131

32-
Then instal dependencies:
32+
Install dependencies:
3333

3434
```sh
35-
pnpm i
35+
bun i
3636
```
3737

3838
### Scripts
3939

4040
This extension is bundled via [WXT](https://wxt.dev).
4141

42-
- `pnpm dev`: Launchs Chrome with the dev version of the extension installed.
43-
- `pnpm build`: Builds the extension for production. Outputs to the `dist` directory.
44-
- `pnpm zip`: Zips up the `dist` directory into an installable ZIP file.
42+
- `bun dev`: Launches Chrome with the dev version of the extension installed.
43+
- `bun run build`: Builds the extension for production. Outputs to the `dist` directory.
44+
- `bun run zip`: Zips up the `dist` directory into an installable ZIP file.
4545

4646
Add `:firefox` suffix to some commands to target firefox instead of Chrome.
4747

48-
- `pnpm build:firefox`
49-
- `pnpm dev:firefox`
48+
- `bun run build:firefox`
49+
- `bun run dev:firefox`
5050

5151
### Running Tests
5252

5353
Unit tests are written with Vitest.
5454

5555
```ts
56-
pnpm test
56+
bun run test
5757
```
5858

5959
## Release an Update
6060

61-
Eventually, I'll create a GitHub action for this. But for now, you can release an update by:
62-
63-
1. Create a file, `.env.submit`, with the following content:
64-
65-
```sh
66-
# Follow: https://developer.chrome.com/docs/webstore/using_webstore_api/
67-
CHROME_EXTENSION_ID="..."
68-
CHROME_CLIENT_ID="..."
69-
CHROME_CLIENT_SECRET="..."
70-
CHROME_REFRESH_TOKEN="..."
71-
72-
# Follow: https://extensionworkshop.com/documentation/develop/web-ext-command-reference/#web-ext-sign
73-
FIREFOX_EXTENSION_ID="..."
74-
FIREFOX_JWT_ISSUER="..."
75-
FIREFOX_JWT_SECRET="..."
76-
77-
# Follow: https://learn.microsoft.com/en-us/microsoft-edge/extensions-chromium/publish/api/using-addons-api#before-you-begin
78-
EDGE_PRODUCT_ID="..."
79-
EDGE_CLIENT_ID="..."
80-
EDGE_CLIENT_SECRET="..."
81-
EDGE_ACCESS_TOKEN_URL="..."
82-
```
83-
84-
2. _Optional_: Run `pnpm submit:dry` to test if your config is correct.
85-
86-
3. Run `pnpm submit` to submit new versions to the stores.
61+
Use the [Submit for Review](https://github.com/aklinker1/github-better-line-counts/actions/workflows/submit.yml) workflow.

bun.lockb

295 KB
Binary file not shown.

package.json

+12-21
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Remove generated files from GitHub line counts",
44
"private": true,
55
"version": "1.7.0",
6-
"packageManager": "pnpm@9.6.0",
6+
"packageManager": "bun@1.1.31",
77
"type": "module",
88
"scripts": {
99
"check": "check",
@@ -16,29 +16,27 @@
1616
"zip": "wxt zip",
1717
"zip:firefox": "wxt zip -b firefox",
1818
"prepare": "simple-git-hooks",
19-
"postinstall": "wxt prepare",
20-
"submit": "env-cmd -f ./.env.submit ./scripts/submit.sh",
21-
"submit:dry": "pnpm -s submit --dry-run"
19+
"postinstall": "wxt prepare"
2220
},
2321
"dependencies": {
2422
"@aklinker1/check": "^1.2.0",
23+
"@tanstack/vue-query": "^5.59.13",
2524
"@vueuse/core": "^9",
2625
"@webext-core/messaging": "^1.4.0",
2726
"@webext-core/proxy-service": "^1.2.0",
2827
"async-mutex": "^0.4.0",
2928
"daisyui": "^3.7.7",
3029
"fast-deep-equal": "^3.1.3",
3130
"minimatch": "^9.0.3",
32-
"ofetch": "^1.3.3",
33-
"vue-query": "^1.26.0"
31+
"ofetch": "^1.3.3"
3432
},
3533
"devDependencies": {
3634
"@aklinker1/generate-changelog": "^1.1.2",
3735
"@iconify/json": "^2.2.119",
36+
"@types/bun": "^1.1.11",
3837
"@types/chrome": "^0.0.269",
3938
"@types/jsdom": "^21.1.3",
40-
"@vitejs/plugin-vue": "^5.0.4",
41-
"@vitest/coverage-v8": "^1.3.1",
39+
"@vitest/coverage-v8": "^2.1.3",
4240
"@wxt-dev/module-vue": "^1.0.0",
4341
"autoprefixer": "^10.4.16",
4442
"env-cmd": "^10.1.0",
@@ -52,23 +50,16 @@
5250
"simple-git-hooks": "^2.9.0",
5351
"tailwindcss": "^3.3.3",
5452
"tsx": "^3.12.10",
55-
"typescript": "^5.4.2",
56-
"unplugin-icons": "^0.17.0",
57-
"vitest": "^1.3.1",
53+
"typescript": "^5.6.3",
54+
"unplugin-icons": "^0.19.3",
55+
"vitest": "^2.1.3",
5856
"vue": "^3.4.21",
59-
"vue-tsc": "^2.0.6",
57+
"vue-tsc": "^2.1.6",
6058
"webextension-polyfill": "0.12.0",
61-
"wxt": "0.19.1"
62-
},
63-
"pnpm": {
64-
"peerDependencyRules": {
65-
"allowAny": [
66-
"node-fetch"
67-
]
68-
}
59+
"wxt": "^0.19.11"
6960
},
7061
"simple-git-hooks": {
71-
"pre-commit": "pnpm lint-staged"
62+
"pre-commit": "bun lint-staged"
7263
},
7364
"lint-staged": {
7465
"*": "prettier --write"

0 commit comments

Comments
 (0)