chrome-webstore-upload 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -0
- package/package.json +10 -3
package/index.js
CHANGED
|
@@ -15,6 +15,10 @@ const requiredFields = ['extensionId', 'clientId', 'refreshToken'];
|
|
|
15
15
|
|
|
16
16
|
class APIClient {
|
|
17
17
|
constructor(options) {
|
|
18
|
+
if (typeof fetch !== 'function') {
|
|
19
|
+
throw new TypeError('`chrome-webstore-upload` requires Node.js 18.0 or newer because it relies on the global `fetch` function.');
|
|
20
|
+
}
|
|
21
|
+
|
|
18
22
|
for (const field of requiredFields) {
|
|
19
23
|
if (!options[field]) {
|
|
20
24
|
throw new Error(`Option "${field}" is required`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chrome-webstore-upload",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "Upload Chrome Extensions to the Chrome Web Store",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chrome",
|
|
@@ -25,7 +25,12 @@
|
|
|
25
25
|
"index.js"
|
|
26
26
|
],
|
|
27
27
|
"scripts": {
|
|
28
|
-
"test": "xo && vitest"
|
|
28
|
+
"test": "xo && vitest run",
|
|
29
|
+
"upload": "npm run bundle && npm run test:upload",
|
|
30
|
+
"prebundle": "dot-json test/extension/manifest.json version $(utc-version)",
|
|
31
|
+
"bundle": "web-ext build --filename live-test.zip --overwrite-dest",
|
|
32
|
+
"postbundle": "git restore test/extension/manifest.json",
|
|
33
|
+
"test:upload": "eval $(cat .env) node test/live-test.js"
|
|
29
34
|
},
|
|
30
35
|
"xo": {
|
|
31
36
|
"rules": {
|
|
@@ -38,8 +43,10 @@
|
|
|
38
43
|
"space": 4
|
|
39
44
|
},
|
|
40
45
|
"devDependencies": {
|
|
46
|
+
"dot-json": "^1.3.0",
|
|
41
47
|
"fetch-mock": "^9.11.0",
|
|
42
48
|
"node-fetch": "^2.7.0",
|
|
49
|
+
"utc-version": "^2.0.2",
|
|
43
50
|
"vitest": "^1.0.4",
|
|
44
51
|
"xo": "^0.56.0"
|
|
45
52
|
},
|
|
@@ -47,6 +54,6 @@
|
|
|
47
54
|
"node": ">=18"
|
|
48
55
|
},
|
|
49
56
|
"webExt": {
|
|
50
|
-
"sourceDir": "
|
|
57
|
+
"sourceDir": "test/extension"
|
|
51
58
|
}
|
|
52
59
|
}
|