Skip to content

Commit 29ff1c6

Browse files
authored
chore!: Drop CJS support and build package with tsdown (#45)
1 parent f2cc971 commit 29ff1c6

File tree

7 files changed

+154
-91
lines changed

7 files changed

+154
-91
lines changed

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- run: bun run build
1818
- run: bun check
1919
- run: bun test
20-
- run: node bin/publish-extension.cjs --help
20+
- run: bun bin/publish-extension.mjs --help
2121
e2e-tests:
2222
name: E2E Tests
2323
runs-on: ubuntu-24.04

bin/publish-extension.cjs

Lines changed: 0 additions & 2 deletions
This file was deleted.

bin/publish-extension.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env node
2+
import '../dist/cli.js';

bun.lock

Lines changed: 109 additions & 17 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 36 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,59 +3,12 @@
33
"description": "Easily publish web extensions to their stores",
44
"version": "3.0.3",
55
"packageManager": "[email protected]",
6-
"license": "MIT",
7-
"keywords": [
8-
"chrome-web-store",
9-
"firefox-addon-store",
10-
"chrome",
11-
"firefox",
12-
"addon",
13-
"store",
14-
"extension",
15-
"browser"
16-
],
17-
"author": {
18-
"name": "Aaron Klinker",
19-
"url": "https://github.com/aklinker1"
20-
},
21-
"repository": {
22-
"type": "git",
23-
"url": "git+https://github.com/aklinker1/publish-browser-extension.git"
24-
},
25-
"homepage": "https://github.com/aklinker1/publish-browser-extension#readme",
26-
"files": [
27-
"dist"
28-
],
296
"type": "module",
30-
"main": "dist/index.cjs",
31-
"module": "dist/index.js",
32-
"types": "dist/index.d.ts",
33-
"bin": {
34-
"publish-extension": "bin/publish-extension.cjs"
35-
},
36-
"exports": {
37-
".": {
38-
"require": {
39-
"types": "./dist/index.d.cts",
40-
"default": "./dist/index.cjs"
41-
},
42-
"import": {
43-
"types": "./dist/index.d.ts",
44-
"default": "./dist/index.js"
45-
}
46-
},
47-
"./cli": {
48-
"require": "./dist/cli.cjs",
49-
"import": "./dist/cli.js"
50-
}
51-
},
527
"scripts": {
538
"check": "check",
549
"build": "run-s build:*",
55-
"build:clean": "rimraf dist",
56-
"build:lib": "tsup src/index.ts --dts --format cjs,esm --sourcemap",
57-
"build:cli": "tsup --format cjs,esm --entry.cli src/cli.ts",
58-
"build:test-extension": "node scripts/build-test-extension.js",
10+
"build:lib": "tsdown src/index.ts src/cli.ts",
11+
"build:test-extension": "bun scripts/build-test-extension.js",
5912
"dev:all": "./scripts/dev.sh all",
6013
"dev:chrome": "./scripts/dev.sh chrome",
6114
"dev:firefox": "./scripts/dev.sh firefox",
@@ -87,8 +40,8 @@
8740
"oxlint": "^1.24.0",
8841
"prettier": "^3.6.2",
8942
"publint": "^0.2.12",
90-
"rimraf": "^4.4.1",
9143
"simple-git-hooks": "^2.13.1",
44+
"tsdown": "^0.15.9",
9245
"tsup": "^8.5.0",
9346
"typescript": "^5.9.3"
9447
},
@@ -98,9 +51,38 @@
9851
"lint-staged": {
9952
"*": "prettier --ignore-unknown --write"
10053
},
101-
"changelog": {
102-
"excludeAuthors": [
103-
104-
]
54+
"license": "MIT",
55+
"keywords": [
56+
"chrome-web-store",
57+
"firefox-addon-store",
58+
"chrome",
59+
"firefox",
60+
"addon",
61+
"store",
62+
"extension",
63+
"browser"
64+
],
65+
"author": {
66+
"name": "Aaron Klinker",
67+
"url": "https://github.com/aklinker1"
68+
},
69+
"repository": {
70+
"type": "git",
71+
"url": "git+https://github.com/aklinker1/publish-browser-extension.git"
72+
},
73+
"homepage": "https://github.com/aklinker1/publish-browser-extension#readme",
74+
"files": [
75+
"dist"
76+
],
77+
"module": "dist/index.js",
78+
"types": "dist/index.d.ts",
79+
"bin": {
80+
"publish-extension": "bin/publish-extension.mjs"
81+
},
82+
"exports": {
83+
".": {
84+
"types": "./dist/index.d.ts",
85+
"import": "./dist/index.js"
86+
}
10587
}
10688
}

scripts/dev.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ bun run build
55
TARGET="$1"
66

77
if [[ "$TARGET" == "all" ]]; then
8-
bun bin/publish-extension.cjs \
8+
bun bin/publish-extension.mjs \
99
--chrome-zip extension/chrome.zip \
1010
--firefox-zip extension/firefox.zip \
1111
--firefox-sources-zip extension/firefox.zip \
1212
--edge-zip extension/chrome.zip
1313
elif [[ "$TARGET" == "chrome" ]]; then
14-
bun bin/publish-extension.cjs --chrome-zip extension/chrome.zip
14+
bun bin/publish-extension.mjs --chrome-zip extension/chrome.zip
1515
elif [[ "$TARGET" == "firefox" ]]; then
16-
bun bin/publish-extension.cjs --firefox-zip extension/firefox.zip --firefox-sources-zip extension/firefox.zip
16+
bun bin/publish-extension.mjs --firefox-zip extension/firefox.zip --firefox-sources-zip extension/firefox.zip
1717
elif [[ "$TARGET" == "edge" ]]; then
18-
bun bin/publish-extension.cjs --edge-zip extension/chrome.zip
18+
bun bin/publish-extension.mjs --edge-zip extension/chrome.zip
1919
elif [[ "$TARGET" == "help" ]]; then
20-
bun bin/publish-extension.cjs --help
20+
bun bin/publish-extension.mjs --help
2121
else
2222
echo
2323
echo "Run 'bun dev:chrome' or 'bun dev:firefox' or 'bun dev:edge' or 'bun dev:all'"
24-
bun bin/publish-extension.cjs
24+
bun bin/publish-extension.mjs
2525
fi

tsconfig.build.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)