extension-develop 4.0.8 → 4.0.9-canary.1784132385.d3f8090d
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/0~dev-server.mjs +4 -1
- package/dist/0~rspack-config.mjs +97 -12
- package/dist/101.mjs +25 -6
- package/dist/839.mjs +22 -4
- package/dist/845.mjs +9 -1
- package/dist/extension-js-devtools/chrome/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/chrome/pages/centralized-logger.js +4 -4
- package/dist/extension-js-devtools/chrome/pages/welcome.js +1 -1
- package/dist/extension-js-devtools/chromium/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/chromium/pages/centralized-logger.js +4 -4
- package/dist/extension-js-devtools/chromium/pages/welcome.js +1 -1
- package/dist/extension-js-devtools/edge/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/edge/pages/centralized-logger.js +4 -4
- package/dist/extension-js-devtools/edge/pages/welcome.js +1 -1
- package/dist/extension-js-devtools/extension-js/chrome/events.ndjson +142 -6
- package/dist/extension-js-devtools/extension-js/chrome/ready.json +7 -7
- package/dist/extension-js-devtools/extension-js/chromium/events.ndjson +144 -6
- package/dist/extension-js-devtools/extension-js/chromium/ready.json +7 -7
- package/dist/extension-js-devtools/extension-js/edge/events.ndjson +142 -6
- package/dist/extension-js-devtools/extension-js/edge/ready.json +7 -7
- package/dist/extension-js-devtools/extension-js/firefox/events.ndjson +142 -6
- package/dist/extension-js-devtools/extension-js/firefox/ready.json +7 -7
- package/dist/extension-js-devtools/firefox/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/firefox/pages/centralized-logger.js +4 -4
- package/dist/extension-js-devtools/firefox/pages/welcome.js +1 -1
- package/dist/extension-js-theme/extension-js/chrome/events.ndjson +142 -6
- package/dist/extension-js-theme/extension-js/chrome/ready.json +7 -7
- package/dist/extension-js-theme/extension-js/chromium/events.ndjson +142 -6
- package/dist/extension-js-theme/extension-js/chromium/ready.json +7 -7
- package/dist/extension-js-theme/extension-js/edge/events.ndjson +142 -6
- package/dist/extension-js-theme/extension-js/edge/ready.json +7 -7
- package/dist/extension-js-theme/extension-js/firefox/events.ndjson +236 -8
- package/dist/extension-js-theme/extension-js/firefox/ready.json +7 -7
- package/dist/preprocessor-passthrough-loader.mjs +10 -0
- package/package.json +1 -1
package/dist/0~dev-server.mjs
CHANGED
|
@@ -491,6 +491,9 @@ class BridgeBroker {
|
|
|
491
491
|
case 'result':
|
|
492
492
|
if ('producer' === this.roles.get(conn)) this.onResult(frame);
|
|
493
493
|
return;
|
|
494
|
+
case 'reload-ack':
|
|
495
|
+
if ('producer' === this.roles.get(conn) && this.pendingReload?.reloadType === frame.reloadType) this.pendingReload = void 0;
|
|
496
|
+
return;
|
|
494
497
|
default:
|
|
495
498
|
return;
|
|
496
499
|
}
|
|
@@ -516,7 +519,7 @@ class BridgeBroker {
|
|
|
516
519
|
conn.send(frame);
|
|
517
520
|
notified++;
|
|
518
521
|
} catch {}
|
|
519
|
-
this.pendingReload = 0 === notified ? frame : void 0;
|
|
522
|
+
this.pendingReload = 0 === notified || "content-scripts" === frame.reloadType ? frame : void 0;
|
|
520
523
|
return notified;
|
|
521
524
|
}
|
|
522
525
|
pingProducers() {
|
package/dist/0~rspack-config.mjs
CHANGED
|
@@ -35,7 +35,8 @@ __webpack_require__.d(rspack_config_namespaceObject, {
|
|
|
35
35
|
default: ()=>webpackConfig
|
|
36
36
|
});
|
|
37
37
|
function filterKeysForThisBrowser(manifest, browser) {
|
|
38
|
-
const
|
|
38
|
+
const isSafariTarget = 'safari' === browser || 'webkit-based' === browser || String(browser).includes('webkit');
|
|
39
|
+
const isChromiumTarget = isChromiumBasedBrowser(String(browser)) || isSafariTarget;
|
|
39
40
|
const isGeckoTarget = constants_isGeckoBasedBrowser(String(browser));
|
|
40
41
|
const chromiumPrefixes = new Set([
|
|
41
42
|
'chromium',
|
|
@@ -46,12 +47,18 @@ function filterKeysForThisBrowser(manifest, browser) {
|
|
|
46
47
|
'gecko',
|
|
47
48
|
'firefox'
|
|
48
49
|
]);
|
|
49
|
-
const
|
|
50
|
+
const webkitPrefixes = new Set([
|
|
51
|
+
'safari',
|
|
52
|
+
'webkit'
|
|
53
|
+
]);
|
|
54
|
+
const isFamilyPrefix = (prefix)=>isChromiumTarget && chromiumPrefixes.has(prefix) || isGeckoTarget && geckoPrefixes.has(prefix);
|
|
55
|
+
const isSpecificPrefix = (prefix)=>prefix === browser || isSafariTarget && webkitPrefixes.has(prefix);
|
|
50
56
|
const resolve = (node)=>{
|
|
51
57
|
if (Array.isArray(node)) return node.map((item)=>resolve(item));
|
|
52
58
|
if (node && 'object' == typeof node) {
|
|
53
59
|
const result = {};
|
|
54
|
-
const
|
|
60
|
+
const familyMatches = {};
|
|
61
|
+
const specificMatches = {};
|
|
55
62
|
for (const [key, value] of Object.entries(node)){
|
|
56
63
|
const indexOfColon = key.indexOf(':');
|
|
57
64
|
if (-1 === indexOfColon) {
|
|
@@ -59,9 +66,12 @@ function filterKeysForThisBrowser(manifest, browser) {
|
|
|
59
66
|
continue;
|
|
60
67
|
}
|
|
61
68
|
const prefix = key.substring(0, indexOfColon);
|
|
62
|
-
|
|
69
|
+
const strippedKey = key.substring(indexOfColon + 1);
|
|
70
|
+
if (isSpecificPrefix(prefix)) specificMatches[strippedKey] = resolve(value);
|
|
71
|
+
else if (isFamilyPrefix(prefix)) familyMatches[strippedKey] = resolve(value);
|
|
63
72
|
}
|
|
64
|
-
for (const [strippedKey, value] of Object.entries(
|
|
73
|
+
for (const [strippedKey, value] of Object.entries(familyMatches))result[strippedKey] = value;
|
|
74
|
+
for (const [strippedKey, value] of Object.entries(specificMatches))result[strippedKey] = value;
|
|
65
75
|
return result;
|
|
66
76
|
}
|
|
67
77
|
return node;
|
|
@@ -816,7 +826,7 @@ function icons_icons(manifest) {
|
|
|
816
826
|
}))
|
|
817
827
|
};
|
|
818
828
|
}
|
|
819
|
-
function
|
|
829
|
+
function commands_commands(manifest) {
|
|
820
830
|
return manifest.commands && {
|
|
821
831
|
commands: manifest.commands
|
|
822
832
|
};
|
|
@@ -947,7 +957,7 @@ function manifestCommon(manifest, manifestPath) {
|
|
|
947
957
|
...content_scripts_contentScripts(manifest, manifestPath),
|
|
948
958
|
...devtoolsPage(manifest),
|
|
949
959
|
...icons_icons(manifest),
|
|
950
|
-
...
|
|
960
|
+
...commands_commands(manifest),
|
|
951
961
|
...permissions(manifest),
|
|
952
962
|
...optionsPage(manifest),
|
|
953
963
|
...optionsUi(manifest),
|
|
@@ -2220,12 +2230,14 @@ async function buildCssRules(projectPath, mode, usage, opts) {
|
|
|
2220
2230
|
test: /\.(sass|scss)$/,
|
|
2221
2231
|
exclude: /\.module\.(sass|scss)$/,
|
|
2222
2232
|
type: nonModuleType,
|
|
2223
|
-
loader: null
|
|
2233
|
+
loader: null,
|
|
2234
|
+
missingTool: 'sass'
|
|
2224
2235
|
},
|
|
2225
2236
|
{
|
|
2226
2237
|
test: /\.module\.(sass|scss)$/,
|
|
2227
2238
|
type: 'css/module',
|
|
2228
|
-
loader: null
|
|
2239
|
+
loader: null,
|
|
2240
|
+
missingTool: 'sass'
|
|
2229
2241
|
}
|
|
2230
2242
|
],
|
|
2231
2243
|
...useLess ? [
|
|
@@ -2245,16 +2257,18 @@ async function buildCssRules(projectPath, mode, usage, opts) {
|
|
|
2245
2257
|
test: /\.less$/,
|
|
2246
2258
|
exclude: /\.module\.less$/,
|
|
2247
2259
|
type: nonModuleType,
|
|
2248
|
-
loader: null
|
|
2260
|
+
loader: null,
|
|
2261
|
+
missingTool: 'less'
|
|
2249
2262
|
},
|
|
2250
2263
|
{
|
|
2251
2264
|
test: /\.module\.less$/,
|
|
2252
2265
|
type: 'css/module',
|
|
2253
|
-
loader: null
|
|
2266
|
+
loader: null,
|
|
2267
|
+
missingTool: 'less'
|
|
2254
2268
|
}
|
|
2255
2269
|
]
|
|
2256
2270
|
];
|
|
2257
|
-
return Promise.all(fileTypes.map(async ({ test, exclude, type, loader })=>{
|
|
2271
|
+
return Promise.all(fileTypes.map(async ({ test, exclude, type, loader, missingTool })=>{
|
|
2258
2272
|
const use = loader ? await commonStyleLoaders(projectPath, {
|
|
2259
2273
|
mode: mode,
|
|
2260
2274
|
loader,
|
|
@@ -2264,6 +2278,9 @@ async function buildCssRules(projectPath, mode, usage, opts) {
|
|
|
2264
2278
|
}) : await commonStyleLoaders(projectPath, {
|
|
2265
2279
|
mode: mode
|
|
2266
2280
|
});
|
|
2281
|
+
if (missingTool) use.push({
|
|
2282
|
+
loader: resolveDevelopDistFile('preprocessor-passthrough-loader')
|
|
2283
|
+
});
|
|
2267
2284
|
return {
|
|
2268
2285
|
test,
|
|
2269
2286
|
exclude,
|
|
@@ -3605,6 +3622,22 @@ class EmitManifest {
|
|
|
3605
3622
|
function sanitizeFatalManifestShapes(manifest, manifestDir) {
|
|
3606
3623
|
const out = manifest;
|
|
3607
3624
|
const fixes = [];
|
|
3625
|
+
if ('string' != typeof out.name || '' === out.name) {
|
|
3626
|
+
const from = out.name;
|
|
3627
|
+
const isScalar = 'number' == typeof from || 'boolean' == typeof from;
|
|
3628
|
+
out.name = isScalar ? String(from) : 'Unnamed Extension';
|
|
3629
|
+
fixes.push({
|
|
3630
|
+
field: 'name',
|
|
3631
|
+
detail: `replaced ${JSON.stringify(from)} with "${out.name}" — Chrome requires a non-empty string name and refuses the whole extension otherwise`
|
|
3632
|
+
});
|
|
3633
|
+
}
|
|
3634
|
+
if (null == out.version) {
|
|
3635
|
+
out.version = '0.0.0';
|
|
3636
|
+
fixes.push({
|
|
3637
|
+
field: 'version',
|
|
3638
|
+
detail: 'added "0.0.0" — the required version key was missing and Chrome refuses the whole extension without it'
|
|
3639
|
+
});
|
|
3640
|
+
}
|
|
3608
3641
|
if (null != out.version && 'string' != typeof out.version) {
|
|
3609
3642
|
const from = JSON.stringify(out.version);
|
|
3610
3643
|
out.version = String(out.version);
|
|
@@ -3691,11 +3724,52 @@ function sanitizeFatalManifestShapes(manifest, manifestDir) {
|
|
|
3691
3724
|
}
|
|
3692
3725
|
}
|
|
3693
3726
|
}
|
|
3727
|
+
const csp = out.content_security_policy;
|
|
3728
|
+
if (csp && 'object' == typeof csp && !Array.isArray(csp) && 'string' == typeof csp.extension_pages) {
|
|
3729
|
+
const stripped = stripUnsafeInlineFromScriptSrc(csp.extension_pages);
|
|
3730
|
+
if (stripped !== csp.extension_pages) {
|
|
3731
|
+
csp.extension_pages = stripped;
|
|
3732
|
+
fixes.push({
|
|
3733
|
+
field: 'content_security_policy.extension_pages',
|
|
3734
|
+
detail: "removed 'unsafe-inline' from script-src — Chrome refuses the whole extension over an insecure CSP value in extension pages"
|
|
3735
|
+
});
|
|
3736
|
+
}
|
|
3737
|
+
}
|
|
3738
|
+
const commands = out.commands;
|
|
3739
|
+
if (commands && 'object' == typeof commands && !Array.isArray(commands)) for (const [name, command] of Object.entries(commands)){
|
|
3740
|
+
if (name.startsWith('_execute_')) continue;
|
|
3741
|
+
if (!command || 'object' != typeof command || Array.isArray(command)) continue;
|
|
3742
|
+
const entry = command;
|
|
3743
|
+
if ('string' == typeof entry.description && entry.description.trim()) continue;
|
|
3744
|
+
const from = entry.description;
|
|
3745
|
+
entry.description = name;
|
|
3746
|
+
fixes.push({
|
|
3747
|
+
field: `commands.${name}.description`,
|
|
3748
|
+
detail: `replaced ${JSON.stringify(from)} with "${name}" — Chrome requires a non-empty string description on named commands and refuses the whole extension otherwise`
|
|
3749
|
+
});
|
|
3750
|
+
}
|
|
3694
3751
|
return {
|
|
3695
3752
|
manifest: out,
|
|
3696
3753
|
fixes
|
|
3697
3754
|
};
|
|
3698
3755
|
}
|
|
3756
|
+
function stripUnsafeInlineFromScriptSrc(policy) {
|
|
3757
|
+
let changed = false;
|
|
3758
|
+
const rebuilt = policy.split(';').map((segment)=>{
|
|
3759
|
+
const tokens = segment.trim().split(/\s+/).filter(Boolean);
|
|
3760
|
+
if (0 === tokens.length) return null;
|
|
3761
|
+
if ("script-src" !== tokens[0].toLowerCase()) return tokens.join(' ');
|
|
3762
|
+
const values = tokens.slice(1).filter((value)=>"'unsafe-inline'" !== value.toLowerCase());
|
|
3763
|
+
if (values.length !== tokens.length - 1) changed = true;
|
|
3764
|
+
return [
|
|
3765
|
+
"script-src",
|
|
3766
|
+
...values.length ? values : [
|
|
3767
|
+
"'self'"
|
|
3768
|
+
]
|
|
3769
|
+
].join(' ');
|
|
3770
|
+
}).filter((segment)=>null !== segment);
|
|
3771
|
+
return changed ? rebuilt.join('; ') : policy;
|
|
3772
|
+
}
|
|
3699
3773
|
function isValidChromeVersion(version) {
|
|
3700
3774
|
if (!version) return false;
|
|
3701
3775
|
const parts = version.split('.');
|
|
@@ -8006,6 +8080,16 @@ const BRIDGE_PRODUCER_SOURCE = `;(function () {
|
|
|
8006
8080
|
return;
|
|
8007
8081
|
}
|
|
8008
8082
|
|
|
8083
|
+
// Delivery ack for the broker: proves this SW's message pump actually
|
|
8084
|
+
// processed the frame — a successful socket WRITE proves nothing when
|
|
8085
|
+
// the worker is wedged-but-connected (bug 27). The broker latches a
|
|
8086
|
+
// content-scripts reload until this ack and replays it to the next
|
|
8087
|
+
// producer hello, so an edit that landed on a dead pump still converges.
|
|
8088
|
+
// Sent on receipt (not after reinjection): the scripting-unavailable
|
|
8089
|
+
// fallback restarts the whole extension, and an unacked latch would
|
|
8090
|
+
// replay into the fresh SW and restart it a second time.
|
|
8091
|
+
send({type: "reload-ack", reloadType: kind, label: label});
|
|
8092
|
+
|
|
8009
8093
|
announceReloadInTabs(announced);
|
|
8010
8094
|
performDevReload(kind, function () {
|
|
8011
8095
|
// Only the content-scripts path confirms from here (reinjection ran to
|
|
@@ -10792,6 +10876,7 @@ function webpackConfig(projectStructure, devOptions) {
|
|
|
10792
10876
|
hints: false
|
|
10793
10877
|
},
|
|
10794
10878
|
optimization: {
|
|
10879
|
+
emitOnErrors: false,
|
|
10795
10880
|
minimize: 'production' === devOptions.mode,
|
|
10796
10881
|
sideEffects: true,
|
|
10797
10882
|
usedExports: 'global',
|
package/dist/101.mjs
CHANGED
|
@@ -416,6 +416,13 @@ function buildCommandFailed(error) {
|
|
|
416
416
|
})();
|
|
417
417
|
return `${getLoggingPrefix('error')} Build failed.\n${pintor.red(fmt.truncate(message, 1200))}`;
|
|
418
418
|
}
|
|
419
|
+
function devCommandFailed(error) {
|
|
420
|
+
const message = (()=>{
|
|
421
|
+
if (error instanceof Error && error.message) return error.message;
|
|
422
|
+
return String(error || 'Unknown error');
|
|
423
|
+
})();
|
|
424
|
+
return `${getLoggingPrefix('error')} Dev mode failed.\n${pintor.red(fmt.truncate(message, 1200))}`;
|
|
425
|
+
}
|
|
419
426
|
function managedDependencyConflict(duplicates, userPackageJsonPath) {
|
|
420
427
|
const list = duplicates.map((d)=>`- ${pintor.yellow(d)}`).join('\n');
|
|
421
428
|
return `${getLoggingPrefix('error')} Your project declares dependencies that are managed by ${pintor.blue('Extension.js')} and referenced in ${pintor.underline('extension.config.js')}\n${pintor.red('This can cause version conflicts and break the development/build process.')}\n\n${pintor.gray('Managed dependencies (remove these from your package.json):')}\n${list}\n\n${pintor.gray('PATH')} ${pintor.underline(userPackageJsonPath)}\nIf you need a different version, open an issue so we can consider bundling it safely.\nOperation aborted.`;
|
|
@@ -677,7 +684,7 @@ async function config_loader_isUsingExperimentalConfig(projectPath) {
|
|
|
677
684
|
}
|
|
678
685
|
return false;
|
|
679
686
|
}
|
|
680
|
-
var package_namespaceObject = /*#__PURE__*/ JSON.parse('{"rE":"4.0.
|
|
687
|
+
var package_namespaceObject = /*#__PURE__*/ JSON.parse('{"rE":"4.0.9-canary.1784132385.d3f8090d","El":{"@prefresh/core":"1.5.9","@prefresh/utils":"1.2.1","@rspack/core":"^2.1.1","@rspack/dev-server":"2.1.0","@rspack/plugin-preact-refresh":"2.0.1","@rspack/plugin-react-refresh":"2.0.2","@vue/compiler-sfc":"3.5.26","adm-zip":"^0.5.16","browser-extension-manifest-fields":"^2.2.9","case-sensitive-paths-webpack-plugin":"^2.4.0","content-security-policy-parser":"^0.6.0","dotenv":"^17.2.3","es-module-lexer":"^2.1.0","extension-from-store":"^0.1.1","go-git-it":"^5.1.5","ignore":"^7.0.5","less":"4.6.7","less-loader":"13.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","postcss":"8.5.10","postcss-loader":"8.2.1","postcss-preset-env":"11.1.1","postcss-scss":"4.0.9","preact":"10.27.3","prefers-yarn":"2.0.1","react-refresh":"0.18.0","sass-loader":"17.0.0","schema-utils":"^4.3.3","svelte-loader":"3.2.4","tiny-glob":"^0.2.9","typescript":"5.9.3","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","ws":"^8.20.1"}}');
|
|
681
688
|
function asAbsolute(p) {
|
|
682
689
|
return __rspack_external_path.isAbsolute(p) ? p : __rspack_external_path.resolve(p);
|
|
683
690
|
}
|
|
@@ -1574,6 +1581,15 @@ function sanitize(obj) {
|
|
|
1574
1581
|
function nowISO() {
|
|
1575
1582
|
return new Date().toISOString();
|
|
1576
1583
|
}
|
|
1584
|
+
const MAX_CONTRACT_ERRORS = 10;
|
|
1585
|
+
const ANSI_PATTERN = /\u001b\[[0-9;]*m/g;
|
|
1586
|
+
function formatStatsErrors(errors) {
|
|
1587
|
+
if (!Array.isArray(errors)) return [];
|
|
1588
|
+
return errors.slice(0, MAX_CONTRACT_ERRORS).map((error)=>{
|
|
1589
|
+
const message = error && 'object' == typeof error ? String(error.message ?? '') : String(error ?? '');
|
|
1590
|
+
return message.replace(ANSI_PATTERN, '').trim();
|
|
1591
|
+
}).filter(Boolean);
|
|
1592
|
+
}
|
|
1577
1593
|
function createRunId() {
|
|
1578
1594
|
return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
1579
1595
|
}
|
|
@@ -1715,17 +1731,20 @@ class PlaywrightPlugin {
|
|
|
1715
1731
|
});
|
|
1716
1732
|
const errorsCount = Array.isArray(errorsJson?.errors) ? errorsJson.errors.length : 0;
|
|
1717
1733
|
if (hasErrors) {
|
|
1734
|
+
const errorMessages = formatStatsErrors(errorsJson?.errors);
|
|
1735
|
+
const contractErrors = errorMessages.length ? errorMessages : [
|
|
1736
|
+
`errors: ${String(errorsCount || 1)}`
|
|
1737
|
+
];
|
|
1718
1738
|
this.writer.appendEvent({
|
|
1719
1739
|
type: 'compile_error',
|
|
1720
1740
|
ts: nowISO(),
|
|
1721
1741
|
command: this.command,
|
|
1722
1742
|
browser: this.browser,
|
|
1723
1743
|
durationMs: Number.isFinite(durationMs) ? durationMs : void 0,
|
|
1724
|
-
errorCount: Number.isFinite(errorsCount) ? errorsCount : 1
|
|
1744
|
+
errorCount: Number.isFinite(errorsCount) ? errorsCount : 1,
|
|
1745
|
+
errors: contractErrors
|
|
1725
1746
|
});
|
|
1726
|
-
this.writer.writeError('compile_error', 'Compilation failed',
|
|
1727
|
-
`errors: ${String(errorsCount || 1)}`
|
|
1728
|
-
]);
|
|
1747
|
+
this.writer.writeError('compile_error', 'Compilation failed', contractErrors);
|
|
1729
1748
|
return;
|
|
1730
1749
|
}
|
|
1731
1750
|
this.writer.appendEvent({
|
|
@@ -2120,4 +2139,4 @@ async function extensionPreview(pathOrRemoteUrl, previewOptions, browserLauncher
|
|
|
2120
2139
|
await browserLauncher(resolvedOpts);
|
|
2121
2140
|
metadata.writeReady();
|
|
2122
2141
|
}
|
|
2123
|
-
export { PlaywrightPlugin, asAbsolute, assertNoManagedDependencyConflicts, authorInstallNotice, autoExitForceKill, autoExitModeEnabled, autoExitTriggered, browserRunnerDisabled, buildCommandFailed, buildSuccess, buildSuccessWithWarnings, buildWarningsDetails, buildWebpack, bundlerFatalError, bundlerRecompiling, computeExtensionsToLoad, constants_isGeckoBasedBrowser, createPlaywrightMetadataWriter, debugBrowser, debugContextPath, debugDirs, debugExtensionsToLoad, debugOutputPath, devServerStartTimeout, downloadingText, extensionJsRunnerError, extensionPreview, failedToDownloadOrExtractZIPFileError, getDirs, getDistPath, getProjectStructure, getSpecialFoldersDataForCompiler, getSpecialFoldersDataForProjectRoot, invalidRemoteZip, isChromiumBasedBrowser, loadBrowserConfig, loadCommandConfig, loadCustomConfig, localZipNotFound, manifestInvalidJson, messages_ready, needsInstall, noCompanionExtensionsResolved, noEntrypointsDetected, normalizeBrowser, notAZipArchive, package_namespaceObject, packagingDistributionFiles, packagingSourceFiles, portInUse, projectInstallFallbackToNpm, projectInstallScriptsDisabled, resolveCompanionExtensionDirs, resolveCompanionExtensionsConfig, sanitize, spacerLine, toPosixPath, treeWithDistFilesbrowser, treeWithSourceAndDistFiles, treeWithSourceFiles, unpackagedSuccessfully, unpackagingExtension, writingTypeDefinitions, writingTypeDefinitionsError };
|
|
2142
|
+
export { PlaywrightPlugin, asAbsolute, assertNoManagedDependencyConflicts, authorInstallNotice, autoExitForceKill, autoExitModeEnabled, autoExitTriggered, browserRunnerDisabled, buildCommandFailed, buildSuccess, buildSuccessWithWarnings, buildWarningsDetails, buildWebpack, bundlerFatalError, bundlerRecompiling, computeExtensionsToLoad, constants_isGeckoBasedBrowser, createPlaywrightMetadataWriter, debugBrowser, debugContextPath, debugDirs, debugExtensionsToLoad, debugOutputPath, devCommandFailed, devServerStartTimeout, downloadingText, extensionJsRunnerError, extensionPreview, failedToDownloadOrExtractZIPFileError, getDirs, getDistPath, getProjectStructure, getSpecialFoldersDataForCompiler, getSpecialFoldersDataForProjectRoot, invalidRemoteZip, isChromiumBasedBrowser, loadBrowserConfig, loadCommandConfig, loadCustomConfig, localZipNotFound, manifestInvalidJson, messages_ready, needsInstall, noCompanionExtensionsResolved, noEntrypointsDetected, normalizeBrowser, notAZipArchive, package_namespaceObject, packagingDistributionFiles, packagingSourceFiles, portInUse, projectInstallFallbackToNpm, projectInstallScriptsDisabled, resolveCompanionExtensionDirs, resolveCompanionExtensionsConfig, sanitize, spacerLine, toPosixPath, treeWithDistFilesbrowser, treeWithSourceAndDistFiles, treeWithSourceFiles, unpackagedSuccessfully, unpackagingExtension, writingTypeDefinitions, writingTypeDefinitionsError };
|
package/dist/839.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { execFileSync, spawn, spawnSync as external_child_process_spawnSync } fr
|
|
|
4
4
|
import { buildExecEnv, detectPackageManagerFromLockfile } from "prefers-yarn";
|
|
5
5
|
import pintor from "pintor";
|
|
6
6
|
import { EventEmitter } from "node:events";
|
|
7
|
-
import { package_namespaceObject, buildSuccessWithWarnings, buildWarningsDetails, loadCommandConfig, needsInstall, getDirs, buildCommandFailed, getSpecialFoldersDataForProjectRoot, writingTypeDefinitions, sanitize, projectInstallFallbackToNpm, buildWebpack, assertNoManagedDependencyConflicts, debugDirs, debugBrowser, normalizeBrowser, debugOutputPath, loadCustomConfig, buildSuccess, writingTypeDefinitionsError, getDistPath, loadBrowserConfig, projectInstallScriptsDisabled, authorInstallNotice, getProjectStructure, resolveCompanionExtensionsConfig } from "./101.mjs";
|
|
7
|
+
import { package_namespaceObject, buildSuccessWithWarnings, buildWarningsDetails, loadCommandConfig, needsInstall, getDirs, buildCommandFailed, getSpecialFoldersDataForProjectRoot, writingTypeDefinitions, sanitize, projectInstallFallbackToNpm, buildWebpack, assertNoManagedDependencyConflicts, debugDirs, debugBrowser, normalizeBrowser, debugOutputPath, loadCustomConfig, buildSuccess, devCommandFailed, writingTypeDefinitionsError, getDistPath, loadBrowserConfig, projectInstallScriptsDisabled, authorInstallNotice, getProjectStructure, resolveCompanionExtensionsConfig } from "./101.mjs";
|
|
8
8
|
import { stripBom, parseJsonSafe } from "./23.mjs";
|
|
9
9
|
import { hasProjectDependency, findNearestProjectManifestDirSync } from "./80.mjs";
|
|
10
10
|
import { getCanonicalContentScriptEntryName } from "./291.mjs";
|
|
@@ -1280,7 +1280,16 @@ async function extensionBuild(pathOrRemoteUrl, buildOptions) {
|
|
|
1280
1280
|
}
|
|
1281
1281
|
});
|
|
1282
1282
|
});
|
|
1283
|
-
if (('safari' === browser || 'webkit-based' === browser) && buildOptions?.safariPackager)
|
|
1283
|
+
if (('safari' === browser || 'webkit-based' === browser) && buildOptions?.safariPackager) {
|
|
1284
|
+
const safariConfig = await loadBrowserConfig(packageJsonDir, browser);
|
|
1285
|
+
await buildOptions.safariPackager(distPath, 'full', {
|
|
1286
|
+
appName: buildOptions.appName ?? safariConfig.appName,
|
|
1287
|
+
bundleId: buildOptions.bundleId ?? safariConfig.bundleId,
|
|
1288
|
+
macOsOnly: buildOptions.macOsOnly ?? safariConfig.macOsOnly,
|
|
1289
|
+
forceRegenerate: buildOptions.forceRegenerate,
|
|
1290
|
+
safariBinary: buildOptions.safariBinary ?? safariConfig.safariBinary
|
|
1291
|
+
});
|
|
1292
|
+
}
|
|
1284
1293
|
return summary;
|
|
1285
1294
|
} catch (error) {
|
|
1286
1295
|
const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
|
|
@@ -1716,7 +1725,15 @@ async function extensionDev(pathOrRemoteUrl, devOptions) {
|
|
|
1716
1725
|
...sanitize(devOptions)
|
|
1717
1726
|
};
|
|
1718
1727
|
if (('safari' === browser || 'webkit-based' === browser) && !devOptions.noBrowser && devOptions.safariPackager) {
|
|
1719
|
-
|
|
1728
|
+
const safariPackager = devOptions.safariPackager;
|
|
1729
|
+
const safariOverrides = {
|
|
1730
|
+
appName: merged.appName,
|
|
1731
|
+
bundleId: merged.bundleId,
|
|
1732
|
+
macOsOnly: merged.macOsOnly,
|
|
1733
|
+
forceRegenerate: merged.forceRegenerate,
|
|
1734
|
+
safariBinary: merged.safariBinary
|
|
1735
|
+
};
|
|
1736
|
+
browsersPlugin = new SafariDevPlugin((distPath, packagerMode)=>safariPackager(distPath, packagerMode, safariOverrides));
|
|
1720
1737
|
emitter = browsersPlugin.emitter;
|
|
1721
1738
|
} else if (devOptions.launcher && !devOptions.noBrowser) {
|
|
1722
1739
|
browsersPlugin = new BrowsersPlugin({
|
|
@@ -1759,7 +1776,8 @@ async function extensionDev(pathOrRemoteUrl, devOptions) {
|
|
|
1759
1776
|
});
|
|
1760
1777
|
return emitter;
|
|
1761
1778
|
} catch (error) {
|
|
1762
|
-
console.error(error);
|
|
1779
|
+
if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.error(error);
|
|
1780
|
+
else console.error(devCommandFailed(error));
|
|
1763
1781
|
process.exit(1);
|
|
1764
1782
|
}
|
|
1765
1783
|
}
|
package/dist/845.mjs
CHANGED
|
@@ -43,6 +43,14 @@ function cssParseErrorShippedVerbatim(resourcePath, error) {
|
|
|
43
43
|
'PostCSS/Tailwind processing was NOT applied to this file. Fix the CSS to re-enable it.'
|
|
44
44
|
].join('\n');
|
|
45
45
|
}
|
|
46
|
+
function preprocessorShippedUncompiled(resourcePath, tool) {
|
|
47
|
+
const pkg = 'sass' === tool ? 'sass' : 'less';
|
|
48
|
+
return [
|
|
49
|
+
`${pintor.yellow('⏵⏵⏵')} ${pintor.underline(resourcePath)} shipped UNCOMPILED — ${pintor.brightBlue(`"${pkg}"`)} is not installed in this project.`,
|
|
50
|
+
`The raw ${'sass' === tool ? 'Sass/SCSS' : 'Less'} source was copied as-is into the output .css, which browsers will treat as broken CSS (unstyled surfaces).`,
|
|
51
|
+
`Install it to compile this file, for example: ${pintor.gray(`npm install --save-dev ${pkg}`)}`
|
|
52
|
+
].join('\n');
|
|
53
|
+
}
|
|
46
54
|
function deadCssUrlRef(issuerPath, request) {
|
|
47
55
|
return [
|
|
48
56
|
`Missing file in ${pintor.underline(issuerPath)}.`,
|
|
@@ -52,4 +60,4 @@ function deadCssUrlRef(issuerPath, request) {
|
|
|
52
60
|
`${pintor.red('NOT FOUND')} ${pintor.underline(request)}`
|
|
53
61
|
].join('\n');
|
|
54
62
|
}
|
|
55
|
-
export { cssConfigsDetected, cssIntegrationsEnabled, cssParseErrorShippedVerbatim, deadCssUrlRef, isUsingIntegration, missingSassDependency, postCssPluginNotResolved };
|
|
63
|
+
export { cssConfigsDetected, cssIntegrationsEnabled, cssParseErrorShippedVerbatim, deadCssUrlRef, isUsingIntegration, missingSassDependency, postCssPluginNotResolved, preprocessorShippedUncompiled };
|