extension-develop 3.8.10 → 3.8.11-canary.216.a962702

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/README.md CHANGED
@@ -95,7 +95,7 @@ Options accepted by each command. Values shown are typical types or enumerations
95
95
  | profile | string or false | Profile path or disable profile persistence |
96
96
  | startingUrl | string | Initial URL to open |
97
97
  | open | boolean | Focus/open the browser window (CLI: use `--no-open` to disable) |
98
- | --no-runner | boolean | Skip launching the browser runner |
98
+ | --no-browser | boolean | Skip launching the browser |
99
99
  | chromiumBinary | string | Custom Chromium-based executable path |
100
100
  | geckoBinary | string | Custom Gecko-based executable path |
101
101
 
package/dist/535.cjs CHANGED
@@ -422,11 +422,13 @@ exports.modules = {
422
422
  }
423
423
  if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(envSelectedFile(envPath));
424
424
  const envVars = envPath ? external_dotenv_.config({
425
- path: envPath
425
+ path: envPath,
426
+ quiet: true
426
427
  }).parsed || {} : {};
427
428
  const defaultsPath = external_path_.join(projectPath, '.env.defaults');
428
429
  const defaultsVars = external_fs_.existsSync(defaultsPath) ? external_dotenv_.config({
429
- path: defaultsPath
430
+ path: defaultsPath,
431
+ quiet: true
430
432
  }).parsed || {} : {};
