extension-develop 4.1.21 → 4.1.23

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/832~0.mjs CHANGED
@@ -8,7 +8,7 @@ import node_fs from "node:fs";
8
8
  import node_path from "node:path";
9
9
  import { getSpecialFoldersData } from "browser-extension-manifest-fields";
10
10
  import pintor from "pintor";
11
- import { devtoolsEngineFor, managedDependencyConflict, resolveProjectStructureSync, getDirs, computePreviewOutputPath, eventsPath as session_paths_eventsPath, anotherDevSessionActive, previewingSourceFallback, asAbsolute, previewing, starting, debugPreviewOutput, ensureSessionArtifactsIgnoreFile, debugDirs, debugBrowser, readyContractPath, configLoadingError, normalizeBrowser, previewingCustomOutput, browserArtifactsDir, getProjectStructure, isUsingExperimentalConfig as messages_isUsingExperimentalConfig, getDistPath, configBrowserOrThrow } from "./950~0.mjs";
11
+ import { devtoolsEngineFor, managedDependencyConflict, resolveProjectStructureSync, getDirs, computePreviewOutputPath, eventsPath as session_paths_eventsPath, anotherDevSessionActive, previewingSourceFallback, asAbsolute, displayPath, previewing, starting, debugPreviewOutput, ensureSessionArtifactsIgnoreFile, debugDirs, debugBrowser, readyContractPath, configLoadingError, normalizeBrowser, collapseHomeDir, previewingCustomOutput, browserArtifactsDir, getProjectStructure, isUsingExperimentalConfig as messages_isUsingExperimentalConfig, getDistPath, configBrowserOrThrow } from "./950~0.mjs";
12
12
  import { isChromiumBasedBrowser, isWebkitBasedBrowser, isGeckoBasedBrowser } from "./331~0.mjs";
13
13
  import { humanWarn, isDebug, browserRowValue, artifactNoun, prefix as messaging_prefix, card, humanLine } from "./852~0.mjs";
14
14
  import { stripBom, parseJsonSafe, readProjectDependencies } from "./731~0.mjs";
@@ -19,7 +19,7 @@ import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
19
19
  import * as __rspack_external_node_os_4f3c9d58 from "node:os";
20
20
  import * as __rspack_external_node_path_806ed179 from "node:path";
21
21
  import * as __rspack_external_node_vm_ef240610 from "node:vm";
22
- var package_namespaceObject = /*#__PURE__*/ JSON.parse('{"rE":"4.1.21","El":{"@prefresh/core":"1.5.9","@prefresh/utils":"1.2.1","@rspack/core":"^2.2.3","@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","acorn":"^8.16.0","browser-extension-manifest-fields":"^3.0.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","es-module-lexer":"^3.0.2","extension-from-store":"^0.2.5","fflate":"^0.8.3","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.23","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","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"}}');
22
+ var package_namespaceObject = /*#__PURE__*/ JSON.parse('{"rE":"4.1.23","El":{"@prefresh/core":"1.5.9","@prefresh/utils":"1.2.1","@rspack/core":"^2.2.3","@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","acorn":"^8.16.0","browser-extension-manifest-fields":"^3.0.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","es-module-lexer":"^3.0.2","extension-from-store":"^0.2.5","fflate":"^0.8.3","go-git-it":"^5.1.5","ignore":"^7.0.5","less":"4.9.1","less-loader":"13.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","postcss":"8.5.23","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","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"}}');
23
23
  const preloadedEnvKeys = new Set();
