@hominis/fireforge 0.28.4 → 0.28.5

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 CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  ## 0.28.0
4
4
 
5
+ - Restored mach lint compatibility for FireForge-managed Git-backed Firefox checkouts by materializing a `.hgignore` copy of `.gitignore` when Firefox's ignorefile linter config is present.
5
6
  - Added the product-resolved Firefox source archive URL to `source set` output so pinned checksums can be verified against the exact archive target before download.
6
7
  - Added dry-run locking for `re-export` so parallel previews serialize engine git inspection instead of racing on `.git/index.lock`.
7
8
  - Added `re-export --scan --scan-files <manifest>` for dry-runnable bulk generated-file assignment across owner patches, with ambiguity and ownership refusals.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Result of normalizing Firefox's Mercurial ignore file for Git-backed
3
+ * checkouts.
4
+ */
5
+ export type FirefoxIgnorefileCompatibilityResult = 'created' | 'existing' | 'skipped';
6
+ /**
7
+ * Ensures Firefox's mozlint ignorefile configuration can be parsed in
8
+ * Git-backed source trees.
9
+ *
10
+ * Firefox's `tools/lint/ignorefile.yml` includes both `.gitignore` and
11
+ * `.hgignore`. Source archives and some Git mirrors may omit `.hgignore`,
12
+ * which makes `mach lint --fix <files>` fail before it reaches the scoped
13
+ * linter. For FireForge-managed Git checkouts, copying `.gitignore` gives
14
+ * mozlint the missing include and keeps the ignorefile linter's pattern
15
+ * comparison equivalent without patching upstream lint configuration.
16
+ */
17
+ export declare function ensureFirefoxIgnorefileCompatibility(engineDir: string): Promise<FirefoxIgnorefileCompatibilityResult>;
@@ -0,0 +1,31 @@
1
+ // SPDX-License-Identifier: EUPL-1.2
2
+ import { join } from 'node:path';
3
+ import { pathExists, readText, writeText } from '../utils/fs.js';
4
+ /**
5
+ * Ensures Firefox's mozlint ignorefile configuration can be parsed in
6
+ * Git-backed source trees.
7
+ *
8
+ * Firefox's `tools/lint/ignorefile.yml` includes both `.gitignore` and
9
+ * `.hgignore`. Source archives and some Git mirrors may omit `.hgignore`,
10
+ * which makes `mach lint --fix <files>` fail before it reaches the scoped
11
+ * linter. For FireForge-managed Git checkouts, copying `.gitignore` gives
12
+ * mozlint the missing include and keeps the ignorefile linter's pattern
13
+ * comparison equivalent without patching upstream lint configuration.
14
+ */
15
+ export async function ensureFirefoxIgnorefileCompatibility(engineDir) {
16
+ const lintConfigPath = join(engineDir, 'tools', 'lint', 'ignorefile.yml');
17
+ if (!(await pathExists(lintConfigPath))) {
18
+ return 'skipped';
19
+ }
20
+ const hgignorePath = join(engineDir, '.hgignore');
21
+ if (await pathExists(hgignorePath)) {
22
+ return 'existing';
23
+ }
24
+ const gitignorePath = join(engineDir, '.gitignore');
25
+ if (!(await pathExists(gitignorePath))) {
26
+ return 'skipped';
27
+ }
28
+ await writeText(hgignorePath, await readText(gitignorePath));
29
+ return 'created';
30
+ }
31
+ //# sourceMappingURL=firefox-ignorefile.js.map
@@ -7,6 +7,7 @@ import { toError } from '../utils/errors.js';
7
7
  import { pathExists, removeFile } from '../utils/fs.js';
8
8
  import { verbose } from '../utils/logger.js';
9
9
  import { exec } from '../utils/process.js';
10
+ import { ensureFirefoxIgnorefileCompatibility } from './firefox-ignorefile.js';
10
11
  import { configureGitPerformance, ensureGit, git, GIT_ADD_CHUNK_TIMEOUT_ENV_VAR, GIT_ADD_CHUNK_TIMEOUT_MS, GIT_ADD_TIMEOUT_MS, } from './git-base.js';
11
12
  import { getWorkingTreeStatus } from './git-status.js';
