extension-develop 3.14.0 → 3.14.1
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/144.cjs
CHANGED
|
@@ -9066,7 +9066,7 @@ Set background.noDynamicEntryWarning to true to disable this warning.
|
|
|
9066
9066
|
minimize: 'production' === devOptions.mode,
|
|
9067
9067
|
sideEffects: true,
|
|
9068
9068
|
usedExports: 'global',
|
|
9069
|
-
concatenateModules:
|
|
9069
|
+
concatenateModules: 'production' === devOptions.mode,
|
|
9070
9070
|
splitChunks: false,
|
|
9071
9071
|
runtimeChunk: false,
|
|
9072
9072
|
moduleIds: 'deterministic',
|
|
@@ -68,6 +68,12 @@ function findNearestPackageJsonSync(manifestPath) {
|
|
|
68
68
|
return null;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
+
const external_pintor_namespaceObject = require("pintor");
|
|
72
|
+
var external_pintor_default = /*#__PURE__*/ __webpack_require__.n(external_pintor_namespaceObject);
|
|
73
|
+
function reservedScriptsFolder(relPath, indicators) {
|
|
74
|
+
const reasons = indicators.map((r)=>`- ${external_pintor_default().gray(r)}`).join('\n');
|
|
75
|
+
return `${external_pintor_default().red('ERROR')} scripts/ is a reserved folder in Extension.js.\nEvery file under ${external_pintor_default().yellow("scripts/")} is wrapped with the browser content-script mount runtime, so Node.js-only files placed here will fail to parse or run.\nRename the folder at the project root (for example ${external_pintor_default().yellow('bin/')}, ${external_pintor_default().yellow('tools/')}, ${external_pintor_default().yellow('ops/')}, ${external_pintor_default().yellow('tasks/')}, or ${external_pintor_default().yellow("ci-scripts/")}) or move the file out of scripts/.\n\n${external_pintor_default().red('NODE.JS SHAPE')}\n${reasons}\n${external_pintor_default().red('NOT ALLOWED')} ${external_pintor_default().underline(relPath)}`;
|
|
76
|
+
}
|
|
71
77
|
const schema = {
|
|
72
78
|
type: 'object',
|
|
73
79
|
properties: {
|
|
@@ -100,6 +106,12 @@ function createBuildToken(source) {
|
|
|
100
106
|
for(let index = 0; index < source.length; index++)hash = 31 * hash + source.charCodeAt(index) >>> 0;
|
|
101
107
|
return hash.toString(16);
|
|
102
108
|
}
|
|
109
|
+
function detectNodeJsShapedScript(source) {
|
|
110
|
+
const indicators = [];
|
|
111
|
+
if ('string' == typeof source && source.startsWith('#!')) indicators.push('shebang on line 1 (#!/usr/bin/env node ...)');
|
|
112
|
+
if ('string' == typeof source && /(?:^|\n)\s*(?:import[^\n;]*?from\s*|import\s*\(\s*|require\s*\(\s*)["']node:[\w/-]+["']/m.test(source)) indicators.push("import from the 'node:' protocol");
|
|
113
|
+
return indicators;
|
|
114
|
+
}
|
|
103
115
|
function collectStyleAssetSpecifiers(source) {
|
|
104
116
|
const SAFE_SPECIFIER = /^[\w./@~\-?&=#+%]+$/;
|
|
105
117
|
const styleSpecifiers = new Set();
|
|
@@ -207,6 +219,13 @@ function contentScriptWrapper(source) {
|
|
|
207
219
|
const scriptsDir = external_path_default().resolve(packageJsonDir, "scripts");
|
|
208
220
|
const relToScripts = external_path_default().relative(scriptsDir, resourceAbsPath);
|
|
209
221
|
const isScriptsFolderScript = relToScripts && !relToScripts.startsWith('..') && !external_path_default().isAbsolute(relToScripts);
|
|
222
|
+
if (isScriptsFolderScript && !declaredEntry) {
|
|
223
|
+
const nodeIndicators = detectNodeJsShapedScript(rewrittenSource);
|
|
224
|
+
if (nodeIndicators.length > 0) {
|
|
225
|
+
const relFromProject = external_path_default().relative(packageJsonDir, resourceAbsPath).split(external_path_default().sep).join('/');
|
|
226
|
+
throw new Error(reservedScriptsFolder(relFromProject, nodeIndicators));
|
|
227
|
+
}
|
|
228
|
+
}
|
|
210
229
|
const isContentScriptLike = Boolean(declaredEntry || isScriptsFolderScript);
|
|
211
230
|
if (!isContentScriptLike) return rewrittenSource;
|
|
212
231
|
const runAt = declaredEntry?.runAt || 'document_idle';
|
|
@@ -68,6 +68,12 @@ function findNearestPackageJsonSync(manifestPath) {
|
|
|
68
68
|
return null;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
+
const external_pintor_namespaceObject = require("pintor");
|
|
72
|
+
var external_pintor_default = /*#__PURE__*/ __webpack_require__.n(external_pintor_namespaceObject);
|
|
73
|
+
function reservedScriptsFolder(relPath, indicators) {
|
|
74
|
+
const reasons = indicators.map((r)=>`- ${external_pintor_default().gray(r)}`).join('\n');
|
|
75
|
+
return `${external_pintor_default().red('ERROR')} scripts/ is a reserved folder in Extension.js.\nEvery file under ${external_pintor_default().yellow("scripts/")} is wrapped with the browser content-script mount runtime, so Node.js-only files placed here will fail to parse or run.\nRename the folder at the project root (for example ${external_pintor_default().yellow('bin/')}, ${external_pintor_default().yellow('tools/')}, ${external_pintor_default().yellow('ops/')}, ${external_pintor_default().yellow('tasks/')}, or ${external_pintor_default().yellow("ci-scripts/")}) or move the file out of scripts/.\n\n${external_pintor_default().red('NODE.JS SHAPE')}\n${reasons}\n${external_pintor_default().red('NOT ALLOWED')} ${external_pintor_default().underline(relPath)}`;
|
|
76
|
+
}
|
|
71
77
|
const schema = {
|
|
72
78
|
type: 'object',
|
|
73
79
|
properties: {
|
|
@@ -100,6 +106,12 @@ function createBuildToken(source) {
|
|
|
100
106
|
for(let index = 0; index < source.length; index++)hash = 31 * hash + source.charCodeAt(index) >>> 0;
|
|
101
107
|
return hash.toString(16);
|
|
102
108
|
}
|
|
109
|
+
function detectNodeJsShapedScript(source) {
|
|
110
|
+
const indicators = [];
|
|
111
|
+
if ('string' == typeof source && source.startsWith('#!')) indicators.push('shebang on line 1 (#!/usr/bin/env node ...)');
|
|
112
|
+
if ('string' == typeof source && /(?:^|\n)\s*(?:import[^\n;]*?from\s*|import\s*\(\s*|require\s*\(\s*)["']node:[\w/-]+["']/m.test(source)) indicators.push("import from the 'node:' protocol");
|
|
113
|
+
return indicators;
|
|
114
|
+
}
|
|
103
115
|
function collectStyleAssetSpecifiers(source) {
|
|
104
116
|
const SAFE_SPECIFIER = /^[\w./@~\-?&=#+%]+$/;
|
|
105
117
|
const styleSpecifiers = new Set();
|
|
@@ -207,6 +219,13 @@ function contentScriptWrapper(source) {
|
|
|
207
219
|
const scriptsDir = external_path_default().resolve(packageJsonDir, "scripts");
|
|
208
220
|
const relToScripts = external_path_default().relative(scriptsDir, resourceAbsPath);
|
|
209
221
|
const isScriptsFolderScript = relToScripts && !relToScripts.startsWith('..') && !external_path_default().isAbsolute(relToScripts);
|
|
222
|
+
if (isScriptsFolderScript && !declaredEntry) {
|
|
223
|
+
const nodeIndicators = detectNodeJsShapedScript(rewrittenSource);
|
|
224
|
+
if (nodeIndicators.length > 0) {
|
|
225
|
+
const relFromProject = external_path_default().relative(packageJsonDir, resourceAbsPath).split(external_path_default().sep).join('/');
|
|
226
|
+
throw new Error(reservedScriptsFolder(relFromProject, nodeIndicators));
|
|
227
|
+
}
|
|
228
|
+
}
|
|
210
229
|
const isContentScriptLike = Boolean(declaredEntry || isScriptsFolderScript);
|
|
211
230
|
if (!isContentScriptLike) return rewrittenSource;
|
|
212
231
|
const runAt = declaredEntry?.runAt || 'document_idle';
|
package/dist/module.cjs
CHANGED
|
@@ -2216,7 +2216,7 @@ var __webpack_modules__ = {
|
|
|
2216
2216
|
module.exports = require("webpack-merge");
|
|
2217
2217
|
},
|
|
2218
2218
|
"./package.json" (module) {
|
|
2219
|
-
module.exports = JSON.parse('{"rE":"3.14.
|
|
2219
|
+
module.exports = JSON.parse('{"rE":"3.14.1","El":{"@prefresh/core":"1.5.9","@prefresh/utils":"1.2.1","@rspack/core":"^1.7.5","@rspack/dev-server":"^1.2.1","@rspack/plugin-preact-refresh":"1.1.4","@rspack/plugin-react-refresh":"1.6.0","@swc/core":"^1.15.8","@swc/helpers":"^0.5.18","@vue/compiler-sfc":"3.5.26","adm-zip":"^0.5.16","browser-extension-manifest-fields":"^2.2.1","case-sensitive-paths-webpack-plugin":"^2.4.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^17.2.3","extension-from-store":"^0.1.1","go-git-it":"^5.1.5","ignore":"^7.0.5","less":"4.5.1","less-loader":"12.3.0","loader-utils":"^3.3.1","magic-string":"^0.30.21","parse5-utilities":"^1.0.0","pintor":"0.3.0","postcss":"8.5.6","postcss-loader":"8.2.0","postcss-preset-env":"11.1.1","postcss-scss":"4.0.9","preact":"10.27.3","react-refresh":"0.18.0","sass-loader":"16.0.6","schema-utils":"^4.3.3","svelte-loader":"3.2.4","tiny-glob":"^0.2.9","typescript":"5.9.3","unique-names-generator":"^4.7.1","vue":"3.5.26","vue-loader":"17.4.2","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3"}}');
|
|
2220
2220
|
}
|
|
2221
2221
|
};
|
|
2222
2222
|
var __webpack_module_cache__ = {};
|
package/dist/preview.cjs
CHANGED
|
@@ -150,7 +150,7 @@ var __webpack_modules__ = {
|
|
|
150
150
|
module.exports = require("pintor");
|
|
151
151
|
},
|
|
152
152
|
"./package.json" (module) {
|
|
153
|
-
module.exports = JSON.parse('{"rE":"3.14.
|
|
153
|
+
module.exports = JSON.parse('{"rE":"3.14.1","El":{"@prefresh/core":"1.5.9","@prefresh/utils":"1.2.1","@rspack/core":"^1.7.5","@rspack/dev-server":"^1.2.1","@rspack/plugin-preact-refresh":"1.1.4","@rspack/plugin-react-refresh":"1.6.0","@swc/core":"^1.15.8","@swc/helpers":"^0.5.18","@vue/compiler-sfc":"3.5.26","adm-zip":"^0.5.16","browser-extension-manifest-fields":"^2.2.1","case-sensitive-paths-webpack-plugin":"^2.4.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^17.2.3","extension-from-store":"^0.1.1","go-git-it":"^5.1.5","ignore":"^7.0.5","less":"4.5.1","less-loader":"12.3.0","loader-utils":"^3.3.1","magic-string":"^0.30.21","parse5-utilities":"^1.0.0","pintor":"0.3.0","postcss":"8.5.6","postcss-loader":"8.2.0","postcss-preset-env":"11.1.1","postcss-scss":"4.0.9","preact":"10.27.3","react-refresh":"0.18.0","sass-loader":"16.0.6","schema-utils":"^4.3.3","svelte-loader":"3.2.4","tiny-glob":"^0.2.9","typescript":"5.9.3","unique-names-generator":"^4.7.1","vue":"3.5.26","vue-loader":"17.4.2","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3"}}');
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
156
|
var __webpack_module_cache__ = {};
|