24
24
  function getPreloadedEnvKeys() {
25
25
  return preloadedEnvKeys;
@@ -673,6 +673,7 @@ function createPlaywrightMetadataWriter(options) {
673
673
  if ('number' == typeof prev.rdpPort) payload.rdpPort = prev.rdpPort;
674
674
  if ('string' == typeof prev.profilePath) payload.profilePath = prev.profilePath;
675
675
  if ('number' == typeof prev.browserPid) payload.browserPid = prev.browserPid;
676
+ if ('number' == typeof prev.launcherPid) payload.launcherPid = prev.launcherPid;
676
677
  if ('string' == typeof prev.binary && prev.binary) payload.binary = prev.binary;
677
678
  if ('string' == typeof prev.binaryProvenance && prev.binaryProvenance) payload.binaryProvenance = prev.binaryProvenance;
678
679
  if ('string' == typeof prev.extensionId && prev.extensionId) payload.extensionId = prev.extensionId;
@@ -1112,14 +1113,11 @@ async function resolveCompanionExtensionsConfig(opts) {
1112
1113
  function serverRestartRequiredFromSpecialFolderMessageOnly(addingOrRemoving, folder, typeOfAsset) {
1113
1114
  return `${messaging_prefix('warn')} ${addingOrRemoving} ${pintor.yellow(typeOfAsset)} in ${pintor.underline(`${folder}/`)} changes the extension entrypoints.\nRestart the dev server to apply the change.`;
1114
1115
  }
1115
- function displayPath(absolutePath) {
1116
- return absolutePath.replace(/\\/g, '/');
1116
+ function publicMustBeAtProjectRoot(foundAt, expectedAt, projectRoot) {
1117
+ return `The public folder sits in the legacy next-to-manifest location.\nGOT ${displayPath(foundAt, projectRoot)}\nEXPECTED ${displayPath(expectedAt, projectRoot)}\nStatic files ship from the extension root, so public/ is canonically placed at the project root.\nThe build uses it either way.\nMove the folder to the project root to silence this warning.`;
1117
1118
  }
1118
- function publicMustBeAtProjectRoot(foundAt, expectedAt) {
1119
- return `The public folder sits in the legacy next-to-manifest location.\nGOT ${displayPath(foundAt)}\nEXPECTED ${displayPath(expectedAt)}\nStatic files ship from the extension root, so public/ is canonically placed at the project root.\nThe build uses it either way.\nMove the folder to the project root to silence this warning.`;
1120
- }
1121
- function publicFolderShadowed(usedAt, ignoredAt) {
1122
- return `Two public folders were found and only one is copied into the build.\nUSING ${displayPath(usedAt)}\nIGNORED ${displayPath(ignoredAt)}\npublic/ is canonically placed at the project root, and that copy wins.\nFiles that exist only in the ignored folder do not ship.\nMove or merge the ignored folder to silence this warning.`;
1119
+ function publicFolderShadowed(usedAt, ignoredAt, projectRoot) {
1120
+ return `Two public folders were found and only one is copied into the build.\nUSING ${displayPath(usedAt, projectRoot)}\nIGNORED ${displayPath(ignoredAt, projectRoot)}\npublic/ is canonically placed at the project root, and that copy wins.\nFiles that exist only in the ignored folder do not ship.\nMove or merge the ignored folder to silence this warning.`;
1123
1121
  }
1124
1122
  function specialFoldersSetupSummary(hasPublic, copyEnabled, ignoredCount) {
1125
1123
  return `${messaging_prefix('debug')} folders setup public=${String(hasPublic)} copy=${String(copyEnabled)} ignored=${String(ignoredCount)}`;
@@ -1511,15 +1509,6 @@ function getExtensionVersion() {
1511
1509
  }
1512
1510
  })();
1513
1511
  }
1514
- function collapseHomeDirInCardValue(value) {
1515
- const raw = String(value || '');
1516
- const home = __rspack_external_node_os_4f3c9d58.homedir();
1517
- if (!home || !raw.startsWith(home)) return raw;
1518
- const rest = raw.slice(home.length);
1519
- if ('' === rest) return '~';
1520
- if (rest.startsWith(__rspack_external_node_path_806ed179.sep) || rest.startsWith('/')) return `~${rest}`;
1521
- return raw;
1522
- }
1523
1512
  function browserRunnerDisabled(args) {
1524
1513
  const manifest = readJsonRecord(args.manifestPath);
1525
1514
  const ready = readJsonRecord(args.readyPath);
@@ -1551,7 +1540,7 @@ function browserRunnerDisabled(args) {
1551
1540
  },
1552
1541
  {
1553
1542
  label: 'Output',
1554
- value: collapseHomeDirInCardValue(String(args.distPath || '').trim())
1543
+ value: collapseHomeDir(String(args.distPath || '').trim())
1555
1544
  }
1556
1545
  ]
1557
1546
  });
package/dist/840~0.mjs CHANGED
@@ -11,14 +11,13 @@ import { humanWarn, browserRowValue, CODES, ENVELOPE, prefix as messaging_prefix
11
11
  import { package_namespaceObject, loadCommandConfig, DEV_COMMAND_DEFAULTS, stampReadyDistExtensionId, loadProjectConfigDefaults, mergeOptionLayers, stampReadyKnownExtensionId, assertNoManagedDependencyConflicts, loadCustomConfig, START_BUILD_DEFAULTS, loadBrowserConfig, resolveCompanionExtensionsConfig, BUILD_COMMAND_DEFAULTS, getSpecialFoldersDataForProjectRoot, withDarkMode } from "./832~0.mjs";
12
12
  import { stripBom, hasProjectDependency, parseJsonSafe, findNearestProjectManifestDirSync } from "./731~0.mjs";
13
13
  import { isGeckoBasedBrowser } from "./331~0.mjs";
14
- import { buildWarningsDetails, buildFailed, getDirs, zipArtifactReady, projectInstallFallbackToNpm, debugDirs, addonLintDependencyAttribution, browserLaunchFailed, buildSummaryPath, addonLintMore, extensionLoadRecovered, writingTypeDefinitionsError, extensionLoadStillRefused, projectInstallScriptsDisabled, authorInstallNotice, addonLintFailed, buildAssetsTree, addonLintSummary, addonLintFinding, configBrowserOrThrow, needsInstall, projectInstallInWorkspaceRoot, buildCommandFailed, addonLintNotInstalled, writingTypeDefinitions, buildComplete, ensureSessionStateInProjectGitignore, ensureSessionArtifactsIgnoreFile, debugBrowser, normalizeBrowser, debugOutputPath, devCommandFailed, buildShareHint, getDistPath, getProjectStructure, debugSplitChunksNarrowed } from "./950~0.mjs";
14
+ import { buildWarningsDetails, buildFailed, getDirs, zipArtifactReady, projectInstallFallbackToNpm, debugDirs, addonLintDependencyAttribution, browserLaunchFailed, collapseHomeDir, addonLintMore, extensionLoadRecovered, writingTypeDefinitionsError, extensionLoadStillRefused, relativeToDir, projectInstallScriptsDisabled, authorInstallNotice, addonLintFailed, buildAssetsTree, addonLintSummary, addonLintFinding, configBrowserOrThrow, buildSummaryPath, needsInstall, projectInstallInWorkspaceRoot, buildCommandFailed, addonLintNotInstalled, writingTypeDefinitions, buildComplete, ensureSessionStateInProjectGitignore, displayPath, ensureSessionArtifactsIgnoreFile, debugBrowser, normalizeBrowser, debugOutputPath, devCommandFailed, buildShareHint, getDistPath, getProjectStructure, debugSplitChunksNarrowed } from "./950~0.mjs";
15
15
  import { publicRootsFor } from "./105~0.mjs";
16
16
  import { getCanonicalContentScriptEntryName } from "./640~0.mjs";
17
17
  import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
18
18
  import { dirname as __rspack_dirname } from "node:path";
19
19
  var __rspack_import_meta_dirname__ = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
20
20
  import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
21
- import * as __rspack_external_node_os_4f3c9d58 from "node:os";
22
21
  import * as __rspack_external_node_path_806ed179 from "node:path";
23
22
  import * as __rspack_external_node_fs_promises_3b710708 from "node:fs/promises";
24
23
  const MAX_OUTPUT_CHARS = 2000;
@@ -1901,6 +1900,9 @@ function solidIsNotSupported() {
1901
1900
  function creatingTSConfig() {
1902
1901
  return `${messaging_prefix('info')} Creating a default tsconfig.json…`;
1903
1902
  }
1903
+ function svelteCompilerRuntimeMismatch(compilerVersion, projectVersion) {
1904
+ return `${messaging_prefix('warn')} Svelte ${pintor.blue(compilerVersion)} compiles this project, which pins svelte ${pintor.blue(projectVersion)}.\nThe build uses ${pintor.blue(compilerVersion)} for both, so the output links. Add ${pintor.blue('svelte-loader')} to the project to compile with ${pintor.blue(projectVersion)} instead.`;
1905
+ }
1904
1906
  function isUsingCustomLoader(loaderPath) {
1905
1907
  return `${messaging_prefix('debug')} loader custom=${loaderPath}`;
1906
1908
  }
@@ -2338,19 +2340,6 @@ function writeTsConfig(projectPath) {
2338
2340
  mode: 'development'
2339
2341
  }), null, 2));
