@hominis/fireforge 0.27.0 → 0.27.2
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 +11 -1
- package/README.md +6 -6
- package/dist/src/cli.js +5 -1
- package/dist/src/commands/build.js +61 -1
- package/dist/src/commands/doctor/post-rebase-audit.d.ts +2 -0
- package/dist/src/commands/doctor/post-rebase-audit.js +86 -0
- package/dist/src/commands/doctor-working-tree.js +5 -1
- package/dist/src/commands/doctor.js +3 -0
- package/dist/src/commands/download.js +41 -42
- package/dist/src/commands/export-all.js +3 -2
- package/dist/src/commands/export-flow.d.ts +2 -0
- package/dist/src/commands/export-flow.js +2 -0
- package/dist/src/commands/export.js +5 -4
- package/dist/src/commands/import.js +2 -1
- package/dist/src/commands/manifest.js +2 -0
- package/dist/src/commands/re-export.js +10 -8
- package/dist/src/commands/rebase/conflict-summary.d.ts +12 -0
- package/dist/src/commands/rebase/conflict-summary.js +38 -0
- package/dist/src/commands/rebase/continue.js +2 -0
- package/dist/src/commands/rebase/index.d.ts +2 -2
- package/dist/src/commands/rebase/index.js +9 -4
- package/dist/src/commands/rebase/patch-loop.js +29 -11
- package/dist/src/commands/rebase/summary.js +7 -2
- package/dist/src/commands/resolve.js +2 -1
- package/dist/src/commands/setup-support.js +6 -2
- package/dist/src/commands/setup.js +1 -0
- package/dist/src/commands/source.d.ts +9 -0
- package/dist/src/commands/source.js +92 -0
- package/dist/src/commands/status-output.d.ts +13 -0
- package/dist/src/commands/status-output.js +186 -0
- package/dist/src/commands/status.js +4 -247
- package/dist/src/commands/verify.js +32 -16
- package/dist/src/core/build-prepare.js +12 -4
- package/dist/src/core/config-validate.js +1 -1
- package/dist/src/core/firefox-cache.d.ts +1 -1
- package/dist/src/core/firefox-cache.js +10 -3
- package/dist/src/core/firefox-extract.d.ts +1 -1
- package/dist/src/core/firefox-extract.js +13 -1
- package/dist/src/core/firefox.d.ts +2 -1
- package/dist/src/core/firefox.js +3 -3
- package/dist/src/core/furnace-registration-validate.d.ts +7 -0
- package/dist/src/core/furnace-registration-validate.js +29 -12
- package/dist/src/core/furnace-validate-registration.js +5 -37
- package/dist/src/core/git.js +25 -5
- package/dist/src/core/ownership-table.d.ts +3 -1
- package/dist/src/core/ownership-table.js +31 -7
- package/dist/src/core/patch-artifact-normalize.d.ts +9 -0
- package/dist/src/core/patch-artifact-normalize.js +13 -0
- package/dist/src/core/patch-export-update.js +2 -1
- package/dist/src/core/patch-export.d.ts +4 -0
- package/dist/src/core/patch-export.js +7 -2
- package/dist/src/core/patch-manifest-consistency.d.ts +1 -1
- package/dist/src/core/patch-manifest-consistency.js +4 -2
- package/dist/src/core/patch-manifest-query.d.ts +4 -3
- package/dist/src/core/patch-manifest-query.js +12 -4
- package/dist/src/core/patch-manifest-validate.js +22 -4
- package/dist/src/core/patch-source-metadata.d.ts +8 -0
- package/dist/src/core/patch-source-metadata.js +17 -0
- package/dist/src/core/rebase-session.d.ts +8 -3
- package/dist/src/core/rebase-session.js +1 -1
- package/dist/src/core/status-classify.d.ts +4 -1
- package/dist/src/core/status-classify.js +4 -5
- package/dist/src/types/commands/index.d.ts +1 -1
- package/dist/src/types/commands/options.d.ts +16 -1
- package/dist/src/types/commands/patches.d.ts +9 -1
- package/dist/src/types/config.d.ts +1 -1
- package/dist/src/utils/elapsed.d.ts +4 -0
- package/dist/src/utils/elapsed.js +15 -0
- package/dist/src/utils/validation.d.ts +2 -2
- package/dist/src/utils/validation.js +5 -5
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Rebase session persistence for multi-patch
|
|
2
|
+
* Rebase session persistence for multi-patch Firefox source upgrades.
|
|
3
3
|
* Session state is stored at `.fireforge/rebase-session.json` and
|
|
4
4
|
* survives across CLI invocations so the user can fix conflicts and
|
|
5
5
|
* resume with `fireforge rebase --continue`.
|
|
6
6
|
*/
|
|
7
|
+
import type { FirefoxProduct } from '../types/config.js';
|
|
7
8
|
export type RebasePatchStatus = 'pending' | 'applied-clean' | 'applied-fuzz' | 'failed' | 'resolved' | 'skipped';
|
|
8
9
|
export interface RebasePatchEntry {
|
|
9
10
|
filename: string;
|
|
@@ -18,9 +19,13 @@ export interface RebasePatchEntry {
|
|
|
18
19
|
export interface RebaseSession {
|
|
19
20
|
/** ISO timestamp when the rebase started. */
|
|
20
21
|
startedAt: string;
|
|
21
|
-
/**
|
|
22
|
+
/** Source product being rebased FROM. */
|
|
23
|
+
fromProduct?: FirefoxProduct;
|
|
24
|
+
/** Source product being rebased TO. */
|
|
25
|
+
toProduct?: FirefoxProduct;
|
|
26
|
+
/** Source version being rebased FROM. */
|
|
22
27
|
fromVersion: string;
|
|
23
|
-
/**
|
|
28
|
+
/** Source version being rebased TO. */
|
|
24
29
|
toVersion: string;
|
|
25
30
|
/** Commit hash recorded before the rebase started (for --abort). */
|
|
26
31
|
preRebaseCommit: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// SPDX-License-Identifier: EUPL-1.2
|
|
2
2
|
/**
|
|
3
|
-
* Rebase session persistence for multi-patch
|
|
3
|
+
* Rebase session persistence for multi-patch Firefox source upgrades.
|
|
4
4
|
* Session state is stored at `.fireforge/rebase-session.json` and
|
|
5
5
|
* survives across CLI invocations so the user can fix conflicts and
|
|
6
6
|
* resume with `fireforge rebase --continue`.
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
* Classification buckets for engine file changes:
|
|
10
10
|
* - `patch-backed`: content matches the expected post-patch state —
|
|
11
11
|
* normal after `fireforge import`.
|
|
12
|
+
* - `patch-owned-drift`: the file is claimed by exactly one patch, but
|
|
13
|
+
* the live engine content no longer matches that patch's expected
|
|
14
|
+
* post-apply content.
|
|
12
15
|
* - `unmanaged`: edits not explained by any patch or tool — local
|
|
13
16
|
* drift to export or discard.
|
|
14
17
|
* - `branding`: files under tool-managed branding paths, written by
|
|
@@ -23,7 +26,7 @@
|
|
|
23
26
|
* in `--json`, which misled scripts built on top of the JSON view
|
|
24
27
|
* into treating the file as routine local drift.
|
|
25
28
|
*/
|
|
26
|
-
export type FileClassification = 'patch-backed' | 'unmanaged' | 'branding' | 'furnace' | 'conflict';
|
|
29
|
+
export type FileClassification = 'patch-backed' | 'patch-owned-drift' | 'unmanaged' | 'branding' | 'furnace' | 'conflict';
|
|
27
30
|
export interface StatusFile {
|
|
28
31
|
status: string;
|
|
29
32
|
file: string;
|
|
@@ -123,7 +123,7 @@ export async function classifyFiles(files, engineDir, patchesDir, binaryName, fu
|
|
|
123
123
|
const expected = await computePatchedContent(patchesDir, engineDir, entry.file);
|
|
124
124
|
results.push({
|
|
125
125
|
...entry,
|
|
126
|
-
classification: expected === null ? 'patch-backed' : '
|
|
126
|
+
classification: expected === null ? 'patch-backed' : 'patch-owned-drift',
|
|
127
127
|
});
|
|
128
128
|
continue;
|
|
129
129
|
}
|
|
@@ -135,13 +135,12 @@ export async function classifyFiles(files, engineDir, patchesDir, binaryName, fu
|
|
|
135
135
|
]);
|
|
136
136
|
results.push({
|
|
137
137
|
...entry,
|
|
138
|
-
classification: actual === expected ? 'patch-backed' : '
|
|
138
|
+
classification: actual === expected ? 'patch-backed' : 'patch-owned-drift',
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
catch (error) {
|
|
142
|
-
verbose(`Treating ${entry.file} as
|
|
143
|
-
|
|
144
|
-
results.push({ ...entry, classification: 'unmanaged' });
|
|
142
|
+
verbose(`Treating ${entry.file} as patch-owned drift because patch-backed classification failed: ${toError(error).message}`);
|
|
143
|
+
results.push({ ...entry, classification: 'patch-owned-drift' });
|
|
145
144
|
}
|
|
146
145
|
}
|
|
147
146
|
return results;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Re-exports all command-related types from focused sub-modules.
|
|
3
3
|
*/
|
|
4
|
-
export type { BuildOptions, DiscardOptions, DoctorOptions, DownloadOptions, ExportOptions, FurnaceApplyOptions, FurnaceCreateOptions, FurnaceDeployOptions, FurnaceOverrideOptions, FurnacePreviewOptions, FurnaceRefreshOptions, FurnaceRemoveOptions, FurnaceSyncOptions, FurnaceValidateOptions, GlobalOptions, ImportOptions, PackageOptions, PatchCompactOptions, PatchDeleteOptions, PatchLintIgnoreOptions, PatchMoveFilesOptions, PatchRenameOptions, PatchReorderOptions, PatchStagedDependencyOptions, PatchTierOptions, RebaseOptions, ReExportOptions, RegisterOptions, ResetOptions, RunOptions, SetupOptions, StatusOptions, TestOptions, TokenAddOptions, WireOptions, } from './options.js';
|
|
4
|
+
export type { BuildOptions, DiscardOptions, DoctorOptions, DownloadOptions, ExportOptions, FurnaceApplyOptions, FurnaceCreateOptions, FurnaceDeployOptions, FurnaceOverrideOptions, FurnacePreviewOptions, FurnaceRefreshOptions, FurnaceRemoveOptions, FurnaceSyncOptions, FurnaceValidateOptions, GlobalOptions, ImportOptions, PackageOptions, PatchCompactOptions, PatchDeleteOptions, PatchLintIgnoreOptions, PatchMoveFilesOptions, PatchRenameOptions, PatchReorderOptions, PatchStagedDependencyOptions, PatchTierOptions, RebaseOptions, ReExportOptions, RegisterOptions, ResetOptions, RunOptions, SetupOptions, SourceSetOptions, StatusOptions, TestOptions, TokenAddOptions, WireOptions, } from './options.js';
|
|
5
5
|
export type { ImportSummary, PatchCategory, PatchesManifest, PatchInfo, PatchLintIssue, PatchMetadata, PatchResult, PatchStagedDependencies, PatchStagedForwardImport, } from './patches.js';
|
|
6
6
|
export type { DoctorCheck, ProjectStatus, TokenCoverageFileEntry, TokenCoverageReport, } from './project.js';
|
|
@@ -17,7 +17,7 @@ export interface SetupOptions {
|
|
|
17
17
|
binaryName?: string;
|
|
18
18
|
/** Firefox version to base on */
|
|
19
19
|
firefoxVersion?: string;
|
|
20
|
-
/** Firefox product type (firefox, firefox-esr, firefox-beta) */
|
|
20
|
+
/** Firefox product type (firefox, firefox-esr, firefox-beta, firefox-devedition) */
|
|
21
21
|
product?: FirefoxProduct;
|
|
22
22
|
/** Overwrite existing configuration without prompting */
|
|
23
23
|
force?: boolean;
|
|
@@ -31,6 +31,19 @@ export interface DownloadOptions {
|
|
|
31
31
|
/** Force re-download, deleting existing engine/ */
|
|
32
32
|
force?: boolean;
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Options for the source command.
|
|
36
|
+
*/
|
|
37
|
+
export interface SourceSetOptions {
|
|
38
|
+
/** Firefox version to set */
|
|
39
|
+
version: string;
|
|
40
|
+
/** Firefox product type */
|
|
41
|
+
product: FirefoxProduct;
|
|
42
|
+
/** Optional pinned SHA-256 for the resolved source archive */
|
|
43
|
+
sha256?: string;
|
|
44
|
+
/** Clear any existing pinned SHA-256 */
|
|
45
|
+
clearSha256?: boolean;
|
|
46
|
+
}
|
|
34
47
|
/**
|
|
35
48
|
* Options for the build command.
|
|
36
49
|
*/
|
|
@@ -651,6 +664,8 @@ export interface DoctorOptions {
|
|
|
651
664
|
* and side-effect-free.
|
|
652
665
|
*/
|
|
653
666
|
repairFurnace?: boolean;
|
|
667
|
+
/** Run extra post-rebase checks for common Firefox registration surfaces. */
|
|
668
|
+
postRebaseAudit?: boolean;
|
|
654
669
|
}
|
|
655
670
|
/**
|
|
656
671
|
* Global CLI options available to all commands.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types for the patch system: patch metadata, manifests, lint, and import results.
|
|
3
3
|
*/
|
|
4
|
+
import type { FirefoxProduct } from '../config.js';
|
|
4
5
|
/**
|
|
5
6
|
* Patch categories for organizational classification.
|
|
6
7
|
*/
|
|
@@ -47,8 +48,15 @@ export interface PatchMetadata {
|
|
|
47
48
|
description: string;
|
|
48
49
|
/** ISO timestamp of when the patch was created */
|
|
49
50
|
createdAt: string;
|
|
50
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Deprecated compatibility alias for the source version the patch was
|
|
53
|
+
* created against. New writes also include `sourceVersion`.
|
|
54
|
+
*/
|
|
51
55
|
sourceEsrVersion: string;
|
|
56
|
+
/** Firefox source product the patch was created against. */
|
|
57
|
+
sourceProduct?: FirefoxProduct;
|
|
58
|
+
/** Firefox source version the patch was created against. */
|
|
59
|
+
sourceVersion?: string;
|
|
52
60
|
/** Array of file paths affected by this patch */
|
|
53
61
|
filesAffected: string[];
|
|
54
62
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Firefox product type for downloads.
|
|
3
3
|
*/
|
|
4
|
-
export type FirefoxProduct = 'firefox' | 'firefox-esr' | 'firefox-beta';
|
|
4
|
+
export type FirefoxProduct = 'firefox' | 'firefox-esr' | 'firefox-beta' | 'firefox-devedition';
|
|
5
5
|
/**
|
|
6
6
|
* Firefox version configuration.
|
|
7
7
|
*/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EUPL-1.2
|
|
2
|
+
/** Formats elapsed milliseconds for progress messages. */
|
|
3
|
+
export function formatElapsed(ms) {
|
|
4
|
+
const totalSeconds = Math.max(0, Math.round(ms / 1000));
|
|
5
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
6
|
+
const seconds = totalSeconds % 60;
|
|
7
|
+
if (minutes === 0)
|
|
8
|
+
return `${seconds}s`;
|
|
9
|
+
return `${minutes}m ${seconds}s`;
|
|
10
|
+
}
|
|
11
|
+
/** Returns formatted elapsed time since a start timestamp from Date.now(). */
|
|
12
|
+
export function elapsedSince(startedAt) {
|
|
13
|
+
return formatElapsed(Date.now() - startedAt);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=elapsed.js.map
|
|
@@ -71,7 +71,7 @@ export declare function assertObject(value: unknown, name: string): asserts valu
|
|
|
71
71
|
export declare function isValidFirefoxVersion(version: string): boolean;
|
|
72
72
|
/**
|
|
73
73
|
* Validates a Firefox product string.
|
|
74
|
-
* Accepts: firefox, firefox-esr, firefox-beta
|
|
74
|
+
* Accepts: firefox, firefox-esr, firefox-beta, firefox-devedition
|
|
75
75
|
*/
|
|
76
76
|
export declare function isValidFirefoxProduct(product: string): boolean;
|
|
77
77
|
/**
|
|
@@ -108,7 +108,7 @@ export declare function inferProductFromVersion(version: string): 'firefox' | 'f
|
|
|
108
108
|
*
|
|
109
109
|
* Rules:
|
|
110
110
|
* - `firefox-esr` requires an ESR version (e.g. "140.9.0esr", "128.0.1esr").
|
|
111
|
-
* - `firefox-beta`
|
|
111
|
+
* - `firefox-beta` and `firefox-devedition` require a beta version (e.g. "147.0b1").
|
|
112
112
|
* - `firefox` (stable) rejects both ESR and beta version strings.
|
|
113
113
|
*
|
|
114
114
|
* @returns An error message if incompatible, or undefined if valid.
|
|
@@ -106,10 +106,10 @@ export function isValidFirefoxVersion(version) {
|
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
108
108
|
* Validates a Firefox product string.
|
|
109
|
-
* Accepts: firefox, firefox-esr, firefox-beta
|
|
109
|
+
* Accepts: firefox, firefox-esr, firefox-beta, firefox-devedition
|
|
110
110
|
*/
|
|
111
111
|
export function isValidFirefoxProduct(product) {
|
|
112
|
-
return ['firefox', 'firefox-esr', 'firefox-beta'].includes(product);
|
|
112
|
+
return ['firefox', 'firefox-esr', 'firefox-beta', 'firefox-devedition'].includes(product);
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
115
115
|
* Valid project license SPDX identifiers.
|
|
@@ -161,7 +161,7 @@ export function inferProductFromVersion(version) {
|
|
|
161
161
|
*
|
|
162
162
|
* Rules:
|
|
163
163
|
* - `firefox-esr` requires an ESR version (e.g. "140.9.0esr", "128.0.1esr").
|
|
164
|
-
* - `firefox-beta`
|
|
164
|
+
* - `firefox-beta` and `firefox-devedition` require a beta version (e.g. "147.0b1").
|
|
165
165
|
* - `firefox` (stable) rejects both ESR and beta version strings.
|
|
166
166
|
*
|
|
167
167
|
* @returns An error message if incompatible, or undefined if valid.
|
|
@@ -177,9 +177,9 @@ export function validateFirefoxProductVersionCompatibility(version, product) {
|
|
|
177
177
|
}
|
|
178
178
|
break;
|
|
179
179
|
case 'firefox-beta':
|
|
180
|
+
case 'firefox-devedition':
|
|
180
181
|
if (!versionIsBeta) {
|
|
181
|
-
return (`Product "
|
|
182
|
-
`but got "${version}"`);
|
|
182
|
+
return (`Product "${product}" requires a beta version (e.g. "147.0b1"), ` + `but got "${version}"`);
|
|
183
183
|
}
|
|
184
184
|
break;
|
|
185
185
|
case 'firefox':
|