@hominis/fireforge 0.11.1 → 0.11.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 +8 -0
- package/README.md +2 -2
- package/dist/src/commands/setup-support.js +5 -0
- package/dist/src/core/branding.js +5 -5
- package/dist/src/utils/fs.d.ts +8 -0
- package/dist/src/utils/fs.js +17 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
- Override `baseVersion` drift now blocks `apply` and `deploy` by default instead of warning and continuing. Pass `--force` to override, or use `furnace refresh` to update the baseline.
|
|
54
54
|
- Post-apply consistency check verifies that `customElements.js` and `jar.mn` entries match what was deployed.
|
|
55
55
|
- Engine-side content hashes are cached in the furnace state file, making drift detection faster for the common no-change case.
|
|
56
|
+
- Branding file writes are now content-aware: re-running setup with the same configuration no longer bumps file timestamps, avoiding unnecessary `config.status` reconfiguration during incremental builds.
|
|
56
57
|
- `build` and `test --build` now share the same preparation pipeline including Furnace apply, so incremental test builds no longer run against stale component state.
|
|
57
58
|
- `furnace remove` on an override now restores every overridden engine file to its Firefox baseline instead of leaving deployed files behind.
|
|
58
59
|
- Scanner results are cached by content hash within a process, avoiding redundant parsing during scan-status-apply sequences.
|
|
@@ -63,6 +64,9 @@
|
|
|
63
64
|
|
|
64
65
|
### Bug fixes
|
|
65
66
|
|
|
67
|
+
- `fireforge setup` now writes an initial `patches/patches.json` (with `version: 1`) when creating a new project. Previously, setup created the `patches/` directory but not the manifest, causing `fireforge doctor` to fail the "Patch manifest consistency" check on a fresh project. Re-running `setup --force` on an existing project preserves the current manifest.
|
|
68
|
+
- The full Firefox integration test script (`scripts/run-full-firefox-integration.mjs`) now uses `--yes` instead of `--force` when invoking `fireforge discard`, matching the actual CLI flag. This was the sole cause of integration test failures in the discard and recovery workflow steps.
|
|
69
|
+
- The integration test's cleanup loop now uses direct git operations (`git checkout` for tracked files, `git clean` for untracked) instead of routing through `fireforge discard`, which could not handle untracked branding files introduced by the build.
|
|
66
70
|
- `furnace refresh` now correctly advances the per-override `baseCommit` to the engine HEAD after a successful merge, preventing phantom conflicts on subsequent refreshes.
|
|
67
71
|
- `furnace rename` uses the correct file-removal function for FTL files.
|
|
68
72
|
- `furnace remove` now parses browser.toml sections properly, cleaning up metadata keys below the section header instead of leaving stale fragments.
|
|
@@ -77,6 +81,10 @@
|
|
|
77
81
|
|
|
78
82
|
### Internal
|
|
79
83
|
|
|
84
|
+
- The full Firefox integration script now accepts `FIREFORGE_FULL_FIREFOX_VERSION` to override the Firefox version used during the test run, decoupling the test from the version baked into `fireforge.json`.
|
|
85
|
+
- The integration test now verifies that `obj-*/dist/bin/` exists after a build reports success, detecting cases where mach masks a build failure with exit code 0.
|
|
86
|
+
- The integration test cleanup loop now uses direct git operations (`checkout` / `clean`) instead of routing through `fireforge discard`, correctly handling untracked branding files introduced by the build.
|
|
87
|
+
- New unit tests from a full local Firefox integration run: Python version resolution skips candidates above mach's `MAX_PYTHON_VERSION_TO_CONSIDER` and falls through to a compatible version; fresh-project manifest consistency returns zero issues for the empty manifest that `setup` now writes; bootstrap soft-failure detection catches the `urllib.error.HTTPError: HTTP Error 403` pattern observed in real `mach bootstrap` output.
|
|
80
88
|
- CLI command registration is now driven by a declarative manifest instead of hand-listed calls.
|
|
81
89
|
- Doctor checks are a declarative registry with per-check `run`, `skipIf`, and `fix` fields.
|
|
82
90
|
- New shared destructive-op framework handles confirmation, `--dry-run`, `--yes`/`--force-unsafe`, and audit logging for the patch mutation commands.
|
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ Inspired by [fern.js](https://github.com/ghostery/user-agent-desktop) and [Melon
|
|
|
26
26
|
|
|
27
27
|
- **Quality checks** `fireforge lint` catches fork-specific issues (raw colours, missing licence headers, relative imports, large patches, cross-patch ordering problems) before you export. `fireforge verify` runs a read-only integrity check over the whole patch queue. `fireforge doctor` diagnoses project health including Furnace component validation.
|
|
28
28
|
|
|
29
|
-
- **Built and validated against real Firefox code** Developed by editing a real Firefox ESR codebase, learning from existing patch tools, observing the breakages and edge cases that surfaced, and turning those findings into a realistic test suite. In-repo tests are thus grounded in actual development scenarios. Yes, we
|
|
29
|
+
- **Built and validated against real Firefox code** Developed by editing a real Firefox ESR codebase, learning from existing patch tools, observing the breakages and edge cases that surfaced, and turning those findings into a realistic test suite. In-repo tests are thus grounded in actual development scenarios. Yes, we mock quite a bit, but when building a tool that modifies a separate code base, I think it's a solid compromise for the time being. Full end-to-end runs are currently run locally, as they require about 30 GB of disk and significant compute for multiple full builds. Full end-to-end via Github Actions will be added soonishlyTM.
|
|
30
30
|
|
|
31
31
|
## Quick Start
|
|
32
32
|
|
|
@@ -52,7 +52,7 @@ npx fireforge build # build the browser
|
|
|
52
52
|
npx fireforge run # launch it
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
Your project now has `fireforge.json`, an `engine/` directory with Firefox source, and a `patches/` directory ready for your first customisation.
|
|
55
|
+
Your project now has `fireforge.json`, an `engine/` directory with Firefox source, and a `patches/` directory with an empty `patches.json` manifest ready for your first customisation.
|
|
56
56
|
|
|
57
57
|
### Workflow Overview
|
|
58
58
|
|
|
@@ -3,6 +3,7 @@ import { cpus } from 'node:os';
|
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { group, select, text } from '@clack/prompts';
|
|
5
5
|
import { getProjectPaths, writeConfig } from '../core/config.js';
|
|
6
|
+
import { PATCHES_MANIFEST, savePatchesManifest } from '../core/patch-manifest-io.js';
|
|
6
7
|
import { CancellationError, InvalidArgumentError } from '../errors/base.js';
|
|
7
8
|
import { ensureDir, pathExists, readText, writeText } from '../utils/fs.js';
|
|
8
9
|
import { cancel } from '../utils/logger.js';
|
|
@@ -251,6 +252,10 @@ export async function writeSetupProjectFiles(projectRoot, config) {
|
|
|
251
252
|
await ensureDir(paths.configs);
|
|
252
253
|
await ensureDir(paths.fireforgeDir);
|
|
253
254
|
await writeConfig(projectRoot, config);
|
|
255
|
+
const manifestPath = join(paths.patches, PATCHES_MANIFEST);
|
|
256
|
+
if (!(await pathExists(manifestPath))) {
|
|
257
|
+
await savePatchesManifest(paths.patches, { version: 1, patches: [] });
|
|
258
|
+
}
|
|
254
259
|
const gitignorePath = join(projectRoot, '.gitignore');
|
|
255
260
|
const requiredIgnores = ['node_modules/', 'dist/', 'engine/', '.fireforge/'];
|
|
256
261
|
if (await pathExists(gitignorePath)) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { FireForgeError } from '../errors/base.js';
|
|
4
4
|
import { ExitCode } from '../errors/codes.js';
|
|
5
|
-
import { copyDir, pathExists, readText,
|
|
5
|
+
import { copyDir, pathExists, readText, writeTextIfChanged } from '../utils/fs.js';
|
|
6
6
|
import { warn } from '../utils/logger.js';
|
|
7
7
|
/**
|
|
8
8
|
* Error thrown when branding operations fail.
|
|
@@ -49,7 +49,7 @@ export async function setupBranding(engineDir, config) {
|
|
|
49
49
|
*/
|
|
50
50
|
async function createConfigureScript(brandingDir, config) {
|
|
51
51
|
const configureShPath = join(brandingDir, 'configure.sh');
|
|
52
|
-
await
|
|
52
|
+
await writeTextIfChanged(configureShPath, buildConfigureScriptContent(config));
|
|
53
53
|
}
|
|
54
54
|
function buildConfigureScriptContent(config) {
|
|
55
55
|
return `# This Source Code Form is subject to the terms of the Mozilla Public
|
|
@@ -69,7 +69,7 @@ async function updateBrandProperties(brandingDir, config) {
|
|
|
69
69
|
warn('brand.properties not found in branding directory — browser will use default strings');
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
-
await
|
|
72
|
+
await writeTextIfChanged(propsPath, buildBrandPropertiesContent(config));
|
|
73
73
|
}
|
|
74
74
|
function buildBrandPropertiesContent(config) {
|
|
75
75
|
return `# This Source Code Form is subject to the terms of the Mozilla Public
|
|
@@ -90,7 +90,7 @@ async function updateBrandFtl(brandingDir, config) {
|
|
|
90
90
|
warn('brand.ftl not found in branding directory — browser will use default strings');
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
|
-
await
|
|
93
|
+
await writeTextIfChanged(ftlPath, buildBrandFtlContent(config));
|
|
94
94
|
}
|
|
95
95
|
function buildBrandFtlContent(config) {
|
|
96
96
|
return `# This Source Code Form is subject to the terms of the Mozilla Public
|
|
@@ -128,7 +128,7 @@ async function patchMozConfigure(engineDir, config) {
|
|
|
128
128
|
throw new BrandingError('Could not find MOZ_APP_VENDOR imply_option in browser/moz.configure');
|
|
129
129
|
}
|
|
130
130
|
content = content.replace(vendorRegex, buildMozConfigureVendorLine(config));
|
|
131
|
-
await
|
|
131
|
+
await writeTextIfChanged(mozConfigurePath, content);
|
|
132
132
|
}
|
|
133
133
|
function buildMozConfigureVendorLine(config) {
|
|
134
134
|
return `imply_option("MOZ_APP_VENDOR", "${escapeString(config.vendor)}")`;
|
package/dist/src/utils/fs.d.ts
CHANGED
|
@@ -57,6 +57,14 @@ export declare function readText(path: string): Promise<string>;
|
|
|
57
57
|
* @param content - Content to write
|
|
58
58
|
*/
|
|
59
59
|
export declare function writeText(path: string, content: string): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Writes text to a file only when the content has actually changed.
|
|
62
|
+
* Prevents unnecessary mtime bumps that can trigger downstream rebuilds.
|
|
63
|
+
* @param path - Path to text file
|
|
64
|
+
* @param content - Content to write
|
|
65
|
+
* @returns true if the file was written, false if content was already up to date
|
|
66
|
+
*/
|
|
67
|
+
export declare function writeTextIfChanged(path: string, content: string): Promise<boolean>;
|
|
60
68
|
/**
|
|
61
69
|
* Writes content atomically using a temp-file-and-rename strategy.
|
|
62
70
|
* Temp files are created in the destination directory so rename stays atomic.
|
package/dist/src/utils/fs.js
CHANGED
|
@@ -112,6 +112,23 @@ export async function readText(path) {
|
|
|
112
112
|
export async function writeText(path, content) {
|
|
113
113
|
await writeFileAtomic(path, content);
|
|
114
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Writes text to a file only when the content has actually changed.
|
|
117
|
+
* Prevents unnecessary mtime bumps that can trigger downstream rebuilds.
|
|
118
|
+
* @param path - Path to text file
|
|
119
|
+
* @param content - Content to write
|
|
120
|
+
* @returns true if the file was written, false if content was already up to date
|
|
121
|
+
*/
|
|
122
|
+
export async function writeTextIfChanged(path, content) {
|
|
123
|
+
if (await pathExists(path)) {
|
|
124
|
+
const existing = await readText(path);
|
|
125
|
+
if (existing === content) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
await writeText(path, content);
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
115
132
|
/**
|
|
116
133
|
* Writes content atomically using a temp-file-and-rename strategy.
|
|
117
134
|
* Temp files are created in the destination directory so rename stays atomic.
|