12
13
  // ── Functions that remain in this file ──
@@ -291,6 +292,8 @@ export async function initRepository(dir, branchName = 'main', options = {}) {
291
292
  reportProgress('Configuring origin remote for build compatibility...');
292
293
  await git(['remote', 'add', 'origin', 'https://github.com/mozilla-firefox/firefox'], dir);
293
294
  reportProgress('Git phase complete: source git repository metadata initialized.');
295
+ reportProgress('Normalizing Firefox ignore files for Git-backed mach lint compatibility...');
296
+ await ensureFirefoxIgnorefileCompatibility(dir);
294
297
  // Add all files
295
298
  reportProgress('Indexing Firefox source with git add -A (this can take several minutes on large trees)...');
296
299
  await assertNoGitIndexLock(dir);
@@ -327,6 +330,8 @@ export async function resumeRepository(dir, options = {}) {
327
330
  await cleanupIndexLock(dir);
328
331
  // Ensure origin remote exists (may have been added before the interrupt)
329
332
  await ensureOriginRemote(dir);
333
+ reportProgress('Normalizing Firefox ignore files for Git-backed mach lint compatibility...');
334
+ await ensureFirefoxIgnorefileCompatibility(dir);
330
335
  // Stage all files
331
336
  reportProgress('Indexing Firefox source (resuming)...');
332
337
  await assertNoGitIndexLock(dir);
@@ -5,6 +5,7 @@ import { pathExists } from '../utils/fs.js';
5
5
  import { warn } from '../utils/logger.js';
6
6
  import { exec, execInherit, execInheritCapture, execSmokeRun, execStream, } from '../utils/process.js';
7
7
  import { createSiblingLockPath, withFileLock } from './file-lock.js';
8
+ import { ensureFirefoxIgnorefileCompatibility } from './firefox-ignorefile.js';
8
9
  import { explainMachError } from './mach-error-hints.js';
9
10
  import { getPython } from './mach-python.js';
10
11
  // Re-export sub-modules so existing `from './mach.js'` imports keep working.
@@ -32,6 +33,7 @@ export async function ensureMach(engineDir) {
32
33
  export async function runMach(args, engineDir, options = {}) {
33
34
  const python = await getPython(engineDir);
34
35
  await ensureMach(engineDir);
36
+ await ensureFirefoxIgnorefileCompatibility(engineDir);
35
37
  const machPath = join(engineDir, 'mach');
36
38
  const execOptions = {
37
39
  cwd: engineDir,
@@ -59,6 +61,7 @@ const CAPTURE_TAIL_LIMIT = 2 * 1024 * 1024;
59
61
  export async function runMachCapture(args, engineDir, options = {}) {
60
62
  const python = await getPython(engineDir);
61
63
  await ensureMach(engineDir);
64
+ await ensureFirefoxIgnorefileCompatibility(engineDir);
62
65
  const machPath = join(engineDir, 'mach');
63
66
  let stdout = '';
64
67
  let stderr = '';
@@ -89,6 +92,7 @@ export async function runMachCapture(args, engineDir, options = {}) {
89
92
  export async function runMachInheritCapture(args, engineDir, options = {}) {
90
93
  const python = await getPython(engineDir);
91
94
  await ensureMach(engineDir);
95
+ await ensureFirefoxIgnorefileCompatibility(engineDir);
92
96
  const machPath = join(engineDir, 'mach');
93
97
  return execInheritCapture(python, [machPath, ...args], {
94
98
  cwd: engineDir,
@@ -237,6 +241,7 @@ export async function run(engineDir, args = []) {
237
241
  export async function runMachSmoke(args, engineDir, options) {
238
242
  const python = await getPython(engineDir);
239
243
  await ensureMach(engineDir);
244
+ await ensureFirefoxIgnorefileCompatibility(engineDir);
240
245
  const machPath = join(engineDir, 'mach');
241
246
  return execSmokeRun(python, [machPath, ...args], {
242
247
  cwd: engineDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hominis/fireforge",
3
- "version": "0.28.4",
3
+ "version": "0.28.5",
4
4
  "description": "FireForge — a build tool for customizing Firefox",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",