@hominis/fireforge 0.19.2 → 0.19.4
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/CHANGELOG.md +5 -0
- package/README.md +6 -0
- package/dist/src/commands/bootstrap-checks.js +1 -1
- package/dist/src/commands/doctor-check-core.d.ts +101 -0
- package/dist/src/commands/doctor-check-core.js +32 -0
- package/dist/src/commands/doctor-furnace-manifest-sync.d.ts +1 -1
- package/dist/src/commands/doctor-furnace-manifest-sync.js +1 -1
- package/dist/src/commands/doctor-furnace.d.ts +1 -1
- package/dist/src/commands/doctor-furnace.js +1 -1
- package/dist/src/commands/doctor-working-tree.d.ts +1 -1
- package/dist/src/commands/doctor-working-tree.js +1 -1
- package/dist/src/commands/doctor.d.ts +1 -107
- package/dist/src/commands/doctor.js +1 -29
- package/dist/src/commands/furnace/index.d.ts +0 -17
- package/dist/src/commands/furnace/index.js +0 -1
- package/dist/src/commands/furnace/validate.d.ts +2 -3
- package/dist/src/commands/patch/index.d.ts +0 -6
- package/dist/src/commands/patch/index.js +0 -6
- package/dist/src/commands/test.js +10 -9
- package/dist/src/commands/wire.js +34 -32
- package/dist/src/core/config.d.ts +2 -2
- package/dist/src/core/config.js +2 -2
- package/dist/src/core/furnace-apply-helpers.js +2 -2
- package/dist/src/core/furnace-config-array-utils.d.ts +11 -0
- package/dist/src/core/furnace-config-array-utils.js +27 -0
- package/dist/src/core/furnace-config-custom.js +1 -1
- package/dist/src/core/furnace-config-tokens.js +1 -1
- package/dist/src/core/furnace-config.d.ts +0 -6
- package/dist/src/core/furnace-config.js +2 -14
- package/dist/src/core/furnace-refresh.d.ts +0 -4
- package/dist/src/core/furnace-registration-ast.d.ts +0 -1
- package/dist/src/core/furnace-registration-ast.js +0 -1
- package/dist/src/core/furnace-registration.d.ts +2 -3
- package/dist/src/core/furnace-registration.js +2 -3
- package/dist/src/core/git-file-ops.d.ts +0 -6
- package/dist/src/core/git-file-ops.js +0 -8
- package/dist/src/core/git-status.d.ts +0 -14
- package/dist/src/core/git-status.js +0 -24
- package/dist/src/core/git.d.ts +0 -1
- package/dist/src/core/mach.d.ts +2 -2
- package/dist/src/core/marionette-port.d.ts +22 -4
- package/dist/src/core/marionette-port.js +35 -8
- package/dist/src/core/patch-apply.d.ts +2 -2
- package/dist/src/core/patch-apply.js +2 -2
- package/dist/src/core/patch-lint-reexports.d.ts +1 -4
- package/dist/src/core/patch-lint-reexports.js +0 -3
- package/dist/src/core/patch-manifest.d.ts +1 -2
- package/dist/src/core/patch-manifest.js +1 -1
- package/dist/src/core/signal-critical.d.ts +0 -11
- package/dist/src/core/signal-critical.js +0 -15
- package/dist/src/core/wire-targets.d.ts +4 -4
- package/dist/src/core/wire-targets.js +4 -4
- package/dist/src/types/commands/options.d.ts +4 -3
- package/dist/src/utils/logger.d.ts +0 -5
- package/dist/src/utils/logger.js +2 -2
- package/dist/src/utils/package-root.d.ts +0 -2
- package/dist/src/utils/package-root.js +0 -4
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared string-array parsing for furnace.json validation. Lives in its own
|
|
3
|
+
* module so `furnace-config-custom.ts` and `furnace-config-tokens.ts` can use
|
|
4
|
+
* it without importing `furnace-config.ts`, which would create import cycles.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Parses a JSON array-of-strings field from raw furnace config data.
|
|
8
|
+
* @param value - Raw value from JSON
|
|
9
|
+
* @param fieldName - Field label for error messages
|
|
10
|
+
*/
|
|
11
|
+
export declare function parseStringArray(value: unknown, fieldName: string): string[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EUPL-1.2
|
|
2
|
+
/**
|
|
3
|
+
* Shared string-array parsing for furnace.json validation. Lives in its own
|
|
4
|
+
* module so `furnace-config-custom.ts` and `furnace-config-tokens.ts` can use
|
|
5
|
+
* it without importing `furnace-config.ts`, which would create import cycles.
|
|
6
|
+
*/
|
|
7
|
+
import { FurnaceError } from '../errors/furnace.js';
|
|
8
|
+
import { isArray, isString } from '../utils/validation.js';
|
|
9
|
+
/**
|
|
10
|
+
* Parses a JSON array-of-strings field from raw furnace config data.
|
|
11
|
+
* @param value - Raw value from JSON
|
|
12
|
+
* @param fieldName - Field label for error messages
|
|
13
|
+
*/
|
|
14
|
+
export function parseStringArray(value, fieldName) {
|
|
15
|
+
if (!isArray(value)) {
|
|
16
|
+
throw new FurnaceError(`Furnace config: "${fieldName}" must be an array`);
|
|
17
|
+
}
|
|
18
|
+
const items = [];
|
|
19
|
+
for (const item of value) {
|
|
20
|
+
if (!isString(item)) {
|
|
21
|
+
throw new FurnaceError(`Furnace config: "${fieldName}" array must contain only strings`);
|
|
22
|
+
}
|
|
23
|
+
items.push(item);
|
|
24
|
+
}
|
|
25
|
+
return items;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=furnace-config-array-utils.js.map
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { FurnaceError } from '../errors/furnace.js';
|
|
10
10
|
import { isExplicitAbsolutePath } from '../utils/paths.js';
|
|
11
11
|
import { isBoolean, isString } from '../utils/validation.js';
|
|
12
|
-
import { parseStringArray } from './furnace-config.js';
|
|
12
|
+
import { parseStringArray } from './furnace-config-array-utils.js';
|
|
13
13
|
import { validateSharedFtl } from './shared-ftl.js';
|
|
14
14
|
/**
|
|
15
15
|
* Validates a custom component config object.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { FurnaceError } from '../errors/furnace.js';
|
|
8
8
|
import { isContainedRelativePath } from '../utils/paths.js';
|
|
9
|
-
import { parseStringArray } from './furnace-config.js';
|
|
9
|
+
import { parseStringArray } from './furnace-config-array-utils.js';
|
|
10
10
|
/**
|
|
11
11
|
* Validates a `tokenHostDocuments` raw value. Each entry must be a non-empty
|
|
12
12
|
* relative path contained in the engine tree. Throws `FurnaceError` on
|
|
@@ -38,12 +38,6 @@ export declare function getFurnacePaths(root: string): FurnacePaths;
|
|
|
38
38
|
* @returns True if furnace.json exists
|
|
39
39
|
*/
|
|
40
40
|
export declare function furnaceConfigExists(root: string): Promise<boolean>;
|
|
41
|
-
/**
|
|
42
|
-
* Validates an override component config object.
|
|
43
|
-
* @param data - Raw data to validate
|
|
44
|
-
* @param name - Component name for error messages
|
|
45
|
-
*/
|
|
46
|
-
export declare function parseStringArray(value: unknown, fieldName: string): string[];
|
|
47
41
|
/**
|
|
48
42
|
* Migrates a furnace config from an older schema version to the current one.
|
|
49
43
|
* Returns the data unchanged if it is already at the current version.
|
|
@@ -4,8 +4,9 @@ import { FurnaceError } from '../errors/furnace.js';
|
|
|
4
4
|
import { toError } from '../utils/errors.js';
|
|
5
5
|
import { pathExists, readJson, writeJson } from '../utils/fs.js';
|
|
6
6
|
import { warn } from '../utils/logger.js';
|
|
7
|
-
import {
|
|
7
|
+
import { isObject, isString } from '../utils/validation.js';
|
|
8
8
|
import { FIREFORGE_DIR } from './config.js';
|
|
9
|
+
import { parseStringArray } from './furnace-config-array-utils.js';
|
|
9
10
|
import { parseCustomConfig } from './furnace-config-custom.js';
|
|
10
11
|
import { validateRuntimeVariables, validateTokenHostDocuments } from './furnace-config-tokens.js';
|
|
11
12
|
import { resolveFtlDir } from './furnace-constants.js';
|
|
@@ -51,19 +52,6 @@ export async function furnaceConfigExists(root) {
|
|
|
51
52
|
* @param data - Raw data to validate
|
|
52
53
|
* @param name - Component name for error messages
|
|
53
54
|
*/
|
|
54
|
-
export function parseStringArray(value, fieldName) {
|
|
55
|
-
if (!isArray(value)) {
|
|
56
|
-
throw new FurnaceError(`Furnace config: "${fieldName}" must be an array`);
|
|
57
|
-
}
|
|
58
|
-
const items = [];
|
|
59
|
-
for (const item of value) {
|
|
60
|
-
if (!isString(item)) {
|
|
61
|
-
throw new FurnaceError(`Furnace config: "${fieldName}" array must contain only strings`);
|
|
62
|
-
}
|
|
63
|
-
items.push(item);
|
|
64
|
-
}
|
|
65
|
-
return items;
|
|
66
|
-
}
|
|
67
55
|
function parseOverrideConfig(data, name) {
|
|
68
56
|
const validTypes = ['css-only', 'full'];
|
|
69
57
|
if (!isString(data['type']) || !validTypes.includes(data['type'])) {
|
|
@@ -3,10 +3,6 @@ export interface RefreshFileResult {
|
|
|
3
3
|
status: 'merged' | 'conflict' | 'unchanged' | 'new-file';
|
|
4
4
|
conflictMarkers?: number;
|
|
5
5
|
}
|
|
6
|
-
export interface RefreshResult {
|
|
7
|
-
files: RefreshFileResult[];
|
|
8
|
-
newBaseVersion: string;
|
|
9
|
-
}
|
|
10
6
|
/**
|
|
11
7
|
* Refreshes a single override file against the current engine HEAD.
|
|
12
8
|
*
|
|
@@ -15,7 +15,6 @@ export interface RegistrationWriteOptions {
|
|
|
15
15
|
markerComment?: string;
|
|
16
16
|
}
|
|
17
17
|
export { removeCustomElementRegistration } from './furnace-registration-remove.js';
|
|
18
|
-
export { CUSTOM_ELEMENTS_JS, JAR_MN } from './furnace-constants.js';
|
|
19
18
|
/**
|
|
20
19
|
* Adds a custom element registration entry to customElements.js.
|
|
21
20
|
*
|
|
@@ -49,7 +49,6 @@ function formatMarkerSuffix(markerComment) {
|
|
|
49
49
|
// Re-export from split modules so existing import sites continue working
|
|
50
50
|
export { removeCustomElementRegistration } from './furnace-registration-remove.js';
|
|
51
51
|
// Re-export constants so existing import sites continue working
|
|
52
|
-
export { CUSTOM_ELEMENTS_JS, JAR_MN } from './furnace-constants.js';
|
|
53
52
|
// ---------------------------------------------------------------------------
|
|
54
53
|
// Helpers
|
|
55
54
|
// ---------------------------------------------------------------------------
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { CUSTOM_ELEMENTS_JS, JAR_MN } from './furnace-constants.js';
|
|
2
1
|
export { addCustomElementRegistration, removeCustomElementRegistration, validateCustomElementRegistration, } from './furnace-registration-ast.js';
|
|
3
2
|
/**
|
|
4
3
|
* Adds jar.mn entries that map chrome:// URIs to on-disk paths for a
|
|
@@ -27,7 +26,7 @@ export { addCustomElementRegistration, removeCustomElementRegistration, validate
|
|
|
27
26
|
*
|
|
28
27
|
* If Firefox upstream changes the jar.mn section ordering or switches to a
|
|
29
28
|
* different resource registration mechanism, the preflight validation in
|
|
30
|
-
* `
|
|
29
|
+
* `validateJarMnInsertionForFiles` will catch the format mismatch before any writes
|
|
31
30
|
* occur.
|
|
32
31
|
*
|
|
33
32
|
* @param engineDir - Path to the Firefox engine source root
|
|
@@ -76,4 +75,4 @@ export declare function removeJarMnEntries(engineDir: string, tagName: string):
|
|
|
76
75
|
* Validates that jar.mn entries *could* be added without writing anything.
|
|
77
76
|
* Used by dry-run to surface structural problems early.
|
|
78
77
|
*/
|
|
79
|
-
export declare function
|
|
78
|
+
export declare function validateJarMnInsertionForFiles(engineDir: string, tagName: string, files: string[]): Promise<void>;
|
|
@@ -21,7 +21,6 @@ function detectJarMnIndent(lines) {
|
|
|
21
21
|
return ' ';
|
|
22
22
|
}
|
|
23
23
|
// Re-export everything from the AST module so existing imports keep working
|
|
24
|
-
export { CUSTOM_ELEMENTS_JS, JAR_MN } from './furnace-constants.js';
|
|
25
24
|
export { addCustomElementRegistration, removeCustomElementRegistration, validateCustomElementRegistration, } from './furnace-registration-ast.js';
|
|
26
25
|
import { JAR_MN } from './furnace-constants.js';
|
|
27
26
|
/**
|
|
@@ -51,7 +50,7 @@ import { JAR_MN } from './furnace-constants.js';
|
|
|
51
50
|
*
|
|
52
51
|
* If Firefox upstream changes the jar.mn section ordering or switches to a
|
|
53
52
|
* different resource registration mechanism, the preflight validation in
|
|
54
|
-
* `
|
|
53
|
+
* `validateJarMnInsertionForFiles` will catch the format mismatch before any writes
|
|
55
54
|
* occur.
|
|
56
55
|
*
|
|
57
56
|
* @param engineDir - Path to the Firefox engine source root
|
|
@@ -237,7 +236,7 @@ export async function removeJarMnEntries(engineDir, tagName) {
|
|
|
237
236
|
* Validates that jar.mn entries *could* be added without writing anything.
|
|
238
237
|
* Used by dry-run to surface structural problems early.
|
|
239
238
|
*/
|
|
240
|
-
export async function
|
|
239
|
+
export async function validateJarMnInsertionForFiles(engineDir, tagName, files) {
|
|
241
240
|
const filePath = join(engineDir, JAR_MN);
|
|
242
241
|
if (!(await pathExists(filePath))) {
|
|
243
242
|
throw new FurnaceError('jar.mn not found in engine', tagName);
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import type { GitStatusEntry } from './git-base.js';
|
|
2
|
-
/**
|
|
3
|
-
* Discards changes to a specific file.
|
|
4
|
-
* @param repoDir - Repository directory
|
|
5
|
-
* @param filePath - Path to the file (relative to repo)
|
|
6
|
-
*/
|
|
7
|
-
export declare function discardFile(repoDir: string, filePath: string): Promise<void>;
|
|
8
2
|
/**
|
|
9
3
|
* Restores a tracked path from HEAD, including staged changes.
|
|
10
4
|
* @param repoDir - Repository directory
|
|
@@ -5,14 +5,6 @@ import { GitError } from '../errors/git.js';
|
|
|
5
5
|
import { removeFile } from '../utils/fs.js';
|
|
6
6
|
import { exec } from '../utils/process.js';
|
|
7
7
|
import { ensureGit, git } from './git-base.js';
|
|
8
|
-
/**
|
|
9
|
-
* Discards changes to a specific file.
|
|
10
|
-
* @param repoDir - Repository directory
|
|
11
|
-
* @param filePath - Path to the file (relative to repo)
|
|
12
|
-
*/
|
|
13
|
-
export async function discardFile(repoDir, filePath) {
|
|
14
|
-
await restoreTrackedPath(repoDir, filePath);
|
|
15
|
-
}
|
|
16
8
|
/**
|
|
17
9
|
* Restores a tracked path from HEAD, including staged changes.
|
|
18
10
|
* @param repoDir - Repository directory
|
|
@@ -20,12 +20,6 @@ export declare function getWorkingTreeStatus(repoDir: string): Promise<GitStatus
|
|
|
20
20
|
* @returns Status entries with untracked directories expanded to individual files
|
|
21
21
|
*/
|
|
22
22
|
export declare function expandUntrackedDirectoryEntries(repoDir: string, entries: GitStatusEntry[]): Promise<GitStatusEntry[]>;
|
|
23
|
-
/**
|
|
24
|
-
* Gets the list of modified files.
|
|
25
|
-
* @param repoDir - Repository directory
|
|
26
|
-
* @returns List of modified file paths
|
|
27
|
-
*/
|
|
28
|
-
export declare function getModifiedFiles(repoDir: string): Promise<string[]>;
|
|
29
23
|
/**
|
|
30
24
|
* Gets all untracked files (including files inside untracked directories).
|
|
31
25
|
* @param repoDir - Repository directory
|
|
@@ -55,11 +49,3 @@ export declare function getModifiedFilesInDir(repoDir: string, dir: string): Pro
|
|
|
55
49
|
* @returns List of dirty file paths
|
|
56
50
|
*/
|
|
57
51
|
export declare function getDirtyFiles(repoDir: string, files: string[]): Promise<string[]>;
|
|
58
|
-
/**
|
|
59
|
-
* Lists all files in a directory (tracked and untracked, respecting .gitignore).
|
|
60
|
-
* Combines git ls-files for tracked files and --others for untracked files.
|
|
61
|
-
* @param repoDir - Repository directory
|
|
62
|
-
* @param dir - Directory path (relative to repo root)
|
|
63
|
-
* @returns List of file paths relative to repo root
|
|
64
|
-
*/
|
|
65
|
-
export declare function listAllFilesInDir(repoDir: string, dir: string): Promise<string[]>;
|
|
@@ -72,15 +72,6 @@ export async function expandUntrackedDirectoryEntries(repoDir, entries) {
|
|
|
72
72
|
}
|
|
73
73
|
return expanded;
|
|
74
74
|
}
|
|
75
|
-
/**
|
|
76
|
-
* Gets the list of modified files.
|
|
77
|
-
* @param repoDir - Repository directory
|
|
78
|
-
* @returns List of modified file paths
|
|
79
|
-
*/
|
|
80
|
-
export async function getModifiedFiles(repoDir) {
|
|
81
|
-
const entries = await getWorkingTreeStatus(repoDir);
|
|
82
|
-
return entries.map((entry) => entry.file);
|
|
83
|
-
}
|
|
84
75
|
/**
|
|
85
76
|
* Gets all untracked files (including files inside untracked directories).
|
|
86
77
|
* @param repoDir - Repository directory
|
|
@@ -134,19 +125,4 @@ export async function getDirtyFiles(repoDir, files) {
|
|
|
134
125
|
const untracked = untrackedOutput.split('\n').filter((line) => line.trim().length > 0);
|
|
135
126
|
return [...new Set([...tracked, ...untracked])].sort();
|
|
136
127
|
}
|
|
137
|
-
/**
|
|
138
|
-
* Lists all files in a directory (tracked and untracked, respecting .gitignore).
|
|
139
|
-
* Combines git ls-files for tracked files and --others for untracked files.
|
|
140
|
-
* @param repoDir - Repository directory
|
|
141
|
-
* @param dir - Directory path (relative to repo root)
|
|
142
|
-
* @returns List of file paths relative to repo root
|
|
143
|
-
*/
|
|
144
|
-
export async function listAllFilesInDir(repoDir, dir) {
|
|
145
|
-
await ensureGit();
|
|
146
|
-
const trackedOutput = await git(['ls-files', '--', dir], repoDir);
|
|
147
|
-
const trackedFiles = trackedOutput.split('\n').filter((line) => line.trim().length > 0);
|
|
148
|
-
const untrackedOutput = await git(['ls-files', '--others', '--exclude-standard', '--', dir], repoDir);
|
|
149
|
-
const untrackedFiles = untrackedOutput.split('\n').filter((line) => line.trim().length > 0);
|
|
150
|
-
return [...new Set([...trackedFiles, ...untrackedFiles])].sort();
|
|
151
|
-
}
|
|
152
128
|
//# sourceMappingURL=git-status.js.map
|
package/dist/src/core/git.d.ts
CHANGED
package/dist/src/core/mach.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SmokeLineCallback, type SmokeRunResult } from '../utils/process.js';
|
|
2
|
-
export { attemptMozinfoRewrite,
|
|
3
|
-
export { generateMozconfig
|
|
2
|
+
export { attemptMozinfoRewrite, buildArtifactMismatchMessage, hasBuildArtifacts, hasRunnableBundle, } from './mach-build-artifacts.js';
|
|
3
|
+
export { generateMozconfig } from './mach-mozconfig.js';
|
|
4
4
|
export { ensurePython, resetResolvedPython } from './mach-python.js';
|
|
5
5
|
/**
|
|
6
6
|
* Ensures mach is available in the engine directory.
|
|
@@ -64,13 +64,31 @@ export declare function assertMarionettePortAvailable(port?: number, options?: {
|
|
|
64
64
|
* `undefined`.
|
|
65
65
|
*/
|
|
66
66
|
export declare function extractForwardedMarionettePort(machArgs: string[]): number | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* True when forwarded mach args explicitly select the xpcshell harness.
|
|
69
|
+
* Used so `--marionette-port` auto-forward skips `--setpref=marionette.port`
|
|
70
|
+
* for runs where the pref is ignored anyway.
|
|
71
|
+
*/
|
|
72
|
+
export declare function hasExplicitXpcshellFlavor(machArgs: string[]): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Whether `fireforge test` should append `--setpref=marionette.port=<n>` when
|
|
75
|
+
* the operator passed `--marionette-port`. Forwards for every harness except
|
|
76
|
+
* an explicit `--flavor=xpcshell` / `xpcshell-tests` (toolkit widget mochitests
|
|
77
|
+
* under `toolkit/content/tests/` do not match the older path-only heuristic
|
|
78
|
+
* but still launch a Marionette-driven browser).
|
|
79
|
+
*/
|
|
80
|
+
export declare function shouldAutoForwardMarionettePortToMach(machArgs: string[]): boolean;
|
|
67
81
|
/**
|
|
68
82
|
* Heuristic: do the test paths or forwarded mach args indicate a flavour
|
|
69
83
|
* that actually launches a Marionette-driven browser? Browser-chrome and
|
|
70
|
-
* mochitest do; xpcshell does not.
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
84
|
+
* mochitest do; xpcshell does not. A no-paths invocation (the default "run
|
|
85
|
+
* all tests" shape) is treated as marionette-relevant since it includes
|
|
86
|
+
* browser-chrome.
|
|
87
|
+
*
|
|
88
|
+
* Note: `fireforge test` auto-forward of `--marionette-port` to mach uses
|
|
89
|
+
* {@link shouldAutoForwardMarionettePortToMach} (mach-arg flavor gate) rather
|
|
90
|
+
* than this function alone, so toolkit paths without `/mochitest/` still get
|
|
91
|
+
* the pref when appropriate.
|
|
74
92
|
*
|
|
75
93
|
* @param testPaths - Engine-relative paths after `stripEnginePrefix`.
|
|
76
94
|
* @param machArgs - Forwarded mach args (post-`--mach-arg`).
|
|
@@ -260,23 +260,47 @@ export function extractForwardedMarionettePort(machArgs) {
|
|
|
260
260
|
}
|
|
261
261
|
return undefined;
|
|
262
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* True when forwarded mach args explicitly select the xpcshell harness.
|
|
265
|
+
* Used so `--marionette-port` auto-forward skips `--setpref=marionette.port`
|
|
266
|
+
* for runs where the pref is ignored anyway.
|
|
267
|
+
*/
|
|
268
|
+
export function hasExplicitXpcshellFlavor(machArgs) {
|
|
269
|
+
for (const arg of machArgs) {
|
|
270
|
+
if (/^--flavor=xpcshell\b/.test(arg) || arg === '--flavor=xpcshell-tests')
|
|
271
|
+
return true;
|
|
272
|
+
}
|
|
273
|
+
return false;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Whether `fireforge test` should append `--setpref=marionette.port=<n>` when
|
|
277
|
+
* the operator passed `--marionette-port`. Forwards for every harness except
|
|
278
|
+
* an explicit `--flavor=xpcshell` / `xpcshell-tests` (toolkit widget mochitests
|
|
279
|
+
* under `toolkit/content/tests/` do not match the older path-only heuristic
|
|
280
|
+
* but still launch a Marionette-driven browser).
|
|
281
|
+
*/
|
|
282
|
+
export function shouldAutoForwardMarionettePortToMach(machArgs) {
|
|
283
|
+
return !hasExplicitXpcshellFlavor(machArgs);
|
|
284
|
+
}
|
|
263
285
|
/**
|
|
264
286
|
* Heuristic: do the test paths or forwarded mach args indicate a flavour
|
|
265
287
|
* that actually launches a Marionette-driven browser? Browser-chrome and
|
|
266
|
-
* mochitest do; xpcshell does not.
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
288
|
+
* mochitest do; xpcshell does not. A no-paths invocation (the default "run
|
|
289
|
+
* all tests" shape) is treated as marionette-relevant since it includes
|
|
290
|
+
* browser-chrome.
|
|
291
|
+
*
|
|
292
|
+
* Note: `fireforge test` auto-forward of `--marionette-port` to mach uses
|
|
293
|
+
* {@link shouldAutoForwardMarionettePortToMach} (mach-arg flavor gate) rather
|
|
294
|
+
* than this function alone, so toolkit paths without `/mochitest/` still get
|
|
295
|
+
* the pref when appropriate.
|
|
270
296
|
*
|
|
271
297
|
* @param testPaths - Engine-relative paths after `stripEnginePrefix`.
|
|
272
298
|
* @param machArgs - Forwarded mach args (post-`--mach-arg`).
|
|
273
299
|
* @returns `true` when the run is likely to bind a Marionette listener.
|
|
274
300
|
*/
|
|
275
301
|
export function isMarionetteFlavor(testPaths, machArgs) {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
return false;
|
|
279
|
-
}
|
|
302
|
+
if (hasExplicitXpcshellFlavor(machArgs))
|
|
303
|
+
return false;
|
|
280
304
|
for (const arg of machArgs) {
|
|
281
305
|
if (/^--flavor=(browser-chrome|mochitest|chrome|a11y)\b/.test(arg))
|
|
282
306
|
return true;
|
|
@@ -291,6 +315,9 @@ export function isMarionetteFlavor(testPaths, machArgs) {
|
|
|
291
315
|
return true;
|
|
292
316
|
if (path.includes('/browser-chrome/') || path.startsWith('browser-chrome/'))
|
|
293
317
|
return true;
|
|
318
|
+
if (path.includes('toolkit/content/tests/') && !path.includes('/tests/xpcshell/')) {
|
|
319
|
+
return true;
|
|
320
|
+
}
|
|
294
321
|
}
|
|
295
322
|
return false;
|
|
296
323
|
}
|
|
@@ -6,8 +6,8 @@ import type { ImportSummary, PatchResult } from '../types/commands/index.js';
|
|
|
6
6
|
export { PatchError } from '../errors/patch.js';
|
|
7
7
|
export { countPatches, discoverPatches, getAllTargetFilesFromPatch, getTargetFileFromPatch, isNewFilePatch, } from './patch-files.js';
|
|
8
8
|
export { withPatchDirectoryLock } from './patch-lock.js';
|
|
9
|
-
export { extractAffectedFiles, extractOrder, isNewFileInPatch
|
|
10
|
-
export { applyPatchToContent, extractNewFileContent
|
|
9
|
+
export { extractAffectedFiles, extractOrder, isNewFileInPatch } from './patch-parse.js';
|
|
10
|
+
export { applyPatchToContent, extractNewFileContent } from './patch-transform.js';
|
|
11
11
|
/**
|
|
12
12
|
* Applies all patches in order. Rolls back all successfully applied
|
|
13
13
|
* patches when one fails so the engine directory stays clean.
|
|
@@ -21,8 +21,8 @@ import { applyPatchToContent, extractNewFileContent } from './patch-transform.js
|
|
|
21
21
|
export { PatchError } from '../errors/patch.js';
|
|
22
22
|
export { countPatches, discoverPatches, getAllTargetFilesFromPatch, getTargetFileFromPatch, isNewFilePatch, } from './patch-files.js';
|
|
23
23
|
export { withPatchDirectoryLock } from './patch-lock.js';
|
|
24
|
-
export { extractAffectedFiles, extractOrder, isNewFileInPatch
|
|
25
|
-
export { applyPatchToContent, extractNewFileContent
|
|
24
|
+
export { extractAffectedFiles, extractOrder, isNewFileInPatch } from './patch-parse.js';
|
|
25
|
+
export { applyPatchToContent, extractNewFileContent } from './patch-transform.js';
|
|
26
26
|
/**
|
|
27
27
|
* Applies a single patch.
|
|
28
28
|
* @param patch - Patch info
|
|
@@ -2,8 +2,5 @@
|
|
|
2
2
|
* Public re-exports for {@link ./patch-lint.ts}. Split out so the
|
|
3
3
|
* orchestrator stays within the ESLint `max-lines` budget.
|
|
4
4
|
*/
|
|
5
|
-
export {
|
|
6
|
-
export { buildPatchQueueContext, collectNewFileCreatorsByPath, type ExtractedSpecifier, extractImportSpecifiers, extractImportSpecifiersWithLines, findForwardImportIgnoreLines, FORWARD_IMPORT_IGNORE_MARKER, isForwardImportableFile, lintPatchQueue, lintPatchQueueDuplicateCreations, lintPatchQueueForwardImports, type PatchQueueContext, type PatchQueueEntry, } from './patch-lint-cross.js';
|
|
5
|
+
export { buildPatchQueueContext, collectNewFileCreatorsByPath, extractImportSpecifiers, extractImportSpecifiersWithLines, findForwardImportIgnoreLines, FORWARD_IMPORT_IGNORE_MARKER, isForwardImportableFile, lintPatchQueue, lintPatchQueueDuplicateCreations, lintPatchQueueForwardImports, type PatchQueueContext, type PatchQueueEntry, } from './patch-lint-cross.js';
|
|
7
6
|
export { buildModifiedFileAdditionsFromDiff, detectNewFilesInDiff } from './patch-lint-diff.js';
|
|
8
|
-
export { type JsDocCheck, type JsDocIssue, validateExportJsDoc } from './patch-lint-jsdoc.js';
|
|
9
|
-
export { resolvePatchOwnedChromeScripts, resolvePatchOwnedSysMjs } from './patch-lint-ownership.js';
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
* Public re-exports for {@link ./patch-lint.ts}. Split out so the
|
|
4
4
|
* orchestrator stays within the ESLint `max-lines` budget.
|
|
5
5
|
*/
|
|
6
|
-
export { runCheckJs } from './patch-lint-checkjs.js';
|
|
7
6
|
export { buildPatchQueueContext, collectNewFileCreatorsByPath, extractImportSpecifiers, extractImportSpecifiersWithLines, findForwardImportIgnoreLines, FORWARD_IMPORT_IGNORE_MARKER, isForwardImportableFile, lintPatchQueue, lintPatchQueueDuplicateCreations, lintPatchQueueForwardImports, } from './patch-lint-cross.js';
|
|
8
7
|
export { buildModifiedFileAdditionsFromDiff, detectNewFilesInDiff } from './patch-lint-diff.js';
|
|
9
|
-
export { validateExportJsDoc } from './patch-lint-jsdoc.js';
|
|
10
|
-
export { resolvePatchOwnedChromeScripts, resolvePatchOwnedSysMjs } from './patch-lint-ownership.js';
|
|
11
8
|
//# sourceMappingURL=patch-lint-reexports.js.map
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
* Callers should continue to import from this module; the internal split
|
|
5
5
|
* is an implementation detail.
|
|
6
6
|
*/
|
|
7
|
-
export type { PatchManifestConsistencyIssue } from './patch-manifest-consistency.js';
|
|
8
7
|
export { rebuildPatchesManifest, validatePatchesManifestConsistency, } from './patch-manifest-consistency.js';
|
|
9
|
-
export { addPatchToManifest, loadPatchesManifest,
|
|
8
|
+
export { addPatchToManifest, loadPatchesManifest, PATCHES_MANIFEST, type PatchRenameEntry, removePatchFileAndManifest, renumberPatchesInManifest, savePatchesManifest, } from './patch-manifest-io.js';
|
|
10
9
|
export { checkVersionCompatibility, findPatchesAffectingFile, getClaimedFiles, stampPatchVersions, validatePatchIntegrity, } from './patch-manifest-query.js';
|
|
11
10
|
export { resolvePatchIdentifier } from './patch-manifest-resolve.js';
|
|
12
11
|
export { validatePatchesManifest } from './patch-manifest-validate.js';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* is an implementation detail.
|
|
7
7
|
*/
|
|
8
8
|
export { rebuildPatchesManifest, validatePatchesManifestConsistency, } from './patch-manifest-consistency.js';
|
|
9
|
-
export { addPatchToManifest, loadPatchesManifest,
|
|
9
|
+
export { addPatchToManifest, loadPatchesManifest, PATCHES_MANIFEST, removePatchFileAndManifest, renumberPatchesInManifest, savePatchesManifest, } from './patch-manifest-io.js';
|
|
10
10
|
export { checkVersionCompatibility, findPatchesAffectingFile, getClaimedFiles, stampPatchVersions, validatePatchIntegrity, } from './patch-manifest-query.js';
|
|
11
11
|
export { resolvePatchIdentifier } from './patch-manifest-resolve.js';
|
|
12
12
|
export { validatePatchesManifest } from './patch-manifest-validate.js';
|
|
@@ -29,11 +29,6 @@
|
|
|
29
29
|
* persist pair," not "postpone exit indefinitely."
|
|
30
30
|
*/
|
|
31
31
|
export declare function runInSignalCriticalSection<T>(label: string, fn: () => Promise<T>): Promise<T>;
|
|
32
|
-
/**
|
|
33
|
-
* Returns true while any critical section is currently running. Used by the
|
|
34
|
-
* bin entry point's signal handler to decide whether to await before exit.
|
|
35
|
-
*/
|
|
36
|
-
export declare function hasActiveCriticalSection(): boolean;
|
|
37
32
|
/**
|
|
38
33
|
* Waits for every active critical section to complete or for `timeoutMs` to
|
|
39
34
|
* elapse, whichever comes first. Never rejects: a section that throws still
|
|
@@ -41,9 +36,3 @@ export declare function hasActiveCriticalSection(): boolean;
|
|
|
41
36
|
* cleans up in `finally`.
|
|
42
37
|
*/
|
|
43
38
|
export declare function waitForActiveCriticalSections(timeoutMs: number): Promise<void>;
|
|
44
|
-
/**
|
|
45
|
-
* Test-only helper: clears the critical-section registry. Production code
|
|
46
|
-
* must never call this — it voids the exit-ordering guarantee for any
|
|
47
|
-
* section still in flight.
|
|
48
|
-
*/
|
|
49
|
-
export declare function resetCriticalSectionsForTests(): void;
|
|
@@ -47,13 +47,6 @@ export async function runInSignalCriticalSection(label, fn) {
|
|
|
47
47
|
resolver();
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
/**
|
|
51
|
-
* Returns true while any critical section is currently running. Used by the
|
|
52
|
-
* bin entry point's signal handler to decide whether to await before exit.
|
|
53
|
-
*/
|
|
54
|
-
export function hasActiveCriticalSection() {
|
|
55
|
-
return activeSections.size > 0;
|
|
56
|
-
}
|
|
57
50
|
/**
|
|
58
51
|
* Waits for every active critical section to complete or for `timeoutMs` to
|
|
59
52
|
* elapse, whichever comes first. Never rejects: a section that throws still
|
|
@@ -69,12 +62,4 @@ export async function waitForActiveCriticalSections(timeoutMs) {
|
|
|
69
62
|
new Promise((resolve) => setTimeout(resolve, timeoutMs)),
|
|
70
63
|
]);
|
|
71
64
|
}
|
|
72
|
-
/**
|
|
73
|
-
* Test-only helper: clears the critical-section registry. Production code
|
|
74
|
-
* must never call this — it voids the exit-ordering guarantee for any
|
|
75
|
-
* section still in flight.
|
|
76
|
-
*/
|
|
77
|
-
export function resetCriticalSectionsForTests() {
|
|
78
|
-
activeSections.clear();
|
|
79
|
-
}
|
|
80
65
|
//# sourceMappingURL=signal-critical.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Wire targets barrel — re-exports all wiring target modules.
|
|
3
3
|
*/
|
|
4
|
-
export {
|
|
5
|
-
export { addDomFragment
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
4
|
+
export { addDestroyToBrowserInit } from './wire-destroy.js';
|
|
5
|
+
export { addDomFragment } from './wire-dom-fragment.js';
|
|
6
|
+
export { addInitToBrowserInit } from './wire-init.js';
|
|
7
|
+
export { addSubscriptToBrowserMain } from './wire-subscript.js';
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Wire targets barrel — re-exports all wiring target modules.
|
|
4
4
|
*/
|
|
5
|
-
export {
|
|
6
|
-
export { addDomFragment
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
5
|
+
export { addDestroyToBrowserInit } from './wire-destroy.js';
|
|
6
|
+
export { addDomFragment } from './wire-dom-fragment.js';
|
|
7
|
+
export { addInitToBrowserInit } from './wire-init.js';
|
|
8
|
+
export { addSubscriptToBrowserMain } from './wire-subscript.js';
|
|
9
9
|
//# sourceMappingURL=wire-targets.js.map
|
|
@@ -319,9 +319,10 @@ export interface TestOptions {
|
|
|
319
319
|
/**
|
|
320
320
|
* Override the Marionette control port (default 2828) used by the
|
|
321
321
|
* stale-browser probe, the `--doctor` preflight, and the auto-forwarded
|
|
322
|
-
* `--setpref=marionette.port=<n>` arg passed to mach
|
|
323
|
-
*
|
|
324
|
-
* when a
|
|
322
|
+
* `--setpref=marionette.port=<n>` arg passed to mach (omitted when mach
|
|
323
|
+
* args explicitly set `--flavor=xpcshell` / `xpcshell-tests`). Set this
|
|
324
|
+
* when a stale process holds the default port and `kill` is not an option,
|
|
325
|
+
* or when a CI runner reserves a different port for parallel test runs.
|
|
325
326
|
*/
|
|
326
327
|
marionettePort?: number;
|
|
327
328
|
}
|
|
@@ -3,11 +3,6 @@
|
|
|
3
3
|
* @param enabled - Whether to enable verbose output
|
|
4
4
|
*/
|
|
5
5
|
export declare function setVerbose(enabled: boolean): void;
|
|
6
|
-
/**
|
|
7
|
-
* Checks if verbose mode is enabled.
|
|
8
|
-
* @returns True if verbose mode is enabled
|
|
9
|
-
*/
|
|
10
|
-
export declare function isVerbose(): boolean;
|
|
11
6
|
/**
|
|
12
7
|
* Displays a verbose/debug message (only shown if verbose mode is enabled).
|
|
13
8
|
* @param message - Message to display
|
package/dist/src/utils/logger.js
CHANGED
|
@@ -14,7 +14,7 @@ export function setVerbose(enabled) {
|
|
|
14
14
|
* Checks if verbose mode is enabled.
|
|
15
15
|
* @returns True if verbose mode is enabled
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
function isVerbose() {
|
|
18
18
|
return verboseMode;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
@@ -22,7 +22,7 @@ export function isVerbose() {
|
|
|
22
22
|
* @param message - Message to display
|
|
23
23
|
*/
|
|
24
24
|
export function verbose(message) {
|
|
25
|
-
if (
|
|
25
|
+
if (isVerbose()) {
|
|
26
26
|
p.log.info(`[debug] ${message}`);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -14,8 +14,6 @@ interface PackageMetadata {
|
|
|
14
14
|
* within a process.
|
|
15
15
|
*/
|
|
16
16
|
export declare function getPackageRoot(): string;
|
|
17
|
-
/** Clears the cached package root for testing. */
|
|
18
|
-
export declare function resetPackageRootCacheForTests(): void;
|
|
19
17
|
/** @internal */
|
|
20
18
|
export declare function isFireForgePackageMetadata(pkg: PackageMetadata): boolean;
|
|
21
19
|
/** Reads the current package version from the repository root package manifest. */
|
|
@@ -53,10 +53,6 @@ export function getPackageRoot() {
|
|
|
53
53
|
current = parent;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
/** Clears the cached package root for testing. */
|
|
57
|
-
export function resetPackageRootCacheForTests() {
|
|
58
|
-
cachedPackageRoot = undefined;
|
|
59
|
-
}
|
|
60
56
|
/** @internal */
|
|
61
57
|
export function isFireForgePackageMetadata(pkg) {
|
|
62
58
|
if (typeof pkg.bin !== 'object' || pkg.bin === null || Array.isArray(pkg.bin)) {
|