extension-develop 4.1.34 → 4.1.35
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/dist/206~0.mjs +33 -0
- package/dist/363~0.mjs +1 -1
- package/dist/469~0.mjs +98 -16
- package/dist/519~0.mjs +12 -1
- package/dist/771~0.mjs +49 -8
- package/dist/832~0.mjs +127 -25
- package/dist/840~0.mjs +215 -54
- package/dist/846~0.mjs +16 -14
- package/dist/852~0.mjs +2 -0
- package/dist/88~0.mjs +10 -1
- package/dist/command-preview.d.ts +2 -0
- package/dist/contract/codes.json +9 -0
- package/dist/contracts-entry.d.ts +1 -1
- package/dist/contracts.mjs +109 -1
- package/dist/css-parse-guard-loader.mjs +7 -2
- package/dist/dev-server/control-bridge/log-rule.d.ts +38 -0
- package/dist/dev-server/control-bridge/logs-query.d.ts +2 -55
- package/dist/dev-server/control-bridge/producer-runtime.d.ts +1 -1
- package/dist/dev-server/html-refresh.d.ts +10 -0
- package/dist/dev-server/port-manager.d.ts +14 -0
- package/dist/dev-server/reserved-listen.d.ts +9 -0
- package/dist/dev-server/session-restart.d.ts +1 -1
- package/dist/dev-server~0.mjs +155 -30
- 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.css +1 -1
- package/dist/extension-js-devtools/chromium/background/service_worker.js +2 -2
- package/dist/extension-js-devtools/chromium/pages/welcome.css +1 -1
- package/dist/extension-js-devtools/edge/background/service_worker.js +2 -2
- package/dist/extension-js-devtools/edge/pages/welcome.css +1 -1
- package/dist/extension-js-devtools/firefox/background/scripts.js +2 -2
- package/dist/extension-js-devtools/firefox/pages/welcome.css +1 -1
- package/dist/extension-js-theme/build-stamp.json +2 -2
- package/dist/feature-scripts-classic-concat-loader.js +45 -2
- package/dist/feature-scripts-classic-concat-loader.mjs +45 -2
- package/dist/feature-scripts-classic-traced-globals-loader.mjs +111 -0
- package/dist/feature-scripts-content-script-wrapper.js +10 -6
- package/dist/feature-scripts-content-script-wrapper.mjs +10 -6
- package/dist/lib/config-loader.d.ts +1 -0
- package/dist/lib/css-minimizer-options.d.ts +8 -0
- package/dist/lib/develop-context.d.ts +1 -1
- package/dist/lib/live-dev-session.d.ts +5 -0
- package/dist/lib/messages.d.ts +9 -1
- package/dist/lib/messaging.d.ts +2 -0
- package/dist/lib/package-manager.d.ts +7 -1
- package/dist/lib/paths.d.ts +1 -0
- package/dist/lib/project.d.ts +10 -2
- package/dist/lib/remote-archive.d.ts +11 -0
- package/dist/lib/rename-with-retry.d.ts +6 -0
- package/dist/lib/session-paths.d.ts +1 -0
- package/dist/lib/zip.d.ts +5 -1
- package/dist/plugin-browsers/index.d.ts +2 -0
- package/dist/plugin-css/css-in-content-script-loader.d.ts +1 -1
- package/dist/plugin-css/css-in-html-loader.d.ts +1 -1
- package/dist/plugin-css/css-lib/build-css-rules.d.ts +2 -1
- package/dist/plugin-css/css-lib/verbatim-css.d.ts +1 -0
- package/dist/plugin-js-frameworks/js-tools/typescript.d.ts +1 -0
- package/dist/plugin-playwright/index.d.ts +3 -0
- package/dist/plugin-special-folders/messages.d.ts +1 -0
- package/dist/plugin-special-folders/warn-upon-folder-changes.d.ts +1 -1
- package/dist/plugin-web-extension/feature-html/html-lib/options-dialog-floor.d.ts +7 -0
- package/dist/plugin-web-extension/feature-html/html-lib/patch-html.d.ts +3 -1
- package/dist/plugin-web-extension/feature-html/steps/update-html-file.d.ts +1 -0
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/dev-injected-hosts.d.ts +4 -1
- package/dist/plugin-web-extension/feature-scripts/messages.d.ts +1 -0
- 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 +1 -0
- package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/index.d.ts +1 -0
- package/dist/plugin-web-extension/feature-scripts/steps/classic-traced-globals-loader.d.ts +7 -0
- package/dist/plugin-web-extension/feature-scripts/steps/warn-unshipped-runtime-assets.d.ts +32 -0
- package/dist/plugin-web-extension/feature-web-resources/web-resources-lib/messages.d.ts +1 -0
- package/dist/plugin-web-extension/shared/discover-runtime-surfaces.d.ts +2 -0
- package/dist/plugin-web-extension/shared/script-graph.d.ts +4 -0
- package/dist/rspack-config~0.mjs +799 -196
- package/dist/types.d.ts +7 -1
- package/dist/zip~0.mjs +14 -7
- package/package.json +3 -3
- package/dist/plugin-css/css-lib/is-content-script.d.ts +0 -2
package/dist/contracts.mjs
CHANGED
|
@@ -25,4 +25,112 @@ const CLOSE_BAD_INSTANCE = 4001;
|
|
|
25
25
|
const CLOSE_BAD_HELLO = 4002;
|
|
26
26
|
const CLOSE_CONTROL_UNAVAILABLE = 4003;
|
|
27
27
|
const CLOSE_SLOW_CONSUMER = 4008;
|
|
28
|
-
|
|
28
|
+
const LOG_LEVEL_ORDER = [
|
|
29
|
+
'error',
|
|
30
|
+
'warn',
|
|
31
|
+
'info',
|
|
32
|
+
'debug',
|
|
33
|
+
'trace'
|
|
34
|
+
];
|
|
35
|
+
const LOG_LEVEL_FILTERS = [
|
|
36
|
+
'off',
|
|
37
|
+
...LOG_LEVEL_ORDER,
|
|
38
|
+
'all'
|
|
39
|
+
];
|
|
40
|
+
function logLevelRank(level) {
|
|
41
|
+
const normalized = 'log' === level ? 'info' : level;
|
|
42
|
+
const index = LOG_LEVEL_ORDER.indexOf(normalized);
|
|
43
|
+
return -1 === index ? LOG_LEVEL_ORDER.length : index;
|
|
44
|
+
}
|
|
45
|
+
function parseLogLevelFilter(value) {
|
|
46
|
+
if (null == value || '' === value) return 'all';
|
|
47
|
+
const text = String(value).trim().toLowerCase();
|
|
48
|
+
const level = 'log' === text ? 'info' : text;
|
|
49
|
+
return LOG_LEVEL_FILTERS.includes(level) ? level : void 0;
|
|
50
|
+
}
|
|
51
|
+
function toContextNames(context) {
|
|
52
|
+
if (null == context) return [];
|
|
53
|
+
const list = Array.isArray(context) ? context : String(context).split(',');
|
|
54
|
+
return list.map((name)=>String(name).trim()).filter(Boolean);
|
|
55
|
+
}
|
|
56
|
+
function unknownLogContexts(context) {
|
|
57
|
+
return toContextNames(context).filter((name)=>'all' !== name.toLowerCase() && !LOG_CONTEXTS.includes(name));
|
|
58
|
+
}
|
|
59
|
+
function toContextSet(context) {
|
|
60
|
+
const names = toContextNames(context);
|
|
61
|
+
if (0 === names.length) return null;
|
|
62
|
+
if (names.some((name)=>'all' === name.toLowerCase())) return null;
|
|
63
|
+
return new Set(names);
|
|
64
|
+
}
|
|
65
|
+
function logQueryProblem(query) {
|
|
66
|
+
const unknown = unknownLogContexts(query.context);
|
|
67
|
+
if (unknown.length > 0) return `context expects a comma-separated list of ${LOG_CONTEXTS.join(', ')} or all, got: ${unknown.join(', ')}`;
|
|
68
|
+
if (void 0 === parseLogLevelFilter(query.level)) return `level expects one of ${LOG_LEVEL_FILTERS.join(', ')}, got: ${String(query.level)}`;
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
function makeUrlMatcher(pattern) {
|
|
72
|
+
const escaped = pattern.includes('*') ? pattern.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*') : null;
|
|
73
|
+
const expression = null == escaped ? null : new RegExp(escaped);
|
|
74
|
+
return (event)=>{
|
|
75
|
+
const candidates = [
|
|
76
|
+
event.url,
|
|
77
|
+
event.hostname
|
|
78
|
+
].filter((value)=>'string' == typeof value);
|
|
79
|
+
if (0 === candidates.length) return false;
|
|
80
|
+
return candidates.some((candidate)=>expression ? expression.test(candidate) : candidate.includes(pattern));
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function parseLogSince(value) {
|
|
84
|
+
if (null == value || '' === value) return null;
|
|
85
|
+
if ('number' == typeof value) return Number.isFinite(value) ? {
|
|
86
|
+
seq: value
|
|
87
|
+
} : void 0;
|
|
88
|
+
const text = String(value).trim();
|
|
89
|
+
if (/^\d+(?:\.\d+)?$/.test(text)) return {
|
|
90
|
+
seq: Number(text)
|
|
91
|
+
};
|
|
92
|
+
const time = Date.parse(text);
|
|
93
|
+
return Number.isFinite(time) ? {
|
|
94
|
+
time
|
|
95
|
+
} : void 0;
|
|
96
|
+
}
|
|
97
|
+
function eventTime(event) {
|
|
98
|
+
if ('number' == typeof event.timestamp) return event.timestamp;
|
|
99
|
+
if ('string' == typeof event.ts) {
|
|
100
|
+
const parsed = Date.parse(event.ts);
|
|
101
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
102
|
+
}
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
function isAfterSince(event, since) {
|
|
106
|
+
if ('seq' in since) return !('number' == typeof event.seq && event.seq <= since.seq);
|
|
107
|
+
const time = eventTime(event);
|
|
108
|
+
return null == time || time > since.time;
|
|
109
|
+
}
|
|
110
|
+
function toFiniteNumber(value) {
|
|
111
|
+
if (null == value || '' === value) return null;
|
|
112
|
+
const parsed = 'number' == typeof value ? value : Number(value);
|
|
113
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
114
|
+
}
|
|
115
|
+
function matchesLogQuery(event, query) {
|
|
116
|
+
const problem = logQueryProblem(query);
|
|
117
|
+
if (problem) throw new RangeError(problem);
|
|
118
|
+
if (!event || 'object' != typeof event) return false;
|
|
119
|
+
if ('header' === event.type) return false;
|
|
120
|
+
const minLevel = parseLogLevelFilter(query.level) ?? 'all';
|
|
121
|
+
if ('off' === minLevel) return false;
|
|
122
|
+
if ('gap' === event.type && query.includeGaps) return true;
|
|
123
|
+
if (query.signalsOnly && 'dx.signal' !== event.eventType) return false;
|
|
124
|
+
const contexts = toContextSet(query.context);
|
|
125
|
+
if (contexts && !contexts.has(String(event.context))) return false;
|
|
126
|
+
if ('all' !== minLevel) {
|
|
127
|
+
if (logLevelRank(String(event.level || '')) > logLevelRank(minLevel)) return false;
|
|
128
|
+
}
|
|
129
|
+
const since = parseLogSince(query.since);
|
|
130
|
+
if (since && !isAfterSince(event, since)) return false;
|
|
131
|
+
if (query.url && !makeUrlMatcher(query.url)(event)) return false;
|
|
132
|
+
const tabId = toFiniteNumber(query.tab);
|
|
133
|
+
if (null != tabId && event.tabId !== tabId) return false;
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
export { CLOSE_BAD_HELLO, CLOSE_BAD_INSTANCE, CLOSE_CONTROL_UNAVAILABLE, CLOSE_SLOW_CONSUMER, CONTROL_ENVELOPE_VERSION, CONTROL_WS_PATH, LOG_CONTEXTS, LOG_EVENT_VERSION, LOG_LEVEL_FILTERS, LOG_LEVEL_ORDER, REFUSAL_API_UNAVAILABLE, REFUSAL_NEEDS_HEADED_WINDOW, REFUSAL_NEEDS_USER_GESTURE, REFUSAL_SURFACE_NOT_DECLARED, REFUSAL_SURFACE_NOT_OPEN, REFUSAL_SURFACE_REPLY_FAILED, REFUSAL_TAB_NOT_FOUND, REFUSAL_URL_REFUSED, isAfterSince, logLevelRank, logQueryProblem, matchesLogQuery, parseLogLevelFilter, parseLogSince, unknownLogContexts };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
2
|
import postcss from "postcss";
|
|
3
3
|
import { cssParseErrorShippedVerbatim } from "./524~0.mjs";
|
|
4
|
-
import { verbatimCssPlaceholder, registerVerbatimCss } from "./88~0.mjs";
|
|
4
|
+
import { verbatimCssModulePlaceholder, verbatimCssPlaceholder, registerVerbatimCss } from "./88~0.mjs";
|
|
5
5
|
import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
|
|
6
6
|
function cssParseGuardLoader(source) {
|
|
7
7
|
return source;
|
|
@@ -20,7 +20,12 @@ function pitch() {
|
|
|
20
20
|
name: 'CssParseWarning'
|
|
21
21
|
}));
|
|
22
22
|
const moduleType = String(this._module?.type || '');
|
|
23
|
-
if (moduleType.startsWith('css'))
|
|
23
|
+
if (moduleType.startsWith('css')) {
|
|
24
|
+
const id = registerVerbatimCss(raw, this.resourcePath);
|
|
25
|
+
const isCssModule = 'css/module' === moduleType || 'css/auto' === moduleType && /\.module\.css$/i.test(this.resourcePath);
|
|
26
|
+
callback(null, isCssModule ? verbatimCssModulePlaceholder(id, raw) : verbatimCssPlaceholder(id));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
24
29
|
callback(null, raw);
|
|
25
30
|
}
|
|
26
31
|
}).catch(()=>{
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare const LOG_LEVEL_ORDER: readonly ['error', 'warn', 'info', 'debug', 'trace'];
|
|
2
|
+
export declare const LOG_LEVEL_FILTERS: readonly ["off", "error", "warn", "info", "debug", "trace", "all"];
|
|
3
|
+
export type LogLevelFilter = (typeof LOG_LEVEL_FILTERS)[number] | (string & {});
|
|
4
|
+
export interface LogQuery {
|
|
5
|
+
context?: string | string[];
|
|
6
|
+
level?: LogLevelFilter;
|
|
7
|
+
signalsOnly?: boolean;
|
|
8
|
+
since?: number | string;
|
|
9
|
+
url?: string;
|
|
10
|
+
tab?: number | string;
|
|
11
|
+
includeGaps?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface LogEventLike {
|
|
14
|
+
type?: unknown;
|
|
15
|
+
eventType?: unknown;
|
|
16
|
+
context?: unknown;
|
|
17
|
+
level?: unknown;
|
|
18
|
+
seq?: unknown;
|
|
19
|
+
timestamp?: unknown;
|
|
20
|
+
ts?: unknown;
|
|
21
|
+
url?: unknown;
|
|
22
|
+
hostname?: unknown;
|
|
23
|
+
tabId?: unknown;
|
|
24
|
+
dropped?: unknown;
|
|
25
|
+
reason?: unknown;
|
|
26
|
+
}
|
|
27
|
+
export declare function logLevelRank(level: string): number;
|
|
28
|
+
export declare function parseLogLevelFilter(value: unknown): (typeof LOG_LEVEL_FILTERS)[number] | undefined;
|
|
29
|
+
export declare function unknownLogContexts(context: LogQuery['context']): string[];
|
|
30
|
+
export declare function logQueryProblem(query: LogQuery): string | null;
|
|
31
|
+
export type LogSince = {
|
|
32
|
+
seq: number;
|
|
33
|
+
} | {
|
|
34
|
+
time: number;
|
|
35
|
+
};
|
|
36
|
+
export declare function parseLogSince(value: unknown): LogSince | null | undefined;
|
|
37
|
+
export declare function isAfterSince(event: LogEventLike, since: LogSince): boolean;
|
|
38
|
+
export declare function matchesLogQuery(event: LogEventLike, query: LogQuery): boolean;
|
|
@@ -1,58 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
/** What a level filter may name: a level, every level, or none at all. */
|
|
4
|
-
export declare const LOG_LEVEL_FILTERS: readonly ["off", "error", "warn", "info", "debug", "trace", "all"];
|
|
5
|
-
export type LogLevelFilter = (typeof LOG_LEVEL_FILTERS)[number] | (string & {});
|
|
6
|
-
export interface LogQuery {
|
|
7
|
-
/** One context, a comma-separated list, an array, or 'all'. */
|
|
8
|
-
context?: string | string[];
|
|
9
|
-
/** Minimum severity. 'all' selects every level, 'off' selects none. */
|
|
10
|
-
level?: LogLevelFilter;
|
|
11
|
-
/** Only structured dx.signal diagnostics. */
|
|
12
|
-
signalsOnly?: boolean;
|
|
13
|
-
/** Only events after this point: a sequence number, or an ISO timestamp
|
|
14
|
-
* compared against the event's own clock. */
|
|
15
|
-
since?: number | string;
|
|
16
|
-
/** Glob (`*` = any run of chars) or plain substring over url then hostname. */
|
|
17
|
-
url?: string;
|
|
18
|
-
/** Only events carrying this tab id. */
|
|
19
|
-
tab?: number | string;
|
|
20
|
-
/** Keep `type: "gap"` records under a filter. Without it a gap is returned
|
|
21
|
-
* only by a query no clause narrows, since it has no field to match. */
|
|
22
|
-
includeGaps?: boolean;
|
|
23
|
-
}
|
|
24
|
-
/** A bridge log line as read off disk: dynamic, so the probed fields only. */
|
|
25
|
-
export interface LogEventLike {
|
|
26
|
-
type?: unknown;
|
|
27
|
-
eventType?: unknown;
|
|
28
|
-
context?: unknown;
|
|
29
|
-
level?: unknown;
|
|
30
|
-
seq?: unknown;
|
|
31
|
-
timestamp?: unknown;
|
|
32
|
-
ts?: unknown;
|
|
33
|
-
url?: unknown;
|
|
34
|
-
hostname?: unknown;
|
|
35
|
-
tabId?: unknown;
|
|
36
|
-
dropped?: unknown;
|
|
37
|
-
reason?: unknown;
|
|
38
|
-
}
|
|
39
|
-
export declare function logLevelRank(level: string): number;
|
|
40
|
-
/** The level filter as the query reads it, or undefined for a name it refuses. */
|
|
41
|
-
export declare function parseLogLevelFilter(value: unknown): (typeof LOG_LEVEL_FILTERS)[number] | undefined;
|
|
42
|
-
/** The names in a context filter outside LOG_CONTEXTS; empty when it is valid. */
|
|
43
|
-
export declare function unknownLogContexts(context: LogQuery['context']): string[];
|
|
44
|
-
/** Why a query cannot be answered as written, or null when every clause is valid. */
|
|
45
|
-
export declare function logQueryProblem(query: LogQuery): string | null;
|
|
46
|
-
/** How a `since` value is read: a sequence number, or a point in time. */
|
|
47
|
-
export type LogSince = {
|
|
48
|
-
seq: number;
|
|
49
|
-
} | {
|
|
50
|
-
time: number;
|
|
51
|
-
};
|
|
52
|
-
export declare function parseLogSince(value: unknown): LogSince | null | undefined;
|
|
53
|
-
export declare function isAfterSince(event: LogEventLike, since: LogSince): boolean;
|
|
54
|
-
/** True when the event passes every clause; a RangeError names a clause the query cannot mean. */
|
|
55
|
-
export declare function matchesLogQuery(event: LogEventLike, query: LogQuery): boolean;
|
|
1
|
+
import { type LogEventLike, type LogQuery } from './log-rule.js';
|
|
2
|
+
export * from './log-rule.js';
|
|
56
3
|
/**
|
|
57
4
|
* One-shot read of a session's logs.ndjson. Returns an empty array when the
|
|
58
5
|
* session has never written one: an absent file is "nothing logged yet", and
|