extension-develop 2.0.0 → 2.0.1
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 +204 -0
- package/dist/add-content-script-wrapper.js +1777 -0
- package/dist/add-hmr-accept-code.js +95 -3
- package/dist/build.d.ts +2 -0
- package/dist/cleanup.d.ts +1 -0
- package/dist/deprecated-shadow-root.js +115 -14
- package/dist/dev.d.ts +2 -0
- package/dist/develop-lib/config-types.d.ts +85 -0
- package/dist/develop-lib/extract-from-zip.d.ts +1 -0
- package/dist/develop-lib/find-nearest-package.d.ts +2 -0
- package/dist/develop-lib/generate-extension-types.d.ts +1 -0
- package/dist/develop-lib/generate-zip.d.ts +2 -0
- package/dist/develop-lib/get-extension-config.d.ts +6 -0
- package/dist/develop-lib/get-project-path.d.ts +6 -0
- package/dist/develop-lib/install-dependencies.d.ts +2 -0
- package/dist/develop-lib/messages.d.ts +35 -0
- package/dist/develop-lib/validate-user-dependencies.d.ts +1 -0
- package/dist/ensure-hmr-for-scripts.js +74 -3
- package/dist/extensions/chrome-manager-extension/background.js +1 -1
- package/dist/extensions/chrome-manager-extension/images/logo.png +0 -0
- package/dist/extensions/chrome-manager-extension/manifest.json +3 -3
- package/dist/extensions/chrome-manager-extension/pages/welcome.html +3 -6
- package/dist/extensions/chrome-manager-extension/reload-service.js +214 -62
- package/dist/extensions/chromium-based-manager-extension/background.js +1 -1
- package/dist/extensions/chromium-based-manager-extension/images/logo.png +0 -0
- package/dist/extensions/chromium-based-manager-extension/manifest.json +3 -3
- package/dist/extensions/chromium-based-manager-extension/pages/welcome.html +3 -6
- package/dist/extensions/chromium-based-manager-extension/reload-service.js +185 -28
- package/dist/extensions/edge-manager-extension/background.js +1 -1
- package/dist/extensions/edge-manager-extension/images/logo.png +0 -0
- package/dist/extensions/edge-manager-extension/manifest.json +3 -3
- package/dist/extensions/edge-manager-extension/pages/welcome.html +3 -6
- package/dist/extensions/edge-manager-extension/reload-service.js +223 -69
- package/dist/extensions/firefox-manager-extension/background.js +40 -12
- package/dist/extensions/firefox-manager-extension/define-initial-tab.js +10 -12
- package/dist/extensions/firefox-manager-extension/images/logo.png +0 -0
- package/dist/extensions/firefox-manager-extension/manifest.json +4 -5
- package/dist/extensions/firefox-manager-extension/pages/welcome.html +3 -6
- package/dist/extensions/firefox-manager-extension/reload-service.js +113 -75
- package/dist/extensions/gecko-based-manager-extension/background.js +1 -1
- package/dist/extensions/gecko-based-manager-extension/define-initial-tab.js +7 -4
- package/dist/extensions/gecko-based-manager-extension/images/logo.png +0 -0
- package/dist/extensions/gecko-based-manager-extension/manifest.json +3 -3
- package/dist/extensions/gecko-based-manager-extension/pages/welcome.html +3 -6
- package/dist/extensions/gecko-based-manager-extension/reload-service.js +54 -26
- package/dist/inject-chromium-client-loader.js +144 -22
- package/dist/inject-firefox-client-loader.js +164 -47
- package/dist/minimum-chromium-file.js +25 -0
- package/dist/minimum-content-file.js +5 -0
- package/dist/minimum-firefox-file.js +17 -0
- package/dist/minimum-script-file.js +5 -0
- package/dist/module.d.ts +8 -95
- package/dist/module.js +10543 -128
- package/dist/preview.d.ts +2 -0
- package/dist/rslib.config.d.ts +3 -0
- package/dist/start.d.ts +2 -0
- package/dist/types.d.ts +11 -0
- package/dist/vitest.config.d.mts +2 -0
- package/dist/webpack/dev-server.d.ts +3 -0
- package/dist/webpack/plugin-browsers/browsers-lib/add-progress-bar.d.ts +1 -0
- package/dist/webpack/plugin-browsers/browsers-lib/constants.d.ts +5 -0
- package/dist/webpack/plugin-browsers/browsers-lib/dynamic-extension-manager.d.ts +35 -0
- package/dist/webpack/plugin-browsers/browsers-lib/html-merge.d.ts +1 -0
- package/dist/webpack/plugin-browsers/browsers-lib/instance-manager.d.ts +71 -0
- package/dist/webpack/plugin-browsers/browsers-lib/messages.d.ts +161 -0
- package/dist/webpack/plugin-browsers/browsers-lib/rdp-wire.d.ts +7 -0
- package/dist/webpack/plugin-browsers/browsers-lib/shared-utils.d.ts +16 -0
- package/dist/webpack/plugin-browsers/browsers-types.d.ts +131 -0
- package/dist/webpack/plugin-browsers/index.d.ts +41 -0
- package/dist/webpack/plugin-browsers/run-chromium/browser-config.d.ts +3 -0
- package/dist/webpack/plugin-browsers/run-chromium/create-profile.d.ts +10 -0
- package/dist/webpack/plugin-browsers/run-chromium/index.d.ts +28 -0
- package/dist/webpack/plugin-browsers/run-chromium/master-preferences.d.ts +161 -0
- package/dist/webpack/plugin-browsers/run-chromium/setup-chrome-inspection/cdp-client.d.ts +29 -0
- package/dist/webpack/plugin-browsers/run-chromium/setup-chrome-inspection/index.d.ts +25 -0
- package/dist/webpack/plugin-browsers/run-firefox/firefox/binary-detector.d.ts +15 -0
- package/dist/webpack/plugin-browsers/run-firefox/firefox/browser-config.d.ts +7 -0
- package/dist/webpack/plugin-browsers/run-firefox/firefox/create-profile.d.ts +13 -0
- package/dist/webpack/plugin-browsers/run-firefox/firefox/master-preferences.d.ts +95 -0
- package/dist/webpack/plugin-browsers/run-firefox/index.d.ts +26 -0
- package/dist/webpack/plugin-browsers/run-firefox/remote-firefox/index.d.ts +13 -0
- package/dist/webpack/plugin-browsers/run-firefox/remote-firefox/message-utils.d.ts +2 -0
- package/dist/webpack/plugin-browsers/run-firefox/remote-firefox/messaging-client.d.ts +42 -0
- package/dist/webpack/plugin-browsers/run-firefox/remote-firefox/setup-firefox-inspection.d.ts +31 -0
- package/dist/webpack/plugin-compatibility/feature-browser-specific-fields.d.ts +9 -0
- package/dist/webpack/plugin-compatibility/feature-polyfill.d.ts +12 -0
- package/dist/webpack/plugin-compatibility/index.d.ts +13 -0
- package/dist/webpack/plugin-compilation/clean-dist.d.ts +8 -0
- package/dist/webpack/plugin-compilation/env.d.ts +9 -0
- package/dist/webpack/plugin-compilation/index.d.ts +12 -0
- package/dist/webpack/plugin-css/common-style-loaders.d.ts +8 -0
- package/dist/webpack/plugin-css/css-in-content-script-loader.d.ts +11 -0
- package/dist/webpack/plugin-css/css-in-html-loader.d.ts +8 -0
- package/dist/webpack/plugin-css/css-tools/less.d.ts +4 -0
- package/dist/webpack/plugin-css/css-tools/postcss.d.ts +3 -0
- package/dist/webpack/plugin-css/css-tools/sass.d.ts +4 -0
- package/dist/webpack/plugin-css/css-tools/stylelint.d.ts +4 -0
- package/dist/webpack/plugin-css/css-tools/tailwind.d.ts +2 -0
- package/dist/webpack/plugin-css/index.d.ts +9 -0
- package/dist/webpack/plugin-css/is-content-script.d.ts +1 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/action.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/background.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/browser_action.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/chrome_url_overrides.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/devtools_page.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/index.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/options_ui.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/page_action.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/sandbox.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/side_panel.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/html-fields/sidebar_action.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/action.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/browser_action.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/browser_action.theme_icons.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/icons.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/index.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/normalize.d.ts +6 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/page_action.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/icons-fields/sidebar_action.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/index.d.ts +19 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/json-fields/declarative_net_request.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/json-fields/index.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/json-fields/storage.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/locales-fields/index.d.ts +1 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/normalize.d.ts +10 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/scripts-fields/background.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/scripts-fields/content_scripts.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/scripts-fields/index.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/scripts-fields/service_worker.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/scripts-fields/user_scripts.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/manifest-fields/web-resources-fields/index.d.ts +2 -0
- package/dist/webpack/plugin-extension/data/special-folders/generate-entries.d.ts +4 -0
- package/dist/webpack/plugin-extension/data/special-folders/index.d.ts +12 -0
- package/dist/webpack/plugin-extension/feature-html/__spec__/html-lib/test-utils.d.ts +18 -0
- package/dist/webpack/plugin-extension/feature-html/html-lib/parse-html.d.ts +8 -0
- package/dist/webpack/plugin-extension/feature-html/html-lib/patch-html.d.ts +8 -0
- package/dist/webpack/plugin-extension/feature-html/html-lib/utils.d.ts +18 -0
- package/dist/webpack/plugin-extension/feature-html/index.d.ts +37 -0
- package/dist/webpack/plugin-extension/feature-html/steps/add-assets-to-compilation.d.ts +11 -0
- package/dist/webpack/plugin-extension/feature-html/steps/add-scripts-and-styles-to-compilation.d.ts +10 -0
- package/dist/webpack/plugin-extension/feature-html/steps/add-to-file-dependencies.d.ts +10 -0
- package/dist/webpack/plugin-extension/feature-html/steps/emit-html-file.d.ts +9 -0
- package/dist/webpack/plugin-extension/feature-html/steps/ensure-hmr-for-scripts.d.ts +2 -0
- package/dist/webpack/plugin-extension/feature-html/steps/handle-common-errors.d.ts +10 -0
- package/dist/webpack/plugin-extension/feature-html/steps/minimum-script-file.d.ts +1 -0
- package/dist/webpack/plugin-extension/feature-html/steps/throw-if-recompile-is-needed.d.ts +13 -0
- package/dist/webpack/plugin-extension/feature-html/steps/update-html-file.d.ts +10 -0
- package/dist/webpack/plugin-extension/feature-icons/index.d.ts +25 -0
- package/dist/webpack/plugin-extension/feature-icons/steps/add-to-file-dependencies.d.ts +9 -0
- package/dist/webpack/plugin-extension/feature-icons/steps/emit-file.d.ts +9 -0
- package/dist/webpack/plugin-extension/feature-json/index.d.ts +18 -0
- package/dist/webpack/plugin-extension/feature-locales/get-locales.d.ts +1 -0
- package/dist/webpack/plugin-extension/feature-locales/index.d.ts +13 -0
- package/dist/webpack/plugin-extension/feature-manifest/index.d.ts +23 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/background.d.ts +10 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/chrome_url_overrides.d.ts +8 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/commands.d.ts +16 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/content_scripts.d.ts +7 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/content_security_policy.d.ts +4 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/devtools_page.d.ts +4 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/icons.d.ts +6 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/index.d.ts +2 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/omnibox.d.ts +2 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/options_page.d.ts +4 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/options_ui.d.ts +8 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/page_action.d.ts +8 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/permissions.d.ts +4 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/sandbox.d.ts +7 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/sidebar_action.d.ts +2 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/storage.d.ts +6 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/theme.d.ts +2 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/user_scripts.d.ts +2 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/common/web_accessible_resources.d.ts +9 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/index.d.ts +2 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/background.d.ts +10 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/browser_action.d.ts +12 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/chrome_settings_overrides.d.ts +24 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/index.d.ts +2 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/page_action.d.ts +1 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/sidebar_action.d.ts +1 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv2/theme_experiment.d.ts +2 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv3/action.d.ts +8 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv3/background.d.ts +10 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv3/declarative_net_request.d.ts +2 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv3/host_permissions.d.ts +2 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv3/index.d.ts +2 -0
- package/dist/webpack/plugin-extension/feature-manifest/manifest-overrides/mv3/side_panel.d.ts +2 -0
- package/dist/webpack/plugin-extension/feature-manifest/steps/add-dependencies.d.ts +6 -0
- package/dist/webpack/plugin-extension/feature-manifest/steps/check-manifest-files.d.ts +17 -0
- package/dist/webpack/plugin-extension/feature-manifest/steps/emit-manifest.d.ts +7 -0
- package/dist/webpack/plugin-extension/feature-manifest/steps/throw-if-recompile.d.ts +11 -0
- package/dist/webpack/plugin-extension/feature-manifest/steps/update-manifest.d.ts +9 -0
- package/dist/webpack/plugin-extension/feature-scripts/index.d.ts +27 -0
- package/dist/webpack/plugin-extension/feature-scripts/scripts-lib/utils.d.ts +3 -0
- package/dist/webpack/plugin-extension/feature-scripts/steps/add-content-script-wrapper.d.ts +2 -0
- package/dist/webpack/plugin-extension/feature-scripts/steps/add-hmr-accept-code.d.ts +2 -0
- package/dist/webpack/plugin-extension/feature-scripts/steps/add-public-path-for-main-world.d.ts +11 -0
- package/dist/webpack/plugin-extension/feature-scripts/steps/add-public-path-runtime-module.d.ts +4 -0
- package/dist/webpack/plugin-extension/feature-scripts/steps/add-scripts.d.ts +9 -0
- package/dist/webpack/plugin-extension/feature-scripts/steps/deprecated-shadow-root.d.ts +2 -0
- package/dist/webpack/plugin-extension/feature-scripts/steps/javascript-content-script-wrapper.d.ts +1 -0
- package/dist/webpack/plugin-extension/feature-scripts/steps/preact-content-script-wrapper.d.ts +1 -0
- package/dist/webpack/plugin-extension/feature-scripts/steps/react-content-script-wrapper.d.ts +1 -0
- package/dist/webpack/plugin-extension/feature-scripts/steps/svelte-content-script-wrapper.d.ts +1 -0
- package/dist/webpack/plugin-extension/feature-scripts/steps/typescript-content-script-wrapper.d.ts +1 -0
- package/dist/webpack/plugin-extension/feature-scripts/steps/vue-content-script-wrapper.d.ts +1 -0
- package/dist/webpack/plugin-extension/feature-special-folders/copy-public-folder.d.ts +14 -0
- package/dist/webpack/plugin-extension/feature-special-folders/index.d.ts +19 -0
- package/dist/webpack/plugin-extension/feature-special-folders/warn-upon-folder-changes.d.ts +7 -0
- package/dist/webpack/plugin-extension/feature-web-resources/clean-matches.d.ts +7 -0
- package/dist/webpack/plugin-extension/feature-web-resources/index.d.ts +18 -0
- package/dist/webpack/plugin-extension/index.d.ts +10 -0
- package/dist/webpack/plugin-js-frameworks/index.d.ts +13 -0
- package/dist/webpack/plugin-js-frameworks/js-tools/babel.d.ts +16 -0
- package/dist/webpack/plugin-js-frameworks/js-tools/preact.d.ts +3 -0
- package/dist/webpack/plugin-js-frameworks/js-tools/react.d.ts +3 -0
- package/dist/webpack/plugin-js-frameworks/js-tools/svelte.d.ts +3 -0
- package/dist/webpack/plugin-js-frameworks/js-tools/typescript.d.ts +36 -0
- package/dist/webpack/plugin-js-frameworks/js-tools/vue.d.ts +3 -0
- package/dist/webpack/plugin-js-frameworks/load-loader-options.d.ts +1 -0
- package/dist/webpack/plugin-reload/index.d.ts +13 -0
- package/dist/webpack/plugin-reload/reload-lib/messages.d.ts +106 -0
- package/dist/webpack/plugin-reload/reload-types.d.ts +14 -0
- package/dist/webpack/plugin-reload/start-server.d.ts +4 -0
- package/dist/webpack/plugin-reload/steps/create-web-socket-server/index.d.ts +14 -0
- package/dist/webpack/plugin-reload/steps/create-web-socket-server/web-socket-server/broadcast-message.d.ts +2 -0
- package/dist/webpack/plugin-reload/steps/create-web-socket-server/web-socket-server/message-dispatcher.d.ts +2 -0
- package/dist/webpack/plugin-reload/steps/create-web-socket-server/web-socket-server/servers.d.ts +2 -0
- package/dist/webpack/plugin-reload/steps/setup-chromium-reload-client/index.d.ts +3 -0
- package/dist/webpack/plugin-reload/steps/setup-chromium-reload-client/inject-chromium-client-loader.d.ts +9 -0
- package/dist/webpack/plugin-reload/steps/setup-chromium-reload-client/minimum-chromium-file.d.ts +0 -0
- package/dist/webpack/plugin-reload/steps/setup-firefox-reload-client/index.d.ts +3 -0
- package/dist/webpack/plugin-reload/steps/setup-firefox-reload-client/inject-firefox-client-loader.d.ts +9 -0
- package/dist/webpack/plugin-reload/steps/setup-firefox-reload-client/minimum-firefox-file.d.ts +0 -0
- package/dist/webpack/plugin-reload/steps/setup-reload-strategy/apply-manifest-dev-defaults/index.d.ts +9 -0
- package/dist/webpack/plugin-reload/steps/setup-reload-strategy/apply-manifest-dev-defaults/patch-background.d.ts +15 -0
- package/dist/webpack/plugin-reload/steps/setup-reload-strategy/apply-manifest-dev-defaults/patch-csp.d.ts +5 -0
- package/dist/webpack/plugin-reload/steps/setup-reload-strategy/apply-manifest-dev-defaults/patch-externally-connectable.d.ts +10 -0
- package/dist/webpack/plugin-reload/steps/setup-reload-strategy/apply-manifest-dev-defaults/patch-web-resources.d.ts +10 -0
- package/dist/webpack/plugin-reload/steps/setup-reload-strategy/generate-manager-extension.d.ts +15 -0
- package/dist/webpack/plugin-reload/steps/setup-reload-strategy/index.d.ts +10 -0
- package/dist/webpack/plugin-reload/steps/setup-reload-strategy/target-web-extension-plugin/index.d.ts +13 -0
- package/dist/webpack/plugin-static-assets/index.d.ts +12 -0
- package/dist/webpack/webpack-config.d.ts +14 -0
- package/dist/webpack/webpack-lib/auto-exit.d.ts +1 -0
- package/dist/webpack/webpack-lib/constants.d.ts +4 -0
- package/dist/webpack/webpack-lib/messages.d.ts +121 -0
- package/dist/webpack/webpack-lib/port-manager.d.ts +27 -0
- package/dist/webpack/webpack-lib/utils.d.ts +20 -0
- package/dist/webpack/webpack-types.d.ts +49 -0
- package/package.json +64 -29
- package/dist/depreacated-shadow-root.js +0 -34
- package/dist/inject-content-css-during-dev.js +0 -10
- package/dist/minimum-chromium-file.mjs +0 -1
- package/dist/minimum-content-file.mjs +0 -1
- package/dist/minimum-firefox-file.mjs +0 -1
- package/dist/resolver-loader.js +0 -1
- package/dist/resolver-module.mjs +0 -1
- package/dist/tailwind.config.js +0 -25
- /package/dist/{minimum-script-file.mjs → webpack/plugin-extension/feature-scripts/steps/minimum-content-file.d.ts} +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
[npm-version-image]: https://img.shields.io/npm/v/extension-develop.svg?color=0971fe
|
|
2
|
+
[npm-version-url]: https://www.npmjs.com/package/extension-develop
|
|
3
|
+
[downloads-image]: https://img.shields.io/npm/dm/extension-develop.svg?color=2ecc40
|
|
4
|
+
[downloads-url]: https://npmjs.org/package/extension-develop
|
|
5
|
+
[empowering-image]: https://img.shields.io/badge/Empowering-Extension.js-0971fe
|
|
6
|
+
[empowering-url]: https://extension.js.org
|
|
7
|
+
|
|
8
|
+
[![Empowering][empowering-image]][empowering-url] [![Version][npm-version-image]][npm-version-url] [![Downloads][downloads-image]][downloads-url]
|
|
9
|
+
|
|
10
|
+
# extension-develop
|
|
11
|
+
|
|
12
|
+
> Develop, build, preview, and package [Extension.js](https://extension.js.org) projects.
|
|
13
|
+
|
|
14
|
+
This package powers Extension.js during local development and production builds. It provides the commands and build plugins that compile your extension, run it in browsers, and produce distributable artifacts.
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
pnpm add extension-develop
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import {
|
|
26
|
+
extensionDev,
|
|
27
|
+
extensionBuild,
|
|
28
|
+
extensionStart,
|
|
29
|
+
extensionPreview,
|
|
30
|
+
cleanupCommand,
|
|
31
|
+
type DevOptions,
|
|
32
|
+
type BuildOptions,
|
|
33
|
+
type StartOptions,
|
|
34
|
+
type PreviewOptions
|
|
35
|
+
} from 'extension-develop'
|
|
36
|
+
|
|
37
|
+
async function run() {
|
|
38
|
+
// Development server
|
|
39
|
+
await extensionDev(undefined, {
|
|
40
|
+
browser: 'chrome',
|
|
41
|
+
open: true
|
|
42
|
+
} satisfies DevOptions)
|
|
43
|
+
|
|
44
|
+
// Production build + zip
|
|
45
|
+
await extensionBuild(undefined, {
|
|
46
|
+
browser: 'firefox',
|
|
47
|
+
zip: true
|
|
48
|
+
} satisfies BuildOptions)
|
|
49
|
+
|
|
50
|
+
// Build then preview from dist/<browser>
|
|
51
|
+
await extensionStart(undefined, {browser: 'edge'} satisfies StartOptions)
|
|
52
|
+
|
|
53
|
+
// Preview using an existing output folder or project path
|
|
54
|
+
await extensionPreview(undefined, {
|
|
55
|
+
browser: 'chrome',
|
|
56
|
+
mode: 'production'
|
|
57
|
+
} satisfies PreviewOptions)
|
|
58
|
+
|
|
59
|
+
// Cleanup orphaned browser instances
|
|
60
|
+
await cleanupCommand()
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
run()
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Features
|
|
67
|
+
|
|
68
|
+
- Live reload/HMR development server with per-instance browser runners
|
|
69
|
+
- Cross-browser support: Chrome, Edge, Firefox, Chromium-based, Gecko-based
|
|
70
|
+
- Rspack-based build with opinionated plugin stack
|
|
71
|
+
- Clean production output in `dist/<browser>`
|
|
72
|
+
- Zipping: distribution and/or source packages (respects `.gitignore`)
|
|
73
|
+
- Auto-install of missing dependencies and package manager detection
|
|
74
|
+
- Type generation for TS projects via `extension-env.d.ts`
|
|
75
|
+
- User config via `extension.config.(js|mjs)` for commands, browser launch, and webpack config hooks
|
|
76
|
+
- Managed dependency guard to avoid conflicts
|
|
77
|
+
|
|
78
|
+
## Commands
|
|
79
|
+
|
|
80
|
+
| Name | Summary |
|
|
81
|
+
| ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
82
|
+
| dev | - Starts a local development server with live reload/HMR<br/>- Auto-installs dependencies if missing<br/>- Generates TypeScript shim types (`extension-env.d.ts`) when applicable<br/>- Launches a target browser with an isolated/stable profile |
|
|
83
|
+
| build | - Production build using the webpack/Rspack plugin stack<br/>- Cleans `dist/<browser>` before emitting<br/>- Optional packaging: distribution zip and/or source zip<br/>- Merges user config; excludes browser runners during compilation |
|
|
84
|
+
| start | - Runs a silent production build, then launches preview from `dist/<browser>`<br/>- Mirrors the runtime environment of shipped output |
|
|
85
|
+
| preview | - Launches the extension for manual testing without dev server<br/>- Uses `dist/<browser>` when present, otherwise uses the project directory<br/>- Preserves production settings; only browser runners are applied |
|
|
86
|
+
| cleanup | - Removes orphaned browser instances and temporary profiles created during development |
|
|
87
|
+
|
|
88
|
+
## Command options
|
|
89
|
+
|
|
90
|
+
Options accepted by each command. Values shown are typical types or enumerations; see the tables for specifics.
|
|
91
|
+
|
|
92
|
+
### Common (browser/runtime)
|
|
93
|
+
|
|
94
|
+
| Option | Type / Values | Description |
|
|
95
|
+
| -------------- | -------------------------------------------------- | ------------------------------------------- |
|
|
96
|
+
| browser | chrome, edge, firefox, chromium-based, gecko-based | Target browser/runtime |
|
|
97
|
+
| profile | string or false | Profile path or disable profile persistence |
|
|
98
|
+
| startingUrl | string | Initial URL to open |
|
|
99
|
+
| open | boolean | Focus/open the browser window |
|
|
100
|
+
| chromiumBinary | string | Custom Chromium-based executable path |
|
|
101
|
+
| geckoBinary | string | Custom Gecko-based executable path |
|
|
102
|
+
|
|
103
|
+
### dev
|
|
104
|
+
|
|
105
|
+
| Option | Type / Values | Description |
|
|
106
|
+
| ----------- | ----------------------------- | --------------------------------------------- |
|
|
107
|
+
| mode | development, production, none | Build mode |
|
|
108
|
+
| polyfill | boolean | Include `webextension-polyfill` when possible |
|
|
109
|
+
| port | number or string | Dev server port |
|
|
110
|
+
| source | string | Inspect a source directory |
|
|
111
|
+
| watchSource | boolean | Watch the source directory |
|
|
112
|
+
|
|
113
|
+
### build
|
|
114
|
+
|
|
115
|
+
| Option | Type / Values | Description |
|
|
116
|
+
| ----------- | ------------- | -------------------------------------------------------------- |
|
|
117
|
+
| zip | boolean | Package `dist/<browser>` as an artifact (e.g., `.zip`, `.xpi`) |
|
|
118
|
+
| zipSource | boolean | Package source files (respects `.gitignore`) |
|
|
119
|
+
| zipFilename | string | Custom base name for artifacts |
|
|
120
|
+
| polyfill | boolean | Include `webextension-polyfill` when possible |
|
|
121
|
+
| silent | boolean | Suppress non-error logs |
|
|
122
|
+
|
|
123
|
+
### start
|
|
124
|
+
|
|
125
|
+
| Option | Type / Values | Description |
|
|
126
|
+
| -------- | ------------- | --------------------------------------------- |
|
|
127
|
+
| mode | `production` | Build mode |
|
|
128
|
+
| polyfill | boolean | Include `webextension-polyfill` when possible |
|
|
129
|
+
|
|
130
|
+
### preview
|
|
131
|
+
|
|
132
|
+
| Option | Type / Values | Description |
|
|
133
|
+
| ---------- | ------------- | ------------------------------------------------------------------- |
|
|
134
|
+
| mode | `production` | Build mode |
|
|
135
|
+
| outputPath | string | Directory to run from (defaults to `dist/<browser>` when available) |
|
|
136
|
+
|
|
137
|
+
## Project detection and inputs
|
|
138
|
+
|
|
139
|
+
- Path or remote: Commands accept a local path or a remote URL.
|
|
140
|
+
- GitHub repo URL: downloaded via `go-git-it` into a subfolder named after the repository.
|
|
141
|
+
- Other HTTP(S) URLs: treated as zip archives and extracted locally.
|
|
142
|
+
- Monorepos: The nearest `manifest.json` is resolved recursively; the nearest valid `package.json` is then located and validated.
|
|
143
|
+
|
|
144
|
+
## User config
|
|
145
|
+
|
|
146
|
+
- Provide `extension.config.js` or `extension.config.mjs` in your project root.
|
|
147
|
+
- Supported sections:
|
|
148
|
+
- config(config: Configuration): mutate the assembled Rspack config.
|
|
149
|
+
- commands.dev | .build | .start | .preview: per-command options (browser, profile, binaries, flags, preferences, packaging).
|
|
150
|
+
- browser.chrome | .firefox | .edge | .chromium-based | .gecko-based: launch flags, excluded flags, preferences, binaries, and profile reuse.
|
|
151
|
+
- When detected, a one‑time notice is printed to indicate config is active.
|
|
152
|
+
|
|
153
|
+
## Safety and ergonomics
|
|
154
|
+
|
|
155
|
+
- Managed dependency guard: If your `extension.config.*` references dependencies that are managed by Extension.js itself, the command aborts with a detailed message to prevent version conflicts.
|
|
156
|
+
- Auto‑install: If `node_modules` is missing, the appropriate package manager is detected and dependencies are installed before running.
|
|
157
|
+
- Type generation: For TypeScript projects, `extension-env.d.ts` is generated/updated to include required types and polyfills.
|
|
158
|
+
|
|
159
|
+
## Packaging outputs
|
|
160
|
+
|
|
161
|
+
- Distribution artifacts live under `dist/<browser>/` and source artifacts under `dist/`.
|
|
162
|
+
- File names default to a sanitized form of `manifest.name` plus `manifest.version` (override with `zipFilename`).
|
|
163
|
+
- Source packaging respects `.gitignore`.
|
|
164
|
+
|
|
165
|
+
Example layout when both `zip` and `zipSource` are enabled:
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
dist/
|
|
169
|
+
chrome/
|
|
170
|
+
<name>-<version>.zip
|
|
171
|
+
<name>-<version>-source.zip
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Notes and compatibility
|
|
175
|
+
|
|
176
|
+
- Built on the same Rspack stack as `@/webpack`; user config is loaded when an `extension.config.*` is present.
|
|
177
|
+
- Only `EXTENSION_PUBLIC_*` variables are injected into client code; avoid secrets in templated `.json`/`.html`.
|
|
178
|
+
|
|
179
|
+
## Plugins
|
|
180
|
+
|
|
181
|
+
| Name | Group | Summary |
|
|
182
|
+
| -------------------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
183
|
+
| plugin-extension | core | - Core builder: emits pages and scripts<br/>- Validates and rewrites `manifest.json`<br/>- Ships icons, JSON, locales, and web resources<br/>- Ensures dev parity between local and shipped output |
|
|
184
|
+
| plugin-css | core | - Auto‑wires CSS for HTML and content scripts<br/>- Optional SASS/LESS/PostCSS when configs exist<br/>- Integrates Stylelint when configured |
|
|
185
|
+
| plugin-js-frameworks | core | - Detects React/Preact/Vue/Svelte and TypeScript<br/>- Configures SWC parsing, loaders/plugins, and safe aliases<br/>- Sets `tsconfig` resolution<br/>- Defers heavy work to `beforeRun` in production |
|
|
186
|
+
| plugin-static-assets | core | - Emits images, fonts, and misc files to `assets/`<br/>- Inlines small SVGs (≤2KB), emits larger ones<br/>- Content hashing in production; stable names in development<br/>- Respects existing custom SVG rules |
|
|
187
|
+
| plugin-compatibility | core | - Cross‑browser helpers<br/>- Normalizes browser‑specific manifest fields<br/>- Optional `webextension-polyfill` for Chromium |
|
|
188
|
+
| plugin-compilation | core | - Loads env and templating (`EXTENSION_PUBLIC_*`)<br/>- Optional `dist/<browser>` cleaning<br/>- Compact, de‑duplicated compilation summary |
|
|
189
|
+
| plugin-reload | core | - Dev‑time live reload/HMR orchestration<br/>- Per‑instance WebSocket server<br/>- Manifest dev overrides<br/>- Full recompiles on HTML entry changes |
|
|
190
|
+
|
|
191
|
+
## Notes and compatibility
|
|
192
|
+
|
|
193
|
+
- Built against `@rspack/core`; Webpack 5 may work for some plugins but is not officially supported here.
|
|
194
|
+
- Only `EXTENSION_PUBLIC_*` variables are injected into client code; avoid embedding secrets in templated `.json`/`.html`.
|
|
195
|
+
|
|
196
|
+
## Related files in this folder
|
|
197
|
+
|
|
198
|
+
- `webpack/webpack-config.ts`: Assembles the plugin stack and shared configuration.
|
|
199
|
+
- `webpack/dev-server.ts`: Local development server wiring and reload orchestration.
|
|
200
|
+
- `webpack/webpack-types.ts`: Common types for the plugin stack.
|
|
201
|
+
|
|
202
|
+
## License
|
|
203
|
+
|
|
204
|
+
MIT (c) Cezar Augusto and the Extension.js Authors.
|