2340
2342
  }
2341
- function collapseHomeDir(value) {
2342
- const home = __rspack_external_node_os_4f3c9d58.homedir();
2343
- if (!home || !value.startsWith(home)) return value;
2344
- const rest = value.slice(home.length);
2345
- if ('' === rest) return '~';
2346
- if (rest.startsWith(__rspack_external_node_path_806ed179.sep) || rest.startsWith('/')) return `~${rest}`;
2347
- return value;
2348
- }
2349
- function relativeToCwd(target) {
2350
- const relative = __rspack_external_node_path_806ed179.relative(process.cwd(), target);
2351
- if (relative && !relative.startsWith('..') && !__rspack_external_node_path_806ed179.isAbsolute(relative)) return relative;
2352
- return null;
2353
- }
2354
2343
  const reportedBuildFailures = new WeakSet();
2355
2344
  function printBuildCard(manifestPath, browser, distPath) {
2356
2345
  if (!claimCardKey(`${browser}::${__rspack_external_node_path_806ed179.resolve(distPath)}`)) return;
@@ -2524,7 +2513,7 @@ async function extensionBuild(pathOrRemoteUrl, buildOptions) {
2524
2513
  errors: true
2525
2514
  });
2526
2515
  summary = getBuildSummary(browser, info, displayDistPath);
2527
- const distDisplay = relativeToCwd(displayDistPath) || collapseHomeDir(displayDistPath);
2516
+ const distDisplay = displayPath(displayDistPath);
2528
2517
  const lintLines = [];
