extension-develop 4.0.8 → 4.0.9-canary.1784113746.dc729329
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 +82 -10
- 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 +134 -6
- package/dist/extension-js-devtools/extension-js/chrome/ready.json +7 -7
- package/dist/extension-js-devtools/extension-js/chromium/events.ndjson +136 -6
- package/dist/extension-js-devtools/extension-js/chromium/ready.json +7 -7
- package/dist/extension-js-devtools/extension-js/edge/events.ndjson +134 -6
- package/dist/extension-js-devtools/extension-js/edge/ready.json +7 -7
- package/dist/extension-js-devtools/extension-js/firefox/events.ndjson +134 -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 +134 -6
- package/dist/extension-js-theme/extension-js/chrome/ready.json +7 -7
- package/dist/extension-js-theme/extension-js/chromium/events.ndjson +134 -6
- package/dist/extension-js-theme/extension-js/chromium/ready.json +7 -7
- package/dist/extension-js-theme/extension-js/edge/events.ndjson +134 -6
- package/dist/extension-js-theme/extension-js/edge/ready.json +7 -7
- package/dist/extension-js-theme/extension-js/firefox/events.ndjson +226 -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;
|
|
@@ -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,39 @@ 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
|
+
}
|
|
3694
3738
|
return {
|
|
3695
3739
|
manifest: out,
|
|
3696
3740
|
fixes
|
|
3697
3741
|
};
|
|
3698
3742
|
}
|
|
3743
|
+
function stripUnsafeInlineFromScriptSrc(policy) {
|
|
3744
|
+
let changed = false;
|
|
3745
|
+
const rebuilt = policy.split(';').map((segment)=>{
|
|
3746
|
+
const tokens = segment.trim().split(/\s+/).filter(Boolean);
|
|
3747
|
+
if (0 === tokens.length) return null;
|
|
3748
|
+
if ("script-src" !== tokens[0].toLowerCase()) return tokens.join(' ');
|
|
3749
|
+
const values = tokens.slice(1).filter((value)=>"'unsafe-inline'" !== value.toLowerCase());
|
|
3750
|
+
if (values.length !== tokens.length - 1) changed = true;
|
|
3751
|
+
return [
|
|
3752
|
+
"script-src",
|
|
3753
|
+
...values.length ? values : [
|
|
3754
|
+
"'self'"
|
|
3755
|
+
]
|
|
3756
|
+
].join(' ');
|
|
3757
|
+
}).filter((segment)=>null !== segment);
|
|
3758
|
+
return changed ? rebuilt.join('; ') : policy;
|
|
3759
|
+
}
|
|
3699
3760
|
function isValidChromeVersion(version) {
|
|
3700
3761
|
if (!version) return false;
|
|
3701
3762
|
const parts = version.split('.');
|
|
@@ -8006,6 +8067,16 @@ const BRIDGE_PRODUCER_SOURCE = `;(function () {
|
|
|
8006
8067
|
return;
|
|
8007
8068
|
}
|
|
8008
8069
|
|
|
8070
|
+
// Delivery ack for the broker: proves this SW's message pump actually
|
|
8071
|
+
// processed the frame — a successful socket WRITE proves nothing when
|
|
8072
|
+
// the worker is wedged-but-connected (bug 27). The broker latches a
|
|
8073
|
+
// content-scripts reload until this ack and replays it to the next
|
|
8074
|
+
// producer hello, so an edit that landed on a dead pump still converges.
|
|
8075
|
+
// Sent on receipt (not after reinjection): the scripting-unavailable
|
|
8076
|
+
// fallback restarts the whole extension, and an unacked latch would
|
|
8077
|
+
// replay into the fresh SW and restart it a second time.
|
|
8078
|
+
send({type: "reload-ack", reloadType: kind, label: label});
|
|
8079
|
+
|
|
8009
8080
|
announceReloadInTabs(announced);
|
|
8010
8081
|
performDevReload(kind, function () {
|
|
8011
8082
|
// Only the content-scripts path confirms from here (reinjection ran to
|
|
@@ -10792,6 +10863,7 @@ function webpackConfig(projectStructure, devOptions) {
|
|
|
10792
10863
|
hints: false
|
|
10793
10864
|
},
|
|
10794
10865
|
optimization: {
|
|
10866
|
+
emitOnErrors: false,
|
|
10795
10867
|
minimize: 'production' === devOptions.mode,
|
|
10796
10868
|
sideEffects: true,
|
|
10797
10869
|
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.1784113746.dc729329","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 };
|