extension-develop 4.1.19 → 4.1.20

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.
Files changed (63) hide show
  1. package/dist/832~0.mjs +26 -6
  2. package/dist/840~0.mjs +75 -6
  3. package/dist/950~0.mjs +3 -2
  4. package/dist/command-preview.d.ts +0 -8
  5. package/dist/dev-server/control-bridge/actions-file.d.ts +0 -1
  6. package/dist/dev-server/control-bridge/broker.d.ts +6 -4
  7. package/dist/dev-server/control-bridge/consumer-client.d.ts +0 -10
  8. package/dist/dev-server/control-bridge/contracts.d.ts +1 -43
  9. package/dist/dev-server/control-bridge/logs-file.d.ts +0 -1
  10. package/dist/dev-server/control-bridge/logs-query.d.ts +0 -16
  11. package/dist/dev-server/control-bridge/producer-runtime.d.ts +1 -2
  12. package/dist/dev-server~0.mjs +17 -5
  13. package/dist/extension-js-devtools/edge/manifest.json +0 -1
  14. package/dist/lib/build-summary.d.ts +0 -11
  15. package/dist/lib/constants.d.ts +1 -0
  16. package/dist/lib/ensure-develop-artifacts.d.ts +0 -7
  17. package/dist/lib/has-dependency.d.ts +0 -5
  18. package/dist/lib/merge-options.d.ts +0 -40
  19. package/dist/lib/messages.d.ts +1 -1
  20. package/dist/lib/project-manifest.d.ts +0 -1
  21. package/dist/lib/session-paths.d.ts +0 -22
  22. package/dist/plugin-browsers/index.d.ts +0 -35
  23. package/dist/plugin-browsers/safari-dev-plugin.d.ts +4 -0
  24. package/dist/plugin-compatibility/feature-polyfill.d.ts +0 -4
  25. package/dist/plugin-compilation/env.d.ts +0 -5
  26. package/dist/plugin-css/css-lib/dead-url-refs.d.ts +0 -6
  27. package/dist/plugin-css/css-lib/inline-content-script-css.d.ts +0 -15
  28. package/dist/plugin-css/css-lib/resolve-css-asset.d.ts +0 -8
  29. package/dist/plugin-perf-budgets/index.d.ts +0 -21
  30. package/dist/plugin-playwright/index.d.ts +3 -2
  31. package/dist/plugin-reload/classify-reload.d.ts +0 -4
  32. package/dist/plugin-reload/index.d.ts +1 -19
  33. package/dist/plugin-reload/reload-dispatch.d.ts +6 -3
  34. package/dist/plugin-reload/steps/setup-chunk-loading-target.d.ts +0 -13
  35. package/dist/plugin-special-folders/folder-extensions/types.d.ts +0 -13
  36. package/dist/plugin-special-folders/index.d.ts +0 -9
  37. package/dist/plugin-web-extension/feature-html/html-lib/utils.d.ts +0 -1
  38. package/dist/plugin-web-extension/feature-html/index.d.ts +0 -27
  39. package/dist/plugin-web-extension/feature-icons/index.d.ts +0 -12
  40. package/dist/plugin-web-extension/feature-json/index.d.ts +0 -9
  41. package/dist/plugin-web-extension/feature-locales/index.d.ts +0 -4
  42. package/dist/plugin-web-extension/feature-manifest/index.d.ts +0 -10
  43. package/dist/plugin-web-extension/feature-manifest/manifest-lib/filter-key-edge.d.ts +5 -0
  44. package/dist/plugin-web-extension/feature-manifest/manifest-lib/filter-keys-safari.d.ts +11 -0
  45. package/dist/plugin-web-extension/feature-manifest/manifest-lib/gecko-data-collection.d.ts +0 -12
  46. package/dist/plugin-web-extension/feature-manifest/manifest-lib/legacy-paths.d.ts +0 -13
  47. package/dist/plugin-web-extension/feature-manifest/manifest-lib/sanitize-fatal-shapes.d.ts +0 -36
  48. package/dist/plugin-web-extension/feature-manifest/messages.d.ts +19 -0
  49. package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/dev-injected-hosts.d.ts +0 -5
  50. package/dist/plugin-web-extension/feature-manifest/steps/patch-war.d.ts +0 -5
  51. package/dist/plugin-web-extension/feature-manifest/steps/patch-webkit-background.d.ts +2 -0
  52. package/dist/plugin-web-extension/feature-manifest/steps/update-manifest.d.ts +1 -0
  53. package/dist/plugin-web-extension/feature-manifest/steps/warn-gecko-unsupported-apis.d.ts +117 -13
  54. package/dist/plugin-web-extension/feature-scripts/index.d.ts +0 -10
  55. package/dist/plugin-web-extension/feature-scripts/steps/native-geturl-import-loader.d.ts +0 -3
  56. package/dist/plugin-web-extension/feature-web-resources/index.d.ts +0 -10
  57. package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/clean-matches.d.ts +0 -6
  58. package/dist/plugin-web-extension/shared/discover-devtools-panels.d.ts +0 -6
  59. package/dist/plugin-web-extension/shared/paths.d.ts +0 -1
  60. package/dist/rspack-config~0.mjs +666 -133
  61. package/dist/types.d.ts +0 -190
  62. package/package.json +1 -1
  63. package/runtime/process-shim.cjs +2 -0
