extension-develop 4.1.39 → 4.1.40-canary.458.001a6a0
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 +7 -4
- package/dist/{771~0.mjs → 5h~0.mjs} +13 -3
- package/dist/{273~0.mjs → 6l~0.mjs} +1 -1
- package/dist/{524~0.mjs → 9~0.mjs} +18 -2
- package/dist/{640~0.mjs → bh~0.mjs} +6 -1
- package/dist/bridge.mjs +14 -8
- package/dist/b~0.mjs +8568 -0
- package/dist/command-dev.d.ts +2 -0
- package/dist/command-preview.d.ts +2 -0
- package/dist/contracts.mjs +2 -1
- package/dist/{469~0.mjs → cp~0.mjs} +30 -18
- package/dist/css-parse-guard-loader.mjs +2 -2
- package/dist/c~0.mjs +56 -0
- package/dist/dead-css-url-loader.mjs +20 -119
- package/dist/dev-server/control-bridge/actions-file.d.ts +7 -0
- package/dist/dev-server/control-bridge/broker.d.ts +42 -2
- package/dist/dev-server/control-bridge/consumer-client.d.ts +7 -0
- package/dist/dev-server/control-bridge/contracts.d.ts +29 -1
- package/dist/dev-server/control-bridge/logs-file.d.ts +6 -0
- package/dist/dev-server/control-bridge/loopback.d.ts +1 -0
- package/dist/dev-server/control-bridge/producer-runtime.d.ts +5 -2
- package/dist/dev-server/control-bridge/production-control.d.ts +1 -0
- package/dist/dev-server/control-bridge/session-token.d.ts +5 -2
- package/dist/dev-server/cors.d.ts +4 -2
- package/dist/dev-server/messages.d.ts +6 -0
- package/dist/dev-server/session-restart.d.ts +3 -1
- package/dist/dev-server~0.mjs +71 -129
- package/dist/df~0.mjs +197 -0
- package/dist/{846~0.mjs → d~0.mjs} +4 -3
- package/dist/ensure-hmr-for-scripts.js +3 -3
- package/dist/ensure-hmr-for-scripts.mjs +3 -3
- 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/pages/welcome.js +2 -2
- package/dist/extension-js-devtools/chromium/background/service_worker.js +2 -2
- 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/pages/welcome.js +2 -2
- package/dist/extension-js-devtools/firefox/background/scripts.js +2 -2
- package/dist/extension-js-devtools/firefox/pages/welcome.js +2 -2
- package/dist/extension-js-theme/build-stamp.json +2 -2
- package/dist/{143~0.mjs → ey~0.mjs} +2 -2
- package/dist/e~0.mjs +33 -0
- package/dist/feature-scripts-classic-traced-globals-loader.mjs +7 -2
- package/dist/feature-scripts-content-script-wrapper.js +55 -17
- package/dist/feature-scripts-content-script-wrapper.mjs +55 -17
- package/dist/feature-scripts-native-geturl-import-loader.mjs +1 -1
- package/dist/{105~0.mjs → g0~0.mjs} +1 -1
- package/dist/{88~0.mjs → j6~0.mjs} +9 -1
- package/dist/{731~0.mjs → j~0.mjs} +2 -2
- package/dist/{712~0.mjs → ka~0.mjs} +18 -2
- package/dist/{852~0.mjs → k~0.mjs} +4 -2
- package/dist/late-css-import-loader.mjs +1 -1
- package/dist/lib/addon-lint.d.ts +6 -0
- package/dist/lib/build-summary.d.ts +6 -0
- package/dist/lib/dev-additions.d.ts +12 -0
- package/dist/lib/extension-base-from-stack.d.ts +16 -0
- package/dist/lib/localized-manifest-name.d.ts +9 -0
- package/dist/lib/messages.d.ts +5 -2
- package/dist/lib/process-started-at.d.ts +1 -0
- package/dist/lib/real-path.d.ts +8 -0
- package/dist/lib/resource-path.d.ts +1 -0
- package/dist/lib/session-paths.d.ts +2 -0
- package/dist/lib/split-chunks.d.ts +2 -1
- package/dist/lib/stats-handler.d.ts +1 -0
- package/dist/lib/tsconfig-includes-file.d.ts +1 -0
- package/dist/l~0.mjs +2290 -0
- package/dist/main-world-bridge.js +92 -23
- package/dist/main-world-bridge.mjs +92 -23
- package/dist/manifest-entry.d.ts +2 -0
- package/dist/manifest.mjs +3 -1
- package/dist/module.mjs +3 -3
- package/dist/{832~0.mjs → m~0.mjs} +2242 -286
- package/dist/o~0.mjs +47 -0
- package/dist/plugin-browsers/index.d.ts +7 -0
- package/dist/plugin-browsers/safari-dev-plugin.d.ts +2 -0
- package/dist/plugin-compatibility/compatibility-lib/messages.d.ts +1 -1
- package/dist/plugin-compatibility/compatibility-lib/native-browser-namespace.d.ts +5 -0
- package/dist/plugin-compatibility/feature-browser-global.d.ts +4 -0
- package/dist/plugin-compilation/compilation-lib/messages.d.ts +4 -1
- package/dist/plugin-compilation/env.d.ts +1 -0
- package/dist/plugin-compilation/index.d.ts +2 -0
- package/dist/plugin-compilation/node-builtins.d.ts +5 -0
- package/dist/plugin-compilation/one-diagnostic-per-location.d.ts +13 -0
- package/dist/plugin-compilation/resolve-file-requests.d.ts +16 -0
- package/dist/plugin-compilation/warm-ancestor-watchers.d.ts +19 -0
- package/dist/plugin-compilation/watch-real-project-path.d.ts +27 -0
- package/dist/plugin-compilation/zip.d.ts +2 -0
- package/dist/plugin-css/css-in-content-script-loader.d.ts +1 -1
- package/dist/plugin-css/css-lib/build-css-rules.d.ts +3 -0
- package/dist/plugin-css/css-lib/inline-content-script-css.d.ts +3 -1
- package/dist/plugin-css/css-lib/messages.d.ts +4 -0
- package/dist/plugin-css/css-lib/sfc-style-block.d.ts +26 -0
- package/dist/plugin-css/css-lib/unplaced-style-imports.d.ts +7 -0
- package/dist/plugin-css/css-lib/verbatim-css.d.ts +1 -0
- package/dist/plugin-css/dead-css-url-loader.d.ts +9 -1
- package/dist/plugin-css/index.d.ts +1 -0
- package/dist/plugin-css/sfc-style-block-loader.d.ts +18 -0
- package/dist/plugin-css/unplaced-style-import-loader.d.ts +16 -0
- package/dist/plugin-playwright/index.d.ts +22 -0
- package/dist/plugin-reload/classify-reload.d.ts +20 -0
- package/dist/plugin-reload/index.d.ts +4 -2
- package/dist/plugin-reload/messages.d.ts +1 -0
- package/dist/plugin-reload/reload-dispatch.d.ts +21 -2
- package/dist/plugin-reload/reload-lib/dev-content-scripts.d.ts +6 -0
- package/dist/plugin-reload/reload-lib/scripts-replay-shim.d.ts +1 -1
- package/dist/plugin-reload/steps/inject-bridge-producer.d.ts +6 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/ChunkLoader.d.ts +3 -0
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/AutoPublicPath.d.ts +1 -1
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/BaseUri.d.ts +1 -1
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/LoadScript.d.ts +1 -1
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/lib/webpack5/RuntimeModules/PublicPath.d.ts +1 -1
- package/dist/plugin-special-folders/get-data.d.ts +2 -0
- package/dist/plugin-special-folders/hint-import-only-scripts.d.ts +4 -0
- package/dist/plugin-special-folders/include-files.d.ts +2 -0
- package/dist/plugin-special-folders/messages.d.ts +1 -0
- package/dist/plugin-web-extension/feature-html/html-lib/inject.d.ts +1 -1
- package/dist/plugin-web-extension/feature-html/html-lib/patch-html.d.ts +1 -0
- package/dist/plugin-web-extension/feature-html/steps/update-html-file.d.ts +1 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/filter-keys-gecko.d.ts +21 -0
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/filter-keys-safari.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/webkit-unsupported-keys.d.ts +15 -0
- package/dist/plugin-web-extension/feature-manifest/messages.d.ts +7 -0
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/dev-additions.d.ts +8 -0
- package/dist/plugin-web-extension/feature-manifest/steps/warn-description-length.d.ts +25 -0
- package/dist/plugin-web-extension/feature-manifest/steps/warn-gecko-unsupported-apis.d.ts +2 -2
- package/dist/plugin-web-extension/feature-scripts/contracts.d.ts +3 -0
- package/dist/plugin-web-extension/feature-scripts/index.d.ts +1 -0
- package/dist/plugin-web-extension/feature-scripts/messages.d.ts +9 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/completion-value.d.ts +13 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/injected-sheet-urls.d.ts +5 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/main-world-bridge-pairing.d.ts +5 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/main-world-copy-routing.d.ts +2 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/registration-worlds.d.ts +10 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/runtime-main-world-scripts.d.ts +25 -2
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/runtime-script-sheet.d.ts +14 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/taken-extension-base.d.ts +10 -0
- package/dist/plugin-web-extension/feature-scripts/steps/add-base-uri-runtime-module.d.ts +7 -1
- package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/content-script-wrapper.d.ts +2 -0
- package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/index.d.ts +2 -0
- package/dist/plugin-web-extension/feature-scripts/steps/add-public-path-runtime-module.d.ts +6 -0
- package/dist/plugin-web-extension/feature-scripts/steps/classic-traced-globals-loader.d.ts +1 -0
- package/dist/plugin-web-extension/feature-scripts/steps/compile-main-world-scripts.d.ts +4 -0
- package/dist/plugin-web-extension/feature-scripts/steps/keep-completion-value.d.ts +6 -0
- package/dist/plugin-web-extension/feature-scripts/steps/pair-runtime-main-world-bridges.d.ts +12 -0
- package/dist/plugin-web-extension/feature-scripts/steps/place-runtime-script-sheets.d.ts +12 -0
- package/dist/plugin-web-extension/feature-scripts/steps/prune-main-world-bridges.d.ts +1 -0
- package/dist/plugin-web-extension/feature-scripts/steps/root-injected-sheet-urls.d.ts +9 -0
- package/dist/plugin-web-extension/feature-scripts/steps/route-main-world-copies.d.ts +10 -0
- package/dist/plugin-web-extension/feature-scripts/steps/source-literals.d.ts +24 -0
- package/dist/plugin-web-extension/feature-scripts/steps/take-extension-base.d.ts +11 -0
- package/dist/plugin-web-extension/feature-scripts/steps/trace-runtime-loaded-files.d.ts +18 -3
- package/dist/plugin-web-extension/feature-scripts/steps/warn-main-world-registration-changed.d.ts +12 -0
- package/dist/plugin-web-extension/feature-scripts/steps/warn-moved-page-relative-urls.d.ts +30 -0
- package/dist/plugin-web-extension/feature-scripts/steps/warn-page-relative-script-path.d.ts +10 -0
- package/dist/plugin-web-extension/feature-scripts/steps/warn-unknown-registration-world.d.ts +10 -0
- package/dist/plugin-web-extension/feature-web-resources/collect-entry-imports.d.ts +1 -0
- package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/messages.d.ts +1 -0
- package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/page-requests.d.ts +5 -0
- package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/resolve-war.d.ts +1 -0
- package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/unreachable-resources.d.ts +1 -0
- package/dist/plugin-web-extension/shared/script-graph.d.ts +12 -0
- package/dist/preprocessor-passthrough-loader.mjs +1 -1
- package/dist/preview.mjs +1 -1
- package/dist/public-css-url-loader.mjs +1 -1
- package/dist/{331~0.mjs → q~0.mjs} +2 -2
- package/dist/rj~0.mjs +125 -0
- package/dist/{519~0.mjs → rl~0.mjs} +53 -3
- package/dist/rspack-config~0.mjs +2768 -3256
- package/dist/{177~0.mjs → r~0.mjs} +2 -2
- package/dist/sfc-style-block-loader.mjs +49 -0
- package/dist/stats-handler~0.mjs +15 -7
- package/dist/tm~0.mjs +71 -0
- package/dist/types.d.ts +43 -3
- package/dist/{285~0.mjs → t~0.mjs} +41 -26
- package/dist/unplaced-style-import-loader.mjs +131 -0
- package/dist/x~0.mjs +3 -0
- package/dist/y~0.mjs +234 -0
- package/dist/zip~0.mjs +5 -4
- package/dist/{363~0.mjs → z~0.mjs} +360 -267
- package/package.json +5 -5
- package/dist/527~0.mjs +0 -3
- package/dist/840~0.mjs +0 -5635
- /package/dist/{895~0.mjs → 3~0.mjs} +0 -0
- /package/dist/{374~0.mjs → 5~0.mjs} +0 -0
- /package/dist/{206~0.mjs → 6~0.mjs} +0 -0
- /package/dist/{471~0.mjs → g~0.mjs} +0 -0
- /package/dist/{117~0.mjs → w~0.mjs} +0 -0
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
[npm-version-image]: https://img.shields.io/npm/v/extension-develop.svg?color=
|
|
1
|
+
[npm-version-image]: https://img.shields.io/npm/v/extension-develop.svg?color=0065e6
|
|
2
2
|
[npm-version-url]: https://www.npmjs.com/package/extension-develop
|
|
3
|
-
[npm-downloads-image]: https://img.shields.io/npm/dm/extension-develop.svg?color=
|
|
3
|
+
[npm-downloads-image]: https://img.shields.io/npm/dm/extension-develop.svg?color=0065e6
|
|
4
4
|
[npm-downloads-url]: https://www.npmjs.com/package/extension-develop
|
|
5
|
-
[powered-image]: https://img.shields.io/badge/Powered%20by-Extension.js-
|
|
5
|
+
[powered-image]: https://img.shields.io/badge/Powered%20by-Extension.js-0065e6
|
|
6
6
|
[powered-url]: https://extension.js.org
|
|
7
|
-
[action-image]: https://github.com/extension-js/extension.js/actions/workflows/ci.yml/badge.svg?branch=main&color=
|
|
7
|
+
[action-image]: https://github.com/extension-js/extension.js/actions/workflows/ci.yml/badge.svg?branch=main&color=0065e6
|
|
8
8
|
[action-url]: https://github.com/extension-js/extension.js/actions
|
|
9
9
|
|
|
10
10
|
[![Powered by Extension.js][powered-image]][powered-url]
|
|
@@ -134,6 +134,8 @@ Options accepted by each command. Values shown are typical types or enumerations
|
|
|
134
134
|
| zip | boolean | Package `dist/<browser>` as an artifact (e.g., `.zip`, `.xpi`) |
|
|
135
135
|
| zipSource | boolean | Package source files (respects `.gitignore`) |
|
|
136
136
|
| zipFilename | string | Custom base name for artifacts |
|
|
137
|
+
| zipDir | string | Folder for the artifacts, relative to the project or absolute |
|
|
138
|
+
| sourceMaps | boolean | Write source maps beside a production build, never zipped |
|
|
137
139
|
| polyfill | boolean | Include `webextension-polyfill` when possible |
|
|
138
140
|
| silent | boolean | Suppress non-error logs |
|
|
139
141
|
|
|
@@ -276,6 +278,7 @@ export default {
|
|
|
276
278
|
|
|
277
279
|
- Distribution artifacts live under `dist/<browser>/` and source artifacts under `dist/`.
|
|
278
280
|
- File names default to a sanitized form of `manifest.name` plus `manifest.version` (override with `zipFilename`).
|
|
281
|
+
- `zipDir` moves both archives to another folder. A relative path has to stay inside the project, an absolute path is taken as written, and a folder inside `dist/<browser>` is refused.
|
|
279
282
|
- Source packaging respects `.gitignore`.
|
|
280
283
|
|
|
281
284
|
Example layout when both `zip` and `zipSource` are enabled:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
2
|
import { spawnSync } from "node:child_process";
|
|
3
|
-
import { humanLine } from "./
|
|
4
|
-
import { sessionStateIgnoreAdded } from "./
|
|
3
|
+
import { humanLine } from "./k~0.mjs";
|
|
4
|
+
import { sessionStateIgnoreAdded } from "./cp~0.mjs";
|
|
5
5
|
import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
|
|
6
6
|
import * as __rspack_external_node_path_806ed179 from "node:path";
|
|
7
7
|
function sessionStateDir(projectPath) {
|
|
@@ -20,6 +20,16 @@ function controlTokenPath(projectPath, browser) {
|
|
|
20
20
|
function legacyControlTokenPath(projectPath) {
|
|
21
21
|
return __rspack_external_node_path_806ed179.join(sessionStateDir(projectPath), 'control.token');
|
|
22
22
|
}
|
|
23
|
+
const SESSION_STATE_IGNORE_CONTENT = "# Extension.js local session state: the control port and the live control\n# token of a running session. Never commit or ship this directory.\n*\n";
|
|
24
|
+
function ensureSessionStateIgnoreFile(projectPath) {
|
|
25
|
+
try {
|
|
26
|
+
const ignoreFile = __rspack_external_node_path_806ed179.join(sessionStateDir(projectPath), '.gitignore');
|
|
27
|
+
__rspack_external_node_fs_1b05aee1.mkdirSync(__rspack_external_node_path_806ed179.dirname(ignoreFile), {
|
|
28
|
+
recursive: true
|
|
29
|
+
});
|
|
30
|
+
if (!__rspack_external_node_fs_1b05aee1.existsSync(ignoreFile)) __rspack_external_node_fs_1b05aee1.writeFileSync(ignoreFile, SESSION_STATE_IGNORE_CONTENT);
|
|
31
|
+
} catch {}
|
|
32
|
+
}
|
|
23
33
|
function sessionArtifactsRootDir(projectPath) {
|
|
24
34
|
return __rspack_external_node_path_806ed179.resolve(projectPath, 'dist', 'extension-js');
|
|
25
35
|
}
|
|
@@ -146,4 +156,4 @@ function actionsPath(projectPath, browser) {
|
|
|
146
156
|
function buildSummaryPath(projectPath, browser) {
|
|
147
157
|
return __rspack_external_node_path_806ed179.join(browserArtifactsDir(projectPath, browser), 'build-summary.json');
|
|
148
158
|
}
|
|
149
|
-
export { CONTROL_TOKEN_FILE_PREFIX, actionsPath, browserArtifactsDir, browserDistDir, browserProfileRootDir, buildSummaryPath, controlPortFilePath, controlTokenPath, ensureSessionArtifactsIgnoreFile, ensureSessionStateInProjectGitignore, eventsPath, legacyControlPortFilePath, legacyControlTokenPath, logsPath, readyContractPath, sessionArtifactsRootDir, sessionStateDir };
|
|
159
|
+
export { CONTROL_TOKEN_FILE_PREFIX, actionsPath, browserArtifactsDir, browserDistDir, browserProfileRootDir, buildSummaryPath, controlPortFilePath, controlTokenPath, ensureSessionArtifactsIgnoreFile, ensureSessionStateIgnoreFile, ensureSessionStateInProjectGitignore, eventsPath, legacyControlPortFilePath, legacyControlTokenPath, logsPath, readyContractPath, sessionArtifactsRootDir, sessionStateDir };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
|
-
import { canonicalizeDir, canonicalizeResourcePath } from "./
|
|
2
|
+
import { canonicalizeDir, canonicalizeResourcePath } from "./ka~0.mjs";
|
|
3
3
|
import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
|
|
4
4
|
import * as __rspack_external_node_path_806ed179 from "node:path";
|
|
5
5
|
const ASSET_EXT = /\.(png|jpe?g|gif|webp|svg|avif|ico|bmp|cur|woff2?|ttf|otf|eot|mp3|mp4|webm|ogg|wav)$/i;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
2
|
import pintor from "pintor";
|
|
3
|
-
import { prefix as messaging_prefix } from "./
|
|
3
|
+
import { prefix as messaging_prefix } from "./k~0.mjs";
|
|
4
4
|
function cssIntegrationsEnabled(integrations) {
|
|
5
5
|
const names = integrations.length > 0 ? integrations.join(',') : 'none';
|
|
6
6
|
return `${messaging_prefix('debug')} css integrations=${integrations.length} names=${names}`;
|
|
@@ -72,6 +72,22 @@ function lateCssImportIgnored(issuerPath, line) {
|
|
|
72
72
|
`Move the ${pintor.blue('@import')} above every other rule to make it load.`
|
|
73
73
|
].join('\n');
|
|
74
74
|
}
|
|
75
|
+
function unplacedStyleImport(issuerPath, imports, declared) {
|
|
76
|
+
const first = imports[0];
|
|
77
|
+
const where = first?.line ? `${issuerPath}:${first.line}` : issuerPath;
|
|
78
|
+
const request = first?.request || './styles.css';
|
|
79
|
+
return [
|
|
80
|
+
`${messaging_prefix('warn')} A stylesheet imported only for its side effect styles nothing in a content script.`,
|
|
81
|
+
`${pintor.gray('PATH')} ${pintor.underline(where)}`,
|
|
82
|
+
...imports.map((entry)=>`${pintor.gray('IMPORT')} ${pintor.blue(`import '${entry.request}'`)}`),
|
|
83
|
+
`There the import evaluates to the sheet as a ${pintor.blue('data:')} URL, and no code reads it.`,
|
|
84
|
+
`Read the value and place it: ${pintor.blue(`import href from '${request}'`)}, then set it on a ${pintor.blue('<link rel="stylesheet">')}.`,
|
|
85
|
+
...declared ? [
|
|
86
|
+
`Or list the sheet under ${pintor.blue("content_scripts[].css")} in manifest.json, or use a CSS module (${pintor.blue('.module.css')}).`,
|
|
87
|
+
`Extension.js places it for you only in the shadow root of a host marked ${pintor.blue('data-extension-root')}.`
|
|
88
|
+
] : []
|
|
89
|
+
].join('\n');
|
|
90
|
+
}
|
|
75
91
|
function postCssConfigUnreadable(configPath, error) {
|
|
76
92
|
return `${messaging_prefix('warn')} Could not load the PostCSS config at ${pintor.gray(configPath)}.\n${String(error?.message || error)}\nThe build continues without it. Fix the file or remove it.`;
|
|
77
93
|
}
|
|
@@ -81,4 +97,4 @@ function postCssConfigPluginsShape(configPath, found) {
|
|
|
81
97
|
function cssMinifierDroppedRules(assetName, tokens) {
|
|
82
98
|
return `${messaging_prefix('warn')} The CSS minimizer dropped ${tokens.join(', ')} from ${pintor.gray(assetName)}.\nShipped that stylesheet unminified so production keeps every rule development keeps.`;
|
|
83
99
|
}
|
|
84
|
-
export { cssConfigsDetected, cssIntegrationsEnabled, cssMinifierDroppedRules, cssParseErrorShippedVerbatim, deadCssUrlRef, isUsingIntegration, lateCssImportIgnored, missingSassDependency, postCssConfigPluginsShape, postCssConfigUnreadable, postCssPluginNotResolved, preprocessorShippedUncompiled };
|
|
100
|
+
export { cssConfigsDetected, cssIntegrationsEnabled, cssMinifierDroppedRules, cssParseErrorShippedVerbatim, deadCssUrlRef, isUsingIntegration, lateCssImportIgnored, missingSassDependency, postCssConfigPluginsShape, postCssConfigUnreadable, postCssPluginNotResolved, preprocessorShippedUncompiled, unplacedStyleImport };
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
2
|
const EXTENSIONJS_CONTENT_SCRIPT_LAYER = "extensionjs-content-script";
|
|
3
|
+
const EXTENSIONJS_MAIN_WORLD_IMPORT_LAYER = `${EXTENSIONJS_CONTENT_SCRIPT_LAYER}-main-world-import`;
|
|
4
|
+
const MAIN_WORLD_COPY_SUFFIX = '.extjs-main-world';
|
|
5
|
+
function mainWorldCopyEntryName(entryName) {
|
|
6
|
+
return `${entryName}${MAIN_WORLD_COPY_SUFFIX}`;
|
|
7
|
+
}
|
|
3
8
|
const CANONICAL_CONTENT_SCRIPT_ENTRY_PREFIX = "content_scripts/content-";
|
|
4
9
|
function getCanonicalContentScriptEntryName(index) {
|
|
5
10
|
return `${CANONICAL_CONTENT_SCRIPT_ENTRY_PREFIX}${index}`;
|
|
@@ -30,4 +35,4 @@ function getContentScriptCssProbeMarker(entryName) {
|
|
|
30
35
|
function createContentScriptCssProbeMarkerPattern() {
|
|
31
36
|
return /__EXTENSIONJS_CSS_PROBE__([^"'`\s\\]+?\.css)__/g;
|
|
32
37
|
}
|
|
33
|
-
export { CANONICAL_CONTENT_SCRIPT_ENTRY_PREFIX, CONTENT_SCRIPT_CSS_PROBE_MARKER_PREFIX, EXTENSIONJS_CONTENT_SCRIPT_LAYER, createContentScriptCssProbeMarkerPattern, getCanonicalContentScriptCssAssetName, getCanonicalContentScriptEntryName, getCanonicalContentScriptJsAssetName, getContentScriptCssProbeMarker, isCanonicalContentScriptAsset, parseCanonicalContentScriptAsset };
|
|
38
|
+
export { CANONICAL_CONTENT_SCRIPT_ENTRY_PREFIX, CONTENT_SCRIPT_CSS_PROBE_MARKER_PREFIX, EXTENSIONJS_CONTENT_SCRIPT_LAYER, EXTENSIONJS_MAIN_WORLD_IMPORT_LAYER, MAIN_WORLD_COPY_SUFFIX, createContentScriptCssProbeMarkerPattern, getCanonicalContentScriptCssAssetName, getCanonicalContentScriptEntryName, getCanonicalContentScriptJsAssetName, getContentScriptCssProbeMarker, isCanonicalContentScriptAsset, mainWorldCopyEntryName, parseCanonicalContentScriptAsset };
|
package/dist/bridge.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
2
|
import { WebSocket } from "ws";
|
|
3
|
-
import { readyContractPath, logsPath } from "./
|
|
4
|
-
import { CONTROL_WS_PATH, LOG_CONTEXTS } from "./
|
|
5
|
-
import { resolveProjectStructureSync, getDirs } from "./
|
|
3
|
+
import { readyContractPath, logsPath } from "./5h~0.mjs";
|
|
4
|
+
import { CONTROL_WS_PATH, LOG_CONTEXTS } from "./t~0.mjs";
|
|
5
|
+
import { resolveProjectStructureSync, getDirs } from "./cp~0.mjs";
|
|
6
6
|
import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
|
|
7
7
|
import * as __rspack_external_node_path_806ed179 from "node:path";
|
|
8
8
|
function readReadyContractDocument(projectPath, browser = 'chrome') {
|
|
@@ -28,11 +28,14 @@ function readReadyContract(projectPath, browser = 'chrome') {
|
|
|
28
28
|
schema: 'number' == typeof c.schema ? c.schema : void 0,
|
|
29
29
|
logsPath: c.logsPath,
|
|
30
30
|
status: c.status,
|
|
31
|
+
command: 'string' == typeof c.command ? c.command : void 0,
|
|
31
32
|
engine: 'string' == typeof c.engine ? c.engine : void 0,
|
|
32
33
|
pid: 'number' == typeof c.pid ? c.pid : void 0,
|
|
34
|
+
pidStartedAt: 'string' == typeof c.pidStartedAt ? c.pidStartedAt : void 0,
|
|
33
35
|
cdpPort: 'number' == typeof c.cdpPort ? c.cdpPort : void 0,
|
|
34
36
|
rdpPort: 'number' == typeof c.rdpPort ? c.rdpPort : void 0,
|
|
35
37
|
browserPid: 'number' == typeof c.browserPid ? c.browserPid : void 0,
|
|
38
|
+
browserStartedAt: 'string' == typeof c.browserStartedAt ? c.browserStartedAt : void 0,
|
|
36
39
|
startedAt: 'string' == typeof c.startedAt ? c.startedAt : void 0,
|
|
37
40
|
browserExitedAt: 'string' == typeof c.browserExitedAt ? c.browserExitedAt : void 0,
|
|
38
41
|
browserExitCode: 'number' == typeof c.browserExitCode ? c.browserExitCode : void 0,
|
|
@@ -95,7 +98,10 @@ class BridgeConsumer {
|
|
|
95
98
|
type: 'hello',
|
|
96
99
|
v: 1,
|
|
97
100
|
role: 'consumer',
|
|
98
|
-
instanceId: this.opts.instanceId
|
|
101
|
+
instanceId: this.opts.instanceId,
|
|
102
|
+
...this.opts.token ? {
|
|
103
|
+
token: this.opts.token
|
|
104
|
+
} : {}
|
|
99
105
|
}));
|
|
100
106
|
} catch {}
|
|
101
107
|
});
|
|
@@ -203,7 +209,7 @@ class BridgeController {
|
|
|
203
209
|
settled = true;
|
|
204
210
|
clearTimeout(connectTimer);
|
|
205
211
|
const flag = this.opts.unlockFlag || '--allow-control';
|
|
206
|
-
const detail = 4003 === code ? `control is off in the session that answered, so it accepts no controller. A session turns control on with ${flag}, and one that had the flag and still answers this way needs \`extension doctor\`.` : 4001 === code ? "the session that wrote ready.json has been replaced. Re-read ready.json or restart the
|
|
212
|
+
const detail = 4003 === code ? `control is off in the session that answered, so it accepts no controller. A session turns control on with ${flag}, and one that had the flag and still answers this way needs \`extension doctor\`.` : 4001 === code ? "the session that wrote ready.json has been replaced. Re-read ready.json or restart the session." : 4002 === code ? "the session did not understand the hello. Update the CLI and the session to the same Extension.js version." : 'the session closed the socket during the handshake.';
|
|
207
213
|
reject(Object.assign(new Error(`control channel refused the controller (code ${code}${reason ? `: ${reason}` : ''}). ${detail}`), {
|
|
208
214
|
closeCode: code
|
|
209
215
|
}));
|
|
@@ -417,7 +423,7 @@ var bridge_entry_CLOSE_CONTROL_UNAVAILABLE = 4003;
|
|
|
417
423
|
var bridge_entry_CLOSE_SLOW_CONSUMER = 4008;
|
|
418
424
|
var bridge_entry_CONTROL_ENVELOPE_VERSION = 1;
|
|
419
425
|
var bridge_entry_LOG_EVENT_VERSION = 1;
|
|
420
|
-
export { CONTROL_WS_PATH, LOG_CONTEXTS, REFUSAL_API_UNAVAILABLE, REFUSAL_NEEDS_HEADED_WINDOW, REFUSAL_NEEDS_USER_GESTURE, REFUSAL_SURFACE_NOT_DECLARED, REFUSAL_SURFACE_NOT_OPEN, REFUSAL_TAB_NOT_FOUND, REFUSAL_URL_REFUSED, readControlToken } from "./
|
|
421
|
-
export { actionsPath, browserArtifactsDir, browserDistDir, browserProfileRootDir, buildSummaryPath, controlPortFilePath, controlTokenPath, eventsPath, logsPath, readyContractPath, sessionArtifactsRootDir, sessionStateDir } from "./
|
|
422
|
-
export { readPersistedControlPort } from "./
|
|
426
|
+
export { CONTROL_WS_PATH, LOG_CONTEXTS, REFUSAL_API_UNAVAILABLE, REFUSAL_NEEDS_HEADED_WINDOW, REFUSAL_NEEDS_USER_GESTURE, REFUSAL_SURFACE_NOT_DECLARED, REFUSAL_SURFACE_NOT_OPEN, REFUSAL_TAB_NOT_FOUND, REFUSAL_URL_REFUSED, readControlToken } from "./t~0.mjs";
|
|
427
|
+
export { actionsPath, browserArtifactsDir, browserDistDir, browserProfileRootDir, buildSummaryPath, controlPortFilePath, controlTokenPath, eventsPath, logsPath, readyContractPath, sessionArtifactsRootDir, sessionStateDir } from "./5h~0.mjs";
|
|
428
|
+
export { readPersistedControlPort } from "./w~0.mjs";
|
|
423
429
|
export { BridgeConsumer, BridgeController, LOG_LEVEL_FILTERS, LOG_LEVEL_ORDER, bridge_entry_CLOSE_BAD_HELLO as CLOSE_BAD_HELLO, bridge_entry_CLOSE_BAD_INSTANCE as CLOSE_BAD_INSTANCE, bridge_entry_CLOSE_CONTROL_UNAVAILABLE as CLOSE_CONTROL_UNAVAILABLE, bridge_entry_CLOSE_SLOW_CONSUMER as CLOSE_SLOW_CONSUMER, bridge_entry_CONTROL_ENVELOPE_VERSION as CONTROL_ENVELOPE_VERSION, bridge_entry_LOG_EVENT_VERSION as LOG_EVENT_VERSION, isAfterSince, logLevelRank, logQueryProblem, matchesLogQuery, parseLogLevelFilter, parseLogSince, readLogEvents, readReadyContract, readReadyContractDocument, resolveSessionProjectRoot, unknownLogContexts };
|