extension-develop 4.1.41 → 4.1.42-canary.466.1b67056
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 +127 -92
- package/dist/3~0.mjs +1 -1
- package/dist/5h~0.mjs +5 -13
- package/dist/5~0.mjs +60 -4
- package/dist/6~0.mjs +406 -28
- package/dist/7~0.mjs +38 -0
- package/dist/8~0.mjs +1508 -0
- package/dist/9q~0.mjs +248 -0
- package/dist/9~0.mjs +5 -99
- package/dist/asset-source-maps~0.mjs +19 -0
- package/dist/bh~0.mjs +27 -2
- package/dist/bridge-entry.d.ts +2 -2
- package/dist/bridge.mjs +10 -140
- package/dist/br~0.mjs +274 -0
- package/dist/b~0.mjs +53 -8624
- package/dist/command-build~0.mjs +1526 -0
- package/dist/command-dev.d.ts +1 -0
- package/dist/command-dev~0.mjs +309 -0
- package/dist/command-preview.d.ts +5 -7
- package/dist/command-preview~0.mjs +596 -0
- package/dist/config-loader~0.mjs +717 -0
- package/dist/contract/codes.json +290 -77
- package/dist/contract/envelope.schema.json +4 -1
- package/dist/contract/golden.doctor.healthy.json +1 -1
- package/dist/contract/golden.doctor.session-not-found.json +1 -1
- package/dist/contracts.mjs +3 -1
- package/dist/css-parse-guard-loader.mjs +4 -3
- package/dist/c~0.mjs +1 -1
- package/dist/dark-mode~0.mjs +77 -0
- package/dist/dead-css-url-loader.mjs +148 -23
- package/dist/dev-content-scripts~0.mjs +589 -0
- package/dist/dev-server/auto-exit.d.ts +2 -1
- package/dist/dev-server/cleanup.d.ts +23 -1
- package/dist/dev-server/control-bridge/broker.d.ts +5 -0
- package/dist/dev-server/control-bridge/consumer-client.d.ts +1 -0
- package/dist/dev-server/control-bridge/contracts.d.ts +3 -1
- package/dist/dev-server/control-bridge/producer-runtime.d.ts +1 -1
- package/dist/dev-server/control-bridge/production-control.d.ts +1 -33
- package/dist/dev-server/control-bridge/ws-control-server.d.ts +1 -0
- package/dist/dev-server/control-bridge-start.d.ts +24 -0
- package/dist/dev-server/cors.d.ts +23 -0
- package/dist/dev-server/file-event-assist.d.ts +25 -0
- package/dist/dev-server/index.d.ts +3 -3
- package/dist/dev-server/lifecycle-stream.d.ts +22 -6
- package/dist/dev-server/main-world-restart.d.ts +14 -0
- package/dist/dev-server/messages.d.ts +9 -0
- package/dist/dev-server/port-manager.d.ts +1 -0
- package/dist/dev-server/ready-contract-codes.d.ts +3 -0
- package/dist/dev-server/server-config.d.ts +26 -0
- package/dist/dev-server/session-claim.d.ts +1 -0
- package/dist/dev-server/session-end.d.ts +6 -0
- package/dist/dev-server/session-env.d.ts +3 -0
- package/dist/dev-server/session-gone-outputs.d.ts +15 -0
- package/dist/dev-server/session-holdings.d.ts +12 -0
- package/dist/dev-server/session-restart-handler.d.ts +47 -0
- package/dist/dev-server/session-restart-holds.d.ts +4 -0
- package/dist/dev-server/session-restart.d.ts +12 -3
- package/dist/dev-server/start-bundler.d.ts +91 -0
- package/dist/dev-server~0.mjs +1028 -470
- package/dist/d~0.mjs +178 -445
- package/dist/ensure-hmr-for-scripts.mjs +6 -17
- package/dist/extension-js-devtools/build-stamp.json +2 -2
- package/dist/extension-js-devtools/chrome/background/service_worker.js +2 -2
- package/dist/extension-js-devtools/chrome/extension-js-session.json +1 -1
- package/dist/extension-js-devtools/chrome/pages/welcome.css +1 -1
- package/dist/extension-js-devtools/chrome/pages/welcome.js +2 -2
- package/dist/extension-js-devtools/chromium/background/service_worker.js +2 -2
- package/dist/extension-js-devtools/chromium/extension-js-session.json +1 -1
- package/dist/extension-js-devtools/chromium/pages/welcome.css +1 -1
- package/dist/extension-js-devtools/chromium/pages/welcome.js +2 -2
- package/dist/extension-js-devtools/edge/background/service_worker.js +2 -2
- package/dist/extension-js-devtools/edge/extension-js-session.json +1 -1
- package/dist/extension-js-devtools/edge/pages/welcome.css +1 -1
- package/dist/extension-js-devtools/edge/pages/welcome.js +2 -2
- package/dist/extension-js-devtools/firefox/background/scripts.js +2 -2
- package/dist/extension-js-devtools/firefox/extension-js-session.json +1 -1
- package/dist/extension-js-devtools/firefox/pages/welcome.css +1 -1
- package/dist/extension-js-devtools/firefox/pages/welcome.js +2 -2
- package/dist/extension-js-theme/build-stamp.json +2 -2
- package/dist/ey~0.mjs +16 -2
- package/dist/e~0.mjs +1 -1
- package/dist/feature-scripts-classic-concat-loader.mjs +21 -4
- package/dist/feature-scripts-classic-traced-globals-loader.mjs +2 -2
- package/dist/feature-scripts-content-script-wrapper.mjs +87 -89
- package/dist/feature-scripts-native-geturl-import-loader.mjs +1 -1
- package/dist/g0~0.mjs +8 -9
- package/dist/g~0.mjs +407 -91
- package/dist/i~0.mjs +246 -0
- package/dist/j6~0.mjs +14 -2
- package/dist/j8~0.mjs +579 -0
- package/dist/j~0.mjs +1 -1
- package/dist/ka~0.mjs +25 -3
- package/dist/ke~0.mjs +382 -0
- package/dist/k~0.mjs +1344 -291
- package/dist/late-css-import-loader.mjs +3 -2
- package/dist/lib/addon-lint.d.ts +1 -1
- package/dist/lib/addon-reviewer-note.d.ts +0 -1
- package/dist/lib/build-output-guard.d.ts +9 -0
- package/dist/lib/build-summary.d.ts +5 -1
- package/dist/lib/coded-warnings.d.ts +5 -2
- package/dist/lib/config-loader.d.ts +10 -5
- package/dist/lib/constants.d.ts +0 -5
- package/dist/lib/corepack-registry.d.ts +5 -0
- package/dist/lib/dev-additions.d.ts +1 -1
- package/dist/lib/dev-server-client-import.d.ts +5 -1
- package/dist/lib/develop-build-entries.d.ts +6 -0
- package/dist/lib/development-artifacts.d.ts +0 -1
- package/dist/lib/diagnostic-code.d.ts +5 -0
- package/dist/lib/duplicate-output-files.d.ts +0 -1
- package/dist/lib/ensure-develop-artifacts.d.ts +11 -2
- package/dist/lib/extension-base-from-stack.d.ts +0 -1
- package/dist/lib/extension-id.d.ts +5 -0
- package/dist/lib/extensions-to-load.d.ts +24 -1
- package/dist/lib/generate-extension-types.d.ts +2 -1
- package/dist/lib/install-registry-failure.d.ts +30 -0
- package/dist/lib/launch-codes.d.ts +1 -0
- package/dist/lib/loader-source-maps.d.ts +0 -1
- package/dist/lib/machine-text.d.ts +1 -0
- package/dist/lib/manifest-utils.d.ts +3 -1
- package/dist/lib/messages.d.ts +47 -5
- package/dist/lib/messaging.d.ts +59 -12
- package/dist/lib/missing-reference-watch.d.ts +9 -0
- package/dist/lib/named-cause.d.ts +5 -0
- package/dist/lib/normalize-split-chunks.d.ts +0 -1
- package/dist/lib/optional-deps-resolver.d.ts +0 -1
- package/dist/lib/package-json.d.ts +0 -1
- package/dist/lib/package-manager.d.ts +8 -5
- package/dist/lib/parse-json-safe.d.ts +11 -0
- package/dist/lib/paths.d.ts +3 -2
- package/dist/lib/production-control/index.d.ts +38 -0
- package/dist/lib/project-manifest.d.ts +0 -2
- package/dist/lib/project.d.ts +3 -0
- package/dist/lib/real-path.d.ts +1 -0
- package/dist/lib/recorded-build-browser.d.ts +2 -0
- package/dist/lib/reload-session.d.ts +1 -0
- package/dist/lib/resource-path.d.ts +1 -0
- package/dist/lib/resource-query.d.ts +1 -0
- package/dist/lib/session-contract.d.ts +16 -0
- package/dist/lib/session-paths.d.ts +2 -13
- package/dist/lib/split-chunks.d.ts +0 -1
- package/dist/lib/thrown-location.d.ts +1 -0
- package/dist/lib/transpile-packages.d.ts +0 -1
- package/dist/lib/withheld-file.d.ts +13 -0
- package/dist/lib/zip.d.ts +0 -1
- package/dist/l~0.mjs +14 -1898
- package/dist/manifest-entry.d.ts +25 -3
- package/dist/manifest.mjs +11 -4
- package/dist/mn~0.mjs +234 -0
- package/dist/module.d.ts +12 -8
- package/dist/module.mjs +19 -4
- package/dist/m~0.mjs +188 -5907
- package/dist/o~0.mjs +19 -44
- package/dist/plugin-browsers/bounded-wait.d.ts +10 -0
- package/dist/plugin-browsers/index.d.ts +21 -12
- package/dist/plugin-browsers/launch-timeout-stamp.d.ts +2 -0
- package/dist/plugin-browsers/messages.d.ts +5 -0
- package/dist/plugin-browsers/safari-dev-plugin.d.ts +8 -3
- package/dist/plugin-browsers~0.mjs +873 -0
- package/dist/plugin-compatibility/compatibility-lib/no-extension-api-files.d.ts +4 -0
- package/dist/plugin-compatibility/feature-polyfill.d.ts +7 -2
- package/dist/plugin-compilation/boring.d.ts +7 -1
- package/dist/plugin-compilation/compilation-lib/js-literal.d.ts +1 -0
- package/dist/plugin-compilation/compilation-lib/messages.d.ts +25 -6
- package/dist/plugin-compilation/env.d.ts +4 -1
- package/dist/plugin-compilation/index.d.ts +3 -4
- package/dist/plugin-compilation/process-module.d.ts +2 -0
- package/dist/plugin-compilation/zip.d.ts +16 -1
- package/dist/plugin-css/common-style-loaders.d.ts +8 -0
- package/dist/plugin-css/css-lib/build-css-rules.d.ts +4 -0
- package/dist/plugin-css/css-lib/dead-url-refs.d.ts +6 -1
- package/dist/plugin-css/css-lib/inline-content-script-css.d.ts +6 -0
- package/dist/plugin-css/css-lib/inline-css-imports.d.ts +45 -0
- package/dist/plugin-css/css-lib/messages.d.ts +26 -5
- package/dist/plugin-css/css-lib/style-diagnostics.d.ts +2 -0
- package/dist/plugin-css/css-lib/user-css-rules.d.ts +5 -0
- package/dist/plugin-css/css-lib/verbatim-css.d.ts +2 -1
- package/dist/plugin-css/css-parse-guard-loader.d.ts +1 -0
- package/dist/plugin-css/css-tools/postcss.d.ts +15 -1
- package/dist/plugin-css/css-tools/sass.d.ts +1 -1
- package/dist/plugin-css/css-tools/tailwind.d.ts +1 -0
- package/dist/plugin-css/dead-css-url-loader.d.ts +4 -0
- package/dist/plugin-css/index.d.ts +5 -3
- package/dist/plugin-css/preprocessor-passthrough-loader.d.ts +5 -0
- package/dist/plugin-css/public-css-url-loader.d.ts +7 -0
- package/dist/plugin-js-frameworks/js-frameworks-lib/load-loader-options.d.ts +3 -1
- package/dist/plugin-js-frameworks/js-frameworks-lib/messages.d.ts +0 -4
- package/dist/plugin-js-frameworks/js-tools/decorators.d.ts +7 -0
- package/dist/plugin-js-frameworks/js-tools/preact.d.ts +3 -1
- package/dist/plugin-js-frameworks/js-tools/react.d.ts +3 -1
- package/dist/plugin-js-frameworks/js-tools/solid.d.ts +3 -1
- package/dist/plugin-js-frameworks/js-tools/svelte.d.ts +13 -2
- package/dist/plugin-js-frameworks/js-tools/typescript-reach.d.ts +7 -0
- package/dist/plugin-js-frameworks/js-tools/typescript.d.ts +9 -17
- package/dist/plugin-js-frameworks/js-tools/vue.d.ts +3 -1
- package/dist/plugin-perf-budgets/categorize.d.ts +9 -1
- package/dist/plugin-perf-budgets/index.d.ts +18 -5
- package/dist/plugin-perf-budgets/messages.d.ts +9 -0
- package/dist/plugin-perf-budgets/referrers.d.ts +2 -2
- package/dist/plugin-playwright/index.d.ts +7 -0
- package/dist/plugin-reload/build-reload.d.ts +9 -0
- package/dist/plugin-reload/index.d.ts +16 -12
- package/dist/plugin-reload/messages.d.ts +2 -0
- package/dist/plugin-reload/reload-after-package.d.ts +3 -0
- package/dist/plugin-reload/reload-lib/content-script-reinject.d.ts +3 -0
- package/dist/plugin-reload/reload-lib/dev-content-scripts.d.ts +3 -4
- package/dist/plugin-reload/steps/add-content-script-reinject.d.ts +7 -0
- package/dist/plugin-reload/steps/inject-bridge-producer.d.ts +7 -0
- package/dist/plugin-reload/steps/inject-bridge-relay.d.ts +6 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/index.d.ts +1 -11
- package/dist/plugin-reload/steps/setup-reload-strategy/setup-background-entry.d.ts +4 -0
- package/dist/plugin-special-folders/emit-root-absolute-refs.d.ts +8 -2
- package/dist/plugin-special-folders/folder-extensions/resolve-config.d.ts +3 -0
- package/dist/plugin-special-folders/folder-extensions/resolve-dirs.d.ts +1 -0
- package/dist/plugin-special-folders/folders-config.d.ts +1 -2
- package/dist/plugin-special-folders/get-data.d.ts +7 -1
- package/dist/plugin-special-folders/messages.d.ts +4 -0
- package/dist/plugin-special-folders/public-private-files.d.ts +15 -0
- package/dist/plugin-special-folders/resolve-public-folder.d.ts +3 -1
- package/dist/plugin-special-folders/walked-scripts.d.ts +6 -0
- package/dist/plugin-special-folders/warn-upon-folder-changes.d.ts +14 -0
- package/dist/plugin-static-assets/index.d.ts +0 -5
- package/dist/plugin-web-extension/feature-chunk-loading/background-entry-name.d.ts +8 -0
- package/dist/plugin-web-extension/feature-chunk-loading/chunk-loading-target.d.ts +7 -0
- package/dist/plugin-web-extension/feature-chunk-loading/content-scripts-meta.d.ts +3 -0
- package/dist/plugin-web-extension/feature-chunk-loading/options.d.ts +22 -0
- package/dist/plugin-web-extension/feature-chunk-loading/runtime-modules/browser-runtime.d.ts +4 -0
- package/dist/plugin-web-extension/feature-chunk-loading/runtime-modules/chunk-loader-fallback.d.ts +2 -0
- package/dist/plugin-web-extension/feature-chunk-loading/runtime-modules/load-script.d.ts +3 -0
- package/dist/plugin-web-extension/feature-chunk-loading/runtime-modules/public-path.d.ts +2 -0
- package/dist/plugin-web-extension/feature-chunk-loading/runtime-modules/template-fn.d.ts +4 -0
- package/dist/plugin-web-extension/feature-chunk-loading/steps/chunk-loader.d.ts +12 -0
- package/dist/plugin-web-extension/feature-chunk-loading/steps/no-danger-name.d.ts +4 -0
- package/dist/plugin-web-extension/feature-html/html-lib/assets.d.ts +2 -1
- package/dist/plugin-web-extension/feature-html/html-lib/messages.d.ts +4 -3
- package/dist/plugin-web-extension/feature-html/html-lib/options-dialog-floor.d.ts +1 -0
- package/dist/plugin-web-extension/feature-html/html-lib/patch-html.d.ts +1 -1
- package/dist/plugin-web-extension/feature-html/html-lib/source-may-ship.d.ts +6 -0
- package/dist/plugin-web-extension/feature-html/html-lib/utils.d.ts +6 -2
- package/dist/plugin-web-extension/feature-html/index.d.ts +2 -0
- package/dist/plugin-web-extension/feature-html/steps/add-assets-to-compilation.d.ts +1 -0
- package/dist/plugin-web-extension/feature-html/steps/add-scripts-and-styles-to-compilation.d.ts +2 -0
- package/dist/plugin-web-extension/feature-html/steps/emit-html-file.d.ts +1 -1
- package/dist/plugin-web-extension/feature-html/steps/throw-if-recompile-is-needed.d.ts +1 -0
- package/dist/plugin-web-extension/feature-json/index.d.ts +9 -3
- package/dist/plugin-web-extension/feature-json/messages.d.ts +1 -0
- package/dist/plugin-web-extension/feature-json/process-assets.d.ts +1 -1
- package/dist/plugin-web-extension/feature-json/resolve-json-resource.d.ts +2 -0
- package/dist/plugin-web-extension/feature-json/track-dependencies.d.ts +1 -1
- package/dist/plugin-web-extension/feature-locales/get-locales.d.ts +1 -0
- package/dist/plugin-web-extension/feature-locales/index.d.ts +1 -2
- package/dist/plugin-web-extension/feature-manifest/index.d.ts +2 -2
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/filter-keys-safari.d.ts +1 -2
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/manifest.d.ts +3 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/shadowed-declaration.d.ts +9 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/theme-values.d.ts +5 -5
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/content_scripts.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/messages.d.ts +38 -2
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/dev-additions.d.ts +3 -0
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/dev-injected-hosts.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/dev-injected-permissions.d.ts +4 -1
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/emitted-evidence.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-csp.d.ts +3 -2
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults.d.ts +1 -0
- package/dist/plugin-web-extension/feature-manifest/steps/emit-manifest.d.ts +5 -1
- package/dist/plugin-web-extension/feature-manifest/steps/patch-chromium-theme-colors.d.ts +5 -0
- package/dist/plugin-web-extension/feature-manifest/steps/patch-gecko-background.d.ts +1 -0
- package/dist/plugin-web-extension/feature-manifest/steps/update-manifest.d.ts +4 -0
- package/dist/plugin-web-extension/feature-manifest/steps/validate-theme-values.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/warn-gecko-unsupported-apis.d.ts +1 -0
- package/dist/plugin-web-extension/feature-manifest/steps/warn-ignored-host-permissions.d.ts +10 -0
- package/dist/plugin-web-extension/feature-manifest/steps/warn-webassembly.d.ts +27 -0
- package/dist/plugin-web-extension/feature-scripts/contracts.d.ts +6 -0
- package/dist/plugin-web-extension/feature-scripts/messages.d.ts +12 -1
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/default-export.d.ts +28 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/front-rules.d.ts +4 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/injected-sheet-urls.d.ts +35 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/top-level-await.d.ts +6 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/utils.d.ts +6 -1
- package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/classic-concat-loader.d.ts +1 -0
- package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/content-script-wrapper.d.ts +6 -1
- package/dist/plugin-web-extension/feature-scripts/steps/add-scripts.d.ts +4 -1
- package/dist/plugin-web-extension/feature-scripts/steps/source-literals.d.ts +1 -0
- package/dist/plugin-web-extension/feature-scripts/steps/trace-runtime-loaded-files.d.ts +22 -1
- package/dist/plugin-web-extension/feature-scripts/steps/warn-main-world-registration-changed.d.ts +0 -2
- package/dist/plugin-web-extension/feature-scripts/steps/warn-split-initial-chunks.d.ts +0 -3
- package/dist/plugin-web-extension/feature-web-resources/index.d.ts +0 -1
- package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/messages.d.ts +0 -1
- package/dist/plugin-web-extension/index.d.ts +2 -0
- package/dist/plugin-web-extension/shared/chunk-loading-target-extensions.d.ts +10 -0
- package/dist/plugin-web-extension/shared/classic-concat.d.ts +9 -0
- package/dist/plugin-web-extension/shared/content-script-wrapper-extensions.d.ts +29 -0
- package/dist/plugin-web-extension/shared/kept-page-paths.d.ts +16 -0
- package/dist/plugin-web-extension/shared/reported-missing-pages.d.ts +2 -0
- package/dist/preprocessor-passthrough-loader.mjs +4 -3
- package/dist/preview-entry.d.ts +2 -2
- package/dist/preview.mjs +6 -2
- package/dist/producer-runtime~0.mjs +3448 -0
- package/dist/public-css-url-loader.mjs +2 -2
- package/dist/q~0.mjs +1 -3
- package/dist/rename-with-retry~0.mjs +33 -0
- package/dist/rj~0.mjs +1 -1
- package/dist/rl~0.mjs +92 -9
- package/dist/rspack-config~0.mjs +16139 -8719
- package/dist/rz~0.mjs +137 -0
- package/dist/r~0.mjs +533 -90
- package/dist/session-end~0.mjs +28 -0
- package/dist/sfc-style-block-loader.mjs +2 -2
- package/dist/solid-jsx-gate-loader.mjs +1 -1
- package/dist/stats-handler~0.mjs +7 -4
- package/dist/sy~0.mjs +3905 -0
- package/dist/s~0.mjs +948 -0
- package/dist/types.d.ts +238 -78
- package/dist/unplaced-style-import-loader.mjs +2 -2
- package/dist/u~0.mjs +312 -0
- package/dist/w~0.mjs +1 -1
- package/dist/xk~0.mjs +778 -0
- package/dist/x~0.mjs +687 -3
- package/dist/y~0.mjs +29 -12
- package/dist/zip~0.mjs +6 -6
- package/dist/z~0.mjs +59 -2208
- package/package.json +5 -17
- package/dist/6l~0.mjs +0 -55
- package/dist/cp~0.mjs +0 -1363
- package/dist/dev-server/frameworks.d.ts +0 -2
- package/dist/df~0.mjs +0 -197
- package/dist/ensure-hmr-for-scripts.js +0 -104
- package/dist/feature-scripts-classic-concat-loader.js +0 -365
- package/dist/feature-scripts-content-script-wrapper.js +0 -310
- package/dist/lib/stable-loader-paths.d.ts +0 -14
- package/dist/main-world-bridge.js +0 -178
- package/dist/minimum-chromium-file.js +0 -5
- package/dist/minimum-firefox-file.js +0 -5
- package/dist/minimum-script-file.js +0 -54
- package/dist/package.json +0 -3
- package/dist/plugin-compilation/clean-dist.d.ts +0 -8
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/index.d.ts +0 -2
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/ChunkLoader.d.ts +0 -12
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/HMRDevServer.d.ts +0 -3
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/InitialChunkFile.d.ts +0 -5
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/NoDangerNamePlugin.d.ts +0 -3
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/AutoPublicPath.d.ts +0 -2
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/BaseUri.d.ts +0 -2
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/BrowserRuntime.d.ts +0 -8
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/ChunkLoaderFallback.d.ts +0 -1
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/EagerlyLoadChunks.d.ts +0 -1
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/LoadScript.d.ts +0 -4
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/PublicPath.d.ts +0 -2
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/ServiceWorkerPlugin.d.ts +0 -6
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/helper.d.ts +0 -12
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/index.d.ts +0 -5
- package/dist/plugin-wasm/index.d.ts +0 -16
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/commands.d.ts +0 -16
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/permissions.d.ts +0 -4
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/host_permissions.d.ts +0 -4
- package/dist/rslib.config.d.ts +0 -3
- package/dist/tm~0.mjs +0 -71
- package/dist/t~0.mjs +0 -102
- package/runtime/process-shim.cjs +0 -53
- /package/dist/{plugin-reload/steps/setup-chunk-loading-target.d.ts → plugin-web-extension/feature-chunk-loading/index.d.ts} +0 -0
- /package/dist/plugin-web-extension/{feature-scripts → feature-chunk-loading}/steps/add-public-path-runtime-module.d.ts +0 -0
package/README.md
CHANGED
|
@@ -25,42 +25,40 @@ pnpm add extension-develop
|
|
|
25
25
|
|
|
26
26
|
```ts
|
|
27
27
|
import {
|
|
28
|
-
extensionDev,
|
|
29
28
|
extensionBuild,
|
|
30
|
-
extensionStart,
|
|
31
|
-
extensionPreview,
|
|
32
|
-
type DevOptions,
|
|
33
29
|
type BuildOptions,
|
|
34
|
-
type
|
|
35
|
-
type PreviewOptions
|
|
30
|
+
type BuildSummary
|
|
36
31
|
} from 'extension-develop'
|
|
32
|
+
import {
|
|
33
|
+
extensionPreview,
|
|
34
|
+
type PreviewLauncherFn,
|
|
35
|
+
type PreviewOptions
|
|
36
|
+
} from 'extension-develop/preview'
|
|
37
|
+
|
|
38
|
+
// Production build of the project in the current folder, with a zip
|
|
39
|
+
const summary: BuildSummary = await extensionBuild(undefined, {
|
|
40
|
+
browser: 'chrome',
|
|
41
|
+
zip: true
|
|
42
|
+
} satisfies BuildOptions)
|
|
37
43
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Production build + zip
|
|
46
|
-
await extensionBuild(undefined, {
|
|
47
|
-
browser: 'firefox',
|
|
48
|
-
zip: true
|
|
49
|
-
} satisfies BuildOptions)
|
|
50
|
-
|
|
51
|
-
// Build then preview from dist/<browser>
|
|
52
|
-
await extensionStart(undefined, {browser: 'edge'} satisfies StartOptions)
|
|
53
|
-
|
|
54
|
-
// Preview using an existing output folder or project path
|
|
55
|
-
await extensionPreview(undefined, {
|
|
56
|
-
browser: 'chrome',
|
|
57
|
-
mode: 'production'
|
|
58
|
-
} satisfies PreviewOptions)
|
|
44
|
+
console.log(summary.errors_count)
|
|
45
|
+
|
|
46
|
+
// This package starts no browser. The caller passes the launcher, which
|
|
47
|
+
// receives the built folder and every unpacked extension to load.
|
|
48
|
+
const launcher: PreviewLauncherFn = async ({browser, extensionsToLoad}) => {
|
|
49
|
+
console.log(`Start ${browser} with`, extensionsToLoad)
|
|
59
50
|
}
|
|
60
51
|
|
|
61
|
-
|
|
52
|
+
// Runs the build in dist/chrome with no dev server
|
|
53
|
+
await extensionPreview(
|
|
54
|
+
undefined,
|
|
55
|
+
{browser: 'chrome', mode: 'production'} satisfies PreviewOptions,
|
|
56
|
+
launcher
|
|
57
|
+
)
|
|
62
58
|
```
|
|
63
59
|
|
|
60
|
+
The `extension-develop/manifest` entry is deprecated and is removed in the next minor.
|
|
61
|
+
|
|
64
62
|
## Features
|
|
65
63
|
|
|
66
64
|
- Live reload/HMR development server with per-instance browser runners
|
|
@@ -70,7 +68,7 @@ run()
|
|
|
70
68
|
- Zipping: distribution and/or source packages (respects `.gitignore`)
|
|
71
69
|
- Auto-install of missing build + optional dependencies on first run
|
|
72
70
|
- Type generation for TS projects via `extension-env.d.ts`
|
|
73
|
-
- User config via `extension.config.(js|mjs)` for commands, browser start, unified logger defaults, and
|
|
71
|
+
- User config via `extension.config.(js|mjs)` for commands, browser start, unified logger defaults, and the bundler config hooks (`config`, `configResolved`)
|
|
74
72
|
- Managed dependency guard to avoid conflicts
|
|
75
73
|
|
|
76
74
|
## Commands
|
|
@@ -85,73 +83,102 @@ run()
|
|
|
85
83
|
|
|
86
84
|
## Command options
|
|
87
85
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
|
|
|
86
|
+
Each table lists fields of the exported option types `DevOptions`, `BuildOptions`, `StartOptions` and `PreviewOptions`, under the commands whose type has them. Every field is optional except `browser` and, for `start`, `mode`.
|
|
87
|
+
|
|
88
|
+
`extensionDev` and `extensionPreview` start a browser only through a launcher the caller passes. This package exports no `extensionStart`. `StartOptions` types the `start` command the CLI runs as `extensionBuild` followed by `extensionPreview`.
|
|
89
|
+
|
|
90
|
+
### dev, build, start and preview
|
|
91
|
+
|
|
92
|
+
| Option | Type / Values | Description |
|
|
93
|
+
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
94
|
+
| `browser` | chrome, edge, firefox, safari, chromium, brave, opera, vivaldi, yandex, waterfox, librewolf, zen, floorp, chromium-based, gecko-based, firefox-based, webkit-based, chromium-emulator | Target browser |
|
|
95
|
+
| `mode` | development, production, none | Bundler mode. `dev` always runs `development`, `start` and `preview` take `production` only, `build` defaults to `production` |
|
|
96
|
+
| `chromiumBinary` | string | Path of a Chromium-based executable to run |
|
|
97
|
+
| `geckoBinary` | string | Path of a Gecko-based executable to run |
|
|
98
|
+
| `firefoxBinary` | string | Same as `geckoBinary`, which wins when both are set |
|
|
99
|
+
| `extensions` | string[] or `{dir, paths}` | Companion extensions for this command, see "Companion extensions" below |
|
|
100
|
+
|
|
101
|
+
### dev, start and preview
|
|
102
|
+
|
|
103
|
+
| Option | Type / Values | Description |
|
|
104
|
+
| -------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
105
|
+
| `noOpen` | boolean | Start the browser without opening a tab for the extension |
|
|
106
|
+
| `noBrowser` | boolean | Start no browser at all |
|
|
107
|
+
| `profile` | string or false | Profile folder to use. `false` asks for the browser's own default profile. Defaults to a fresh managed profile |
|
|
108
|
+
| `persistProfile` | boolean | Reuse one managed profile across runs, off by default |
|
|
109
|
+
| `keepProfileChanges` | boolean | Keep the managed profile and what the run changed in it |
|
|
110
|
+
| `copyFromProfile` | string | Seed the managed profile from a copy of this profile folder, on first creation |
|
|
111
|
+
| `startingUrl` | string | Page to open when the browser starts |
|
|
112
|
+
| `port` | number or string | `dev`: the dev server port, 8080 by default. `start` and `preview`: handed to the launcher, which seeds the browser debug port from it |
|
|
113
|
+
| `host` | string | Address to bind, 127.0.0.1 by default. `dev` binds the dev server, `start` and `preview` bind the control channel |
|
|
114
|
+
| `publicHost` | string | `dev`: the address the browser dials when it differs from `host`. Accepted and unused by `start` and `preview` |
|
|
115
|
+
| `logLevel` | off, error, warn, info, debug, trace, all | Lowest level of browser log printed in the terminal, `off` by default |
|
|
116
|
+
| `logContexts` | array of: background, content, page, popup, options, sidebar, devtools, newtab, history, bookmarks | Contexts whose logs print. Leave unset for all of them |
|
|
117
|
+
| `logFormat` | pretty, json, ndjson | Output format of the printed logs, `pretty` by default |
|
|
118
|
+
| `logTimestamps` | boolean | Timestamps in `pretty` output, on by default |
|
|
119
|
+
| `logColor` | boolean | Colors in `pretty` output, on by default |
|
|
120
|
+
| `logUrl` | string | Print only logs whose URL holds this text or matches this `/regex/flags` literal |
|
|
121
|
+
| `logTab` | number or string | Print only logs from this tab id |
|
|
122
|
+
| `preferences` | object | Browser preferences to set in the profile |
|
|
123
|
+
| `browserFlags` | string[] | Extra flags for the browser command line |
|
|
124
|
+
| `excludeBrowserFlags` | string[] | Default flags to leave off the browser command line |
|
|
125
|
+
|
|
126
|
+
### dev and build
|
|
127
|
+
|
|
128
|
+
| Option | Type / Values | Description |
|
|
129
|
+
| ----------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
130
|
+
| `polyfill` | boolean | Bundle `webextension-polyfill` on a Chromium target, off by default |
|
|
131
|
+
| `safariBinary` | string | Path of a Safari or WebKit-based app to run |
|
|
132
|
+
| `appName` | string | Safari app name, the manifest name by default |
|
|
133
|
+
| `bundleId` | string | Safari bundle identifier |
|
|
134
|
+
| `developmentTeam` | string | Apple development team that signs the Safari app |
|
|
135
|
+
| `macOsOnly` | boolean | Generate the macOS-only Xcode project, on by default |
|
|
136
|
+
| `appIcon` | string | Square 1024 px PNG the Safari app icon set is made from, relative to the project |
|
|
137
|
+
| `forceRegenerate` | boolean | Regenerate the Xcode project even when it is current |
|
|
138
|
+
| `safariPackager` | function | The callback that packages the Safari app. Without it no Safari app is produced |
|
|
139
|
+
| `zip` | boolean | `build`: package `dist/<browser>` as an archive. Accepted and unused by `dev`, which writes no archive |
|
|
140
|
+
| `zipSource` | boolean | `build`: package the source files, respecting `.gitignore`. Unused by `dev` |
|
|
141
|
+
| `zipFilename` | string | `build`: base name of the archives. Unused by `dev` |
|
|
142
|
+
| `zipDir` | string | `build`: folder for the archives, relative to the project or absolute. Unused by `dev` |
|
|
143
|
+
| `sourceMaps` | boolean | `build`: write a `.map` file beside each script and stylesheet of a production build, never zipped. Unused by `dev`, which always writes maps |
|
|
144
|
+
| `exitOnError` | boolean | `dev`: exit the process with code 1 on a failed session, off by default for a library. Deprecated and ignored by `build`: a failed build rejects and the caller owns the exit |
|
|
101
145
|
|
|
102
146
|
### dev
|
|
103
147
|
|
|
104
|
-
| Option
|
|
105
|
-
|
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
|
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
| sourceMeta | boolean | Output page metadata (readyState, viewport, frames) |
|
|
114
|
-
| sourceProbe | string[] | CSS selectors to probe for quick validation |
|
|
115
|
-
| sourceTree | off,root-only | Output a compact extension root tree |
|
|
116
|
-
| sourceConsole | boolean | Output console summary (best-effort) |
|
|
117
|
-
| sourceDom | boolean | Output DOM snapshots and diffs |
|
|
118
|
-
| sourceMaxBytes | number | Limit HTML output size in bytes (0 disables truncation) |
|
|
119
|
-
| sourceRedact | off,safe,strict | Redact sensitive content in HTML output |
|
|
120
|
-
| sourceIncludeShadow | off,open-only,all | Control Shadow DOM inclusion |
|
|
121
|
-
| sourceDiff | boolean | Include diff metadata on watch updates |
|
|
122
|
-
| logs | off,error,warn,info,debug,trace,all | Unified logger verbosity (all shows everything) |
|
|
123
|
-
| logContext | list or `all` | Comma-separated contexts (background,content,page,sidebar,popup,options,devtools) |
|
|
124
|
-
| logFormat | pretty,json,ndjson | Pretty text or JSON/NDJSON output |
|
|
125
|
-
| logTimestamps | boolean | Include timestamps in pretty output |
|
|
126
|
-
| logColor | boolean | Colorize pretty output |
|
|
127
|
-
| logUrl | string or /regex/flags | Filter by URL substring or JS-style regex literal |
|
|
128
|
-
| logTab | number | Filter by tabId |
|
|
148
|
+
| Option | Type / Values | Description |
|
|
149
|
+
| --------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------ |
|
|
150
|
+
| `allowedHosts` | string or string[] | Extra host names the dev server answers. A leading dot allows every subdomain |
|
|
151
|
+
| `hashContentScripts` | boolean | Put a content hash in each content script file name, on by default |
|
|
152
|
+
| `allowControl` | boolean | Open the control channel for the act verbs |
|
|
153
|
+
| `allowEval` | boolean | Also allow the `eval` verb. Implies `allowControl` |
|
|
154
|
+
| `hintFor` | function | The hint for a terminal `failed` or `usage` frame that carries none. Called with the code, returns a string or undefined |
|
|
155
|
+
|
|
156
|
+
A host that learns a session cannot go on calls `endSessionAsFailed(code, message, instanceId?)`, exported beside `extensionDev`. It ends the named session, or the newest one, with one `failed` frame and answers `false` when that session is not live or is already stopping. A host that did not pass `exitOnError` keeps running.
|
|
129
157
|
|
|
130
158
|
### build
|
|
131
159
|
|
|
132
|
-
| Option
|
|
133
|
-
|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
136
|
-
|
|
|
137
|
-
|
|
|
138
|
-
|
|
|
139
|
-
| polyfill | boolean | Bundle `webextension-polyfill` on Chromium, off by default |
|
|
140
|
-
| silent | boolean | Suppress non-error logs |
|
|
160
|
+
| Option | Type / Values | Description |
|
|
161
|
+
| --------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
162
|
+
| `outDir` | string | Base folder of the output, relative to the project. The build writes `<outDir>/<browser>`, `dist/<browser>` by default |
|
|
163
|
+
| `silent` | boolean | Print nothing on stdout. A failure still prints |
|
|
164
|
+
| `addonLint` | boolean | Run `addons-linter` over a production build for a Gecko target, on by default when it is installed |
|
|
165
|
+
| `minify` | boolean | Minify first-party code in a production build. On by default, off for `opera` |
|
|
166
|
+
| `failOnWarning` | boolean | Deprecated. Nothing reads it, a build never fails on a warning |
|
|
141
167
|
|
|
142
168
|
### start
|
|
143
169
|
|
|
144
|
-
| Option
|
|
145
|
-
|
|
|
146
|
-
|
|
|
147
|
-
| polyfill | boolean | Bundle `webextension-polyfill`, default off |
|
|
170
|
+
| Option | Type / Values | Description |
|
|
171
|
+
| ---------- | ------------- | ------------------------------------------------------------------- |
|
|
172
|
+
| `polyfill` | boolean | Bundle `webextension-polyfill` on a Chromium target, off by default |
|
|
148
173
|
|
|
149
174
|
### preview
|
|
150
175
|
|
|
151
|
-
| Option
|
|
152
|
-
|
|
|
153
|
-
|
|
|
154
|
-
|
|
|
176
|
+
| Option | Type / Values | Description |
|
|
177
|
+
| -------------- | ------------- | ---------------------------------------------------------------- |
|
|
178
|
+
| `outputPath` | string | Folder to run from, `dist/<browser>` by default |
|
|
179
|
+
| `allowControl` | boolean | Open the control channel for the act verbs on the production run |
|
|
180
|
+
| `allowEval` | boolean | Also allow the `eval` verb. Implies `allowControl` |
|
|
181
|
+
| `dryRun` | boolean | Handed to the launcher, which then starts no browser |
|
|
155
182
|
|
|
156
183
|
## Project detection and inputs
|
|
157
184
|
|
|
@@ -229,12 +256,14 @@ export default {
|
|
|
229
256
|
- `extension.config.*` runs in a Node context during command startup.
|
|
230
257
|
- Use `process.env.*` to read environment variables inside the config file.
|
|
231
258
|
- `import.meta.env.*` is available in your extension code at bundle time (via the Env plugin), not in the Node config.
|
|
232
|
-
-
|
|
233
|
-
1. `.env.
|
|
234
|
-
2. `.env
|
|
235
|
-
3. `.env
|
|
236
|
-
4. `.env`
|
|
237
|
-
|
|
259
|
+
- Before the config runs, develop loads the env files that match the running mode and browser into `process.env`. Values layer key by key: every matching file is read, and for each key the strongest file that sets it wins. A value already set in the shell or CI wins over every file. Strongest first:
|
|
260
|
+
1. `.env.<browser>.<mode>`, then `.env.<browser>`, for the browser and then for each name of its family (for example `.env.chrome.production`, `.env.chrome`, `.env.chromium`). These apply once the browser is known.
|
|
261
|
+
2. `.env.<mode>.local`
|
|
262
|
+
3. `.env.<mode>` (`development` for `dev`, `production` otherwise)
|
|
263
|
+
4. `.env.local`
|
|
264
|
+
5. `.env`
|
|
265
|
+
6. `.env.defaults` (weakest, it only fills keys no other file sets)
|
|
266
|
+
- In a monorepo, a package with none of the files 1 to 5 reads them from the nearest workspace root instead (the directory containing `pnpm-workspace.yaml`), even when the package has its own `.env.defaults`. The root's `.env.defaults` is then the weakest layer, the package's `.env.defaults` comes above it, and the root's other env files come above both. A package with any of the files 1 to 5 reads only its own folder.
|
|
238
267
|
- Only variables you read explicitly in the config are used there; client-side injection still requires the `EXTENSION_PUBLIC_*` prefix.
|
|
239
268
|
- Example:
|
|
240
269
|
|
|
@@ -302,11 +331,17 @@ dist/
|
|
|
302
331
|
| Name | Group | Summary |
|
|
303
332
|
| -------------------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
304
333
|
| plugin-web-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 |
|
|
305
|
-
| plugin-css | core | - Auto‑wires CSS for HTML and content scripts<br/>- Optional SASS/LESS/PostCSS when configs exist
|
|
334
|
+
| plugin-css | core | - Auto‑wires CSS for HTML and content scripts<br/>- Optional SASS/LESS/PostCSS when configs exist |
|
|
306
335
|
| 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 |
|
|
307
|
-
| plugin-static-assets | core | - Emits images, fonts, and misc files to `assets/`<br/>- Inlines
|
|
336
|
+
| plugin-static-assets | core | - Emits images, fonts, and misc files to `assets/`<br/>- Inlines files up to 2 KB, emits larger ones<br/>- Content-hashed names in development and production<br/>- Steps aside for user asset rules<br/>- Appends `.wasm` to the resolve extensions |
|
|
308
337
|
| plugin-compatibility | core | - Cross‑browser helpers<br/>- Normalizes browser‑specific manifest fields<br/>- Optional `webextension-polyfill` for Chromium (skipped for Firefox/Safari) |
|
|
309
338
|
| plugin-compilation | core | - Loads env and templating (`EXTENSION_PUBLIC_*`)<br/>- Optional `dist/<browser>` cleaning<br/>- Compact, de‑duplicated compilation summary |
|
|
339
|
+
| plugin-special-folders | core | - Copies `public/` to the output root<br/>- Builds the pages in `pages/` and the scripts in `scripts/`<br/>- Resolves companion extensions from `extensions/`<br/>- Applies the `include` and `exclude` lists |
|
|
340
|
+
| plugin-wasm | core | - Enables async WebAssembly<br/>- Resolves `.wasm` imports<br/>- Aliases runtime wasm assets |
|
|
341
|
+
| plugin-perf-budgets | core | - Size budgets per extension surface<br/>- Replaces the bundler's single size threshold |
|
|
342
|
+
| plugin-reload | dev | - Reload and HMR strategy of `extension dev`<br/>- Injects the dev reload runtime<br/>- Classifies each change and dispatches the reload<br/>- Does nothing outside a dev session |
|
|
343
|
+
| plugin-playwright | dev | - Writes the session contract (`ready.json`, `events.ndjson`) under `dist/extension-js/<browser>`<br/>- Read by `--wait`, `logs` and automation |
|
|
344
|
+
| plugin-browsers | dev | - Launches the target browser with the built extension loaded<br/>- Passed in by the CLI, absent under `--no-browser` |
|
|
310
345
|
|
|
311
346
|
## Notes and compatibility
|
|
312
347
|
|
package/dist/3~0.mjs
CHANGED
package/dist/5h~0.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "node:module";
|
|
2
2
|
import { spawnSync } from "node:child_process";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { sessionArtifactsRootDir, browserArtifactsDir } from "./7~0.mjs";
|
|
4
|
+
import { humanLine } from "./ke~0.mjs";
|
|
5
|
+
import { sessionStateIgnoreAdded } from "./k~0.mjs";
|
|
5
6
|
import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
|
|
6
7
|
import * as __rspack_external_node_path_806ed179 from "node:path";
|
|
7
8
|
function sessionStateDir(projectPath) {
|
|
@@ -30,9 +31,6 @@ function ensureSessionStateIgnoreFile(projectPath) {
|
|
|
30
31
|
if (!__rspack_external_node_fs_1b05aee1.existsSync(ignoreFile)) __rspack_external_node_fs_1b05aee1.writeFileSync(ignoreFile, SESSION_STATE_IGNORE_CONTENT);
|
|
31
32
|
} catch {}
|
|
32
33
|
}
|
|
33
|
-
function sessionArtifactsRootDir(projectPath) {
|
|
34
|
-
return __rspack_external_node_path_806ed179.resolve(projectPath, 'dist', 'extension-js');
|
|
35
|
-
}
|
|
36
34
|
const SESSION_ARTIFACTS_IGNORE_CONTENT = "# Extension.js session state: managed browser profiles (cookies, history,\n# logins), session logs and machine contracts. Personal data lives here:\n# this directory must never be committed or shipped.\n*\n";
|
|
37
35
|
function sessionArtifactsIgnoreFilePath(projectPath) {
|
|
38
36
|
return __rspack_external_node_path_806ed179.join(sessionArtifactsRootDir(projectPath), '.gitignore');
|
|
@@ -132,18 +130,12 @@ function ensureSessionStateInProjectGitignore(projectPath) {
|
|
|
132
130
|
humanLine(sessionStateIgnoreAdded(gitignorePath));
|
|
133
131
|
} catch {}
|
|
134
132
|
}
|
|
135
|
-
function browserArtifactsDir(projectPath, browser) {
|
|
136
|
-
return __rspack_external_node_path_806ed179.join(sessionArtifactsRootDir(projectPath), browser);
|
|
137
|
-
}
|
|
138
133
|
function browserProfileRootDir(projectPath, browser) {
|
|
139
134
|
return __rspack_external_node_path_806ed179.join(sessionArtifactsRootDir(projectPath), 'profiles', `${browser}-profile`);
|
|
140
135
|
}
|
|
141
136
|
function browserDistDir(projectPath, browser) {
|
|
142
137
|
return __rspack_external_node_path_806ed179.resolve(projectPath, 'dist', browser);
|
|
143
138
|
}
|
|
144
|
-
function readyContractPath(projectPath, browser) {
|
|
145
|
-
return __rspack_external_node_path_806ed179.join(browserArtifactsDir(projectPath, browser), 'ready.json');
|
|
146
|
-
}
|
|
147
139
|
function eventsPath(projectPath, browser) {
|
|
148
140
|
return __rspack_external_node_path_806ed179.join(browserArtifactsDir(projectPath, browser), 'events.ndjson');
|
|
149
141
|
}
|
|
@@ -156,4 +148,4 @@ function actionsPath(projectPath, browser) {
|
|
|
156
148
|
function buildSummaryPath(projectPath, browser) {
|
|
157
149
|
return __rspack_external_node_path_806ed179.join(browserArtifactsDir(projectPath, browser), 'build-summary.json');
|
|
158
150
|
}
|
|
159
|
-
export { CONTROL_TOKEN_FILE_PREFIX, actionsPath,
|
|
151
|
+
export { CONTROL_TOKEN_FILE_PREFIX, actionsPath, browserDistDir, browserProfileRootDir, buildSummaryPath, controlPortFilePath, controlTokenPath, ensureSessionArtifactsIgnoreFile, ensureSessionStateIgnoreFile, ensureSessionStateInProjectGitignore, eventsPath, legacyControlPortFilePath, legacyControlTokenPath, logsPath, sessionStateDir };
|
package/dist/5~0.mjs
CHANGED
|
@@ -1,10 +1,66 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { isGeckoBasedBrowser } from "./q~0.mjs";
|
|
2
3
|
function stripBom(text) {
|
|
3
4
|
const raw = 'string' == typeof text ? text : String(text || '');
|
|
4
5
|
return raw && 0xfeff === raw.charCodeAt(0) ? raw.slice(1) : raw;
|
|
5
6
|
}
|
|
7
|
+
function blankJsonComments(source) {
|
|
8
|
+
const raw = stripBom(source);
|
|
9
|
+
let out = '';
|
|
10
|
+
let hasComments = false;
|
|
11
|
+
let firstBlockComment = -1;
|
|
12
|
+
let i = 0;
|
|
13
|
+
while(i < raw.length){
|
|
14
|
+
const char = raw[i];
|
|
15
|
+
if ('"' === char) {
|
|
16
|
+
let j = i + 1;
|
|
17
|
+
while(j < raw.length && '"' !== raw[j] && '\n' !== raw[j])j += '\\' === raw[j] ? 2 : 1;
|
|
18
|
+
out += raw.slice(i, j + 1);
|
|
19
|
+
i = j + 1;
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
if ('/' === char && '/' === raw[i + 1]) {
|
|
23
|
+
let j = i;
|
|
24
|
+
while(j < raw.length && '\n' !== raw[j] && '\r' !== raw[j])j++;
|
|
25
|
+
out += ' '.repeat(j - i);
|
|
26
|
+
hasComments = true;
|
|
27
|
+
i = j;
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
if ('/' === char && '*' === raw[i + 1]) {
|
|
31
|
+
const end = raw.indexOf('*/', i + 2);
|
|
32
|
+
if (-1 !== end) {
|
|
33
|
+
out += raw.slice(i, end + 2).replace(/[^\r\n]/g, ' ');
|
|
34
|
+
hasComments = true;
|
|
35
|
+
if (-1 === firstBlockComment) firstBlockComment = i;
|
|
36
|
+
i = end + 2;
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
out += char;
|
|
41
|
+
i++;
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
text: out,
|
|
45
|
+
hasComments,
|
|
46
|
+
firstBlockComment
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function hasJsonComments(source) {
|
|
50
|
+
return blankJsonComments(source).hasComments;
|
|
51
|
+
}
|
|
52
|
+
function lineAndColumn(text, offset) {
|
|
53
|
+
const before = text.slice(0, offset).split('\n');
|
|
54
|
+
return `line ${before.length} column ${before[before.length - 1].length + 1}`;
|
|
55
|
+
}
|
|
56
|
+
function parseAuthoredJson(source, options = {}) {
|
|
57
|
+
const scan = blankJsonComments(source);
|
|
58
|
+
if (-1 !== scan.firstBlockComment && options.browser && isGeckoBasedBrowser(String(options.browser))) throw new SyntaxError(`Firefox does not read a /* */ block comment, found at ${lineAndColumn(scan.text, scan.firstBlockComment)}. Write it as // line comments, which Chromium and Firefox both read`);
|
|
59
|
+
return JSON.parse(options.emptyAsObject && !scan.text ? '{}' : scan.text);
|
|
60
|
+
}
|
|
6
61
|
function parseJsonSafe(text) {
|
|
7
|
-
|
|
8
|
-
|
|
62
|
+
return parseAuthoredJson(text, {
|
|
63
|
+
emptyAsObject: true
|
|
64
|
+
});
|
|
9
65
|
}
|
|
10
|
-
export { parseJsonSafe, stripBom };
|
|
66
|
+
export { hasJsonComments, parseAuthoredJson, parseJsonSafe, stripBom };
|