package/dist/types.d.ts CHANGED
@@ -1,8 +1,5 @@
1
1
  import type { LoaderContext as RspackLoaderContext, RspackPluginInstance } from '@rspack/core';
2
2
  /**
3
- * Firefox-only `theme_experiment` manifest key.
4
- * Not present in `@types/chrome`; declared here so the manifest pipeline can
5
- * read it type-safely instead of casting `manifest as any`.
6
3
  * @see https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/theme_experiment
7
4
  */
8
5
  export interface ThemeExperiment {
@@ -34,9 +31,6 @@ export type PluginInterface = {
34
31
  browser?: DevOptions['browser'];
35
32
  includeList?: FilepathList;
36
33
  transpilePackages?: string[];
37
- /** True inside `extension dev`: the one axis that turns dev instrumentation
38
- * (dev CSP, injected permissions, reload client, page HMR) on. A build in
39
- * development mode is shippable and keeps the author's manifest. */
40
34
  devSession?: boolean;
41
35
  };
42
36
  export interface LoaderInterface extends RspackLoaderContext<LoaderInterface> {
@@ -69,21 +63,8 @@ export type BrowserType = 'chrome' | 'edge' | 'firefox' | 'chromium' | 'brave' |
69
63
  export interface BrowserOptionsBase {
70
64
  noOpen?: boolean;
71
65
  profile?: string | false;
72
- /**
73
- * Opt-in persistent managed profile for development.
74
- * Defaults to false (ephemeral temp profiles are used).
75
- */
76
66
  persistProfile?: boolean;
77
- /**
78
- * Keep the managed profile and its changes across runs (persistent `dev`
79
- * profile, skipped by cleanup). Seeded once when combined with
80
- * `copyFromProfile`.
81
- */
82
67
  keepProfileChanges?: boolean;
83
- /**
84
- * Seed the managed profile as a copy of this profile directory on first
85
- * creation.
86
- */
87
68
  copyFromProfile?: string;
88
69
  startingUrl?: string;
89
70
  browser: BrowserType;
@@ -99,19 +80,11 @@ export interface GeckoOptions extends BrowserOptionsBase {
99
80
  export interface SafariOptions extends BrowserOptionsBase {
100
81
  browser: 'webkit-based';
101
82
  safariBinary?: string;
102
- /** Override the Safari app name (defaults to the manifest name). */
103
83
  appName?: string;
104
- /** User-owned bundle identifier (defaults to a dev.extensionjs.* id). */
105
84
  bundleId?: string;
106
85
  developmentTeam?: string;
107
- /** Generate the macOS-only Xcode project (default true). */
108
86
  macOsOnly?: boolean;
109
87
  }
110
- /**
111
- * Safari identity/packaging options resolved by develop (CLI flags merged
112
- * with extension.config.js `browser.safari`) and forwarded to the packager
113
- * the CLI injects.
114
- */
115
88
  export interface SafariPackagerOverrides {
116
89
  appName?: string;
117
90
  bundleId?: string;
@@ -119,15 +92,8 @@ export interface SafariPackagerOverrides {
119
92
  macOsOnly?: boolean;
120
93
  forceRegenerate?: boolean;
121
94
  safariBinary?: string;
122
- /** When set, overrides the factory `noOpen` for this packaging call. */
123
95
  noOpen?: boolean;
124
96
  }
125
- /**
126
- * The packaging callback develop calls once the Safari dist is on disk. The
127
- * CLI injects `createSafariPackager()` from `extension/browsers`; a library
128
- * caller must inject the same thing or no Safari app is produced at all.
129
- * Returning a summary is optional so older packagers keep type-checking.
130
- */
131
97
  export type SafariPackagerFn = (distPath: string, mode: 'full' | 'resync', overrides?: SafariPackagerOverrides) => Promise<SafariPackageSummary | void>;
132
98
  export interface NonBinaryOptions extends BrowserOptionsBase {
133
99
  browser: Exclude<BrowserType, 'chromium-based' | 'gecko-based' | 'webkit-based'>;
@@ -136,26 +102,10 @@ export interface DevOptions extends BrowserOptionsBase {
136
102
  mode: 'development' | 'production' | 'none';
137
103
  polyfill?: boolean;
138
104
  port?: string | number | undefined;
139
- /**
140
- * Host to bind the dev server to.
141
- * Use '0.0.0.0' for Docker/devcontainer environments.
142
- * Defaults to '127.0.0.1'.
143
- */
144
105
  host?: string;
145
- /**
146
- * Connectable host the browser (HMR client + control-bridge producer) dials,
147
- * when it differs from the bind `host` (e.g. a remote/devcontainer). Defaults
148
- * to the bind host, or 127.0.0.1 when bound to a wildcard like '0.0.0.0'.
149
- */
150
106
  publicHost?: string;
151
107
  install?: boolean;
152
- /**
153
- * Companion extensions (load-only) for this command.
154
- */
155
108
  extensions?: CompanionExtensionsConfig;
156
- /**
157
- * Skip launching the browser (dev server still starts).
158
- */
159
109
  noBrowser?: boolean;
160
110
  preferences?: Record<string, unknown>;
161
111
  browserFlags?: string[];
@@ -175,16 +125,7 @@ export interface DevOptions extends BrowserOptionsBase {
175
125
  logUrl?: string;
176
126
  logTab?: number | string;
177
127
  hashContentScripts?: boolean;
178
- /**
179
- * Open the agent-bridge control channel for the bounded act verbs
180
- * (storage/reload/open). The CLI sets this from `--allow-control`.
181
- */
182
128
  allowControl?: boolean;
183
- /**
184
- * Additionally allow the `eval` verb, which runs arbitrary code inside a
185
- * context and writes a 0600 session token. Implies `allowControl`, since
186
- * eval is strictly stronger. The CLI sets this from `--allow-eval`.
187
- */
188
129
  allowEval?: boolean;
189
130
  exitOnError?: boolean;
190
131
  appName?: SafariOptions['appName'];
@@ -200,42 +141,17 @@ export interface BuildOptions {
200
141
  geckoBinary?: GeckoOptions['geckoBinary'];
201
142
  firefoxBinary?: GeckoOptions['geckoBinary'];
202
143
  safariBinary?: SafariOptions['safariBinary'];
203
- /**
204
- * Companion extensions (load-only) for this command.
205
- */
206
144
  extensions?: CompanionExtensionsConfig;
207
145
  zipFilename?: string;
208
146
  zip?: boolean;
209
147
  zipSource?: boolean;
210
148
  polyfill?: boolean;
211
149
  silent?: boolean;
212
- /**
213
- * Run Mozilla's addons-linter over the emitted dist after a production
214
- * build for a Gecko target and print its findings as build warnings.
215
- * Needs `addons-linter` installed in the project. Defaults to `true`.
216
- */
217
150
  addonLint?: boolean;
218
- /**
219
- * Override the bundler mode (and NODE_ENV). Defaults to 'production' to
220
- * preserve historical behavior. Setting 'development' is useful for
221
- * staging/QA dists that should still pass through the bundler's debug
222
- * pipeline (sourcemaps, looser minification). Mirrors `vite build --mode`
223
- * and `webpack --mode`. The artifact stays shippable: it carries the
224
- * author's CSP and permissions, no reload client, and its zip holds no
225
- * maps. Only `extension dev` turns the dev instrumentation on.
226
- */
227
151
  mode?: 'development' | 'production' | 'none';
228
- /**
229
- * [internal] Auto-install project dependencies when missing.
230
- */
231
152
  install?: boolean;
232
153
  failOnWarning?: boolean;
233
154
  exitOnError?: boolean;
234
- /**
235
- * Internal: the command stamped into ready.json/events.ndjson. Defaults to
236
- * 'build'; `extension start` passes 'start' for its build phase so the
237
- * receipt names the command the user actually ran.
238
- */
239
155
  metadataCommand?: 'dev' | 'start' | 'preview' | 'build';
240
156
  appName?: SafariOptions['appName'];
241
157
  bundleId?: SafariOptions['bundleId'];
@@ -247,47 +163,17 @@ export interface BuildOptions {
247
163
  export interface PreviewOptions extends BrowserOptionsBase {
248
164
  mode: 'production';
249
165
  outputPath?: string;
250
- /**
251
- * Internal metadata command override used by start->preview delegation.
252
- * (Full command union so the WebpackConfigOptions intersection with
253
- * BuildOptions.metadataCommand doesn't narrow the field.)
254
- */
255
166
  metadataCommand?: 'dev' | 'start' | 'preview' | 'build';
256
167
  chromiumBinary?: ChromiumOptions['chromiumBinary'];
257
168
  geckoBinary?: GeckoOptions['geckoBinary'];
258
169
  firefoxBinary?: GeckoOptions['geckoBinary'];
259
- /**
260
- * Companion extensions (load-only) for this command.
261
- */
262
170
  extensions?: CompanionExtensionsConfig;
263
- /**
264
- * Skip launching the browser (no preview window).
265
- */
266
171
  noBrowser?: boolean;
267
- /**
268
- * Internal auto-generated instance ID, not user-configurable.
269
- */
270
172
  instanceId?: string;
271
- /**
272
- * Internal: true when the instance ID came from the user, not autogenerated.
273
- */
274
173
  instanceExplicit?: boolean;
275
- /**
276
- * Dry run mode (no browser launch) for diagnostics.
277
- */
278
174
  dryRun?: boolean;
279
175
  port?: string | number;
280
- /**
281
- * Host to bind the dev server to.
282
- * Use '0.0.0.0' for Docker/devcontainer environments.
283
- * Defaults to '127.0.0.1'.
284
- */
285
176
  host?: string;
286
- /**
287
- * Connectable host the browser (HMR client + control-bridge producer) dials,
288
- * when it differs from the bind `host` (e.g. a remote/devcontainer). Defaults
289
- * to the bind host, or 127.0.0.1 when bound to a wildcard like '0.0.0.0'.
290
- */
291
177
  publicHost?: string;
292
178
  logLevel?: 'off' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'all';
293
179
  logContexts?: ('background' | 'content' | 'page' | 'sidebar' | 'popup' | 'options' | 'devtools')[];
@@ -303,30 +189,11 @@ export interface StartOptions extends BrowserOptionsBase {
303
189
  chromiumBinary?: ChromiumOptions['chromiumBinary'];
304
190
  geckoBinary?: GeckoOptions['geckoBinary'];
305
191
  firefoxBinary?: GeckoOptions['geckoBinary'];
306
- /**
307
- * Companion extensions (load-only) for this command.
308
- */
309
192
  extensions?: CompanionExtensionsConfig;
310
- /**
311
- * [internal] Auto-install project dependencies when missing.
312
- */
313
193
  install?: boolean;
314
- /**
315
- * Skip launching the browser (build still runs).
316
- */
317
194
  noBrowser?: boolean;
318
195
  port?: string | number;
319
- /**
320
- * Host to bind the dev server to.
321
- * Use '0.0.0.0' for Docker/devcontainer environments.
322
- * Defaults to '127.0.0.1'.
323
- */
324
196
  host?: string;
325
- /**
326
- * Connectable host the browser (HMR client + control-bridge producer) dials,
327
- * when it differs from the bind `host` (e.g. a remote/devcontainer). Defaults
328
- * to the bind host, or 127.0.0.1 when bound to a wildcard like '0.0.0.0'.
329
- */
330
197
  publicHost?: string;
331
198
  logLevel?: 'off' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'all';
332
199
  logContexts?: ('background' | 'content' | 'page' | 'sidebar' | 'popup' | 'options' | 'devtools')[];
@@ -348,70 +215,27 @@ export interface BrowserConfig extends BrowserOptionsBase {
348
215
  bundleId?: SafariOptions['bundleId'];
349
216
  developmentTeam?: SafariOptions['developmentTeam'];
350
217
  macOsOnly?: SafariOptions['macOsOnly'];
351
- /**
352
- * Companion extensions (load-only) scoped to a browser config.
353
- * Useful for per-browser store URLs or local unpacked extensions.
354
- */
355
218
  extensions?: CompanionExtensionsConfig;
356
219
  }
357
220
  export type OutputConfig = {
358
221
  clean: boolean;
359
222
  path: string;
360
- /**
361
- * Internal: the final dist path when `path` points at the staging
362
- * directory a one-shot build is later promoted from. Metadata surfaces
363
- * (ready.json) advertise this path, never the staging directory.
364
- */
365
223
  finalPath?: string;
366
224
  };
367
- /**
368
- * Per-category asset size budgets (bytes) for the perf-budgets plugin.
369
- * Set at the top level of extension.config.js (weakest), under
370
- * `browser.<vendor>.perfBudgets`, or per command via
371
- * `commands.dev.perfBudgets` / `commands.build.perfBudgets` (strongest
372
- * below a CLI flag).
373
- */
374
225
  export type PerfBudgetsConfig = Partial<Record<import('./plugin-perf-budgets/index.js').AssetCategory, number>>;
375
226
  export interface CommonWebpackOptions {
376
227
  output: OutputConfig;
377
228
  preferences?: Record<string, unknown>;
378
229
  browserFlags?: string[];
379
230
  excludeBrowserFlags?: string[];
380
- /**
381
- * Workspace/dependency packages that should be transpiled from source.
382
- * Useful for monorepos where package exports point to TS/TSX files.
383
- */
384
231
  transpilePackages?: string[];
385
232
  perfBudgets?: PerfBudgetsConfig;
386
- /**
387
- * Companion extensions (load-only). Each entry must be an unpacked extension root
388
- * containing a manifest.json. These are loaded alongside the user extension in
389
- * dev/preview/start (and can also be applied to build for packaging scenarios).
390
- */
391
233
  extensions?: CompanionExtensionsConfig;
392
- /**
393
- * Internal auto-generated instance ID, not user-configurable
394
- */
395
234
  instanceId?: string;
396
- /**
397
- * Agent-bridge control channel. Injected by dev-server so the
398
- * PlaywrightPlugin can advertise them in ready.json. Not user-configurable.
399
- */
400
235
  controlPort?: number | null;
401
236
  controlPath?: string;
402
237
  logsPath?: string;
403
238
  }
404
- /**
405
- * Canonical options type for webpack-config consumers.
406
- * Accepts any of the command option fields (dev/preview/start/build),
407
- * while requiring browser and mode, and the common output settings.
408
- *
409
- * `mode` is omitted from the partial intersection because PreviewOptions
410
- * and StartOptions narrow it to `'production'`. Without the omit the
411
- * outer override below becomes ineffective: TypeScript intersects the
412
- * outer `'development' | 'production' | 'none'` with the inner
413
- * `'production'` and the input is locked back to `'production'`.
414
- */
415
239
  export type WebpackConfigOptions = CommonWebpackOptions & Omit<Partial<DevOptions & PreviewOptions & StartOptions & BuildOptions>, 'mode'> & {
416
240
  browser: BrowserType;
417
241
  mode: 'development' | 'production' | 'none';
@@ -453,22 +277,8 @@ export interface FileConfig {
453
277
  perfBudgets?: PerfBudgetsConfig;
454
278
  };
455
279
  };
456
- /**
457
- * Companion extensions (load-only) applied to commands unless overridden per-command.
458
- * This is merged into `commands.dev|start|preview|build` by the config loader.
459
- */
460
280
  extensions?: CompanionExtensionsConfig;
461
- /**
462
- * Default transpile allowlist for all commands, the weakest layer.
463
- * `browser.<vendor>.transpilePackages` overrides it, and per-command
464
- * `commands.<name>.transpilePackages` overrides both.
465
- */
466
281
  transpilePackages?: string[];
467
- /**
468
- * Default per-category asset budgets for all commands, the weakest layer.
469
- * `browser.<vendor>.perfBudgets` overrides it, and per-command
470
- * `commands.dev|build.perfBudgets` overrides both.
471
- */
472
282
  perfBudgets?: PerfBudgetsConfig;
473
283
  config?: (config: Configuration) => Configuration;
474
284
  }
package/package.json CHANGED
@@ -43,7 +43,7 @@
43
43
  "runtime"
44
44
  ],
45
45
  "name": "extension-develop",
46
- "version": "4.1.19",
46
+ "version": "4.1.20",
47
47
  "description": "Develop, build, preview, and package Extension.js projects.",
48
48
  "author": {
49
49
  "name": "Cezar Augusto",
@@ -12,9 +12,11 @@ var noop = () => {}
12
12
 
13
13
  function nextTick(callback) {
14
14
  var args = Array.prototype.slice.call(arguments, 1)
15
+
15
16
  var run = () => {
16
17
  callback.apply(null, args)
17
18
  }
19
+
18
20
  if (typeof queueMicrotask === 'function') {
19
21
  queueMicrotask(run)
20
22
  } else {