extension-develop 3.8.11 → 3.8.13

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
  },
@@ -133062,6 +133071,193 @@ var __webpack_modules__ = {
133062
133071
  };
133063
133072
  }
133064
133073
  },
133074
+ "./webpack/plugin-playwright/index.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
133075
+ "use strict";
133076
+ __webpack_require__.d(__webpack_exports__, {
133077
+ Ih: ()=>createPlaywrightMetadataWriter,
133078
+ Tb: ()=>PlaywrightPlugin
133079
+ });
133080
+ var fs__rspack_import_0 = __webpack_require__("fs");
133081
+ var path__rspack_import_1 = __webpack_require__("path");
133082
+ var _webpack_lib_paths__rspack_import_2 = __webpack_require__("./webpack/webpack-lib/paths.ts");
133083
+ function _define_property(obj, key, value) {
133084
+ if (key in obj) Object.defineProperty(obj, key, {
133085
+ value: value,
133086
+ enumerable: true,
133087
+ configurable: true,
133088
+ writable: true
133089
+ });
133090
+ else obj[key] = value;
133091
+ return obj;
133092
+ }
133093
+ function nowISO() {
133094
+ return new Date().toISOString();
133095
+ }
133096
+ function createRunId() {
133097
+ return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
133098
+ }
133099
+ function ensureDirSync(dirPath) {
133100
+ try {
133101
+ fs__rspack_import_0.mkdirSync(dirPath, {
133102
+ recursive: true
133103
+ });
133104
+ } catch {}
133105
+ }
133106
+ function writeJsonAtomic(filePath, value) {
133107
+ try {
133108
+ const tmpPath = `${filePath}.tmp-${process.pid}`;
133109
+ fs__rspack_import_0.writeFileSync(tmpPath, JSON.stringify(value, null, 2) + '\n', 'utf-8');
133110
+ fs__rspack_import_0.renameSync(tmpPath, filePath);
133111
+ } catch {}
133112
+ }
133113
+ function getPlaywrightMetadataDir(packageJsonDir, browser) {
133114
+ return (0, _webpack_lib_paths__rspack_import_2.G6)(path__rspack_import_1.join(packageJsonDir, 'dist', 'extension-js', browser));
133115
+ }
133116
+ function createPlaywrightMetadataWriter(options) {
133117
+ const metadataDir = getPlaywrightMetadataDir(options.packageJsonDir, options.browser);
133118
+ const readyPath = (0, _webpack_lib_paths__rspack_import_2.G6)(path__rspack_import_1.join(metadataDir, 'ready.json'));
133119
+ const eventsPath = (0, _webpack_lib_paths__rspack_import_2.G6)(path__rspack_import_1.join(metadataDir, 'events.ndjson'));
133120
+ const base = {
133121
+ command: options.command,
133122
+ browser: options.browser,
133123
+ runId: createRunId(),
133124
+ startedAt: nowISO(),
133125
+ distPath: options.distPath,
133126
+ manifestPath: options.manifestPath,
133127
+ port: (()=>{
133128
+ if ('number' == typeof options.port && Number.isFinite(options.port)) return options.port;
133129
+ if ('string' == typeof options.port) {
133130
+ const parsed = parseInt(options.port, 10);
133131
+ return Number.isFinite(parsed) ? parsed : null;
133132
+ }
133133
+ return null;
133134
+ })()
133135
+ };
133136
+ function writeReady(status, extra) {
133137
+ ensureDirSync(metadataDir);
133138
+ const payload = {
133139
+ ...base,
133140
+ status,
133141
+ pid: process.pid,
133142
+ ts: nowISO(),
133143
+ compiledAt: extra?.compiledAt ?? null,
133144
+ errors: Array.isArray(extra?.errors) ? extra.errors : []
133145
+ };
133146
+ if (extra?.code) payload.code = extra.code;
133147
+ if (extra?.message) payload.message = extra.message;
133148
+ writeJsonAtomic(readyPath, payload);
133149
+ }
133150
+ function appendEvent(event) {
133151
+ ensureDirSync(metadataDir);
133152
+ try {
133153
+ fs__rspack_import_0.appendFileSync(eventsPath, `${JSON.stringify(event)}\n`, 'utf-8');
133154
+ } catch {}
133155
+ }
133156
+ return {
133157
+ metadataDir,
133158
+ readyPath,
133159
+ eventsPath,
133160
+ writeStarting () {
133161
+ writeReady('starting');
133162
+ },
133163
+ writeReady (compiledAt) {
133164
+ writeReady('ready', {
133165
+ compiledAt: compiledAt || nowISO()
133166
+ });
133167
+ },
133168
+ writeError (code, message, errors) {
133169
+ writeReady('error', {
133170
+ code,
133171
+ message,
133172
+ errors: Array.isArray(errors) ? errors : [],
133173
+ compiledAt: null
133174
+ });
133175
+ },
133176
+ appendEvent
133177
+ };
133178
+ }
133179
+ class PlaywrightPlugin {
133180
+ apply(compiler) {
133181
+ this.writer.writeStarting();
133182
+ compiler.hooks.compile.tap(PlaywrightPlugin.name, ()=>{
133183
+ this.writer.appendEvent({
133184
+ type: 'compile_start',
133185
+ ts: nowISO(),
133186
+ command: this.command,
133187
+ browser: this.browser
133188
+ });
133189
+ });
133190
+ compiler.hooks.done.tap(PlaywrightPlugin.name, (stats)=>{
133191
+ const durationMs = Number((stats?.compilation?.endTime || 0) - (stats?.compilation?.startTime || 0));
133192
+ const hasErrors = Boolean(stats?.hasErrors?.());
133193
+ const errorsCount = Number(Array.isArray(stats?.toJson?.({
133194
+ all: false,
133195
+ errors: true
133196
+ })?.errors) ? stats.toJson({
133197
+ all: false,
133198
+ errors: true
133199
+ }).errors.length : 0);
133200
+ if (hasErrors) {
133201
+ this.writer.appendEvent({
133202
+ type: 'compile_error',
133203
+ ts: nowISO(),
133204
+ command: this.command,
133205
+ browser: this.browser,
133206
+ durationMs: Number.isFinite(durationMs) ? durationMs : void 0,
133207
+ errorCount: Number.isFinite(errorsCount) ? errorsCount : 1
133208
+ });
133209
+ this.writer.writeError('compile_error', 'Compilation failed', [
133210
+ `errors: ${String(errorsCount || 1)}`
133211
+ ]);
133212
+ return;
133213
+ }
133214
+ this.writer.appendEvent({
133215
+ type: 'compile_success',
133216
+ ts: nowISO(),
133217
+ command: this.command,
133218
+ browser: this.browser,
133219
+ durationMs: Number.isFinite(durationMs) ? durationMs : void 0,
133220
+ errorCount: 0
133221
+ });
133222
+ this.writer.writeReady(nowISO());
133223
+ });
133224
+ compiler.hooks.failed.tap(PlaywrightPlugin.name, (error)=>{
133225
+ this.writer.appendEvent({
133226
+ type: 'compile_error',
133227
+ ts: nowISO(),
133228
+ command: this.command,
133229
+ browser: this.browser,
133230
+ errorCount: 1
133231
+ });
133232
+ this.writer.writeError('compile_failed', error instanceof Error ? error.message : String(error));
133233
+ });
133234
+ compiler.hooks.watchClose.tap(PlaywrightPlugin.name, ()=>{
133235
+ this.writer.appendEvent({
133236
+ type: 'shutdown',
133237
+ ts: nowISO(),
133238
+ command: this.command,
133239
+ browser: this.browser
133240
+ });
133241
+ });
133242
+ }
133243
+ constructor(options){
133244
+ _define_property(this, "writer", void 0);
133245
+ _define_property(this, "command", void 0);
133246
+ _define_property(this, "browser", void 0);
133247
+ this.browser = String(options.browser || 'chromium');
133248
+ this.command = options.command || ('development' === options.mode ? 'dev' : 'start');
133249
+ this.writer = createPlaywrightMetadataWriter({
133250
+ packageJsonDir: options.packageJsonDir,
133251
+ browser: this.browser,
133252
+ command: this.command,
133253
+ distPath: options.outputPath,
133254
+ manifestPath: options.manifestPath,
133255
+ port: options.port
133256
+ });
133257
+ }
133258
+ }
133259
+ _define_property(PlaywrightPlugin, "name", 'plugin-playwright');
133260
+ },
133065
133261
  "./webpack/webpack-lib/check-build-dependencies.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
