@hominis/fireforge 0.19.5 → 0.19.6

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
@@ -12,9 +12,14 @@
12
12
  - **`modified-file-missing-header` — standard Mozilla MPL-2.0 block headers with wrapped line breaks.** The upstream fallback scan required a contiguous `Mozilla Public License` substring in the first few lines, so files that follow Mozilla’s usual `/* … Mozilla Public` / ` * License, v. 2.0 … */` wrap (including after Emacs/vim directive blocks) were warned despite a valid notice. `containsUpstreamLicenseText` in `src/core/license-headers.ts` now normalizes common block-comment continuation prefixes before matching, so forks need not add SPDX solely to satisfy patch lint.
13
13
  - **`fireforge test` — `--marionette-port` auto-forward matches toolkit mochitests and mixed suites.** Auto-forward of `--setpref=marionette.port=<n>` previously keyed off a path heuristic that missed `toolkit/content/tests/**` widget HTML tests (no `/mochitest/` segment), so the preflight could use the operator’s port while mach still defaulted to **2828**. Forwarding now runs whenever `--marionette-port` is set unless `--mach-arg` explicitly includes `--flavor=xpcshell` / `xpcshell-tests` (the pref is unused there). `isMarionetteFlavor` also treats `toolkit/content/tests/` paths as Marionette-relevant unless they sit under `/tests/xpcshell/`, for consistency with other callers of that helper.
14
14
 
15
+ ### Compatibility
16
+
17
+ - **`furnace create --with-tests` defaults to `browser-chrome` again** (not `mochikit`, which was the default after the `--test-style` split). Forks whose top-level chrome document has no `tabbrowser` should pass **`--test-style=mochikit`** explicitly. On macOS, toolkit MochiKit / mochitest-chrome-style widget tests can idle until ~370s with no subtests; README documents the tradeoff.
18
+
15
19
  ### Documentation
16
20
 
17
21
  - **README — mochitest timeouts vs Marionette.** The Test harness section documents long idle timeouts (~370s, `TEST_END: TIMEOUT`) on fork custom chrome, `--marionette-port` behaviour with xpcshell flavor, and pointers to fork-side prefs and investigation (for example Hominis `AGENT_RULES.md`).
22
+ - **README — default test harness and macOS mochitest-chrome.** The README sections “Picking a test harness for `furnace create`”, “Test harness options”, and “Known upstream build issues” describe the browser-chrome default, macOS single-process idle timeout, explicit `--test-style=mochikit`, and `--with-tests` + `--xpcshell` resolution.
18
23
 
19
24
  ## 0.18.0
20
25
 
package/README.md CHANGED
@@ -59,6 +59,8 @@ Your project now has `fireforge.json`, an `engine/` directory with Firefox sourc
59
59
 
