extension-develop 2.0.0-rc.36 → 2.0.0-rc.38

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.
@@ -35,6 +35,7 @@ export interface BuildOptions {
35
35
  }
36
36
  export interface PreviewOptions extends BrowserOptionsBase {
37
37
  mode: 'production';
38
+ outputPath?: string;
38
39
  chromiumBinary?: ChromiumOptions['chromiumBinary'];
39
40
  geckoBinary?: GeckoOptions['geckoBinary'];
40
41
  }
@@ -39,8 +39,8 @@ const external_path_namespaceObject = require("path");
39
39
  const external_fs_namespaceObject = require("fs");
40
40
  const external_loader_utils_namespaceObject = require("loader-utils");
41
41
  const external_schema_utils_namespaceObject = require("schema-utils");
42
- const external_chalk_namespaceObject = require("chalk");
43
- var external_chalk_default = /*#__PURE__*/ __webpack_require__.n(external_chalk_namespaceObject);
42
+ const external_pintor_namespaceObject = require("pintor");
43
+ var external_pintor_default = /*#__PURE__*/ __webpack_require__.n(external_pintor_namespaceObject);
44
44
  external_path_namespaceObject.join(process.cwd(), 'node_modules/extension-develop/dist/certs');
45
45
  const CHROMIUM_BASED_BROWSERS = [
46
46
  'chrome',
@@ -55,13 +55,13 @@ const GECKO_BASED_BROWSERS = [
55
55
  ];
56
56
  require("console");
57
57
  function getLoggingPrefix(feature, type) {
58
- if ('error' === type) return `${external_chalk_default().bold(external_chalk_default().red('ERROR'))} in ${feature} ${external_chalk_default().red("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`;
59
- if ('warn' === type) return `${feature} ${external_chalk_default().yellow("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`;
60
- const arrow = 'info' === type ? external_chalk_default().cyan("\u25BA\u25BA\u25BA") : external_chalk_default().green("\u25BA\u25BA\u25BA");
61
- return `${arrow} ${external_chalk_default().cyan(feature)}`;
58
+ if ('error' === type) return `${external_pintor_default().bold(external_pintor_default().red('ERROR'))} in ${feature} ${external_pintor_default().red("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`;
59
+ if ('warn' === type) return `${feature} ${external_pintor_default().yellow("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`;
60
+ const arrow = 'info' === type ? external_pintor_default().cyan("\u25BA\u25BA\u25BA") : external_pintor_default().green("\u25BA\u25BA\u25BA");
61
+ return `${arrow} ${external_pintor_default().cyan(feature)}`;
62
62
  }
63
63
  function deprecatedShadowRoot() {
64
- return `${getLoggingPrefix('DEPRECATION', 'warn')} Using ${external_chalk_default().yellow('window.__EXTENSION_SHADOW_ROOT__')} in content_scripts is deprecated\nand will be removed in a future version of Extension.js. To use content_scripts with\nthe shadow DOM, see one of the many examples at:\nhttps://github.com/extension-js/extension.js/tree/main/examples\n\nIf you really need to use the shadow DOM as-is, the latest version of Extension.js\nto support it is extension@2.0.0-beta.9.\n`;
64
+ return `${getLoggingPrefix('DEPRECATION', 'warn')} Using ${external_pintor_default().yellow('window.__EXTENSION_SHADOW_ROOT__')} in content_scripts is deprecated\nand will be removed in a future version of Extension.js. To use content_scripts with\nthe shadow DOM, see one of the many examples at:\nhttps://github.com/extension-js/extension.js/tree/main/examples\n\nIf you really need to use the shadow DOM as-is, the latest version of Extension.js\nto support it is extension@2.0.0-beta.9.\n`;
65
65
  }
66
66
  const schema = {
67
67
  type: 'object',
@@ -133,7 +133,7 @@ function getAssetsFromHtml(htmlFilePath, htmlContent, publicPath = 'public') {
133
133
  }
134
134
  require("child_process");
135
135
  require("package-manager-detector");
136
- require("chalk");
136
+ require("pintor");
137
137
  external_path_namespaceObject.join(process.cwd(), 'node_modules/extension-develop/dist/certs');
138
138
  const constants_CHROMIUM_BASED_BROWSERS = [
139
139
  'chrome',
@@ -185,10 +185,14 @@ function ensureHMRForScripts(source) {
185
185
  const options = this.getOptions();
186
186
  const manifestPath = options.manifestPath;
187
187
  const projectPath = external_path_namespaceObject.dirname(manifestPath);
188
- (0, external_schema_utils_namespaceObject.validate)(schema, options, {
189
- name: "html:ensure-hmr-for-scripts",
190
- baseDataPath: 'options'
191
- });
188
+ try {
189
+ (0, external_schema_utils_namespaceObject.validate)(schema, options, {
190
+ name: "html:ensure-hmr-for-scripts",
191
+ baseDataPath: 'options'
192
+ });
193
+ } catch (error) {
194
+ throw error;
195
+ }
192
196
  const url = (0, external_loader_utils_namespaceObject.urlToRequest)(this.resourcePath);
193
197
  const reloadCode = `
194
198
  // TODO: cezaraugusto re-visit this
@@ -198,14 +202,16 @@ if (import.meta.webpackHot) { import.meta.webpackHot.accept() };
198
202
  const allEntries = options.includeList || {};
199
203
  for (const field of Object.entries(allEntries)){
200
204
  const [, resource] = field;
201
- if (resource) {
202
- if (!external_fs_namespaceObject.existsSync(resource)) return;
203
- const htmlAssets = getAssetsFromHtml(resource);
204
- const fileAssets = (null == htmlAssets ? void 0 : htmlAssets.js) || [];
205
- for (const asset of fileAssets){
206
- const absoluteUrl = external_path_namespaceObject.resolve(projectPath, asset);
207
- if (url.includes(absoluteUrl)) return `${reloadCode}${source}`;
208
- }
205
+ if (!resource) continue;
206
+ if (!external_fs_namespaceObject.existsSync(resource)) break;
207
+ const htmlAssets = getAssetsFromHtml(resource);
208
+ const fileAssets = (null == htmlAssets ? void 0 : htmlAssets.js) || [];
209
+ for (const asset of fileAssets){
210
+ const cleanAsset = asset.split('#')[0].split('?')[0];
211
+ const cleanUrl = url.split('#')[0].split('?')[0];
212
+ const normalizedAsset = external_path_namespaceObject.normalize(cleanAsset);
213
+ const normalizedUrl = external_path_namespaceObject.normalize(cleanUrl);
214
+ if (normalizedAsset === normalizedUrl) return `${reloadCode}${source}`;
209
215
  }
210
216
  }
211
217
  return source;
@@ -32,7 +32,7 @@ const external_loader_utils_namespaceObject = require("loader-utils");
32
32
  const external_schema_utils_namespaceObject = require("schema-utils");
33
33
  require("child_process");
34
34
  require("package-manager-detector");
35
- require("chalk");
35
+ require("pintor");
36
36
  external_path_namespaceObject.join(process.cwd(), 'node_modules/extension-develop/dist/certs');
37
37
  const CHROMIUM_BASED_BROWSERS = [
38
38
  'chrome',
@@ -41,8 +41,8 @@ const external_loader_utils_namespaceObject = require("loader-utils");
41
41
  const external_schema_utils_namespaceObject = require("schema-utils");
42
42
  require("child_process");
43
43
  require("package-manager-detector");
44
- const external_chalk_namespaceObject = require("chalk");
45
- var external_chalk_default = /*#__PURE__*/ __webpack_require__.n(external_chalk_namespaceObject);
44
+ const external_pintor_namespaceObject = require("pintor");
45
+ var external_pintor_default = /*#__PURE__*/ __webpack_require__.n(external_pintor_namespaceObject);
46
46
  external_path_namespaceObject.join(process.cwd(), 'node_modules/extension-develop/dist/certs');
47
47
  const CHROMIUM_BASED_BROWSERS = [
48
48
  'chrome',
@@ -57,13 +57,13 @@ const GECKO_BASED_BROWSERS = [
57
57
  ];
58
58
  require("console");
59
59
  function getLoggingPrefix(feature, type) {
60
- if ('error' === type) return `${external_chalk_default().bold(external_chalk_default().red('ERROR'))} in ${feature} ${external_chalk_default().red("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`;
61
- if ('warn' === type) return `${feature} ${external_chalk_default().yellow("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`;
62
- const arrow = 'info' === type ? external_chalk_default().cyan("\u25BA\u25BA\u25BA") : external_chalk_default().green("\u25BA\u25BA\u25BA");
63
- return `${arrow} ${external_chalk_default().cyan(feature)}`;
60
+ if ('error' === type) return `${external_pintor_default().bold(external_pintor_default().red('ERROR'))} in ${feature} ${external_pintor_default().red("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`;
61
+ if ('warn' === type) return `${feature} ${external_pintor_default().yellow("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`;
62
+ const arrow = 'info' === type ? external_pintor_default().cyan("\u25BA\u25BA\u25BA") : external_pintor_default().green("\u25BA\u25BA\u25BA");
63
+ return `${arrow} ${external_pintor_default().cyan(feature)}`;
64
64
  }
65
65
  function firefoxServiceWorkerError() {
66
- return `${getLoggingPrefix('Firefox runner', 'error')} No Service Worker Support\n\nFirefox does not support the ${external_chalk_default().yellow('background.service_worker')} field yet.\nUpdate your manifest.json file to use ${external_chalk_default().yellow("background.scripts")} instead.\nIf you really need to keep the ${external_chalk_default().yellow('service_worker')} field, prefix it with\n${external_chalk_default().yellow('chromium:')} so it can target only Chromium-based browsers.\n\nMozilla bug: ${external_chalk_default().underline('https://bugzilla.mozilla.org/show_bug.cgi?id=1573659')}.`;
66
+ return `${getLoggingPrefix('Firefox runner', 'error')} No Service Worker Support\n\nFirefox does not support the ${external_pintor_default().yellow('background.service_worker')} field yet.\nUpdate your manifest.json file to use ${external_pintor_default().yellow("background.scripts")} instead.\nIf you really need to keep the ${external_pintor_default().yellow('service_worker')} field, prefix it with\n${external_pintor_default().yellow('chromium:')} so it can target only Chromium-based browsers.\n\nMozilla bug: ${external_pintor_default().underline('https://bugzilla.mozilla.org/show_bug.cgi?id=1573659')}.`;
67
67
  }
68
68
  function filterKeysForThisBrowser(manifest, browser) {
69
69
  const patchedManifest = JSON.parse(JSON.stringify(manifest), function(key, value) {
package/dist/module.js CHANGED
@@ -39,6 +39,7 @@ __webpack_require__.d(__webpack_exports__, {
39
39
  extensionStart: ()=>extensionStart
40
40
  });
41
41
  const external_fs_namespaceObject = require("fs");
42
+ var external_fs_default = /*#__PURE__*/ __webpack_require__.n(external_fs_namespaceObject);
42
43
  const external_path_namespaceObject = require("path");
43
44
  const core_namespaceObject = require("@rspack/core");
44
45
  var core_default = /*#__PURE__*/ __webpack_require__.n(core_namespaceObject);
@@ -134,11 +135,21 @@ class EnvPlugin {
134
135
  this.browser = options.browser || 'chrome';
135
136
  }
136
137
  }
138
+ function clean_dist_define_property(obj, key, value) {
139
+ if (key in obj) Object.defineProperty(obj, key, {
140
+ value: value,
141
+ enumerable: true,
142
+ configurable: true,
143
+ writable: true
144
+ });
145
+ else obj[key] = value;
146
+ return obj;
147
+ }
137
148
  class CleanDistFolderPlugin {
138
149
  apply(compiler) {
139
- const outputPath = external_path_namespaceObject.join(compiler.options.output.path || '');
140
- if (external_fs_namespaceObject.existsSync(outputPath)) try {
141
- external_fs_namespaceObject.rmSync(outputPath, {
150
+ const distPath = external_path_namespaceObject.join(compiler.options.context, 'dist', this.options.browser);
151
+ if (external_fs_namespaceObject.existsSync(distPath)) try {
152
+ external_fs_namespaceObject.rmSync(distPath, {
142
153
  recursive: true,
143
154
  force: true
144
155
  });
@@ -147,9 +158,13 @@ class CleanDistFolderPlugin {
147
158
  console.error(`[CleanDistFolderPlugin] Failed to remove hot-update files: ${error.message}`);
148
159
  }
149
160
  }
161
+ constructor(options){
162
+ clean_dist_define_property(this, "options", void 0);
163
+ this.options = options;
164
+ }
150
165
  }
151
- const external_chalk_namespaceObject = require("chalk");
152
- var external_chalk_default = /*#__PURE__*/ __webpack_require__.n(external_chalk_namespaceObject);
166
+ const external_pintor_namespaceObject = require("pintor");
167
+ var external_pintor_default = /*#__PURE__*/ __webpack_require__.n(external_pintor_namespaceObject);
153
168
  const CERTIFICATE_DESTINATION_PATH = external_path_namespaceObject.join(process.cwd(), 'node_modules/extension-develop/dist/certs');
154
169
  const CHROMIUM_BASED_BROWSERS = [
155
170
  'chrome',
@@ -164,13 +179,13 @@ const GECKO_BASED_BROWSERS = [
164
179
  ];
165
180
  const external_console_namespaceObject = require("console");
166
181
  var package_namespaceObject = {
167
- i8: "2.0.0-rc.36"
182
+ i8: "2.0.0-rc.38"
168
183
  };
169
184
  function getLoggingPrefix(feature, type) {
170
- if ('error' === type) return `${external_chalk_default().bold(external_chalk_default().red('ERROR'))} in ${feature} ${external_chalk_default().red("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`;
171
- if ('warn' === type) return `${feature} ${external_chalk_default().yellow("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`;
172
- const arrow = 'info' === type ? external_chalk_default().cyan("\u25BA\u25BA\u25BA") : external_chalk_default().green("\u25BA\u25BA\u25BA");
173
- return `${arrow} ${external_chalk_default().cyan(feature)}`;
185
+ if ('error' === type) return `${external_pintor_default().bold(external_pintor_default().red('ERROR'))} in ${feature} ${external_pintor_default().red("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`;
186
+ if ('warn' === type) return `${feature} ${external_pintor_default().yellow("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`;
187
+ const arrow = 'info' === type ? external_pintor_default().cyan("\u25BA\u25BA\u25BA") : external_pintor_default().green("\u25BA\u25BA\u25BA");
188
+ return `${arrow} ${external_pintor_default().cyan(feature)}`;
174
189
  }
175
190
  function capitalize(browser) {
176
191
  return browser.charAt(0).toUpperCase() + browser.slice(1);
@@ -178,15 +193,15 @@ function capitalize(browser) {
178
193
  function boring(manifestName, duration, stats) {
179
194
  let didShow = false;
180
195
  if (!didShow) {
181
- const arrow = stats.hasErrors() ? external_chalk_default().red("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E") : external_chalk_default().green("\u25BA\u25BA\u25BA");
182
- return `${arrow} ${external_chalk_default().cyan(manifestName)} compiled ${stats.hasErrors() ? external_chalk_default().red('with errors') : external_chalk_default().green('successfully')} in ${duration} ms.`;
196
+ const arrow = stats.hasErrors() ? external_pintor_default().red("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E") : external_pintor_default().green("\u25BA\u25BA\u25BA");
197
+ return `${arrow} ${external_pintor_default().cyan(manifestName)} compiled ${stats.hasErrors() ? external_pintor_default().red('with errors') : external_pintor_default().green('successfully')} in ${duration} ms.`;
183
198
  }
184
199
  }
185
200
  function integrationNotInstalled(integration, packageManager) {
186
- return `${(0, external_console_namespaceObject.info)("\u25BA\u25BA\u25BA")} Using ${external_chalk_default().magenta(integration)}. Installing required dependencies via ${external_chalk_default().yellow(packageManager)}...`;
201
+ return `${(0, external_console_namespaceObject.info)("\u25BA\u25BA\u25BA")} Using ${external_pintor_default().magenta(integration)}. Installing required dependencies via ${external_pintor_default().yellow(packageManager)}...`;
187
202
  }
188
203
  function isUsingIntegration(integration) {
189
- return `${external_chalk_default().cyan("\u25BA\u25BA\u25BA")} Using ${external_chalk_default().magenta(integration)}...`;
204
+ return `${external_pintor_default().cyan("\u25BA\u25BA\u25BA")} Using ${external_pintor_default().magenta(integration)}...`;
190
205
  }
191
206
  function youAreAllSet(integration) {
192
207
  return `${getLoggingPrefix(integration, 'success')} installation completed. Run the program again and happy hacking.`;
@@ -195,10 +210,10 @@ function installingRootDependencies(integration) {
195
210
  return `${getLoggingPrefix(integration, 'info')} dependencies are being installed. This only happens for core contributors...`;
196
211
  }
197
212
  function integrationInstalledSuccessfully(integration) {
198
- return `${getLoggingPrefix(integration, 'success')} dependencies installed ${external_chalk_default().green('successfully')}.`;
213
+ return `${getLoggingPrefix(integration, 'success')} dependencies installed ${external_pintor_default().green('successfully')}.`;
199
214
  }
200
215
  function failedToInstallIntegration(integration, error) {
201
- return `${getLoggingPrefix('Integration', 'error')} ${integration} Installation Error\n\nFailed to detect package manager or install ${integration} dependencies:\n${external_chalk_default().red((null == error ? void 0 : error.toString()) || '')}`;
216
+ return `${getLoggingPrefix('Integration', 'error')} ${integration} Installation Error\n\nFailed to detect package manager or install ${integration} dependencies:\n${external_pintor_default().red((null == error ? void 0 : error.toString()) || '')}`;
202
217
  }
203
218
  function fileNotFound(errorSourcePath, missingFilePath) {
204
219
  if (!errorSourcePath) throw new Error('This operation is impossible. Please report a bug.');
@@ -222,28 +237,28 @@ function manifestFieldError(manifestName, manifestField, filePath) {
222
237
  const contentIndex = manifestField.split('-')[1];
223
238
  const isPage = manifestField.startsWith('pages');
224
239
  const field = manifestName.includes("content_scripts") ? `(index ${contentIndex})\n\n` : manifestFieldName;
225
- return `${getLoggingPrefix('manifest.json', 'error')} File Not Found\n\n${isPage ? `Check the ${external_chalk_default().yellow('pages')} folder in your project root directory.\n` : `Check the ${external_chalk_default().yellow(field)} field in your manifest.json file.\n`}${external_chalk_default().red('NOT FOUND')} ${external_chalk_default().underline(filePath)}`;
240
+ return `${getLoggingPrefix('manifest.json', 'error')} File Not Found\n\n${isPage ? `Check the ${external_pintor_default().yellow('pages')} folder in your project root directory.\n` : `Check the ${external_pintor_default().yellow(field)} field in your manifest.json file.\n`}${external_pintor_default().red('NOT FOUND')} ${external_pintor_default().underline(filePath)}`;
226
241
  }
227
242
  function entryNotFoundWarn(manifestField, filePath) {
228
- return `File Not Found\n\nCheck the ${external_chalk_default().yellow(manifestField)} field in your manifest.json file.\n${external_chalk_default().red('NOT FOUND')} ${external_chalk_default().underline(filePath)}`;
243
+ return `File Not Found\n\nCheck the ${external_pintor_default().yellow(manifestField)} field in your manifest.json file.\n${external_pintor_default().red('NOT FOUND')} ${external_pintor_default().underline(filePath)}`;
229
244
  }
230
245
  function manifestNotFoundError(manifestName, manifestPath) {
231
- return `${getLoggingPrefix(manifestName, 'error')} Manifest Not Found\n\nEnsure you have a manifest.json file at the root directory of your project.\n${external_chalk_default().red('NOT FOUND')} ${external_chalk_default().underline(manifestPath)}`;
246
+ return `${getLoggingPrefix(manifestName, 'error')} Manifest Not Found\n\nEnsure you have a manifest.json file at the root directory of your project.\n${external_pintor_default().red('NOT FOUND')} ${external_pintor_default().underline(manifestPath)}`;
232
247
  }
233
248
  function manifestInvalidError(error) {
234
- return `${getLoggingPrefix('manifest.json', 'error')} Invalid Manifest\n\nUpdate your manifest.json file and try again. ` + external_chalk_default().red(error.toString());
249
+ return `${getLoggingPrefix('manifest.json', 'error')} Invalid Manifest\n\nUpdate your manifest.json file and try again. ` + external_pintor_default().red(error.toString());
235
250
  }
236
251
  function serverRestartRequiredFromManifestError(fileAdded, fileRemoved) {
237
- const fileRemovedText = fileRemoved && `${external_chalk_default().gray('PATH')} ${external_chalk_default().red('REMOVED')} ${external_chalk_default().underline(fileRemoved)}\n`;
238
- const fileAddedText = fileAdded && `${external_chalk_default().gray('PATH')} ${external_chalk_default().green('ADDED')} ${external_chalk_default().underline(fileAdded)}`;
239
- return `$manifest.json ${external_chalk_default().red("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")} Manifest Entry Point Modification\n\nChanging the path of ${external_chalk_default().yellow('HTML')} or ${external_chalk_default().yellow("script")} files in manifest.json after compilation requires a server restart.\n` + fileRemovedText + fileAddedText;
252
+ const fileRemovedText = fileRemoved && `${external_pintor_default().gray('PATH')} ${external_pintor_default().red('REMOVED')} ${external_pintor_default().underline(fileRemoved)}\n`;
253
+ const fileAddedText = fileAdded && `${external_pintor_default().gray('PATH')} ${external_pintor_default().green('ADDED')} ${external_pintor_default().underline(fileAdded)}`;
254
+ return `$manifest.json ${external_pintor_default().red("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")} Manifest Entry Point Modification\n\nChanging the path of ${external_pintor_default().yellow('HTML')} or ${external_pintor_default().yellow("script")} files in manifest.json after compilation requires a server restart.\n` + fileRemovedText + fileAddedText;
240
255
  }
241
256
  function serverRestartRequiredFromSpecialFolderError(addingOrRemoving, folder, typeOfAsset, pathRelative) {
242
257
  const addOrRemove = addingOrRemoving.charAt(0).toUpperCase() + addingOrRemoving.slice(1);
243
- return `${getLoggingPrefix('manifest.json', 'error')} Manifest Entry Point Modification\n\n${addOrRemove} ${external_chalk_default().yellow(typeOfAsset)} in the ${external_chalk_default().underline(folder + '/')} folder after compilation requires a server restart.\n${external_chalk_default().gray('PATH')} ${external_chalk_default().underline(pathRelative)}`;
258
+ return `${getLoggingPrefix('manifest.json', 'error')} Manifest Entry Point Modification\n\n${addOrRemove} ${external_pintor_default().yellow(typeOfAsset)} in the ${external_pintor_default().underline(folder + '/')} folder after compilation requires a server restart.\n${external_pintor_default().gray('PATH')} ${external_pintor_default().underline(pathRelative)}`;
244
259
  }
245
260
  function creatingTSConfig() {
246
- return `${getLoggingPrefix('TypeScript', 'info')} is being used but no config file was found. Creating ${external_chalk_default().yellow('tsconfig.json')}...`;
261
+ return `${getLoggingPrefix('TypeScript', 'info')} is being used but no config file was found. Creating ${external_pintor_default().yellow('tsconfig.json')}...`;
247
262
  }
248
263
  function runningInDevelopment(manifest, browser, message) {
249
264
  const manifestName = manifest.name || 'Extension.js';
@@ -261,51 +276,51 @@ function runningInDevelopment(manifest, browser, message) {
261
276
  default:
262
277
  browserDevToolsUrl = '';
263
278
  }
264
- if (!message.data) return `${getLoggingPrefix(manifestName, 'error')} No Client Data Received\n\nThis error happens when the program can\'t get the data from your extension.\nThere are many reasons this might happen. To fix, ensure that:\n\n- Your extension is set as enabled in ${external_chalk_default().underline(browserDevToolsUrl)}\n- No previous ${capitalize(browser)} browser instance is open\n\nIf that is not the case, restart both the ${external_chalk_default().cyan(manifest.name || '')} and the\n${external_chalk_default().yellow('Manager Extension')} in ${external_chalk_default().underline(browserDevToolsUrl)} and try again.\n\nIf the issue still persists, please report a bug:\n\n` + external_chalk_default().underline("https://github.com/extension-js/extension.js/issues");
279
+ if (!message.data) return `${getLoggingPrefix(manifestName, 'error')} No Client Data Received\n\nThis error happens when the program can\'t get the data from your extension.\nThere are many reasons this might happen. To fix, ensure that:\n\n- Your extension is set as enabled in ${external_pintor_default().underline(browserDevToolsUrl)}\n- No previous ${capitalize(browser)} browser instance is open\n\nIf that is not the case, restart both the ${external_pintor_default().cyan(manifest.name || '')} and the\n${external_pintor_default().yellow('Manager Extension')} in ${external_pintor_default().underline(browserDevToolsUrl)} and try again.\n\nIf the issue still persists, please report a bug:\n\n` + external_pintor_default().underline("https://github.com/extension-js/extension.js/issues");
265
280
  const { id, management } = message.data;
266
281
  if (!management) {
267
282
  if ('development' === process.env.EXTENSION_ENV) return `${getLoggingPrefix(manifestName, 'error')} No management API info received from client. Investigate.`;
268
283
  }
269
284
  const { name, version } = management;
270
285
  return `
271
- \u{1F9E9} ${external_chalk_default().green('Extension.js')} ${external_chalk_default().gray(`${package_namespaceObject.i8}`)}
272
- Extension Name ${external_chalk_default().gray(name)}
273
- Extension Version ${external_chalk_default().gray(version)}
274
- Extension ID ${external_chalk_default().gray(id)}`;
286
+ \u{1F9E9} ${external_pintor_default().green('Extension.js')} ${external_pintor_default().gray(`${package_namespaceObject.i8}`)}
287
+ Extension Name ${external_pintor_default().gray(name)}
288
+ Extension Version ${external_pintor_default().gray(version)}
289
+ Extension ID ${external_pintor_default().gray(id)}`;
275
290
  }
276
291
  function isFirstRun(browser) {
277
292
  return `This is your first run using Extension.js via ${capitalize(browser)}. Welcome! \u{1F389}
278
293
 
279
- \u{1F9E9} Learn more at ${external_chalk_default().underline("https://extension.js.org")}`;
294
+ \u{1F9E9} Learn more at ${external_pintor_default().underline("https://extension.js.org")}`;
280
295
  }
281
296
  function webSocketError(error) {
282
- return `${getLoggingPrefix('WebSocket', 'error')} General WebSocket Error:\n${external_chalk_default().red(error)}`;
297
+ return `${getLoggingPrefix('WebSocket', 'error')} General WebSocket Error:\n${external_pintor_default().red(error)}`;
283
298
  }
284
299
  function backgroundIsRequired(backgroundChunkName, filePath) {
285
- return `${getLoggingPrefix('manifest.json', 'error')} File Not Found\n\nCheck the ${external_chalk_default().yellow(backgroundChunkName.replace('/', '.'))} field in your manifest.json file.\n${external_chalk_default().red('NOT FOUND')} ${external_chalk_default().underline(filePath)}`;
300
+ return `${getLoggingPrefix('manifest.json', 'error')} File Not Found\n\nCheck the ${external_pintor_default().yellow(backgroundChunkName.replace('/', '.'))} field in your manifest.json file.\n${external_pintor_default().red('NOT FOUND')} ${external_pintor_default().underline(filePath)}`;
286
301
  }
287
302
  function serverRestartRequiredFromHtml(filePath) {
288
- const errorMessage = `${getLoggingPrefix('HTML', 'error')} Entry Point Modification\n\nChanging the path of ${external_chalk_default().yellow("<script>")} or ${external_chalk_default().yellow('<link rel="stylesheet">')} files after compilation requires a server restart.\n${external_chalk_default().gray('PATH')} ${external_chalk_default().underline(filePath)}`;
303
+ const errorMessage = `${getLoggingPrefix('HTML', 'error')} Entry Point Modification\n\nChanging the path of ${external_pintor_default().yellow("<script>")} or ${external_pintor_default().yellow('<link rel="stylesheet">')} files after compilation requires a server restart.\n${external_pintor_default().gray('PATH')} ${external_pintor_default().underline(filePath)}`;
289
304
  return errorMessage;
290
305
  }
291
306
  function javaScriptError(errorSourcePath, missingFilePath) {
292
- return `${getLoggingPrefix('HTML', 'error')} File Not Found\n\nCheck your ${external_chalk_default().yellow("<script>")} tags in ${external_chalk_default().underline(errorSourcePath)}.\n${external_chalk_default().red('NOT FOUND')} ${external_chalk_default().underline(missingFilePath)}`;
307
+ return `${getLoggingPrefix('HTML', 'error')} File Not Found\n\nCheck your ${external_pintor_default().yellow("<script>")} tags in ${external_pintor_default().underline(errorSourcePath)}.\n${external_pintor_default().red('NOT FOUND')} ${external_pintor_default().underline(missingFilePath)}`;
293
308
  }
294
309
  function cssError(errorSourcePath, missingFilePath) {
295
- return `${getLoggingPrefix('HTML', 'error')} File Not Found\n\nCheck your ${external_chalk_default().yellow('<link>')} tags in ${external_chalk_default().underline(errorSourcePath)}.\n${external_chalk_default().red('NOT FOUND')} ${external_chalk_default().underline(missingFilePath)}`;
310
+ return `${getLoggingPrefix('HTML', 'error')} File Not Found\n\nCheck your ${external_pintor_default().yellow('<link>')} tags in ${external_pintor_default().underline(errorSourcePath)}.\n${external_pintor_default().red('NOT FOUND')} ${external_pintor_default().underline(missingFilePath)}`;
296
311
  }
297
312
  function staticAssetError(errorSourcePath, missingFilePath) {
298
313
  const extname = external_path_namespaceObject.extname(missingFilePath);
299
- return `${getLoggingPrefix('HTML', 'warn')} File Not Found\n\nCheck your ${external_chalk_default().yellow('*' + extname)} assets in ${external_chalk_default().underline(errorSourcePath)}.\n${external_chalk_default().red('NOT FOUND')} ${external_chalk_default().underline(missingFilePath)}`;
314
+ return `${getLoggingPrefix('HTML', 'warn')} File Not Found\n\nCheck your ${external_pintor_default().yellow('*' + extname)} assets in ${external_pintor_default().underline(errorSourcePath)}.\n${external_pintor_default().red('NOT FOUND')} ${external_pintor_default().underline(missingFilePath)}`;
300
315
  }
301
316
  function certRequired() {
302
- return `${external_chalk_default().yellow('Note')}: Firefox requires a secure certificate for localhost connections, needed for the reloader to work.\nBy default, your manifest.json file is not being watched. To enable this feature, run:\n\n npx -y mkcert-cli \\\n ${external_chalk_default().green('--outDir')} ${external_chalk_default().underline(CERTIFICATE_DESTINATION_PATH)} \\\n ${external_chalk_default().green('--cert')} ${external_chalk_default().yellow('localhost.cert')} \\\n ${external_chalk_default().green('--key')} ${external_chalk_default().yellow('localhost.key')}\n\nThis will enable the secure certificate needed for Firefox via ${external_chalk_default().bold('mkcert')}.\n\nLearn more about ${external_chalk_default().bold('mkcert')}: ${external_chalk_default().underline("https://github.com/FiloSottile/mkcert")}`;
317
+ return `${external_pintor_default().yellow('Note')}: Firefox requires a secure certificate for localhost connections, needed for the reloader to work.\nBy default, your manifest.json file is not being watched. To enable this feature, run:\n\n npx -y mkcert-cli \\\n ${external_pintor_default().green('--outDir')} ${external_pintor_default().underline(CERTIFICATE_DESTINATION_PATH)} \\\n ${external_pintor_default().green('--cert')} ${external_pintor_default().yellow('localhost.cert')} \\\n ${external_pintor_default().green('--key')} ${external_pintor_default().yellow('localhost.key')}\n\nThis will enable the secure certificate needed for Firefox via ${external_pintor_default().bold('mkcert')}.\n\nLearn more about ${external_pintor_default().bold('mkcert')}: ${external_pintor_default().underline("https://github.com/FiloSottile/mkcert")}`;
303
318
  }
304
319
  function defaultPortInUse(port) {
305
- return `${getLoggingPrefix('Port', 'error')} Selected port ${external_chalk_default().yellow(port.toString())} in use. Choose a new port. `;
320
+ return `${getLoggingPrefix('Port', 'error')} Selected port ${external_pintor_default().yellow(port.toString())} in use. Choose a new port. `;
306
321
  }
307
322
  function noExtensionIdError() {
308
- return `${getLoggingPrefix('manifest.json', 'error')} Extension ID Not Defined\n\nFor MAIN world content_scripts, the extension ID must be specified.\nEnsure your extension have a fixed ID and that the ${external_chalk_default().yellow('publicPath')}\nof your ${external_chalk_default().yellow('extension.config.js')} is defined as your extension URL.`;
323
+ return `${getLoggingPrefix('manifest.json', 'error')} Extension ID Not Defined\n\nFor MAIN world content_scripts, the extension ID must be specified.\nEnsure your extension have a fixed ID and that the ${external_pintor_default().yellow('publicPath')}\nof your ${external_pintor_default().yellow('extension.config.js')} is defined as your extension URL.`;
309
324
  }
310
325
  function isUsingCustomLoader(file) {
311
326
  const loaderName = file.split('.').shift() || 'custom';
@@ -329,7 +344,9 @@ class CompilationPlugin {
329
344
  manifestPath: this.manifestPath,
330
345
  browser: this.browser
331
346
  }).apply(compiler);
332
- new CleanDistFolderPlugin().apply(compiler);
347
+ if (this.clean) new CleanDistFolderPlugin({
348
+ browser: this.browser || 'chrome'
349
+ }).apply(compiler);
333
350
  compiler.hooks.done.tapAsync('develop:brand', (stats, done)=>{
334
351
  stats.compilation.name = void 0;
335
352
  const duration = stats.compilation.endTime - stats.compilation.startTime;
@@ -341,8 +358,10 @@ class CompilationPlugin {
341
358
  constructor(options){
342
359
  plugin_compilation_define_property(this, "manifestPath", void 0);
343
360
  plugin_compilation_define_property(this, "browser", void 0);
361
+ plugin_compilation_define_property(this, "clean", void 0);
344
362
  this.manifestPath = options.manifestPath;
345
363
  this.browser = options.browser || 'chrome';
364
+ this.clean = options.clean || true;
346
365
  }
347
366
  }
348
367
  plugin_compilation_define_property(CompilationPlugin, "name", 'plugin-compilation');
@@ -1065,6 +1084,7 @@ async function maybeUseReact(projectPath) {
1065
1084
  };
1066
1085
  }
1067
1086
  const external_vue_loader_namespaceObject = require("vue-loader");
1087
+ const external_url_namespaceObject = require("url");
1068
1088
  let load_loader_options_userMessageDelivered = false;
1069
1089
  async function loadLoaderOptions(projectPath, framework) {
1070
1090
  const loaderPath = external_path_namespaceObject.join(projectPath, `${framework}.loader.js`);
@@ -1076,7 +1096,7 @@ async function loadLoaderOptions(projectPath, framework) {
1076
1096
  load_loader_options_userMessageDelivered = true;
1077
1097
  }
1078
1098
  try {
1079
- const module = await import(configPath);
1099
+ const module = await import((0, external_url_namespaceObject.pathToFileURL)(configPath).href);
1080
1100
  return module.default || module;
1081
1101
  } catch (err) {
1082
1102
  const error = err;
@@ -2417,10 +2437,11 @@ class EmitHtmlFile {
2417
2437
  for (const field of htmlFields){
2418
2438
  const [featureName, resource] = field;
2419
2439
  if (resource) {
2440
+ if ('string' != typeof resource) continue;
2420
2441
  if (!external_fs_namespaceObject.existsSync(resource)) {
2421
2442
  const errorMessage = manifestFieldError(manifestName, featureName, resource);
2422
2443
  compilation.warnings.push(new (core_default()).WebpackError(errorMessage));
2423
- return;
2444
+ continue;
2424
2445
  }
2425
2446
  const rawHtml = external_fs_namespaceObject.readFileSync(resource, 'utf8');
2426
2447
  if (!shouldExclude(resource, this.excludeList)) {
@@ -2674,12 +2695,14 @@ class UpdateHtmlFile {
2674
2695
  for (const field of Object.entries(htmlEntries)){
2675
2696
  const [feature, resource] = field;
2676
2697
  if (resource) {
2677
- const updatedHtml = patchHtml(compilation, feature, resource, htmlEntries, this.excludeList || {});
2678
2698
  if (!shouldExclude(resource, this.excludeList)) {
2679
- if (updatedHtml) {
2680
- const rawSource = new core_namespaceObject.sources.RawSource(updatedHtml.toString());
2681
- const filepath = getFilePath(feature, '.html', false);
2682
- compilation.updateAsset(filepath, rawSource);
2699
+ if (external_fs_default().existsSync(resource)) {
2700
+ const updatedHtml = patchHtml(compilation, feature, resource, htmlEntries, this.excludeList || {});
2701
+ if (updatedHtml) {
2702
+ const rawSource = new core_namespaceObject.sources.RawSource(updatedHtml.toString());
2703
+ const filepath = getFilePath(feature, '.html', false);
2704
+ compilation.updateAsset(filepath, rawSource);
2705
+ }
2683
2706
  }
2684
2707
  }
2685
2708
  }
@@ -2762,21 +2785,20 @@ class throw_if_recompile_is_needed_ThrowIfRecompileIsNeeded {
2762
2785
  }
2763
2786
  storeInitialHtmlAssets(htmlFields) {
2764
2787
  Object.entries(htmlFields).forEach(([key, resource])=>{
2788
+ var _getAssetsFromHtml, _getAssetsFromHtml1;
2789
+ if ('string' != typeof resource) return;
2765
2790
  const htmlFile = resource;
2766
- if (htmlFile) {
2767
- var _getAssetsFromHtml, _getAssetsFromHtml1;
2768
- if (!external_fs_namespaceObject.existsSync(htmlFile)) {
2769
- const manifest = JSON.parse(external_fs_namespaceObject.readFileSync(this.manifestPath, 'utf-8'));
2770
- const patchedManifest = filterKeysForThisBrowser(manifest, 'chrome');
2771
- const manifestName = patchedManifest.name || 'Extension.js';
2772
- console.error(manifestFieldError(manifestName, key, htmlFile));
2773
- process.exit(1);
2774
- }
2775
- this.initialHtmlAssets[htmlFile] = {
2776
- js: (null == (_getAssetsFromHtml = getAssetsFromHtml(htmlFile)) ? void 0 : _getAssetsFromHtml.js) || [],
2777
- css: (null == (_getAssetsFromHtml1 = getAssetsFromHtml(htmlFile)) ? void 0 : _getAssetsFromHtml1.css) || []
2778
- };
2791
+ if (!external_fs_namespaceObject.existsSync(htmlFile)) {
2792
+ const manifest = JSON.parse(external_fs_namespaceObject.readFileSync(this.manifestPath, 'utf-8'));
2793
+ const patchedManifest = filterKeysForThisBrowser(manifest, 'chrome');
2794
+ const manifestName = patchedManifest.name || 'Extension.js';
2795
+ console.error(manifestFieldError(manifestName, key, htmlFile));
2796
+ process.exit(1);
2779
2797
  }
2798
+ this.initialHtmlAssets[htmlFile] = {
2799
+ js: (null == (_getAssetsFromHtml = getAssetsFromHtml(htmlFile)) ? void 0 : _getAssetsFromHtml.js) || [],
2800
+ css: (null == (_getAssetsFromHtml1 = getAssetsFromHtml(htmlFile)) ? void 0 : _getAssetsFromHtml1.css) || []
2801
+ };
2780
2802
  });
2781
2803
  }
2782
2804
  apply(compiler) {
@@ -4596,8 +4618,8 @@ const edgeMasterPreferences = {
4596
4618
  ...masterPreferences
4597
4619
  };
4598
4620
  function messages_getLoggingPrefix(browser, type) {
4599
- const arrow = 'warn' === type ? external_chalk_default().yellow("\u25BA\u25BA\u25BA") : 'info' === type ? external_chalk_default().cyan("\u25BA\u25BA\u25BA") : 'error' === type ? `${external_chalk_default().bold(external_chalk_default().red('ERROR'))} in ${capitalizedBrowserName(browser)} ${external_chalk_default().red("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}` : external_chalk_default().green("\u25BA\u25BA\u25BA");
4600
- return `${external_chalk_default().gray('')}${arrow}`;
4621
+ const arrow = 'warn' === type ? external_pintor_default().yellow("\u25BA\u25BA\u25BA") : 'info' === type ? external_pintor_default().cyan("\u25BA\u25BA\u25BA") : 'error' === type ? `${external_pintor_default().bold(external_pintor_default().red('ERROR'))} in ${capitalizedBrowserName(browser)} ${external_pintor_default().red("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}` : external_pintor_default().green("\u25BA\u25BA\u25BA");
4622
+ return `${external_pintor_default().gray('')}${arrow}`;
4601
4623
  }
4602
4624
  function capitalizedBrowserName(browser) {
4603
4625
  return browser.charAt(0).toUpperCase() + browser.slice(1);
@@ -4614,71 +4636,71 @@ function browserInstanceExited(browser) {
4614
4636
  }
4615
4637
  function stdoutData(browser, mode) {
4616
4638
  const extensionOutput = 'firefox' === browser || 'gecko-based' === browser ? 'Add-on' : 'Extension';
4617
- return `${messages_getLoggingPrefix(browser, 'success')} ${capitalizedBrowserName(browser)} ${extensionOutput} running in ${external_chalk_default().blue(mode || 'unknown')} mode.`;
4639
+ return `${messages_getLoggingPrefix(browser, 'success')} ${capitalizedBrowserName(browser)} ${extensionOutput} running in ${external_pintor_default().blue(mode || 'unknown')} mode.`;
4618
4640
  }
4619
4641
  function browserNotInstalledError(browser, browserBinaryLocation) {
4620
4642
  const isUnreacheable = 'null' == browserBinaryLocation ? `Browser is not installed\n\n` : `Can\'t find the browser path\n\n`;
4621
- return `${messages_getLoggingPrefix(browser, 'error')} ${isUnreacheable}Either install the missing browser or choose a different one via ${external_chalk_default().yellow('--browser')} flag.\n${external_chalk_default().red('NOT FOUND')} ${external_chalk_default().underline(browserBinaryLocation || capitalizedBrowserName(browser) + 'BROWSER')}`;
4643
+ return `${messages_getLoggingPrefix(browser, 'error')} ${isUnreacheable}Either install the missing browser or choose a different one via ${external_pintor_default().yellow('--browser')} flag.\n${external_pintor_default().red('NOT FOUND')} ${external_pintor_default().underline(browserBinaryLocation || capitalizedBrowserName(browser) + 'BROWSER')}`;
4622
4644
  }
4623
4645
  function messages_firefoxServiceWorkerError(browser) {
4624
- return `${messages_getLoggingPrefix(browser, 'error')} No Service Worker Support\n\nFirefox does not support the ${external_chalk_default().yellow('background.service_worker')} field yet.\nUpdate your manifest.json file to use ${external_chalk_default().yellow("background.scripts")} instead.\n\nRead more: ${external_chalk_default().underline('https://bugzilla.mozilla.org/show_bug.cgi?id=1573659')}.`;
4646
+ return `${messages_getLoggingPrefix(browser, 'error')} No Service Worker Support\n\nFirefox does not support the ${external_pintor_default().yellow('background.service_worker')} field yet.\nUpdate your manifest.json file to use ${external_pintor_default().yellow("background.scripts")} instead.\n\nRead more: ${external_pintor_default().underline('https://bugzilla.mozilla.org/show_bug.cgi?id=1573659')}.`;
4625
4647
  }
4626
4648
  function browserLaunchError(browser, error) {
4627
- return `${messages_getLoggingPrefix(browser, 'error')} Error launching browser:\n${external_chalk_default().red(error)}`;
4649
+ return `${messages_getLoggingPrefix(browser, 'error')} Error launching browser:\n${external_pintor_default().red(error)}`;
4628
4650
  }
4629
4651
  function generalBrowserError(browser, error) {
4630
- return `${messages_getLoggingPrefix(browser, 'error')} ${external_chalk_default().red(error.stack)}`;
4652
+ return `${messages_getLoggingPrefix(browser, 'error')} ${external_pintor_default().red(error.stack)}`;
4631
4653
  }
4632
4654
  function errorConnectingToBrowser(browser) {
4633
4655
  return `${messages_getLoggingPrefix(browser, 'error')} Unable to connect to ${capitalizedBrowserName(browser)}. Too many retries.`;
4634
4656
  }
4635
4657
  function addonInstallError(browser, message) {
4636
- return `${messages_getLoggingPrefix(browser, 'error')} Error while installing temporary addon:\n${external_chalk_default().red(message)}`;
4658
+ return `${messages_getLoggingPrefix(browser, 'error')} Error while installing temporary addon:\n${external_pintor_default().red(message)}`;
4637
4659
  }
4638
4660
  function pathIsNotDirectoryError(browser, profilePath) {
4639
- return `${messages_getLoggingPrefix(browser, 'error')} Path is not directory\n\nPlease provide a valid directory path and try again.\n${external_chalk_default().red('NOT DIRECTORY')} ${external_chalk_default().underline(profilePath)}`;
4661
+ return `${messages_getLoggingPrefix(browser, 'error')} Path is not directory\n\nPlease provide a valid directory path and try again.\n${external_pintor_default().red('NOT DIRECTORY')} ${external_pintor_default().underline(profilePath)}`;
4640
4662
  }
4641
4663
  function parseMessageLengthError(browser) {
4642
4664
  return `${messages_getLoggingPrefix(browser, 'error')} Error parsing message length.`;
4643
4665
  }
4644
4666
  function messagingClientClosedError(browser) {
4645
- return `${messages_getLoggingPrefix(browser, 'error')} ${external_chalk_default().magenta('MessagingClient')} connection closed.`;
4667
+ return `${messages_getLoggingPrefix(browser, 'error')} ${external_pintor_default().magenta('MessagingClient')} connection closed.`;
4646
4668
  }
4647
4669
  function requestWithoutTargetActorError(browser, requestType) {
4648
- return `${messages_getLoggingPrefix(browser, 'error')} Unexpected ${external_chalk_default().magenta('MessagingClient')} request without target actor: ${external_chalk_default().yellow(requestType)}`;
4670
+ return `${messages_getLoggingPrefix(browser, 'error')} Unexpected ${external_pintor_default().magenta('MessagingClient')} request without target actor: ${external_pintor_default().yellow(requestType)}`;
4649
4671
  }
4650
4672
  function connectionClosedError(browser) {
4651
- return `${messages_getLoggingPrefix(browser, 'error')} ${external_chalk_default().magenta('MessagingClient')} connection closed.`;
4673
+ return `${messages_getLoggingPrefix(browser, 'error')} ${external_pintor_default().magenta('MessagingClient')} connection closed.`;
4652
4674
  }
4653
4675
  function targetActorHasActiveRequestError(browser, targetActor) {
4654
- return `${messages_getLoggingPrefix(browser, 'error')} Target actor ${external_chalk_default().yellow(targetActor)} already has an active request.`;
4676
+ return `${messages_getLoggingPrefix(browser, 'error')} Target actor ${external_pintor_default().yellow(targetActor)} already has an active request.`;
4655
4677
  }
4656
4678
  function parsingPacketError(browser, error) {
4657
- return `${messages_getLoggingPrefix(browser, 'error')} Error parsing packet: ${external_chalk_default().red(error)}`;
4679
+ return `${messages_getLoggingPrefix(browser, 'error')} Error parsing packet: ${external_pintor_default().red(error)}`;
4658
4680
  }
4659
4681
  function messageWithoutSenderError(browser, message) {
4660
- return `${messages_getLoggingPrefix(browser, 'error')} Message received without a sender actor:\n${external_chalk_default().yellow(JSON.stringify(message))}`;
4682
+ return `${messages_getLoggingPrefix(browser, 'error')} Message received without a sender actor:\n${external_pintor_default().yellow(JSON.stringify(message))}`;
4661
4683
  }
4662
4684
  function unexpectedMessageReceivedError(browser, message) {
4663
- return `${messages_getLoggingPrefix(browser, 'error')} Received unexpected message:\n${external_chalk_default().red(message)}`;
4685
+ return `${messages_getLoggingPrefix(browser, 'error')} Received unexpected message:\n${external_pintor_default().red(message)}`;
4664
4686
  }
4665
4687
  function isUsingStartingUrl(browser, value) {
4666
- return `${messages_getLoggingPrefix(browser, 'info')} Using own ${external_chalk_default().magenta('starting URL')} ${external_chalk_default().underline(value)}. `;
4688
+ return `${messages_getLoggingPrefix(browser, 'info')} Using own ${external_pintor_default().magenta('starting URL')} ${external_pintor_default().underline(value)}. `;
4667
4689
  }
4668
4690
  function isUsingBrowserBinary(binary, binaryPath) {
4669
- return `${messages_getLoggingPrefix(binary, 'info')} Using own ${external_chalk_default().magenta(`${capitalizedBrowserName(binary)} browser binary`)} ${external_chalk_default().underline(binaryPath)}. `;
4691
+ return `${messages_getLoggingPrefix(binary, 'info')} Using own ${external_pintor_default().magenta(`${capitalizedBrowserName(binary)} browser binary`)} ${external_pintor_default().underline(binaryPath)}. `;
4670
4692
  }
4671
4693
  function isUsingProfile(browser, profilePath) {
4672
- return `${messages_getLoggingPrefix(browser, 'info')} Using own ${external_chalk_default().magenta('browser profile')} ${external_chalk_default().underline(profilePath)}. `;
4694
+ return `${messages_getLoggingPrefix(browser, 'info')} Using own ${external_pintor_default().magenta('browser profile')} ${external_pintor_default().underline(profilePath)}. `;
4673
4695
  }
4674
4696
  function isUsingPreferences(browser) {
4675
- return `${messages_getLoggingPrefix(browser, 'info')} Using own ${external_chalk_default().magenta('browser preferences')}. `;
4697
+ return `${messages_getLoggingPrefix(browser, 'info')} Using own ${external_pintor_default().magenta('browser preferences')}. `;
4676
4698
  }
4677
4699
  function isUsingBrowserFlags(browser) {
4678
- return `${messages_getLoggingPrefix(browser, 'info')} Using own ${external_chalk_default().magenta('browser flags')}. `;
4700
+ return `${messages_getLoggingPrefix(browser, 'info')} Using own ${external_pintor_default().magenta('browser flags')}. `;
4679
4701
  }
4680
4702
  function isBrowserLauncherOpen(browser, isOpen) {
4681
- return `${messages_getLoggingPrefix(browser, 'info')} Browser launcher is ${external_chalk_default().yellow(isOpen ? 'enabled' : 'disabled')}. `;
4703
+ return `${messages_getLoggingPrefix(browser, 'info')} Browser launcher is ${external_pintor_default().yellow(isOpen ? 'enabled' : 'disabled')}. `;
4682
4704
  }
4683
4705
  const external_progress_namespaceObject = require("progress");
4684
4706
  var external_progress_default = /*#__PURE__*/ __webpack_require__.n(external_progress_namespaceObject);
@@ -4908,11 +4930,11 @@ function getPreferences(customPrefs) {
4908
4930
  };
4909
4931
  }
4910
4932
  function commands_lib_messages_getLoggingPrefix(type) {
4911
- const arrow = 'warn' === type ? external_chalk_default().yellow("\u25BA\u25BA\u25BA") : 'info' === type ? external_chalk_default().cyan("\u25BA\u25BA\u25BA") : 'error' === type ? external_chalk_default().bold.red('ERROR') + ' in ' + external_chalk_default().red('Extension.js') + external_chalk_default().red("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E") : external_chalk_default().green("\u25BA\u25BA\u25BA");
4933
+ const arrow = 'warn' === type ? external_pintor_default().yellow("\u25BA\u25BA\u25BA") : 'info' === type ? external_pintor_default().cyan("\u25BA\u25BA\u25BA") : 'error' === type ? external_pintor_default().bold.red('ERROR') + ' in ' + external_pintor_default().red('Extension.js') + external_pintor_default().red("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E") : external_pintor_default().green("\u25BA\u25BA\u25BA");
4912
4934
  return `${arrow}`;
4913
4935
  }
4914
4936
  function messages_manifestNotFoundError(manifestPath) {
4915
- return `${commands_lib_messages_getLoggingPrefix('error')} Manifest file not found.\n\nEnsure the path to your extension exists and try again.\n${external_chalk_default().red('NOT FOUND')} ${external_chalk_default().underline(manifestPath)}`;
4937
+ return `${commands_lib_messages_getLoggingPrefix('error')} Manifest file not found.\n\nEnsure the path to your extension exists and try again.\n${external_pintor_default().red('NOT FOUND')} ${external_pintor_default().underline(manifestPath)}`;
4916
4938
  }
4917
4939
  function runningInProduction(outputPath) {
4918
4940
  const manifestPath = external_path_namespaceObject.join(outputPath, 'manifest.json');
@@ -4921,11 +4943,11 @@ function runningInProduction(outputPath) {
4921
4943
  const hasHost = hostPermissions && hostPermissions.length;
4922
4944
  const hasPermissions = permissions && permissions.length;
4923
4945
  return `
4924
- \u{1F9E9} ${external_chalk_default().green('Extension.js')} ${external_chalk_default().gray(`${package_namespaceObject.i8}`)}
4925
- Extension Name ${external_chalk_default().gray(name)}
4926
- Extension Version ${external_chalk_default().gray(version)}
4927
- Host Permissions ${external_chalk_default().gray(hasHost ? hostPermissions.join(', ') : 'Browser defaults')}
4928
- Permissions ${external_chalk_default().gray(hasPermissions ? permissions.join(', ') : 'Browser defaults')}
4946
+ \u{1F9E9} ${external_pintor_default().green('Extension.js')} ${external_pintor_default().gray(`${package_namespaceObject.i8}`)}
4947
+ Extension Name ${external_pintor_default().gray(name)}
4948
+ Extension Version ${external_pintor_default().gray(version)}
4949
+ Host Permissions ${external_pintor_default().gray(hasHost ? hostPermissions.join(', ') : 'Browser defaults')}
4950
+ Permissions ${external_pintor_default().gray(hasPermissions ? permissions.join(', ') : 'Browser defaults')}
4929
4951
  `;
4930
4952
  }
4931
4953
  function buildWebpack(projectDir, stats, browser) {
@@ -4933,12 +4955,12 @@ function buildWebpack(projectDir, stats, browser) {
4933
4955
  const manifestPath = external_path_namespaceObject.join(projectDir, 'manifest.json');
4934
4956
  const manifest = JSON.parse(external_fs_namespaceObject.readFileSync(manifestPath, 'utf8'));
4935
4957
  const assets = null == statsJson ? void 0 : statsJson.assets;
4936
- const heading = `${commands_lib_messages_getLoggingPrefix('info')} Building ${external_chalk_default().cyan(manifest.name)} extension using ${messages_capitalizedBrowserName(browser)} defaults...\n\n`;
4958
+ const heading = `${commands_lib_messages_getLoggingPrefix('info')} Building ${external_pintor_default().cyan(manifest.name)} extension using ${messages_capitalizedBrowserName(browser)} defaults...\n\n`;
4937
4959
  const buildTime = `\nBuild completed in ${(((null == statsJson ? void 0 : statsJson.time) || 0) / 1000).toFixed(2)} seconds.`;
4938
- const buildTarget = `Build Target: ${external_chalk_default().gray(messages_capitalizedBrowserName(browser))}\n`;
4939
- const buildStatus = `Build Status: ${(null == stats ? void 0 : stats.hasErrors()) ? external_chalk_default().red('Failed') : external_chalk_default().green('Success')}\n`;
4940
- const version = `\nVersion: ${external_chalk_default().gray(manifest.version)}\n`;
4941
- const size = `Size: ${external_chalk_default().gray(getAssetsSize(assets))}\n`;
4960
+ const buildTarget = `Build Target: ${external_pintor_default().gray(messages_capitalizedBrowserName(browser))}\n`;
4961
+ const buildStatus = `Build Status: ${(null == stats ? void 0 : stats.hasErrors()) ? external_pintor_default().red('Failed') : external_pintor_default().green('Success')}\n`;
4962
+ const version = `\nVersion: ${external_pintor_default().gray(manifest.version)}\n`;
4963
+ const size = `Size: ${external_pintor_default().gray(getAssetsSize(assets))}\n`;
4942
4964
  let output = '';
4943
4965
  output += heading;
4944
4966
  output += getAssetsTree(assets);
@@ -4950,55 +4972,55 @@ function buildWebpack(projectDir, stats, browser) {
4950
4972
  return output;
4951
4973
  }
4952
4974
  function buildSuccess() {
4953
- return `${commands_lib_messages_getLoggingPrefix('success')} No errors or warnings found. Your extension is ${external_chalk_default().green('ready for deployment')}.`;
4975
+ return `${commands_lib_messages_getLoggingPrefix('success')} No errors or warnings found. Your extension is ${external_pintor_default().green('ready for deployment')}.`;
4954
4976
  }
4955
4977
  function fetchingProjectPath(owner, project) {
4956
- return `${commands_lib_messages_getLoggingPrefix('info')} Fetching data...\n${external_chalk_default().gray('URL')} ${external_chalk_default().underline(`https://github.com/${owner}/${project}`)}`;
4978
+ return `${commands_lib_messages_getLoggingPrefix('info')} Fetching data...\n${external_pintor_default().gray('URL')} ${external_pintor_default().underline(`https://github.com/${owner}/${project}`)}`;
4957
4979
  }
4958
4980
  function downloadingProjectPath(projectName) {
4959
- return `${commands_lib_messages_getLoggingPrefix('info')} Downloading ${external_chalk_default().cyan(projectName)}...`;
4981
+ return `${commands_lib_messages_getLoggingPrefix('info')} Downloading ${external_pintor_default().cyan(projectName)}...`;
4960
4982
  }
4961
4983
  function creatingProjectPath(projectPath) {
4962
- return `\n${commands_lib_messages_getLoggingPrefix('info')} Creating a new browser extension...\n${external_chalk_default().gray('PATH')} ${external_chalk_default().underline(`${projectPath}`)}`;
4984
+ return `\n${commands_lib_messages_getLoggingPrefix('info')} Creating a new browser extension...\n${external_pintor_default().gray('PATH')} ${external_pintor_default().underline(`${projectPath}`)}`;
4963
4985
  }
4964
4986
  function noGitIgnoreFound(projectDir) {
4965
- return `${commands_lib_messages_getLoggingPrefix('info')} No ${external_chalk_default().yellow('.gitignore')} found, zipping all the content inside path:\n${external_chalk_default().gray('PATH')} ${external_chalk_default().underline(projectDir)}`;
4987
+ return `${commands_lib_messages_getLoggingPrefix('info')} No ${external_pintor_default().yellow('.gitignore')} found, zipping all the content inside path:\n${external_pintor_default().gray('PATH')} ${external_pintor_default().underline(projectDir)}`;
4966
4988
  }
4967
4989
  function packagingSourceFiles(zipPath) {
4968
- return `${commands_lib_messages_getLoggingPrefix('info')} Packaging source files. Files in ${external_chalk_default().yellow('.gitignore')} will be excluded...\n${external_chalk_default().gray('PATH')} ${external_chalk_default().underline(zipPath)}.`;
4990
+ return `${commands_lib_messages_getLoggingPrefix('info')} Packaging source files. Files in ${external_pintor_default().yellow('.gitignore')} will be excluded...\n${external_pintor_default().gray('PATH')} ${external_pintor_default().underline(zipPath)}.`;
4969
4991
  }
4970
4992
  function packagingDistributionFiles(zipPath) {
4971
- return `${commands_lib_messages_getLoggingPrefix('info')} Packaging extension distribution files...\n${external_chalk_default().gray('PATH')} ${external_chalk_default().underline(zipPath)}`;
4993
+ return `${commands_lib_messages_getLoggingPrefix('info')} Packaging extension distribution files...\n${external_pintor_default().gray('PATH')} ${external_pintor_default().underline(zipPath)}`;
4972
4994
  }
4973
4995
  function treeWithSourceAndDistFiles(browser, name, sourceZip, destZip) {
4974
- return `\uD83D\uDCE6 Package name: ${external_chalk_default().yellow(`${name}`)}, Target Browser: ${messages_capitalizedBrowserName(browser)}\n ${external_chalk_default().gray("\u2514\u2500")} ${external_chalk_default().underline(`${sourceZip}`)} (source)\n ${external_chalk_default().gray("\u2514\u2500")} ${external_chalk_default().underline(`${destZip}`)} (distribution)`;
4996
+ return `\uD83D\uDCE6 Package name: ${external_pintor_default().yellow(`${name}`)}, Target Browser: ${messages_capitalizedBrowserName(browser)}\n ${external_pintor_default().gray("\u2514\u2500")} ${external_pintor_default().underline(`${sourceZip}`)} (source)\n ${external_pintor_default().gray("\u2514\u2500")} ${external_pintor_default().underline(`${destZip}`)} (distribution)`;
4975
4997
  }
4976
4998
  function treeWithDistFilesbrowser(name, ext, browser, zipPath) {
4977
- return `\uD83D\uDCE6 Package name: ${external_chalk_default().yellow(`${name}.${ext}`)}, Target Browser: ${messages_capitalizedBrowserName(browser)}\n ${external_chalk_default().gray("\u2514\u2500")} ${external_chalk_default().underline(`${zipPath}`)} ${external_chalk_default().gray('(distribution)')}`;
4999
+ return `\uD83D\uDCE6 Package name: ${external_pintor_default().yellow(`${name}.${ext}`)}, Target Browser: ${messages_capitalizedBrowserName(browser)}\n ${external_pintor_default().gray("\u2514\u2500")} ${external_pintor_default().underline(`${zipPath}`)} ${external_pintor_default().gray('(distribution)')}`;
4978
5000
  }
4979
5001
  function treeWithSourceFiles(name, ext, browser, zipPath) {
4980
- return `\uD83D\uDCE6 Package name: ${external_chalk_default().yellow(`${name}-source.${ext}`)}, Target Browser: ${messages_capitalizedBrowserName(browser)}\n ${external_chalk_default().gray("\u2514\u2500")} ${external_chalk_default().underline(`${zipPath}`)} (source)`;
5002
+ return `\uD83D\uDCE6 Package name: ${external_pintor_default().yellow(`${name}-source.${ext}`)}, Target Browser: ${messages_capitalizedBrowserName(browser)}\n ${external_pintor_default().gray("\u2514\u2500")} ${external_pintor_default().underline(`${zipPath}`)} (source)`;
4981
5003
  }
4982
5004
  function failedToCompressError(error) {
4983
- return `${commands_lib_messages_getLoggingPrefix('error')} Failed to compress extension package.\n${external_chalk_default().red(error)}`;
5005
+ return `${commands_lib_messages_getLoggingPrefix('error')} Failed to compress extension package.\n${external_pintor_default().red(error)}`;
4984
5006
  }
4985
5007
  function writingTypeDefinitions(manifest) {
4986
- return `${commands_lib_messages_getLoggingPrefix('info')} Writing type definitions for ${external_chalk_default().cyan(manifest.name || '')}...`;
5008
+ return `${commands_lib_messages_getLoggingPrefix('info')} Writing type definitions for ${external_pintor_default().cyan(manifest.name || '')}...`;
4987
5009
  }
4988
5010
  function writingTypeDefinitionsError(error) {
4989
- return `${commands_lib_messages_getLoggingPrefix('error')} Failed to write the extension type definition.\n${external_chalk_default().red(error)}`;
5011
+ return `${commands_lib_messages_getLoggingPrefix('error')} Failed to write the extension type definition.\n${external_pintor_default().red(error)}`;
4990
5012
  }
4991
5013
  function downloadingText(url) {
4992
- return `${commands_lib_messages_getLoggingPrefix('info')} Downloading extension...\n${external_chalk_default().gray('URL')} ${external_chalk_default().underline(url)}`;
5014
+ return `${commands_lib_messages_getLoggingPrefix('info')} Downloading browser extension...\n${external_pintor_default().gray('URL')} ${external_pintor_default().underline(url)}`;
4993
5015
  }
4994
5016
  function unpackagingExtension(zipFilePath) {
4995
- return `${commands_lib_messages_getLoggingPrefix('info')} Unpackaging browser extension...\n${external_chalk_default().gray('PATH')} ${external_chalk_default().underline(zipFilePath)}`;
5017
+ return `${commands_lib_messages_getLoggingPrefix('info')} Unpackaging browser extension...\n${external_pintor_default().gray('PATH')} ${external_pintor_default().underline(zipFilePath)}`;
4996
5018
  }
4997
5019
  function unpackagedSuccessfully() {
4998
- return `${commands_lib_messages_getLoggingPrefix('info')} Browser extension unpackaged ${external_chalk_default().green('successfully')}.`;
5020
+ return `${commands_lib_messages_getLoggingPrefix('info')} Browser extension unpackaged ${external_pintor_default().green('successfully')}.`;
4999
5021
  }
5000
5022
  function failedToDownloadOrExtractZIPFileError(error) {
5001
- return `${commands_lib_messages_getLoggingPrefix('error')} Failed to download or extract ZIP file. ${external_chalk_default().red(error)}`;
5023
+ return `${commands_lib_messages_getLoggingPrefix('error')} Failed to download or extract ZIP file. ${external_pintor_default().red(error)}`;
5002
5024
  }
5003
5025
  function messages_capitalizedBrowserName(browser) {
5004
5026
  return browser.charAt(0).toUpperCase() + browser.slice(1);
@@ -5019,8 +5041,8 @@ function printTree(node, prefix = '') {
5019
5041
  const isLast = index === array.length - 1;
5020
5042
  const connector = isLast ? "\u2514\u2500" : "\u251C\u2500";
5021
5043
  const sizeInKB = node[key].size ? ` (${getFileSize(node[key].size)})` : '';
5022
- output += `${external_chalk_default().gray(prefix)}${external_chalk_default().gray(connector)} ${key}${external_chalk_default().gray(sizeInKB)}\n`;
5023
- if ('object' == typeof node[key] && !node[key].size) output += printTree(node[key], `${prefix}${isLast ? ' ' : external_chalk_default().gray("\u2502 ")}`);
5044
+ output += `${external_pintor_default().gray(prefix)}${external_pintor_default().gray(connector)} ${key}${external_pintor_default().gray(sizeInKB)}\n`;
5045
+ if ('object' == typeof node[key] && !node[key].size) output += printTree(node[key], `${prefix}${isLast ? ' ' : external_pintor_default().gray("\u2502 ")}`);
5024
5046
  });
5025
5047
  return output;
5026
5048
  }
@@ -5040,7 +5062,7 @@ function getAssetsTree(assets) {
5040
5062
  return `.\n${printTree(assetTree)}`;
5041
5063
  }
5042
5064
  function isUsingExperimentalConfig(integration) {
5043
- return `${commands_lib_messages_getLoggingPrefix('info')} Using ${external_chalk_default().magenta(integration)}. ${external_chalk_default().yellow('This is very experimental')}.`;
5065
+ return `${commands_lib_messages_getLoggingPrefix('info')} Using ${external_pintor_default().magenta(integration)}. ${external_pintor_default().yellow('This is very experimental')}.`;
5044
5066
  }
5045
5067
  function installingDependencies() {
5046
5068
  return `${commands_lib_messages_getLoggingPrefix('info')} Installing project dependencies...`;
@@ -5049,15 +5071,15 @@ function installingDependenciesFailed(gitCommand, gitArgs, code) {
5049
5071
  return `${commands_lib_messages_getLoggingPrefix('error')} Command ${gitCommand} ${gitArgs.join(' ')} failed with exit code ${code}`;
5050
5072
  }
5051
5073
  function cantInstallDependencies(error) {
5052
- return `${commands_lib_messages_getLoggingPrefix('error')} Can't install project dependencies. ${external_chalk_default().red(error.message || error.toString())}`;
5074
+ return `${commands_lib_messages_getLoggingPrefix('error')} Can't install project dependencies. ${external_pintor_default().red(error.message || error.toString())}`;
5053
5075
  }
5054
5076
  function portInUse(requestedPort, newPort) {
5055
- return `${commands_lib_messages_getLoggingPrefix('warn')} Port ${external_chalk_default().yellow(requestedPort.toString())} is in use. Using port ${external_chalk_default().green(newPort.toString())} instead.`;
5077
+ return `${commands_lib_messages_getLoggingPrefix('warn')} Port ${external_pintor_default().yellow(requestedPort.toString())} is in use. Using port ${external_pintor_default().green(newPort.toString())} instead.`;
5056
5078
  }
5057
5079
  async function loadConfigFile(configPath) {
5058
5080
  const absolutePath = external_path_namespaceObject.resolve(configPath);
5059
5081
  try {
5060
- const module = await import(absolutePath);
5082
+ const module = await import((0, external_url_namespaceObject.pathToFileURL)(absolutePath).href);
5061
5083
  return module.default || module;
5062
5084
  } catch (err) {
5063
5085
  const error = err;
@@ -5666,10 +5688,11 @@ class BrowsersPlugin {
5666
5688
  }
5667
5689
  plugin_browsers_define_property(BrowsersPlugin, "name", 'plugin-browsers');
5668
5690
  function webpackConfig(projectPath, devOptions) {
5669
- var _devOptions_output;
5691
+ var _devOptions_output, _devOptions_output1;
5670
5692
  const manifestPath = external_path_namespaceObject.join(projectPath, 'manifest.json');
5671
5693
  const manifest = filterKeysForThisBrowser(JSON.parse(external_fs_namespaceObject.readFileSync(manifestPath, 'utf-8')), devOptions.browser);
5672
- const userExtensionOutputPath = external_path_namespaceObject.join(projectPath, `dist/${devOptions.browser}`);
5694
+ const userExtensionOutputPath = devOptions.output.path;
5695
+ const managerExtensionPath = external_path_namespaceObject.join(__dirname, 'extensions', `${devOptions.browser}-manager-extension`);
5673
5696
  const browser = devOptions.chromiumBinary ? 'chromium-based' : devOptions.geckoBinary ? 'gecko-based' : devOptions.browser;
5674
5697
  return {
5675
5698
  mode: devOptions.mode || 'development',
@@ -5720,7 +5743,8 @@ function webpackConfig(projectPath, devOptions) {
5720
5743
  plugins: [
5721
5744
  new CompilationPlugin({
5722
5745
  manifestPath,
5723
- browser
5746
+ browser,
5747
+ clean: null == (_devOptions_output1 = devOptions.output) ? void 0 : _devOptions_output1.clean
5724
5748
  }),
5725
5749
  new StaticAssetsPlugin({
5726
5750
  mode: devOptions.mode,
@@ -5751,7 +5775,7 @@ function webpackConfig(projectPath, devOptions) {
5751
5775
  new BrowsersPlugin({
5752
5776
  extension: [
5753
5777
  userExtensionOutputPath,
5754
- external_path_namespaceObject.join(__dirname, 'extensions', `${browser}-manager-extension`)
5778
+ 'production' !== devOptions.mode ? managerExtensionPath : ''
5755
5779
  ],
5756
5780
  browser,
5757
5781
  open: devOptions.open,
@@ -6013,7 +6037,8 @@ async function extensionBuild(pathOrRemoteUrl, buildOptions) {
6013
6037
  browser,
6014
6038
  mode: 'production',
6015
6039
  output: {
6016
- clean: true
6040
+ clean: true,
6041
+ path: external_path_namespaceObject.join(projectPath, 'dist', browser)
6017
6042
  }
6018
6043
  });
6019
6044
  const allPluginsButBrowserRunners = null == (_baseConfig_plugins = baseConfig.plugins) ? void 0 : _baseConfig_plugins.filter((plugin)=>(null == plugin ? void 0 : plugin.constructor.name) !== 'plugin-browsers' && (null == plugin ? void 0 : plugin.constructor.name) !== 'plugin-reload');
@@ -6091,7 +6116,8 @@ async function dev_server_devServer(projectPath, devOptions) {
6091
6116
  ...browserConfig,
6092
6117
  mode: 'development',
6093
6118
  output: {
6094
- clean: false
6119
+ clean: false,
6120
+ path: external_path_namespaceObject.join(projectPath, 'dist', devOptions.browser)
6095
6121
  }
6096
6122
  });
6097
6123
  const customWebpackConfig = await loadCustomWebpackConfig(projectPath);
@@ -6226,6 +6252,8 @@ async function extensionDev(pathOrRemoteUrl, devOptions) {
6226
6252
  }
6227
6253
  async function extensionPreview(pathOrRemoteUrl, previewOptions) {
6228
6254
  const projectPath = await getProjectPath(pathOrRemoteUrl);
6255
+ const distPath = external_path_namespaceObject.join(projectPath, 'dist', previewOptions.browser);
6256
+ const outputPath = previewOptions.outputPath ? previewOptions.outputPath : external_fs_namespaceObject.existsSync(distPath) ? distPath : projectPath;
6229
6257
  if (!(null == pathOrRemoteUrl ? void 0 : pathOrRemoteUrl.startsWith('http')) && !external_fs_namespaceObject.existsSync(external_path_namespaceObject.join(projectPath, 'manifest.json'))) {
6230
6258
  console.log(messages_manifestNotFoundError(external_path_namespaceObject.join(projectPath, 'manifest.json')));
6231
6259
  process.exit(1);
@@ -6241,7 +6269,8 @@ async function extensionPreview(pathOrRemoteUrl, previewOptions) {
6241
6269
  geckoBinary: previewOptions.geckoBinary,
6242
6270
  startingUrl: previewOptions.startingUrl,
6243
6271
  output: {
6244
- clean: false
6272
+ clean: false,
6273
+ path: outputPath
6245
6274
  }
6246
6275
  });
6247
6276
  const onlyBrowserRunners = null == (_baseConfig_plugins = baseConfig.plugins) ? void 0 : _baseConfig_plugins.filter((plugin)=>(null == plugin ? void 0 : plugin.constructor.name) === 'plugin-browsers');
@@ -6262,7 +6291,7 @@ async function extensionPreview(pathOrRemoteUrl, previewOptions) {
6262
6291
  colors: true
6263
6292
  }));
6264
6293
  process.exit(1);
6265
- } else console.log(runningInProduction(external_path_namespaceObject.join(projectPath, 'dist', browser)));
6294
+ } else console.log(runningInProduction(projectPath));
6266
6295
  });
6267
6296
  } catch (error) {
6268
6297
  if ('development' === process.env.EXTENSION_ENV) console.error(error);
@@ -6284,7 +6313,8 @@ async function extensionStart(pathOrRemoteUrl, startOptions) {
6284
6313
  });
6285
6314
  await extensionPreview(pathOrRemoteUrl, {
6286
6315
  ...startOptions,
6287
- browser
6316
+ browser,
6317
+ outputPath: external_path_namespaceObject.join(projectPath, 'dist', browser)
6288
6318
  });
6289
6319
  } catch (error) {
6290
6320
  if ('development' === process.env.EXTENSION_ENV) console.error(error);
@@ -1,4 +1,8 @@
1
1
  import { type Compiler } from '@rspack/core';
2
2
  export declare class CleanDistFolderPlugin {
3
+ private options;
4
+ constructor(options: {
5
+ browser: string;
6
+ });
3
7
  apply(compiler: Compiler): void;
4
8
  }
@@ -4,6 +4,9 @@ export declare class CompilationPlugin {
4
4
  static readonly name: string;
5
5
  readonly manifestPath: string;
6
6
  readonly browser: PluginInterface['browser'];
7
- constructor(options: PluginInterface);
7
+ readonly clean: boolean;
8
+ constructor(options: PluginInterface & {
9
+ clean: boolean;
10
+ });
8
11
  apply(compiler: Compiler): void;
9
12
  }
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@rslib/core").RslibConfig;
2
+ export default _default;
@@ -0,0 +1,124 @@
1
+ import type { DefaultTreeAdapterTypes } from 'parse5';
2
+ export interface Attribute {
3
+ name: string;
4
+ value: string;
5
+ }
6
+ export type ParsedNode = DefaultTreeAdapterTypes.Node;
7
+ /**
8
+ * Parses HTML string into a document or fragment
9
+ * @param string - HTML string to parse
10
+ * @param smart - If true, automatically detects if input is a document or fragment
11
+ * @returns Parsed document or fragment
12
+ */
13
+ export declare const parse: (string: string, smart?: boolean) => DefaultTreeAdapterTypes.Document | DefaultTreeAdapterTypes.DocumentFragment;
14
+ /**
15
+ * Creates a document fragment from HTML string
16
+ * @param string - HTML string to parse
17
+ * @returns Document fragment
18
+ */
19
+ export declare const createFragment: (string: string) => DefaultTreeAdapterTypes.DocumentFragment;
20
+ /**
21
+ * Serializes a node back to HTML string
22
+ * @param node - Node to serialize
23
+ * @returns HTML string
24
+ */
25
+ export declare const stringify: (node: ParsedNode) => string;
26
+ /**
27
+ * Converts node attributes to a plain object
28
+ * @param node - Node to extract attributes from
29
+ * @returns Object containing attribute name-value pairs
30
+ */
31
+ export declare const attributesOf: (node: ParsedNode) => Record<string, string>;
32
+ /**
33
+ * Converts a plain object to an array of attributes
34
+ * @param obj - Object containing attribute name-value pairs
35
+ * @returns Array of attributes
36
+ */
37
+ export declare const toAttrs: (obj: Record<string, string>) => Attribute[];
38
+ /**
39
+ * Sets an attribute on a node
40
+ * @param node - Node to set attribute on
41
+ * @param key - Attribute name
42
+ * @param value - Attribute value
43
+ * @returns Modified node
44
+ */
45
+ export declare const setAttribute: (node: ParsedNode, key: string, value: string) => ParsedNode;
46
+ /**
47
+ * Gets an attribute value from a node
48
+ * @param node - Node to get attribute from
49
+ * @param key - Attribute name
50
+ * @returns Attribute value or undefined
51
+ */
52
+ export declare const getAttribute: (node: ParsedNode, key: string) => string | undefined;
53
+ /**
54
+ * Removes an attribute from a node
55
+ * @param node - Node to remove attribute from
56
+ * @param key - Attribute name to remove
57
+ */
58
+ export declare const removeAttribute: (node: ParsedNode, key: string) => void;
59
+ /**
60
+ * Creates a new element node
61
+ * @param tagName - Tag name for the new element
62
+ * @returns New element node
63
+ */
64
+ export declare const createNode: (tagName: string) => DefaultTreeAdapterTypes.Element;
65
+ /**
66
+ * Creates a new text node
67
+ * @param text - Text content
68
+ * @returns New text node
69
+ */
70
+ export declare const createTextNode: (text: string) => DefaultTreeAdapterTypes.TextNode;
71
+ /**
72
+ * Prepends a node to a parent node
73
+ * @param parent - Parent node
74
+ * @param node - Node to prepend
75
+ * @returns Prepended node
76
+ */
77
+ export declare const prepend: (parent: DefaultTreeAdapterTypes.ParentNode, node: DefaultTreeAdapterTypes.ChildNode) => DefaultTreeAdapterTypes.ChildNode;
78
+ /**
79
+ * Appends a node to a parent node
80
+ * @param parent - Parent node
81
+ * @param node - Node to append
82
+ * @returns Appended node
83
+ */
84
+ export declare const append: (parent: DefaultTreeAdapterTypes.ParentNode, node: DefaultTreeAdapterTypes.ChildNode) => DefaultTreeAdapterTypes.ChildNode;
85
+ /**
86
+ * Replaces a node with another node
87
+ * @param original - Node to replace
88
+ * @param node - New node
89
+ * @returns New node
90
+ */
91
+ export declare const replace: (original: DefaultTreeAdapterTypes.ChildNode, node: DefaultTreeAdapterTypes.ChildNode) => DefaultTreeAdapterTypes.ChildNode | undefined;
92
+ /**
93
+ * Removes a node from its parent
94
+ * @param node - Node to remove
95
+ * @returns Removed node
96
+ */
97
+ export declare const remove: (node: DefaultTreeAdapterTypes.ChildNode) => DefaultTreeAdapterTypes.ChildNode;
98
+ /**
99
+ * Gets text content of a node
100
+ * @param node - Node to get text from
101
+ * @returns Text content
102
+ * @throws Error if node has multiple children or non-text children
103
+ */
104
+ export declare const textOf: (node: DefaultTreeAdapterTypes.ParentNode) => string;
105
+ /**
106
+ * Sets text content of a node
107
+ * @param node - Node to set text on
108
+ * @param text - Text content
109
+ * @returns Modified node
110
+ */
111
+ export declare const setText: (node: DefaultTreeAdapterTypes.ParentNode, text: string) => DefaultTreeAdapterTypes.ParentNode;
112
+ /**
113
+ * Checks if a string is likely a complete HTML document
114
+ * @param string - String to check
115
+ * @returns True if string appears to be a complete document
116
+ */
117
+ export declare const isDocument: (string: string) => boolean;
118
+ /**
119
+ * Flattens a node tree into an array
120
+ * @param node - Node or array of nodes to flatten
121
+ * @param arr - Optional array to accumulate results
122
+ * @returns Array of all nodes
123
+ */
124
+ export declare const flatten: (node: ParsedNode | ParsedNode[], arr?: ParsedNode[]) => ParsedNode[];
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
@@ -1,2 +1,2 @@
1
1
  import { LoaderInterface } from '../../../webpack-types';
2
- export default function ensureHMRForScripts(this: LoaderInterface, source: string): string | undefined;
2
+ export default function ensureHMRForScripts(this: LoaderInterface, source: string): string;
@@ -6,5 +6,6 @@ export default function webpackConfig(projectPath: string, devOptions: DevOption
6
6
  } & {
7
7
  output: {
8
8
  clean: boolean;
9
+ path: string;
9
10
  };
10
11
  }): Configuration;
package/package.json CHANGED
@@ -21,7 +21,7 @@
21
21
  "dist"
22
22
  ],
23
23
  "name": "extension-develop",
24
- "version": "2.0.0-rc.36",
24
+ "version": "2.0.0-rc.38",
25
25
  "description": "The develop step of Extension.js",
26
26
  "author": {
27
27
  "name": "Cezar Augusto",
@@ -37,7 +37,6 @@
37
37
  "adm-zip": "^0.5.16",
38
38
  "axios": "^1.9.0",
39
39
  "case-sensitive-paths-webpack-plugin": "^2.4.0",
40
- "chalk": "^5.3.0",
41
40
  "chokidar": "^4.0.1",
42
41
  "chrome-location2": "2.0.0",
43
42
  "content-security-policy-parser": "^0.6.0",
@@ -56,6 +55,7 @@
56
55
  "package-manager-detector": "^0.2.7",
57
56
  "parse5": "^7.2.1",
58
57
  "parse5-utilities": "^1.0.0",
58
+ "pintor": "0.3.0",
59
59
  "postcss": "^8.4.49",
60
60
  "preact": "^10.22.0",
61
61
  "progress": "^2.0.3",