extension-develop 4.0.16 → 4.0.17
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 +1 -1
- package/dist/0~dev-server.mjs +25 -10
- package/dist/0~rspack-config.mjs +182 -190
- package/dist/101.mjs +114 -139
- package/dist/266.mjs +8 -7
- package/dist/349.mjs +249 -0
- package/dist/839.mjs +314 -29
- package/dist/845.mjs +19 -13
- package/dist/contract/codes.json +590 -0
- package/dist/contract/envelope.schema.json +42 -0
- package/dist/contract/golden.build.built.json +13 -0
- package/dist/contract/golden.build.compile.json +13 -0
- package/dist/contract/golden.dev.first-compile.json +23 -0
- package/dist/contract/golden.dev.ready.json +20 -0
- package/dist/contract/golden.doctor.healthy.json +45 -0
- package/dist/contract/golden.doctor.session-not-found.json +50 -0
- package/dist/contract/golden.eval.eval.json +16 -0
- package/dist/contract/golden.eval.ok.json +12 -0
- package/dist/dev-server/control-bridge/producer-runtime.d.ts +1 -1
- package/dist/dev-server/lifecycle-stream.d.ts +54 -0
- package/dist/lib/messages.d.ts +2 -10
- package/dist/lib/messaging.d.ts +180 -0
- package/dist/plugin-playwright/index.d.ts +1 -0
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -194,7 +194,7 @@ Use this when you have other unpacked extensions you want loaded alongside your
|
|
|
194
194
|
- When `dir` points to `./extensions`, browser folders like `./extensions/chrome/*` and `./extensions/firefox/*` are also scanned.
|
|
195
195
|
- `extensions.paths`: explicit directories (absolute or relative to the project root)
|
|
196
196
|
- **Overrides**: top-level `extensions` applies to all commands, but `commands.<cmd>.extensions` overrides it for that command.
|
|
197
|
-
- **Invalid entries**: ignored.
|
|
197
|
+
- **Invalid entries**: ignored. With `--debug` we print a warning if `extensions` is configured but nothing resolves.
|
|
198
198
|
- **Store URLs**: entries pointing to Chrome Web Store, Edge Addons, or AMO are downloaded on-demand into `./extensions/<browser>/<id-or-slug>`.
|
|
199
199
|
- **Local paths**: only paths under `./extensions/` are accepted for companion extensions.
|
|
200
200
|
- **CLI**: use `--extensions <csv>` to provide a comma-separated list of paths or store URLs.
|
package/dist/0~dev-server.mjs
CHANGED
|
@@ -6,11 +6,12 @@ import { rspack } from "@rspack/core";
|
|
|
6
6
|
import { RspackDevServer } from "@rspack/dev-server";
|
|
7
7
|
import { merge } from "webpack-merge";
|
|
8
8
|
import { WebSocket, WebSocketServer } from "ws";
|
|
9
|
-
import {
|
|
9
|
+
import { classifyReloadFromSources, attachLifecycleStream, readContentScriptCount, humanLine, buildSourceFeatureIndex, createChangedSourcesTracker, createLifecycleStream, dispatchReload } from "./839.mjs";
|
|
10
|
+
import { autoExitForceKill, loadCommandConfig, sanitize, extensionJsRunnerError, portInUse, devServerStartTimeout, autoExitTriggered, asAbsolute, isGeckoBasedBrowser, createPlaywrightMetadataWriter, autoExitModeEnabled, getSessionRunId, loadCustomConfig, loadBrowserConfig, getDistPath, resolveCompanionExtensionsConfig, getSpecialFoldersDataForProjectRoot } from "./101.mjs";
|
|
10
11
|
import { CONTROL_WS_PATH, writePersistedControlPort, writeControlToken, clearControlToken, readPersistedControlPort } from "./887.mjs";
|
|
11
12
|
import { hasProjectDependency, findNearestProjectManifestDirSync } from "./80.mjs";
|
|
13
|
+
import { isDebug } from "./349.mjs";
|
|
12
14
|
import { actionsPath, controlPortFilePath, logsPath, legacyControlPortFilePath, ensureSessionArtifactsIgnoreFile } from "./494.mjs";
|
|
13
|
-
import { buildSourceFeatureIndex, classifyReloadFromSources, readContentScriptCount, createChangedSourcesTracker, dispatchReload } from "./839.mjs";
|
|
14
15
|
import { setupNoBrowserBannerOnFirstDone, webpackConfig, resolveConnectableHost, setupCompilerLifecycleHooks } from "./0~rspack-config.mjs";
|
|
15
16
|
import * as __rspack_external_node_path_c5b9b54f from "node:path";
|
|
16
17
|
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
@@ -30,11 +31,11 @@ function setupAutoExit(autoExitMsRaw, forceKillMsRaw, onCleanup) {
|
|
|
30
31
|
const autoExitMs = parseMilliseconds(autoExitMsRaw);
|
|
31
32
|
if (null === autoExitMs) return ()=>{};
|
|
32
33
|
try {
|
|
33
|
-
|
|
34
|
+
humanLine(autoExitModeEnabled(autoExitMs));
|
|
34
35
|
} catch {}
|
|
35
36
|
autoExitTimer = setTimeout(async ()=>{
|
|
36
37
|
try {
|
|
37
|
-
|
|
38
|
+
humanLine(autoExitTriggered(autoExitMs));
|
|
38
39
|
} catch {}
|
|
39
40
|
await onCleanup();
|
|
40
41
|
}, autoExitMs);
|
|
@@ -42,7 +43,7 @@ function setupAutoExit(autoExitMsRaw, forceKillMsRaw, onCleanup) {
|
|
|
42
43
|
const forceKillMs = null !== parsedForceKillMs && parsedForceKillMs > 0 ? parsedForceKillMs : autoExitMs + 4000;
|
|
43
44
|
forceKillTimer = setTimeout(()=>{
|
|
44
45
|
try {
|
|
45
|
-
|
|
46
|
+
humanLine(autoExitForceKill(forceKillMs));
|
|
46
47
|
} catch {}
|
|
47
48
|
process.exit(0);
|
|
48
49
|
}, forceKillMs);
|
|
@@ -63,7 +64,7 @@ function closeAll(devServer, portManager) {
|
|
|
63
64
|
await portManager.terminateCurrentInstance();
|
|
64
65
|
setTimeout(()=>process.exit(), 500);
|
|
65
66
|
}).catch(async (error)=>{
|
|
66
|
-
|
|
67
|
+
humanLine(extensionJsRunnerError(error));
|
|
67
68
|
await portManager.terminateCurrentInstance();
|
|
68
69
|
setTimeout(()=>process.exit(1), 500);
|
|
69
70
|
});
|
|
@@ -1053,7 +1054,7 @@ async function dev_server_devServer(projectStructure, devOptions) {
|
|
|
1053
1054
|
});
|
|
1054
1055
|
const allowControl = Boolean(extendedOptions.allowControl);
|
|
1055
1056
|
const allowEval = Boolean(extendedOptions.allowEval);
|
|
1056
|
-
const authorMode = Boolean(extendedOptions.authorMode) ||
|
|
1057
|
+
const authorMode = Boolean(extendedOptions.authorMode) || isDebug();
|
|
1057
1058
|
const bridgeActionsFile = allowControl ? new ActionsFileWriter({
|
|
1058
1059
|
filePath: actionsPath(packageJsonDir, browserName)
|
|
1059
1060
|
}) : void 0;
|
|
@@ -1062,7 +1063,7 @@ async function dev_server_devServer(projectStructure, devOptions) {
|
|
|
1062
1063
|
const bridgeBroker = new BridgeBroker({
|
|
1063
1064
|
instanceId: currentInstance.instanceId,
|
|
1064
1065
|
runId: sessionRunId,
|
|
1065
|
-
engine:
|
|
1066
|
+
engine: isGeckoBasedBrowser(browserName) ? 'firefox' : 'chromium',
|
|
1066
1067
|
ring: new LogRingBuffer(),
|
|
1067
1068
|
file: bridgeLogFile,
|
|
1068
1069
|
allowControl,
|
|
@@ -1210,6 +1211,18 @@ async function dev_server_devServer(projectStructure, devOptions) {
|
|
|
1210
1211
|
logsPath: bridgeLogsRelPath
|
|
1211
1212
|
});
|
|
1212
1213
|
stampExecutorAttached = ()=>metadata.stampExecutorAttached();
|
|
1214
|
+
const lifecycle = createLifecycleStream({
|
|
1215
|
+
command: 'dev',
|
|
1216
|
+
browser: browserName,
|
|
1217
|
+
distPath: primaryDistPath,
|
|
1218
|
+
readyPath: metadata.readyPath,
|
|
1219
|
+
eventsPath: metadata.eventsPath
|
|
1220
|
+
});
|
|
1221
|
+
lifecycle.starting({
|
|
1222
|
+
requestedPort: Number(devOptions.port),
|
|
1223
|
+
port
|
|
1224
|
+
});
|
|
1225
|
+
attachLifecycleStream(compiler, lifecycle);
|
|
1213
1226
|
setupCompilerLifecycleHooks(compiler);
|
|
1214
1227
|
if (devOptions.noBrowser) setupNoBrowserBannerOnFirstDone({
|
|
1215
1228
|
compiler,
|
|
@@ -1218,7 +1231,7 @@ async function dev_server_devServer(projectStructure, devOptions) {
|
|
|
1218
1231
|
readyPath: metadata.readyPath
|
|
1219
1232
|
});
|
|
1220
1233
|
const requestedPort = Number(devOptions.port);
|
|
1221
|
-
if (Number.isFinite(requestedPort) && requestedPort !== port)
|
|
1234
|
+
if (Number.isFinite(requestedPort) && requestedPort !== port) humanLine(portInUse(requestedPort, port));
|
|
1222
1235
|
const serverConfig = {
|
|
1223
1236
|
host: devServerHost,
|
|
1224
1237
|
allowedHosts: 'all',
|
|
@@ -1271,9 +1284,11 @@ async function dev_server_devServer(projectStructure, devOptions) {
|
|
|
1271
1284
|
} catch (error) {
|
|
1272
1285
|
if (startTimeout) clearTimeout(startTimeout);
|
|
1273
1286
|
metadata.writeError('dev_server_start_failed', error instanceof Error ? error.message : String(error));
|
|
1274
|
-
|
|
1287
|
+
lifecycle.failed(error instanceof Error ? error.message : String(error));
|
|
1288
|
+
humanLine(extensionJsRunnerError(error));
|
|
1275
1289
|
process.exit(1);
|
|
1276
1290
|
}
|
|
1291
|
+
lifecycle.watchBrowserExit();
|
|
1277
1292
|
setupCleanupHandlers(devServer, portManager);
|
|
1278
1293
|
}
|
|
1279
1294
|
export { dev_server_devServer as devServer };
|