60
60
  - **macOS 15 (Darwin 25+) — `gecko-profiler` bindgen error `cannot find type _CharT in this scope`.** An Apple toolchain update changed `std::__CharT_pointer` to `_CharT_pointer` in the libc++ headers Firefox's bindgen walks, so `toolkit/library/rust/target-objects` fails during `mach build` even on a clean `fireforge bootstrap`. This is an upstream Firefox issue, not a FireForge bug. Two workarounds: pin Xcode's command line tools to a pre-September-2025 release via `xcode-select --install` / [Apple developer downloads](https://developer.apple.com/download/all/), or apply a one-line bindgen-basic-string-workaround patch (a downstream consumer may ship one in its patch queue). If you interrupt the resulting `fireforge build` and re-run `fireforge doctor`, the download/engine state is unaffected — the failure is isolated to the Rust compile phase.
61
61
 
62
+ - **macOS (including Apple Silicon) — toolkit / MochiKit widget tests idle until ~370s (`TEST_END: TIMEOUT`, no subtests).** The **mochitest-chrome** flavor used for `toolkit/content/tests/widgets/test_*.html` runs **single-process** (`e10s: false`), which interacts badly with headed or headless compositing (for example SWGL) in some setups. Prefer **`furnace create --with-tests`** (defaults to **`browser-chrome`**, multi-process) for interactive chrome coverage, or place tests alongside your fork's browser modules (for example `engine/browser/modules/<fork>/test/`). If you must use **`--test-style=mochikit`**, expect possible hangs on macOS. Details: [Picking a test harness for `furnace create`](#picking-a-test-harness-for-furnace-create), [Test harness options](#test-harness-options).
63
+
62
64
  ### Workflow Overview
63
65
 
64
66
  1. Make changes inside the `engine/` directory.
@@ -417,15 +419,17 @@ The packaging-verification test that `--with-tests` scaffolds is what FireForge
417
419
 
418
420
  ### Picking a test harness for `furnace create`
419
421
 
420
- `furnace create --with-tests` defaults to a MochiKit test at `engine/toolkit/content/tests/widgets/test_<tag>.html`. MochiKit tests load the component module via `chrome://global/` and don't need a `tabbrowser`, so they run against any fork including bespoke chrome documents (`mybrowser.xhtml`-class) that deliberately omit the upstream browser chrome.
422
+ `furnace create --with-tests` defaults to a **browser-chrome** mochitest: `browser_<binary>_<tag>.js` under `engine/browser/base/content/test/<binary-name>/`, registered via `browser.toml` (and `browser/base/moz.build` when the scaffolder appends there). Use this when the component participates in real browser chrome (tabs, `gBrowser`, and similar).
423
+
424
+ **MochiKit** (`--test-style=mochikit`) is opt-in: it emits `test_<tag>.html` under `engine/toolkit/content/tests/widgets/`, loads the module via `chrome://global/`, and does not need a `tabbrowser` — so it is the right choice for bespoke chrome documents that omit the upstream tab strip. On **macOS**, that harness can hit a long idle timeout (see [Known upstream build issues](#known-upstream-build-issues)); prefer browser-chrome tests when your fork has a normal tabbed window.
421
425
 
422
426
  Three styles are available via `--test-style`:
423
427
 
424
- | Style | When to use |
425
- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
426
- | `mochikit` | Default. Pure-UI custom elements. Runs today against non-tabbrowser chrome. Emits `test_<tag>.html` under `toolkit/content/tests/widgets/`. |
427
- | `browser-chrome` | Element talks to the browser window (open URLs, manipulate tabs). Requires a working `tabbrowser` in the chrome document. Emits the `browser_<bin>_<tag>.js` scaffold and registers it in `browser/base/moz.build`. |
428
- | `xpcshell` | Storage-layer, observer-driven, or ESM-loading code. Headless, no tabbrowser. Emits `test_<name>_module_loads.js` + `xpcshell.toml` (registration in `XPCSHELL_TESTS_MANIFESTS` is left to the operator). |
428
+ | Style | When to use |
429
+ | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
430
+ | `browser-chrome` | **Default** with `--with-tests`. Interactive chrome, tab strip, `gBrowser`. Requires a working `tabbrowser`. Emits `browser_<bin>_<tag>.js` and registers via `browser.toml` / `browser/base/moz.build`. |
431
+ | `mochikit` | Pure-UI custom elements on forks **without** a `tabbrowser`. Emits `test_<tag>.html` under `toolkit/content/tests/widgets/`. May be unreliable on macOS (mochitest-chrome / single-process). |
432
+ | `xpcshell` | Storage-layer, observer-driven, or ESM-loading code. Headless, no tabbrowser. Emits `test_<name>_module_loads.js` + `xpcshell.toml` (registration in `XPCSHELL_TESTS_MANIFESTS` is left to the operator). |
429
433
 
430
434
  `--xpcshell` is preserved as an alias for `--test-style=xpcshell`; conflicting flag combinations (`--xpcshell --test-style=mochikit`) are rejected.
431
435
 
@@ -628,7 +632,7 @@ Set this in `furnace.json` to extend the list (forks with additional platform pr
628
632
 
629
633
  ### Test harness options
630
634
 
631
- `fireforge furnace create --with-tests` scaffolds a **browser-chrome mochitest**. Use this when the component renders UI that depends on the tab strip (`openLinkIn` → `URILoadingHelper`, `gBrowser`, etc.).
635
+ `fireforge furnace create --with-tests` scaffolds a **browser-chrome mochitest** by default. Use this when the component renders UI that depends on the tab strip (`openLinkIn` → `URILoadingHelper`, `gBrowser`, etc.). On **macOS**, avoid relying on **`--test-style=mochikit`** (toolkit `test_*.html` under `toolkit/content/tests/widgets/`) for primary chrome/widget coverage: the **mochitest-chrome** flavor runs **single-process** (`e10s: false`) and has been observed to **idle ~370s** with no subtests (headless or headed compositing / SWGL). Prefer browser-chrome tests (multi-process); for forks that organize interactive tests under `engine/browser/modules/<fork>/test/`, extend that tree rather than adding new `test_<tag>.html` scaffolds when browser-chrome is sufficient.
632
636
 
633
637
  `fireforge furnace create --xpcshell` scaffolds an **xpcshell test harness** instead. Use this when the component's code path is storage-only, observer-driven, or module-loading logic that does not touch a `tabbrowser`. xpcshell runs headless without browser chrome, so forks without an upstream tab strip can still cover these paths. The scaffolder writes `test_<name>_packaged.js` + `xpcshell.toml` into `engine/browser/base/content/test/<binary-name>-xpcshell/<component-name>/` and prints a note: registration in `XPCSHELL_TESTS_MANIFESTS` is the operator's call (the moz.build that should own the entry depends on where the component actually lives). `fireforge register <path>/xpcshell.toml` surfaces the same guidance when run directly rather than silently routing to a browser.toml-shaped advice.
634
638
 
@@ -636,7 +640,7 @@ The scaffolded xpcshell test is a **packaging probe**, not a module-load test. L
636
640
 
637
641
  xpcshell has a chrome-URI boundary that is worth knowing before writing assertions: `chrome://global/*` (toolkit chrome) IS registered and resolvable from the harness, but `chrome://browser/*` (browser chrome) is NOT — even when `firefox-appdir = "browser"` is set in the xpcshell.toml, the manifest set xpcshell loads lags what the real browser loads, so `NetUtil.asyncFetch("chrome://browser/content/…")` can still fail with `NS_ERROR_FILE_NOT_FOUND` against an artifact that IS present in `obj-*/dist/`. Assertions that need browser chrome URIs belong in a browser-chrome mochitest (`furnace create --test-style=browser-chrome`).
638
642
 
639
- The two flags can be combined `--with-tests --xpcshell` writes both harnesses.
643
+ If you pass **`--with-tests` and `--xpcshell` together**, FireForge resolves the harness to **xpcshell only** (`--xpcshell` takes precedence). To get the default browser-chrome mochitest as well, run a second `furnace create` with `--with-tests` only or add the browser test files manually.
640
644
 
641
645
  ### Mochitest stalls and `--marionette-port`
642
646
 
@@ -5,14 +5,14 @@ export type ResolvedTestStyle = 'mochikit' | 'browser-chrome' | 'xpcshell' | 'no
5
5
  * Collapses `--with-tests`, `--xpcshell`, and `--test-style` into the single
6
6
  * scaffold dispatch used inside the mutation phase.
7
7
  *
8
- * Backwards-compat invariants:
8
+ * Invariants:
9
9
  * - `--xpcshell` alone is equivalent to `--test-style=xpcshell`.
10
- * - `--with-tests` alone (no `--test-style`) now defaults to `mochikit`
11
- * (previously it defaulted to browser-chrome; the dogfooding pass
12
- * flagged browser-chrome as unrunnable against non-tabbrowser chrome).
13
- * Operators who need the old behavior can pass
14
- * `--with-tests --test-style=browser-chrome`.
15
- * - `--xpcshell --with-tests` is rejected as ambiguous.
10
+ * - `--with-tests` alone (no `--test-style`) defaults to `browser-chrome`
11
+ * (multi-process mochitest; reliable on macOS for interactive chrome).
12
+ * Forks whose chrome document has no `tabbrowser` should pass
13
+ * `--test-style=mochikit` explicitly.
14
+ * - When both `--xpcshell` and `--with-tests` are set, `--xpcshell` wins
15
+ * (resolved style is `xpcshell` only).
16
16
  * @throws InvalidArgumentError when flags conflict.
17
17
  */
18
18
  export declare function resolveTestStyle(options: FurnaceCreateOptions): ResolvedTestStyle;
@@ -204,14 +204,14 @@ async function writeComponentFiles(componentDir, componentName, className, descr
204
204
  * Collapses `--with-tests`, `--xpcshell`, and `--test-style` into the single
205
205
  * scaffold dispatch used inside the mutation phase.
206
206
  *
207
- * Backwards-compat invariants:
207
+ * Invariants:
208
208
  * - `--xpcshell` alone is equivalent to `--test-style=xpcshell`.
209
- * - `--with-tests` alone (no `--test-style`) now defaults to `mochikit`
210
- * (previously it defaulted to browser-chrome; the dogfooding pass
211
- * flagged browser-chrome as unrunnable against non-tabbrowser chrome).
212
- * Operators who need the old behavior can pass
213
- * `--with-tests --test-style=browser-chrome`.
214
- * - `--xpcshell --with-tests` is rejected as ambiguous.
209
+ * - `--with-tests` alone (no `--test-style`) defaults to `browser-chrome`
210
+ * (multi-process mochitest; reliable on macOS for interactive chrome).
211
+ * Forks whose chrome document has no `tabbrowser` should pass
212
+ * `--test-style=mochikit` explicitly.
213
+ * - When both `--xpcshell` and `--with-tests` are set, `--xpcshell` wins
214
+ * (resolved style is `xpcshell` only).
215
215
  * @throws InvalidArgumentError when flags conflict.
216
216
  */
217
217
  export function resolveTestStyle(options) {
@@ -226,7 +226,7 @@ export function resolveTestStyle(options) {
226
226
  if (xpcshellFlag)
227
227
  return 'xpcshell';
228
228
  if (withTests)
229
- return 'mochikit';
229
+ return 'browser-chrome';
230
230
  return 'none';
231
231
  }
232
232
  /**
@@ -71,9 +71,9 @@ function registerFurnaceInfoCommands(furnace, context) {
71
71
  .option('-d, --description <desc>', 'Component description')
72
72
  .option('--localized', 'Include Fluent l10n support')
73
73
  .option('--no-register', 'Skip customElements.js registration')
74
- .option('--with-tests', 'Scaffold a test harness (defaults to MochiKit; see --test-style)')
74
+ .option('--with-tests', 'Scaffold a test harness (defaults to browser-chrome; use --test-style=mochikit for tabbrowser-less chrome — may be flaky on macOS)')
75
75
  .option('--xpcshell', 'Scaffold an xpcshell test harness (for storage-layer code on forks without tabbrowser); equivalent to --test-style=xpcshell. Note: xpcshell resolves chrome://global/* URIs but not chrome://browser/* — use --test-style=browser-chrome for browser-chrome-dependent tests.')
76
- .option('--test-style <style>', "Override the harness written by --with-tests: mochikit (default, runs against non-tabbrowser chrome), browser-chrome (today's scaffold, needs tabbrowser), or xpcshell (headless)", (value) => {
76
+ .option('--test-style <style>', 'Override the harness written by --with-tests: browser-chrome (default, needs tabbrowser), mochikit (toolkit/widgets, non-tabbrowser chrome), or xpcshell (headless)', (value) => {
77
77
  if (value !== 'mochikit' && value !== 'browser-chrome' && value !== 'xpcshell') {
78
78
  throw new Error(`--test-style must be one of: mochikit, browser-chrome, xpcshell. Got: "${value}".`);
79
79
  }
@@ -426,15 +426,15 @@ export interface FurnaceCreateOptions {
426
426
  /**
427
427
  * Test harness style to scaffold when `--with-tests` is set.
428
428
  *
429
- * - `mochikit` (default when `--with-tests` is set alone) — a MochiKit
430
- * test at `engine/toolkit/content/tests/widgets/test_<tag>.html` that
431
- * loads the component module directly via `chrome://global/` and
432
- * asserts against `customElements`. Runs today on forks whose
433
- * top-level chrome document (e.g. `mybrowser.xhtml`) lacks a
434
- * `tabbrowser`, because it doesn't go through `URILoadingHelper`.
435
- * - `browser-chrome` today's browser-mochitest scaffold, requires a
436
- * working tabbrowser. Use for components that talk to the browser
437
- * window or open URLs.
429
+ * - `browser-chrome` (default when `--with-tests` is set without
430
+ * `--test-style`) browser mochitest scaffold; requires a working
431
+ * `tabbrowser`. Prefer this for interactive chrome/widget coverage
432
+ * (including on macOS).
433
+ * - `mochikit` opt-in MochiKit test at
434
+ * `engine/toolkit/content/tests/widgets/test_<tag>.html` that loads
435
+ * the component via `chrome://global/`. Use when the top-level chrome
436
+ * document lacks a `tabbrowser`; on macOS the toolkit mochitest-chrome
437
+ * flavor can be unreliable (long idle timeout).
438
438
  * - `xpcshell` — equivalent to setting `--xpcshell`; headless, storage-only.
439
439
  */
440
440
  testStyle?: 'mochikit' | 'browser-chrome' | 'xpcshell';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hominis/fireforge",
3
- "version": "0.19.5",
3
+ "version": "0.19.6",
4
4
  "description": "FireForge — a build tool for customizing Firefox",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",