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
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type LoaderContext } from '@rspack/core';
|
|
2
|
+
interface InjectFirefoxClientContext extends LoaderContext<any> {
|
|
3
|
+
getOptions: () => {
|
|
4
|
+
manifestPath: string;
|
|
5
|
+
browser: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export default function (this: InjectFirefoxClientContext, source: string): string;
|
|
9
|
+
export {};
|
package/dist/webpack/plugin-reload/steps/setup-firefox-reload-client/minimum-firefox-file.d.ts
ADDED
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Compiler } from '@rspack/core';
|
|
2
|
+
import { type PluginInterface } from '../../../reload-types';
|
|
3
|
+
export declare class ApplyManifestDevDefaults {
|
|
4
|
+
private readonly manifestPath?;
|
|
5
|
+
private readonly browser;
|
|
6
|
+
constructor(options: PluginInterface);
|
|
7
|
+
private generateManifestPatches;
|
|
8
|
+
apply(compiler: Compiler): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DevOptions } from '../../../../../module';
|
|
2
|
+
import { Manifest } from '../../../../webpack-types';
|
|
3
|
+
export default function patchBackground(manifest: Manifest, browser: DevOptions['browser']): {
|
|
4
|
+
background: {
|
|
5
|
+
scripts: string[];
|
|
6
|
+
};
|
|
7
|
+
} | {
|
|
8
|
+
background: {
|
|
9
|
+
scripts?: string[] | undefined;
|
|
10
|
+
page?: string | undefined;
|
|
11
|
+
persistent?: boolean | undefined;
|
|
12
|
+
service_worker: string;
|
|
13
|
+
type?: "module";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Manifest } from '../../../../webpack-types';
|
|
2
|
+
export default function patchExternallyConnectable(manifest: Manifest): {
|
|
3
|
+
externally_connectable: {
|
|
4
|
+
ids: string[];
|
|
5
|
+
matches?: string[] | undefined;
|
|
6
|
+
accepts_tls_channel_id?: boolean | undefined;
|
|
7
|
+
};
|
|
8
|
+
} | {
|
|
9
|
+
externally_connectable?: undefined;
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Manifest } from '../../../../../types';
|
|
2
|
+
declare function patchWebResourcesV2(manifest: Manifest): string[];
|
|
3
|
+
declare function patchWebResourcesV3(manifest: Manifest): ((string & {
|
|
4
|
+
resources: string[];
|
|
5
|
+
matches: string[];
|
|
6
|
+
}) | {
|
|
7
|
+
resources: string[];
|
|
8
|
+
matches: string[];
|
|
9
|
+
})[];
|
|
10
|
+
export { patchWebResourcesV2, patchWebResourcesV3 };
|
package/dist/webpack/plugin-reload/steps/setup-reload-strategy/generate-manager-extension.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Compiler } from '@rspack/core';
|
|
2
|
+
import { type PluginInterface } from '../../reload-types';
|
|
3
|
+
export declare class GenerateManagerExtension {
|
|
4
|
+
private readonly browser;
|
|
5
|
+
private readonly EXTENSION_SOURCE_DIR;
|
|
6
|
+
private readonly EXTENSION_OUTPUT_DIR;
|
|
7
|
+
private readonly EXTENSIONS_DIR;
|
|
8
|
+
private readonly port;
|
|
9
|
+
constructor(options: PluginInterface);
|
|
10
|
+
private copyRecursively;
|
|
11
|
+
private copyExtensionFiles;
|
|
12
|
+
private getPortForBrowser;
|
|
13
|
+
private updateReloadServicePort;
|
|
14
|
+
apply(compiler: Compiler): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Compiler } from '@rspack/core';
|
|
2
|
+
import { type PluginInterface } from '../../reload-types';
|
|
3
|
+
declare class SetupReloadStrategy {
|
|
4
|
+
private readonly manifestPath;
|
|
5
|
+
private readonly browser;
|
|
6
|
+
private readonly port;
|
|
7
|
+
constructor(options: PluginInterface);
|
|
8
|
+
apply(compiler: Compiler): void;
|
|
9
|
+
}
|
|
10
|
+
export default SetupReloadStrategy;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Compiler } from '@rspack/core';
|
|
2
|
+
import { type PluginInterface } from '../../../reload-types';
|
|
3
|
+
export declare class TargetWebExtensionPlugin {
|
|
4
|
+
private readonly manifestPath;
|
|
5
|
+
private readonly browser;
|
|
6
|
+
constructor(options: PluginInterface);
|
|
7
|
+
private handleBackground;
|
|
8
|
+
private ensureFileExists;
|
|
9
|
+
private addDefaultEntry;
|
|
10
|
+
private getEntryName;
|
|
11
|
+
private convertToWebpackCompiler;
|
|
12
|
+
apply(compiler: Compiler): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Compiler } from '@rspack/core';
|
|
2
|
+
import { PluginInterface } from '../webpack-types';
|
|
3
|
+
import { type DevOptions } from '../../develop-lib/config-types';
|
|
4
|
+
export declare class StaticAssetsPlugin {
|
|
5
|
+
static readonly name: string;
|
|
6
|
+
readonly manifestPath: string;
|
|
7
|
+
readonly mode: DevOptions['mode'];
|
|
8
|
+
constructor(options: PluginInterface & {
|
|
9
|
+
mode: DevOptions['mode'];
|
|
10
|
+
});
|
|
11
|
+
apply(compiler: Compiler): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Configuration } from '@rspack/core';
|
|
2
|
+
import { DevOptions } from '../develop-lib/config-types';
|
|
3
|
+
import { type ProjectStructure } from '../develop-lib/get-project-path';
|
|
4
|
+
export default function webpackConfig(projectStructure: ProjectStructure, devOptions: DevOptions & {
|
|
5
|
+
preferences?: Record<string, unknown>;
|
|
6
|
+
browserFlags?: string[];
|
|
7
|
+
} & {
|
|
8
|
+
output: {
|
|
9
|
+
clean: boolean;
|
|
10
|
+
path: string;
|
|
11
|
+
};
|
|
12
|
+
} & {
|
|
13
|
+
instanceId?: string;
|
|
14
|
+
}): Configuration;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function setupAutoExit(autoExitMsRaw: string | number | undefined, forceKillMsRaw: string | number | undefined, onCleanup: () => Promise<void>): () => void;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { Stats } from '@rspack/core';
|
|
2
|
+
import { Manifest } from '../webpack-types';
|
|
3
|
+
import { DevOptions } from '../../develop-lib/config-types';
|
|
4
|
+
export declare function capitalize(browser: DevOptions['browser']): string;
|
|
5
|
+
export declare function boring(manifestName: string, duration: number, stats: Stats): string | undefined;
|
|
6
|
+
export declare function integrationNotInstalled(integration: string, packageManager: string): string;
|
|
7
|
+
export declare function envFileLoaded(): string;
|
|
8
|
+
export declare function isUsingIntegration(integration: any): string;
|
|
9
|
+
export declare function youAreAllSet(integration: string): string;
|
|
10
|
+
export declare function installingRootDependencies(integration: string): string;
|
|
11
|
+
export declare function integrationInstalledSuccessfully(integration: string): string;
|
|
12
|
+
export declare function failedToInstallIntegration(integration: string, error: unknown): string;
|
|
13
|
+
export declare function firefoxServiceWorkerError(): string;
|
|
14
|
+
export declare function insecurePolicy(): string;
|
|
15
|
+
export declare function noDefaultLocaleError(): string;
|
|
16
|
+
export declare function webAccessibleResourcesV2Type(browser: DevOptions['browser']): string;
|
|
17
|
+
export declare function webAccessibleResourcesV3Type(browser: DevOptions['browser']): string;
|
|
18
|
+
export declare function deprecatedMessage(browser: DevOptions['browser'], errorData: any): string;
|
|
19
|
+
export declare function invalidFieldType(errorData: any, browser: DevOptions['browser']): string;
|
|
20
|
+
export declare function missingRequiredMessage(browser: DevOptions['browser'], message: string | undefined): string;
|
|
21
|
+
export declare function handleMultipleAssetsError(manifestName: string, filename: string): string | undefined;
|
|
22
|
+
export declare function handleCantResolveError(manifestName: string, moduleName: string): string;
|
|
23
|
+
export declare function handleTopLevelAwaitError(manifestName: string): string;
|
|
24
|
+
export declare function fileNotFound(errorSourcePath: string | undefined, missingFilePath: string): string;
|
|
25
|
+
export declare function manifestFieldError(manifestName: string, manifestField: string, filePath: string): string;
|
|
26
|
+
export declare function entryNotFoundWarn(manifestField: string, filePath: string): string;
|
|
27
|
+
export declare function manifestInvalidError(error: NodeJS.ErrnoException): string;
|
|
28
|
+
export declare function serverRestartRequiredFromManifestError(fileAdded: string, fileRemoved: string): string;
|
|
29
|
+
export declare function resolverHtmlError(manifestName: string, filePath: string): string;
|
|
30
|
+
export declare function resolverJsError(manifestName: string, filePath: string): string;
|
|
31
|
+
export declare function resolverStaticError(manifestName: string, filePath: string): string;
|
|
32
|
+
export declare function serverRestartRequiredFromSpecialFolderError(addingOrRemoving: string, folder: string, typeOfAsset: string, pathRelative: string): string;
|
|
33
|
+
export declare function manifestNotFoundError(manifestName: string, manifestPath: string): string;
|
|
34
|
+
export declare function creatingTSConfig(): string;
|
|
35
|
+
export declare function serverIsRunning(useHttps: boolean, port: number): string;
|
|
36
|
+
export interface MessageData {
|
|
37
|
+
id: string;
|
|
38
|
+
manifest: Manifest;
|
|
39
|
+
management: chrome.management.ExtensionInfo;
|
|
40
|
+
}
|
|
41
|
+
export declare function isFirstRun(browser: DevOptions['browser']): string;
|
|
42
|
+
export declare function webSocketError(error: any): string;
|
|
43
|
+
export declare function backgroundIsRequired(backgroundChunkName: string, filePath: string): string;
|
|
44
|
+
export declare function serverRestartRequiredFromHtml(filePath: string): string;
|
|
45
|
+
export declare function javaScriptError(errorSourcePath: string, missingFilePath: string): string;
|
|
46
|
+
export declare function cssError(errorSourcePath: string, missingFilePath: string): string;
|
|
47
|
+
export declare function staticAssetError(errorSourcePath: string, missingFilePath: string): string;
|
|
48
|
+
export declare function certRequired(): string;
|
|
49
|
+
export declare function defaultPortInUse(port: number): string;
|
|
50
|
+
export declare function portInUse(requestedPort: number, newPort: number): string;
|
|
51
|
+
export declare function noExtensionIdError(): string;
|
|
52
|
+
export declare function deprecatedShadowRoot(): string;
|
|
53
|
+
export declare function isUsingCustomLoader(file: string): string;
|
|
54
|
+
export declare function webextensionPolyfillNotFound(): string;
|
|
55
|
+
export declare function registrySaved(registryPath: string): string;
|
|
56
|
+
export declare function registrySaveError(error: unknown): string;
|
|
57
|
+
export declare function smartPortAllocationExistingPorts(usedPorts: number[]): string;
|
|
58
|
+
export declare function smartPortAllocationExistingWebSocketPorts(usedWebSocketPorts: number[]): string;
|
|
59
|
+
export declare function smartPortAllocationUsingRequestedPort(port: number, webSocketPort: number): string;
|
|
60
|
+
export declare function smartPortAllocationRequestedPortUnavailable(port: number): string;
|
|
61
|
+
export declare function smartPortAllocationAllocatedPorts(port: number, webSocketPort: number): string;
|
|
62
|
+
export declare function instanceManagerCreateInstanceCalled(params: any): string;
|
|
63
|
+
export declare function instanceManagerRegistryAfterCreateInstance(registry: any): string;
|
|
64
|
+
export declare function extensionManagerInstanceInitialized(instanceId: string, webSocketPort: number): string;
|
|
65
|
+
export declare function extensionManagerCopyFilesWarning(error: unknown): string;
|
|
66
|
+
export declare function extensionManagerInstanceNotFoundWarning(instanceId: string): string;
|
|
67
|
+
export declare function extensionManagerCleanupWarning(error: unknown): string;
|
|
68
|
+
export declare function firefoxDetectedFlatpak(): string;
|
|
69
|
+
export declare function firefoxDetectedSnap(): string;
|
|
70
|
+
export declare function firefoxDetectedTraditional(firefoxPath: string): string;
|
|
71
|
+
export declare function firefoxDetectedCustom(firefoxPath: string): string;
|
|
72
|
+
export declare function firefoxUsingFlatpakWithSandbox(): string;
|
|
73
|
+
export declare function firefoxVersion(version: string): string;
|
|
74
|
+
export declare function webSocketServerNotRunning(): string;
|
|
75
|
+
export declare function webSocketConnectionCloseError(error: unknown): string;
|
|
76
|
+
export declare function portManagerErrorAllocatingPorts(error: unknown): string;
|
|
77
|
+
export declare function browserPluginFailedToLoad(browser: string, error: unknown): string;
|
|
78
|
+
export declare function sharedUtilsWarning(message: string): string;
|
|
79
|
+
export declare function extensionJsRunnerError(error: unknown): string;
|
|
80
|
+
export declare function extensionJsRunnerCleanupError(error: unknown): string;
|
|
81
|
+
export declare function extensionJsRunnerUncaughtException(error: unknown): string;
|
|
82
|
+
export declare function extensionJsRunnerUnhandledRejection(promise: Promise<any>, reason: unknown): string;
|
|
83
|
+
export declare function emptyLine(): string;
|
|
84
|
+
export declare function configLoadingError(configType: string, error: unknown): string;
|
|
85
|
+
export declare function autoExitModeEnabled(ms: number): string;
|
|
86
|
+
export declare function autoExitTriggered(ms: number): string;
|
|
87
|
+
export declare function autoExitForceKill(ms: number): string;
|
|
88
|
+
export declare function reloadClientForcingExtensionReload(timestamp: string): string;
|
|
89
|
+
export declare function reloadClientFailedToReloadExtension(error: unknown): string;
|
|
90
|
+
export declare function reloadClientBackgroundScriptLoaded(cacheBuster: string): string;
|
|
91
|
+
export declare function reloadClientBackgroundScriptStale(): string;
|
|
92
|
+
export declare function firefoxReloadClientReloadingExtension(changedFile: string): string;
|
|
93
|
+
export declare function firefoxReloadClientForcingExtensionReload(timestamp: string): string;
|
|
94
|
+
export declare function firefoxReloadClientFailedToReloadExtension(error: unknown): string;
|
|
95
|
+
export declare function firefoxReloadClientBackgroundScriptLoaded(cacheBuster: string): string;
|
|
96
|
+
export declare function firefoxReloadClientBackgroundScriptStale(): string;
|
|
97
|
+
export declare function enhancedProcessManagementStarting(browser: DevOptions['browser']): string;
|
|
98
|
+
export declare function enhancedProcessManagementCleanup(browser: DevOptions['browser']): string;
|
|
99
|
+
export declare function enhancedProcessManagementTerminating(browser: DevOptions['browser']): string;
|
|
100
|
+
export declare function enhancedProcessManagementForceKill(browser: DevOptions['browser']): string;
|
|
101
|
+
export declare function enhancedProcessManagementCleanupError(browser: DevOptions['browser'], error: unknown): string;
|
|
102
|
+
export declare function enhancedProcessManagementInstanceCleanup(browser: DevOptions['browser']): string;
|
|
103
|
+
export declare function enhancedProcessManagementInstanceCleanupComplete(browser: DevOptions['browser']): string;
|
|
104
|
+
export declare function enhancedProcessManagementSignalHandling(browser: DevOptions['browser']): string;
|
|
105
|
+
export declare function enhancedProcessManagementUncaughtException(browser: DevOptions['browser'], error: unknown): string;
|
|
106
|
+
export declare function enhancedProcessManagementUnhandledRejection(browser: DevOptions['browser'], reason: unknown): string;
|
|
107
|
+
export declare function instanceManagerHealthMonitoringStart(instanceId: string): string;
|
|
108
|
+
export declare function instanceManagerHealthMonitoringPassed(instanceId: string): string;
|
|
109
|
+
export declare function instanceManagerHealthMonitoringOrphaned(instanceId: string): string;
|
|
110
|
+
export declare function instanceManagerHealthMonitoringFailed(instanceId: string, error: unknown): string;
|
|
111
|
+
export declare function instanceManagerForceCleanupProject(projectPath: string): string;
|
|
112
|
+
export declare function instanceManagerForceCleanupFound(instanceCount: number): string;
|
|
113
|
+
export declare function instanceManagerForceCleanupInstance(instanceId: string): string;
|
|
114
|
+
export declare function instanceManagerForceCleanupTerminating(processId: number): string;
|
|
115
|
+
export declare function instanceManagerForceCleanupForceKilled(processId: number): string;
|
|
116
|
+
export declare function instanceManagerForceCleanupInstanceTerminated(instanceId: string): string;
|
|
117
|
+
export declare function instanceManagerForceCleanupError(instanceId: string, error: unknown): string;
|
|
118
|
+
export declare function instanceManagerForceCleanupComplete(): string;
|
|
119
|
+
export declare function instanceManagerProcessNoLongerRunning(instanceId: string, processId: number): string;
|
|
120
|
+
export declare function instanceManagerPortsNotInUse(instanceId: string, port: number, webSocketPort: number): string;
|
|
121
|
+
export declare function instanceManagerCleanedUpOrphanedInstance(instanceId: string): string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DevOptions } from '../../develop-lib/config-types';
|
|
2
|
+
import { InstanceManager, InstanceInfo } from '../plugin-browsers/browsers-lib/instance-manager';
|
|
3
|
+
export interface PortAllocation {
|
|
4
|
+
port: number;
|
|
5
|
+
webSocketPort: number;
|
|
6
|
+
instanceId: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class PortManager {
|
|
9
|
+
private readonly basePort;
|
|
10
|
+
private readonly instanceManager;
|
|
11
|
+
private currentInstance;
|
|
12
|
+
constructor(browser: DevOptions['browser'], projectPath: string, basePort?: number);
|
|
13
|
+
allocatePorts(browser: DevOptions['browser'], projectPath: string, requestedPort?: number): Promise<PortAllocation>;
|
|
14
|
+
getCurrentInstance(): InstanceInfo | null;
|
|
15
|
+
updateExtensionId(extensionId: string): Promise<void>;
|
|
16
|
+
terminateCurrentInstance(): Promise<void>;
|
|
17
|
+
getPortInfo(allocation: PortAllocation): string;
|
|
18
|
+
getInstanceManager(): InstanceManager;
|
|
19
|
+
isPortInUse(port: number): Promise<boolean>;
|
|
20
|
+
getRunningInstances(): Promise<InstanceInfo[]>;
|
|
21
|
+
getStats(): Promise<{
|
|
22
|
+
total: number;
|
|
23
|
+
running: number;
|
|
24
|
+
terminated: number;
|
|
25
|
+
error: number;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Compilation } from '@rspack/core';
|
|
2
|
+
import { type Manifest, type FilepathList } from '../webpack-types';
|
|
3
|
+
import { DevOptions } from '../../module';
|
|
4
|
+
export declare function getResolvedPath(context: string, filePath: string, basePath: string): string;
|
|
5
|
+
export declare function isFromFilepathList(filePath: string, filepathList?: FilepathList): boolean;
|
|
6
|
+
export declare function getFilename(feature: string, filePath: string, excludeList: FilepathList): string;
|
|
7
|
+
/**
|
|
8
|
+
* Change the path from win style to unix style
|
|
9
|
+
*/
|
|
10
|
+
export declare function unixify(filePath: string): string;
|
|
11
|
+
export declare function shouldExclude(filePath: string, ignorePatterns?: FilepathList): boolean;
|
|
12
|
+
export declare function getManifestContent(compilation: Compilation, manifestPath: string): Manifest;
|
|
13
|
+
export declare function getRelativePath(from: string, to: string): string;
|
|
14
|
+
export declare function isFromPnpx(): false | "pnpm";
|
|
15
|
+
export declare function isFromNpx(): false | "npm";
|
|
16
|
+
export declare function installOptionalDependencies(integration: string, dependencies: string[]): Promise<void>;
|
|
17
|
+
export declare function isUsingJSFramework(projectPath: string): boolean;
|
|
18
|
+
export declare function isFirstRun(outputPath: string, browser: DevOptions['browser']): boolean;
|
|
19
|
+
export declare function filterKeysForThisBrowser(manifest: Manifest, browser: DevOptions['browser']): any;
|
|
20
|
+
export declare function hasDependency(projectPath: string, dependency: string): boolean;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type RspackPluginInstance, type LoaderContext as RspackLoaderContext } from '@rspack/core';
|
|
2
|
+
import { type DevOptions } from '../develop-lib/config-types';
|
|
3
|
+
export type ChromeManifest = Partial<chrome.runtime.ManifestV2> & Partial<chrome.runtime.ManifestV3> & {
|
|
4
|
+
browser_action?: {
|
|
5
|
+
theme_icons?: ThemeIcon[];
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export type Manifest = ChromeManifest;
|
|
9
|
+
export interface ThemeIcon {
|
|
10
|
+
light: string;
|
|
11
|
+
dark: string;
|
|
12
|
+
size?: number;
|
|
13
|
+
}
|
|
14
|
+
export type PluginInterface = {
|
|
15
|
+
manifestPath: string;
|
|
16
|
+
browser?: DevOptions['browser'];
|
|
17
|
+
includeList?: FilepathList;
|
|
18
|
+
excludeList?: FilepathList;
|
|
19
|
+
};
|
|
20
|
+
export interface LoaderInterface extends RspackLoaderContext<LoaderInterface> {
|
|
21
|
+
manifestPath: string;
|
|
22
|
+
includeList?: FilepathList;
|
|
23
|
+
excludeList?: FilepathList;
|
|
24
|
+
}
|
|
25
|
+
export type FilepathList = Record<string, string | string[] | undefined>;
|
|
26
|
+
export type ResourceType = 'script' | 'css' | 'html' | 'static' | 'staticSrc' | 'staticHref' | 'empty';
|
|
27
|
+
export type HtmlFilepathList = Record<string, {
|
|
28
|
+
html: string;
|
|
29
|
+
js: string[];
|
|
30
|
+
css: string[];
|
|
31
|
+
static: string[];
|
|
32
|
+
} | undefined>;
|
|
33
|
+
export interface LoaderContext {
|
|
34
|
+
resourcePath: string;
|
|
35
|
+
emitFile: (name: string, content: string) => void;
|
|
36
|
+
getOptions: () => {
|
|
37
|
+
test: string;
|
|
38
|
+
manifestPath: string;
|
|
39
|
+
browser?: DevOptions['browser'];
|
|
40
|
+
includeList?: FilepathList;
|
|
41
|
+
excludeList?: FilepathList;
|
|
42
|
+
mode: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface JsFramework {
|
|
46
|
+
plugins: RspackPluginInstance[] | undefined;
|
|
47
|
+
loaders: Record<string, any>[] | undefined;
|
|
48
|
+
alias: Record<string, string> | undefined;
|
|
49
|
+
}
|
package/package.json
CHANGED
|
@@ -8,61 +8,95 @@
|
|
|
8
8
|
"engines": {
|
|
9
9
|
"node": ">=18"
|
|
10
10
|
},
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/module.d.ts",
|
|
14
|
+
"import": "./dist/module.js",
|
|
15
|
+
"require": "./dist/module.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
14
18
|
"main": "./dist/module.js",
|
|
15
19
|
"types": "./dist/module.d.ts",
|
|
16
20
|
"files": [
|
|
17
21
|
"dist"
|
|
18
22
|
],
|
|
23
|
+
"name": "extension-develop",
|
|
24
|
+
"version": "2.0.1",
|
|
25
|
+
"description": "The develop step of Extension.js",
|
|
19
26
|
"author": {
|
|
20
27
|
"name": "Cezar Augusto",
|
|
21
28
|
"email": "boss@cezaraugusto.net",
|
|
22
29
|
"url": "https://cezaraugusto.com"
|
|
23
30
|
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public",
|
|
33
|
+
"registry": "https://registry.npmjs.org"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"webextension",
|
|
37
|
+
"browser-extension",
|
|
38
|
+
"manifest-v3",
|
|
39
|
+
"mv3",
|
|
40
|
+
"cross-browser",
|
|
41
|
+
"development-server",
|
|
42
|
+
"dev-server",
|
|
43
|
+
"live-reload",
|
|
44
|
+
"hot-reload",
|
|
45
|
+
"watch-mode",
|
|
46
|
+
"content-script",
|
|
47
|
+
"background-script",
|
|
48
|
+
"devtools",
|
|
49
|
+
"polyfill",
|
|
50
|
+
"build-tools",
|
|
51
|
+
"preview",
|
|
52
|
+
"production-preview",
|
|
53
|
+
"build",
|
|
54
|
+
"bundle",
|
|
55
|
+
"zip",
|
|
56
|
+
"chrome-extension",
|
|
57
|
+
"firefox-extension",
|
|
58
|
+
"edge-extension"
|
|
59
|
+
],
|
|
24
60
|
"dependencies": {
|
|
25
|
-
"@
|
|
26
|
-
"@rspack/
|
|
27
|
-
"@rspack/dev-server": "^1.1.0",
|
|
28
|
-
"@swc/core": "^1.10.1",
|
|
61
|
+
"@rspack/core": "^1.4.8",
|
|
62
|
+
"@rspack/dev-server": "^1.1.3",
|
|
29
63
|
"@swc/helpers": "^0.5.15",
|
|
30
|
-
"@types/
|
|
64
|
+
"@types/webextension-polyfill": "0.12.3",
|
|
31
65
|
"@vue/compiler-sfc": "^3.5.13",
|
|
32
66
|
"adm-zip": "^0.5.16",
|
|
33
|
-
"axios": "^1.
|
|
67
|
+
"axios": "^1.9.0",
|
|
34
68
|
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|
|
35
69
|
"chokidar": "^4.0.1",
|
|
36
|
-
"chrome-
|
|
70
|
+
"chrome-location2": "2.0.0",
|
|
37
71
|
"content-security-policy-parser": "^0.6.0",
|
|
38
72
|
"cross-spawn": "^7.0.6",
|
|
39
|
-
"csv-loader": "^3.0.5",
|
|
40
73
|
"dotenv": "^16.4.7",
|
|
41
74
|
"dotenv-webpack": "^8.1.0",
|
|
42
|
-
"edge-location": "^1.
|
|
75
|
+
"edge-location": "^1.1.1",
|
|
76
|
+
"firefox-location2": "1.0.0",
|
|
43
77
|
"firefox-profile": "^4.7.0",
|
|
44
|
-
"
|
|
45
|
-
"go-git-it": "2.0.4",
|
|
78
|
+
"go-git-it": "^5.0.0",
|
|
46
79
|
"ignore": "^6.0.2",
|
|
47
80
|
"loader-utils": "^3.3.1",
|
|
81
|
+
"locate-path": "^7.2.0",
|
|
48
82
|
"micromatch": "^4.0.8",
|
|
49
83
|
"package-manager-detector": "^0.2.7",
|
|
50
84
|
"parse5": "^7.2.1",
|
|
51
|
-
"parse5-
|
|
85
|
+
"parse5-utilities": "^1.0.0",
|
|
86
|
+
"pintor": "0.3.0",
|
|
52
87
|
"postcss": "^8.4.49",
|
|
53
88
|
"preact": "^10.22.0",
|
|
54
89
|
"progress": "^2.0.3",
|
|
55
90
|
"schema-utils": "^4.2.0",
|
|
56
91
|
"slugify": "^1.6.6",
|
|
57
92
|
"tiny-glob": "^0.2.9",
|
|
58
|
-
"vue-template-compiler": "^2.7.16",
|
|
59
93
|
"webextension-polyfill": "^0.12.0",
|
|
60
94
|
"webpack-merge": "^6.0.1",
|
|
61
95
|
"webpack-target-webextension": "^2.1.3",
|
|
62
|
-
"which": "^5.0.0",
|
|
63
96
|
"ws": "^8.18.0"
|
|
64
97
|
},
|
|
65
98
|
"devDependencies": {
|
|
99
|
+
"@rslib/core": "^0.6.9",
|
|
66
100
|
"@types/adm-zip": "^0.5.7",
|
|
67
101
|
"@types/case-sensitive-paths-webpack-plugin": "^2.1.9",
|
|
68
102
|
"@types/chrome": "^0.0.287",
|
|
@@ -71,12 +105,14 @@
|
|
|
71
105
|
"@types/jest": "^29.5.14",
|
|
72
106
|
"@types/loader-utils": "^2.0.6",
|
|
73
107
|
"@types/node": "^22.10.1",
|
|
74
|
-
"@types/
|
|
108
|
+
"@types/sass-loader": "8.0.9",
|
|
75
109
|
"@types/ws": "^8.5.13",
|
|
110
|
+
"@vitest/coverage-v8": "3.2.2",
|
|
76
111
|
"jest": "^29.7.0",
|
|
77
|
-
"ts-jest": "^29.
|
|
112
|
+
"ts-jest": "^29.3.1",
|
|
78
113
|
"tsup": "^8.3.5",
|
|
79
|
-
"typescript": "5.7.2"
|
|
114
|
+
"typescript": "5.7.2",
|
|
115
|
+
"vitest": "3.2.2"
|
|
80
116
|
},
|
|
81
117
|
"optionalDependencies": {
|
|
82
118
|
"@prefresh/core": "^1.5.2",
|
|
@@ -89,20 +125,19 @@
|
|
|
89
125
|
"postcss-loader": "^8.1.1",
|
|
90
126
|
"postcss-preset-env": "^10.1.1",
|
|
91
127
|
"react-refresh": "^0.14.2",
|
|
92
|
-
"resolve-url-loader": "^5.0.0",
|
|
93
128
|
"sass-loader": "^16.0.4",
|
|
94
129
|
"svelte-loader": "^3.2.4",
|
|
95
|
-
"svelte-preprocess": "^6.0.3",
|
|
96
130
|
"vue-loader": "^17.4.2",
|
|
97
|
-
"vue-style-loader": "^4.1.3"
|
|
98
|
-
"vue-template-compiler": "^2.7.16"
|
|
131
|
+
"vue-style-loader": "^4.1.3"
|
|
99
132
|
},
|
|
100
133
|
"scripts": {
|
|
134
|
+
"pretest": "pnpm -w --filter extension --filter extension-develop compile",
|
|
101
135
|
"clean": "rm -rf dist",
|
|
102
|
-
"watch": "
|
|
103
|
-
"compile": "
|
|
104
|
-
"test": "
|
|
105
|
-
"test:
|
|
106
|
-
"test:
|
|
136
|
+
"watch": "rslib build --watch",
|
|
137
|
+
"compile": "rslib build",
|
|
138
|
+
"test": "vitest run",
|
|
139
|
+
"test:build": "vitest run build.spec.ts",
|
|
140
|
+
"test:dev": "vitest run dev.spec.ts",
|
|
141
|
+
"test:coverage": "vitest run --coverage"
|
|
107
142
|
}
|
|
108
143
|
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";var y=Object.create;var i=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var T=(e,n)=>{for(var r in n)i(e,r,{get:n[r],enumerable:!0})},l=(e,n,r,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of b(n))!v.call(e,o)&&o!==r&&i(e,o,{get:()=>n[o],enumerable:!(s=E(n,o))||s.enumerable});return e};var a=(e,n,r)=>(r=e!=null?y(w(e)):{},l(n||!e||!e.__esModule?i(r,"default",{value:e,enumerable:!0}):r,e)),S=e=>l(i({},"__esModule",{value:!0}),e);var k={};T(k,{default:()=>I});module.exports=S(k);var c=a(require("path")),f=require("loader-utils"),m=require("schema-utils");var F=a(require("path")),t=require("@colors/colors/safe");var d=a(require("path")),O=d.default.join(process.cwd(),"node_modules/extension-develop/dist/certs"),N=["chrome","edge"],R=["firefox"],U=[...N,...R];var M=require("console");function j(e,n){return n==="error"?`${(0,t.bold)((0,t.red)("ERROR"))} in ${e} ${(0,t.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`:n==="warn"?`${e} ${(0,t.brightYellow)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`:`${n==="info"?(0,t.cyan)("\u25BA\u25BA\u25BA"):(0,t.brightGreen)("\u25BA\u25BA\u25BA")} ${(0,t.cyan)(e)}`}function p(){return`${j("DEPRECATION","warn")} Using ${(0,t.brightYellow)("window.__EXTENSION_SHADOW_ROOT__")} in content_scripts is deprecated
|
|
2
|
-
and will be removed in a future version of Extension.js. To use content_scripts with
|
|
3
|
-
the shadow DOM, see one of the many examples at:
|
|
4
|
-
https://github.com/extension-js/extension.js/tree/main/examples
|
|
5
|
-
|
|
6
|
-
If you really need to use the shadow DOM as-is, the latest version of Extension.js
|
|
7
|
-
to support it is extension@2.0.0-beta.9.
|
|
8
|
-
`}var D={type:"object",properties:{test:{type:"string"},manifestPath:{type:"string"}}};function I(e){let n=this.getOptions(),r=n.manifestPath,s=c.default.dirname(r),o=require(r);(0,m.validate)(D,n,{name:"scripts:deprecated-shadow-root",baseDataPath:"options"});let $=(0,f.urlToRequest)(this.resourcePath),h=`
|
|
9
|
-
;const appendStyleElementForLegacyShadowRoot = (legacyShadowRoot, stylesheets) => {
|
|
10
|
-
const styleElement = document.createElement('link')
|
|
11
|
-
styleElement.rel = 'stylesheet'
|
|
12
|
-
styleElement.href = (typeof chrome !== 'undefined' ? chrome : browser).runtime.getURL('content_scripts/content-0.css')
|
|
13
|
-
legacyShadowRoot.appendChild(styleElement)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function injectStyles() {
|
|
17
|
-
const legacyShadowRoot = window.__EXTENSION_SHADOW_ROOT__
|
|
18
|
-
|
|
19
|
-
if (legacyShadowRoot) {
|
|
20
|
-
appendStyleElementForLegacyShadowRoot(legacyShadowRoot)
|
|
21
|
-
} else {
|
|
22
|
-
// Use MutationObserver to wait for shadow root to be available
|
|
23
|
-
const observer = new MutationObserver(() => {
|
|
24
|
-
const shadowRoot = window.__EXTENSION_SHADOW_ROOT__
|
|
25
|
-
|
|
26
|
-
if (shadowRoot) {
|
|
27
|
-
appendStyleElementForLegacyShadowRoot(shadowRoot)
|
|
28
|
-
observer.disconnect()
|
|
29
|
-
}
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
observer.observe(document.body, { childList: true, subtree: true })
|
|
33
|
-
}
|
|
34
|
-
};injectStyles();`;if(o.content_scripts){for(let u of o.content_scripts)if(u.js)for(let g of u.js){let x=c.default.resolve(s,g);if($.includes(x))return e.includes("__EXTENSION_SHADOW_ROOT__")?(console.warn(p()),`${h}${e}`):`${e}`}}return e}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";var _=Object.create;var m=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var L=(e,n)=>{for(var r in n)m(e,r,{get:n[r],enumerable:!0})},y=(e,n,r,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of D(n))!C.call(e,t)&&t!==r&&m(e,t,{get:()=>n[t],enumerable:!(i=I(n,t))||i.enumerable});return e};var a=(e,n,r)=>(r=e!=null?_(R(e)):{},y(n||!e||!e.__esModule?m(r,"default",{value:e,enumerable:!0}):r,e)),A=e=>y(m({},"__esModule",{value:!0}),e);var X={};L(X,{default:()=>T});module.exports=A(X);var x=a(require("path")),S=require("loader-utils"),M=require("schema-utils");var g=a(require("path")),z=a(require("fs")),B=require("child_process"),J=require("package-manager-detector");var W=a(require("path")),o=require("@colors/colors/safe");var v=a(require("path")),U=v.default.join(process.cwd(),"node_modules/extension-develop/dist/certs"),b=["chrome","edge"],P=["firefox"],Z=[...b,...P];var H=require("console");function E(e){return e.replace(/\\/g,"/")}function h(e,n={}){if(!n)return!1;let r=g.default.normalize(E(e));return Object.values(n).some(t=>typeof t!="string"?!1:E(t).includes(r))}function F(e,n){let r=g.default.relative(g.default.dirname(e),n);return!r.startsWith(".")&&!r.startsWith("..")&&(r="./"+r),r}var $=a(require("fs")),j=a(require("path"));function N(e,n){return(Array.isArray(e)?e||[]:e?[e]:[]).filter(t=>{let l=$.default.existsSync(t)&&!h(t,n),s=j.default.extname(t);return l&&(s===".js"||s===".mjs"||s===".jsx"||s===".ts"||s===".tsx")})}function w(e,n){return(Array.isArray(e)?e||[]:e?[e]:[]).filter(t=>$.default.existsSync(t)&&!h(t,n)&&(t.endsWith(".css")||t.endsWith(".scss")||t.endsWith(".sass")||t.endsWith(".less")))}var G={type:"object",properties:{test:{type:"string"},manifestPath:{type:"string"},includeList:{type:"object"},excludeList:{type:"object"}}},K=`/**
|
|
2
|
-
* Welcome to to your content_scripts CSS file during development!
|
|
3
|
-
* To speed up the development process, your styles
|
|
4
|
-
* are being injected directly into the head of the webpage,
|
|
5
|
-
* and will be removed when you build your application, along
|
|
6
|
-
* with this file. If you are seeing this file in a production build,
|
|
7
|
-
* it means that something is wrong with your build configuration.
|
|
8
|
-
*/`;function T(e){let n=this.getOptions();(0,M.validate)(G,n,{name:"scripts:inject-content-css-during-dev",baseDataPath:"options"});let r=n.includeList||{},i=[],t=Object.entries(r).filter(([s,u])=>s.startsWith("content")&&u);if(!t.length)return e;for(let s of t){let[u,d]=s,c=[...N(d,n.excludeList||{})],p=w(d,n.excludeList||{});if(p.length&&!c.length){let f=x.default.resolve(__dirname,"minimum-content-file.mjs");c.push(f)}i.push({feature:u,scriptPath:c[0],cssImports:p.map(f=>F(c[0],f))})}let l=(0,S.urlToRequest)(this.resourcePath);return i.forEach(({feature:s,scriptPath:u,cssImports:d})=>{if(l.includes(u)){let c=d.map(p=>{let[,f]=s.split("/"),O=f.split("-")[1],k=x.default.basename(p);return`import(/* webpackChunkName: "${`web_accessible_resources/resource-${O}/${k.replace(".","_")}`}" */ '${p}').then(css => console.info('content_script.css loaded', css)).catch(err => console.error(err));`}).join(`
|
|
9
|
-
`);this.emitFile(`${s}.css`,K),e=`${c}
|
|
10
|
-
${e}`}}),e}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
chrome.runtime.onMessageExternal.addListener(async(e,i,a)=>{let r=await new Promise(n=>{chrome.management.getSelf(n)});return e.initialLoadData?(a({id:chrome.runtime.id,manifest:chrome.runtime.getManifest(),management:r}),!0):((e.changedFile==="manifest.json"||e.changedFile==="service_worker"||e.changedFile==="_locales")&&setTimeout(()=>{a({reloaded:!0}),chrome.runtime.reload()},750),e.changedFile==="declarative_net_request"&&(a({reloaded:!0}),chrome.runtime.reload()),!0)});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import.meta.webpackHot&&import.meta.webpackHot.accept();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
browser.runtime.onMessageExternal.addListener(async(e,a)=>{let n=await browser.management.getSelf();return e.initialLoadData?{id:browser.runtime.id,manifest:browser.runtime.getManifest(),management:n}:((e.changedFile==="manifest.json"||e.changedFile==="service_worker"||e.changedFile==="_locales")&&setTimeout(()=>{browser.runtime.reload()},750),e.changedFile==="declarative_net_request"&&browser.runtime.reload(),{reloaded:!0})});
|
package/dist/resolver-loader.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var V=Object.create;var g=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var Q=(e,t)=>{for(var r in t)g(e,r,{get:t[r],enumerable:!0})},y=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of K(t))!Y.call(e,o)&&o!==r&&g(e,o,{get:()=>t[o],enumerable:!(n=G(t,o))||n.enumerable});return e};var l=(e,t,r)=>(r=e!=null?V(X(e)):{},y(t||!e||!e.__esModule?g(r,"default",{value:e,enumerable:!0}):r,e)),Z=e=>y(g({},"__esModule",{value:!0}),e);var he={};Q(he,{default:()=>J});module.exports=Z(he);var m=l(require("path")),z=require("schema-utils");var v=require("@swc/core"),_=require("acorn"),P=l(require("acorn-walk")),M=require("astring");function ee(e,t){let r=e;for(let n=t.length-1;n>=0;n--){if(n===0)return r.type==="Identifier"&&r.name===t[n];if(r.type!=="MemberExpression"||r.property.type!=="Identifier"||r.property.name!==t[n])return!1;r=r.object}return!0}function s(e,t){let r=t.split(".");return ee(e,r)}function u(e,t){if(e.arguments.length===0)return;let r=e.arguments[0];e.arguments[0]={type:"CallExpression",callee:{type:"Identifier",name:t},arguments:[r]}}function h(e,t){if(e.arguments.length!==0){if(t==="chrome.devtools.panels.create"||t==="browser.devtools.panels.create")e.arguments[1]={type:"CallExpression",callee:{type:"Identifier",name:"r.solve"},arguments:[e.arguments[1]]},e.arguments[2]={type:"CallExpression",callee:{type:"Identifier",name:"r.solve"},arguments:[e.arguments[2]]};else if(t==="chrome.runtime.getURL"||t==="browser.runtime.getURL"){if(e.arguments[0].type==="Literal"&&e.arguments[0].value.includes("/_favicon/"))return;e.arguments[0]={type:"CallExpression",callee:{type:"Identifier",name:"r.solve"},arguments:[e.arguments[0]]}}}}function te(e,t,r,n){(s(e,`${n}.action.setIcon`)||s(e,`${n}.browserAction.setIcon`)||s(e,`${n}.pageAction.setIcon`)||s(e,`${n}.declarativeContent.SetIcon`)||s(e,`${n}.action.setPopup`)||s(e,`${n}.browserAction.setPopup`)||s(e,`${n}.pageAction.setPopup`)||s(e,`${n}.scriptBadge.setPopup`))&&u(r,"r.solve"),s(e,`${n}.devtools.panels.create`)&&h(r,`${n}.devtools.panels.create`),s(e,`${n}.downloads.download`)&&u(r,"r.solve"),s(e,`${n}.runtime.getURL`)&&h(r,`${n}.runtime.getURL`),(s(e,`${n}.scripting.insertCSS`)||s(e,`${n}.scripting.removeCSS`)||s(e,`${n}.scripting.executeScript`))&&u(r,"r.solve"),(s(e,`${n}.scripting.registerContentScripts`)||s(e,`${n}.declarativeContent.RequestContentScript`))&&u(r,"r.solve"),s(e,`${n}.declarativeContent.RequestContentScript`)&&u(r,"r.solve"),(s(e,`${n}.tabs.create`)||s(e,`${n}.tabs.executeScript`)||s(e,`${n}.tabs.insertCSS`)||s(e,`${n}.windows.create`))&&t.length>0&&u(r,"r.solve"),s(e,`${n}.sidePanel.setOptions`)&&u(r,"r.solve"),s(e,`${n}.notifications.create`)&&u(r,"r.solve")}function E(e,t){let r=(0,v.transformSync)(e,{module:{type:"es6"},minify:t.minify,jsc:{loose:!0,target:"es2016",externalHelpers:!0,parser:{syntax:t.typescript?"typescript":"ecmascript",jsx:!t.typescript&&t.jsx,tsx:t.typescript&&t.jsx,dynamicImport:!0},transform:{react:{runtime:"automatic",importSource:"react"}}}}),n=(0,_.parse)(r.code,{sourceType:"module",ecmaVersion:"latest"});return P.simple(n,{CallExpression(i){let a=["chrome","browser"],c=i.callee,d=i.arguments;a.forEach(f=>{te(c,d,i,f)})}}),(0,M.generate)(n)}var b=l(require("fs"));var x=l(require("path"));function S(e){if(!e||!e.background)return;let t=e.background.scripts;if(t)return t.map(r=>r)}function w(e){if(!e||!e.background)return;if(e.background.service_worker)return e.background.service_worker}function D(e){if(!e||!e.content_scripts)return{"content_scripts/content-0.js":void 0};let t=i=>{if(i.js?.length!==0)return i.js?.map(a=>a)},r=i=>{if(i.css?.length!==0)return i.css?.map(a=>a)},n={},o=e.content_scripts;for(let[i,a]of o.entries()){let c=t(a),d=r(a);n[`content_scripts/content-${i}`]=[...(c||[]).filter(f=>f!=null),...(d||[]).filter(f=>f!=null)]}return n}function j(e){return!e||!e.user_scripts||!e.user_scripts.api_script?void 0:e.user_scripts.api_script}function k(e){return!e||!e.action||!e.action.default_popup?void 0:e.action.default_popup}function A(e){return!e||!e.background||!e.background.page?void 0:e.background.page}function F(e){return!e||!e.browser_action||!e.browser_action.default_popup?void 0:e.browser_action.default_popup}function O(e){let t={newtab:void 0};return!e||!e.chrome_url_overrides?{"chrome_url_overrides/newtab.html":void 0}:(e.chrome_url_overrides.history&&(t={"chrome_url_overrides/history.html":e.chrome_url_overrides.history}),e.chrome_url_overrides.newtab&&(t={"chrome_url_overrides/newtab.html":e.chrome_url_overrides.newtab}),e.chrome_url_overrides.bookmarks&&(t={"chrome_url_overrides/bookmarks.html":e.chrome_url_overrides.bookmarks}),t)}function R(e){return!e||!e.devtools_page?void 0:e.devtools_page}function I(e){return e.options_page?e.options_page:!e||!e.options_ui||!e.options_ui.page?void 0:e.options_ui.page}function N(e){return!e||!e.page_action||!e.page_action.default_popup?void 0:e.page_action.default_popup}function T(e){if(!e||!e.sandbox||!e.sandbox.pages)return{"sandbox/page-0.html":void 0};let t=e.sandbox.pages,r={};for(let[n,o]of t.entries()){let i=o;r[`sandbox/page-${n}.html`]=i}return r}function C(e){return!e||!e.side_panel||!e.side_panel.default_path?void 0:e.side_panel.default_path}function L(e){return!e||!e.sidebar_action||!e.sidebar_action.default_panel?void 0:e.sidebar_action.default_panel}function U(e){return{"background/scripts.js":S(e),"background/service_worker.js":w(e),...D(e),"user_scripts/apiscript.js":j(e),"action/default_popup.html":k(e),"background/page.html":A(e),"browser_action/default_popup.html":F(e),...O(e),"devtools_page.html":R(e),"options_ui/page.html":I(e),"page_action/default_popup.html":N(e),...T(e),"side_panel/default_path.html":C(e),"sidebar_action/default_panel.html":L(e)}}var ae=l(require("path")),ce=l(require("fs")),ue=require("child_process"),pe=require("package-manager-detector");var oe=l(require("path")),p=require("@colors/colors/safe");var W=l(require("path")),re=W.default.join(process.cwd(),"node_modules/extension-develop/dist/certs"),$=["chrome","edge"],ne=["firefox"],et=[...$,...ne];var se=require("console");function H(e,t){return JSON.parse(JSON.stringify(e),function(o,i){let a=o.indexOf(":");if(a===-1)return i;let c=o.substring(0,a);(c===t||c==="chromium"&&$.includes(t)||c==="chromium"&&t.includes("chromium")||c==="gecko"&&t.includes("gecko"))&&(this[o.substring(a+1)]=i)})}function de(e,t){let r=x.default.dirname(e);return Object.entries(t||{}).reduce((o,[i,a])=>{let c=x.default.relative(r,a);return o[i]=c,o},{})}function fe(e,t){let r=require(e),n=H(r,t);return U(n)}function q(e,t,r){let n=de(e,r),o=fe(e,t);return{...n,...o}}function B(e,t){let r=e.getOptions(),{manifestPath:n,includeList:o,browser:i}=r,a=JSON.stringify(q(n,i,o)),d=b.default.readFileSync(t,"utf8").replace('"__RESOLVER_MODULE_FILE_LIST__"',`${a}`);b.default.writeFileSync(t,d)}var ge={type:"object",properties:{test:{type:"string"},browser:{type:"string"},manifestPath:{type:"string"},includeList:{type:"object"},excludeList:{type:"object"},loaderOptions:{type:"object"}}};function me(e,t){if(!e.content_scripts)return[];let r=[];return e.content_scripts.forEach(n=>{n.js&&n.js.forEach(o=>{r.push(m.default.resolve(t,o))})}),r}function J(e){let t=this.getOptions();if((0,z.validate)(ge,t,{name:"resolve:loader",baseDataPath:"options"}),new RegExp(t.test).test(this.resourcePath)){let r="resolver-module.mjs";if(this.resourcePath.includes("node_modules")||this.resourcePath.includes("dist/"))return e;let n=m.default.dirname(t.manifestPath);if(me(require(t.manifestPath),n).some(c=>c===this.resourcePath))return e;let i=E(e,t),a=m.default.join(__dirname,r);return B(this,a),i}return e}
|
package/dist/resolver-module.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var c={resolverNotFoundError(){console.error('Could not resolve file path. Ensure the file exists in the "public" or "pages" directory.')},resolverHtmlError:r=>(console.error(`Could not resolve path ${r}. Either add it to the "public" directory or create a page in the "pages" directory.`),r),resolverJsError:r=>`Could not resolve path ${r}. Either add it to the "public" directory or create a script in the "scripts" directory.`,resolverStaticError:r=>`Could not resolve path ${r}. If you want to preserve this file path, add the file to the "public" directory.`};function p(r){let n=r.split("/"),t=[];for(let s of n)s===".."||s==="."||s!==""&&t.push(s);return t.join("/")}function u(r){return r?.endsWith(".html")?(console.error(c.resolverHtmlError(r)),r):r?.endsWith(".js")?(console.error(c.resolverJsError(r)),r):(r&&console.error(c.resolverStaticError(r)),r)}var l={data:"__RESOLVER_MODULE_FILE_LIST__"};function e(r){if(!r)return c.resolverNotFoundError(),"";if(r?.startsWith("http")||r?.startsWith("chrome://")||r?.startsWith("about:"))return r;if(r?.startsWith("chrome-extension://")){let s=chrome.runtime.getURL("");if(r.startsWith(s)){let o=r.replace(s,"");return chrome.runtime.getURL(e(o))}return r}if(r?.startsWith("/_favicon"))return r;let n=Object.entries(l.data).find(([s,o])=>{let i=p(r);return o===i||o===`pages/${i}`||o===`scripts/${i}`?s:!1}),t=p(r);return t.includes("public/")?"/"+t:n&&n.length?n[0]:(r!=="/"&&u(r),r)}function a(r){if(typeof r=="string")return e(r);let n=t=>({...t,...t?.path&&{path:typeof t.path=="string"?e(t.path):Object.entries(t.path).reduce((s,[o,i])=>(s[o]=e(i),s),{})},...t?.popup&&{popup:e(t.popup)},...t?.url&&{url:Array.isArray(t?.url)?t?.url.map(s=>e(s)):e(t?.url)},...t?.iconUrl&&{iconUrl:e(t.iconUrl)},...t?.files&&{files:t.files.map(s=>e(s))},...t?.js&&{js:Array.isArray(t.js)?t.js.map(s=>e(s)):t.js},...t?.css&&{css:Array.isArray(t.css)?t.css.map(s=>e(s)):t.css}});return Array.isArray(r)?r.map(t=>n(t)):{...n(r||{})}}var g={solve:a},d=g;export{d as default};
|