extension-develop 2.0.0-rc.33 → 2.0.0-rc.35
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/dist/ensure-hmr-for-scripts.js +32 -29
- package/dist/module.js +35 -33
- package/package.json +8 -6
|
@@ -97,35 +97,38 @@ function getAssetsFromHtml(htmlFilePath, htmlContent, publicPath = 'public') {
|
|
|
97
97
|
static: []
|
|
98
98
|
};
|
|
99
99
|
if (!htmlFilePath) return assets;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
100
|
+
try {
|
|
101
|
+
const htmlString = htmlContent || external_fs_namespaceObject.readFileSync(htmlFilePath, {
|
|
102
|
+
encoding: 'utf8'
|
|
103
|
+
});
|
|
104
|
+
if (!htmlString) return assets;
|
|
105
|
+
const htmlDocument = external_parse5_utilities_namespaceObject.parse(htmlString);
|
|
106
|
+
const getAbsolutePath = (htmlFilePath, filePath)=>{
|
|
107
|
+
if (filePath.startsWith('/')) return filePath;
|
|
108
|
+
return external_path_namespaceObject.join(external_path_namespaceObject.dirname(htmlFilePath), filePath);
|
|
109
|
+
};
|
|
110
|
+
parseHtml(htmlDocument, ({ filePath, assetType })=>{
|
|
111
|
+
const fileAbsolutePath = getAbsolutePath(htmlFilePath, filePath);
|
|
112
|
+
switch(assetType){
|
|
113
|
+
case "script":
|
|
114
|
+
var _assets_js;
|
|
115
|
+
null == (_assets_js = assets.js) || _assets_js.push(fileAbsolutePath);
|
|
116
|
+
break;
|
|
117
|
+
case 'css':
|
|
118
|
+
var _assets_css;
|
|
119
|
+
null == (_assets_css = assets.css) || _assets_css.push(fileAbsolutePath);
|
|
120
|
+
break;
|
|
121
|
+
case 'staticSrc':
|
|
122
|
+
case 'staticHref':
|
|
123
|
+
var _assets_static;
|
|
124
|
+
if (filePath.startsWith('#')) break;
|
|
125
|
+
null == (_assets_static = assets.static) || _assets_static.push(fileAbsolutePath);
|
|
126
|
+
break;
|
|
127
|
+
default:
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
} catch (error) {}
|
|
129
132
|
return assets;
|
|
130
133
|
}
|
|
131
134
|
require("child_process");
|
package/dist/module.js
CHANGED
|
@@ -164,7 +164,7 @@ const GECKO_BASED_BROWSERS = [
|
|
|
164
164
|
];
|
|
165
165
|
const external_console_namespaceObject = require("console");
|
|
166
166
|
var package_namespaceObject = {
|
|
167
|
-
i8: "2.0.0-rc.
|
|
167
|
+
i8: "2.0.0-rc.35"
|
|
168
168
|
};
|
|
169
169
|
function getLoggingPrefix(feature, type) {
|
|
170
170
|
if ('error' === type) return `${external_chalk_default().bold(external_chalk_default().red('ERROR'))} in ${feature} ${external_chalk_default().red("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`;
|
|
@@ -1108,7 +1108,6 @@ async function maybeUseVue(projectPath) {
|
|
|
1108
1108
|
} catch (e) {
|
|
1109
1109
|
const vueDependencies = [
|
|
1110
1110
|
'vue-loader',
|
|
1111
|
-
'vue-template-compiler',
|
|
1112
1111
|
'@vue/compiler-sfc'
|
|
1113
1112
|
];
|
|
1114
1113
|
await utils_installOptionalDependencies('Vue', vueDependencies);
|
|
@@ -2340,35 +2339,38 @@ function getAssetsFromHtml(htmlFilePath, htmlContent, publicPath = 'public') {
|
|
|
2340
2339
|
static: []
|
|
2341
2340
|
};
|
|
2342
2341
|
if (!htmlFilePath) return assets;
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2342
|
+
try {
|
|
2343
|
+
const htmlString = htmlContent || external_fs_namespaceObject.readFileSync(htmlFilePath, {
|
|
2344
|
+
encoding: 'utf8'
|
|
2345
|
+
});
|
|
2346
|
+
if (!htmlString) return assets;
|
|
2347
|
+
const htmlDocument = external_parse5_utilities_namespaceObject.parse(htmlString);
|
|
2348
|
+
const getAbsolutePath = (htmlFilePath, filePath)=>{
|
|
2349
|
+
if (filePath.startsWith('/')) return filePath;
|
|
2350
|
+
return external_path_namespaceObject.join(external_path_namespaceObject.dirname(htmlFilePath), filePath);
|
|
2351
|
+
};
|
|
2352
|
+
parseHtml(htmlDocument, ({ filePath, assetType })=>{
|
|
2353
|
+
const fileAbsolutePath = getAbsolutePath(htmlFilePath, filePath);
|
|
2354
|
+
switch(assetType){
|
|
2355
|
+
case "script":
|
|
2356
|
+
var _assets_js;
|
|
2357
|
+
null == (_assets_js = assets.js) || _assets_js.push(fileAbsolutePath);
|
|
2358
|
+
break;
|
|
2359
|
+
case 'css':
|
|
2360
|
+
var _assets_css;
|
|
2361
|
+
null == (_assets_css = assets.css) || _assets_css.push(fileAbsolutePath);
|
|
2362
|
+
break;
|
|
2363
|
+
case 'staticSrc':
|
|
2364
|
+
case 'staticHref':
|
|
2365
|
+
var _assets_static;
|
|
2366
|
+
if (filePath.startsWith('#')) break;
|
|
2367
|
+
null == (_assets_static = assets.static) || _assets_static.push(fileAbsolutePath);
|
|
2368
|
+
break;
|
|
2369
|
+
default:
|
|
2370
|
+
break;
|
|
2371
|
+
}
|
|
2372
|
+
});
|
|
2373
|
+
} catch (error) {}
|
|
2372
2374
|
return assets;
|
|
2373
2375
|
}
|
|
2374
2376
|
function getHtmlPageDeclaredAssetPath(filepathList, filePath, extension) {
|
|
@@ -6178,10 +6180,10 @@ async function generateExtensionTypes(projectPath) {
|
|
|
6178
6180
|
// If you need additional types, consider creating a new *.d.ts file and
|
|
6179
6181
|
// referencing it in the "include" array of your tsconfig.json file.
|
|
6180
6182
|
// See https://www.typescriptlang.org/tsconfig#include for more information.
|
|
6181
|
-
/// <reference types="${typePath}" />
|
|
6183
|
+
/// <reference types="${typePath}/types" />
|
|
6182
6184
|
|
|
6183
6185
|
// Polyfill types for browser.* APIs
|
|
6184
|
-
/// <reference types="${typePath}/polyfill" />
|
|
6186
|
+
/// <reference types="${typePath}/types/polyfill" />
|
|
6185
6187
|
`;
|
|
6186
6188
|
try {
|
|
6187
6189
|
await promises_namespaceObject.access(extensionEnvFile);
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"name": "extension-develop",
|
|
24
|
-
"version": "2.0.0-rc.
|
|
24
|
+
"version": "2.0.0-rc.35",
|
|
25
25
|
"description": "The develop step of Extension.js",
|
|
26
26
|
"author": {
|
|
27
27
|
"name": "Cezar Augusto",
|
|
@@ -30,11 +30,12 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@rspack/core": "^1.3.8",
|
|
33
|
-
"@rspack/dev-server": "^1.1.
|
|
33
|
+
"@rspack/dev-server": "^1.1.3",
|
|
34
34
|
"@swc/helpers": "^0.5.15",
|
|
35
|
+
"@types/webextension-polyfill": "0.12.3",
|
|
35
36
|
"@vue/compiler-sfc": "^3.5.13",
|
|
36
37
|
"adm-zip": "^0.5.16",
|
|
37
|
-
"axios": "^1.
|
|
38
|
+
"axios": "^1.9.0",
|
|
38
39
|
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|
|
39
40
|
"chalk": "^5.3.0",
|
|
40
41
|
"chokidar": "^4.0.1",
|
|
@@ -78,10 +79,12 @@
|
|
|
78
79
|
"@types/node": "^22.10.1",
|
|
79
80
|
"@types/sass-loader": "8.0.9",
|
|
80
81
|
"@types/ws": "^8.5.13",
|
|
82
|
+
"@vitest/coverage-v8": "3.2.2",
|
|
81
83
|
"jest": "^29.7.0",
|
|
82
84
|
"ts-jest": "^29.3.1",
|
|
83
85
|
"tsup": "^8.3.5",
|
|
84
|
-
"typescript": "5.7.2"
|
|
86
|
+
"typescript": "5.7.2",
|
|
87
|
+
"vitest": "3.2.2"
|
|
85
88
|
},
|
|
86
89
|
"optionalDependencies": {
|
|
87
90
|
"@prefresh/core": "^1.5.2",
|
|
@@ -97,8 +100,7 @@
|
|
|
97
100
|
"sass-loader": "^16.0.4",
|
|
98
101
|
"svelte-loader": "^3.2.4",
|
|
99
102
|
"vue-loader": "^17.4.2",
|
|
100
|
-
"vue-style-loader": "^4.1.3"
|
|
101
|
-
"vue-template-compiler": "^2.7.16"
|
|
103
|
+
"vue-style-loader": "^4.1.3"
|
|
102
104
|
},
|
|
103
105
|
"scripts": {
|
|
104
106
|
"clean": "rm -rf dist",
|