133066
133262
  "use strict";
133067
133263
  __webpack_require__.d(__webpack_exports__, {
@@ -133636,6 +133832,7 @@ var __webpack_modules__ = {
133636
133832
  ax: ()=>downloadedProjectFolderNotFound,
133637
133833
  dx: ()=>manifestNotFoundError,
133638
133834
  f7: ()=>configLoadingError,
133835
+ fm: ()=>buildSuccessWithWarnings,
133639
133836
  gC: ()=>unpackagingExtension,
133640
133837
  jM: ()=>debugExtensionsToLoad,
133641
133838
  jV: ()=>debugPreviewOutput,
@@ -133645,6 +133842,7 @@ var __webpack_modules__ = {
133645
133842
  tc: ()=>invalidRemoteZip,
133646
133843
  v_: ()=>writingTypeDefinitionsError,
133647
133844
  vo: ()=>buildDependenciesManualInstall,
133845
+ wh: ()=>buildWarningsDetails,
133648
133846
  xK: ()=>installingBuildDependencies,
133649
133847
  yp: ()=>noCompanionExtensionsResolved,
133650
133848
  zM: ()=>unpackagedSuccessfully
@@ -133751,7 +133949,77 @@ var __webpack_modules__ = {
133751
133949
  return output;
133752
133950
  }
133753
133951
  function buildSuccess() {
133754
- return `${getLoggingPrefix('success')} No errors or warnings found. Your extension is ${pintor__rspack_import_2_default().green('ready for deployment')}.`;
133952
+ return `${getLoggingPrefix('success')} Build succeeded with no warnings. Your extension is ${pintor__rspack_import_2_default().green('ready for deployment')}.`;
133953
+ }
133954
+ function getWarningMessage(warning) {
133955
+ if (!warning) return '';
133956
+ if ('string' == typeof warning) return warning.trim();
133957
+ const candidates = [
133958
+ warning.message,
133959
+ warning.details,
133960
+ warning.reason,
133961
+ warning.description
133962
+ ];
133963
+ for (const candidate of candidates)if ('string' == typeof candidate && candidate.trim()) return candidate.trim();
133964
+ return '';
133965
+ }
133966
+ function getWarningSource(warning) {
133967
+ if (!warning || 'string' == typeof warning) return 'bundler';
133968
+ const candidates = [
133969
+ warning.name,
133970
+ warning.moduleName,
133971
+ warning.moduleIdentifier,
133972
+ warning.originName,
133973
+ warning.pluginName
133974
+ ];
133975
+ for (const candidate of candidates)if ('string' == typeof candidate && candidate.trim()) return candidate.trim();
133976
+ return 'bundler';
133977
+ }
133978
+ function getWarningArtifact(warning) {
133979
+ if (!warning || 'string' == typeof warning) return '';
133980
+ const candidates = [
133981
+ warning.file,
133982
+ warning.chunkName,
133983
+ warning.moduleName
133984
+ ];
133985
+ for (const candidate of candidates)if ('string' == typeof candidate && candidate.trim()) return candidate.trim();
133986
+ return '';
133987
+ }
133988
+ function classifyWarning(message, source) {
133989
+ const haystack = `${message} ${source}`.toLowerCase();
133990
+ if (haystack.includes('performance') || haystack.includes('asset size') || haystack.includes('entrypoint size') || haystack.includes('exceeds the recommended size') || haystack.includes('hints')) return 'Performance';
133991
+ if (haystack.includes('deprecat') || haystack.includes('[dep_') || haystack.includes('legacy')) return 'Deprecation';
133992
+ if (haystack.includes('invalid') || haystack.includes('unknown option') || haystack.includes('configuration') || haystack.includes('schema')) return 'Configuration';
133993
+ if (haystack.includes('manifest') || haystack.includes('browser') || haystack.includes('target')) return 'Compatibility';
133994
+ if (haystack.includes('runtime') || haystack.includes('will fail') || haystack.includes('cannot resolve') || haystack.includes('service_worker')) return 'Runtime-risk';
133995
+ return 'Warning';
133996
+ }
133997
+ function suggestedActionForWarning(category) {
133998
+ if ('Performance' === category) return 'Split optional features and lazy-load heavy paths. Tune thresholds only if large assets are intentional.';
133999
+ if ('Deprecation' === category) return 'Move to the supported API/plugin path to avoid breakage in future updates.';
134000
+ if ('Configuration' === category) return 'Review extension and bundler config keys, then remove or rename invalid options.';
134001
+ if ('Compatibility' === category) return 'Verify browser target and manifest compatibility for this build.';
134002
+ if ('Runtime-risk' === category) return 'Address this warning before release; it may fail or degrade at runtime.';
134003
+ return 'Re-run with verbose output to inspect warning details and apply targeted fixes.';
134004
+ }
134005
+ function buildSuccessWithWarnings(warningCount) {
134006
+ return `${getLoggingPrefix('warn')} Build succeeded with ${warningCount} warning(s). Your extension is ${pintor__rspack_import_2_default().green('ready for deployment')}.`;
134007
+ }
134008
+ function buildWarningsDetails(warnings) {
134009
+ if (!Array.isArray(warnings) || 0 === warnings.length) return '';
134010
+ const lines = [];
134011
+ warnings.forEach((warning, index)=>{
134012
+ const message = getWarningMessage(warning);
134013
+ const source = getWarningSource(warning);
134014
+ const artifact = getWarningArtifact(warning);
134015
+ const category = classifyWarning(message, source);
134016
+ const action = suggestedActionForWarning(category);
134017
+ 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.");
134018
+ const oneLine = message.replace(/\s+/g, ' ').trim();
134019
+ const artifactSuffix = artifact ? ` (${artifact})` : '';
134020
+ lines.push(`- ${category}: ${oneLine}${artifactSuffix}`, ` Source: ${source}`, ` Action: ${action}`);
134021
+ });
134022
+ return lines.join('\n');
133755
134023
  }
133756
134024
  function fetchingProjectPath(owner, project) {
133757
134025
  return fmt.block('Fetching project', [
@@ -134832,7 +135100,7 @@ var __webpack_modules__ = {
134832
135100
  },
134833
135101
  "./package.json" (module) {
134834
135102
  "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"}}');
135103
+ module.exports = JSON.parse('{"rE":"3.8.13","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
135104
  }
134837
135105
  };
134838
135106
  var __webpack_module_cache__ = {};
@@ -135794,12 +136062,17 @@ var __webpack_exports__ = {};
135794
136062
  process.exit(1);
135795
136063
  } else {
135796
136064
  const info = stats?.toJson({
136065
+ all: false,
135797
136066
  assets: true,
135798
136067
  warnings: true,
135799
136068
  errors: true
135800
136069
  });
135801
136070
  summary = getBuildSummary(browser, info);
135802
- console.log(messages.Cf());
136071
+ if (summary.warnings_count > 0) {
136072
+ console.log(messages.fm(summary.warnings_count));
136073
+ const warningDetails = messages.wh(info?.warnings || []);
136074
+ if (warningDetails) console.log(`\n${warningDetails}`);
136075
+ } else console.log(messages.Cf());
135803
136076
  resolve();
135804
136077
  }
135805
136078
  });
@@ -135887,6 +136160,7 @@ var __webpack_exports__ = {};
135887
136160
  process.exit(1);
135888
136161
  }
135889
136162
  }
