@hominis/fireforge 0.9.0

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.
Files changed (316) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE.md +294 -0
  3. package/README.md +435 -0
  4. package/dist/bin/fireforge.d.ts +10 -0
  5. package/dist/bin/fireforge.js +29 -0
  6. package/dist/src/cli.d.ts +33 -0
  7. package/dist/src/cli.js +180 -0
  8. package/dist/src/commands/bootstrap.d.ts +9 -0
  9. package/dist/src/commands/bootstrap.js +73 -0
  10. package/dist/src/commands/build.d.ts +11 -0
  11. package/dist/src/commands/build.js +102 -0
  12. package/dist/src/commands/config.d.ts +13 -0
  13. package/dist/src/commands/config.js +135 -0
  14. package/dist/src/commands/discard.d.ts +12 -0
  15. package/dist/src/commands/discard.js +84 -0
  16. package/dist/src/commands/doctor.d.ts +18 -0
  17. package/dist/src/commands/doctor.js +356 -0
  18. package/dist/src/commands/download.d.ts +11 -0
  19. package/dist/src/commands/download.js +127 -0
  20. package/dist/src/commands/export-all.d.ts +11 -0
  21. package/dist/src/commands/export-all.js +122 -0
  22. package/dist/src/commands/export-shared.d.ts +48 -0
  23. package/dist/src/commands/export-shared.js +208 -0
  24. package/dist/src/commands/export.d.ts +13 -0
  25. package/dist/src/commands/export.js +178 -0
  26. package/dist/src/commands/furnace/apply.d.ts +7 -0
  27. package/dist/src/commands/furnace/apply.js +80 -0
  28. package/dist/src/commands/furnace/create.d.ts +8 -0
  29. package/dist/src/commands/furnace/create.js +377 -0
  30. package/dist/src/commands/furnace/deploy.d.ts +8 -0
  31. package/dist/src/commands/furnace/deploy.js +338 -0
  32. package/dist/src/commands/furnace/diff.d.ts +7 -0
  33. package/dist/src/commands/furnace/diff.js +119 -0
  34. package/dist/src/commands/furnace/index.d.ts +16 -0
  35. package/dist/src/commands/furnace/index.js +121 -0
  36. package/dist/src/commands/furnace/list.d.ts +5 -0
  37. package/dist/src/commands/furnace/list.js +65 -0
  38. package/dist/src/commands/furnace/override.d.ts +8 -0
  39. package/dist/src/commands/furnace/override.js +188 -0
  40. package/dist/src/commands/furnace/preview.d.ts +7 -0
  41. package/dist/src/commands/furnace/preview.js +96 -0
  42. package/dist/src/commands/furnace/remove.d.ts +8 -0
  43. package/dist/src/commands/furnace/remove.js +159 -0
  44. package/dist/src/commands/furnace/scan.d.ts +5 -0
  45. package/dist/src/commands/furnace/scan.js +112 -0
  46. package/dist/src/commands/furnace/status.d.ts +7 -0
  47. package/dist/src/commands/furnace/status.js +137 -0
  48. package/dist/src/commands/furnace/validate.d.ts +6 -0
  49. package/dist/src/commands/furnace/validate.js +91 -0
  50. package/dist/src/commands/furnace/validation-output.d.ts +7 -0
  51. package/dist/src/commands/furnace/validation-output.js +22 -0
  52. package/dist/src/commands/import.d.ts +11 -0
  53. package/dist/src/commands/import.js +241 -0
  54. package/dist/src/commands/lint.d.ts +10 -0
  55. package/dist/src/commands/lint.js +118 -0
  56. package/dist/src/commands/package.d.ts +11 -0
  57. package/dist/src/commands/package.js +80 -0
  58. package/dist/src/commands/re-export.d.ts +12 -0
  59. package/dist/src/commands/re-export.js +242 -0
  60. package/dist/src/commands/rebase/abort.d.ts +7 -0
  61. package/dist/src/commands/rebase/abort.js +49 -0
  62. package/dist/src/commands/rebase/confirm.d.ts +18 -0
  63. package/dist/src/commands/rebase/confirm.js +33 -0
  64. package/dist/src/commands/rebase/continue.d.ts +7 -0
  65. package/dist/src/commands/rebase/continue.js +81 -0
  66. package/dist/src/commands/rebase/index.d.ts +22 -0
  67. package/dist/src/commands/rebase/index.js +127 -0
  68. package/dist/src/commands/rebase/patch-loop.d.ts +9 -0
  69. package/dist/src/commands/rebase/patch-loop.js +135 -0
  70. package/dist/src/commands/rebase/summary.d.ts +12 -0
  71. package/dist/src/commands/rebase/summary.js +43 -0
  72. package/dist/src/commands/rebase.d.ts +4 -0
  73. package/dist/src/commands/rebase.js +6 -0
  74. package/dist/src/commands/register.d.ts +13 -0
  75. package/dist/src/commands/register.js +67 -0
  76. package/dist/src/commands/reset.d.ts +11 -0
  77. package/dist/src/commands/reset.js +83 -0
  78. package/dist/src/commands/resolve.d.ts +9 -0
  79. package/dist/src/commands/resolve.js +124 -0
  80. package/dist/src/commands/run.d.ts +9 -0
  81. package/dist/src/commands/run.js +91 -0
  82. package/dist/src/commands/setup-support.d.ts +23 -0
  83. package/dist/src/commands/setup-support.js +310 -0
  84. package/dist/src/commands/setup.d.ts +11 -0
  85. package/dist/src/commands/setup.js +94 -0
  86. package/dist/src/commands/status.d.ts +11 -0
  87. package/dist/src/commands/status.js +268 -0
  88. package/dist/src/commands/test.d.ts +12 -0
  89. package/dist/src/commands/test.js +182 -0
  90. package/dist/src/commands/token-coverage.d.ts +5 -0
  91. package/dist/src/commands/token-coverage.js +57 -0
  92. package/dist/src/commands/token.d.ts +14 -0
  93. package/dist/src/commands/token.js +121 -0
  94. package/dist/src/commands/watch.d.ts +9 -0
  95. package/dist/src/commands/watch.js +112 -0
  96. package/dist/src/commands/wire.d.ts +13 -0
  97. package/dist/src/commands/wire.js +149 -0
  98. package/dist/src/core/ast-utils.d.ts +47 -0
  99. package/dist/src/core/ast-utils.js +57 -0
  100. package/dist/src/core/brand-validation.d.ts +7 -0
  101. package/dist/src/core/brand-validation.js +15 -0
  102. package/dist/src/core/branding.d.ts +49 -0
  103. package/dist/src/core/branding.js +229 -0
  104. package/dist/src/core/browser-wire.d.ts +40 -0
  105. package/dist/src/core/browser-wire.js +66 -0
  106. package/dist/src/core/build-prepare.d.ts +25 -0
  107. package/dist/src/core/build-prepare.js +93 -0
  108. package/dist/src/core/config-mutate.d.ts +15 -0
  109. package/dist/src/core/config-mutate.js +51 -0
  110. package/dist/src/core/config-paths.d.ts +28 -0
  111. package/dist/src/core/config-paths.js +65 -0
  112. package/dist/src/core/config-state.d.ts +28 -0
  113. package/dist/src/core/config-state.js +152 -0
  114. package/dist/src/core/config-validate.d.ts +11 -0
  115. package/dist/src/core/config-validate.js +141 -0
  116. package/dist/src/core/config.d.ts +39 -0
  117. package/dist/src/core/config.js +70 -0
  118. package/dist/src/core/file-lock.d.ts +11 -0
  119. package/dist/src/core/file-lock.js +80 -0
  120. package/dist/src/core/firefox-archive.d.ts +40 -0
  121. package/dist/src/core/firefox-archive.js +63 -0
  122. package/dist/src/core/firefox-cache.d.ts +23 -0
  123. package/dist/src/core/firefox-cache.js +134 -0
  124. package/dist/src/core/firefox-download.d.ts +21 -0
  125. package/dist/src/core/firefox-download.js +129 -0
  126. package/dist/src/core/firefox-extract.d.ts +21 -0
  127. package/dist/src/core/firefox-extract.js +53 -0
  128. package/dist/src/core/firefox.d.ts +34 -0
  129. package/dist/src/core/firefox.js +78 -0
  130. package/dist/src/core/furnace-apply-helpers.d.ts +21 -0
  131. package/dist/src/core/furnace-apply-helpers.js +244 -0
  132. package/dist/src/core/furnace-apply.d.ts +16 -0
  133. package/dist/src/core/furnace-apply.js +147 -0
  134. package/dist/src/core/furnace-config.d.ts +94 -0
  135. package/dist/src/core/furnace-config.js +372 -0
  136. package/dist/src/core/furnace-constants.d.ts +4 -0
  137. package/dist/src/core/furnace-constants.js +6 -0
  138. package/dist/src/core/furnace-registration-ast.d.ts +24 -0
  139. package/dist/src/core/furnace-registration-ast.js +218 -0
  140. package/dist/src/core/furnace-registration-remove.d.ts +14 -0
  141. package/dist/src/core/furnace-registration-remove.js +89 -0
  142. package/dist/src/core/furnace-registration-validate.d.ts +20 -0
  143. package/dist/src/core/furnace-registration-validate.js +40 -0
  144. package/dist/src/core/furnace-registration.d.ts +29 -0
  145. package/dist/src/core/furnace-registration.js +96 -0
  146. package/dist/src/core/furnace-rollback.d.ts +20 -0
  147. package/dist/src/core/furnace-rollback.js +66 -0
  148. package/dist/src/core/furnace-scanner.d.ts +40 -0
  149. package/dist/src/core/furnace-scanner.js +143 -0
  150. package/dist/src/core/furnace-stories.d.ts +37 -0
  151. package/dist/src/core/furnace-stories.js +185 -0
  152. package/dist/src/core/furnace-validate-accessibility.d.ts +6 -0
  153. package/dist/src/core/furnace-validate-accessibility.js +32 -0
  154. package/dist/src/core/furnace-validate-checks.d.ts +4 -0
  155. package/dist/src/core/furnace-validate-checks.js +7 -0
  156. package/dist/src/core/furnace-validate-compatibility.d.ts +6 -0
  157. package/dist/src/core/furnace-validate-compatibility.js +57 -0
  158. package/dist/src/core/furnace-validate-helpers.d.ts +28 -0
  159. package/dist/src/core/furnace-validate-helpers.js +129 -0
  160. package/dist/src/core/furnace-validate-registration.d.ts +37 -0
  161. package/dist/src/core/furnace-validate-registration.js +220 -0
  162. package/dist/src/core/furnace-validate-structure.d.ts +6 -0
  163. package/dist/src/core/furnace-validate-structure.js +66 -0
  164. package/dist/src/core/furnace-validate.d.ts +16 -0
  165. package/dist/src/core/furnace-validate.js +103 -0
  166. package/dist/src/core/git-base.d.ts +47 -0
  167. package/dist/src/core/git-base.js +50 -0
  168. package/dist/src/core/git-diff.d.ts +63 -0
  169. package/dist/src/core/git-diff.js +246 -0
  170. package/dist/src/core/git-file-ops.d.ts +65 -0
  171. package/dist/src/core/git-file-ops.js +141 -0
  172. package/dist/src/core/git-status.d.ts +65 -0
  173. package/dist/src/core/git-status.js +163 -0
  174. package/dist/src/core/git.d.ts +113 -0
  175. package/dist/src/core/git.js +363 -0
  176. package/dist/src/core/license-headers.d.ts +36 -0
  177. package/dist/src/core/license-headers.js +83 -0
  178. package/dist/src/core/mach-build-artifacts.d.ts +29 -0
  179. package/dist/src/core/mach-build-artifacts.js +117 -0
  180. package/dist/src/core/mach-mozconfig.d.ts +17 -0
  181. package/dist/src/core/mach-mozconfig.js +50 -0
  182. package/dist/src/core/mach-python.d.ts +16 -0
  183. package/dist/src/core/mach-python.js +126 -0
  184. package/dist/src/core/mach.d.ts +106 -0
  185. package/dist/src/core/mach.js +166 -0
  186. package/dist/src/core/manifest-helpers.d.ts +25 -0
  187. package/dist/src/core/manifest-helpers.js +96 -0
  188. package/dist/src/core/manifest-register.d.ts +30 -0
  189. package/dist/src/core/manifest-register.js +65 -0
  190. package/dist/src/core/manifest-rules.d.ts +39 -0
  191. package/dist/src/core/manifest-rules.js +151 -0
  192. package/dist/src/core/manifest-tokenizers.d.ts +34 -0
  193. package/dist/src/core/manifest-tokenizers.js +84 -0
  194. package/dist/src/core/parser-fallback.d.ts +36 -0
  195. package/dist/src/core/parser-fallback.js +43 -0
  196. package/dist/src/core/patch-apply-fuzz.d.ts +29 -0
  197. package/dist/src/core/patch-apply-fuzz.js +70 -0
  198. package/dist/src/core/patch-apply.d.ts +46 -0
  199. package/dist/src/core/patch-apply.js +235 -0
  200. package/dist/src/core/patch-export.d.ts +99 -0
  201. package/dist/src/core/patch-export.js +314 -0
  202. package/dist/src/core/patch-files.d.ts +11 -0
  203. package/dist/src/core/patch-files.js +51 -0
  204. package/dist/src/core/patch-lint.d.ts +72 -0
  205. package/dist/src/core/patch-lint.js +403 -0
  206. package/dist/src/core/patch-lock.d.ts +8 -0
  207. package/dist/src/core/patch-lock.js +29 -0
  208. package/dist/src/core/patch-manifest-consistency.d.ts +24 -0
  209. package/dist/src/core/patch-manifest-consistency.js +135 -0
  210. package/dist/src/core/patch-manifest-io.d.ts +36 -0
  211. package/dist/src/core/patch-manifest-io.js +77 -0
  212. package/dist/src/core/patch-manifest-query.d.ts +48 -0
  213. package/dist/src/core/patch-manifest-query.js +124 -0
  214. package/dist/src/core/patch-manifest-validate.d.ts +22 -0
  215. package/dist/src/core/patch-manifest-validate.js +72 -0
  216. package/dist/src/core/patch-manifest.d.ts +11 -0
  217. package/dist/src/core/patch-manifest.js +12 -0
  218. package/dist/src/core/patch-parse.d.ts +43 -0
  219. package/dist/src/core/patch-parse.js +143 -0
  220. package/dist/src/core/patch-transform.d.ts +21 -0
  221. package/dist/src/core/patch-transform.js +138 -0
  222. package/dist/src/core/rebase-session.d.ts +47 -0
  223. package/dist/src/core/rebase-session.js +65 -0
  224. package/dist/src/core/register-browser-content.d.ts +11 -0
  225. package/dist/src/core/register-browser-content.js +116 -0
  226. package/dist/src/core/register-module.d.ts +11 -0
  227. package/dist/src/core/register-module.js +76 -0
  228. package/dist/src/core/register-shared-css.d.ts +11 -0
  229. package/dist/src/core/register-shared-css.js +117 -0
  230. package/dist/src/core/register-test-manifest.d.ts +18 -0
  231. package/dist/src/core/register-test-manifest.js +99 -0
  232. package/dist/src/core/state-file.d.ts +4 -0
  233. package/dist/src/core/state-file.js +25 -0
  234. package/dist/src/core/token-coverage.d.ts +12 -0
  235. package/dist/src/core/token-coverage.js +74 -0
  236. package/dist/src/core/token-manager.d.ts +55 -0
  237. package/dist/src/core/token-manager.js +387 -0
  238. package/dist/src/core/wire-destroy.d.ts +21 -0
  239. package/dist/src/core/wire-destroy.js +103 -0
  240. package/dist/src/core/wire-dom-fragment.d.ts +23 -0
  241. package/dist/src/core/wire-dom-fragment.js +129 -0
  242. package/dist/src/core/wire-init.d.ts +23 -0
  243. package/dist/src/core/wire-init.js +201 -0
  244. package/dist/src/core/wire-subscript.d.ts +20 -0
  245. package/dist/src/core/wire-subscript.js +134 -0
  246. package/dist/src/core/wire-targets.d.ts +7 -0
  247. package/dist/src/core/wire-targets.js +9 -0
  248. package/dist/src/core/wire-utils.d.ts +88 -0
  249. package/dist/src/core/wire-utils.js +279 -0
  250. package/dist/src/errors/base.d.ts +60 -0
  251. package/dist/src/errors/base.js +87 -0
  252. package/dist/src/errors/build.d.ts +52 -0
  253. package/dist/src/errors/build.js +114 -0
  254. package/dist/src/errors/codes.d.ts +29 -0
  255. package/dist/src/errors/codes.js +30 -0
  256. package/dist/src/errors/config.d.ts +31 -0
  257. package/dist/src/errors/config.js +61 -0
  258. package/dist/src/errors/download.d.ts +42 -0
  259. package/dist/src/errors/download.js +95 -0
  260. package/dist/src/errors/furnace.d.ts +10 -0
  261. package/dist/src/errors/furnace.js +22 -0
  262. package/dist/src/errors/git.d.ts +41 -0
  263. package/dist/src/errors/git.js +99 -0
  264. package/dist/src/errors/patch.d.ts +10 -0
  265. package/dist/src/errors/patch.js +26 -0
  266. package/dist/src/errors/rebase.d.ts +20 -0
  267. package/dist/src/errors/rebase.js +30 -0
  268. package/dist/src/index.d.ts +21 -0
  269. package/dist/src/index.js +21 -0
  270. package/dist/src/types/cli.d.ts +14 -0
  271. package/dist/src/types/cli.js +2 -0
  272. package/dist/src/types/commands/index.d.ts +6 -0
  273. package/dist/src/types/commands/index.js +6 -0
  274. package/dist/src/types/commands/options.d.ts +239 -0
  275. package/dist/src/types/commands/options.js +6 -0
  276. package/dist/src/types/commands/patches.d.ts +89 -0
  277. package/dist/src/types/commands/patches.js +6 -0
  278. package/dist/src/types/commands/project.d.ts +71 -0
  279. package/dist/src/types/commands/project.js +6 -0
  280. package/dist/src/types/config.d.ts +101 -0
  281. package/dist/src/types/config.js +2 -0
  282. package/dist/src/types/furnace.d.ts +158 -0
  283. package/dist/src/types/furnace.js +2 -0
  284. package/dist/src/types/index.d.ts +6 -0
  285. package/dist/src/types/index.js +6 -0
  286. package/dist/src/utils/errors.d.ts +2 -0
  287. package/dist/src/utils/errors.js +15 -0
  288. package/dist/src/utils/fs.d.ts +72 -0
  289. package/dist/src/utils/fs.js +179 -0
  290. package/dist/src/utils/logger.d.ts +58 -0
  291. package/dist/src/utils/logger.js +120 -0
  292. package/dist/src/utils/options.d.ts +8 -0
  293. package/dist/src/utils/options.js +16 -0
  294. package/dist/src/utils/package-root.d.ts +10 -0
  295. package/dist/src/utils/package-root.js +53 -0
  296. package/dist/src/utils/parse.d.ts +110 -0
  297. package/dist/src/utils/parse.js +200 -0
  298. package/dist/src/utils/paths.d.ts +10 -0
  299. package/dist/src/utils/paths.js +43 -0
  300. package/dist/src/utils/platform.d.ts +38 -0
  301. package/dist/src/utils/platform.js +56 -0
  302. package/dist/src/utils/process.d.ts +80 -0
  303. package/dist/src/utils/process.js +188 -0
  304. package/dist/src/utils/regex.d.ts +24 -0
  305. package/dist/src/utils/regex.js +40 -0
  306. package/dist/src/utils/validation.d.ts +133 -0
  307. package/dist/src/utils/validation.js +250 -0
  308. package/package.json +106 -0
  309. package/templates/configs/common.mozconfig +24 -0
  310. package/templates/configs/darwin.mozconfig +10 -0
  311. package/templates/configs/linux.mozconfig +12 -0
  312. package/templates/configs/win32.mozconfig +14 -0
  313. package/templates/licenses/0BSD.md +14 -0
  314. package/templates/licenses/EUPL-1.2.md +294 -0
  315. package/templates/licenses/GPL-2.0-or-later.md +339 -0
  316. package/templates/licenses/MPL-2.0.md +383 -0
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Exit codes for fireforge CLI operations.
3
+ * Each code represents a specific category of failure.
4
+ */
5
+ export declare const ExitCode: {
6
+ /** Operation completed successfully */
7
+ readonly SUCCESS: 0;
8
+ /** Unspecified error */
9
+ readonly GENERAL_ERROR: 1;
10
+ /** fireforge.json missing or invalid */
11
+ readonly CONFIG_ERROR: 2;
12
+ /** Failed to download or extract Firefox source */
13
+ readonly DOWNLOAD_ERROR: 3;
14
+ /** Git operation failed */
15
+ readonly GIT_ERROR: 4;
16
+ /** mach build failed */
17
+ readonly BUILD_ERROR: 5;
18
+ /** Patch application failed */
19
+ readonly PATCH_ERROR: 6;
20
+ /** Required tool not found (python3, git, tar) */
21
+ readonly MISSING_DEPENDENCY: 7;
22
+ /** Invalid command-line argument */
23
+ readonly INVALID_ARGUMENT: 8;
24
+ /** Furnace component management error */
25
+ readonly FURNACE_ERROR: 9;
26
+ /** Patch conflict resolution error */
27
+ readonly RESOLUTION_ERROR: 10;
28
+ };
29
+ export type ExitCode = (typeof ExitCode)[keyof typeof ExitCode];
@@ -0,0 +1,30 @@
1
+ // SPDX-License-Identifier: EUPL-1.2
2
+ /**
3
+ * Exit codes for fireforge CLI operations.
4
+ * Each code represents a specific category of failure.
5
+ */
6
+ export const ExitCode = {
7
+ /** Operation completed successfully */
8
+ SUCCESS: 0,
9
+ /** Unspecified error */
10
+ GENERAL_ERROR: 1,
11
+ /** fireforge.json missing or invalid */
12
+ CONFIG_ERROR: 2,
13
+ /** Failed to download or extract Firefox source */
14
+ DOWNLOAD_ERROR: 3,
15
+ /** Git operation failed */
16
+ GIT_ERROR: 4,
17
+ /** mach build failed */
18
+ BUILD_ERROR: 5,
19
+ /** Patch application failed */
20
+ PATCH_ERROR: 6,
21
+ /** Required tool not found (python3, git, tar) */
22
+ MISSING_DEPENDENCY: 7,
23
+ /** Invalid command-line argument */
24
+ INVALID_ARGUMENT: 8,
25
+ /** Furnace component management error */
26
+ FURNACE_ERROR: 9,
27
+ /** Patch conflict resolution error */
28
+ RESOLUTION_ERROR: 10,
29
+ };
30
+ //# sourceMappingURL=codes.js.map
@@ -0,0 +1,31 @@
1
+ import { FireForgeError } from './base.js';
2
+ /**
3
+ * Error thrown when configuration is missing or invalid.
4
+ */
5
+ export declare class ConfigError extends FireForgeError {
6
+ readonly field?: string | undefined;
7
+ readonly code: 2;
8
+ constructor(message: string, field?: string | undefined, cause?: Error);
9
+ get userMessage(): string;
10
+ }
11
+ /**
12
+ * Error thrown when fireforge.json is not found.
13
+ */
14
+ export declare class ConfigNotFoundError extends ConfigError {
15
+ constructor(configPath: string);
16
+ get userMessage(): string;
17
+ }
18
+ /**
19
+ * Error thrown when a required field is missing from config.
20
+ */
21
+ export declare class MissingFieldError extends ConfigError {
22
+ constructor(field: string);
23
+ }
24
+ /**
25
+ * Error thrown when a field has an invalid value.
26
+ */
27
+ export declare class InvalidFieldError extends ConfigError {
28
+ readonly expectedType: string;
29
+ readonly actualValue: unknown;
30
+ constructor(field: string, expectedType: string, actualValue: unknown);
31
+ }
@@ -0,0 +1,61 @@
1
+ // SPDX-License-Identifier: EUPL-1.2
2
+ import { FireForgeError } from './base.js';
3
+ import { ExitCode } from './codes.js';
4
+ /**
5
+ * Error thrown when configuration is missing or invalid.
6
+ */
7
+ export class ConfigError extends FireForgeError {
8
+ field;
9
+ code = ExitCode.CONFIG_ERROR;
10
+ constructor(message, field, cause) {
11
+ super(message, cause);
12
+ this.field = field;
13
+ }
14
+ get userMessage() {
15
+ let msg = `Configuration Error: ${this.message}`;
16
+ if (this.field) {
17
+ msg += `\n\nField: ${this.field}`;
18
+ }
19
+ msg += '\n\nTo fix this:\n';
20
+ msg += ' 1. Check your fireforge.json file for errors\n';
21
+ msg += ' 2. Run "fireforge setup" to create a new configuration\n';
22
+ msg += ' 3. See the documentation for the expected format';
23
+ return msg;
24
+ }
25
+ }
26
+ /**
27
+ * Error thrown when fireforge.json is not found.
28
+ */
29
+ export class ConfigNotFoundError extends ConfigError {
30
+ constructor(configPath) {
31
+ super(`Configuration file not found: ${configPath}`);
32
+ }
33
+ get userMessage() {
34
+ return (`Configuration Error: ${this.message}\n\n` +
35
+ 'This directory does not appear to be a FireForge project.\n\n' +
36
+ 'To fix this:\n' +
37
+ ' 1. Navigate to your project root directory\n' +
38
+ ' 2. Run "fireforge setup" to initialize a new project');
39
+ }
40
+ }
41
+ /**
42
+ * Error thrown when a required field is missing from config.
43
+ */
44
+ export class MissingFieldError extends ConfigError {
45
+ constructor(field) {
46
+ super(`Required field "${field}" is missing from fireforge.json`, field);
47
+ }
48
+ }
49
+ /**
50
+ * Error thrown when a field has an invalid value.
51
+ */
52
+ export class InvalidFieldError extends ConfigError {
53
+ expectedType;
54
+ actualValue;
55
+ constructor(field, expectedType, actualValue) {
56
+ super(`Field "${field}" has invalid value. Expected ${expectedType}, got ${typeof actualValue}`, field);
57
+ this.expectedType = expectedType;
58
+ this.actualValue = actualValue;
59
+ }
60
+ }
61
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1,42 @@
1
+ import { FireForgeError } from './base.js';
2
+ /**
3
+ * Error thrown when Firefox source download fails.
4
+ */
5
+ export declare class DownloadError extends FireForgeError {
6
+ readonly url?: string | undefined;
7
+ readonly code: 3;
8
+ constructor(message: string, url?: string | undefined, cause?: Error);
9
+ get userMessage(): string;
10
+ }
11
+ /**
12
+ * Error thrown when extraction of the downloaded archive fails.
13
+ */
14
+ export declare class ExtractionError extends DownloadError {
15
+ readonly archivePath: string;
16
+ constructor(archivePath: string, cause?: Error);
17
+ get userMessage(): string;
18
+ }
19
+ /**
20
+ * Error thrown when the Firefox version is not found on the server.
21
+ */
22
+ export declare class VersionNotFoundError extends DownloadError {
23
+ readonly version: string;
24
+ constructor(version: string);
25
+ get userMessage(): string;
26
+ }
27
+ /**
28
+ * Error thrown when engine directory already exists.
29
+ */
30
+ export declare class EngineExistsError extends DownloadError {
31
+ readonly enginePath: string;
32
+ constructor(enginePath: string);
33
+ get userMessage(): string;
34
+ }
35
+ /**
36
+ * Error thrown when engine/ exists but contains an unborn git repo from a failed download.
37
+ */
38
+ export declare class PartialEngineExistsError extends DownloadError {
39
+ readonly enginePath: string;
40
+ constructor(enginePath: string);
41
+ get userMessage(): string;
42
+ }
@@ -0,0 +1,95 @@
1
+ // SPDX-License-Identifier: EUPL-1.2
2
+ import { FireForgeError } from './base.js';
3
+ import { ExitCode } from './codes.js';
4
+ /**
5
+ * Error thrown when Firefox source download fails.
6
+ */
7
+ export class DownloadError extends FireForgeError {
8
+ url;
9
+ code = ExitCode.DOWNLOAD_ERROR;
10
+ constructor(message, url, cause) {
11
+ super(message, cause);
12
+ this.url = url;
13
+ }
14
+ get userMessage() {
15
+ let msg = `Download Error: ${this.message}`;
16
+ if (this.url) {
17
+ msg += `\n\nURL: ${this.url}`;
18
+ }
19
+ msg += '\n\nTo fix this:\n';
20
+ msg += ' 1. Check your internet connection\n';
21
+ msg += ' 2. Verify the Firefox version in fireforge.json is valid\n';
22
+ msg += ' 3. Try again with "fireforge download --force"';
23
+ return msg;
24
+ }
25
+ }
26
+ /**
27
+ * Error thrown when extraction of the downloaded archive fails.
28
+ */
29
+ export class ExtractionError extends DownloadError {
30
+ archivePath;
31
+ constructor(archivePath, cause) {
32
+ super(`Failed to extract archive: ${archivePath}`, undefined, cause);
33
+ this.archivePath = archivePath;
34
+ }
35
+ get userMessage() {
36
+ return (`Extraction Error: Failed to extract Firefox source archive.\n\n` +
37
+ `Archive: ${this.archivePath}\n\n` +
38
+ 'To fix this:\n' +
39
+ ' 1. Delete the corrupted archive and try again\n' +
40
+ ' 2. Ensure you have enough disk space\n' +
41
+ ' 3. Verify tar/xz tools are installed');
42
+ }
43
+ }
44
+ /**
45
+ * Error thrown when the Firefox version is not found on the server.
46
+ */
47
+ export class VersionNotFoundError extends DownloadError {
48
+ version;
49
+ constructor(version) {
50
+ super(`Firefox version ${version} not found on archive.mozilla.org`);
51
+ this.version = version;
52
+ }
53
+ get userMessage() {
54
+ return (`Download Error: Firefox version "${this.version}" was not found.\n\n` +
55
+ 'To fix this:\n' +
56
+ ' 1. Check the version number in fireforge.json\n' +
57
+ ' 2. Visit https://archive.mozilla.org/pub/firefox/releases/ to see available versions\n' +
58
+ ' 3. Update firefox.version in fireforge.json to a valid version');
59
+ }
60
+ }
61
+ /**
62
+ * Error thrown when engine directory already exists.
63
+ */
64
+ export class EngineExistsError extends DownloadError {
65
+ enginePath;
66
+ constructor(enginePath) {
67
+ super(`Engine directory already exists: ${enginePath}`);
68
+ this.enginePath = enginePath;
69
+ }
70
+ get userMessage() {
71
+ return (`Download Error: Firefox source already exists.\n\n` +
72
+ `Path: ${this.enginePath}\n\n` +
73
+ 'To fix this:\n' +
74
+ ' 1. Use "fireforge download --force" to re-download\n' +
75
+ ' 2. Or manually delete the engine/ directory');
76
+ }
77
+ }
78
+ /**
79
+ * Error thrown when engine/ exists but contains an unborn git repo from a failed download.
80
+ */
81
+ export class PartialEngineExistsError extends DownloadError {
82
+ enginePath;
83
+ constructor(enginePath) {
84
+ super(`Engine directory contains a partially initialized checkout: ${enginePath}`);
85
+ this.enginePath = enginePath;
86
+ }
87
+ get userMessage() {
88
+ return (`Download Error: Firefox source exists, but the baseline git repository was not fully initialized.\n\n` +
89
+ `Path: ${this.enginePath}\n\n` +
90
+ 'To fix this:\n' +
91
+ ' 1. Re-run "fireforge download --force" to recreate the baseline repository\n' +
92
+ ' 2. Or manually delete the engine/ directory before downloading again');
93
+ }
94
+ }
95
+ //# sourceMappingURL=download.js.map
@@ -0,0 +1,10 @@
1
+ import { FireForgeError } from './base.js';
2
+ /**
3
+ * Error thrown when a furnace component operation fails.
4
+ */
5
+ export declare class FurnaceError extends FireForgeError {
6
+ readonly component?: string | undefined;
7
+ readonly code: 9;
8
+ constructor(message: string, component?: string | undefined, cause?: Error);
9
+ get userMessage(): string;
10
+ }
@@ -0,0 +1,22 @@
1
+ // SPDX-License-Identifier: EUPL-1.2
2
+ import { FireForgeError } from './base.js';
3
+ import { ExitCode } from './codes.js';
4
+ /**
5
+ * Error thrown when a furnace component operation fails.
6
+ */
7
+ export class FurnaceError extends FireForgeError {
8
+ component;
9
+ code = ExitCode.FURNACE_ERROR;
10
+ constructor(message, component, cause) {
11
+ super(message, cause);
12
+ this.component = component;
13
+ }
14
+ get userMessage() {
15
+ let msg = this.component
16
+ ? `Furnace Error (${this.component}): ${this.message}`
17
+ : `Furnace Error: ${this.message}`;
18
+ msg += '\n\nRun "fireforge furnace validate" to diagnose issues.';
19
+ return msg;
20
+ }
21
+ }
22
+ //# sourceMappingURL=furnace.js.map
@@ -0,0 +1,41 @@
1
+ import { FireForgeError } from './base.js';
2
+ /**
3
+ * Error thrown when a git operation fails.
4
+ */
5
+ export declare class GitError extends FireForgeError {
6
+ readonly command?: string | undefined;
7
+ readonly code: 4;
8
+ constructor(message: string, command?: string | undefined, cause?: Error);
9
+ get userMessage(): string;
10
+ }
11
+ /**
12
+ * Error thrown when git is not installed.
13
+ */
14
+ export declare class GitNotFoundError extends GitError {
15
+ constructor();
16
+ get userMessage(): string;
17
+ }
18
+ /**
19
+ * Error thrown when applying a patch fails.
20
+ */
21
+ export declare class PatchApplyError extends GitError {
22
+ readonly patchPath: string;
23
+ constructor(patchPath: string, cause?: Error);
24
+ get userMessage(): string;
25
+ }
26
+ /**
27
+ * Error thrown when the repository is in a dirty state.
28
+ */
29
+ export declare class DirtyRepositoryError extends GitError {
30
+ constructor();
31
+ get userMessage(): string;
32
+ }
33
+ /**
34
+ * Error thrown when a stale git index lock blocks repository initialization.
35
+ */
36
+ export declare class GitIndexLockError extends GitError {
37
+ readonly lockPath: string;
38
+ readonly ageMs?: number | undefined;
39
+ constructor(lockPath: string, ageMs?: number | undefined);
40
+ get userMessage(): string;
41
+ }
@@ -0,0 +1,99 @@
1
+ // SPDX-License-Identifier: EUPL-1.2
2
+ import { FireForgeError } from './base.js';
3
+ import { ExitCode } from './codes.js';
4
+ /**
5
+ * Error thrown when a git operation fails.
6
+ */
7
+ export class GitError extends FireForgeError {
8
+ command;
9
+ code = ExitCode.GIT_ERROR;
10
+ constructor(message, command, cause) {
11
+ super(message, cause);
12
+ this.command = command;
13
+ }
14
+ get userMessage() {
15
+ let msg = `Git Error: ${this.message}`;
16
+ if (this.command) {
17
+ msg += `\n\nCommand: git ${this.command}`;
18
+ }
19
+ msg += '\n\nTo fix this:\n';
20
+ msg += ' 1. Ensure git is installed and in your PATH\n';
21
+ msg += ' 2. Check if the repository is in a valid state\n';
22
+ msg += ' 3. Try running "fireforge reset" to start fresh';
23
+ return msg;
24
+ }
25
+ }
26
+ /**
27
+ * Error thrown when git is not installed.
28
+ */
29
+ export class GitNotFoundError extends GitError {
30
+ constructor() {
31
+ super('Git is not installed or not found in PATH');
32
+ }
33
+ get userMessage() {
34
+ return ('Git Error: Git is not installed or not found in PATH.\n\n' +
35
+ 'To fix this:\n' +
36
+ ' 1. Install git from https://git-scm.com/\n' +
37
+ ' 2. Ensure git is in your system PATH\n' +
38
+ ' 3. Restart your terminal and try again');
39
+ }
40
+ }
41
+ /**
42
+ * Error thrown when applying a patch fails.
43
+ */
44
+ export class PatchApplyError extends GitError {
45
+ patchPath;
46
+ constructor(patchPath, cause) {
47
+ super(`Failed to apply patch: ${patchPath}`, 'apply', cause);
48
+ this.patchPath = patchPath;
49
+ }
50
+ get userMessage() {
51
+ return (`Git Error: Failed to apply patch.\n\n` +
52
+ `Patch: ${this.patchPath}\n\n` +
53
+ 'This usually means the patch conflicts with existing changes.\n\n' +
54
+ 'To fix this:\n' +
55
+ ' 1. Check if the Firefox version matches the patch\n' +
56
+ ' 2. Use "fireforge reset" to start with clean source\n' +
57
+ ' 3. Update the patch to match the current Firefox version');
58
+ }
59
+ }
60
+ /**
61
+ * Error thrown when the repository is in a dirty state.
62
+ */
63
+ export class DirtyRepositoryError extends GitError {
64
+ constructor() {
65
+ super('Repository has uncommitted changes');
66
+ }
67
+ get userMessage() {
68
+ return ('Git Error: The Firefox source has uncommitted changes.\n\n' +
69
+ 'To fix this:\n' +
70
+ ' 1. Export your changes with "fireforge export"\n' +
71
+ ' 2. Use "fireforge reset" to restore clean state\n' +
72
+ ' 3. Then run "fireforge import" to reapply patches');
73
+ }
74
+ }
75
+ /**
76
+ * Error thrown when a stale git index lock blocks repository initialization.
77
+ */
78
+ export class GitIndexLockError extends GitError {
79
+ lockPath;
80
+ ageMs;
81
+ constructor(lockPath, ageMs) {
82
+ super(`Git index is locked: ${lockPath}`, 'add -A');
83
+ this.lockPath = lockPath;
84
+ this.ageMs = ageMs;
85
+ }
86
+ get userMessage() {
87
+ const ageDescription = this.ageMs === undefined
88
+ ? ''
89
+ : `\nApproximate lock age: ${Math.max(1, Math.round(this.ageMs / 60000))} minute(s)\n`;
90
+ return ('Git Error: Firefox source indexing is blocked by an existing git index lock.\n\n' +
91
+ `Lock file: ${this.lockPath}${ageDescription}\n` +
92
+ 'This usually means a previous git or FireForge process was interrupted while indexing the engine tree.\n\n' +
93
+ 'To fix this:\n' +
94
+ ' 1. Make sure no other git process is still running inside engine/\n' +
95
+ ` 2. Remove "${this.lockPath}" if it is stale\n` +
96
+ ' 3. Re-run "fireforge download --force"');
97
+ }
98
+ }
99
+ //# sourceMappingURL=git.js.map
@@ -0,0 +1,10 @@
1
+ import { FireForgeError } from './base.js';
2
+ /**
3
+ * Error thrown when patch operations fail.
4
+ */
5
+ export declare class PatchError extends FireForgeError {
6
+ readonly patchName?: string | undefined;
7
+ readonly code: 6;
8
+ constructor(message: string, patchName?: string | undefined, cause?: Error);
9
+ get userMessage(): string;
10
+ }
@@ -0,0 +1,26 @@
1
+ // SPDX-License-Identifier: EUPL-1.2
2
+ import { FireForgeError } from './base.js';
3
+ import { ExitCode } from './codes.js';
4
+ /**
5
+ * Error thrown when patch operations fail.
6
+ */
7
+ export class PatchError extends FireForgeError {
8
+ patchName;
9
+ code = ExitCode.PATCH_ERROR;
10
+ constructor(message, patchName, cause) {
11
+ super(message, cause);
12
+ this.patchName = patchName;
13
+ }
14
+ get userMessage() {
15
+ let msg = `Patch Error: ${this.message}`;
16
+ if (this.patchName) {
17
+ msg += `\n\nPatch: ${this.patchName}`;
18
+ }
19
+ msg += '\n\nTo fix this:\n';
20
+ msg += ' 1. Check if the patch is compatible with the Firefox version\n';
21
+ msg += ' 2. Use "fireforge reset" to start with clean source\n';
22
+ msg += ' 3. Update the patch for the current Firefox version';
23
+ return msg;
24
+ }
25
+ }
26
+ //# sourceMappingURL=patch.js.map
@@ -0,0 +1,20 @@
1
+ import { FireForgeError } from './base.js';
2
+ /**
3
+ * Base error for rebase operations.
4
+ */
5
+ export declare class RebaseError extends FireForgeError {
6
+ readonly code: 6;
7
+ get userMessage(): string;
8
+ }
9
+ /**
10
+ * Thrown when starting a rebase while an existing session is in progress.
11
+ */
12
+ export declare class RebaseSessionExistsError extends RebaseError {
13
+ constructor();
14
+ }
15
+ /**
16
+ * Thrown when --continue or --abort is used without an active session.
17
+ */
18
+ export declare class NoRebaseSessionError extends RebaseError {
19
+ constructor();
20
+ }
@@ -0,0 +1,30 @@
1
+ // SPDX-License-Identifier: EUPL-1.2
2
+ import { FireForgeError } from './base.js';
3
+ import { ExitCode } from './codes.js';
4
+ /**
5
+ * Base error for rebase operations.
6
+ */
7
+ export class RebaseError extends FireForgeError {
8
+ code = ExitCode.PATCH_ERROR;
9
+ get userMessage() {
10
+ return `Rebase Error: ${this.message}`;
11
+ }
12
+ }
13
+ /**
14
+ * Thrown when starting a rebase while an existing session is in progress.
15
+ */
16
+ export class RebaseSessionExistsError extends RebaseError {
17
+ constructor() {
18
+ super('A rebase session is already in progress.\n' +
19
+ 'Use "fireforge rebase --continue" to resume or "fireforge rebase --abort" to cancel.');
20
+ }
21
+ }
22
+ /**
23
+ * Thrown when --continue or --abort is used without an active session.
24
+ */
25
+ export class NoRebaseSessionError extends RebaseError {
26
+ constructor() {
27
+ super('No rebase session in progress. Start one with "fireforge rebase".');
28
+ }
29
+ }
30
+ //# sourceMappingURL=rebase.js.map
@@ -0,0 +1,21 @@
1
+ /**
2
+ * FireForge — a toolkit for building and maintaining Firefox-based browsers.
3
+ *
4
+ * This module re-exports the public API surface used by downstream consumers.
5
+ * For CLI usage, see `bin/fireforge.ts`.
6
+ *
7
+ * **Stability:** Pre-1.0. The exports listed here are functional and tested,
8
+ * but may change between minor versions until 1.0 is released. Pin to an
9
+ * exact version if you depend on the programmatic API.
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+ export { loadConfig, validateConfig } from './core/config.js';
14
+ export { applyAllComponents } from './core/furnace-apply.js';
15
+ export { ensureFurnaceConfig, loadFurnaceConfig, loadFurnaceState, saveFurnaceState, validateFurnaceConfig, } from './core/furnace-config.js';
16
+ export { validateAllComponents, validateComponent } from './core/furnace-validate.js';
17
+ export type { AddTokenOptions, AddTokenResult, TokenMode } from './core/token-manager.js';
18
+ export { addToken, getTokensCssPath, validateTokenAdd } from './core/token-manager.js';
19
+ export { CancellationError, CommandError, FireForgeError, GeneralError, InvalidArgumentError, ResolutionError, } from './errors/base.js';
20
+ export { ExitCode } from './errors/codes.js';
21
+ export type { ApplyResult, BuildConfig, BuildMode, BuildOptions, ComponentType, CustomComponentConfig, DiscardOptions, DoctorCheck, DownloadOptions, DryRunAction, ExportOptions, FireForgeConfig, FireForgeState, FirefoxConfig, FirefoxProduct, FurnaceConfig, FurnaceCreateOptions, FurnaceOverrideOptions, FurnaceRemoveOptions, FurnaceState, GlobalOptions, ImportOptions, ImportSummary, OverrideComponentConfig, OverrideType, PackageOptions, PatchCategory, PatchesManifest, PatchInfo, PatchLintIssue, PatchMetadata, PatchResult, ProjectLicense, ProjectPaths, ProjectStatus, ReExportOptions, RegistrationStatus, ResetOptions, RunOptions, ScannedComponent, SetupOptions, StepError, SyncResult, TestOptions, TokenCoverageFileEntry, TokenCoverageReport, ValidationIssue, WireConfig, } from './types/index.js';
@@ -0,0 +1,21 @@
1
+ // SPDX-License-Identifier: EUPL-1.2
2
+ /**
3
+ * FireForge — a toolkit for building and maintaining Firefox-based browsers.
4
+ *
5
+ * This module re-exports the public API surface used by downstream consumers.
6
+ * For CLI usage, see `bin/fireforge.ts`.
7
+ *
8
+ * **Stability:** Pre-1.0. The exports listed here are functional and tested,
9
+ * but may change between minor versions until 1.0 is released. Pin to an
10
+ * exact version if you depend on the programmatic API.
11
+ *
12
+ * @packageDocumentation
13
+ */
14
+ export { loadConfig, validateConfig } from './core/config.js';
15
+ export { applyAllComponents } from './core/furnace-apply.js';
16
+ export { ensureFurnaceConfig, loadFurnaceConfig, loadFurnaceState, saveFurnaceState, validateFurnaceConfig, } from './core/furnace-config.js';
17
+ export { validateAllComponents, validateComponent } from './core/furnace-validate.js';
18
+ export { addToken, getTokensCssPath, validateTokenAdd } from './core/token-manager.js';
19
+ export { CancellationError, CommandError, FireForgeError, GeneralError, InvalidArgumentError, ResolutionError, } from './errors/base.js';
20
+ export { ExitCode } from './errors/codes.js';
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,14 @@
1
+ import type { Command } from 'commander';
2
+ /**
3
+ * Context passed to command registration functions.
4
+ */
5
+ export interface CommandContext {
6
+ /** Returns the detected project root directory */
7
+ getProjectRoot: () => string;
8
+ /** Wraps async handlers with error handling */
9
+ withErrorHandling: <T extends unknown[]>(handler: (...args: T) => Promise<void>) => (...args: T) => Promise<void>;
10
+ }
11
+ /**
12
+ * Function that registers one or more commands onto the given program.
13
+ */
14
+ export type CommandRegistrar = (program: Command, ctx: CommandContext) => void;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Re-exports all command-related types from focused sub-modules.
3
+ */
4
+ export type { BuildOptions, DiscardOptions, DoctorOptions, DownloadOptions, ExportOptions, FurnaceApplyOptions, FurnaceCreateOptions, FurnaceDeployOptions, FurnaceOverrideOptions, FurnacePreviewOptions, FurnaceRemoveOptions, GlobalOptions, ImportOptions, PackageOptions, RebaseOptions, ReExportOptions, RegisterOptions, ResetOptions, RunOptions, SetupOptions, StatusOptions, TestOptions, TokenAddOptions, WireOptions, } from './options.js';
5
+ export type { ImportSummary, PatchCategory, PatchesManifest, PatchInfo, PatchLintIssue, PatchMetadata, PatchResult, } from './patches.js';
6
+ export type { DoctorCheck, ProjectStatus, TokenCoverageFileEntry, TokenCoverageReport, } from './project.js';
@@ -0,0 +1,6 @@
1
+ // SPDX-License-Identifier: EUPL-1.2
2
+ /**
3
+ * Re-exports all command-related types from focused sub-modules.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=index.js.map