extension 4.1.17 → 4.1.18-canary.1789403792.e514b06c
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 +5 -3
- package/dist/cli.cjs +3 -1
- package/dist/extension/config-types.d.ts +5 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
[discord-url]: https://discord.gg/v9h2RgeTSN
|
|
9
9
|
[snyk-image]: https://snyk.io/test/github/extension-js/extension.js/badge.svg?color=0971fe
|
|
10
10
|
[snyk-url]: https://snyk.io/test/github/extension-js/extension.js
|
|
11
|
+
[scorecard-image]: https://api.scorecard.dev/projects/github.com/extension-js/extension.js/badge
|
|
12
|
+
[scorecard-url]: https://scorecard.dev/viewer/?uri=github.com/extension-js/extension.js
|
|
11
13
|
|
|
12
|
-
# Extension.js [![Version][npm-version-image]][npm-version-url] [![Stars][stars-image]][stars-url] [![CI][action-image]][action-url] [![Discord][discord-image]][discord-url]
|
|
14
|
+
# Extension.js [![Version][npm-version-image]][npm-version-url] [![Stars][stars-image]][stars-url] [![CI][action-image]][action-url] [![Discord][discord-image]][discord-url] [![OpenSSF Scorecard][scorecard-image]][scorecard-url]
|
|
13
15
|
|
|
14
16
|
> The cross-browser extension framework. Build for Chrome, Edge, Firefox, and Safari with no build config required.
|
|
15
17
|
|
|
@@ -29,7 +31,7 @@ Works with `npm`, `pnpm`, `yarn`, `bun`, and `deno`.
|
|
|
29
31
|
|
|
30
32
|
Browser extensions ship with the worst dev experience in modern web. Manifest V3 fragmentation, browser-specific quirks, no hot reload for content scripts, and a separate build pipeline for every target. Extension.js fixes that.
|
|
31
33
|
|
|
32
|
-
- **Hot Module Replacement** for
|
|
34
|
+
- **Hot Module Replacement** for popup, options, devtools and other extension pages, including React, Vue, Svelte, and Preact components, with targeted reloads for content scripts and the service worker so one save never reloads the whole extension
|
|
33
35
|
- **Manifest V3 by default**, with automatic adapters for Chrome, Edge, Firefox, and Safari targets
|
|
34
36
|
- **One CLI** for Chrome, Edge, Firefox, and any Chromium or Gecko binary
|
|
35
37
|
- **Zero config**, no webpack, no rollup, no plugins to maintain
|
|
@@ -51,7 +53,7 @@ If you have used [Plasmo](https://www.plasmo.com), [WXT](https://wxt.dev), or [C
|
|
|
51
53
|
| :--------- | :----------- |
|
|
52
54
|
| Run any GitHub sample directly | `extension dev https://github.com/.../sample` |
|
|
53
55
|
| Managed browser binaries | `extension install firefox` downloads an isolated build |
|
|
54
|
-
|
|
|
56
|
+
| Targeted content-script reload across browsers | Built in, only the changed entries re-inject, no plugin glue |
|
|
55
57
|
| Production zip for the stores | `extension build --zip` |
|
|
56
58
|
| Framework agnostic | [Vanilla](https://templates.extension.dev/javascript), [TS](https://templates.extension.dev/typescript), [React](https://templates.extension.dev/react), [Vue](https://templates.extension.dev/vue), [Svelte](https://templates.extension.dev/svelte), [Preact](https://templates.extension.dev/preact), no lock-in |
|
|
57
59
|
| Custom Chromium and Gecko binaries | `--chromium-binary`, `--gecko-binary` |
|
package/dist/cli.cjs
CHANGED
|
@@ -8010,6 +8010,7 @@ Build options
|
|
|
8010
8010
|
- ${messages_code('--zip')} ${messages_arg('[boolean]')} Create ZIP archive of built extension
|
|
8011
8011
|
- ${messages_code('--zip-source')} ${messages_arg('[boolean]')} Include source files in ZIP
|
|
8012
8012
|
- ${messages_code('--zip-filename')} ${messages_arg('<name>')} Custom ZIP filename
|
|
8013
|
+
- ${messages_code('--no-addon-lint')} Skip the addons.mozilla.org lint of Firefox builds (runs when addons-linter is installed)
|
|
8013
8014
|
|
|
8014
8015
|
${external_pintor_default().underline('Centralized logger (terminal output)')}
|
|
8015
8016
|
- The manager extension embeds a centralized logger that streams events to the CLI.
|
|
@@ -9195,7 +9196,7 @@ Cross-browser compatibility
|
|
|
9195
9196
|
return null;
|
|
9196
9197
|
}
|
|
9197
9198
|
function registerBuildCommand(program) {
|
|
9198
|
-
program.command('build').arguments('[project-name]').usage('[path-to-remote-extension] [options]').description(commandDescriptions.build).option(`--browser <${BROWSER_TARGETS_HELP}>`, 'specify a browser/engine to run. Defaults to `chromium`. `safari` builds a Safari app via Xcode (macOS only)').option('--polyfill [boolean]', 'whether or not to apply the cross-browser polyfill. Defaults to `false`', parseOptionalBoolean).option('--no-polyfill', 'disable the cross-browser polyfill').option('--zip [boolean]', 'whether or not to compress the extension into a ZIP file. Defaults to `false`', parseOptionalBoolean).option('--zip-source [boolean]', 'whether or not to include the source files in the ZIP file. Defaults to `false`', parseOptionalBoolean).option('--zip-filename <string>', 'specify the name of the ZIP file. Defaults to the extension name and version').option('--silent [boolean]', 'suppress the build summary output. Defaults to `false`', parseOptionalBoolean).option('--install [boolean]', '[internal] install project dependencies when missing', parseOptionalBoolean).option('--extensions <list>', 'comma-separated list of companion extensions or store URLs to load').option('--mode <development|production|none>', 'bundler mode override (also sets NODE_ENV). Defaults to `production`').option('--open [boolean]', 'open the built Safari app after packaging (safari targets only). Defaults to `false`', parseOptionalBoolean).option('--app-name <name>', 'override the Safari app name (safari targets only). Defaults to the manifest `name`').option('--bundle-id <reverse.dns>', 'set a user-owned Safari bundle identifier (safari targets only). Defaults to a generated dev.extensionjs.* id').option('--development-team <id>', 'sign the Safari app with an Apple Developer team id (safari targets only). Without it the build is ad-hoc signed, which Safari treats as unsigned: the extension then needs Develop \u25b8 Allow Unsigned Extensions re-ticked on every launch. A signed build is listed and stays enabled across restarts').option('--macos-only [boolean]', 'generate a macOS-only Safari Xcode project (safari targets only). Pass `false` for a universal macOS + iOS project. Defaults to `true`', parseOptionalBoolean).option('--force-regenerate', 'regenerate the Safari Xcode project even when up to date (safari targets only)').option('--output <pretty|json>', 'result format. Use json for a schema-1 envelope on stdout').addOption(new external_commander_namespaceObject.Option('--debug', 'print maintainer diagnostics alongside normal output')).addOption(new external_commander_namespaceObject.Option('--author, --author-mode', 'deprecated alias for --debug').hideHelp()).action(async (pathOrRemoteUrl, { browser: cliBrowser, ...buildOptions })=>{
|
|
9199
|
+
program.command('build').arguments('[project-name]').usage('[path-to-remote-extension] [options]').description(commandDescriptions.build).option(`--browser <${BROWSER_TARGETS_HELP}>`, 'specify a browser/engine to run. Defaults to `chromium`. `safari` builds a Safari app via Xcode (macOS only)').option('--polyfill [boolean]', 'whether or not to apply the cross-browser polyfill. Defaults to `false`', parseOptionalBoolean).option('--no-polyfill', 'disable the cross-browser polyfill').option('--zip [boolean]', 'whether or not to compress the extension into a ZIP file. Defaults to `false`', parseOptionalBoolean).option('--zip-source [boolean]', 'whether or not to include the source files in the ZIP file. Defaults to `false`', parseOptionalBoolean).option('--zip-filename <string>', 'specify the name of the ZIP file. Defaults to the extension name and version').option('--silent [boolean]', 'suppress the build summary output. Defaults to `false`', parseOptionalBoolean).option('--addon-lint [boolean]', 'check Firefox builds against addons.mozilla.org rules with addons-linter when it is installed. Findings print as warnings. Defaults to `true`', parseOptionalBoolean).option('--no-addon-lint', 'skip the addons.mozilla.org lint of Firefox builds').option('--install [boolean]', '[internal] install project dependencies when missing', parseOptionalBoolean).option('--extensions <list>', 'comma-separated list of companion extensions or store URLs to load').option('--mode <development|production|none>', 'bundler mode override (also sets NODE_ENV). Defaults to `production`').option('--open [boolean]', 'open the built Safari app after packaging (safari targets only). Defaults to `false`', parseOptionalBoolean).option('--app-name <name>', 'override the Safari app name (safari targets only). Defaults to the manifest `name`').option('--bundle-id <reverse.dns>', 'set a user-owned Safari bundle identifier (safari targets only). Defaults to a generated dev.extensionjs.* id').option('--development-team <id>', 'sign the Safari app with an Apple Developer team id (safari targets only). Without it the build is ad-hoc signed, which Safari treats as unsigned: the extension then needs Develop \u25b8 Allow Unsigned Extensions re-ticked on every launch. A signed build is listed and stays enabled across restarts').option('--macos-only [boolean]', 'generate a macOS-only Safari Xcode project (safari targets only). Pass `false` for a universal macOS + iOS project. Defaults to `true`', parseOptionalBoolean).option('--force-regenerate', 'regenerate the Safari Xcode project even when up to date (safari targets only)').option('--output <pretty|json>', 'result format. Use json for a schema-1 envelope on stdout').addOption(new external_commander_namespaceObject.Option('--debug', 'print maintainer diagnostics alongside normal output')).addOption(new external_commander_namespaceObject.Option('--author, --author-mode', 'deprecated alias for --debug').hideHelp()).action(async (pathOrRemoteUrl, { browser: cliBrowser, ...buildOptions })=>{
|
|
9199
9200
|
const browser = cliBrowser ?? await resolveConfigBrowser(pathOrRemoteUrl || process.cwd(), 'build') ?? 'chromium';
|
|
9200
9201
|
if (buildOptions.debug || buildOptions.author || buildOptions.authorMode) {
|
|
9201
9202
|
process.env.EXTENSION_DEBUG = '1';
|
|
@@ -9273,6 +9274,7 @@ Cross-browser compatibility
|
|
|
9273
9274
|
zipSource: buildOptions.zipSource,
|
|
9274
9275
|
zipFilename: buildOptions.zipFilename,
|
|
9275
9276
|
silent: buildOptions.silent,
|
|
9277
|
+
addonLint: buildOptions.addonLint,
|
|
9276
9278
|
install: buildOptions.install,
|
|
9277
9279
|
extensions: parseExtensionsList(buildOptions.extensions),
|
|
9278
9280
|
mode,
|
|
@@ -89,6 +89,11 @@ export interface BuildCommandConfig {
|
|
|
89
89
|
zipSource?: boolean;
|
|
90
90
|
zipFilename?: string;
|
|
91
91
|
silent?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Run addons-linter over Firefox production builds and print its findings
|
|
94
|
+
* as warnings. Needs `addons-linter` installed. Defaults to `true`.
|
|
95
|
+
*/
|
|
96
|
+
addonLint?: boolean;
|
|
92
97
|
extensions?: CompanionExtensionsConfig;
|
|
93
98
|
transpilePackages?: string[];
|
|
94
99
|
perfBudgets?: PerfBudgetsConfig;
|
package/package.json
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"extension": "./bin/extension.cjs"
|
|
39
39
|
},
|
|
40
40
|
"name": "extension",
|
|
41
|
-
"version": "4.1.
|
|
41
|
+
"version": "4.1.18-canary.1789403792.e514b06c",
|
|
42
42
|
"description": "The cross-browser extension framework. Build Chrome, Edge, Firefox, and Safari extensions with no build configuration.",
|
|
43
43
|
"homepage": "https://extension.js.org/",
|
|
44
44
|
"bugs": {
|
|
@@ -106,9 +106,9 @@
|
|
|
106
106
|
"vivaldi-location2": "2.1.1",
|
|
107
107
|
"waterfox-location": "2.1.1",
|
|
108
108
|
"yandex-location": "2.1.1",
|
|
109
|
-
"extension-create": "4.1.
|
|
110
|
-
"extension-develop": "4.1.
|
|
111
|
-
"extension-install": "4.1.
|
|
109
|
+
"extension-create": "4.1.18-canary.1789403792.e514b06c",
|
|
110
|
+
"extension-develop": "4.1.18-canary.1789403792.e514b06c",
|
|
111
|
+
"extension-install": "4.1.18-canary.1789403792.e514b06c",
|
|
112
112
|
"commander": "^15.0.0",
|
|
113
113
|
"pintor": "0.3.0",
|
|
114
114
|
"semver": "^7.7.3",
|