web-ext 8.10.0 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -283,5 +283,5 @@ Here is a partial list of examples:
283
283
  [signing](https://addons-server.readthedocs.io/en/latest/topics/api/v4_frozen/signing.html)
284
284
  extensions.
285
285
 
286
- [web-ext-user-docs]: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Getting_started_with_web-ext
286
+ [web-ext-user-docs]: https://extensionworkshop.com/documentation/develop/getting-started-with-web-ext/
287
287
  [dynamic-imports]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#dynamic_imports
package/lib/config.js CHANGED
@@ -8,15 +8,6 @@ import fileExists from './util/file-exists.js';
8
8
  import { createLogger } from './util/logger.js';
9
9
  import { UsageError, WebExtError } from './errors.js';
10
10
  const log = createLogger(import.meta.url);
11
-
12
- // NOTE: this error message is used in an interpolated string (while the other two help
13
- // messages are being logged as is).
14
- export const WARN_LEGACY_JS_EXT = ['should be renamed to ".cjs" or ".mjs" file extension to ensure its format is not ambiguous.', 'Config files with the ".js" file extension are deprecated and will not be loaded anymore', 'in a future web-ext major version.'].join(' ');
15
- export const HELP_ERR_MODULE_FROM_ESM = ['This config file belongs to a package.json file with "type" set to "module".', 'Change the file extension to ".cjs" or rewrite it as an ES module and use the ".mjs" file extension.'].join(' ');
16
- export const HELP_ERR_IMPORTEXPORT_CJS = ['This config file is defined as an ES module, but it belongs to either a project directory', 'with a package.json file with "type" set to "commonjs" or one without any package.json file.', 'Change the file extension to ".mjs" to fix the config loading error.'].join(' ');
17
- const ERR_IMPORT_FROM_CJS = 'Cannot use import statement outside a module';
18
- const ERR_EXPORT_FROM_CJS = "Unexpected token 'export'";
19
- const ERR_MODULE_FROM_ESM = 'module is not defined in ES module scope';
20
11
  export function applyConfigToArgv({
21
12
  argv,
22
13
  argvFromCLI,
@@ -94,7 +85,7 @@ export async function loadJSConfigFile(filePath) {
94
85
  const resolvedFilePath = path.resolve(filePath);
95
86
  log.debug(`Loading JS config file: "${filePath}" ` + `(resolved to "${resolvedFilePath}")`);
96
87
  if (filePath.endsWith('.js')) {
97
- log.warn(`WARNING: config file ${filePath} ${WARN_LEGACY_JS_EXT}`);
88
+ throw new UsageError(` Invalid config file "${resolvedFilePath}": the file extension should be` + '".cjs" or ".mjs". More information at: https://mzl.la/web-ext-config-file');
98
89
  }
99
90
  let configObject;
100
91
  try {
@@ -115,6 +106,12 @@ export async function loadJSConfigFile(filePath) {
115
106
  // ES modules may expose both a default and named exports and so
116
107
  // we merge the named exports on top of what may have been set in
117
108
  // the default export.
109
+ if (filePath.endsWith('.cjs')) {
110
+ // Remove the additional 'module.exports' named export that Node.js >=
111
+ // 24 is returning from the dynamic import call (in addition to being
112
+ // also set on the default property as in Node.js < 24).
113
+ delete esmConfigMod['module.exports'];
114
+ }
118
115
  configObject = {
119
116
  ...configDefault,
120
117
  ...esmConfigMod
@@ -125,14 +122,9 @@ export async function loadJSConfigFile(filePath) {
125
122
  };
126
123
  }
127
124
  } catch (error) {
128
- log.debug('Handling error:', error);
129
- let errorMessage = error.message;
130
- if (error.message.startsWith(ERR_MODULE_FROM_ESM)) {
131
- errorMessage = HELP_ERR_MODULE_FROM_ESM;
132
- } else if ([ERR_IMPORT_FROM_CJS, ERR_EXPORT_FROM_CJS].includes(error.message)) {
133
- errorMessage = HELP_ERR_IMPORTEXPORT_CJS;
134
- }
135
- throw new UsageError(`Cannot read config file: ${resolvedFilePath}\n` + `Error: ${errorMessage}`);
125
+ const configFileError = new UsageError(`Cannot read config file "${resolvedFilePath}":\n${error}`);
126
+ configFileError.cause = error;
127
+ throw configFileError;
136
128
  }
137
129
  if (filePath.endsWith('package.json')) {
138
130
  log.debug('Looking for webExt key inside package.json file');
package/lib/config.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","names":["os","path","fs","camelCase","decamelize","parseJSON","fileExists","createLogger","UsageError","WebExtError","log","import","meta","url","WARN_LEGACY_JS_EXT","join","HELP_ERR_MODULE_FROM_ESM","HELP_ERR_IMPORTEXPORT_CJS","ERR_IMPORT_FROM_CJS","ERR_EXPORT_FROM_CJS","ERR_MODULE_FROM_ESM","applyConfigToArgv","argv","argvFromCLI","configObject","options","configFileName","newArgv","option","Object","keys","Array","isArray","decamelizedOptName","separator","type","undefined","expectedType","optionType","defaultValue","default","wasValueSetOnCLI","debug","coerce","loadJSConfigFile","filePath","resolvedFilePath","resolve","endsWith","warn","nonce","Date","now","Math","random","configModule","readFile","encoding","configDefault","esmConfigMod","error","errorMessage","message","startsWith","includes","webExt","length","discoverConfigFiles","getHomeDir","homedir","magicConfigName","possibleConfigs","process","cwd","configs","Promise","all","map","fileName","resolvedFileName","existingConfigs","forEach","f","push"],"sources":["../src/config.js"],"sourcesContent":["import os from 'os';\nimport path from 'path';\nimport fs from 'fs/promises';\n\nimport camelCase from 'camelcase';\nimport decamelize from 'decamelize';\nimport parseJSON from 'parse-json';\n\nimport fileExists from './util/file-exists.js';\nimport { createLogger } from './util/logger.js';\nimport { UsageError, WebExtError } from './errors.js';\n\nconst log = createLogger(import.meta.url);\n\n// NOTE: this error message is used in an interpolated string (while the other two help\n// messages are being logged as is).\nexport const WARN_LEGACY_JS_EXT = [\n 'should be renamed to \".cjs\" or \".mjs\" file extension to ensure its format is not ambiguous.',\n 'Config files with the \".js\" file extension are deprecated and will not be loaded anymore',\n 'in a future web-ext major version.',\n].join(' ');\n\nexport const HELP_ERR_MODULE_FROM_ESM = [\n 'This config file belongs to a package.json file with \"type\" set to \"module\".',\n 'Change the file extension to \".cjs\" or rewrite it as an ES module and use the \".mjs\" file extension.',\n].join(' ');\n\nexport const HELP_ERR_IMPORTEXPORT_CJS = [\n 'This config file is defined as an ES module, but it belongs to either a project directory',\n 'with a package.json file with \"type\" set to \"commonjs\" or one without any package.json file.',\n 'Change the file extension to \".mjs\" to fix the config loading error.',\n].join(' ');\n\nconst ERR_IMPORT_FROM_CJS = 'Cannot use import statement outside a module';\nconst ERR_EXPORT_FROM_CJS = \"Unexpected token 'export'\";\nconst ERR_MODULE_FROM_ESM = 'module is not defined in ES module scope';\n\nexport function applyConfigToArgv({\n argv,\n argvFromCLI,\n configObject,\n options,\n configFileName,\n}) {\n let newArgv = { ...argv };\n\n for (const option of Object.keys(configObject)) {\n if (camelCase(option) !== option) {\n throw new UsageError(\n `The config option \"${option}\" must be ` +\n `specified in camel case: \"${camelCase(option)}\"`,\n );\n }\n\n // A config option cannot be a sub-command config\n // object if it is an array.\n if (\n !Array.isArray(configObject[option]) &&\n typeof options[option] === 'object' &&\n typeof configObject[option] === 'object'\n ) {\n // Descend into the nested configuration for a sub-command.\n newArgv = applyConfigToArgv({\n argv: newArgv,\n argvFromCLI,\n configObject: configObject[option],\n options: options[option],\n configFileName,\n });\n continue;\n }\n\n const decamelizedOptName = decamelize(option, { separator: '-' });\n\n if (typeof options[decamelizedOptName] !== 'object') {\n throw new UsageError(\n `The config file at ${configFileName} specified ` +\n `an unknown option: \"${option}\"`,\n );\n }\n if (options[decamelizedOptName].type === undefined) {\n // This means yargs option type wasn't not defined correctly\n throw new WebExtError(`Option: ${option} was defined without a type.`);\n }\n\n const expectedType =\n options[decamelizedOptName].type === 'count'\n ? 'number'\n : options[decamelizedOptName].type;\n\n const optionType = Array.isArray(configObject[option])\n ? 'array'\n : typeof configObject[option];\n\n if (optionType !== expectedType) {\n throw new UsageError(\n `The config file at ${configFileName} specified ` +\n `the type of \"${option}\" incorrectly as \"${optionType}\"` +\n ` (expected type \"${expectedType}\")`,\n );\n }\n\n let defaultValue;\n if (options[decamelizedOptName]) {\n if (options[decamelizedOptName].default !== undefined) {\n defaultValue = options[decamelizedOptName].default;\n } else if (expectedType === 'boolean') {\n defaultValue = false;\n }\n }\n\n // This is our best effort (without patching yargs) to detect\n // if a value was set on the CLI instead of in the config.\n // It looks for a default value and if the argv value is\n // different, it assumes that the value was configured on the CLI.\n\n const wasValueSetOnCLI =\n typeof argvFromCLI[option] !== 'undefined' &&\n argvFromCLI[option] !== defaultValue;\n if (wasValueSetOnCLI) {\n log.debug(\n `Favoring CLI: ${option}=${argvFromCLI[option]} over ` +\n `configuration: ${option}=${configObject[option]}`,\n );\n newArgv[option] = argvFromCLI[option];\n continue;\n }\n\n newArgv[option] = configObject[option];\n\n const coerce = options[decamelizedOptName].coerce;\n if (coerce) {\n log.debug(`Calling coerce() on configured value for ${option}`);\n newArgv[option] = coerce(newArgv[option]);\n }\n\n newArgv[decamelizedOptName] = newArgv[option];\n }\n return newArgv;\n}\n\nexport async function loadJSConfigFile(filePath) {\n const resolvedFilePath = path.resolve(filePath);\n log.debug(\n `Loading JS config file: \"${filePath}\" ` +\n `(resolved to \"${resolvedFilePath}\")`,\n );\n if (filePath.endsWith('.js')) {\n log.warn(`WARNING: config file ${filePath} ${WARN_LEGACY_JS_EXT}`);\n }\n let configObject;\n try {\n const nonce = `${Date.now()}-${Math.random()}`;\n let configModule;\n if (resolvedFilePath.endsWith('package.json')) {\n configModule = parseJSON(\n await fs.readFile(resolvedFilePath, { encoding: 'utf-8' }),\n );\n } else {\n configModule = await import(`file://${resolvedFilePath}?nonce=${nonce}`);\n }\n\n if (configModule.default) {\n const { default: configDefault, ...esmConfigMod } = configModule;\n // ES modules may expose both a default and named exports and so\n // we merge the named exports on top of what may have been set in\n // the default export.\n configObject = { ...configDefault, ...esmConfigMod };\n } else {\n configObject = { ...configModule };\n }\n } catch (error) {\n log.debug('Handling error:', error);\n let errorMessage = error.message;\n if (error.message.startsWith(ERR_MODULE_FROM_ESM)) {\n errorMessage = HELP_ERR_MODULE_FROM_ESM;\n } else if (\n [ERR_IMPORT_FROM_CJS, ERR_EXPORT_FROM_CJS].includes(error.message)\n ) {\n errorMessage = HELP_ERR_IMPORTEXPORT_CJS;\n }\n throw new UsageError(\n `Cannot read config file: ${resolvedFilePath}\\n` +\n `Error: ${errorMessage}`,\n );\n }\n if (filePath.endsWith('package.json')) {\n log.debug('Looking for webExt key inside package.json file');\n configObject = configObject.webExt || {};\n }\n if (Object.keys(configObject).length === 0) {\n log.debug(\n `Config file ${resolvedFilePath} did not define any options. ` +\n 'Did you set module.exports = {...}?',\n );\n }\n return configObject;\n}\n\nexport async function discoverConfigFiles({ getHomeDir = os.homedir } = {}) {\n const magicConfigName = 'web-ext-config';\n\n // Config files will be loaded in this order.\n const possibleConfigs = [\n // Look for a magic hidden config (preceded by dot) in home dir.\n path.join(getHomeDir(), `.${magicConfigName}.mjs`),\n path.join(getHomeDir(), `.${magicConfigName}.cjs`),\n path.join(getHomeDir(), `.${magicConfigName}.js`),\n // Look for webExt key inside package.json file\n path.join(process.cwd(), 'package.json'),\n // Look for a magic config in the current working directory.\n path.join(process.cwd(), `${magicConfigName}.mjs`),\n path.join(process.cwd(), `${magicConfigName}.cjs`),\n path.join(process.cwd(), `${magicConfigName}.js`),\n // Look for a magic hidden config (preceded by dot) the current working directory.\n path.join(process.cwd(), `.${magicConfigName}.mjs`),\n path.join(process.cwd(), `.${magicConfigName}.cjs`),\n path.join(process.cwd(), `.${magicConfigName}.js`),\n ];\n\n const configs = await Promise.all(\n possibleConfigs.map(async (fileName) => {\n const resolvedFileName = path.resolve(fileName);\n if (await fileExists(resolvedFileName)) {\n return resolvedFileName;\n } else {\n log.debug(\n `Discovered config \"${resolvedFileName}\" does not ` +\n 'exist or is not readable',\n );\n return undefined;\n }\n }),\n );\n\n const existingConfigs = [];\n configs.forEach((f) => {\n if (typeof f === 'string') {\n existingConfigs.push(f);\n }\n });\n return existingConfigs;\n}\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,IAAI;AACnB,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,EAAE,MAAM,aAAa;AAE5B,OAAOC,SAAS,MAAM,WAAW;AACjC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,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CAAC,CAAC,EAAE,IAAIH,eAAe,MAAM,CAAC,EACnDrE,IAAI,CAACc,IAAI,CAACyD,OAAO,CAACC,GAAG,CAAC,CAAC,EAAE,IAAIH,eAAe,KAAK,CAAC,CACnD;EAED,MAAMI,OAAO,GAAG,MAAMC,OAAO,CAACC,GAAG,CAC/BL,eAAe,CAACM,GAAG,CAAC,MAAOC,QAAQ,IAAK;IACtC,MAAMC,gBAAgB,GAAG9E,IAAI,CAAC8C,OAAO,CAAC+B,QAAQ,CAAC;IAC/C,IAAI,MAAMxE,UAAU,CAACyE,gBAAgB,CAAC,EAAE;MACtC,OAAOA,gBAAgB;IACzB,CAAC,MAAM;MACLrE,GAAG,CAACgC,KAAK,CACP,sBAAsBqC,gBAAgB,aAAa,GACjD,0BACJ,CAAC;MACD,OAAO3C,SAAS;IAClB;EACF,CAAC,CACH,CAAC;EAED,MAAM4C,eAAe,GAAG,EAAE;EAC1BN,OAAO,CAACO,OAAO,CAAEC,CAAC,IAAK;IACrB,IAAI,OAAOA,CAAC,KAAK,QAAQ,EAAE;MACzBF,eAAe,CAACG,IAAI,CAACD,CAAC,CAAC;IACzB;EACF,CAAC,CAAC;EACF,OAAOF,eAAe;AACxB","ignoreList":[]}
1
+ {"version":3,"file":"config.js","names":["os","path","fs","camelCase","decamelize","parseJSON","fileExists","createLogger","UsageError","WebExtError","log","import","meta","url","applyConfigToArgv","argv","argvFromCLI","configObject","options","configFileName","newArgv","option","Object","keys","Array","isArray","decamelizedOptName","separator","type","undefined","expectedType","optionType","defaultValue","default","wasValueSetOnCLI","debug","coerce","loadJSConfigFile","filePath","resolvedFilePath","resolve","endsWith","nonce","Date","now","Math","random","configModule","readFile","encoding","configDefault","esmConfigMod","error","configFileError","cause","webExt","length","discoverConfigFiles","getHomeDir","homedir","magicConfigName","possibleConfigs","join","process","cwd","configs","Promise","all","map","fileName","resolvedFileName","existingConfigs","forEach","f","push"],"sources":["../src/config.js"],"sourcesContent":["import os from 'os';\nimport path from 'path';\nimport fs from 'fs/promises';\n\nimport camelCase from 'camelcase';\nimport decamelize from 'decamelize';\nimport parseJSON from 'parse-json';\n\nimport fileExists from './util/file-exists.js';\nimport { createLogger } from './util/logger.js';\nimport { UsageError, WebExtError } from './errors.js';\n\nconst log = createLogger(import.meta.url);\n\nexport function applyConfigToArgv({\n argv,\n argvFromCLI,\n configObject,\n options,\n configFileName,\n}) {\n let newArgv = { ...argv };\n\n for (const option of Object.keys(configObject)) {\n if (camelCase(option) !== option) {\n throw new UsageError(\n `The config option \"${option}\" must be ` +\n `specified in camel case: \"${camelCase(option)}\"`,\n );\n }\n\n // A config option cannot be a sub-command config\n // object if it is an array.\n if (\n !Array.isArray(configObject[option]) &&\n typeof options[option] === 'object' &&\n typeof configObject[option] === 'object'\n ) {\n // Descend into the nested configuration for a sub-command.\n newArgv = applyConfigToArgv({\n argv: newArgv,\n argvFromCLI,\n configObject: configObject[option],\n options: options[option],\n configFileName,\n });\n continue;\n }\n\n const decamelizedOptName = decamelize(option, { separator: '-' });\n\n if (typeof options[decamelizedOptName] !== 'object') {\n throw new UsageError(\n `The config file at ${configFileName} specified ` +\n `an unknown option: \"${option}\"`,\n );\n }\n if (options[decamelizedOptName].type === undefined) {\n // This means yargs option type wasn't not defined correctly\n throw new WebExtError(`Option: ${option} was defined without a type.`);\n }\n\n const expectedType =\n options[decamelizedOptName].type === 'count'\n ? 'number'\n : options[decamelizedOptName].type;\n\n const optionType = Array.isArray(configObject[option])\n ? 'array'\n : typeof configObject[option];\n\n if (optionType !== expectedType) {\n throw new UsageError(\n `The config file at ${configFileName} specified ` +\n `the type of \"${option}\" incorrectly as \"${optionType}\"` +\n ` (expected type \"${expectedType}\")`,\n );\n }\n\n let defaultValue;\n if (options[decamelizedOptName]) {\n if (options[decamelizedOptName].default !== undefined) {\n defaultValue = options[decamelizedOptName].default;\n } else if (expectedType === 'boolean') {\n defaultValue = false;\n }\n }\n\n // This is our best effort (without patching yargs) to detect\n // if a value was set on the CLI instead of in the config.\n // It looks for a default value and if the argv value is\n // different, it assumes that the value was configured on the CLI.\n\n const wasValueSetOnCLI =\n typeof argvFromCLI[option] !== 'undefined' &&\n argvFromCLI[option] !== defaultValue;\n if (wasValueSetOnCLI) {\n log.debug(\n `Favoring CLI: ${option}=${argvFromCLI[option]} over ` +\n `configuration: ${option}=${configObject[option]}`,\n );\n newArgv[option] = argvFromCLI[option];\n continue;\n }\n\n newArgv[option] = configObject[option];\n\n const coerce = options[decamelizedOptName].coerce;\n if (coerce) {\n log.debug(`Calling coerce() on configured value for ${option}`);\n newArgv[option] = coerce(newArgv[option]);\n }\n\n newArgv[decamelizedOptName] = newArgv[option];\n }\n return newArgv;\n}\n\nexport async function loadJSConfigFile(filePath) {\n const resolvedFilePath = path.resolve(filePath);\n log.debug(\n `Loading JS config file: \"${filePath}\" ` +\n `(resolved to \"${resolvedFilePath}\")`,\n );\n\n if (filePath.endsWith('.js')) {\n throw new UsageError(\n ` Invalid config file \"${resolvedFilePath}\": the file extension should be` +\n '\".cjs\" or \".mjs\". More information at: https://mzl.la/web-ext-config-file',\n );\n }\n\n let configObject;\n try {\n const nonce = `${Date.now()}-${Math.random()}`;\n\n let configModule;\n if (resolvedFilePath.endsWith('package.json')) {\n configModule = parseJSON(\n await fs.readFile(resolvedFilePath, { encoding: 'utf-8' }),\n );\n } else {\n configModule = await import(`file://${resolvedFilePath}?nonce=${nonce}`);\n }\n\n if (configModule.default) {\n const { default: configDefault, ...esmConfigMod } = configModule;\n // ES modules may expose both a default and named exports and so\n // we merge the named exports on top of what may have been set in\n // the default export.\n if (filePath.endsWith('.cjs')) {\n // Remove the additional 'module.exports' named export that Node.js >=\n // 24 is returning from the dynamic import call (in addition to being\n // also set on the default property as in Node.js < 24).\n delete esmConfigMod['module.exports'];\n }\n configObject = { ...configDefault, ...esmConfigMod };\n } else {\n configObject = { ...configModule };\n }\n } catch (error) {\n const configFileError = new UsageError(\n `Cannot read config file \"${resolvedFilePath}\":\\n${error}`,\n );\n configFileError.cause = error;\n throw configFileError;\n }\n\n if (filePath.endsWith('package.json')) {\n log.debug('Looking for webExt key inside package.json file');\n configObject = configObject.webExt || {};\n }\n\n if (Object.keys(configObject).length === 0) {\n log.debug(\n `Config file ${resolvedFilePath} did not define any options. ` +\n 'Did you set module.exports = {...}?',\n );\n }\n\n return configObject;\n}\n\nexport async function discoverConfigFiles({ getHomeDir = os.homedir } = {}) {\n const magicConfigName = 'web-ext-config';\n\n // Config files will be loaded in this order.\n const possibleConfigs = [\n // Look for a magic hidden config (preceded by dot) in home dir.\n path.join(getHomeDir(), `.${magicConfigName}.mjs`),\n path.join(getHomeDir(), `.${magicConfigName}.cjs`),\n path.join(getHomeDir(), `.${magicConfigName}.js`),\n // Look for webExt key inside package.json file\n path.join(process.cwd(), 'package.json'),\n // Look for a magic config in the current working directory.\n path.join(process.cwd(), `${magicConfigName}.mjs`),\n path.join(process.cwd(), `${magicConfigName}.cjs`),\n path.join(process.cwd(), `${magicConfigName}.js`),\n // Look for a magic hidden config (preceded by dot) the current working directory.\n path.join(process.cwd(), `.${magicConfigName}.mjs`),\n path.join(process.cwd(), `.${magicConfigName}.cjs`),\n path.join(process.cwd(), `.${magicConfigName}.js`),\n ];\n\n const configs = await Promise.all(\n possibleConfigs.map(async (fileName) => {\n const resolvedFileName = path.resolve(fileName);\n if (await fileExists(resolvedFileName)) {\n return resolvedFileName;\n } else {\n log.debug(\n `Discovered config \"${resolvedFileName}\" does not ` +\n 'exist or is not readable',\n );\n return undefined;\n }\n }),\n );\n\n const existingConfigs = [];\n configs.forEach((f) => {\n if (typeof f === 'string') {\n existingConfigs.push(f);\n }\n });\n return existingConfigs;\n}\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,IAAI;AACnB,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,EAAE,MAAM,aAAa;AAE5B,OAAOC,SAAS,MAAM,WAAW;AACjC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,U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,eAAe,GAAG,EAAE;EAC1BN,OAAO,CAACO,OAAO,CAAEC,CAAC,IAAK;IACrB,IAAI,OAAOA,CAAC,KAAK,QAAQ,EAAE;MACzBF,eAAe,CAACG,IAAI,CAACD,CAAC,CAAC;IACzB;EACF,CAAC,CAAC;EACF,OAAOF,eAAe;AACxB","ignoreList":[]}
package/lib/program.js CHANGED
@@ -279,6 +279,9 @@ export class Program {
279
279
  if (error.code) {
280
280
  log.error(`Error code: ${error.code}\n`);
281
281
  }
282
+ if (error.cause && adjustedArgv.verbose) {
283
+ log.error(`Error cause: ${error.cause.stack}\n`);
284
+ }
282
285
  log.debug(`Command executed: ${cmd}`);
283
286
  if (this.shouldExitProgram) {
284
287
  systemProcess.exit(1);
@@ -1 +1 @@
1
- {"version":3,"file":"program.js","names":["os","path","readFileSync","camelCase","decamelize","yargs","Parser","yargsParser","defaultCommands","UsageError","createLogger","consoleStream","defaultLogStream","coerceCLICustomPreference","checkForUpdates","defaultUpdateChecker","discoverConfigFiles","defaultConfigDiscovery","loadJSConfigFile","defaultLoadJSConfigFile","applyConfigToArgv","defaultApplyConfigToArgv","log","import","meta","url","envPrefix","defaultGlobalEnv","AMO_BASE_URL","Program","absolutePackageDir","commands","shouldExitProgram","verboseEnabled","options","programArgv","demandedOptions","constructor","argv","process","cwd","slice","yargsInstance","parserConfiguration","strict","wrap","terminalWidth","command","name","description","executor","commandOptions","yargsForCmd","demandCommand","undefined","exitProcess","env","setGlobalOptions","Object","keys","forEach","key","global","demandOption","enableVerboseMode","logStream","version","makeVerbose","info","getArguments","validationInstance","getInternalMethods","getValidationInstance","requiredArguments","getDemandedOptions","args","err","message","startsWith","configDiscovery","noConfigDiscovery","reload","noReload","input","noInput","ignoreFiles","length","startUrl","checkRequiredArguments","adjustedArgv","cleanupProcessEnvConfigs","systemProcess","cmd","_","toOptionKey","k","replace","separator","filter","optKey","globalOpt","cmdOpt","debug","execute","getVersion","defaultVersionGetter","globalEnv","runCommand","verbose","webextVersion","configFiles","discoveredConfigs","push","config","resolve","niceFileList","map","f","homedir","join","configFileName","configObject","argvFromCLI","error","stack","String","code","exit","packageData","JSON","parse","git","branch","long","throwUsageErrorIfArray","errorMessage","value","Array","isArray","main","runOptions","program","usage","help","alias","recommendCommands","describe","default","requiresArg","type","coerce","arg","normalize","hidden","build","filename","dumpConfig","sign","timeout","channel","run","target","choices","firefox","pref","devtools","lint","output","metadata","pretty","privileged","boring","docs"],"sources":["../src/program.js"],"sourcesContent":["import os from 'os';\nimport path from 'path';\nimport { readFileSync } from 'fs';\n\nimport camelCase from 'camelcase';\nimport decamelize from 'decamelize';\nimport yargs from 'yargs';\nimport { Parser as yargsParser } from 'yargs/helpers';\n\nimport defaultCommands from './cmd/index.js';\nimport { UsageError } from './errors.js';\nimport {\n createLogger,\n consoleStream as defaultLogStream,\n} from './util/logger.js';\nimport { coerceCLICustomPreference } from './firefox/preferences.js';\nimport { checkForUpdates as defaultUpdateChecker } from './util/updates.js';\nimport {\n discoverConfigFiles as defaultConfigDiscovery,\n loadJSConfigFile as defaultLoadJSConfigFile,\n applyConfigToArgv as defaultApplyConfigToArgv,\n} from './config.js';\n\nconst log = createLogger(import.meta.url);\nconst envPrefix = 'WEB_EXT';\n// Default to \"development\" (the value actually assigned will be interpolated\n// by babel-plugin-transform-inline-environment-variables).\nconst defaultGlobalEnv = process.env.WEBEXT_BUILD_ENV || 'development';\n\nexport const AMO_BASE_URL = 'https://addons.mozilla.org/api/v5/';\n\n/*\n * The command line program.\n */\nexport class Program {\n absolutePackageDir;\n yargs;\n commands;\n shouldExitProgram;\n verboseEnabled;\n options;\n programArgv;\n demandedOptions;\n\n constructor(argv, { absolutePackageDir = process.cwd() } = {}) {\n // This allows us to override the process argv which is useful for\n // testing.\n // NOTE: process.argv.slice(2) removes the path to node and web-ext\n // executables from the process.argv array.\n argv = argv || process.argv.slice(2);\n this.programArgv = argv;\n\n // NOTE: always initialize yargs explicitly with the package dir\n // to avoid side-effects due to yargs looking for its configuration\n // section from a package.json file stored in an arbitrary directory\n // (e.g. in tests yargs would end up loading yargs config from the\n // mocha package.json). web-ext package.json doesn't contain any yargs\n // section as it is deprecated and we configure yargs using\n // yargs.parserConfiguration. See web-ext#469 for rationale.\n const yargsInstance = yargs(argv, absolutePackageDir);\n\n this.absolutePackageDir = absolutePackageDir;\n this.verboseEnabled = false;\n this.shouldExitProgram = true;\n\n this.yargs = yargsInstance;\n this.yargs.parserConfiguration({\n 'boolean-negation': true,\n });\n this.yargs.strict();\n this.yargs.wrap(this.yargs.terminalWidth());\n\n this.commands = {};\n this.options = {};\n }\n\n command(name, description, executor, commandOptions = {}) {\n this.options[camelCase(name)] = commandOptions;\n\n this.yargs.command(name, description, (yargsForCmd) => {\n if (!commandOptions) {\n return;\n }\n return (\n yargsForCmd\n // Make sure the user does not add any extra commands. For example,\n // this would be a mistake because lint does not accept arguments:\n // web-ext lint ./src/path/to/file.js\n .demandCommand(\n 0,\n 0,\n undefined,\n 'This command does not take any arguments',\n )\n .strict()\n .exitProcess(this.shouldExitProgram)\n // Calling env() will be unnecessary after\n // https://github.com/yargs/yargs/issues/486 is fixed\n .env(envPrefix)\n .options(commandOptions)\n );\n });\n this.commands[name] = executor;\n return this;\n }\n\n setGlobalOptions(options) {\n // This is a convenience for setting global options.\n // An option is only global (i.e. available to all sub commands)\n // with the `global` flag so this makes sure every option has it.\n this.options = { ...this.options, ...options };\n Object.keys(options).forEach((key) => {\n options[key].global = true;\n if (options[key].demandOption === undefined) {\n // By default, all options should be \"demanded\" otherwise\n // yargs.strict() will think they are missing when declared.\n options[key].demandOption = true;\n }\n });\n this.yargs.options(options);\n return this;\n }\n\n enableVerboseMode(logStream, version) {\n if (this.verboseEnabled) {\n return;\n }\n\n logStream.makeVerbose();\n log.info('Version:', version);\n this.verboseEnabled = true;\n }\n\n // Retrieve the yargs argv object and apply any further fix needed\n // on the output of the yargs options parsing.\n getArguments() {\n // To support looking up required parameters via config files, we need to\n // temporarily disable the requiredArguments validation. Otherwise yargs\n // would exit early. Validation is enforced by the checkRequiredArguments()\n // method, after reading configuration files.\n //\n // This is an undocumented internal API of yargs! Unit tests to avoid\n // regressions are located at: tests/functional/test.cli.sign.js\n //\n // Replace hack if possible: https://github.com/mozilla/web-ext/issues/1930\n const validationInstance = this.yargs\n .getInternalMethods()\n .getValidationInstance();\n const { requiredArguments } = validationInstance;\n // Initialize demandedOptions (which is going to be set to an object with one\n // property for each mandatory global options, then the arrow function below\n // will receive as its demandedOptions parameter a new one that also includes\n // all mandatory options for the sub command selected).\n this.demandedOptions = this.yargs.getDemandedOptions();\n validationInstance.requiredArguments = (args, demandedOptions) => {\n this.demandedOptions = demandedOptions;\n };\n let argv;\n try {\n argv = this.yargs.argv;\n } catch (err) {\n if (\n err.name === 'YError' &&\n err.message.startsWith('Unknown argument: ')\n ) {\n throw new UsageError(err.message);\n }\n throw err;\n }\n validationInstance.requiredArguments = requiredArguments;\n\n // Yargs boolean options doesn't define the no* counterpart\n // with negate-boolean on Yargs 15. Define as expected by the\n // web-ext execute method.\n if (argv.configDiscovery != null) {\n argv.noConfigDiscovery = !argv.configDiscovery;\n }\n if (argv.reload != null) {\n argv.noReload = !argv.reload;\n }\n\n // Yargs doesn't accept --no-input as a valid option if there isn't a\n // --input option defined to be negated, to fix that the --input is\n // defined and hidden from the yargs help output and we define here\n // the negated argument name that we expect to be set in the parsed\n // arguments (and fix https://github.com/mozilla/web-ext/issues/1860).\n if (argv.input != null) {\n argv.noInput = !argv.input;\n }\n\n // Replacement for the \"requiresArg: true\" parameter until the following bug\n // is fixed: https://github.com/yargs/yargs/issues/1098\n if (argv.ignoreFiles && !argv.ignoreFiles.length) {\n throw new UsageError('Not enough arguments following: ignore-files');\n }\n\n if (argv.startUrl && !argv.startUrl.length) {\n throw new UsageError('Not enough arguments following: start-url');\n }\n\n return argv;\n }\n\n // getArguments() disables validation of required parameters, to allow us to\n // read parameters from config files first. Before the program continues, it\n // must call checkRequiredArguments() to ensure that required parameters are\n // defined (in the CLI or in a config file).\n checkRequiredArguments(adjustedArgv) {\n const validationInstance = this.yargs\n .getInternalMethods()\n .getValidationInstance();\n validationInstance.requiredArguments(adjustedArgv, this.demandedOptions);\n }\n\n // Remove WEB_EXT_* environment vars that are not a global cli options\n // or an option supported by the current command (See #793).\n cleanupProcessEnvConfigs(systemProcess) {\n const cmd = yargsParser(this.programArgv)._[0];\n const env = systemProcess.env || {};\n const toOptionKey = (k) =>\n decamelize(camelCase(k.replace(envPrefix, '')), { separator: '-' });\n\n if (cmd) {\n Object.keys(env)\n .filter((k) => k.startsWith(envPrefix))\n .forEach((k) => {\n const optKey = toOptionKey(k);\n const globalOpt = this.options[optKey];\n const cmdOpt = this.options[cmd] && this.options[cmd][optKey];\n\n if (!globalOpt && !cmdOpt) {\n log.debug(`Environment ${k} not supported by web-ext ${cmd}`);\n delete env[k];\n }\n });\n }\n }\n\n async execute({\n checkForUpdates = defaultUpdateChecker,\n systemProcess = process,\n logStream = defaultLogStream,\n getVersion = defaultVersionGetter,\n applyConfigToArgv = defaultApplyConfigToArgv,\n discoverConfigFiles = defaultConfigDiscovery,\n loadJSConfigFile = defaultLoadJSConfigFile,\n shouldExitProgram = true,\n globalEnv = defaultGlobalEnv,\n } = {}) {\n this.shouldExitProgram = shouldExitProgram;\n this.yargs.exitProcess(this.shouldExitProgram);\n\n this.cleanupProcessEnvConfigs(systemProcess);\n const argv = this.getArguments();\n\n const cmd = argv._[0];\n\n const version = await getVersion(this.absolutePackageDir);\n const runCommand = this.commands[cmd];\n\n if (argv.verbose) {\n this.enableVerboseMode(logStream, version);\n }\n\n let adjustedArgv = { ...argv, webextVersion: version };\n\n try {\n if (cmd === undefined) {\n throw new UsageError('No sub-command was specified in the args');\n }\n if (!runCommand) {\n throw new UsageError(`Unknown command: ${cmd}`);\n }\n if (globalEnv === 'production') {\n checkForUpdates({ version });\n }\n\n const configFiles = [];\n\n if (argv.configDiscovery) {\n log.debug(\n 'Discovering config files. ' + 'Set --no-config-discovery to disable',\n );\n const discoveredConfigs = await discoverConfigFiles();\n configFiles.push(...discoveredConfigs);\n } else {\n log.debug('Not discovering config files');\n }\n\n if (argv.config) {\n configFiles.push(path.resolve(argv.config));\n }\n\n if (configFiles.length) {\n const niceFileList = configFiles\n .map((f) => f.replace(process.cwd(), '.'))\n .map((f) => f.replace(os.homedir(), '~'))\n .join(', ');\n log.debug(\n 'Applying config file' +\n `${configFiles.length !== 1 ? 's' : ''}: ` +\n `${niceFileList}`,\n );\n }\n\n for (const configFileName of configFiles) {\n const configObject = await loadJSConfigFile(configFileName);\n adjustedArgv = applyConfigToArgv({\n argv: adjustedArgv,\n argvFromCLI: argv,\n configFileName,\n configObject,\n options: this.options,\n });\n }\n\n if (adjustedArgv.verbose) {\n // Ensure that the verbose is enabled when specified in a config file.\n this.enableVerboseMode(logStream, version);\n }\n\n this.checkRequiredArguments(adjustedArgv);\n\n await runCommand(adjustedArgv, { shouldExitProgram });\n } catch (error) {\n if (!(error instanceof UsageError) || adjustedArgv.verbose) {\n log.error(`\\n${error.stack}\\n`);\n } else {\n log.error(`\\n${String(error)}\\n`);\n }\n if (error.code) {\n log.error(`Error code: ${error.code}\\n`);\n }\n\n log.debug(`Command executed: ${cmd}`);\n\n if (this.shouldExitProgram) {\n systemProcess.exit(1);\n } else {\n throw error;\n }\n }\n }\n}\n\n//A definition of type of argument for defaultVersionGetter\n\nexport async function defaultVersionGetter(\n absolutePackageDir,\n { globalEnv = defaultGlobalEnv } = {},\n) {\n if (globalEnv === 'production') {\n log.debug('Getting the version from package.json');\n const packageData = readFileSync(\n path.join(absolutePackageDir, 'package.json'),\n );\n return JSON.parse(packageData).version;\n } else {\n log.debug('Getting version from the git revision');\n // This branch is only reached during development.\n // git-rev-sync is in devDependencies, and lazily imported using require.\n // This also avoids logspam from https://github.com/mozilla/web-ext/issues/1916\n // eslint-disable-next-line import/no-extraneous-dependencies\n const git = await import('git-rev-sync');\n return `${git.branch(absolutePackageDir)}-${git.long(absolutePackageDir)}`;\n }\n}\n\nexport function throwUsageErrorIfArray(errorMessage) {\n return (value) => {\n if (Array.isArray(value)) {\n throw new UsageError(errorMessage);\n }\n return value;\n };\n}\n\nexport async function main(\n absolutePackageDir,\n {\n getVersion = defaultVersionGetter,\n commands = defaultCommands,\n argv,\n runOptions = {},\n } = {},\n) {\n const program = new Program(argv, { absolutePackageDir });\n const version = await getVersion(absolutePackageDir);\n\n // yargs uses magic camel case expansion to expose options on the\n // final argv object. For example, the 'artifacts-dir' option is alternatively\n // available as argv.artifactsDir.\n program.yargs\n .usage(\n `Usage: $0 [options] command\n\nOption values can also be set by declaring an environment variable prefixed\nwith $${envPrefix}_. For example: $${envPrefix}_SOURCE_DIR=/path is the same as\n--source-dir=/path.\n\nTo view specific help for any given command, add the command name.\nExample: $0 --help run.\n`,\n )\n .help('help')\n .alias('h', 'help')\n .env(envPrefix)\n .version(version)\n .demandCommand(1, 'You must specify a command')\n .strict()\n .recommendCommands();\n\n program.setGlobalOptions({\n 'source-dir': {\n alias: 's',\n describe: 'Web extension source directory.',\n default: process.cwd(),\n requiresArg: true,\n type: 'string',\n coerce: (arg) => arg ?? undefined,\n },\n 'artifacts-dir': {\n alias: 'a',\n describe: 'Directory where artifacts will be saved.',\n default: path.join(process.cwd(), 'web-ext-artifacts'),\n normalize: true,\n requiresArg: true,\n type: 'string',\n },\n verbose: {\n alias: 'v',\n describe: 'Show verbose output',\n type: 'boolean',\n demandOption: false,\n },\n 'ignore-files': {\n alias: 'i',\n describe:\n 'A list of glob patterns to define which files should be ' +\n 'ignored. (Example: --ignore-files=path/to/first.js ' +\n 'path/to/second.js \"**/*.log\")',\n demandOption: false,\n // The following option prevents yargs>=11 from parsing multiple values,\n // so the minimum value requirement is enforced in execute instead.\n // Upstream bug: https://github.com/yargs/yargs/issues/1098\n // requiresArg: true,\n type: 'array',\n },\n 'no-input': {\n describe: 'Disable all features that require standard input',\n type: 'boolean',\n demandOption: false,\n },\n input: {\n // This option is defined to make yargs to accept the --no-input\n // defined above, but we hide it from the yargs help output.\n hidden: true,\n type: 'boolean',\n demandOption: false,\n },\n config: {\n alias: 'c',\n describe: 'Path to a CommonJS config file to set ' + 'option defaults',\n default: undefined,\n demandOption: false,\n requiresArg: true,\n type: 'string',\n },\n 'config-discovery': {\n describe:\n 'Discover config files in home directory and ' +\n 'working directory. Disable with --no-config-discovery.',\n demandOption: false,\n default: true,\n type: 'boolean',\n },\n });\n\n program\n .command(\n 'build',\n 'Create an extension package from source',\n commands.build,\n {\n 'as-needed': {\n describe: 'Watch for file changes and re-build as needed',\n type: 'boolean',\n },\n filename: {\n alias: 'n',\n describe: 'Name of the created extension package file.',\n default: undefined,\n normalize: false,\n demandOption: false,\n requiresArg: true,\n type: 'string',\n coerce: (arg) =>\n arg == null\n ? undefined\n : throwUsageErrorIfArray(\n 'Multiple --filename/-n option are not allowed',\n )(arg),\n },\n 'overwrite-dest': {\n alias: 'o',\n describe: 'Overwrite destination package if it exists.',\n type: 'boolean',\n },\n },\n )\n .command(\n 'dump-config',\n 'Run config discovery and dump the resulting config data as JSON',\n commands.dumpConfig,\n {},\n )\n .command(\n 'sign',\n 'Sign the extension so it can be installed in Firefox',\n commands.sign,\n {\n 'amo-base-url': {\n describe: 'Submission API URL prefix',\n default: AMO_BASE_URL,\n demandOption: true,\n type: 'string',\n },\n 'api-key': {\n describe: 'API key (JWT issuer) from addons.mozilla.org',\n demandOption: true,\n type: 'string',\n },\n 'api-secret': {\n describe: 'API secret (JWT secret) from addons.mozilla.org',\n demandOption: true,\n type: 'string',\n },\n 'api-proxy': {\n describe:\n 'Use a proxy to access the signing API. ' +\n 'Example: https://yourproxy:6000 ',\n demandOption: false,\n type: 'string',\n },\n timeout: {\n describe: 'Number of milliseconds to wait before giving up',\n type: 'number',\n },\n 'approval-timeout': {\n describe:\n 'Number of milliseconds to wait for approval before giving up. ' +\n 'Set to 0 to disable waiting for approval. Fallback to `timeout` if not set.',\n type: 'number',\n },\n channel: {\n describe:\n \"The channel for which to sign the addon. Either 'listed' or 'unlisted'.\",\n demandOption: true,\n type: 'string',\n },\n 'amo-metadata': {\n describe:\n 'Path to a JSON file containing an object with metadata to be passed to the API. ' +\n 'See https://addons-server.readthedocs.io/en/latest/topics/api/addons.html for details.',\n type: 'string',\n },\n 'upload-source-code': {\n describe:\n 'Path to an archive file containing human readable source code of this submission, ' +\n 'if the code in --source-dir has been processed to make it unreadable. ' +\n 'See https://extensionworkshop.com/documentation/publish/source-code-submission/ for ' +\n 'details.',\n type: 'string',\n },\n },\n )\n .command('run', 'Run the extension', commands.run, {\n target: {\n alias: 't',\n describe:\n 'The extensions runners to enable. Specify this option ' +\n 'multiple times to run against multiple targets.',\n default: 'firefox-desktop',\n demandOption: false,\n type: 'array',\n choices: ['firefox-desktop', 'firefox-android', 'chromium'],\n },\n firefox: {\n alias: ['f', 'firefox-binary'],\n describe:\n 'Path or alias to a Firefox executable such as firefox-bin ' +\n 'or firefox.exe. ' +\n 'If not specified, the default Firefox will be used. ' +\n 'You can specify the following aliases in lieu of a path: ' +\n 'firefox, beta, nightly, firefoxdeveloperedition (or deved). ' +\n 'For Flatpak, use `flatpak:org.mozilla.firefox` where ' +\n '`org.mozilla.firefox` is the application ID.',\n demandOption: false,\n type: 'string',\n },\n 'firefox-profile': {\n alias: 'p',\n describe:\n 'Run Firefox using a copy of this profile. The profile ' +\n 'can be specified as a directory or a name, such as one ' +\n 'you would see in the Profile Manager. If not specified, ' +\n 'a new temporary profile will be created.',\n demandOption: false,\n type: 'string',\n },\n 'chromium-binary': {\n describe:\n 'Path or alias to a Chromium executable such as ' +\n 'google-chrome, google-chrome.exe or opera.exe etc. ' +\n 'If not specified, the default Google Chrome will be used.',\n demandOption: false,\n type: 'string',\n },\n 'chromium-profile': {\n describe: 'Path to a custom Chromium profile',\n demandOption: false,\n type: 'string',\n },\n 'profile-create-if-missing': {\n describe: 'Create the profile directory if it does not already exist',\n demandOption: false,\n type: 'boolean',\n },\n 'keep-profile-changes': {\n describe:\n 'Run Firefox directly in custom profile. Any changes to ' +\n 'the profile will be saved.',\n demandOption: false,\n type: 'boolean',\n },\n reload: {\n describe:\n 'Reload the extension when source files change. ' +\n 'Disable with --no-reload.',\n demandOption: false,\n default: true,\n type: 'boolean',\n },\n 'watch-file': {\n alias: ['watch-files'],\n describe:\n 'Reload the extension only when the contents of this' +\n ' file changes. This is useful if you use a custom' +\n ' build process for your extension',\n demandOption: false,\n type: 'array',\n },\n 'watch-ignored': {\n describe:\n 'Paths and globs patterns that should not be ' +\n 'watched for changes. This is useful if you want ' +\n 'to explicitly prevent web-ext from watching part ' +\n 'of the extension directory tree, ' +\n 'e.g. the node_modules folder.',\n demandOption: false,\n type: 'array',\n },\n 'pre-install': {\n describe:\n 'Pre-install the extension into the profile before ' +\n 'startup. This is only needed to support older versions ' +\n 'of Firefox.',\n demandOption: false,\n type: 'boolean',\n },\n pref: {\n describe:\n 'Launch firefox with a custom preference ' +\n '(example: --pref=general.useragent.locale=fr-FR). ' +\n 'You can repeat this option to set more than one ' +\n 'preference.',\n demandOption: false,\n requiresArg: true,\n type: 'array',\n coerce: (arg) =>\n arg != null ? coerceCLICustomPreference(arg) : undefined,\n },\n 'start-url': {\n alias: ['u', 'url'],\n describe: 'Launch firefox at specified page',\n demandOption: false,\n type: 'array',\n },\n devtools: {\n describe:\n 'Open the DevTools for the installed add-on ' +\n '(Firefox 106 and later)',\n demandOption: false,\n type: 'boolean',\n },\n 'browser-console': {\n alias: ['bc'],\n describe: 'Open the DevTools Browser Console.',\n demandOption: false,\n type: 'boolean',\n },\n args: {\n alias: ['arg'],\n describe: 'Additional CLI options passed to the Browser binary',\n demandOption: false,\n type: 'array',\n },\n // Firefox for Android CLI options.\n 'adb-bin': {\n describe: 'Specify a custom path to the adb binary',\n demandOption: false,\n type: 'string',\n requiresArg: true,\n },\n 'adb-host': {\n describe: 'Connect to adb on the specified host',\n demandOption: false,\n type: 'string',\n requiresArg: true,\n },\n 'adb-port': {\n describe: 'Connect to adb on the specified port',\n demandOption: false,\n type: 'string',\n requiresArg: true,\n },\n 'adb-device': {\n alias: ['android-device'],\n describe: 'Connect to the specified adb device name',\n demandOption: false,\n type: 'string',\n requiresArg: true,\n },\n 'adb-discovery-timeout': {\n describe: 'Number of milliseconds to wait before giving up',\n demandOption: false,\n type: 'number',\n requiresArg: true,\n },\n 'adb-remove-old-artifacts': {\n describe: 'Remove old artifacts directories from the adb device',\n demandOption: false,\n type: 'boolean',\n },\n 'firefox-apk': {\n describe:\n 'Run a specific Firefox for Android APK. ' +\n 'Example: org.mozilla.fennec_aurora',\n demandOption: false,\n type: 'string',\n requiresArg: true,\n },\n 'firefox-apk-component': {\n describe:\n 'Run a specific Android Component (defaults to <firefox-apk>/.App)',\n demandOption: false,\n type: 'string',\n requiresArg: true,\n },\n })\n .command('lint', 'Validate the extension source', commands.lint, {\n output: {\n alias: 'o',\n describe: 'The type of output to generate',\n type: 'string',\n default: 'text',\n choices: ['json', 'text'],\n },\n metadata: {\n describe: 'Output only metadata as JSON',\n type: 'boolean',\n default: false,\n },\n 'warnings-as-errors': {\n describe: 'Treat warnings as errors by exiting non-zero for warnings',\n alias: 'w',\n type: 'boolean',\n default: false,\n },\n pretty: {\n describe: 'Prettify JSON output',\n type: 'boolean',\n default: false,\n },\n privileged: {\n describe: 'Treat your extension as a privileged extension',\n type: 'boolean',\n default: false,\n },\n 'self-hosted': {\n describe:\n 'Your extension will be self-hosted. This disables messages ' +\n 'related to hosting on addons.mozilla.org.',\n type: 'boolean',\n default: false,\n },\n boring: {\n describe: 'Disables colorful shell output',\n type: 'boolean',\n default: false,\n },\n })\n .command(\n 'docs',\n 'Open the web-ext documentation in a browser',\n commands.docs,\n {},\n );\n\n return program.execute({ getVersion, ...runOptions });\n}\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,IAAI;AACnB,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,YAAY,QAAQ,IAAI;AAEjC,OAAOC,SAAS,MAAM,WAAW;AACjC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,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AEH,OAAO/B,OAAO,CAACtC,OAAO,CAAC;IAAEC,UAAU;IAAE,GAAGoC;EAAW,CAAC,CAAC;AACvD","ignoreList":[]}
1
+ {"version":3,"file":"program.js","names":["os","path","readFileSync","camelCase","decamelize","yargs","Parser","yargsParser","defaultCommands","UsageError","createLogger","consoleStream","defaultLogStream","coerceCLICustomPreference","checkForUpdates","defaultUpdateChecker","discoverConfigFiles","defaultConfigDiscovery","loadJSConfigFile","defaultLoadJSConfigFile","applyConfigToArgv","defaultApplyConfigToArgv","log","import","meta","url","envPrefix","defaultGlobalEnv","AMO_BASE_URL","Program","absolutePackageDir","commands","shouldExitProgram","verboseEnabled","options","programArgv","demandedOptions","constructor","argv","process","cwd","slice","yargsInstance","parserConfiguration","strict","wrap","terminalWidth","command","name","description","executor","commandOptions","yargsForCmd","demandCommand","undefined","exitProcess","env","setGlobalOptions","Object","keys","forEach","key","global","demandOption","enableVerboseMode","logStream","version","makeVerbose","info","getArguments","validationInstance","getInternalMethods","getValidationInstance","requiredArguments","getDemandedOptions","args","err","message","startsWith","configDiscovery","noConfigDiscovery","reload","noReload","input","noInput","ignoreFiles","length","startUrl","checkRequiredArguments","adjustedArgv","cleanupProcessEnvConfigs","systemProcess","cmd","_","toOptionKey","k","replace","separator","filter","optKey","globalOpt","cmdOpt","debug","execute","getVersion","defaultVersionGetter","globalEnv","runCommand","verbose","webextVersion","configFiles","discoveredConfigs","push","config","resolve","niceFileList","map","f","homedir","join","configFileName","configObject","argvFromCLI","error","stack","String","code","cause","exit","packageData","JSON","parse","git","branch","long","throwUsageErrorIfArray","errorMessage","value","Array","isArray","main","runOptions","program","usage","help","alias","recommendCommands","describe","default","requiresArg","type","coerce","arg","normalize","hidden","build","filename","dumpConfig","sign","timeout","channel","run","target","choices","firefox","pref","devtools","lint","output","metadata","pretty","privileged","boring","docs"],"sources":["../src/program.js"],"sourcesContent":["import os from 'os';\nimport path from 'path';\nimport { readFileSync } from 'fs';\n\nimport camelCase from 'camelcase';\nimport decamelize from 'decamelize';\nimport yargs from 'yargs';\nimport { Parser as yargsParser } from 'yargs/helpers';\n\nimport defaultCommands from './cmd/index.js';\nimport { UsageError } from './errors.js';\nimport {\n createLogger,\n consoleStream as defaultLogStream,\n} from './util/logger.js';\nimport { coerceCLICustomPreference } from './firefox/preferences.js';\nimport { checkForUpdates as defaultUpdateChecker } from './util/updates.js';\nimport {\n discoverConfigFiles as defaultConfigDiscovery,\n loadJSConfigFile as defaultLoadJSConfigFile,\n applyConfigToArgv as defaultApplyConfigToArgv,\n} from './config.js';\n\nconst log = createLogger(import.meta.url);\nconst envPrefix = 'WEB_EXT';\n// Default to \"development\" (the value actually assigned will be interpolated\n// by babel-plugin-transform-inline-environment-variables).\nconst defaultGlobalEnv = process.env.WEBEXT_BUILD_ENV || 'development';\n\nexport const AMO_BASE_URL = 'https://addons.mozilla.org/api/v5/';\n\n/*\n * The command line program.\n */\nexport class Program {\n absolutePackageDir;\n yargs;\n commands;\n shouldExitProgram;\n verboseEnabled;\n options;\n programArgv;\n demandedOptions;\n\n constructor(argv, { absolutePackageDir = process.cwd() } = {}) {\n // This allows us to override the process argv which is useful for\n // testing.\n // NOTE: process.argv.slice(2) removes the path to node and web-ext\n // executables from the process.argv array.\n argv = argv || process.argv.slice(2);\n this.programArgv = argv;\n\n // NOTE: always initialize yargs explicitly with the package dir\n // to avoid side-effects due to yargs looking for its configuration\n // section from a package.json file stored in an arbitrary directory\n // (e.g. in tests yargs would end up loading yargs config from the\n // mocha package.json). web-ext package.json doesn't contain any yargs\n // section as it is deprecated and we configure yargs using\n // yargs.parserConfiguration. See web-ext#469 for rationale.\n const yargsInstance = yargs(argv, absolutePackageDir);\n\n this.absolutePackageDir = absolutePackageDir;\n this.verboseEnabled = false;\n this.shouldExitProgram = true;\n\n this.yargs = yargsInstance;\n this.yargs.parserConfiguration({\n 'boolean-negation': true,\n });\n this.yargs.strict();\n this.yargs.wrap(this.yargs.terminalWidth());\n\n this.commands = {};\n this.options = {};\n }\n\n command(name, description, executor, commandOptions = {}) {\n this.options[camelCase(name)] = commandOptions;\n\n this.yargs.command(name, description, (yargsForCmd) => {\n if (!commandOptions) {\n return;\n }\n return (\n yargsForCmd\n // Make sure the user does not add any extra commands. For example,\n // this would be a mistake because lint does not accept arguments:\n // web-ext lint ./src/path/to/file.js\n .demandCommand(\n 0,\n 0,\n undefined,\n 'This command does not take any arguments',\n )\n .strict()\n .exitProcess(this.shouldExitProgram)\n // Calling env() will be unnecessary after\n // https://github.com/yargs/yargs/issues/486 is fixed\n .env(envPrefix)\n .options(commandOptions)\n );\n });\n this.commands[name] = executor;\n return this;\n }\n\n setGlobalOptions(options) {\n // This is a convenience for setting global options.\n // An option is only global (i.e. available to all sub commands)\n // with the `global` flag so this makes sure every option has it.\n this.options = { ...this.options, ...options };\n Object.keys(options).forEach((key) => {\n options[key].global = true;\n if (options[key].demandOption === undefined) {\n // By default, all options should be \"demanded\" otherwise\n // yargs.strict() will think they are missing when declared.\n options[key].demandOption = true;\n }\n });\n this.yargs.options(options);\n return this;\n }\n\n enableVerboseMode(logStream, version) {\n if (this.verboseEnabled) {\n return;\n }\n\n logStream.makeVerbose();\n log.info('Version:', version);\n this.verboseEnabled = true;\n }\n\n // Retrieve the yargs argv object and apply any further fix needed\n // on the output of the yargs options parsing.\n getArguments() {\n // To support looking up required parameters via config files, we need to\n // temporarily disable the requiredArguments validation. Otherwise yargs\n // would exit early. Validation is enforced by the checkRequiredArguments()\n // method, after reading configuration files.\n //\n // This is an undocumented internal API of yargs! Unit tests to avoid\n // regressions are located at: tests/functional/test.cli.sign.js\n //\n // Replace hack if possible: https://github.com/mozilla/web-ext/issues/1930\n const validationInstance = this.yargs\n .getInternalMethods()\n .getValidationInstance();\n const { requiredArguments } = validationInstance;\n // Initialize demandedOptions (which is going to be set to an object with one\n // property for each mandatory global options, then the arrow function below\n // will receive as its demandedOptions parameter a new one that also includes\n // all mandatory options for the sub command selected).\n this.demandedOptions = this.yargs.getDemandedOptions();\n validationInstance.requiredArguments = (args, demandedOptions) => {\n this.demandedOptions = demandedOptions;\n };\n let argv;\n try {\n argv = this.yargs.argv;\n } catch (err) {\n if (\n err.name === 'YError' &&\n err.message.startsWith('Unknown argument: ')\n ) {\n throw new UsageError(err.message);\n }\n throw err;\n }\n validationInstance.requiredArguments = requiredArguments;\n\n // Yargs boolean options doesn't define the no* counterpart\n // with negate-boolean on Yargs 15. Define as expected by the\n // web-ext execute method.\n if (argv.configDiscovery != null) {\n argv.noConfigDiscovery = !argv.configDiscovery;\n }\n if (argv.reload != null) {\n argv.noReload = !argv.reload;\n }\n\n // Yargs doesn't accept --no-input as a valid option if there isn't a\n // --input option defined to be negated, to fix that the --input is\n // defined and hidden from the yargs help output and we define here\n // the negated argument name that we expect to be set in the parsed\n // arguments (and fix https://github.com/mozilla/web-ext/issues/1860).\n if (argv.input != null) {\n argv.noInput = !argv.input;\n }\n\n // Replacement for the \"requiresArg: true\" parameter until the following bug\n // is fixed: https://github.com/yargs/yargs/issues/1098\n if (argv.ignoreFiles && !argv.ignoreFiles.length) {\n throw new UsageError('Not enough arguments following: ignore-files');\n }\n\n if (argv.startUrl && !argv.startUrl.length) {\n throw new UsageError('Not enough arguments following: start-url');\n }\n\n return argv;\n }\n\n // getArguments() disables validation of required parameters, to allow us to\n // read parameters from config files first. Before the program continues, it\n // must call checkRequiredArguments() to ensure that required parameters are\n // defined (in the CLI or in a config file).\n checkRequiredArguments(adjustedArgv) {\n const validationInstance = this.yargs\n .getInternalMethods()\n .getValidationInstance();\n validationInstance.requiredArguments(adjustedArgv, this.demandedOptions);\n }\n\n // Remove WEB_EXT_* environment vars that are not a global cli options\n // or an option supported by the current command (See #793).\n cleanupProcessEnvConfigs(systemProcess) {\n const cmd = yargsParser(this.programArgv)._[0];\n const env = systemProcess.env || {};\n const toOptionKey = (k) =>\n decamelize(camelCase(k.replace(envPrefix, '')), { separator: '-' });\n\n if (cmd) {\n Object.keys(env)\n .filter((k) => k.startsWith(envPrefix))\n .forEach((k) => {\n const optKey = toOptionKey(k);\n const globalOpt = this.options[optKey];\n const cmdOpt = this.options[cmd] && this.options[cmd][optKey];\n\n if (!globalOpt && !cmdOpt) {\n log.debug(`Environment ${k} not supported by web-ext ${cmd}`);\n delete env[k];\n }\n });\n }\n }\n\n async execute({\n checkForUpdates = defaultUpdateChecker,\n systemProcess = process,\n logStream = defaultLogStream,\n getVersion = defaultVersionGetter,\n applyConfigToArgv = defaultApplyConfigToArgv,\n discoverConfigFiles = defaultConfigDiscovery,\n loadJSConfigFile = defaultLoadJSConfigFile,\n shouldExitProgram = true,\n globalEnv = defaultGlobalEnv,\n } = {}) {\n this.shouldExitProgram = shouldExitProgram;\n this.yargs.exitProcess(this.shouldExitProgram);\n\n this.cleanupProcessEnvConfigs(systemProcess);\n const argv = this.getArguments();\n\n const cmd = argv._[0];\n\n const version = await getVersion(this.absolutePackageDir);\n const runCommand = this.commands[cmd];\n\n if (argv.verbose) {\n this.enableVerboseMode(logStream, version);\n }\n\n let adjustedArgv = { ...argv, webextVersion: version };\n\n try {\n if (cmd === undefined) {\n throw new UsageError('No sub-command was specified in the args');\n }\n if (!runCommand) {\n throw new UsageError(`Unknown command: ${cmd}`);\n }\n if (globalEnv === 'production') {\n checkForUpdates({ version });\n }\n\n const configFiles = [];\n\n if (argv.configDiscovery) {\n log.debug(\n 'Discovering config files. ' + 'Set --no-config-discovery to disable',\n );\n const discoveredConfigs = await discoverConfigFiles();\n configFiles.push(...discoveredConfigs);\n } else {\n log.debug('Not discovering config files');\n }\n\n if (argv.config) {\n configFiles.push(path.resolve(argv.config));\n }\n\n if (configFiles.length) {\n const niceFileList = configFiles\n .map((f) => f.replace(process.cwd(), '.'))\n .map((f) => f.replace(os.homedir(), '~'))\n .join(', ');\n log.debug(\n 'Applying config file' +\n `${configFiles.length !== 1 ? 's' : ''}: ` +\n `${niceFileList}`,\n );\n }\n\n for (const configFileName of configFiles) {\n const configObject = await loadJSConfigFile(configFileName);\n adjustedArgv = applyConfigToArgv({\n argv: adjustedArgv,\n argvFromCLI: argv,\n configFileName,\n configObject,\n options: this.options,\n });\n }\n\n if (adjustedArgv.verbose) {\n // Ensure that the verbose is enabled when specified in a config file.\n this.enableVerboseMode(logStream, version);\n }\n\n this.checkRequiredArguments(adjustedArgv);\n\n await runCommand(adjustedArgv, { shouldExitProgram });\n } catch (error) {\n if (!(error instanceof UsageError) || adjustedArgv.verbose) {\n log.error(`\\n${error.stack}\\n`);\n } else {\n log.error(`\\n${String(error)}\\n`);\n }\n if (error.code) {\n log.error(`Error code: ${error.code}\\n`);\n }\n if (error.cause && adjustedArgv.verbose) {\n log.error(`Error cause: ${error.cause.stack}\\n`);\n }\n\n log.debug(`Command executed: ${cmd}`);\n\n if (this.shouldExitProgram) {\n systemProcess.exit(1);\n } else {\n throw error;\n }\n }\n }\n}\n\n//A definition of type of argument for defaultVersionGetter\n\nexport async function defaultVersionGetter(\n absolutePackageDir,\n { globalEnv = defaultGlobalEnv } = {},\n) {\n if (globalEnv === 'production') {\n log.debug('Getting the version from package.json');\n const packageData = readFileSync(\n path.join(absolutePackageDir, 'package.json'),\n );\n return JSON.parse(packageData).version;\n } else {\n log.debug('Getting version from the git revision');\n // This branch is only reached during development.\n // git-rev-sync is in devDependencies, and lazily imported using require.\n // This also avoids logspam from https://github.com/mozilla/web-ext/issues/1916\n // eslint-disable-next-line import/no-extraneous-dependencies\n const git = await import('git-rev-sync');\n return `${git.branch(absolutePackageDir)}-${git.long(absolutePackageDir)}`;\n }\n}\n\nexport function throwUsageErrorIfArray(errorMessage) {\n return (value) => {\n if (Array.isArray(value)) {\n throw new UsageError(errorMessage);\n }\n return value;\n };\n}\n\nexport async function main(\n absolutePackageDir,\n {\n getVersion = defaultVersionGetter,\n commands = defaultCommands,\n argv,\n runOptions = {},\n } = {},\n) {\n const program = new Program(argv, { absolutePackageDir });\n const version = await getVersion(absolutePackageDir);\n\n // yargs uses magic camel case expansion to expose options on the\n // final argv object. For example, the 'artifacts-dir' option is alternatively\n // available as argv.artifactsDir.\n program.yargs\n .usage(\n `Usage: $0 [options] command\n\nOption values can also be set by declaring an environment variable prefixed\nwith $${envPrefix}_. For example: $${envPrefix}_SOURCE_DIR=/path is the same as\n--source-dir=/path.\n\nTo view specific help for any given command, add the command name.\nExample: $0 --help run.\n`,\n )\n .help('help')\n .alias('h', 'help')\n .env(envPrefix)\n .version(version)\n .demandCommand(1, 'You must specify a command')\n .strict()\n .recommendCommands();\n\n program.setGlobalOptions({\n 'source-dir': {\n alias: 's',\n describe: 'Web extension source directory.',\n default: process.cwd(),\n requiresArg: true,\n type: 'string',\n coerce: (arg) => arg ?? undefined,\n },\n 'artifacts-dir': {\n alias: 'a',\n describe: 'Directory where artifacts will be saved.',\n default: path.join(process.cwd(), 'web-ext-artifacts'),\n normalize: true,\n requiresArg: true,\n type: 'string',\n },\n verbose: {\n alias: 'v',\n describe: 'Show verbose output',\n type: 'boolean',\n demandOption: false,\n },\n 'ignore-files': {\n alias: 'i',\n describe:\n 'A list of glob patterns to define which files should be ' +\n 'ignored. (Example: --ignore-files=path/to/first.js ' +\n 'path/to/second.js \"**/*.log\")',\n demandOption: false,\n // The following option prevents yargs>=11 from parsing multiple values,\n // so the minimum value requirement is enforced in execute instead.\n // Upstream bug: https://github.com/yargs/yargs/issues/1098\n // requiresArg: true,\n type: 'array',\n },\n 'no-input': {\n describe: 'Disable all features that require standard input',\n type: 'boolean',\n demandOption: false,\n },\n input: {\n // This option is defined to make yargs to accept the --no-input\n // defined above, but we hide it from the yargs help output.\n hidden: true,\n type: 'boolean',\n demandOption: false,\n },\n config: {\n alias: 'c',\n describe: 'Path to a CommonJS config file to set ' + 'option defaults',\n default: undefined,\n demandOption: false,\n requiresArg: true,\n type: 'string',\n },\n 'config-discovery': {\n describe:\n 'Discover config files in home directory and ' +\n 'working directory. Disable with --no-config-discovery.',\n demandOption: false,\n default: true,\n type: 'boolean',\n },\n });\n\n program\n .command(\n 'build',\n 'Create an extension package from source',\n commands.build,\n {\n 'as-needed': {\n describe: 'Watch for file changes and re-build as needed',\n type: 'boolean',\n },\n filename: {\n alias: 'n',\n describe: 'Name of the created extension package file.',\n default: undefined,\n normalize: false,\n demandOption: false,\n requiresArg: true,\n type: 'string',\n coerce: (arg) =>\n arg == null\n ? undefined\n : throwUsageErrorIfArray(\n 'Multiple --filename/-n option are not allowed',\n )(arg),\n },\n 'overwrite-dest': {\n alias: 'o',\n describe: 'Overwrite destination package if it exists.',\n type: 'boolean',\n },\n },\n )\n .command(\n 'dump-config',\n 'Run config discovery and dump the resulting config data as JSON',\n commands.dumpConfig,\n {},\n )\n .command(\n 'sign',\n 'Sign the extension so it can be installed in Firefox',\n commands.sign,\n {\n 'amo-base-url': {\n describe: 'Submission API URL prefix',\n default: AMO_BASE_URL,\n demandOption: true,\n type: 'string',\n },\n 'api-key': {\n describe: 'API key (JWT issuer) from addons.mozilla.org',\n demandOption: true,\n type: 'string',\n },\n 'api-secret': {\n describe: 'API secret (JWT secret) from addons.mozilla.org',\n demandOption: true,\n type: 'string',\n },\n 'api-proxy': {\n describe:\n 'Use a proxy to access the signing API. ' +\n 'Example: https://yourproxy:6000 ',\n demandOption: false,\n type: 'string',\n },\n timeout: {\n describe: 'Number of milliseconds to wait before giving up',\n type: 'number',\n },\n 'approval-timeout': {\n describe:\n 'Number of milliseconds to wait for approval before giving up. ' +\n 'Set to 0 to disable waiting for approval. Fallback to `timeout` if not set.',\n type: 'number',\n },\n channel: {\n describe:\n \"The channel for which to sign the addon. Either 'listed' or 'unlisted'.\",\n demandOption: true,\n type: 'string',\n },\n 'amo-metadata': {\n describe:\n 'Path to a JSON file containing an object with metadata to be passed to the API. ' +\n 'See https://addons-server.readthedocs.io/en/latest/topics/api/addons.html for details.',\n type: 'string',\n },\n 'upload-source-code': {\n describe:\n 'Path to an archive file containing human readable source code of this submission, ' +\n 'if the code in --source-dir has been processed to make it unreadable. ' +\n 'See https://extensionworkshop.com/documentation/publish/source-code-submission/ for ' +\n 'details.',\n type: 'string',\n },\n },\n )\n .command('run', 'Run the extension', commands.run, {\n target: {\n alias: 't',\n describe:\n 'The extensions runners to enable. Specify this option ' +\n 'multiple times to run against multiple targets.',\n default: 'firefox-desktop',\n demandOption: false,\n type: 'array',\n choices: ['firefox-desktop', 'firefox-android', 'chromium'],\n },\n firefox: {\n alias: ['f', 'firefox-binary'],\n describe:\n 'Path or alias to a Firefox executable such as firefox-bin ' +\n 'or firefox.exe. ' +\n 'If not specified, the default Firefox will be used. ' +\n 'You can specify the following aliases in lieu of a path: ' +\n 'firefox, beta, nightly, firefoxdeveloperedition (or deved). ' +\n 'For Flatpak, use `flatpak:org.mozilla.firefox` where ' +\n '`org.mozilla.firefox` is the application ID.',\n demandOption: false,\n type: 'string',\n },\n 'firefox-profile': {\n alias: 'p',\n describe:\n 'Run Firefox using a copy of this profile. The profile ' +\n 'can be specified as a directory or a name, such as one ' +\n 'you would see in the Profile Manager. If not specified, ' +\n 'a new temporary profile will be created.',\n demandOption: false,\n type: 'string',\n },\n 'chromium-binary': {\n describe:\n 'Path or alias to a Chromium executable such as ' +\n 'google-chrome, google-chrome.exe or opera.exe etc. ' +\n 'If not specified, the default Google Chrome will be used.',\n demandOption: false,\n type: 'string',\n },\n 'chromium-profile': {\n describe: 'Path to a custom Chromium profile',\n demandOption: false,\n type: 'string',\n },\n 'profile-create-if-missing': {\n describe: 'Create the profile directory if it does not already exist',\n demandOption: false,\n type: 'boolean',\n },\n 'keep-profile-changes': {\n describe:\n 'Run Firefox directly in custom profile. Any changes to ' +\n 'the profile will be saved.',\n demandOption: false,\n type: 'boolean',\n },\n reload: {\n describe:\n 'Reload the extension when source files change. ' +\n 'Disable with --no-reload.',\n demandOption: false,\n default: true,\n type: 'boolean',\n },\n 'watch-file': {\n alias: ['watch-files'],\n describe:\n 'Reload the extension only when the contents of this' +\n ' file changes. This is useful if you use a custom' +\n ' build process for your extension',\n demandOption: false,\n type: 'array',\n },\n 'watch-ignored': {\n describe:\n 'Paths and globs patterns that should not be ' +\n 'watched for changes. This is useful if you want ' +\n 'to explicitly prevent web-ext from watching part ' +\n 'of the extension directory tree, ' +\n 'e.g. the node_modules folder.',\n demandOption: false,\n type: 'array',\n },\n 'pre-install': {\n describe:\n 'Pre-install the extension into the profile before ' +\n 'startup. This is only needed to support older versions ' +\n 'of Firefox.',\n demandOption: false,\n type: 'boolean',\n },\n pref: {\n describe:\n 'Launch firefox with a custom preference ' +\n '(example: --pref=general.useragent.locale=fr-FR). ' +\n 'You can repeat this option to set more than one ' +\n 'preference.',\n demandOption: false,\n requiresArg: true,\n type: 'array',\n coerce: (arg) =>\n arg != null ? coerceCLICustomPreference(arg) : undefined,\n },\n 'start-url': {\n alias: ['u', 'url'],\n describe: 'Launch firefox at specified page',\n demandOption: false,\n type: 'array',\n },\n devtools: {\n describe:\n 'Open the DevTools for the installed add-on ' +\n '(Firefox 106 and later)',\n demandOption: false,\n type: 'boolean',\n },\n 'browser-console': {\n alias: ['bc'],\n describe: 'Open the DevTools Browser Console.',\n demandOption: false,\n type: 'boolean',\n },\n args: {\n alias: ['arg'],\n describe: 'Additional CLI options passed to the Browser binary',\n demandOption: false,\n type: 'array',\n },\n // Firefox for Android CLI options.\n 'adb-bin': {\n describe: 'Specify a custom path to the adb binary',\n demandOption: false,\n type: 'string',\n requiresArg: true,\n },\n 'adb-host': {\n describe: 'Connect to adb on the specified host',\n demandOption: false,\n type: 'string',\n requiresArg: true,\n },\n 'adb-port': {\n describe: 'Connect to adb on the specified port',\n demandOption: false,\n type: 'string',\n requiresArg: true,\n },\n 'adb-device': {\n alias: ['android-device'],\n describe: 'Connect to the specified adb device name',\n demandOption: false,\n type: 'string',\n requiresArg: true,\n },\n 'adb-discovery-timeout': {\n describe: 'Number of milliseconds to wait before giving up',\n demandOption: false,\n type: 'number',\n requiresArg: true,\n },\n 'adb-remove-old-artifacts': {\n describe: 'Remove old artifacts directories from the adb device',\n demandOption: false,\n type: 'boolean',\n },\n 'firefox-apk': {\n describe:\n 'Run a specific Firefox for Android APK. ' +\n 'Example: org.mozilla.fennec_aurora',\n demandOption: false,\n type: 'string',\n requiresArg: true,\n },\n 'firefox-apk-component': {\n describe:\n 'Run a specific Android Component (defaults to <firefox-apk>/.App)',\n demandOption: false,\n type: 'string',\n requiresArg: true,\n },\n })\n .command('lint', 'Validate the extension source', commands.lint, {\n output: {\n alias: 'o',\n describe: 'The type of output to generate',\n type: 'string',\n default: 'text',\n choices: ['json', 'text'],\n },\n metadata: {\n describe: 'Output only metadata as JSON',\n type: 'boolean',\n default: false,\n },\n 'warnings-as-errors': {\n describe: 'Treat warnings as errors by exiting non-zero for warnings',\n alias: 'w',\n type: 'boolean',\n default: false,\n },\n pretty: {\n describe: 'Prettify JSON output',\n type: 'boolean',\n default: false,\n },\n privileged: {\n describe: 'Treat your extension as a privileged extension',\n type: 'boolean',\n default: false,\n },\n 'self-hosted': {\n describe:\n 'Your extension will be self-hosted. This disables messages ' +\n 'related to hosting on addons.mozilla.org.',\n type: 'boolean',\n default: false,\n },\n boring: {\n describe: 'Disables colorful shell output',\n type: 'boolean',\n default: false,\n },\n })\n .command(\n 'docs',\n 'Open the web-ext documentation in a browser',\n commands.docs,\n {},\n );\n\n return program.execute({ getVersion, ...runOptions });\n}\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,IAAI;AACnB,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,YAAY,QAAQ,IAAI;AAEjC,OAAOC,SAAS,MAAM,WAAW;AACjC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,IAAIC,WAAW,QAAQ,eAAe;AAErD,OAAOC,eAAe,MAAM,gBAAgB;AAC5C,SAASC,UAAU,QAAQ,aAAa;AACxC,SACEC,YAAY,EACZC,aAAa,IAAIC,gBAAgB,QAC5B,kBAAkB;AACzB,SAASC,yBAAyB,QAAQ,0BAA0B;AACpE,SAASC,eAAe,IAAIC,oBAAoB,QAAQ,mBAAmB;AAC3E,SACEC,mBAAmB,IAAIC,sB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2
  "name": "web-ext",
3
- "version": "8.10.0",
3
+ "version": "9.0.0",
4
4
  "description": "A command line tool to help build, run, and test web extensions",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -61,7 +61,7 @@
61
61
  "dependencies": {
62
62
  "@babel/runtime": "7.28.4",
63
63
  "@devicefarmer/adbkit": "3.3.8",
64
- "addons-linter": "7.20.0",
64
+ "addons-linter": "8.0.0",
65
65
  "camelcase": "8.0.0",
66
66
  "chrome-launcher": "1.2.0",
67
67
  "debounce": "1.2.1",
@@ -75,8 +75,8 @@
75
75
  "multimatch": "6.0.0",
76
76
  "node-notifier": "10.0.1",
77
77
  "open": "10.2.0",
78
- "parse-json": "7.1.1",
79
- "pino": "9.9.5",
78
+ "parse-json": "8.3.0",
79
+ "pino": "9.11.0",
80
80
  "promise-toolbox": "0.21.0",
81
81
  "source-map-support": "0.5.21",
82
82
  "strip-bom": "5.0.0",
@@ -101,7 +101,7 @@
101
101
  "chai-as-promised": "8.0.2",
102
102
  "copy-dir": "1.3.0",
103
103
  "crc-32": "1.2.2",
104
- "cross-env": "7.0.3",
104
+ "cross-env": "10.0.0",
105
105
  "deepcopy": "2.1.0",
106
106
  "eslint": "8.57.0",
107
107
  "eslint-plugin-async-await": "0.0.0",