136163
+ var plugin_playwright = __webpack_require__("./webpack/plugin-playwright/index.ts");
135890
136164
  var sanitize = __webpack_require__("./webpack/webpack-lib/sanitize.ts");
135891
136165
  var utils = __webpack_require__("./webpack/feature-special-folders/folder-extensions/utils.ts");
135892
136166
  function resolveCompanionExtensionDirs(opts) {
@@ -136031,17 +136305,34 @@ var __webpack_exports__ = {};
136031
136305
  const browser = (0, webpack_lib_paths.YN)(previewOptions.browser || 'chrome', previewOptions.chromiumBinary, previewOptions.geckoBinary || previewOptions.firefoxBinary);
136032
136306
  const outputPath = (0, webpack_lib_paths.u2)(projectStructure, browser, previewOptions.outputPath);
136033
136307
  const distPath = (0, webpack_lib_paths.q4)(packageJsonDir, browser);
136308
+ const metadataCommand = 'start' === previewOptions.metadataCommand ? 'start' : 'preview';
136309
+ const metadata = (0, plugin_playwright.Ih)({
136310
+ packageJsonDir,
136311
+ browser: String(browser),
136312
+ command: metadataCommand,
136313
+ distPath,
136314
+ manifestPath: projectStructure.manifestPath,
136315
+ port: 'number' == typeof previewOptions.port ? previewOptions.port : 'string' == typeof previewOptions.port ? parseInt(previewOptions.port, 10) : null
136316
+ });
136317
+ metadata.writeStarting();
136034
136318
  if (debug) {
136035
136319
  console.log(messages.SG(manifestDir, packageJsonDir));
136036
136320
  console.log(messages._A(browser, previewOptions.chromiumBinary, previewOptions.geckoBinary || previewOptions.firefoxBinary));
136037
136321
  console.log(messages.jV(outputPath, distPath));
136038
136322
  }
136039
136323
  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.`);
136324
+ if (!external_fs_.existsSync(manifestAtOutput)) {
136325
+ metadata.writeError('preview_manifest_missing', `Expected manifest at ${manifestAtOutput}`);
136326
+ 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.`);
136327
+ }
136041
136328
  const commandConfig = await (0, config_loader.eY)(packageJsonDir, 'preview');
