extension-develop 3.8.11 → 3.8.13-canary.219.4f7a8c4

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/535.cjs CHANGED
@@ -10135,6 +10135,7 @@ Set background.noDynamicEntryWarning to true to disable this warning.
10135
10135
  }
10136
10136
  }
10137
10137
  plugin_browsers_define_property(BrowsersPlugin, "name", 'plugin-browsers');
10138
+ var plugin_playwright = __webpack_require__("./webpack/plugin-playwright/index.ts");
10138
10139
  function plugin_wasm_define_property(obj, key, value) {
10139
10140
  if (key in obj) Object.defineProperty(obj, key, {
10140
10141
  value: value,
@@ -10264,6 +10265,14 @@ Set background.noDynamicEntryWarning to true to disable this warning.
10264
10265
  manifestPath
10265
10266
  })
10266
10267
  ];
10268
+ if (devOptions.noBrowser) plugins.push(new plugin_playwright.Tb({
10269
+ packageJsonDir,
10270
+ browser: devOptions.browser,
10271
+ mode: devOptions.mode,
10272
+ outputPath: primaryExtensionOutputDir,
10273
+ manifestPath,
10274
+ port: devOptions.port
10275
+ }));
10267
10276
  if (!devOptions.noBrowser) plugins.push(new BrowsersPlugin({
10268
10277
  extension: unpackedExtensionDirsToLoad,
10269
10278
  browser: devOptions.browser,
package/dist/928.cjs CHANGED
@@ -11,6 +11,7 @@ exports.modules = {
11
11
  var core_ = __webpack_require__("@rspack/core");
12
12
  var dev_server_ = __webpack_require__("@rspack/dev-server");
13
13
  var external_webpack_merge_ = __webpack_require__("webpack-merge");
14
+ var external_fs_ = __webpack_require__("fs");
14
15
  var external_pintor_ = __webpack_require__("pintor");
15
16
  var external_pintor_default = /*#__PURE__*/ __webpack_require__.n(external_pintor_);
16
17
  function getLoggingPrefix(type) {
@@ -24,15 +25,49 @@ exports.modules = {
24
25
  if ('info' === type) return external_pintor_default().gray('►►►');
25
26
  return external_pintor_default().green('►►►');
26
27
  }
27
- function ready(mode, browser) {
28
+ function messages_ready(mode, browser) {
28
29
  const extensionOutput = 'firefox' === browser || 'gecko-based' === browser || 'edge' === browser ? 'Add-on' : 'Extension';
29
30
  const b = String(browser || '');
30
31
  const cap = b.charAt(0).toUpperCase() + b.slice(1);
31
32
  const pretty = external_pintor_default().green('ready for ' + mode);
32
33
  return `${getLoggingPrefix('info')} ${cap} ${extensionOutput} ${pretty}.`;
33
34
  }
34
- function browserRunnerDisabled() {
35
- return `${getLoggingPrefix('info')} Browser launch disabled (no-browser).`;
35
+ function readJsonRecord(filePath) {
36
+ try {
37
+ return JSON.parse(external_fs_.readFileSync(filePath, 'utf8'));
38
+ } catch {
39
+ return null;
40
+ }
41
+ }
42
+ function capitalizeToken(value) {
43
+ return value.split('-').filter(Boolean).map((token)=>token.charAt(0).toUpperCase() + token.slice(1)).join('-');
44
+ }
45
+ function getExtensionVersion() {
46
+ return process.env.EXTENSION_DEVELOP_VERSION || process.env.EXTENSION_CLI_VERSION || (()=>{
47
+ try {
48
+ return __webpack_require__("./package.json").rE;
49
+ } catch {
50
+ return 'unknown';
51
+ }
52
+ })();
53
+ }
54
+ function browserRunnerDisabled(args) {
55
+ const manifest = readJsonRecord(args.manifestPath);
56
+ const ready = readJsonRecord(args.readyPath);
57
+ const browserLabel = capitalizeToken(String(args.browser || 'unknown'));
58
+ const runId = String(ready?.runId || '').trim();
59
+ const pid = Number.isInteger(ready?.pid) ? String(ready?.pid) : '';
60
+ const runLabel = runId ? `${external_pintor_default().gray(runId)}${pid ? ` · ${external_pintor_default().gray(`PID ${pid}`)}` : ''}` : pid ? external_pintor_default().gray(`PID ${pid}`) : external_pintor_default().gray('n/a');
61
+ const extensionName = String(manifest?.name || 'Extension');
62
+ const extensionVersion = String(manifest?.version || '').trim();
63
+ const extensionLabel = extensionVersion ? `${extensionName} ${extensionVersion}` : extensionName;
64
+ const extensionJsVersion = getExtensionVersion();
65
+ return [
66
+ ` 🧩 ${external_pintor_default().brightBlue('Extension.js')} ${external_pintor_default().gray(extensionJsVersion)}`,
67
+ ` Browser ${external_pintor_default().gray(`${browserLabel} (build-only mode)`)}`,
68
+ ` Extension ${external_pintor_default().gray(extensionLabel)}`,
69
+ ` Run ID ${runLabel}`
70
+ ].join('\n');
36
71
  }
37
72
  function portInUse(requestedPort, newPort) {
38
73
  return `Port: Requested port ${external_pintor_default().brightBlue(requestedPort.toString())} is in use; using ${external_pintor_default().brightBlue(newPort.toString())} instead.`;
@@ -150,7 +185,6 @@ exports.modules = {
150
185
  this.basePort = basePort;
151
186
  }
152
187
  }
153
- var external_fs_ = __webpack_require__("fs");
154
188
  function hasDependency(projectPath, dependency) {
155
189
  const findNearestPackageJsonDirectory = (startPath)=>{
156
190
  let currentDirectory = startPath;
@@ -323,6 +357,7 @@ exports.modules = {
323
357
  process.on('SIGHUP', cancelAndCleanup);
324
358
  return cancelAutoExit;
325
359
  }
360
+ var plugin_playwright = __webpack_require__("./webpack/plugin-playwright/index.ts");
326
361
  var webpack_config = __webpack_require__("./webpack/webpack-config.ts");
327
362
  async function dev_server_devServer(projectStructure, devOptions) {
328
363
  process.env.EXTENSION_BROWSER_LAUNCH_ENABLED = devOptions.noBrowser ? '0' : '1';
@@ -383,6 +418,14 @@ exports.modules = {
383
418
  }
384
419
  };
385
420
  const compiler = (0, core_.rspack)(compilerConfig);
421
+ const metadata = (0, plugin_playwright.Ih)({
422
+ packageJsonDir,
423
+ browser: String(devOptions.browser || 'chromium'),
424
+ command: 'dev',
425
+ distPath: external_path_.join(packageJsonDir, 'dist', String(devOptions.browser || 'chromium')),
426
+ manifestPath,
427
+ port
428
+ });
386
429
  setupCompilerHooks(compiler, portAllocation.port);
387
430
  if (void 0 !== devOptions.port && devOptions.port !== port) console.log(portInUse(devOptions.port, port));
388
431
  const serverConfig = {
@@ -435,10 +478,15 @@ exports.modules = {
435
478
  }, START_TIMEOUT_MS);
436
479
  await devServer.start();
437
480
  if (startTimeout) clearTimeout(startTimeout);
438
- console.log(ready('development', devOptions.browser));
439
- if (devOptions.noBrowser) console.log(browserRunnerDisabled());
481
+ console.log(messages_ready('development', devOptions.browser));
482
+ if (devOptions.noBrowser) console.log(browserRunnerDisabled({
483
+ browser: String(devOptions.browser || 'chromium'),
484
+ manifestPath,
485
+ readyPath: metadata.readyPath
486
+ }));
440
487
  } catch (error) {
441
488
  if (startTimeout) clearTimeout(startTimeout);
489
+ metadata.writeError('dev_server_start_failed', error instanceof Error ? error.message : String(error));
442
490
  console.log(extensionJsRunnerError(error));
443
491
  process.exit(1);
444
492
  }
package/dist/module.cjs CHANGED
@@ -3,7 +3,7 @@ const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
3
3
  return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
4
4
  }();
5
5
  var __webpack_modules__ = {
6
- "../../node_modules/.pnpm/immutable@5.1.4/node_modules/immutable/dist/immutable.es.js" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
6
+ "../../node_modules/.pnpm/immutable@5.1.5/node_modules/immutable/dist/immutable.es.js" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
7
7
  "use strict";
8
8
  __webpack_require__.r(__webpack_exports__);
9
9
  __webpack_require__.d(__webpack_exports__, {
@@ -1416,6 +1416,9 @@ var __webpack_modules__ = {
1416
1416
  function isDataStructure(value) {
1417
1417
  return 'object' == typeof value && (isImmutable(value) || Array.isArray(value) || isPlainObject(value));
1418
1418
  }
1419
+ function isProtoKey(key) {
1420
+ return 'string' == typeof key && ('__proto__' === key || 'constructor' === key);
1421
+ }
1419
1422
  function arrCopy(arr, offset) {
1420
1423
  offset = offset || 0;
1421
1424
  var len = Math.max(0, arr.length - offset);
@@ -1426,7 +1429,9 @@ var __webpack_modules__ = {
1426
1429
  function shallowCopy(from) {
1427
1430
  if (Array.isArray(from)) return arrCopy(from);
1428
1431
  var to = {};
1429
- for(var key in from)if (hasOwnProperty.call(from, key)) to[key] = from[key];
1432
+ for(var key in from)if (!isProtoKey(key)) {
1433
+ if (hasOwnProperty.call(from, key)) to[key] = from[key];
1434
+ }
1430
1435
  return to;
1431
1436
  }
1432
1437
  function merge(collection) {
@@ -1464,6 +1469,7 @@ var __webpack_modules__ = {
1464
1469
  if (merged === collection) merged = shallowCopy(merged);
1465
1470
  merged.push(value);
1466
1471
  } : function(value, key) {
1472
+ if (isProtoKey(key)) return;
1467
1473
  var hasVal = hasOwnProperty.call(merged, key);
1468
1474
  var nextVal = hasVal && merger ? merger(merged[key], value, key) : value;
1469
1475
  if (!hasVal || nextVal !== merged[key]) {
@@ -2083,6 +2089,7 @@ var __webpack_modules__ = {
2083
2089
  return collectionCopy;
2084
2090
  }
2085
2091
  function set(collection, key, value) {
2092
+ if ('string' == typeof key && isProtoKey(key)) return collection;
2086
2093
  if (!isDataStructure(collection)) throw new TypeError('Cannot update non-data-structure value: ' + collection);
2087
2094
  if (isImmutable(collection)) {
2088
2095
  if (!collection.set) throw new TypeError('Cannot update immutable value without .set() method: ' + collection);
@@ -3174,6 +3181,7 @@ var __webpack_modules__ = {
3174
3181
  assertNotInfinite(this.size);
3175
3182
  var object = {};
3176
3183
  this.__iterate(function(v, k) {
3184
+ if (isProtoKey(k)) return;
3177
3185
  object[k] = v;
3178
3186
  });
3179
3187
  return object;
@@ -3187,6 +3195,7 @@ var __webpack_modules__ = {
3187
3195
  if (isKeyed(value)) {
3188
3196
  var result$1 = {};
3189
3197
  value.__iterate(function(v, k) {
3198
+ if (isProtoKey(k)) return;
3190
3199
  result$1[k] = toJS(v);
3191
3200
  });
3192
3201
  return result$1;
@@ -3976,7 +3985,7 @@ var __webpack_modules__ = {
3976
3985
  function defaultConverter(k, v) {
3977
3986
  return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet();
3978
3987
  }
3979
- var version1 = "5.1.4";
3988
+ var version1 = "5.1.5";
3980
3989
  var Iterable = Collection;
3981
3990
  },
3982
3991
  "../../node_modules/.pnpm/sass@1.97.2/node_modules/sass/sass.dart.js" () {
@@ -127118,7 +127127,7 @@ var __webpack_modules__ = {
127118
127127
  stream: __webpack_require__("stream"),
127119
127128
  nodeModule: __webpack_require__("module"),
127120
127129
  fs: __webpack_require__("fs"),
127121
- immutable: __webpack_require__("../../node_modules/.pnpm/immutable@5.1.4/node_modules/immutable/dist/immutable.es.js")
127130
+ immutable: __webpack_require__("../../node_modules/.pnpm/immutable@5.1.5/node_modules/immutable/dist/immutable.es.js")
127122
127131
  });
127123
127132
  module.exports = library;
127124
127133
  },
@@ -131503,6 +131512,10 @@ var __webpack_modules__ = {
131503
131512
  const err = error;
131504
131513
  return err?.code === 'ENOENT' || String(err?.message || '').includes('ENOENT') || String(err?.message || '').includes('not found');
131505
131514
  }
131515
+ function isInstallExitFailure(error) {
131516
+ const message = String(error?.message || error || '');
131517
+ return /Install failed with exit code \d+/.test(message);
131518
+ }
131506
131519
  function parseWslUncPath(value) {
131507
131520
  const match = /^\\\\wsl(?:\.localhost)?\\([^\\]+)\\(.+)$/.exec(value);
131508
131521
  if (!match) return null;
@@ -131562,7 +131575,7 @@ var __webpack_modules__ = {
131562
131575
  });
131563
131576
  return;
131564
131577
  } catch (error) {
131565
- if (options.fallbackNpmCommand && isMissingManagerError(error)) return void await (0, _webpack_lib_package_manager__rspack_import_5.Qt)(options.fallbackNpmCommand.command, options.fallbackNpmCommand.args, {
131578
+ if (options.fallbackNpmCommand && (isMissingManagerError(error) || options.allowFallbackOnFailure && isInstallExitFailure(error))) return void await (0, _webpack_lib_package_manager__rspack_import_5.Qt)(options.fallbackNpmCommand.command, options.fallbackNpmCommand.args, {
131566
131579
  cwd: options.cwd,
131567
131580
  stdio: 'inherit'
131568
131581
  });
@@ -131706,7 +131719,8 @@ var __webpack_modules__ = {
131706
131719
  ]);
131707
131720
  await execInstallWithFallback(execCommand, {
131708
131721
  cwd: wslContext.useWsl ? void 0 : installBaseDir,
131709
- fallbackNpmCommand
131722
+ fallbackNpmCommand,
131723
+ allowFallbackOnFailure: !wslContext.useWsl && 'npm' !== pm.name && void 0 !== fallbackNpmCommand
131710
131724
  });
131711
131725
  }
131712
131726
  await new Promise((resolve)=>setTimeout(resolve, 500));
@@ -131722,7 +131736,8 @@ var __webpack_modules__ = {
131722
131736
  ]);
131723
131737
  await execInstallWithFallback(rootCommand, {
131724
131738
  cwd: wslContext.useWsl ? void 0 : installBaseDir,
131725
- fallbackNpmCommand: rootFallbackCommand
131739
+ fallbackNpmCommand: rootFallbackCommand,
131740
+ allowFallbackOnFailure: !wslContext.useWsl && 'npm' !== pm.name && void 0 !== rootFallbackCommand
131726
131741
  });
131727
131742
  console.log(_messages__rspack_import_2.ys(integration));
131728
131743
  }
@@ -133062,6 +133077,193 @@ var __webpack_modules__ = {
133062
133077
  };
133063
133078
  }
133064
133079
  },
133080
+ "./webpack/plugin-playwright/index.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
133081
+ "use strict";
133082
+ __webpack_require__.d(__webpack_exports__, {
133083
+ Ih: ()=>createPlaywrightMetadataWriter,
133084
+ Tb: ()=>PlaywrightPlugin
133085
+ });
133086
+ var fs__rspack_import_0 = __webpack_require__("fs");
133087
+ var path__rspack_import_1 = __webpack_require__("path");
133088
+ var _webpack_lib_paths__rspack_import_2 = __webpack_require__("./webpack/webpack-lib/paths.ts");
133089
+ function _define_property(obj, key, value) {
133090
+ if (key in obj) Object.defineProperty(obj, key, {
133091
+ value: value,
133092
+ enumerable: true,
133093
+ configurable: true,
133094
+ writable: true
133095
+ });
133096
+ else obj[key] = value;
133097
+ return obj;
133098
+ }
133099
+ function nowISO() {
133100
+ return new Date().toISOString();
133101
+ }
133102
+ function createRunId() {
133103
+ return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
133104
+ }
133105
+ function ensureDirSync(dirPath) {
133106
+ try {
133107
+ fs__rspack_import_0.mkdirSync(dirPath, {
133108
+ recursive: true
133109
+ });
133110
+ } catch {}
133111
+ }
133112
+ function writeJsonAtomic(filePath, value) {
133113
+ try {
133114
+ const tmpPath = `${filePath}.tmp-${process.pid}`;
133115
+ fs__rspack_import_0.writeFileSync(tmpPath, JSON.stringify(value, null, 2) + '\n', 'utf-8');
133116
+ fs__rspack_import_0.renameSync(tmpPath, filePath);
133117
+ } catch {}
133118
+ }
133119
+ function getPlaywrightMetadataDir(packageJsonDir, browser) {
133120
+ return (0, _webpack_lib_paths__rspack_import_2.G6)(path__rspack_import_1.join(packageJsonDir, 'dist', 'extension-js', browser));
133121
+ }
133122
+ function createPlaywrightMetadataWriter(options) {
133123
+ const metadataDir = getPlaywrightMetadataDir(options.packageJsonDir, options.browser);
133124
+ const readyPath = (0, _webpack_lib_paths__rspack_import_2.G6)(path__rspack_import_1.join(metadataDir, 'ready.json'));
133125
+ const eventsPath = (0, _webpack_lib_paths__rspack_import_2.G6)(path__rspack_import_1.join(metadataDir, 'events.ndjson'));
133126
+ const base = {
133127
+ command: options.command,
133128
+ browser: options.browser,
133129
+ runId: createRunId(),
133130
+ startedAt: nowISO(),
133131
+ distPath: options.distPath,
133132
+ manifestPath: options.manifestPath,
133133
+ port: (()=>{
133134
+ if ('number' == typeof options.port && Number.isFinite(options.port)) return options.port;
133135
+ if ('string' == typeof options.port) {
133136
+ const parsed = parseInt(options.port, 10);
133137
+ return Number.isFinite(parsed) ? parsed : null;
133138
+ }
133139
+ return null;
133140
+ })()
133141
+ };
133142
+ function writeReady(status, extra) {
133143
+ ensureDirSync(metadataDir);
133144
+ const payload = {
133145
+ ...base,
133146
+ status,
133147
+ pid: process.pid,
133148
+ ts: nowISO(),
133149
+ compiledAt: extra?.compiledAt ?? null,
133150
+ errors: Array.isArray(extra?.errors) ? extra.errors : []
133151
+ };
133152
+ if (extra?.code) payload.code = extra.code;
133153
+ if (extra?.message) payload.message = extra.message;
133154
+ writeJsonAtomic(readyPath, payload);
133155
+ }
133156
+ function appendEvent(event) {
133157
+ ensureDirSync(metadataDir);
133158
+ try {
133159
+ fs__rspack_import_0.appendFileSync(eventsPath, `${JSON.stringify(event)}\n`, 'utf-8');
133160
+ } catch {}
133161
+ }
133162
+ return {
133163
+ metadataDir,
133164
+ readyPath,
133165
+ eventsPath,
133166
+ writeStarting () {
133167
+ writeReady('starting');
133168
+ },
133169
+ writeReady (compiledAt) {
133170
+ writeReady('ready', {
133171
+ compiledAt: compiledAt || nowISO()
133172
+ });
133173
+ },
133174
+ writeError (code, message, errors) {
133175
+ writeReady('error', {
133176
+ code,
133177
+ message,
133178
+ errors: Array.isArray(errors) ? errors : [],
133179
+ compiledAt: null
133180
+ });
133181
+ },
133182
+ appendEvent
133183
+ };
133184
+ }
133185
+ class PlaywrightPlugin {
133186
+ apply(compiler) {
133187
+ this.writer.writeStarting();
133188
+ compiler.hooks.compile.tap(PlaywrightPlugin.name, ()=>{
133189
+ this.writer.appendEvent({
133190
+ type: 'compile_start',
133191
+ ts: nowISO(),
133192
+ command: this.command,
133193
+ browser: this.browser
133194
+ });
133195
+ });
133196
+ compiler.hooks.done.tap(PlaywrightPlugin.name, (stats)=>{
133197
+ const durationMs = Number((stats?.compilation?.endTime || 0) - (stats?.compilation?.startTime || 0));
133198
+ const hasErrors = Boolean(stats?.hasErrors?.());
133199
+ const errorsCount = Number(Array.isArray(stats?.toJson?.({
133200
+ all: false,
133201
+ errors: true
133202
+ })?.errors) ? stats.toJson({
133203
+ all: false,
133204
+ errors: true
133205
+ }).errors.length : 0);
133206
+ if (hasErrors) {
133207
+ this.writer.appendEvent({
133208
+ type: 'compile_error',
133209
+ ts: nowISO(),
133210
+ command: this.command,
133211
+ browser: this.browser,
133212
+ durationMs: Number.isFinite(durationMs) ? durationMs : void 0,
133213
+ errorCount: Number.isFinite(errorsCount) ? errorsCount : 1
133214
+ });
133215
+ this.writer.writeError('compile_error', 'Compilation failed', [
133216
+ `errors: ${String(errorsCount || 1)}`
133217
+ ]);
133218
+ return;
133219
+ }
133220
+ this.writer.appendEvent({
133221
+ type: 'compile_success',
133222
+ ts: nowISO(),
133223
+ command: this.command,
133224
+ browser: this.browser,
133225
+ durationMs: Number.isFinite(durationMs) ? durationMs : void 0,
133226
+ errorCount: 0
133227
+ });
133228
+ this.writer.writeReady(nowISO());
133229
+ });
133230
+ compiler.hooks.failed.tap(PlaywrightPlugin.name, (error)=>{
133231
+ this.writer.appendEvent({
133232
+ type: 'compile_error',
133233
+ ts: nowISO(),
133234
+ command: this.command,
133235
+ browser: this.browser,
133236
+ errorCount: 1
133237
+ });
133238
+ this.writer.writeError('compile_failed', error instanceof Error ? error.message : String(error));
133239
+ });
133240
+ compiler.hooks.watchClose.tap(PlaywrightPlugin.name, ()=>{
133241
+ this.writer.appendEvent({
133242
+ type: 'shutdown',
133243
+ ts: nowISO(),
133244
+ command: this.command,
133245
+ browser: this.browser
133246
+ });
133247
+ });
133248
+ }
133249
+ constructor(options){
133250
+ _define_property(this, "writer", void 0);
133251
+ _define_property(this, "command", void 0);
133252
+ _define_property(this, "browser", void 0);
133253
+ this.browser = String(options.browser || 'chromium');
133254
+ this.command = options.command || ('development' === options.mode ? 'dev' : 'start');
133255
+ this.writer = createPlaywrightMetadataWriter({
133256
+ packageJsonDir: options.packageJsonDir,
133257
+ browser: this.browser,
133258
+ command: this.command,
133259
+ distPath: options.outputPath,
133260
+ manifestPath: options.manifestPath,
133261
+ port: options.port
133262
+ });
133263
+ }
133264
+ }
133265
+ _define_property(PlaywrightPlugin, "name", 'plugin-playwright');
133266
+ },
133065
133267
  "./webpack/webpack-lib/check-build-dependencies.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
133066
133268
  "use strict";
133067
133269
  __webpack_require__.d(__webpack_exports__, {
@@ -133636,6 +133838,7 @@ var __webpack_modules__ = {
133636
133838
  ax: ()=>downloadedProjectFolderNotFound,
133637
133839
  dx: ()=>manifestNotFoundError,
133638
133840
  f7: ()=>configLoadingError,
133841
+ fm: ()=>buildSuccessWithWarnings,
133639
133842
  gC: ()=>unpackagingExtension,
133640
133843
  jM: ()=>debugExtensionsToLoad,
133641
133844
  jV: ()=>debugPreviewOutput,
@@ -133645,6 +133848,7 @@ var __webpack_modules__ = {
133645
133848
  tc: ()=>invalidRemoteZip,
133646
133849
  v_: ()=>writingTypeDefinitionsError,
133647
133850
  vo: ()=>buildDependenciesManualInstall,
133851
+ wh: ()=>buildWarningsDetails,
133648
133852
  xK: ()=>installingBuildDependencies,
133649
133853
  yp: ()=>noCompanionExtensionsResolved,
133650
133854
  zM: ()=>unpackagedSuccessfully
@@ -133751,7 +133955,77 @@ var __webpack_modules__ = {
133751
133955
  return output;
133752
133956
  }
133753
133957
  function buildSuccess() {
133754
- return `${getLoggingPrefix('success')} No errors or warnings found. Your extension is ${pintor__rspack_import_2_default().green('ready for deployment')}.`;
133958
+ return `${getLoggingPrefix('success')} Build succeeded with no warnings. Your extension is ${pintor__rspack_import_2_default().green('ready for deployment')}.`;
133959
+ }
133960
+ function getWarningMessage(warning) {
133961
+ if (!warning) return '';
133962
+ if ('string' == typeof warning) return warning.trim();
133963
+ const candidates = [
133964
+ warning.message,
133965
+ warning.details,
133966
+ warning.reason,
133967
+ warning.description
133968
+ ];
133969
+ for (const candidate of candidates)if ('string' == typeof candidate && candidate.trim()) return candidate.trim();
133970
+ return '';
133971
+ }
133972
+ function getWarningSource(warning) {
133973
+ if (!warning || 'string' == typeof warning) return 'bundler';
133974
+ const candidates = [
133975
+ warning.name,
133976
+ warning.moduleName,
133977
+ warning.moduleIdentifier,
133978
+ warning.originName,
133979
+ warning.pluginName
133980
+ ];
133981
+ for (const candidate of candidates)if ('string' == typeof candidate && candidate.trim()) return candidate.trim();
133982
+ return 'bundler';
133983
+ }
133984
+ function getWarningArtifact(warning) {
133985
+ if (!warning || 'string' == typeof warning) return '';
133986
+ const candidates = [
133987
+ warning.file,
133988
+ warning.chunkName,
133989
+ warning.moduleName
133990
+ ];
133991
+ for (const candidate of candidates)if ('string' == typeof candidate && candidate.trim()) return candidate.trim();
133992
+ return '';
133993
+ }
133994
+ function classifyWarning(message, source) {
133995
+ const haystack = `${message} ${source}`.toLowerCase();
133996
+ if (haystack.includes('performance') || haystack.includes('asset size') || haystack.includes('entrypoint size') || haystack.includes('exceeds the recommended size') || haystack.includes('hints')) return 'Performance';
133997
+ if (haystack.includes('deprecat') || haystack.includes('[dep_') || haystack.includes('legacy')) return 'Deprecation';
133998
+ if (haystack.includes('invalid') || haystack.includes('unknown option') || haystack.includes('configuration') || haystack.includes('schema')) return 'Configuration';
133999
+ if (haystack.includes('manifest') || haystack.includes('browser') || haystack.includes('target')) return 'Compatibility';
134000
+ if (haystack.includes('runtime') || haystack.includes('will fail') || haystack.includes('cannot resolve') || haystack.includes('service_worker')) return 'Runtime-risk';
134001
+ return 'Warning';
134002
+ }
134003
+ function suggestedActionForWarning(category) {
134004
+ if ('Performance' === category) return 'Split optional features and lazy-load heavy paths. Tune thresholds only if large assets are intentional.';
134005
+ if ('Deprecation' === category) return 'Move to the supported API/plugin path to avoid breakage in future updates.';
134006
+ if ('Configuration' === category) return 'Review extension and bundler config keys, then remove or rename invalid options.';
134007
+ if ('Compatibility' === category) return 'Verify browser target and manifest compatibility for this build.';
134008
+ if ('Runtime-risk' === category) return 'Address this warning before release; it may fail or degrade at runtime.';
134009
+ return 'Re-run with verbose output to inspect warning details and apply targeted fixes.';
134010
+ }
134011
+ function buildSuccessWithWarnings(warningCount) {
134012
+ return `${getLoggingPrefix('warn')} Build succeeded with ${warningCount} warning(s). Your extension is ${pintor__rspack_import_2_default().green('ready for deployment')}.`;
134013
+ }
134014
+ function buildWarningsDetails(warnings) {
134015
+ if (!Array.isArray(warnings) || 0 === warnings.length) return '';
134016
+ const lines = [];
134017
+ warnings.forEach((warning, index)=>{
134018
+ const message = getWarningMessage(warning);
134019
+ const source = getWarningSource(warning);
134020
+ const artifact = getWarningArtifact(warning);
134021
+ const category = classifyWarning(message, source);
134022
+ const action = suggestedActionForWarning(category);
134023
+ if (!message) return void lines.push(`- Warning ${index + 1}: details were suppressed by tool output.`, ` Source: ${source}`, " Action: Re-run with EXTENSION_VERBOSE=1 to inspect full warning messages.");
134024
+ const oneLine = message.replace(/\s+/g, ' ').trim();
134025
+ const artifactSuffix = artifact ? ` (${artifact})` : '';
134026
+ lines.push(`- ${category}: ${oneLine}${artifactSuffix}`, ` Source: ${source}`, ` Action: ${action}`);
134027
+ });
134028
+ return lines.join('\n');
133755
134029
  }
133756
134030
  function fetchingProjectPath(owner, project) {
133757
134031
  return fmt.block('Fetching project', [
@@ -134832,7 +135106,7 @@ var __webpack_modules__ = {
134832
135106
  },
134833
135107
  "./package.json" (module) {
134834
135108
  "use strict";
134835
- module.exports = JSON.parse('{"rE":"3.8.11","El":{"@rspack/core":"^1.7.5","@rspack/dev-server":"^1.1.5","@swc/core":"^1.15.8","@swc/helpers":"^0.5.18","adm-zip":"^0.5.16","browser-extension-manifest-fields":"^2.2.1","case-sensitive-paths-webpack-plugin":"^2.4.0","chrome-location2":"4.0.0","chromium-location":"2.0.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^17.2.3","edge-location":"2.2.0","extension-from-store":"^0.1.1","firefox-location2":"3.0.0","go-git-it":"^5.1.1","ignore":"^7.0.5","loader-utils":"^3.3.1","magic-string":"^0.30.21","parse5":"^8.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","schema-utils":"^4.3.3","tiny-glob":"^0.2.9","unique-names-generator":"^4.7.1","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.19.0"}}');
135109
+ module.exports = JSON.parse('{"rE":"3.8.13-canary.219.4f7a8c4","El":{"@rspack/core":"^1.7.5","@rspack/dev-server":"^1.1.5","@swc/core":"^1.15.8","@swc/helpers":"^0.5.18","adm-zip":"^0.5.16","browser-extension-manifest-fields":"^2.2.1","case-sensitive-paths-webpack-plugin":"^2.4.0","chrome-location2":"4.0.0","chromium-location":"2.0.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^17.2.3","edge-location":"2.2.0","extension-from-store":"^0.1.1","firefox-location2":"3.0.0","go-git-it":"^5.1.1","ignore":"^7.0.5","loader-utils":"^3.3.1","magic-string":"^0.30.21","parse5":"^8.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","schema-utils":"^4.3.3","tiny-glob":"^0.2.9","unique-names-generator":"^4.7.1","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.19.0"}}');
134836
135110
  }
134837
135111
  };
134838
135112
  var __webpack_module_cache__ = {};
@@ -135794,12 +136068,17 @@ var __webpack_exports__ = {};
135794
136068
  process.exit(1);
135795
136069
  } else {
135796
136070
  const info = stats?.toJson({
136071
+ all: false,
135797
136072
  assets: true,
135798
136073
  warnings: true,
135799
136074
  errors: true
135800
136075
  });
135801
136076
  summary = getBuildSummary(browser, info);
135802
- console.log(messages.Cf());
136077
+ if (summary.warnings_count > 0) {
136078
+ console.log(messages.fm(summary.warnings_count));
136079
+ const warningDetails = messages.wh(info?.warnings || []);
136080
+ if (warningDetails) console.log(`\n${warningDetails}`);
136081
+ } else console.log(messages.Cf());
135803
136082
  resolve();
135804
136083
  }
135805
136084
  });
@@ -135887,6 +136166,7 @@ var __webpack_exports__ = {};
135887
136166
  process.exit(1);
135888
136167
  }
135889
136168
  }
136169
+ var plugin_playwright = __webpack_require__("./webpack/plugin-playwright/index.ts");
135890
136170
  var sanitize = __webpack_require__("./webpack/webpack-lib/sanitize.ts");
135891
136171
  var utils = __webpack_require__("./webpack/feature-special-folders/folder-extensions/utils.ts");
135892
136172
  function resolveCompanionExtensionDirs(opts) {
@@ -136031,17 +136311,34 @@ var __webpack_exports__ = {};
136031
136311
  const browser = (0, webpack_lib_paths.YN)(previewOptions.browser || 'chrome', previewOptions.chromiumBinary, previewOptions.geckoBinary || previewOptions.firefoxBinary);
136032
136312
  const outputPath = (0, webpack_lib_paths.u2)(projectStructure, browser, previewOptions.outputPath);
136033
136313
  const distPath = (0, webpack_lib_paths.q4)(packageJsonDir, browser);
136314
+ const metadataCommand = 'start' === previewOptions.metadataCommand ? 'start' : 'preview';
136315
+ const metadata = (0, plugin_playwright.Ih)({
136316
+ packageJsonDir,
136317
+ browser: String(browser),
136318
+ command: metadataCommand,
136319
+ distPath,
136320
+ manifestPath: projectStructure.manifestPath,
136321
+ port: 'number' == typeof previewOptions.port ? previewOptions.port : 'string' == typeof previewOptions.port ? parseInt(previewOptions.port, 10) : null
136322
+ });
136323
+ metadata.writeStarting();
136034
136324
  if (debug) {
136035
136325
  console.log(messages.SG(manifestDir, packageJsonDir));
136036
136326
  console.log(messages._A(browser, previewOptions.chromiumBinary, previewOptions.geckoBinary || previewOptions.firefoxBinary));
136037
136327
  console.log(messages.jV(outputPath, distPath));
136038
136328
  }
136039
136329
  const manifestAtOutput = external_path_.join(outputPath, 'manifest.json');
136040
- if (!external_fs_.existsSync(manifestAtOutput)) throw new Error(`Preview is run-only and does not compile.\nExpected an unpacked extension at:\n ${manifestAtOutput}\n\nRun \`extension build\` or \`extension dev\` first, or pass --output-path to an existing unpacked extension directory.`);
136330
+ if (!external_fs_.existsSync(manifestAtOutput)) {
136331
+ metadata.writeError('preview_manifest_missing', `Expected manifest at ${manifestAtOutput}`);
136332
+ throw new Error(`Preview is run-only and does not compile.\nExpected an unpacked extension at:\n ${manifestAtOutput}\n\nRun \`extension build\` or \`extension dev\` first, or pass --output-path to an existing unpacked extension directory.`);
136333
+ }
136041
136334
  const commandConfig = await (0, config_loader.eY)(packageJsonDir, 'preview');
136042
136335
  const browserConfig = await (0, config_loader.xY)(packageJsonDir, browser);
136043
136336
  console.log(messages.V_(browser));
136044
- if (previewOptions.noBrowser) return void console.log(messages.k4(browser));
136337
+ if (previewOptions.noBrowser) {
136338
+ console.log(messages.k4(browser));
136339
+ metadata.writeReady();
136340
+ return;
136341
+ }
136045
136342
  const safeBrowserConfig = (0, sanitize.a)(browserConfig);
136046
136343
  const safeCommandConfig = (0, sanitize.a)(commandConfig);
136047
136344
  const safePreviewOptions = (0, sanitize.a)(previewOptions);
@@ -136090,6 +136387,7 @@ var __webpack_exports__ = {};
136090
136387
  port: merged.port,
136091
136388
  dryRun: merged.dryRun
136092
136389
  });
136390
+ metadata.writeReady();
136093
136391
  }
136094
136392
  async function extensionStart(pathOrRemoteUrl, startOptions) {
136095
136393
  const projectStructure = await getProjectStructure(pathOrRemoteUrl);
@@ -136131,6 +136429,7 @@ var __webpack_exports__ = {};
136131
136429
  ...commandConfig,
136132
136430
  ...startOptions,
136133
136431
  browser,
136432
+ metadataCommand: 'start',
136134
136433
  geckoBinary: startOptions.geckoBinary || startOptions.firefoxBinary || browserConfig.geckoBinary || browserConfig.firefoxBinary || commandConfig.geckoBinary || commandConfig.firefoxBinary,
136135
136434
  outputPath: distPath
136136
136435
  });
package/package.json CHANGED
@@ -24,7 +24,7 @@
24
24
  "webpack/webpack-lib/build-dependencies.json"
25
25
  ],
26
26
  "name": "extension-develop",
27
- "version": "3.8.11",
27
+ "version": "3.8.13-canary.219.4f7a8c4",
28
28
  "description": "Develop, build, preview, and package Extension.js projects.",
29
29
  "author": {
30
30
  "name": "Cezar Augusto",