2529
2518
  try {
2530
2519
  const lint = await runAddonLint({
@@ -2567,7 +2556,7 @@ async function extensionBuild(pathOrRemoteUrl, buildOptions) {
2567
2556
  humanLine(buildComplete(browser, distDisplay, summary.total_bytes, resolvedMode));
2568
2557
  for (const artifact of getZipArtifacts(stats.compilation)){
2569
2558
  const artifactPath = useStagingSwap && artifact.path.startsWith(stagingDistPath) ? distPath + artifact.path.slice(stagingDistPath.length) : artifact.path;
2570
- const zipDisplay = relativeToCwd(artifactPath) || artifactPath;
2559
+ const zipDisplay = relativeToDir(artifactPath, process.cwd()) || artifactPath;
2571
2560
  humanLine(zipArtifactReady(zipDisplay, artifact.size));
2572
2561
  }
2573
2562
  const shareHint = buildShareHint();
@@ -3319,4 +3308,4 @@ async function extensionDev(pathOrRemoteUrl, devOptions) {
3319
3308
  process.exit(1);
3320
3309
  }
3321
3310
  }
3322
- export { BuildEmitter, applySplitChunksGuard, attachLifecycleStream, buildSourceFeatureIndex, classifyEntrySurface, classifyReloadFromSources, createChangedSourcesTracker, createLifecycleStream, defaultSplitChunks, dispatchReload, ensureOptionalContractPackageResolved, ensureTypeScriptConfig, extensionBuild, extensionDev, getJsxImportSource, getUserTypeScriptConfigFile, hasDependency, humanLine, isUsingIntegration, isUsingJsxFramework, isUsingReact, isUsingTypeScript, isUsingVue, jsFrameworksConfigsDetected, jsFrameworksHmrSummary, jsFrameworksIntegrationsEnabled, loadLoaderOptions, maybeUsePreact, maybeUseReact, maybeUseSolid, maybeUseVue, readContentScriptCount, recordZipArtifact, resolveDevelopDistFile, resolveDevelopInstallRoot, swcParserForFile };
3311
+ export { BuildEmitter, applySplitChunksGuard, attachLifecycleStream, buildSourceFeatureIndex, classifyEntrySurface, classifyReloadFromSources, createChangedSourcesTracker, createLifecycleStream, defaultSplitChunks, dispatchReload, ensureOptionalContractPackageResolved, ensureTypeScriptConfig, extensionBuild, extensionDev, getJsxImportSource, getUserTypeScriptConfigFile, hasDependency, humanLine, isUsingIntegration, isUsingJsxFramework, isUsingReact, isUsingTypeScript, isUsingVue, jsFrameworksConfigsDetected, jsFrameworksHmrSummary, jsFrameworksIntegrationsEnabled, loadLoaderOptions, maybeUsePreact, maybeUseReact, maybeUseSolid, maybeUseVue, readContentScriptCount, recordZipArtifact, resolveDevelopDistFile, resolveDevelopInstallRoot, svelteCompilerRuntimeMismatch, swcParserForFile };
package/dist/852~0.mjs CHANGED
@@ -22,6 +22,10 @@ function prefix(type) {
22
22
  if ('debug' === type) return pintor.dim(pintor.gray(DEBUG_GLYPH));
23
23
  return pintor.gray(GLYPH);
24
24
  }
25
+ const ANSI_PATTERN = /\[[0-9;]*m/g;
26
+ function hasChannelPrefix(text) {
27
+ return String(text || '').replace(ANSI_PATTERN, '').trimStart().startsWith(GLYPH);
28
+ }
25
29
  const MACHINE_OUTPUT_VALUES = new Set([
26
30
  'json',
27
31
  'ndjson'
@@ -51,7 +55,8 @@ const fmt = {
51
55
  truncate (input, max = 800) {
52
56
  const s = (()=>{
53
57
  try {
54
- return 'string' == typeof input ? input : JSON.stringify(input);
58
+ if ('string' == typeof input) return input;
59
+ return JSON.stringify(input) ?? String(input);
55
60
  } catch {
56
61
  return String(input);
57
62
  }
@@ -272,4 +277,4 @@ const ENVELOPE = {
272
277
  }, extras);
273
278
  }
274
279
  };
275
- export { CODES, ENVELOPE, artifactNoun, browserRowValue, card, claimCardKey, fmt, humanLine, humanWarn, isDebug, isMachineOutput, prefix };
280
+ export { CODES, ENVELOPE, artifactNoun, browserRowValue, card, claimCardKey, fmt, hasChannelPrefix, humanLine, humanWarn, isDebug, isMachineOutput, prefix };
package/dist/950~0.mjs CHANGED
@@ -1,10 +1,11 @@
1
1
  import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
2
2
  import pintor from "pintor";
3
3
  import { spawnSync } from "node:child_process";
4
- import { fmt, isDebug, artifactNoun, prefix as messaging_prefix } from "./852~0.mjs";
4
+ import { fmt, isDebug, artifactNoun, prefix as messaging_prefix, hasChannelPrefix } from "./852~0.mjs";
5
5
  import { findNearestDenoConfigSync, validateDenoConfig, PROJECT_MANIFEST_FILENAMES, parseJsonSafe, readProjectDependencies } from "./731~0.mjs";
6
6
  import * as __rspack_external_node_path_806ed179 from "node:path";
7
7
  import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
8
+ import * as __rspack_external_node_os_4f3c9d58 from "node:os";
8
9
  function getLoggingPrefix(type) {
9
10
  return messaging_prefix(type);
10
11
  }
@@ -136,16 +137,22 @@ function buildFailed(errorCount) {
136
137
  function stripModuleWarningWrapper(message) {
137
138
  return message.replace(/^Module (?:Warning|Error) \(from [^)]*\):\s*/, '');
138
139
  }
140
+ function stripBundlerDecoration(message) {
141
+ return message.replace(/\r/g, '').split('\n').map((line, index)=>0 === index ? line.replace(/^\s*⚠ ?/, '') : line.replace(/^\s*│ ?/, '')).join('\n').trim();
142
+ }
143
+ function cleanWarningText(message) {
144
+ return stripModuleWarningWrapper(stripBundlerDecoration(message));
145
+ }
139
146
  function getWarningMessage(warning) {
140
147
  if (!warning) return '';
141
- if ('string' == typeof warning) return stripModuleWarningWrapper(warning.trim());
148
+ if ('string' == typeof warning) return cleanWarningText(warning);
142
149
  const candidates = [
143
150
  warning.message,
144
151
  warning.details,
145
152
  warning.reason,
146
153
  warning.description
147
154
  ];
148
- for (const candidate of candidates)if ('string' == typeof candidate && candidate.trim()) return stripModuleWarningWrapper(candidate.trim());
155
+ for (const candidate of candidates)if ('string' == typeof candidate && candidate.trim()) return cleanWarningText(candidate);
149
156
  return '';
150
157
  }
151
158
  function getWarningSource(warning) {
@@ -199,9 +206,11 @@ function buildWarningsDetails(warnings) {
199
206
  if (!message) return void blocks.push(`${getLoggingPrefix('warn')} Warning ${index + 1}: details were suppressed by tool output.\n${formatWarningLabelLine('Source', pintor.gray(source))}\n${formatWarningLabelLine('Hint', 'Re-run with EXTENSION_VERBOSE=1 to inspect full warning messages.')}`);
200
207
  const performanceWarning = parsePerformanceWarning(warning, source, artifact);
201
208
  if (performanceWarning) return void blocks.push(performanceWarning);
209
+ if (hasChannelPrefix(message)) return void blocks.push(message);
210
+ const explained = message.includes('\n');
202
211
  const oneLine = message.replace(/\s+/g, ' ').trim();
203
212
  const artifactSuffix = artifact ? ` ${pintor.gray(`(${artifact})`)}` : '';
204
- blocks.push(`${getLoggingPrefix('warn')} ${category}: ${oneLine}${artifactSuffix}\n${formatWarningLabelLine('Source', pintor.gray(source))}\n${formatWarningLabelLine('Hint', hint)}`);
213
+ blocks.push(`${getLoggingPrefix('warn')} ${category}: ${oneLine}${artifactSuffix}\n` + formatWarningLabelLine('Source', pintor.gray(source)) + (explained ? '' : `\n${formatWarningLabelLine('Hint', hint)}`));
205
214
  });
206
215
  return blocks.join('\n\n');
207
216
  }
@@ -737,6 +746,23 @@ function asAbsolute(p) {
737
746
  function toPosixPath(p) {
738
747
  return p.split(__rspack_external_node_path_806ed179.sep).join('/');
739
748
  }
749
+ function collapseHomeDir(value) {
750
+ const raw = String(value || '');
751
+ const home = __rspack_external_node_os_4f3c9d58.homedir();
752
+ if (!home || !raw.startsWith(home)) return raw;
753
+ const rest = raw.slice(home.length);
754
+ if ('' === rest) return '~';
755
+ if (rest.startsWith(__rspack_external_node_path_806ed179.sep) || rest.startsWith('/')) return `~${rest}`;
756
+ return raw;
757
+ }
758
+ function relativeToDir(target, base) {
759
+ const relative = __rspack_external_node_path_806ed179.relative(base, target);
760
+ if (relative && !relative.startsWith('..') && !__rspack_external_node_path_806ed179.isAbsolute(relative)) return relative;
761
+ return null;
762
+ }
763
+ function displayPath(target, base = process.cwd()) {
764
+ return relativeToDir(target, base) || collapseHomeDir(target);
765
+ }
740
766
  function getDirs(struct) {
741
767
  const manifestDir = asAbsolute(__rspack_external_node_path_806ed179.dirname(struct.manifestPath));
742
768
  const projectManifestPath = struct.packageJsonPath || struct.denoJsonPath;
@@ -970,4 +996,4 @@ function actionsPath(projectPath, browser) {
970
996
  function buildSummaryPath(projectPath, browser) {
971
997
  return __rspack_external_node_path_806ed179.join(browserArtifactsDir(projectPath, browser), 'build-summary.json');
972
998
  }
973
- export { actionsPath, addonLintDependencyAttribution, addonLintFailed, addonLintFinding, addonLintMore, addonLintNotInstalled, addonLintSummary, anotherDevSessionActive, asAbsolute, authorInstallNotice, browserArtifactsDir, browserDistDir, browserLaunchFailed, browserProfileRootDir, buildAssetsTree, buildCommandFailed, buildComplete, buildFailed, buildShareHint, buildSummaryPath, buildWarningsDetails, computePreviewOutputPath, configBrowserOrThrow, configLoadingError, controlPortFilePath, controlTokenPath, debugBrowser, debugContextPath, debugDirs, debugExtensionsToLoad, debugOutputPath, debugPreviewOutput, debugSplitChunksNarrowed, devCommandFailed, devtoolsEngineFor, downloadingText, ensureSessionArtifactsIgnoreFile, ensureSessionStateInProjectGitignore, eventsPath, extensionLoadRecovered, extensionLoadStillRefused, failedToDownloadOrExtractZIPFileError, getDirs, getDistPath, getProjectStructure, invalidRemoteZip, isUsingExperimentalConfig, legacyControlPortFilePath, legacyControlTokenPath, localZipNotFound, logsPath, managedDependencyConflict, manifestInvalidJson, needsInstall, noCompanionExtensionsResolved, normalizeBrowser, notAZipArchive, packagingDistributionFiles, packagingSourceFiles, previewing, previewingCustomOutput, previewingSourceFallback, projectInstallFallbackToNpm, projectInstallInWorkspaceRoot, projectInstallScriptsDisabled, readyContractPath, resolveProjectStructureSync, sessionArtifactsRootDir, sessionStateDir, starting, toPosixPath, treeWithDistFilesBrowser, treeWithSourceAndDistFiles, treeWithSourceFiles, unpackagedSuccessfully, unpackagingExtension, writingTypeDefinitions, writingTypeDefinitionsError, zipArtifactReady };
999
+ export { actionsPath, addonLintDependencyAttribution, addonLintFailed, addonLintFinding, addonLintMore, addonLintNotInstalled, addonLintSummary, anotherDevSessionActive, asAbsolute, authorInstallNotice, browserArtifactsDir, browserDistDir, browserLaunchFailed, browserProfileRootDir, buildAssetsTree, buildCommandFailed, buildComplete, buildFailed, buildShareHint, buildSummaryPath, buildWarningsDetails, collapseHomeDir, computePreviewOutputPath, configBrowserOrThrow, configLoadingError, controlPortFilePath, controlTokenPath, debugBrowser, debugContextPath, debugDirs, debugExtensionsToLoad, debugOutputPath, debugPreviewOutput, debugSplitChunksNarrowed, devCommandFailed, devtoolsEngineFor, displayPath, downloadingText, ensureSessionArtifactsIgnoreFile, ensureSessionStateInProjectGitignore, eventsPath, extensionLoadRecovered, extensionLoadStillRefused, failedToDownloadOrExtractZIPFileError, getDirs, getDistPath, getProjectStructure, invalidRemoteZip, isUsingExperimentalConfig, legacyControlPortFilePath, legacyControlTokenPath, localZipNotFound, logsPath, managedDependencyConflict, manifestInvalidJson, needsInstall, noCompanionExtensionsResolved, normalizeBrowser, notAZipArchive, packagingDistributionFiles, packagingSourceFiles, previewing, previewingCustomOutput, previewingSourceFallback, projectInstallFallbackToNpm, projectInstallInWorkspaceRoot, projectInstallScriptsDisabled, readyContractPath, relativeToDir, resolveProjectStructureSync, sessionArtifactsRootDir, sessionStateDir, starting, toPosixPath, treeWithDistFilesBrowser, treeWithSourceAndDistFiles, treeWithSourceFiles, unpackagedSuccessfully, unpackagingExtension, writingTypeDefinitions, writingTypeDefinitionsError, zipArtifactReady };
@@ -1,6 +1,7 @@
1
1
  export type Channel = 'info' | 'success' | 'warn' | 'error' | 'debug';
2
2
  export declare function isDebug(): boolean;
3
3
  export declare function prefix(type: Channel): string;
4
+ export declare function hasChannelPrefix(text: string): boolean;
4
5
  export declare function isMachineOutput(): boolean;
5
6
  export declare function humanLine(...parts: unknown[]): void;
6
7
  export declare function humanWarn(...parts: unknown[]): void;
@@ -6,6 +6,9 @@ export type BrowserInput = 'chrome' | 'edge' | 'chromium' | 'firefox' | 'brave'
6
6
  export type NormalizedBrowser = 'chrome' | 'edge' | 'chromium' | 'firefox' | 'brave' | 'opera' | 'vivaldi' | 'yandex' | 'waterfox' | 'librewolf' | 'chromium-based' | 'gecko-based' | 'safari' | 'webkit-based';
7
7
  export declare function asAbsolute(p: string): AbsolutePath;
8
8
  export declare function toPosixPath(p: string): string;
9
+ export declare function collapseHomeDir(value: string): string;
10
+ export declare function relativeToDir(target: string, base: string): string | null;
11
+ export declare function displayPath(target: string, base?: string): string;
9
12
  export declare function getDirs(struct: ProjectStructure): {
10
13
  manifestDir: AbsolutePath;
11
14
  packageJsonDir: AbsolutePath;
@@ -5,6 +5,7 @@ export declare function solidIsNotSupported(): string;
5
5
  export declare function youAreAllSet(name: string): string;
6
6
  export declare function creatingTSConfig(): string;
7
7
  export declare function failedToInstallIntegration(integration: string, error: unknown): string;
8
+ export declare function svelteCompilerRuntimeMismatch(compilerVersion: string, projectVersion: string): string;
8
9
  export declare function isUsingCustomLoader(loaderPath: string): string;
9
10
  export declare function jsFrameworksIntegrationsEnabled(integrations: string[]): string;
10
11
  export declare function jsFrameworksConfigsDetected(tsConfigPath?: string, tsRoot?: string, targets?: string[]): string;
@@ -1,3 +1,20 @@
1
1
  import type { DevOptions, JsFramework } from '../../types.js';
2
+ export declare function resolveCompilerSvelte(loaderPath: string): {
3
+ root?: string;
4
+ version?: string;
5
+ };
6
+ export interface SvelteRootChoice {
7
+ root?: string;
8
+ mismatch: boolean;
9
+ compilerVersion?: string;
10
+ projectVersion?: string;
11
+ }
12
+ export declare function isOlderThan(left: string, right: string): boolean;
13
+ export declare function chooseSvelteRoot(input: {
14
+ projectRoot?: string;
15
+ projectVersion?: string;
16
+ compilerRoot?: string;
17
+ compilerVersion?: string;
18
+ }): SvelteRootChoice;
2
19
  export declare function isUsingSvelte(projectPath: string): boolean;
3
20
  export declare function maybeUseSvelte(projectPath: string, mode: DevOptions['mode']): Promise<JsFramework | undefined>;
@@ -30,6 +30,7 @@ export type ReadyMetadata = {
30
30
  rdpPort?: number;
31
31
  profilePath?: string;
32
32
  browserPid?: number;
33
+ launcherPid?: number;
33
34
  toolchainVersion: string;
34
35
  extensionName?: string;
35
36
  extensionVersion?: string;
@@ -1,6 +1,6 @@
1
1
  export declare function serverRestartRequiredFromSpecialFolderMessageOnly(addingOrRemoving: string, folder: string, typeOfAsset: string): string;
2
- export declare function publicMustBeAtProjectRoot(foundAt: string, expectedAt: string): string;
3
- export declare function publicFolderShadowed(usedAt: string, ignoredAt: string): string;
2
+ export declare function publicMustBeAtProjectRoot(foundAt: string, expectedAt: string, projectRoot: string): string;
3
+ export declare function publicFolderShadowed(usedAt: string, ignoredAt: string, projectRoot: string): string;
4
4
  export declare function specialFoldersSetupSummary(hasPublic: boolean, copyEnabled: boolean, ignoredCount: number): string;
5
5
  export declare function specialFolderChangeDetected(action: 'add' | 'remove', folder: 'pages' | 'scripts', relativePath: string): string;
6
6
  export declare function unreferencedScriptDropped(relativePaths: string[]): string;
@@ -14,7 +14,7 @@ import node_path from "node:path";
14
14
  import { utils_isUrl, getBaseNode, parseHtml, manifestJsonOutputTarget, getExtname, getBaseHref, isResourceUnderDirs, getAssetsFromHtml, normalizeManifestOutputPath, manifestPageOutputTarget, canonicalizeDir, iconOutputPath, isFromIncludeList, htmlStaticAssetOutputName, isSpecialScheme, resolveStaticAttributeName, getHtmlPageDeclaredAssetPath, themeImageOutputPath, themeIconOutputPath, applyRewrittenStaticUrl, toResourceKey, cleanLeading, getFilePath, resolveAbsoluteFsPath, cleanAssetUrl, isHttpLike, resolveHtmlRefPath } from "./938~0.mjs";
15
15
  import { prefix as messaging_prefix, isDebug } from "./852~0.mjs";
16
16
  import { isChromiumBasedBrowser, CHROMIUM_FAMILY_ALIASES, GECKO_FAMILY_ALIASES, isWebkitBasedBrowser, isGeckoBasedBrowser } from "./331~0.mjs";
17
- import { maybeUsePreact, isUsingTypeScript, jsFrameworksIntegrationsEnabled, maybeUseReact, isUsingVue, classifyEntrySurface, ensureTypeScriptConfig, resolveDevelopInstallRoot, loadLoaderOptions, getUserTypeScriptConfigFile, isUsingIntegration as messages_isUsingIntegration, maybeUseVue, maybeUseSolid, jsFrameworksHmrSummary, humanLine, ensureOptionalContractPackageResolved, jsFrameworksConfigsDetected, recordZipArtifact, hasDependency, resolveDevelopDistFile, isUsingJsxFramework, getJsxImportSource, swcParserForFile, isUsingReact, defaultSplitChunks } from "./840~0.mjs";
17
+ import { maybeUsePreact, isUsingTypeScript, jsFrameworksIntegrationsEnabled, maybeUseReact, isUsingVue, classifyEntrySurface, ensureTypeScriptConfig, resolveDevelopInstallRoot, loadLoaderOptions, getUserTypeScriptConfigFile, svelteCompilerRuntimeMismatch, isUsingIntegration as messages_isUsingIntegration, maybeUseVue, maybeUseSolid, jsFrameworksHmrSummary, humanLine, ensureOptionalContractPackageResolved, jsFrameworksConfigsDetected, recordZipArtifact, hasDependency, resolveDevelopDistFile, isUsingJsxFramework, getJsxImportSource, swcParserForFile, isUsingReact, defaultSplitChunks } from "./840~0.mjs";
18
18
  import { bundlerFatalError, bundlerRecompiling, browserRunnerDisabled, PlaywrightPlugin, publicFolderShadowed, resolveCompanionExtensionDirs, specialFoldersSetupSummary, noEntrypointsDetected, serverRestartRequiredFromSpecialFolderMessageOnly, specialFolderChangeDetected, spacerLine, messages_ready, getPreloadedEnvKeys, publicMustBeAtProjectRoot, computeExtensionsToLoad, getSpecialFoldersDataForCompiler } from "./832~0.mjs";
19
19
  import { renderStatsBlocks, makeSanitizedConsole } from "./stats-handler~0.mjs";
20
20
  import { stripBom, findNearestProjectManifestSync, PROJECT_MANIFEST_FILENAMES, parseJsonSafe, readProjectDependencies } from "./731~0.mjs";
@@ -2932,6 +2932,7 @@ function getResolvedManifestFieldsData(options) {
2932
2932
  }
2933
2933
  }
2934
2934
  let svelte_userMessageDelivered = false;
2935
+ let svelteMismatchDelivered = false;
2935
2936
  function resolveFromProject(id, projectPath) {
2936
2937
  for (const base of [
2937
2938
  projectPath,
@@ -2941,6 +2942,47 @@ function resolveFromProject(id, projectPath) {
2941
2942
  return req.resolve(id);
2942
2943
  } catch {}
2943
2944
  }
2945
+ function readPackageVersion(packageJsonPath) {
2946
+ try {
2947
+ const parsed = JSON.parse(__rspack_external_node_fs_1b05aee1.readFileSync(packageJsonPath, 'utf-8'));
2948
+ return 'string' == typeof parsed.version ? parsed.version : void 0;
2949
+ } catch {
2950
+ return;
2951
+ }
2952
+ }
2953
+ function resolveCompilerSvelte(loaderPath) {
2954
+ try {
2955
+ const req = createRequire(loaderPath);
2956
+ const packageJsonPath = req.resolve('svelte/package.json');
2957
+ return {
2958
+ root: __rspack_external_node_path_806ed179.dirname(packageJsonPath),
2959
+ version: readPackageVersion(packageJsonPath)
2960
+ };
2961
+ } catch {
2962
+ return {};
2963
+ }
2964
+ }
2965
+ function isOlderThan(left, right) {
2966
+ const parts = (value)=>value.split('-')[0].split('.').map((piece)=>Number.parseInt(piece, 10));
2967
+ const a = parts(left);
2968
+ const b = parts(right);
2969
+ for(let i = 0; i < Math.max(a.length, b.length); i++){
2970
+ const x = Number.isFinite(a[i]) ? a[i] : 0;
2971
+ const y = Number.isFinite(b[i]) ? b[i] : 0;
2972
+ if (x !== y) return x < y;
2973
+ }
2974
+ return false;
2975
+ }
2976
+ function chooseSvelteRoot(input) {
2977
+ const { projectRoot, projectVersion, compilerRoot, compilerVersion } = input;
2978
+ const mismatch = Boolean(projectRoot && compilerRoot && projectVersion && compilerVersion && isOlderThan(projectVersion, compilerVersion));
2979
+ return {
2980
+ root: mismatch ? compilerRoot : projectRoot || compilerRoot,
2981
+ mismatch,
2982
+ compilerVersion,
2983
+ projectVersion
2984
+ };
2985
+ }
2944
2986
  function isUsingSvelte(projectPath) {
2945
2987
  const using = hasDependency(projectPath, 'svelte');
2946
2988
  if (using && !svelte_userMessageDelivered) {
@@ -2990,10 +3032,24 @@ async function maybeUseSvelte(projectPath, mode) {
2990
3032
  }
2991
3033
  ];
2992
3034
  const sveltePackageJson = resolveFromProject('svelte/package.json', projectPath);
2993
- const sveltePackageRoot = sveltePackageJson ? __rspack_external_node_path_806ed179.dirname(sveltePackageJson) : void 0;
3035
+ const projectRoot = sveltePackageJson ? __rspack_external_node_path_806ed179.dirname(sveltePackageJson) : void 0;
3036
+ const compilerSvelte = resolveCompilerSvelte(svelteLoaderPath);
3037
+ const chosen = chooseSvelteRoot({
3038
+ projectRoot,
3039
+ projectVersion: sveltePackageJson ? readPackageVersion(sveltePackageJson) : void 0,
3040
+ compilerRoot: compilerSvelte.root,
3041
+ compilerVersion: compilerSvelte.version
3042
+ });
3043
+ const sveltePackageRoot = chosen.root;
3044
+ if (chosen.mismatch && !svelteMismatchDelivered) {
3045
+ console.warn(svelteCompilerRuntimeMismatch(String(chosen.compilerVersion), String(chosen.projectVersion)));
3046
+ svelteMismatchDelivered = true;
3047
+ }
2994
3048
  const resolveClientSubpath = (relative)=>{
2995
- const direct = resolveFromProject(`svelte/${relative}`, projectPath);
2996
- if (direct) return direct;
3049
+ if (!chosen.mismatch) {
3050
+ const direct = resolveFromProject(`svelte/${relative}`, projectPath);
3051
+ if (direct) return direct;
3052
+ }
2997
3053
  if (!sveltePackageRoot) return;
2998
3054
  const fromRoot = __rspack_external_node_path_806ed179.join(sveltePackageRoot, relative);
2999
3055
  return __rspack_external_node_fs_1b05aee1.existsSync(fromRoot) ? fromRoot : void 0;
@@ -3007,6 +3063,8 @@ async function maybeUseSvelte(projectPath, mode) {
3007
3063
  if (svelteStoreClient) alias['svelte/store'] = svelteStoreClient;
3008
3064
  if (svelteReactivityClient) alias['svelte/reactivity'] = svelteReactivityClient;
3009
3065
  if (svelteLegacyClient) alias['svelte/legacy'] = svelteLegacyClient;
3066
+ const svelteInternal = sveltePackageRoot ? __rspack_external_node_path_806ed179.join(sveltePackageRoot, 'src', 'internal') : void 0;
3067
+ if (svelteInternal && __rspack_external_node_fs_1b05aee1.existsSync(svelteInternal)) alias['svelte/internal'] = svelteInternal;
3010
3068
  const resolverPlugin = {
3011
3069
  apply (compiler) {
3012
3070
  const existingMainFields = compiler.options.resolve?.mainFields || [];
@@ -7805,8 +7863,8 @@ class SpecialFoldersPlugin {
7805
7863
  publicDir
7806
7864
  ] : []);
7807
7865
  compiler.hooks.thisCompilation.tap(SpecialFoldersPlugin.name, (compilation)=>{
7808
- if (inspection.bothExist) pushLayoutWarning(compiler, compilation, 'PublicFolderShadowedWarning', publicFolderShadowed(inspection.fromRoot, inspection.fromManifest));
7809
- else if (inspection.usedFallback) pushLayoutWarning(compiler, compilation, 'PublicLayoutWarning', publicMustBeAtProjectRoot(inspection.fromManifest, inspection.fromRoot));
7866
+ if (inspection.bothExist) pushLayoutWarning(compiler, compilation, 'PublicFolderShadowedWarning', publicFolderShadowed(inspection.fromRoot, inspection.fromManifest, context));
7867
+ else if (inspection.usedFallback) pushLayoutWarning(compiler, compilation, 'PublicLayoutWarning', publicMustBeAtProjectRoot(inspection.fromManifest, inspection.fromRoot, context));
7810
7868
  compilation.hooks.processAssets.tapPromise({
7811
7869
  name: `${SpecialFoldersPlugin.name}:root-absolute-refs`,
7812
7870
  stage: compilation.constructor.PROCESS_ASSETS_STAGE_SUMMARIZE
package/package.json CHANGED
@@ -43,7 +43,7 @@
43
43
  "runtime"
44
44
  ],
45
45
  "name": "extension-develop",
46
- "version": "4.1.21",
46
+ "version": "4.1.23",
47
47
  "description": "Develop, build, preview, and package Extension.js projects.",
48
48
  "author": {
49
49
  "name": "Cezar Augusto",
@@ -109,7 +109,7 @@
109
109
  "fflate": "^0.8.3",
110
110
  "go-git-it": "^5.1.5",
111
111
  "ignore": "^7.0.5",
112
- "less": "4.6.7",
112
+ "less": "4.9.1",
113
113
  "less-loader": "13.0.0",
114
114
  "parse5-utilities": "^1.0.0",
115
115
  "pintor": "0.3.0",