extension-develop 3.0.0-next.9 → 3.1.0-next.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/README.md +56 -16
- package/dist/215.js +546 -0
- package/dist/323.js +425 -0
- package/dist/329.js +9094 -0
- package/dist/419.js +44 -0
- package/dist/552.js +54 -0
- package/dist/814.js +127125 -0
- package/dist/814.js.LICENSE.txt +24 -0
- package/dist/928.js +416 -0
- package/dist/add-centralized-logger-script-background.js +3 -3
- package/dist/add-centralized-logger-script-content.js +4 -4
- package/dist/add-centralized-logger-script.js +18 -27
- package/dist/add-hmr-accept-code.js +3 -3
- package/dist/content-script-wrapper.js +114 -32
- package/dist/ensure-hmr-for-scripts.js +3 -3
- package/dist/extension-js-devtools/chrome/assets/logo.7dc70d61.png +0 -0
- package/dist/extension-js-devtools/chrome/background/service_worker.js +26 -0
- package/dist/extension-js-devtools/chrome/chrome_url_overrides/newtab.html +23 -0
- package/dist/extension-js-devtools/chrome/devtools/index.html +12 -0
- package/dist/extension-js-devtools/chrome/devtools/index.js +1 -0
- package/dist/extension-js-devtools/chrome/icons/logo.png +0 -0
- package/dist/extension-js-devtools/chrome/logo.png +0 -0
- package/dist/extension-js-devtools/chrome/manifest.json +44 -0
- package/dist/extension-js-devtools/chrome/pages/centralized-logger.css +2 -0
- package/dist/extension-js-devtools/chrome/pages/centralized-logger.html +12 -0
- package/dist/extension-js-devtools/chrome/pages/centralized-logger.js +16 -0
- package/dist/extension-js-devtools/chrome/pages/welcome.css +2 -0
- package/dist/extension-js-devtools/chrome/pages/welcome.html +11 -0
- package/dist/extension-js-devtools/chrome/pages/welcome.js +21 -0
- package/dist/extension-js-devtools/chrome/scripts/logger-client.js +1 -0
- package/dist/extension-js-devtools/chromium/assets/logo.7dc70d61.png +0 -0
- package/dist/extension-js-devtools/chromium/background/service_worker.js +26 -0
- package/dist/extension-js-devtools/chromium/chrome_url_overrides/newtab.html +23 -0
- package/dist/extension-js-devtools/chromium/devtools/index.html +12 -0
- package/dist/extension-js-devtools/chromium/devtools/index.js +1 -0
- package/dist/extension-js-devtools/chromium/icons/logo.png +0 -0
- package/dist/extension-js-devtools/chromium/logo.png +0 -0
- package/dist/extension-js-devtools/chromium/manifest.json +44 -0
- package/dist/extension-js-devtools/chromium/pages/centralized-logger.css +2 -0
- package/dist/extension-js-devtools/chromium/pages/centralized-logger.html +12 -0
- package/dist/extension-js-devtools/chromium/pages/centralized-logger.js +16 -0
- package/dist/extension-js-devtools/chromium/pages/welcome.css +2 -0
- package/dist/extension-js-devtools/chromium/pages/welcome.html +11 -0
- package/dist/extension-js-devtools/chromium/pages/welcome.js +21 -0
- package/dist/extension-js-devtools/chromium/scripts/logger-client.js +1 -0
- package/dist/extension-js-devtools/edge/assets/logo.7dc70d61.png +0 -0
- package/dist/extension-js-devtools/edge/background/service_worker.js +26 -0
- package/dist/extension-js-devtools/edge/chrome_url_overrides/newtab.html +23 -0
- package/dist/extension-js-devtools/edge/devtools/index.html +12 -0
- package/dist/extension-js-devtools/edge/devtools/index.js +1 -0
- package/dist/extension-js-devtools/edge/icons/logo.png +0 -0
- package/dist/extension-js-devtools/edge/logo.png +0 -0
- package/dist/extension-js-devtools/edge/manifest.json +44 -0
- package/dist/extension-js-devtools/edge/pages/centralized-logger.css +2 -0
- package/dist/extension-js-devtools/edge/pages/centralized-logger.html +12 -0
- package/dist/extension-js-devtools/edge/pages/centralized-logger.js +16 -0
- package/dist/extension-js-devtools/edge/pages/welcome.css +2 -0
- package/dist/extension-js-devtools/edge/pages/welcome.html +11 -0
- package/dist/extension-js-devtools/edge/pages/welcome.js +21 -0
- package/dist/extension-js-devtools/edge/scripts/logger-client.js +1 -0
- package/dist/extension-js-devtools/firefox/assets/logo.7dc70d61.png +0 -0
- package/dist/extension-js-devtools/firefox/background/scripts.js +26 -0
- package/dist/extension-js-devtools/firefox/devtools/index.html +12 -0
- package/dist/extension-js-devtools/firefox/devtools/index.js +1 -0
- package/dist/extension-js-devtools/firefox/icons/logo.png +0 -0
- package/dist/extension-js-devtools/firefox/logo.png +0 -0
- package/dist/extension-js-devtools/firefox/manifest.json +30 -0
- package/dist/extension-js-devtools/firefox/pages/centralized-logger.css +2 -0
- package/dist/extension-js-devtools/firefox/pages/centralized-logger.html +12 -0
- package/dist/extension-js-devtools/firefox/pages/centralized-logger.js +16 -0
- package/dist/extension-js-devtools/firefox/pages/welcome.css +2 -0
- package/dist/extension-js-devtools/firefox/pages/welcome.html +11 -0
- package/dist/extension-js-devtools/firefox/pages/welcome.js +21 -0
- package/dist/extension-js-devtools/firefox/scripts/logger-client.js +1 -0
- package/dist/extension-js-theme/chrome/manifest.json +65 -0
- package/dist/extension-js-theme/chromium/manifest.json +65 -0
- package/dist/extension-js-theme/edge/manifest.json +65 -0
- package/dist/extension-js-theme/firefox/manifest.json +6 -0
- package/dist/main-world-bridge.js +109 -0
- package/dist/minimum-chromium-file.js +2 -3
- package/dist/minimum-firefox-file.js +2 -3
- package/dist/minimum-script-file.js +25 -1
- package/dist/module.js +4774 -13450
- package/dist/resolve-paths-loader.js +61 -102
- package/dist/warn-no-default-export.js +173 -10
- package/package.json +55 -49
- package/dist/930.js +0 -44
|
@@ -22,7 +22,7 @@ var __webpack_require__ = {};
|
|
|
22
22
|
})();
|
|
23
23
|
(()=>{
|
|
24
24
|
__webpack_require__.r = (exports1)=>{
|
|
25
|
-
if (
|
|
25
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
26
|
value: 'Module'
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports1, '__esModule', {
|
|
@@ -39,6 +39,7 @@ const external_fs_namespaceObject = require("fs");
|
|
|
39
39
|
var external_fs_default = /*#__PURE__*/ __webpack_require__.n(external_fs_namespaceObject);
|
|
40
40
|
const external_path_namespaceObject = require("path");
|
|
41
41
|
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
42
|
+
const core_namespaceObject = require("@swc/core");
|
|
42
43
|
const external_schema_utils_namespaceObject = require("schema-utils");
|
|
43
44
|
const schema = {
|
|
44
45
|
type: 'object',
|
|
@@ -54,6 +55,136 @@ const schema = {
|
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
};
|
|
58
|
+
function getSourceSignature(source) {
|
|
59
|
+
const head = source.slice(0, 64);
|
|
60
|
+
const tail = source.slice(-64);
|
|
61
|
+
return `${source.length}:${head}:${tail}`;
|
|
62
|
+
}
|
|
63
|
+
function analyzeDefaultExport(source, resourcePath, compilation) {
|
|
64
|
+
const abs = external_path_default().normalize(resourcePath);
|
|
65
|
+
const sig = getSourceSignature(source);
|
|
66
|
+
const cacheKey = `${abs}|${sig}`;
|
|
67
|
+
try {
|
|
68
|
+
const compilationAny = compilation;
|
|
69
|
+
if (compilationAny) {
|
|
70
|
+
compilationAny.__extjsDefaultExportAnalysisCache ??= new Map();
|
|
71
|
+
const cached = compilationAny.__extjsDefaultExportAnalysisCache.get(cacheKey);
|
|
72
|
+
if (cached) return cached;
|
|
73
|
+
}
|
|
74
|
+
const ext = external_path_default().extname(resourcePath).toLowerCase();
|
|
75
|
+
const isTS = '.ts' === ext || '.tsx' === ext || '.mts' === ext || '.mtsx' === ext;
|
|
76
|
+
const isJSX = '.jsx' === ext || '.tsx' === ext || '.mjsx' === ext || '.mtsx' === ext;
|
|
77
|
+
const ast = (0, core_namespaceObject.parseSync)(source, {
|
|
78
|
+
syntax: isTS ? "typescript" : "ecmascript",
|
|
79
|
+
tsx: isTS && isJSX,
|
|
80
|
+
jsx: !isTS && isJSX,
|
|
81
|
+
decorators: true,
|
|
82
|
+
dynamicImport: true,
|
|
83
|
+
importAssertions: true,
|
|
84
|
+
topLevelAwait: true
|
|
85
|
+
});
|
|
86
|
+
const body = Array.isArray(ast?.body) ? ast.body : [];
|
|
87
|
+
const bindings = new Map();
|
|
88
|
+
const recordBinding = (name, kind)=>{
|
|
89
|
+
if ('string' == typeof name && name) bindings.set(name, kind);
|
|
90
|
+
};
|
|
91
|
+
const inspectDecl = (node)=>{
|
|
92
|
+
if ('FunctionDeclaration' === node.type) {
|
|
93
|
+
const id = node.identifier;
|
|
94
|
+
recordBinding(id?.value, 'function');
|
|
95
|
+
} else if ('ClassDeclaration' === node.type) {
|
|
96
|
+
const id = node.identifier;
|
|
97
|
+
recordBinding(id?.value, 'class');
|
|
98
|
+
} else if ('VariableDeclaration' === node.type) {
|
|
99
|
+
const decls = node.declarations;
|
|
100
|
+
if (!Array.isArray(decls)) return;
|
|
101
|
+
for (const d of decls){
|
|
102
|
+
if (!d || 'object' != typeof d) continue;
|
|
103
|
+
const dd = d;
|
|
104
|
+
const id = dd.id;
|
|
105
|
+
const init = dd.init;
|
|
106
|
+
if (id?.type !== 'Identifier') continue;
|
|
107
|
+
const name = id.value;
|
|
108
|
+
const initType = init?.type;
|
|
109
|
+
if ('FunctionExpression' === initType || 'ArrowFunctionExpression' === initType) recordBinding(name, 'function');
|
|
110
|
+
else if ('ClassExpression' === initType) recordBinding(name, 'class');
|
|
111
|
+
else if (initType) recordBinding(name, 'other');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
for (const item of body){
|
|
116
|
+
if (!item || 'object' != typeof item) continue;
|
|
117
|
+
const it = item;
|
|
118
|
+
if ('FunctionDeclaration' === it.type || 'ClassDeclaration' === it.type || 'VariableDeclaration' === it.type) inspectDecl(it);
|
|
119
|
+
if ('ExportNamedDeclaration' === it.type) {
|
|
120
|
+
const decl = it.declaration;
|
|
121
|
+
if (decl && 'object' == typeof decl) inspectDecl(decl);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const resolveIdentifierKind = (name)=>bindings.get(name) ?? 'unknown';
|
|
125
|
+
const analysis = {
|
|
126
|
+
hasDefaultExport: false,
|
|
127
|
+
kind: 'none'
|
|
128
|
+
};
|
|
129
|
+
for (const item of body){
|
|
130
|
+
if (!item || 'object' != typeof item) continue;
|
|
131
|
+
const it = item;
|
|
132
|
+
if ('ExportDefaultDeclaration' === it.type) {
|
|
133
|
+
analysis.hasDefaultExport = true;
|
|
134
|
+
const decl = it.decl;
|
|
135
|
+
const declType = decl?.type;
|
|
136
|
+
if ('FunctionDeclaration' === declType || 'FunctionExpression' === declType) analysis.kind = 'function';
|
|
137
|
+
else if ('ClassDeclaration' === declType || 'ClassExpression' === declType) analysis.kind = 'class';
|
|
138
|
+
else analysis.kind = 'other';
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
if ('ExportDefaultExpression' === it.type) {
|
|
142
|
+
analysis.hasDefaultExport = true;
|
|
143
|
+
const expr = it.expression;
|
|
144
|
+
const exprType = expr?.type;
|
|
145
|
+
if ('FunctionExpression' === exprType || 'ArrowFunctionExpression' === exprType) analysis.kind = 'function';
|
|
146
|
+
else if ('ClassExpression' === exprType) analysis.kind = 'class';
|
|
147
|
+
else if ('Identifier' === exprType && 'string' == typeof expr?.value) analysis.kind = resolveIdentifierKind(expr.value);
|
|
148
|
+
else analysis.kind = 'other';
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
if ('ExportNamedDeclaration' === it.type && Array.isArray(it.specifiers)) {
|
|
152
|
+
for (const specifier of it.specifiers){
|
|
153
|
+
if (!specifier || 'object' != typeof specifier) continue;
|
|
154
|
+
const spec = specifier;
|
|
155
|
+
if ('ExportSpecifier' !== spec.type) continue;
|
|
156
|
+
const exported = spec.exported;
|
|
157
|
+
const orig = spec.orig;
|
|
158
|
+
const exportedType = exported?.type;
|
|
159
|
+
const exportedValue = exported?.value;
|
|
160
|
+
const isDefault = 'Identifier' === exportedType ? 'default' === exportedValue : 'Ident' === exportedType ? 'default' === exportedValue : 'Str' === exportedType ? 'default' === exportedValue : false;
|
|
161
|
+
if (isDefault) {
|
|
162
|
+
analysis.hasDefaultExport = true;
|
|
163
|
+
if (orig?.type === 'Identifier' && 'string' == typeof orig?.value) analysis.kind = resolveIdentifierKind(orig.value);
|
|
164
|
+
else analysis.kind = 'unknown';
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (analysis.hasDefaultExport) break;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (compilationAny) compilationAny.__extjsDefaultExportAnalysisCache.set(cacheKey, analysis);
|
|
172
|
+
return analysis;
|
|
173
|
+
} catch {
|
|
174
|
+
const fallback = source.includes('export default') ? {
|
|
175
|
+
hasDefaultExport: true,
|
|
176
|
+
kind: 'unknown'
|
|
177
|
+
} : {
|
|
178
|
+
hasDefaultExport: false,
|
|
179
|
+
kind: 'none'
|
|
180
|
+
};
|
|
181
|
+
try {
|
|
182
|
+
const compilationAny = compilation;
|
|
183
|
+
if (compilationAny?.__extjsDefaultExportAnalysisCache) compilationAny.__extjsDefaultExportAnalysisCache.set(cacheKey, fallback);
|
|
184
|
+
} catch {}
|
|
185
|
+
return fallback;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
57
188
|
function warn_no_default_export(source) {
|
|
58
189
|
const options = this.getOptions();
|
|
59
190
|
const manifestPath = options.manifestPath;
|
|
@@ -76,14 +207,46 @@ function warn_no_default_export(source) {
|
|
|
76
207
|
const declaredContentJsAbsPaths = [];
|
|
77
208
|
const contentScripts = Array.isArray(manifest.content_scripts) ? manifest.content_scripts : [];
|
|
78
209
|
for (const contentScript of contentScripts){
|
|
79
|
-
const contentScriptJsList = Array.isArray(
|
|
210
|
+
const contentScriptJsList = Array.isArray(contentScript?.js) ? contentScript.js : [];
|
|
80
211
|
for (const contentScriptJs of contentScriptJsList)declaredContentJsAbsPaths.push(external_path_default().resolve(projectPath, contentScriptJs));
|
|
81
212
|
}
|
|
82
213
|
const isDeclaredContentScript = declaredContentJsAbsPaths.some((abs)=>resourceAbsPath === external_path_default().normalize(abs));
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
214
|
+
const scriptsDir = external_path_default().resolve(projectPath, "scripts");
|
|
215
|
+
const relToScripts = external_path_default().relative(scriptsDir, resourceAbsPath);
|
|
216
|
+
const isScriptsFolderScript = relToScripts && !relToScripts.startsWith('..') && !external_path_default().isAbsolute(relToScripts);
|
|
217
|
+
const isContentScriptLike = isDeclaredContentScript || isScriptsFolderScript;
|
|
218
|
+
if (isContentScriptLike) {
|
|
219
|
+
const analysis = analyzeDefaultExport(source, this.resourcePath, compilation);
|
|
220
|
+
if (analysis.hasDefaultExport) {
|
|
221
|
+
if ('class' === analysis.kind || 'other' === analysis.kind) {
|
|
222
|
+
const dedupeKindKey = `default-not-callable:${resourceAbsPath}`;
|
|
223
|
+
if (compilation) {
|
|
224
|
+
compilation.__extjsWarnedDefaultExportKinds ??= new Set();
|
|
225
|
+
if (compilation.__extjsWarnedDefaultExportKinds.has(dedupeKindKey)) return source;
|
|
226
|
+
}
|
|
227
|
+
const relativeFile = external_path_default().relative(projectPath, resourceAbsPath);
|
|
228
|
+
const found = 'class' === analysis.kind ? 'class' : 'non-callable value';
|
|
229
|
+
const message = [
|
|
230
|
+
"Content script default export must be a function.",
|
|
231
|
+
`File: ${relativeFile}`,
|
|
232
|
+
"",
|
|
233
|
+
`Found: ${found}`,
|
|
234
|
+
"",
|
|
235
|
+
"Fix:",
|
|
236
|
+
" - Export a default function that sets up your script and returns optional cleanup.",
|
|
237
|
+
" - If you want to use a class, instantiate it inside the default function and call its methods.",
|
|
238
|
+
"",
|
|
239
|
+
"Example:",
|
|
240
|
+
" class App { start(){} stop(){} }",
|
|
241
|
+
" export default function main(){",
|
|
242
|
+
" const app = new App(); app.start();",
|
|
243
|
+
" return () => app.stop();",
|
|
244
|
+
" }"
|
|
245
|
+
].join('\n');
|
|
246
|
+
compilation?.warnings.push(message);
|
|
247
|
+
compilation?.__extjsWarnedDefaultExportKinds?.add(dedupeKindKey);
|
|
248
|
+
}
|
|
249
|
+
} else {
|
|
87
250
|
const relativeFile = external_path_default().relative(projectPath, resourceAbsPath);
|
|
88
251
|
const message = [
|
|
89
252
|
"Content script requires a default export.",
|
|
@@ -105,17 +268,17 @@ function warn_no_default_export(source) {
|
|
|
105
268
|
"Side effects if omitted:",
|
|
106
269
|
" - Duplicate UI mounts, memory leaks, and inconsistent state during development."
|
|
107
270
|
].join('\n');
|
|
108
|
-
|
|
109
|
-
|
|
271
|
+
compilation?.warnings.push(message);
|
|
272
|
+
compilation?.__extjsWarnedDefaultExport?.add(dedupeKey);
|
|
110
273
|
}
|
|
111
274
|
}
|
|
112
275
|
} catch {}
|
|
113
276
|
return source;
|
|
114
277
|
}
|
|
115
278
|
exports["default"] = __webpack_exports__["default"];
|
|
116
|
-
for(var
|
|
279
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
117
280
|
"default"
|
|
118
|
-
].indexOf(
|
|
281
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
119
282
|
Object.defineProperty(exports, '__esModule', {
|
|
120
283
|
value: true
|
|
121
284
|
});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"license": "MIT",
|
|
3
3
|
"repository": {
|
|
4
4
|
"type": "git",
|
|
5
|
-
"url": "https://github.com/extension-js/extension.js",
|
|
5
|
+
"url": "git+https://github.com/extension-js/extension.js.git",
|
|
6
6
|
"directory": "programs/develop"
|
|
7
7
|
},
|
|
8
8
|
"engines": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"development": "./module.ts",
|
|
13
14
|
"types": "./dist/module.d.ts",
|
|
14
15
|
"import": "./dist/module.js",
|
|
15
16
|
"require": "./dist/module.js"
|
|
@@ -21,19 +22,24 @@
|
|
|
21
22
|
"dist"
|
|
22
23
|
],
|
|
23
24
|
"name": "extension-develop",
|
|
24
|
-
"version": "3.
|
|
25
|
-
"description": "
|
|
25
|
+
"version": "3.1.0-next.2",
|
|
26
|
+
"description": "Develop, build, preview, and package Extension.js projects.",
|
|
26
27
|
"author": {
|
|
27
28
|
"name": "Cezar Augusto",
|
|
28
29
|
"email": "boss@cezaraugusto.net",
|
|
29
30
|
"url": "https://cezaraugusto.com"
|
|
30
31
|
},
|
|
32
|
+
"homepage": "https://github.com/extension-js/extension.js/tree/main/programs/develop#readme",
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/extension-js/extension.js/issues"
|
|
35
|
+
},
|
|
31
36
|
"publishConfig": {
|
|
32
37
|
"access": "public",
|
|
33
|
-
"registry": "https://registry.npmjs.org"
|
|
34
|
-
"tag": "latest"
|
|
38
|
+
"registry": "https://registry.npmjs.org"
|
|
35
39
|
},
|
|
36
40
|
"scripts": {
|
|
41
|
+
"prepublishOnly": "node scripts/sync-build-dependencies.mjs && rslib build && node ../../scripts/build-extensions.cjs",
|
|
42
|
+
"sync-build-deps": "node scripts/sync-build-dependencies.mjs",
|
|
37
43
|
"compile": "rslib build",
|
|
38
44
|
"watch": "rslib build --watch",
|
|
39
45
|
"test": "vitest run"
|
|
@@ -64,67 +70,67 @@
|
|
|
64
70
|
"edge-extension"
|
|
65
71
|
],
|
|
66
72
|
"dependencies": {
|
|
67
|
-
"@rspack/core": "^1.
|
|
68
|
-
"@rspack/dev-server": "^1.1.
|
|
69
|
-
"@swc/core": "^1.
|
|
70
|
-
"@swc/helpers": "^0.5.
|
|
73
|
+
"@rspack/core": "^1.7.2",
|
|
74
|
+
"@rspack/dev-server": "^1.1.5",
|
|
75
|
+
"@swc/core": "^1.15.8",
|
|
76
|
+
"@swc/helpers": "^0.5.18",
|
|
71
77
|
"adm-zip": "^0.5.16",
|
|
72
78
|
"browser-extension-manifest-fields": "^2.2.1",
|
|
73
79
|
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|
|
74
|
-
"chokidar": "^
|
|
75
|
-
"chrome-location2": "
|
|
76
|
-
"chromium-location": "
|
|
80
|
+
"chokidar": "^5.0.0",
|
|
81
|
+
"chrome-location2": "4.0.0",
|
|
82
|
+
"chromium-location": "2.0.0",
|
|
77
83
|
"content-security-policy-parser": "^0.6.0",
|
|
78
84
|
"cross-spawn": "^7.0.6",
|
|
79
|
-
"dotenv": "^
|
|
80
|
-
"edge-location": "
|
|
81
|
-
"firefox-location2": "
|
|
82
|
-
"go-git-it": "^5.0.
|
|
83
|
-
"ignore": "^
|
|
85
|
+
"dotenv": "^17.2.3",
|
|
86
|
+
"edge-location": "2.2.0",
|
|
87
|
+
"firefox-location2": "3.0.0",
|
|
88
|
+
"go-git-it": "^5.0.3",
|
|
89
|
+
"ignore": "^7.0.5",
|
|
84
90
|
"loader-utils": "^3.3.1",
|
|
85
|
-
"magic-string": "^0.30.
|
|
86
|
-
"package-manager-detector": "^
|
|
87
|
-
"parse5": "^
|
|
91
|
+
"magic-string": "^0.30.21",
|
|
92
|
+
"package-manager-detector": "^1.6.0",
|
|
93
|
+
"parse5": "^8.0.0",
|
|
88
94
|
"parse5-utilities": "^1.0.0",
|
|
89
95
|
"pintor": "0.3.0",
|
|
90
|
-
"schema-utils": "^4.
|
|
96
|
+
"schema-utils": "^4.3.3",
|
|
91
97
|
"tiny-glob": "^0.2.9",
|
|
92
98
|
"unique-names-generator": "^4.7.1",
|
|
93
99
|
"webextension-polyfill": "^0.12.0",
|
|
94
100
|
"webpack-merge": "^6.0.1",
|
|
95
101
|
"webpack-target-webextension": "^2.1.3",
|
|
96
|
-
"ws": "^8.
|
|
102
|
+
"ws": "^8.19.0"
|
|
97
103
|
},
|
|
98
104
|
"devDependencies": {
|
|
99
|
-
"@
|
|
105
|
+
"@prefresh/core": "1.5.9",
|
|
106
|
+
"@prefresh/utils": "1.2.1",
|
|
107
|
+
"@prefresh/webpack": "4.0.6",
|
|
108
|
+
"@rslib/core": "^0.19.2",
|
|
109
|
+
"@rspack/plugin-preact-refresh": "1.1.4",
|
|
110
|
+
"@rspack/plugin-react-refresh": "1.6.0",
|
|
100
111
|
"@types/adm-zip": "^0.5.7",
|
|
101
112
|
"@types/case-sensitive-paths-webpack-plugin": "^2.1.9",
|
|
102
|
-
"@types/chrome": "^0.
|
|
113
|
+
"@types/chrome": "^0.1.33",
|
|
103
114
|
"@types/cross-spawn": "^6.0.6",
|
|
104
|
-
"@types/loader-utils": "^
|
|
105
|
-
"@types/node": "^
|
|
106
|
-
"@types/sass-loader": "8.0.
|
|
107
|
-
"@types/webextension-polyfill": "0.12.
|
|
108
|
-
"@types/ws": "^8.
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"react-refresh": "^0.14.2",
|
|
125
|
-
"sass-loader": "^16.0.4",
|
|
126
|
-
"svelte-loader": "^3.2.4",
|
|
127
|
-
"vue-loader": "^17.4.2",
|
|
128
|
-
"vue-style-loader": "^4.1.3"
|
|
115
|
+
"@types/loader-utils": "^3.0.0",
|
|
116
|
+
"@types/node": "^25.0.9",
|
|
117
|
+
"@types/sass-loader": "8.0.10",
|
|
118
|
+
"@types/webextension-polyfill": "0.12.4",
|
|
119
|
+
"@types/ws": "^8.18.1",
|
|
120
|
+
"@vue/compiler-sfc": "3.5.26",
|
|
121
|
+
"less": "4.5.1",
|
|
122
|
+
"less-loader": "12.3.0",
|
|
123
|
+
"postcss": "^8.5.6",
|
|
124
|
+
"postcss-loader": "8.2.0",
|
|
125
|
+
"postcss-preset-env": "11.1.1",
|
|
126
|
+
"postcss-scss": "4.0.9",
|
|
127
|
+
"react-refresh": "0.18.0",
|
|
128
|
+
"sass-loader": "16.0.6",
|
|
129
|
+
"svelte-loader": "3.2.4",
|
|
130
|
+
"tsup": "^8.5.1",
|
|
131
|
+
"typescript": "5.9.3",
|
|
132
|
+
"vitest": "^4.0.17",
|
|
133
|
+
"vue-loader": "17.4.2",
|
|
134
|
+
"vue-style-loader": "4.1.3"
|
|
129
135
|
}
|
|
130
136
|
}
|
package/dist/930.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports.ids = [
|
|
3
|
-
"930"
|
|
4
|
-
];
|
|
5
|
-
exports.modules = {
|
|
6
|
-
"./webpack/webpack-lib/zip.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
8
|
-
downloadAndExtractZip: ()=>downloadAndExtractZip
|
|
9
|
-
});
|
|
10
|
-
var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("path");
|
|
11
|
-
var adm_zip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("adm-zip");
|
|
12
|
-
var adm_zip__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/ __webpack_require__.n(adm_zip__WEBPACK_IMPORTED_MODULE_1__);
|
|
13
|
-
var _messages__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./webpack/webpack-lib/messages.ts");
|
|
14
|
-
async function downloadAndExtractZip(url, targetPath) {
|
|
15
|
-
const urlNoSearchParams = url.split('?')[0];
|
|
16
|
-
try {
|
|
17
|
-
console.log(_messages__WEBPACK_IMPORTED_MODULE_2__.cq(urlNoSearchParams));
|
|
18
|
-
const res = await fetch(url, {
|
|
19
|
-
redirect: 'follow'
|
|
20
|
-
});
|
|
21
|
-
if (!res.ok || !res.body) throw new Error(`HTTP ${res.status} ${res.statusText}`);
|
|
22
|
-
const contentType = String(res.headers.get('content-type') || '');
|
|
23
|
-
const isZipExt = '.zip' === path__WEBPACK_IMPORTED_MODULE_0__.extname(urlNoSearchParams).toLowerCase();
|
|
24
|
-
const isZipType = /zip|octet-stream/i.test(contentType);
|
|
25
|
-
if (!isZipExt && !isZipType) throw new Error(`${_messages__WEBPACK_IMPORTED_MODULE_2__.wX(urlNoSearchParams, contentType)}`);
|
|
26
|
-
const extname = path__WEBPACK_IMPORTED_MODULE_0__.extname(urlNoSearchParams);
|
|
27
|
-
const basename = path__WEBPACK_IMPORTED_MODULE_0__.basename(urlNoSearchParams, extname);
|
|
28
|
-
const destinationPath = path__WEBPACK_IMPORTED_MODULE_0__.join(targetPath, basename);
|
|
29
|
-
console.log(_messages__WEBPACK_IMPORTED_MODULE_2__.WF(destinationPath));
|
|
30
|
-
const arrayBuffer = await res.arrayBuffer();
|
|
31
|
-
const zipBuffer = Buffer.from(arrayBuffer);
|
|
32
|
-
const zip = new (adm_zip__WEBPACK_IMPORTED_MODULE_1___default())(zipBuffer);
|
|
33
|
-
zip.extractAllTo(destinationPath, true);
|
|
34
|
-
console.log(_messages__WEBPACK_IMPORTED_MODULE_2__.aP());
|
|
35
|
-
return destinationPath;
|
|
36
|
-
} catch (error) {
|
|
37
|
-
console.error(_messages__WEBPACK_IMPORTED_MODULE_2__.QC(error));
|
|
38
|
-
const err = new Error(`${_messages__WEBPACK_IMPORTED_MODULE_2__.QC(error)}`);
|
|
39
|
-
err.code = 'EZIP';
|
|
40
|
-
throw err;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
};
|