431
433
  const combinedVars = {
432
434
  ...defaultsVars,
@@ -689,7 +691,7 @@ exports.modules = {
689
691
  compiler.hooks.done.tap('develop:brand', (stats)=>{
690
692
  const hasErrors = Boolean(stats?.hasErrors?.());
691
693
  const hasWarnings = Boolean(stats?.hasWarnings?.());
692
- const runnerEnabled = '0' !== String(process.env.EXTENSION_BROWSER_RUNNER_ENABLED || '1');
694
+ const browserLaunchEnabled = '0' !== String(process.env.EXTENSION_BROWSER_LAUNCH_ENABLED || '1');
693
695
  stats.compilation.name = void 0;
694
696
  const duration = stats.compilation.endTime - stats.compilation.startTime;
695
697
  const manifestName = boring_readJsonFileSafe(this.manifestPath).name;
@@ -705,12 +707,12 @@ exports.modules = {
705
707
  });
706
708
  if (hasUserFileChange) this.sawUserInvalidation = true;
707
709
  }
708
- if (runnerEnabled && !(0, shared_state.TC)() && !hasErrors && !hasWarnings) {
710
+ if (browserLaunchEnabled && !(0, shared_state.TC)() && !hasErrors && !hasWarnings) {
709
711
  this.printedPostBannerStartupSuccess = true;
710
712
  (0, shared_state.FF)(line);
711
713
  return;
712
714
  }
713
- if (runnerEnabled && !hasErrors && !hasWarnings) {
715
+ if (browserLaunchEnabled && !hasErrors && !hasWarnings) {
714
716
  if (!this.sawUserInvalidation) if (this.printedPostBannerStartupSuccess) return;
715
717
  else this.printedPostBannerStartupSuccess = true;
716
718
  }
@@ -10133,6 +10135,7 @@ Set background.noDynamicEntryWarning to true to disable this warning.
10133
10135
  }
10134
10136
  }
10135
10137
  plugin_browsers_define_property(BrowsersPlugin, "name", 'plugin-browsers');
10138
+ var plugin_playwright = __webpack_require__("./webpack/plugin-playwright/index.ts");
10136
10139
  function plugin_wasm_define_property(obj, key, value) {
10137
10140
  if (key in obj) Object.defineProperty(obj, key, {
10138
10141
  value: value,
@@ -10262,7 +10265,15 @@ Set background.noDynamicEntryWarning to true to disable this warning.
10262
10265
  manifestPath
10263
10266
  })
10264
10267
  ];
10265
- if (!devOptions.noRunner) plugins.push(new BrowsersPlugin({
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
+ }));
10276
+ if (!devOptions.noBrowser) plugins.push(new BrowsersPlugin({
10266
10277
  extension: unpackedExtensionDirsToLoad,
10267
10278
  browser: devOptions.browser,
10268
10279
  noOpen: devOptions.noOpen,
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,39 @@ 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 runner disabled (no-runner).`;
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 browserRunnerDisabled(args) {
46
+ const manifest = readJsonRecord(args.manifestPath);
47
+ const ready = readJsonRecord(args.readyPath);
48
+ const browserLabel = capitalizeToken(String(args.browser || 'unknown'));
49
+ const runId = String(ready?.runId || '').trim();
50
+ const pid = Number.isInteger(ready?.pid) ? String(ready?.pid) : '';
51
+ const runLine = runId ? ` · ${external_pintor_default().gray('Run')} ${external_pintor_default().gray(runId)}${pid ? ` · ${external_pintor_default().gray(`pid ${pid}`)}` : ''}` : '';
52
+ const extensionName = String(manifest?.name || 'Extension');
53
+ const extensionVersion = String(manifest?.version || '').trim();
54
+ const extensionLabel = extensionVersion ? `${extensionName} ${extensionVersion}` : extensionName;
55
+ return [
56
+ ` 🧩 ${external_pintor_default().brightBlue('Extension.js')}`,
57
+ ` Browser ${external_pintor_default().gray(browserLabel)}${runLine}`,
58
+ ` Extension ${external_pintor_default().gray(extensionLabel)}`,
59
+ ` Contract ${external_pintor_default().gray(args.readyPath)}`
60
+ ].join('\n');
36
61
  }
37
62
  function portInUse(requestedPort, newPort) {
38
63
  return `Port: Requested port ${external_pintor_default().brightBlue(requestedPort.toString())} is in use; using ${external_pintor_default().brightBlue(newPort.toString())} instead.`;
@@ -150,7 +175,6 @@ exports.modules = {
150
175
  this.basePort = basePort;
151
176
  }
152
177
  }
153
- var external_fs_ = __webpack_require__("fs");
154
178
  function hasDependency(projectPath, dependency) {
155
179
  const findNearestPackageJsonDirectory = (startPath)=>{
156
180
  let currentDirectory = startPath;
@@ -323,9 +347,10 @@ exports.modules = {
323
347
  process.on('SIGHUP', cancelAndCleanup);
324
348
  return cancelAutoExit;
325
349
  }
350
+ var plugin_playwright = __webpack_require__("./webpack/plugin-playwright/index.ts");
326
351
  var webpack_config = __webpack_require__("./webpack/webpack-config.ts");
327
352
  async function dev_server_devServer(projectStructure, devOptions) {
328
- process.env.EXTENSION_BROWSER_RUNNER_ENABLED = devOptions.noRunner ? '0' : '1';
353
+ process.env.EXTENSION_BROWSER_LAUNCH_ENABLED = devOptions.noBrowser ? '0' : '1';
329
354
  const { manifestPath, packageJsonPath } = projectStructure;
330
355
  const manifestDir = external_path_.dirname(manifestPath);
331
356
  const packageJsonDir = external_path_.dirname(packageJsonPath);
@@ -383,6 +408,14 @@ exports.modules = {
383
408
  }
384
409
  };
385
410
  const compiler = (0, core_.rspack)(compilerConfig);
411
+ const metadata = (0, plugin_playwright.Ih)({
412
+ packageJsonDir,
413
+ browser: String(devOptions.browser || 'chromium'),
414
+ command: 'dev',
415
+ distPath: external_path_.join(packageJsonDir, 'dist', String(devOptions.browser || 'chromium')),
416
+ manifestPath,
417
+ port
418
+ });
386
419
  setupCompilerHooks(compiler, portAllocation.port);
387
420
  if (void 0 !== devOptions.port && devOptions.port !== port) console.log(portInUse(devOptions.port, port));
388
421
  const serverConfig = {
@@ -435,10 +468,15 @@ exports.modules = {
435
468
  }, START_TIMEOUT_MS);
436
469
  await devServer.start();
437
470
  if (startTimeout) clearTimeout(startTimeout);
438
- console.log(ready('development', devOptions.browser));
439
- if (devOptions.noRunner) console.log(browserRunnerDisabled());
471
+ console.log(messages_ready('development', devOptions.browser));
472
+ if (devOptions.noBrowser) console.log(browserRunnerDisabled({
473
+ browser: String(devOptions.browser || 'chromium'),
474
+ manifestPath,
475
+ readyPath: metadata.readyPath
476
+ }));
440
477
  } catch (error) {
441
478
  if (startTimeout) clearTimeout(startTimeout);
479
+ metadata.writeError('dev_server_start_failed', error instanceof Error ? error.message : String(error));
442
480
  console.log(extensionJsRunnerError(error));
443
481
  process.exit(1);
444
482
  }
package/dist/module.cjs CHANGED
@@ -133062,6 +133062,193 @@ var __webpack_modules__ = {
133062
133062
  };
133063
133063
  }
133064
133064
  },
133065
+ "./webpack/plugin-playwright/index.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
133066
+ "use strict";
133067
+ __webpack_require__.d(__webpack_exports__, {
133068
+ Ih: ()=>createPlaywrightMetadataWriter,
133069
+ Tb: ()=>PlaywrightPlugin
133070
+ });
133071
+ var fs__rspack_import_0 = __webpack_require__("fs");
133072
+ var path__rspack_import_1 = __webpack_require__("path");
133073
+ var _webpack_lib_paths__rspack_import_2 = __webpack_require__("./webpack/webpack-lib/paths.ts");
133074
+ function _define_property(obj, key, value) {
133075
+ if (key in obj) Object.defineProperty(obj, key, {
133076
+ value: value,
133077
+ enumerable: true,
133078
+ configurable: true,
133079
+ writable: true
133080
+ });
133081
+ else obj[key] = value;
133082
+ return obj;
133083
+ }
133084
+ function nowISO() {
133085
+ return new Date().toISOString();
133086
+ }
133087
+ function createRunId() {
133088
+ return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
133089
+ }
133090
+ function ensureDirSync(dirPath) {
133091
+ try {
133092
+ fs__rspack_import_0.mkdirSync(dirPath, {
133093
+ recursive: true
133094
+ });
133095
+ } catch {}
133096
+ }
133097
+ function writeJsonAtomic(filePath, value) {
133098
+ try {
133099
+ const tmpPath = `${filePath}.tmp-${process.pid}`;
133100
+ fs__rspack_import_0.writeFileSync(tmpPath, JSON.stringify(value, null, 2) + '\n', 'utf-8');
133101
+ fs__rspack_import_0.renameSync(tmpPath, filePath);
133102
+ } catch {}
133103
+ }
133104
+ function getPlaywrightMetadataDir(packageJsonDir, browser) {
133105
+ return (0, _webpack_lib_paths__rspack_import_2.G6)(path__rspack_import_1.join(packageJsonDir, 'dist', 'extension-js', browser));
133106
+ }
133107
+ function createPlaywrightMetadataWriter(options) {
133108
+ const metadataDir = getPlaywrightMetadataDir(options.packageJsonDir, options.browser);
133109
+ const readyPath = (0, _webpack_lib_paths__rspack_import_2.G6)(path__rspack_import_1.join(metadataDir, 'ready.json'));
133110
+ const eventsPath = (0, _webpack_lib_paths__rspack_import_2.G6)(path__rspack_import_1.join(metadataDir, 'events.ndjson'));
133111
+ const base = {
133112
+ command: options.command,
133113
+ browser: options.browser,
133114
+ runId: createRunId(),
133115
+ startedAt: nowISO(),
133116
+ distPath: options.distPath,
133117
+ manifestPath: options.manifestPath,
133118
+ port: (()=>{
133119
+ if ('number' == typeof options.port && Number.isFinite(options.port)) return options.port;
133120
+ if ('string' == typeof options.port) {
133121
+ const parsed = parseInt(options.port, 10);
133122
+ return Number.isFinite(parsed) ? parsed : null;
133123
+ }
133124
+ return null;
133125
+ })()
133126
+ };
133127
+ function writeReady(status, extra) {
133128
+ ensureDirSync(metadataDir);
133129
+ const payload = {
133130
+ ...base,
133131
+ status,
133132
+ pid: process.pid,
133133
+ ts: nowISO(),
133134
+ compiledAt: extra?.compiledAt ?? null,
133135
+ errors: Array.isArray(extra?.errors) ? extra.errors : []
133136
+ };
133137
+ if (extra?.code) payload.code = extra.code;
133138
+ if (extra?.message) payload.message = extra.message;
133139
+ writeJsonAtomic(readyPath, payload);
133140
+ }
133141
+ function appendEvent(event) {
133142
+ ensureDirSync(metadataDir);
133143
+ try {
133144
+ fs__rspack_import_0.appendFileSync(eventsPath, `${JSON.stringify(event)}\n`, 'utf-8');
133145
+ } catch {}
133146
+ }
133147
+ return {
133148
+ metadataDir,
133149
+ readyPath,
133150
+ eventsPath,
133151
+ writeStarting () {
133152
+ writeReady('starting');
133153
+ },
133154
+ writeReady (compiledAt) {
133155
+ writeReady('ready', {
133156
+ compiledAt: compiledAt || nowISO()
133157
+ });
133158
+ },
133159
+ writeError (code, message, errors) {
133160
+ writeReady('error', {
133161
+ code,
133162
+ message,
133163
+ errors: Array.isArray(errors) ? errors : [],
133164
+ compiledAt: null
133165
+ });
133166
+ },
133167
+ appendEvent
133168
+ };
133169
+ }
133170
+ class PlaywrightPlugin {
133171
+ apply(compiler) {
133172
+ this.writer.writeStarting();
133173
+ compiler.hooks.compile.tap(PlaywrightPlugin.name, ()=>{
133174
+ this.writer.appendEvent({
133175
+ type: 'compile_start',
133176
+ ts: nowISO(),
133177
+ command: this.command,
133178
+ browser: this.browser
133179
+ });
133180
+ });
133181
+ compiler.hooks.done.tap(PlaywrightPlugin.name, (stats)=>{
133182
+ const durationMs = Number((stats?.compilation?.endTime || 0) - (stats?.compilation?.startTime || 0));
133183
+ const hasErrors = Boolean(stats?.hasErrors?.());
133184
+ const errorsCount = Number(Array.isArray(stats?.toJson?.({
133185
+ all: false,
133186
+ errors: true
133187
+ })?.errors) ? stats.toJson({
133188
+ all: false,
133189
+ errors: true
133190
+ }).errors.length : 0);
133191
+ if (hasErrors) {
133192
+ this.writer.appendEvent({
133193
+ type: 'compile_error',
133194
+ ts: nowISO(),
133195
+ command: this.command,
133196
+ browser: this.browser,
133197
+ durationMs: Number.isFinite(durationMs) ? durationMs : void 0,
133198
+ errorCount: Number.isFinite(errorsCount) ? errorsCount : 1
133199
+ });
133200
+ this.writer.writeError('compile_error', 'Compilation failed', [
133201
+ `errors: ${String(errorsCount || 1)}`
133202
+ ]);
133203
+ return;
133204
+ }
133205
+ this.writer.appendEvent({
133206
+ type: 'compile_success',
133207
+ ts: nowISO(),
133208
+ command: this.command,
133209
+ browser: this.browser,
133210
+ durationMs: Number.isFinite(durationMs) ? durationMs : void 0,
133211
+ errorCount: 0
133212
+ });
133213
+ this.writer.writeReady(nowISO());
133214
+ });
133215
+ compiler.hooks.failed.tap(PlaywrightPlugin.name, (error)=>{
133216
+ this.writer.appendEvent({
133217
+ type: 'compile_error',
133218
+ ts: nowISO(),
133219
+ command: this.command,
133220
+ browser: this.browser,
133221
+ errorCount: 1
133222
+ });
133223
+ this.writer.writeError('compile_failed', error instanceof Error ? error.message : String(error));
133224
+ });
133225
+ compiler.hooks.watchClose.tap(PlaywrightPlugin.name, ()=>{
133226
+ this.writer.appendEvent({
133227
+ type: 'shutdown',
133228
+ ts: nowISO(),
133229
+ command: this.command,
133230
+ browser: this.browser
133231
+ });
133232
+ });
133233
+ }
133234
+ constructor(options){
133235
+ _define_property(this, "writer", void 0);
133236
+ _define_property(this, "command", void 0);
133237
+ _define_property(this, "browser", void 0);
133238
+ this.browser = String(options.browser || 'chromium');
133239
+ this.command = options.command || ('development' === options.mode ? 'dev' : 'start');
133240
+ this.writer = createPlaywrightMetadataWriter({
133241
+ packageJsonDir: options.packageJsonDir,
133242
+ browser: this.browser,
133243
+ command: this.command,
133244
+ distPath: options.outputPath,
133245
+ manifestPath: options.manifestPath,
133246
+ port: options.port
133247
+ });
133248
+ }
133249
+ }
133250
+ _define_property(PlaywrightPlugin, "name", 'plugin-playwright');
133251
+ },
133065
133252
  "./webpack/webpack-lib/check-build-dependencies.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
133066
133253
  "use strict";
133067
133254
  __webpack_require__.d(__webpack_exports__, {
@@ -133165,7 +133352,8 @@ var __webpack_modules__ = {
133165
133352
  if (external_fs_.existsSync(defaultsPath)) {
133166
133353
  external_dotenv_default().config({
133167
133354
  path: defaultsPath,
133168
- override: Boolean(options?.override)
133355
+ override: Boolean(options?.override),
133356
+ quiet: true
133169
133357
  });
133170
133358
  loadedAny = true;
133171
133359
  }
@@ -133179,7 +133367,8 @@ var __webpack_modules__ = {
133179
133367
  if (external_fs_.existsSync(filePath)) {
133180
133368
  external_dotenv_default().config({
133181
133369
  path: filePath,
133182
- override: Boolean(options?.override)
133370
+ override: Boolean(options?.override),
133371
+ quiet: true
133183
133372
  });
133184
133373
  loadedAny = true;
133185
133374
  break;
@@ -133637,12 +133826,12 @@ var __webpack_modules__ = {
133637
133826
  gC: ()=>unpackagingExtension,
133638
133827
  jM: ()=>debugExtensionsToLoad,
133639
133828
  jV: ()=>debugPreviewOutput,
133829
+ k4: ()=>previewSkippedNoBrowser,
133640
133830
  ng: ()=>writingTypeDefinitions,
133641
133831
  tQ: ()=>fetchingProjectPath,
133642
133832
  tc: ()=>invalidRemoteZip,
133643
133833
  v_: ()=>writingTypeDefinitionsError,
133644
133834
  vo: ()=>buildDependenciesManualInstall,
133645
- wH: ()=>previewSkippedNoRunner,
133646
133835
  xK: ()=>installingBuildDependencies,
133647
133836
  yp: ()=>noCompanionExtensionsResolved,
133648
133837
  zM: ()=>unpackagedSuccessfully
@@ -133703,8 +133892,8 @@ var __webpack_modules__ = {
133703
133892
  function previewing(browser) {
133704
133893
  return `${getLoggingPrefix('info')} Previewing the extension on ${capitalizedBrowserName(browser)}...`;
133705
133894
  }
133706
- function previewSkippedNoRunner(browser) {
133707
- return `${getLoggingPrefix('info')} Skipping browser runner for ${capitalizedBrowserName(browser)} (no-runner).`;
133895
+ function previewSkippedNoBrowser(browser) {
133896
+ return `${getLoggingPrefix('info')} Skipping browser launch for ${capitalizedBrowserName(browser)} (no-browser).`;
133708
133897
  }
133709
133898
  function installingRequiredDependencies() {
133710
133899
  const suffix = 'true' === process.env.EXTENSION_ONE_TIME_INSTALL_HINT ? ' (this is a one time operation)' : '';
@@ -134830,7 +135019,7 @@ var __webpack_modules__ = {
134830
135019
  },
134831
135020
  "./package.json" (module) {
134832
135021
  "use strict";
134833
- module.exports = JSON.parse('{"rE":"3.8.10","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"}}');
135022
+ module.exports = JSON.parse('{"rE":"3.8.11-canary.216.a962702","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"}}');
134834
135023
  }
134835
135024
  };
134836
135025
  var __webpack_module_cache__ = {};
@@ -135401,9 +135590,13 @@ var __webpack_exports__ = {};
135401
135590
  return external_path_.join(cacheDir, 'version.json');
135402
135591
  }
135403
135592
  function getProjectDepsHash(projectPath) {
135593
+ const lockfileSignature = getNearestLockfileSignature(projectPath);
135404
135594
  try {
135405
135595
  const packageJsonPath = external_path_.join(projectPath, 'package.json');
135406
- if (!external_fs_.existsSync(packageJsonPath)) return 'no-package-json';
135596
+ if (!external_fs_.existsSync(packageJsonPath)) return (0, external_crypto_.createHash)('sha1').update(JSON.stringify({
135597
+ packageJson: 'no-package-json',
135598
+ lockfile: lockfileSignature
135599
+ })).digest('hex');
135407
135600
  const raw = external_fs_.readFileSync(packageJsonPath, 'utf8');
135408
135601
  const parsed = JSON.parse(raw || '{}');
135409
135602
  const deps = parsed?.dependencies || {};
@@ -135416,12 +135609,42 @@ var __webpack_exports__ = {};
135416
135609
  };
135417
135610
  const stable = JSON.stringify({
135418
135611
  dependencies: normalize(deps),
135419
- devDependencies: normalize(devDeps)
135612
+ devDependencies: normalize(devDeps),
135613
+ lockfile: lockfileSignature
135420
135614
  });
135421
135615
  return (0, external_crypto_.createHash)('sha1').update(stable).digest('hex');
135422
135616
  } catch {
135423
- return 'invalid-package-json';
135617
+ return (0, external_crypto_.createHash)('sha1').update(JSON.stringify({
135618
+ packageJson: 'invalid-package-json',
135619
+ lockfile: lockfileSignature
135620
+ })).digest('hex');
135621
+ }
135622
+ }
135623
+ function getNearestLockfileSignature(projectPath) {
135624
+ const lockfileNames = [
135625
+ 'pnpm-lock.yaml',
135626
+ 'package-lock.json',
135627
+ 'yarn.lock',
135628
+ 'bun.lock',
135629
+ 'bun.lockb'
135630
+ ];
135631
+ let current = external_path_.resolve(projectPath);
135632
+ while(true){
135633
+ for (const lockfileName of lockfileNames){
135634
+ const lockfilePath = external_path_.join(current, lockfileName);
135635
+ if (external_fs_.existsSync(lockfilePath)) try {
135636
+ const content = external_fs_.readFileSync(lockfilePath);
135637
+ const digest = (0, external_crypto_.createHash)('sha1').update(content).digest('hex');
135638
+ return `${lockfileName}:${digest}`;
135639
+ } catch {
135640
+ return `${lockfileName}:unreadable`;
135641
+ }
135642
+ }
135643
+ const parent = external_path_.dirname(current);
135644
+ if (parent === current) break;
135645
+ current = parent;
135424
135646
  }
135647
+ return 'none';
135425
135648
  }
135426
135649
  function ensureCacheVersion(cacheDir) {
135427
135650
  const versionPath = getCacheVersionPath(cacheDir);
@@ -135851,6 +136074,7 @@ var __webpack_exports__ = {};
135851
136074
  process.exit(1);
135852
136075
  }
135853
136076
  }
136077
+ var plugin_playwright = __webpack_require__("./webpack/plugin-playwright/index.ts");
135854
136078
  var sanitize = __webpack_require__("./webpack/webpack-lib/sanitize.ts");
135855
136079
  var utils = __webpack_require__("./webpack/feature-special-folders/folder-extensions/utils.ts");
135856
136080
  function resolveCompanionExtensionDirs(opts) {
@@ -135995,17 +136219,33 @@ var __webpack_exports__ = {};
135995
136219
  const browser = (0, webpack_lib_paths.YN)(previewOptions.browser || 'chrome', previewOptions.chromiumBinary, previewOptions.geckoBinary || previewOptions.firefoxBinary);
135996
136220
  const outputPath = (0, webpack_lib_paths.u2)(projectStructure, browser, previewOptions.outputPath);
135997
136221
  const distPath = (0, webpack_lib_paths.q4)(packageJsonDir, browser);
136222
+ const metadata = (0, plugin_playwright.Ih)({
136223
+ packageJsonDir,
136224
+ browser: String(browser),
136225
+ command: 'preview',
136226
+ distPath,
136227
+ manifestPath: projectStructure.manifestPath,
136228
+ port: 'number' == typeof previewOptions.port ? previewOptions.port : 'string' == typeof previewOptions.port ? parseInt(previewOptions.port, 10) : null
136229
+ });
136230
+ metadata.writeStarting();
135998
136231
  if (debug) {
135999
136232
  console.log(messages.SG(manifestDir, packageJsonDir));
136000
136233
  console.log(messages._A(browser, previewOptions.chromiumBinary, previewOptions.geckoBinary || previewOptions.firefoxBinary));
136001
136234
  console.log(messages.jV(outputPath, distPath));
136002
136235
  }
136003
136236
  const manifestAtOutput = external_path_.join(outputPath, 'manifest.json');
136004
- 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.`);
136237
+ if (!external_fs_.existsSync(manifestAtOutput)) {
136238
+ metadata.writeError('preview_manifest_missing', `Expected manifest at ${manifestAtOutput}`);
136239
+ 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.`);
136240
+ }
136005
136241
  const commandConfig = await (0, config_loader.eY)(packageJsonDir, 'preview');
136006
136242
  const browserConfig = await (0, config_loader.xY)(packageJsonDir, browser);
136007
136243
  console.log(messages.V_(browser));
136008
- if (previewOptions.noRunner) return void console.log(messages.wH(browser));
136244
+ if (previewOptions.noBrowser) {
136245
+ console.log(messages.k4(browser));
136246
+ metadata.writeReady();
136247
+ return;
136248
+ }
136009
136249
  const safeBrowserConfig = (0, sanitize.a)(browserConfig);
136010
136250
  const safeCommandConfig = (0, sanitize.a)(commandConfig);
136011
136251
  const safePreviewOptions = (0, sanitize.a)(previewOptions);
@@ -136054,6 +136294,7 @@ var __webpack_exports__ = {};
136054
136294
  port: merged.port,
136055
136295
  dryRun: merged.dryRun
136056
136296
  });
136297
+ metadata.writeReady();
136057
136298
  }
136058
136299
  async function extensionStart(pathOrRemoteUrl, startOptions) {
136059
136300
  const projectStructure = await getProjectStructure(pathOrRemoteUrl);
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.10",
27
+ "version": "3.8.11-canary.216.a962702",
28
28
  "description": "Develop, build, preview, and package Extension.js projects.",
29
29
  "author": {
30
30
  "name": "Cezar Augusto",