136042
136329
  const browserConfig = await (0, config_loader.xY)(packageJsonDir, browser);
136043
136330
  console.log(messages.V_(browser));
136044
- if (previewOptions.noBrowser) return void console.log(messages.k4(browser));
136331
+ if (previewOptions.noBrowser) {
136332
+ console.log(messages.k4(browser));
136333
+ metadata.writeReady();
136334
+ return;
136335
+ }
136045
136336
  const safeBrowserConfig = (0, sanitize.a)(browserConfig);
136046
136337
  const safeCommandConfig = (0, sanitize.a)(commandConfig);
136047
136338
  const safePreviewOptions = (0, sanitize.a)(previewOptions);
@@ -136090,6 +136381,7 @@ var __webpack_exports__ = {};
136090
136381
  port: merged.port,
136091
136382
  dryRun: merged.dryRun
136092
136383
  });
136384
+ metadata.writeReady();
136093
136385
  }
136094
136386
  async function extensionStart(pathOrRemoteUrl, startOptions) {
136095
136387
  const projectStructure = await getProjectStructure(pathOrRemoteUrl);
@@ -136131,6 +136423,7 @@ var __webpack_exports__ = {};
136131
136423
  ...commandConfig,
136132
136424
  ...startOptions,
136133
136425
  browser,
136426
+ metadataCommand: 'start',
136134
136427
  geckoBinary: startOptions.geckoBinary || startOptions.firefoxBinary || browserConfig.geckoBinary || browserConfig.firefoxBinary || commandConfig.geckoBinary || commandConfig.firefoxBinary,
136135
136428
  outputPath: distPath
136136
136429
  });
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",
28
28
  "description": "Develop, build, preview, and package Extension.js projects.",
29
29
  "author": {
30
30
  "name": "Cezar Augusto",