@hominis/fireforge 0.34.2 → 0.36.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.
- package/CHANGELOG.md +48 -0
- package/README.md +43 -5
- package/dist/bin/fireforge.d.ts +4 -0
- package/dist/bin/fireforge.js +25 -6
- package/dist/src/cli.js +22 -5
- package/dist/src/commands/bootstrap-checks.js +0 -1
- package/dist/src/commands/bootstrap.d.ts +2 -1
- package/dist/src/commands/bootstrap.js +16 -7
- package/dist/src/commands/build.js +17 -3
- package/dist/src/commands/config.js +30 -10
- package/dist/src/commands/discard.js +24 -5
- package/dist/src/commands/doctor/post-rebase-audit.js +0 -1
- package/dist/src/commands/doctor-check-core.js +0 -1
- package/dist/src/commands/doctor-external-toolchains.d.ts +3 -0
- package/dist/src/commands/doctor-external-toolchains.js +54 -0
- package/dist/src/commands/doctor-furnace-jar.js +0 -1
- package/dist/src/commands/doctor-furnace-manifest-sync.js +0 -1
- package/dist/src/commands/doctor-furnace.js +2 -2
- package/dist/src/commands/doctor-working-tree.js +0 -1
- package/dist/src/commands/doctor.js +4 -1
- package/dist/src/commands/download.js +51 -15
- package/dist/src/commands/export-all.js +5 -3
- package/dist/src/commands/export-flow.js +12 -7
- package/dist/src/commands/export-placement-gate.js +0 -1
- package/dist/src/commands/export-placement-policy.js +0 -1
- package/dist/src/commands/export-shared.d.ts +5 -1
- package/dist/src/commands/export-shared.js +18 -6
- package/dist/src/commands/export.js +15 -10
- package/dist/src/commands/furnace/apply.js +22 -6
- package/dist/src/commands/furnace/chrome-doc-remove.js +0 -1
- package/dist/src/commands/furnace/chrome-doc-templates.js +0 -1
- package/dist/src/commands/furnace/chrome-doc-tests.js +0 -1
- package/dist/src/commands/furnace/chrome-doc.js +0 -1
- package/dist/src/commands/furnace/create-browser-test.js +0 -1
- package/dist/src/commands/furnace/create-dry-run.js +0 -1
- package/dist/src/commands/furnace/create-features.js +0 -1
- package/dist/src/commands/furnace/create-mochikit.js +0 -1
- package/dist/src/commands/furnace/create-readback.js +0 -1
- package/dist/src/commands/furnace/create-templates.js +0 -1
- package/dist/src/commands/furnace/create-validation.js +0 -1
- package/dist/src/commands/furnace/create-xpcshell.js +0 -1
- package/dist/src/commands/furnace/create.js +0 -1
- package/dist/src/commands/furnace/deploy.js +7 -83
- package/dist/src/commands/furnace/diff.js +0 -1
- package/dist/src/commands/furnace/index.js +59 -25
- package/dist/src/commands/furnace/init.js +0 -1
- package/dist/src/commands/furnace/list.js +0 -1
- package/dist/src/commands/furnace/override.js +0 -1
- package/dist/src/commands/furnace/preview.js +3 -3
- package/dist/src/commands/furnace/refresh.js +0 -1
- package/dist/src/commands/furnace/remove-state.d.ts +15 -0
- package/dist/src/commands/furnace/remove-state.js +47 -1
- package/dist/src/commands/furnace/remove.js +3 -9
- package/dist/src/commands/furnace/rename-browser-test.js +1 -5
- package/dist/src/commands/furnace/rename-helpers.d.ts +6 -0
- package/dist/src/commands/furnace/rename-helpers.js +30 -1
- package/dist/src/commands/furnace/rename-xpcshell.js +7 -6
- package/dist/src/commands/furnace/rename.js +15 -36
- package/dist/src/commands/furnace/scan.js +0 -1
- package/dist/src/commands/furnace/status.js +0 -1
- package/dist/src/commands/furnace/sync.js +76 -4
- package/dist/src/commands/furnace/validate.js +0 -1
- package/dist/src/commands/furnace/validation-output.js +0 -1
- package/dist/src/commands/import.js +35 -9
- package/dist/src/commands/lint-per-patch.js +19 -7
- package/dist/src/commands/lint.js +13 -3
- package/dist/src/commands/manifest.js +1 -2
- package/dist/src/commands/package.js +2 -1
- package/dist/src/commands/patch/compact.js +1 -1
- package/dist/src/commands/patch/delete.js +1 -1
- package/dist/src/commands/patch/index.js +1 -1
- package/dist/src/commands/patch/lint-ignore.js +21 -6
- package/dist/src/commands/patch/move-files.js +1 -1
- package/dist/src/commands/patch/patch-context.js +0 -1
- package/dist/src/commands/patch/rename.js +4 -4
- package/dist/src/commands/patch/reorder.js +3 -4
- package/dist/src/commands/patch/split-plan.js +2 -1
- package/dist/src/commands/patch/split.js +4 -4
- package/dist/src/commands/patch/staged-dependency.js +1 -1
- package/dist/src/commands/patch/tier.js +18 -5
- package/dist/src/commands/re-export-bulk-scan.js +0 -1
- package/dist/src/commands/re-export-files.js +1 -1
- package/dist/src/commands/re-export-options.js +0 -1
- package/dist/src/commands/re-export-scan.js +0 -1
- package/dist/src/commands/re-export.js +6 -4
- package/dist/src/commands/rebase/abort.js +2 -9
- package/dist/src/commands/rebase/confirm.js +0 -1
- package/dist/src/commands/rebase/conflict-summary.js +0 -1
- package/dist/src/commands/rebase/continue.js +0 -1
- package/dist/src/commands/rebase/index.d.ts +1 -1
- package/dist/src/commands/rebase/index.js +10 -15
- package/dist/src/commands/rebase/patch-loop.js +38 -7
- package/dist/src/commands/rebase/summary.js +2 -3
- package/dist/src/commands/rebase.js +0 -1
- package/dist/src/commands/register.js +1 -1
- package/dist/src/commands/reset.js +16 -9
- package/dist/src/commands/resolve.js +2 -2
- package/dist/src/commands/run.js +18 -6
- package/dist/src/commands/setup-support.js +0 -1
- package/dist/src/commands/setup.js +1 -2
- package/dist/src/commands/source.js +1 -2
- package/dist/src/commands/status-output.js +1 -12
- package/dist/src/commands/status.js +147 -133
- package/dist/src/commands/test-appdir.js +0 -1
- package/dist/src/commands/test-diagnose.js +18 -2
- package/dist/src/commands/test-modes.d.ts +15 -0
- package/dist/src/commands/test-modes.js +61 -0
- package/dist/src/commands/test-register.d.ts +4 -0
- package/dist/src/commands/test-register.js +64 -0
- package/dist/src/commands/test-run.d.ts +23 -7
- package/dist/src/commands/test-run.js +15 -14
- package/dist/src/commands/test.d.ts +0 -4
- package/dist/src/commands/test.js +95 -56
- package/dist/src/commands/token-coverage.js +0 -1
- package/dist/src/commands/token.js +1 -2
- package/dist/src/commands/typecheck.js +1 -1
- package/dist/src/commands/verify.js +3 -9
- package/dist/src/commands/watch.js +5 -1
- package/dist/src/commands/wire.js +1 -1
- package/dist/src/core/ast-utils.js +0 -1
- package/dist/src/core/brand-validation.js +0 -1
- package/dist/src/core/branding.js +0 -1
- package/dist/src/core/browser-wire.js +0 -1
- package/dist/src/core/build-audit-platform.js +0 -1
- package/dist/src/core/build-audit-registration.js +0 -1
- package/dist/src/core/build-audit-resolve.js +0 -1
- package/dist/src/core/build-audit-transforms.js +0 -1
- package/dist/src/core/build-audit.js +0 -1
- package/dist/src/core/build-baseline-types.js +0 -1
- package/dist/src/core/build-baseline.js +0 -1
- package/dist/src/core/build-prepare.js +21 -7
- package/dist/src/core/config-mutate.js +0 -1
- package/dist/src/core/config-paths.d.ts +2 -2
- package/dist/src/core/config-paths.js +6 -1
- package/dist/src/core/config-state.js +0 -1
- package/dist/src/core/config-validate-patch-policy.js +0 -1
- package/dist/src/core/config-validate-test-toolchains.d.ts +8 -0
- package/dist/src/core/config-validate-test-toolchains.js +105 -0
- package/dist/src/core/config-validate.js +3 -1
- package/dist/src/core/config.js +0 -1
- package/dist/src/core/destructive.js +0 -1
- package/dist/src/core/diff-hunks.js +13 -7
- package/dist/src/core/engine-changes.js +0 -1
- package/dist/src/core/engine-session-lock.d.ts +12 -0
- package/dist/src/core/engine-session-lock.js +45 -0
- package/dist/src/core/file-lock.d.ts +8 -0
- package/dist/src/core/file-lock.js +157 -48
- package/dist/src/core/firefox-archive.d.ts +4 -0
- package/dist/src/core/firefox-archive.js +6 -1
- package/dist/src/core/firefox-cache.js +67 -8
- package/dist/src/core/firefox-download.js +0 -1
- package/dist/src/core/firefox-extract.d.ts +21 -1
- package/dist/src/core/firefox-extract.js +178 -9
- package/dist/src/core/firefox-ignorefile.js +0 -1
- package/dist/src/core/firefox.d.ts +12 -0
- package/dist/src/core/firefox.js +64 -2
- package/dist/src/core/furnace-apply-dry-run.js +0 -1
- package/dist/src/core/furnace-apply-ftl.d.ts +7 -3
- package/dist/src/core/furnace-apply-ftl.js +10 -5
- package/dist/src/core/furnace-apply-helpers.js +0 -1
- package/dist/src/core/furnace-apply-output.js +2 -2
- package/dist/src/core/furnace-apply.d.ts +7 -1
- package/dist/src/core/furnace-apply.js +47 -13
- package/dist/src/core/furnace-checksum-utils.js +0 -1
- package/dist/src/core/furnace-config-array-utils.js +0 -1
- package/dist/src/core/furnace-config-custom.js +0 -1
- package/dist/src/core/furnace-config-order.js +0 -1
- package/dist/src/core/furnace-config-tokens.js +0 -1
- package/dist/src/core/furnace-config-validate.js +0 -1
- package/dist/src/core/furnace-config.d.ts +11 -0
- package/dist/src/core/furnace-config.js +37 -1
- package/dist/src/core/furnace-constants.js +0 -1
- package/dist/src/core/furnace-css-fragments.js +0 -1
- package/dist/src/core/furnace-graph-utils.js +0 -1
- package/dist/src/core/furnace-jsconfig.d.ts +2 -3
- package/dist/src/core/furnace-jsconfig.js +25 -18
- package/dist/src/core/furnace-marker.js +0 -1
- package/dist/src/core/furnace-operation.js +0 -1
- package/dist/src/core/furnace-refresh.js +0 -1
- package/dist/src/core/furnace-registration-ast.d.ts +14 -0
- package/dist/src/core/furnace-registration-ast.js +1 -2
- package/dist/src/core/furnace-registration-remove.js +0 -1
- package/dist/src/core/furnace-registration-validate.js +1 -5
- package/dist/src/core/furnace-registration.js +0 -1
- package/dist/src/core/furnace-rollback.js +0 -1
- package/dist/src/core/furnace-scanner.js +0 -1
- package/dist/src/core/furnace-staleness.js +0 -1
- package/dist/src/core/furnace-state-persist.d.ts +72 -0
- package/dist/src/core/furnace-state-persist.js +118 -0
- package/dist/src/core/furnace-step-errors.d.ts +23 -0
- package/dist/src/core/furnace-step-errors.js +25 -0
- package/dist/src/core/furnace-stories.js +0 -1
- package/dist/src/core/furnace-validate-accessibility.js +0 -1
- package/dist/src/core/furnace-validate-checks.js +0 -1
- package/dist/src/core/furnace-validate-compatibility.js +0 -1
- package/dist/src/core/furnace-validate-helpers.js +0 -1
- package/dist/src/core/furnace-validate-registration.js +7 -7
- package/dist/src/core/furnace-validate-structure.d.ts +8 -0
- package/dist/src/core/furnace-validate-structure.js +11 -2
- package/dist/src/core/furnace-validate.js +0 -1
- package/dist/src/core/furnace-version-drift.d.ts +6 -3
- package/dist/src/core/furnace-version-drift.js +6 -4
- package/dist/src/core/git-base.js +0 -1
- package/dist/src/core/git-diff.js +0 -1
- package/dist/src/core/git-file-ops.js +0 -1
- package/dist/src/core/git-status.d.ts +13 -0
- package/dist/src/core/git-status.js +32 -2
- package/dist/src/core/git.d.ts +10 -1
- package/dist/src/core/git.js +65 -8
- package/dist/src/core/license-headers.d.ts +16 -0
- package/dist/src/core/license-headers.js +19 -1
- package/dist/src/core/lint-cache.js +0 -1
- package/dist/src/core/lint-projection.js +0 -1
- package/dist/src/core/mach-build-artifacts.js +0 -1
- package/dist/src/core/mach-error-hints.js +27 -1
- package/dist/src/core/mach-mozconfig.js +0 -1
- package/dist/src/core/mach-python.js +0 -1
- package/dist/src/core/mach-resource-shim.js +0 -1
- package/dist/src/core/mach.js +0 -1
- package/dist/src/core/manifest-helpers.js +0 -1
- package/dist/src/core/manifest-register.js +0 -1
- package/dist/src/core/manifest-rules.js +0 -1
- package/dist/src/core/manifest-tokenizers.js +0 -1
- package/dist/src/core/marionette-port.d.ts +8 -0
- package/dist/src/core/marionette-port.js +34 -3
- package/dist/src/core/marionette-preflight.js +0 -1
- package/dist/src/core/markdown-table.js +0 -1
- package/dist/src/core/ownership-table.js +2 -9
- package/dist/src/core/parser-fallback.js +0 -1
- package/dist/src/core/patch-apply-fuzz.d.ts +27 -9
- package/dist/src/core/patch-apply-fuzz.js +71 -34
- package/dist/src/core/patch-apply.d.ts +30 -0
- package/dist/src/core/patch-apply.js +152 -39
- package/dist/src/core/patch-artifact-normalize.d.ts +18 -5
- package/dist/src/core/patch-artifact-normalize.js +19 -15
- package/dist/src/core/patch-export-coverage.js +0 -1
- package/dist/src/core/patch-export-metadata.js +0 -1
- package/dist/src/core/patch-export-update.js +2 -3
- package/dist/src/core/patch-export.d.ts +2 -6
- package/dist/src/core/patch-export.js +24 -48
- package/dist/src/core/patch-files.js +0 -1
- package/dist/src/core/patch-identifier-suggest.js +0 -1
- package/dist/src/core/patch-lint-checkjs.js +0 -1
- package/dist/src/core/patch-lint-chrome-jsdoc.js +0 -1
- package/dist/src/core/patch-lint-cross.js +0 -1
- package/dist/src/core/patch-lint-css.js +0 -1
- package/dist/src/core/patch-lint-diff-tag.js +0 -1
- package/dist/src/core/patch-lint-diff.d.ts +2 -1
- package/dist/src/core/patch-lint-diff.js +17 -32
- package/dist/src/core/patch-lint-imports.js +0 -1
- package/dist/src/core/patch-lint-jsdoc.js +0 -1
- package/dist/src/core/patch-lint-observer.js +0 -1
- package/dist/src/core/patch-lint-ownership.js +0 -1
- package/dist/src/core/patch-lint-reexports.js +0 -1
- package/dist/src/core/patch-lint.d.ts +37 -2
- package/dist/src/core/patch-lint.js +48 -24
- package/dist/src/core/patch-lock.js +0 -1
- package/dist/src/core/patch-manifest-consistency.js +9 -1
- package/dist/src/core/patch-manifest-io.d.ts +16 -0
- package/dist/src/core/patch-manifest-io.js +37 -12
- package/dist/src/core/patch-manifest-query.d.ts +6 -0
- package/dist/src/core/patch-manifest-query.js +27 -12
- package/dist/src/core/patch-manifest-resolve.js +0 -1
- package/dist/src/core/patch-manifest-validate.js +0 -1
- package/dist/src/core/patch-manifest.d.ts +1 -1
- package/dist/src/core/patch-manifest.js +1 -2
- package/dist/src/core/patch-parse.d.ts +59 -0
- package/dist/src/core/patch-parse.js +209 -92
- package/dist/src/core/patch-policy.js +0 -1
- package/dist/src/core/patch-registration-refs.js +16 -26
- package/dist/src/core/patch-source-metadata.js +0 -1
- package/dist/src/core/patch-transform.d.ts +4 -0
- package/dist/src/core/patch-transform.js +30 -38
- package/dist/src/core/rebase-session.js +0 -1
- package/dist/src/core/register-browser-content.js +0 -1
- package/dist/src/core/register-module.js +0 -1
- package/dist/src/core/register-result.js +0 -1
- package/dist/src/core/register-scaffold.js +0 -1
- package/dist/src/core/register-shared-css.js +0 -1
- package/dist/src/core/register-test-manifest.js +0 -1
- package/dist/src/core/register-xpcshell-test.js +0 -1
- package/dist/src/core/shared-ftl.js +0 -1
- package/dist/src/core/signal-critical.js +0 -1
- package/dist/src/core/smoke-patterns.js +0 -1
- package/dist/src/core/state-file.js +0 -1
- package/dist/src/core/status-classify.d.ts +16 -0
- package/dist/src/core/status-classify.js +24 -16
- package/dist/src/core/test-harness-crash.d.ts +64 -7
- package/dist/src/core/test-harness-crash.js +196 -15
- package/dist/src/core/test-harness-output.js +0 -1
- package/dist/src/core/test-path-scope.d.ts +62 -0
- package/dist/src/core/test-path-scope.js +148 -0
- package/dist/src/core/test-stale-check.js +0 -1
- package/dist/src/core/test-stale-symlink.js +0 -1
- package/dist/src/core/test-xpcshell-retry.js +0 -1
- package/dist/src/core/token-coverage.js +0 -1
- package/dist/src/core/token-dark-mode.js +0 -1
- package/dist/src/core/token-docs.js +0 -1
- package/dist/src/core/token-manager.js +0 -1
- package/dist/src/core/token-scaffold.js +0 -1
- package/dist/src/core/token-variant.js +0 -1
- package/dist/src/core/toolchain-preflight.d.ts +85 -0
- package/dist/src/core/toolchain-preflight.js +256 -0
- package/dist/src/core/typecheck-shim.d.ts +4 -1
- package/dist/src/core/typecheck-shim.js +61 -18
- package/dist/src/core/typecheck.js +0 -1
- package/dist/src/core/wire-destroy.js +0 -1
- package/dist/src/core/wire-dom-fragment.js +0 -1
- package/dist/src/core/wire-init.js +0 -1
- package/dist/src/core/wire-subscript.js +0 -1
- package/dist/src/core/wire-targets.js +0 -1
- package/dist/src/core/wire-utils.js +0 -1
- package/dist/src/core/xpcshell-appdir.js +1 -4
- package/dist/src/errors/base.d.ts +29 -0
- package/dist/src/errors/base.js +35 -1
- package/dist/src/errors/build.js +0 -1
- package/dist/src/errors/codes.d.ts +6 -0
- package/dist/src/errors/codes.js +6 -1
- package/dist/src/errors/config.js +0 -1
- package/dist/src/errors/download.js +2 -1
- package/dist/src/errors/furnace.d.ts +11 -1
- package/dist/src/errors/furnace.js +6 -5
- package/dist/src/errors/git.js +0 -1
- package/dist/src/errors/patch.d.ts +17 -0
- package/dist/src/errors/patch.js +29 -1
- package/dist/src/errors/rebase.js +0 -1
- package/dist/src/errors/run.js +1 -1
- package/dist/src/index.js +0 -1
- package/dist/src/types/cli.js +0 -1
- package/dist/src/types/commands/index.js +0 -1
- package/dist/src/types/commands/options.d.ts +20 -5
- package/dist/src/types/commands/options.js +0 -1
- package/dist/src/types/commands/patches.d.ts +8 -0
- package/dist/src/types/commands/patches.js +0 -1
- package/dist/src/types/commands/project.d.ts +11 -2
- package/dist/src/types/commands/project.js +0 -1
- package/dist/src/types/config.d.ts +32 -0
- package/dist/src/types/config.js +0 -1
- package/dist/src/types/furnace.d.ts +10 -0
- package/dist/src/types/furnace.js +0 -1
- package/dist/src/types/index.js +0 -1
- package/dist/src/types/typecheck.js +0 -1
- package/dist/src/utils/elapsed.js +0 -1
- package/dist/src/utils/errors.js +0 -1
- package/dist/src/utils/fs.js +37 -5
- package/dist/src/utils/logger.d.ts +7 -0
- package/dist/src/utils/logger.js +85 -3
- package/dist/src/utils/options.d.ts +15 -0
- package/dist/src/utils/options.js +25 -1
- package/dist/src/utils/package-root.js +11 -4
- package/dist/src/utils/parse.js +0 -1
- package/dist/src/utils/paths.js +0 -1
- package/dist/src/utils/platform.js +0 -1
- package/dist/src/utils/process.d.ts +33 -4
- package/dist/src/utils/process.js +183 -28
- package/dist/src/utils/regex.d.ts +13 -3
- package/dist/src/utils/regex.js +53 -4
- package/dist/src/utils/validation.d.ts +0 -12
- package/dist/src/utils/validation.js +13 -26
- package/package.json +8 -7
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared predicates over {@link StepError} lists.
|
|
3
|
+
*
|
|
4
|
+
* Step errors come in two severities: BLOCKING (the default — the apply is
|
|
5
|
+
* considered failed, triggers rollback and a non-zero exit) and ADVISORY
|
|
6
|
+
* (`advisory: true` — reported as a warning, never blocks; used by the
|
|
7
|
+
* `.ftl` helpers whose contract is graceful degradation). Every gate that
|
|
8
|
+
* decides rollback/failure must count only blocking errors; every reporter
|
|
9
|
+
* should still surface advisory ones. This module is a leaf (types-only
|
|
10
|
+
* imports) so both `furnace-apply.ts` and its callers can share the
|
|
11
|
+
* predicates without import cycles.
|
|
12
|
+
*/
|
|
13
|
+
import type { StepError } from '../types/furnace.js';
|
|
14
|
+
/** Narrow shape shared by applied-component entries carrying step errors. */
|
|
15
|
+
export interface HasStepErrors {
|
|
16
|
+
stepErrors?: StepError[];
|
|
17
|
+
}
|
|
18
|
+
/** Returns only the blocking (non-advisory) step errors. */
|
|
19
|
+
export declare function blockingStepErrors(stepErrors: StepError[] | undefined): StepError[];
|
|
20
|
+
/** True when the entry carries at least one blocking step error. */
|
|
21
|
+
export declare function hasBlockingStepErrors(entry: HasStepErrors): boolean;
|
|
22
|
+
/** Counts applied entries that carry at least one blocking step error. */
|
|
23
|
+
export declare function countEntriesWithBlockingStepErrors(entries: readonly HasStepErrors[]): number;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EUPL-1.2
|
|
2
|
+
/**
|
|
3
|
+
* Shared predicates over {@link StepError} lists.
|
|
4
|
+
*
|
|
5
|
+
* Step errors come in two severities: BLOCKING (the default — the apply is
|
|
6
|
+
* considered failed, triggers rollback and a non-zero exit) and ADVISORY
|
|
7
|
+
* (`advisory: true` — reported as a warning, never blocks; used by the
|
|
8
|
+
* `.ftl` helpers whose contract is graceful degradation). Every gate that
|
|
9
|
+
* decides rollback/failure must count only blocking errors; every reporter
|
|
10
|
+
* should still surface advisory ones. This module is a leaf (types-only
|
|
11
|
+
* imports) so both `furnace-apply.ts` and its callers can share the
|
|
12
|
+
* predicates without import cycles.
|
|
13
|
+
*/
|
|
14
|
+
/** Returns only the blocking (non-advisory) step errors. */
|
|
15
|
+
export function blockingStepErrors(stepErrors) {
|
|
16
|
+
return (stepErrors ?? []).filter((e) => e.advisory !== true);
|
|
17
|
+
}
|
|
18
|
+
/** True when the entry carries at least one blocking step error. */
|
|
19
|
+
export function hasBlockingStepErrors(entry) {
|
|
20
|
+
return blockingStepErrors(entry.stepErrors).length > 0;
|
|
21
|
+
}
|
|
22
|
+
/** Counts applied entries that carry at least one blocking step error. */
|
|
23
|
+
export function countEntriesWithBlockingStepErrors(entries) {
|
|
24
|
+
return entries.filter((entry) => hasBlockingStepErrors(entry)).length;
|
|
25
|
+
}
|
|
@@ -4,4 +4,3 @@ export { validateAccessibility } from './furnace-validate-accessibility.js';
|
|
|
4
4
|
export { validateCompatibility } from './furnace-validate-compatibility.js';
|
|
5
5
|
export { checkRegistrationConsistency, validateJarMnEntries, validateRegistrationPatterns, validateTokenLink, } from './furnace-validate-registration.js';
|
|
6
6
|
export { validateStructure } from './furnace-validate-structure.js';
|
|
7
|
-
//# sourceMappingURL=furnace-validate-checks.js.map
|
|
@@ -5,12 +5,13 @@ import { join } from 'node:path';
|
|
|
5
5
|
import { toError } from '../utils/errors.js';
|
|
6
6
|
import { pathExists, readText } from '../utils/fs.js';
|
|
7
7
|
import { warn } from '../utils/logger.js';
|
|
8
|
-
import { stripJsComments } from '../utils/regex.js';
|
|
8
|
+
import { escapeRegex, stripJsComments } from '../utils/regex.js';
|
|
9
9
|
import { getProjectPaths, loadConfig } from './config.js';
|
|
10
10
|
import { getFurnacePaths } from './furnace-config.js';
|
|
11
11
|
import { CUSTOM_ELEMENTS_JS, FTL_DIR, JAR_MN } from './furnace-constants.js';
|
|
12
12
|
import { expandCssFragments, listFragmentIncludes } from './furnace-css-fragments.js';
|
|
13
13
|
import { findStaleJarMnEntries } from './furnace-registration.js';
|
|
14
|
+
import { isTagAlreadyRegistered } from './furnace-registration-ast.js';
|
|
14
15
|
import { isTagInCorrectCustomElementsPlacement } from './furnace-registration-validate.js';
|
|
15
16
|
import { getTokensCssPath } from './token-manager.js';
|
|
16
17
|
/**
|
|
@@ -47,9 +48,6 @@ export async function validateRegistrationPatterns(root, config) {
|
|
|
47
48
|
}
|
|
48
49
|
return issues;
|
|
49
50
|
}
|
|
50
|
-
function escapeRegex(value) {
|
|
51
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
52
|
-
}
|
|
53
51
|
/**
|
|
54
52
|
* Checks registration consistency for a single custom component.
|
|
55
53
|
*
|
|
@@ -160,8 +158,11 @@ export async function checkRegistrationConsistency(root, name, config, ftlDir) {
|
|
|
160
158
|
const cePath = join(engineDir, CUSTOM_ELEMENTS_JS);
|
|
161
159
|
if (await pathExists(cePath)) {
|
|
162
160
|
const ceContent = await readText(cePath);
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
// Structure-aware check shared with the ADD path — a bare substring
|
|
162
|
+
// test counted any mention of the tag (a leftover comment, an
|
|
163
|
+
// unrelated string) as "registered", masking genuinely missing
|
|
164
|
+
// registrations from both validate and the re-apply drift oracle.
|
|
165
|
+
status.customElementsPresent = isTagAlreadyRegistered(ceContent, name);
|
|
165
166
|
if (status.customElementsPresent) {
|
|
166
167
|
status.customElementsCorrectBlock = isTagInCorrectCustomElementsPlacement(ceContent, name, true);
|
|
167
168
|
}
|
|
@@ -396,4 +397,3 @@ export async function runPostApplyConsistencyChecks(root, config, result, ftlDir
|
|
|
396
397
|
}
|
|
397
398
|
}
|
|
398
399
|
}
|
|
399
|
-
//# sourceMappingURL=furnace-validate-registration.js.map
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { ComponentType, CustomComponentConfig, ValidationIssue } from '../types/furnace.js';
|
|
2
|
+
/**
|
|
3
|
+
* Returns true when file content carries unresolved three-way-merge
|
|
4
|
+
* conflict markers (as left behind by `furnace refresh`). Shared between
|
|
5
|
+
* the structure validator and `furnace sync`'s pre-apply gate — both must
|
|
6
|
+
* agree on what "conflicted" means so a file that validate flags can never
|
|
7
|
+
* slip through sync into the engine.
|
|
8
|
+
*/
|
|
9
|
+
export declare function containsMergeConflictMarkers(content: string): boolean;
|
|
2
10
|
/**
|
|
3
11
|
* Validates the file structure of a component directory.
|
|
4
12
|
* Checks for required files and naming conventions.
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
import { readdir } from 'node:fs/promises';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { pathExists, readText } from '../utils/fs.js';
|
|
5
|
+
/**
|
|
6
|
+
* Returns true when file content carries unresolved three-way-merge
|
|
7
|
+
* conflict markers (as left behind by `furnace refresh`). Shared between
|
|
8
|
+
* the structure validator and `furnace sync`'s pre-apply gate — both must
|
|
9
|
+
* agree on what "conflicted" means so a file that validate flags can never
|
|
10
|
+
* slip through sync into the engine.
|
|
11
|
+
*/
|
|
12
|
+
export function containsMergeConflictMarkers(content) {
|
|
13
|
+
return /^<{7}\s/m.test(content) || /^>{7}\s/m.test(content) || /^={7}$/m.test(content);
|
|
14
|
+
}
|
|
5
15
|
/**
|
|
6
16
|
* Validates the file structure of a component directory.
|
|
7
17
|
* Checks for required files and naming conventions.
|
|
@@ -65,7 +75,7 @@ export async function validateStructure(componentDir, tagName, type, customConfi
|
|
|
65
75
|
!entry.name.endsWith('.ftl'))
|
|
66
76
|
continue;
|
|
67
77
|
const content = await readText(join(componentDir, entry.name));
|
|
68
|
-
if (
|
|
78
|
+
if (containsMergeConflictMarkers(content)) {
|
|
69
79
|
issues.push({
|
|
70
80
|
component: tagName,
|
|
71
81
|
severity: 'error',
|
|
@@ -109,4 +119,3 @@ export async function validateStructure(componentDir, tagName, type, customConfi
|
|
|
109
119
|
}
|
|
110
120
|
return issues;
|
|
111
121
|
}
|
|
112
|
-
//# sourceMappingURL=furnace-validate-structure.js.map
|
|
@@ -14,9 +14,12 @@
|
|
|
14
14
|
* copied from `forgeConfig.firefox.version`. Any string mismatch is worth
|
|
15
15
|
* surfacing — even "140.0" vs "140.9.0esr" is a real drift signal.
|
|
16
16
|
*
|
|
17
|
-
* The result
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* The result GATES apply/deploy: both warn and then FAIL without --force
|
|
18
|
+
* (see furnaceApplyCommand / furnaceDeployCommand), and `furnace sync`
|
|
19
|
+
* re-checks it after refresh before applying. Status reports drift
|
|
20
|
+
* alongside the component overview. Keep this doc in sync with the gates —
|
|
21
|
+
* an earlier version claimed the result was advisory, which invited
|
|
22
|
+
* re-breaking the gate.
|
|
20
23
|
*/
|
|
21
24
|
import type { FurnaceConfig } from '../types/furnace.js';
|
|
22
25
|
/** Severity of the version drift between an override's base and the current Firefox version. */
|
|
@@ -15,9 +15,12 @@
|
|
|
15
15
|
* copied from `forgeConfig.firefox.version`. Any string mismatch is worth
|
|
16
16
|
* surfacing — even "140.0" vs "140.9.0esr" is a real drift signal.
|
|
17
17
|
*
|
|
18
|
-
* The result
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* The result GATES apply/deploy: both warn and then FAIL without --force
|
|
19
|
+
* (see furnaceApplyCommand / furnaceDeployCommand), and `furnace sync`
|
|
20
|
+
* re-checks it after refresh before applying. Status reports drift
|
|
21
|
+
* alongside the component overview. Keep this doc in sync with the gates —
|
|
22
|
+
* an earlier version claimed the result was advisory, which invited
|
|
23
|
+
* re-breaking the gate.
|
|
21
24
|
*/
|
|
22
25
|
/**
|
|
23
26
|
* Parses a version string into its major, minor, and patch numeric
|
|
@@ -98,4 +101,3 @@ export function formatOverrideBaseVersionDriftError(entries) {
|
|
|
98
101
|
'update baseVersion in furnace.json to acknowledge the new baseline, ' +
|
|
99
102
|
'or pass --force to proceed despite the drift.');
|
|
100
103
|
}
|
|
101
|
-
//# sourceMappingURL=furnace-version-drift.js.map
|
|
@@ -12,9 +12,22 @@ export declare function parsePorcelainStatus(output: string): GitStatusEntry[];
|
|
|
12
12
|
* @returns Parsed git status entries
|
|
13
13
|
*/
|
|
14
14
|
export declare function getWorkingTreeStatus(repoDir: string): Promise<GitStatusEntry[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Resolves the per-directory expansion cap, honoring the same
|
|
17
|
+
* FIREFORGE_MAX_UNTRACKED_FILES override the status command documents.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveMaxUntrackedFilesPerDir(): number;
|
|
15
20
|
/**
|
|
16
21
|
* Expands collapsed untracked directory entries into individual file entries.
|
|
17
22
|
* Git status may report "?? dir/" instead of listing each file underneath.
|
|
23
|
+
*
|
|
24
|
+
* Expansion is capped per directory (FIREFORGE_MAX_UNTRACKED_FILES, default
|
|
25
|
+
* 5000) with a warning on overflow. The cap used to exist only in the
|
|
26
|
+
* status command's private expander; this shared one — used by reset,
|
|
27
|
+
* discard, verify, lint, export-all — was unbounded, so e.g. `reset
|
|
28
|
+
* --dry-run` after an interrupted download (unborn HEAD, the entire ~300k
|
|
29
|
+
* file tree untracked) enumerated and printed every file.
|
|
30
|
+
*
|
|
18
31
|
* @param repoDir - Repository directory
|
|
19
32
|
* @param entries - Parsed status entries
|
|
20
33
|
* @returns Status entries with untracked directories expanded to individual files
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EUPL-1.2
|
|
2
|
+
import { warn } from '../utils/logger.js';
|
|
1
3
|
import { ensureGit, git } from './git-base.js';
|
|
2
4
|
/**
|
|
3
5
|
* Parses NUL-delimited porcelain status output.
|
|
@@ -43,22 +45,51 @@ export async function getWorkingTreeStatus(repoDir) {
|
|
|
43
45
|
await ensureGit();
|
|
44
46
|
return parsePorcelainStatus(await git(['status', '--porcelain=v1', '-z'], repoDir));
|
|
45
47
|
}
|
|
48
|
+
/** Default per-directory cap for untracked-directory expansion. */
|
|
49
|
+
const DEFAULT_MAX_UNTRACKED_FILES_PER_DIR = 5000;
|
|
50
|
+
/**
|
|
51
|
+
* Resolves the per-directory expansion cap, honoring the same
|
|
52
|
+
* FIREFORGE_MAX_UNTRACKED_FILES override the status command documents.
|
|
53
|
+
*/
|
|
54
|
+
export function resolveMaxUntrackedFilesPerDir() {
|
|
55
|
+
const raw = process.env['FIREFORGE_MAX_UNTRACKED_FILES'];
|
|
56
|
+
if (raw === undefined || raw.length === 0)
|
|
57
|
+
return DEFAULT_MAX_UNTRACKED_FILES_PER_DIR;
|
|
58
|
+
const parsed = Number.parseInt(raw, 10);
|
|
59
|
+
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
60
|
+
warn(`Ignoring FIREFORGE_MAX_UNTRACKED_FILES="${raw}" — expected a positive integer. Falling back to ${String(DEFAULT_MAX_UNTRACKED_FILES_PER_DIR)}.`);
|
|
61
|
+
return DEFAULT_MAX_UNTRACKED_FILES_PER_DIR;
|
|
62
|
+
}
|
|
63
|
+
return parsed;
|
|
64
|
+
}
|
|
46
65
|
/**
|
|
47
66
|
* Expands collapsed untracked directory entries into individual file entries.
|
|
48
67
|
* Git status may report "?? dir/" instead of listing each file underneath.
|
|
68
|
+
*
|
|
69
|
+
* Expansion is capped per directory (FIREFORGE_MAX_UNTRACKED_FILES, default
|
|
70
|
+
* 5000) with a warning on overflow. The cap used to exist only in the
|
|
71
|
+
* status command's private expander; this shared one — used by reset,
|
|
72
|
+
* discard, verify, lint, export-all — was unbounded, so e.g. `reset
|
|
73
|
+
* --dry-run` after an interrupted download (unborn HEAD, the entire ~300k
|
|
74
|
+
* file tree untracked) enumerated and printed every file.
|
|
75
|
+
*
|
|
49
76
|
* @param repoDir - Repository directory
|
|
50
77
|
* @param entries - Parsed status entries
|
|
51
78
|
* @returns Status entries with untracked directories expanded to individual files
|
|
52
79
|
*/
|
|
53
80
|
export async function expandUntrackedDirectoryEntries(repoDir, entries) {
|
|
54
81
|
const expanded = [];
|
|
82
|
+
const maxPerDir = resolveMaxUntrackedFilesPerDir();
|
|
55
83
|
for (const entry of entries) {
|
|
56
84
|
if (!entry.isUntracked || !entry.file.endsWith('/')) {
|
|
57
85
|
expanded.push(entry);
|
|
58
86
|
continue;
|
|
59
87
|
}
|
|
60
88
|
const individualFiles = await getUntrackedFilesInDir(repoDir, entry.file);
|
|
61
|
-
|
|
89
|
+
if (individualFiles.length > maxPerDir) {
|
|
90
|
+
warn(`Untracked directory ${entry.file} contains ${String(individualFiles.length)} files — only the first ${String(maxPerDir)} are listed. Add a .gitignore entry or clean the directory.`);
|
|
91
|
+
}
|
|
92
|
+
for (const file of individualFiles.slice(0, maxPerDir)) {
|
|
62
93
|
expanded.push({
|
|
63
94
|
status: '??',
|
|
64
95
|
indexStatus: '?',
|
|
@@ -125,4 +156,3 @@ export async function getDirtyFiles(repoDir, files) {
|
|
|
125
156
|
const untracked = untrackedOutput.split('\n').filter((line) => line.trim().length > 0);
|
|
126
157
|
return [...new Set([...tracked, ...untracked])].sort();
|
|
127
158
|
}
|
|
128
|
-
//# sourceMappingURL=git-status.js.map
|
package/dist/src/core/git.d.ts
CHANGED
|
@@ -53,12 +53,21 @@ export declare function applyPatch(patchPath: string, repoDir: string, options?:
|
|
|
53
53
|
* Applies a patch idempotently using reverse-forward pattern.
|
|
54
54
|
* First tries to reverse the patch (in case it's already applied),
|
|
55
55
|
* then applies it forward.
|
|
56
|
+
*
|
|
56
57
|
* @param patchPath - Path to the patch file
|
|
57
58
|
* @param repoDir - Repository directory
|
|
58
|
-
* @param options -
|
|
59
|
+
* @param options.reject - Fall back to `git apply --reject`
|
|
60
|
+
* @param options.protectedFiles - Files that must NOT be reset to HEAD by
|
|
61
|
+
* the recovery step. Callers applying a patch QUEUE pass the files
|
|
62
|
+
* already touched by previously applied patches in the same run: two
|
|
63
|
+
* overlapping patches (an `--allow-overlap` queue) share files, and the
|
|
64
|
+
* blanket `checkout HEAD` used to wipe the earlier patch's changes from
|
|
65
|
+
* the shared file before applying the later one — leaving the engine in
|
|
66
|
+
* a hybrid state the summary never described.
|
|
59
67
|
*/
|
|
60
68
|
export declare function applyPatchIdempotent(patchPath: string, repoDir: string, options?: {
|
|
61
69
|
reject?: boolean;
|
|
70
|
+
protectedFiles?: ReadonlySet<string>;
|
|
62
71
|
}): Promise<void>;
|
|
63
72
|
/**
|
|
64
73
|
* Reverses a previously applied patch.
|
package/dist/src/core/git.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// SPDX-License-Identifier: EUPL-1.2
|
|
2
2
|
import { readdir, stat } from 'node:fs/promises';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
+
import { ExecTimeoutError } from '../errors/base.js';
|
|
4
5
|
import { GitError, GitIndexingTimeoutError, GitIndexLockError, PatchApplyError, } from '../errors/git.js';
|
|
5
6
|
import { elapsedSince } from '../utils/elapsed.js';
|
|
6
7
|
import { toError } from '../utils/errors.js';
|
|
7
|
-
import { pathExists, removeFile } from '../utils/fs.js';
|
|
8
|
+
import { pathExists, pathExistsStrict, removeFile } from '../utils/fs.js';
|
|
8
9
|
import { verbose } from '../utils/logger.js';
|
|
9
10
|
import { exec } from '../utils/process.js';
|
|
10
11
|
import { ensureFirefoxIgnorefileCompatibility } from './firefox-ignorefile.js';
|
|
11
|
-
import { configureGitPerformance, ensureGit, git, GIT_ADD_CHUNK_TIMEOUT_ENV_VAR, GIT_ADD_CHUNK_TIMEOUT_MS, GIT_ADD_TIMEOUT_MS, } from './git-base.js';
|
|
12
|
+
import { chunkPathspecs, configureGitPerformance, ensureGit, git, GIT_ADD_CHUNK_TIMEOUT_ENV_VAR, GIT_ADD_CHUNK_TIMEOUT_MS, GIT_ADD_TIMEOUT_MS, } from './git-base.js';
|
|
12
13
|
import { getWorkingTreeStatus } from './git-status.js';
|
|
13
14
|
// ── Functions that remain in this file ──
|
|
14
15
|
/**
|
|
@@ -18,7 +19,7 @@ import { getWorkingTreeStatus } from './git-status.js';
|
|
|
18
19
|
*/
|
|
19
20
|
export async function isGitRepository(dir) {
|
|
20
21
|
const gitDir = join(dir, '.git');
|
|
21
|
-
return
|
|
22
|
+
return pathExistsStrict(gitDir);
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
24
25
|
* Ensures the repository has an "origin" remote.
|
|
@@ -47,6 +48,11 @@ const GIT_ADD_ENV = { GIT_INDEX_THREADS: '0' };
|
|
|
47
48
|
* detection here needs to recognise that shape too.
|
|
48
49
|
*/
|
|
49
50
|
function isTimeoutError(error) {
|
|
51
|
+
// `exec` now rejects with a typed ExecTimeoutError when its `timeout`
|
|
52
|
+
// option fires (the raw AbortError check below is kept for defence in
|
|
53
|
+
// depth against other abort paths).
|
|
54
|
+
if (error instanceof ExecTimeoutError)
|
|
55
|
+
return true;
|
|
50
56
|
if (error instanceof Error && error.name === 'AbortError')
|
|
51
57
|
return true;
|
|
52
58
|
if (!(error instanceof GitError))
|
|
@@ -410,9 +416,17 @@ export async function applyPatch(patchPath, repoDir, options = {}) {
|
|
|
410
416
|
* Applies a patch idempotently using reverse-forward pattern.
|
|
411
417
|
* First tries to reverse the patch (in case it's already applied),
|
|
412
418
|
* then applies it forward.
|
|
419
|
+
*
|
|
413
420
|
* @param patchPath - Path to the patch file
|
|
414
421
|
* @param repoDir - Repository directory
|
|
415
|
-
* @param options -
|
|
422
|
+
* @param options.reject - Fall back to `git apply --reject`
|
|
423
|
+
* @param options.protectedFiles - Files that must NOT be reset to HEAD by
|
|
424
|
+
* the recovery step. Callers applying a patch QUEUE pass the files
|
|
425
|
+
* already touched by previously applied patches in the same run: two
|
|
426
|
+
* overlapping patches (an `--allow-overlap` queue) share files, and the
|
|
427
|
+
* blanket `checkout HEAD` used to wipe the earlier patch's changes from
|
|
428
|
+
* the shared file before applying the later one — leaving the engine in
|
|
429
|
+
* a hybrid state the summary never described.
|
|
416
430
|
*/
|
|
417
431
|
export async function applyPatchIdempotent(patchPath, repoDir, options = {}) {
|
|
418
432
|
await ensureGit();
|
|
@@ -428,15 +442,59 @@ export async function applyPatchIdempotent(patchPath, repoDir, options = {}) {
|
|
|
428
442
|
const touchedFiles = listResult.stdout
|
|
429
443
|
.split('\n')
|
|
430
444
|
.map((line) => line.split('\t')[2])
|
|
431
|
-
.filter((f) => !!f)
|
|
445
|
+
.filter((f) => !!f)
|
|
446
|
+
.filter((f) => !(options.protectedFiles?.has(f) ?? false));
|
|
432
447
|
if (touchedFiles.length > 0) {
|
|
433
|
-
|
|
434
|
-
await exec('git', ['checkout', 'HEAD', '--', ...touchedFiles], { cwd: repoDir });
|
|
448
|
+
await restoreFilesToHead(repoDir, patchPath, touchedFiles);
|
|
435
449
|
}
|
|
436
450
|
}
|
|
437
451
|
// Apply forward
|
|
438
452
|
await applyPatch(patchPath, repoDir, options);
|
|
439
453
|
}
|
|
454
|
+
/**
|
|
455
|
+
* Restores `files` to their HEAD state, deleting files the patch would
|
|
456
|
+
* CREATE (present on disk from a partial apply but absent in HEAD — for
|
|
457
|
+
* those, `git checkout HEAD --` fails, and the historical code ignored
|
|
458
|
+
* that failure entirely, leaving stray files that made the subsequent
|
|
459
|
+
* forward apply die with "already exists" and no hint why).
|
|
460
|
+
*
|
|
461
|
+
* Every git invocation is chunked via {@link chunkPathspecs} so a very
|
|
462
|
+
* large patch cannot hit `E2BIG`, and every exit code is checked — a
|
|
463
|
+
* silent failed restore is precisely the confusing state this recovery
|
|
464
|
+
* step exists to prevent.
|
|
465
|
+
*/
|
|
466
|
+
async function restoreFilesToHead(repoDir, patchPath, files) {
|
|
467
|
+
// Partition into tracked-in-HEAD (restore via checkout) and absent-in-HEAD
|
|
468
|
+
// (patch-created leftovers: delete from the worktree).
|
|
469
|
+
const trackedInHead = new Set();
|
|
470
|
+
for (const chunk of chunkPathspecs(files)) {
|
|
471
|
+
const lsTree = await exec('git', ['ls-tree', '-r', '--name-only', 'HEAD', '--', ...chunk], {
|
|
472
|
+
cwd: repoDir,
|
|
473
|
+
});
|
|
474
|
+
if (lsTree.exitCode !== 0) {
|
|
475
|
+
throw new PatchApplyError(patchPath, new Error(`git ls-tree failed while preparing recovery: ${lsTree.stderr.trim()}`));
|
|
476
|
+
}
|
|
477
|
+
for (const line of lsTree.stdout.split('\n')) {
|
|
478
|
+
if (line.length > 0)
|
|
479
|
+
trackedInHead.add(line);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
const toCheckout = files.filter((f) => trackedInHead.has(f));
|
|
483
|
+
const toDelete = files.filter((f) => !trackedInHead.has(f));
|
|
484
|
+
for (const chunk of chunkPathspecs(toCheckout)) {
|
|
485
|
+
const checkout = await exec('git', ['checkout', 'HEAD', '--', ...chunk], { cwd: repoDir });
|
|
486
|
+
if (checkout.exitCode !== 0) {
|
|
487
|
+
throw new PatchApplyError(patchPath, new Error(`Could not restore patch-touched files to HEAD before applying: ${checkout.stderr.trim()}`));
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
for (const file of toDelete) {
|
|
491
|
+
const target = join(repoDir, file);
|
|
492
|
+
if (await pathExists(target)) {
|
|
493
|
+
await removeFile(target);
|
|
494
|
+
verbose(`Removed stray patch-created file before apply: ${file}`);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
440
498
|
/**
|
|
441
499
|
* Reverses a previously applied patch.
|
|
442
500
|
* @param patchPath - Path to the patch file
|
|
@@ -524,4 +582,3 @@ export async function getStatusWithCodes(repoDir) {
|
|
|
524
582
|
file: entry.file,
|
|
525
583
|
}));
|
|
526
584
|
}
|
|
527
|
-
//# sourceMappingURL=git.js.map
|
|
@@ -38,6 +38,22 @@ export declare function getLicenseHeader(license: ProjectLicense, style: Comment
|
|
|
38
38
|
* @param style - Comment syntax of the file
|
|
39
39
|
*/
|
|
40
40
|
export declare function hasAnyLicenseHeader(content: string, style: CommentStyle): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Returns true if `content` starts with the verbatim upstream Mozilla
|
|
43
|
+
* MPL-2.0 block header (`/* This Source Code Form … *\/`), optionally
|
|
44
|
+
* preceded by editor-directive comments — the exact shape a JS file
|
|
45
|
+
* copied from the Firefox source tree carries.
|
|
46
|
+
*
|
|
47
|
+
* Deliberately independent of the project license: a new JS file that
|
|
48
|
+
* legitimately keeps its upstream MPL block header (copied-from-upstream
|
|
49
|
+
* provenance) is valid in an EUPL/GPL/0BSD project too. Before 0.35.0
|
|
50
|
+
* this acceptance only existed behind a `license === 'MPL-2.0'` gate in
|
|
51
|
+
* patch-lint, making it dead code for every other project license and
|
|
52
|
+
* forcing repo-side audit workarounds.
|
|
53
|
+
*
|
|
54
|
+
* @param content - File content to check
|
|
55
|
+
*/
|
|
56
|
+
export declare function hasUpstreamMplBlockHeader(content: string): boolean;
|
|
41
57
|
/**
|
|
42
58
|
* Returns true if `content` starts with any known license header in any
|
|
43
59
|
* comment style (js, css, hash).
|
|
@@ -119,6 +119,25 @@ export function hasAnyLicenseHeader(content, style) {
|
|
|
119
119
|
}
|
|
120
120
|
return false;
|
|
121
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Returns true if `content` starts with the verbatim upstream Mozilla
|
|
124
|
+
* MPL-2.0 block header (`/* This Source Code Form … *\/`), optionally
|
|
125
|
+
* preceded by editor-directive comments — the exact shape a JS file
|
|
126
|
+
* copied from the Firefox source tree carries.
|
|
127
|
+
*
|
|
128
|
+
* Deliberately independent of the project license: a new JS file that
|
|
129
|
+
* legitimately keeps its upstream MPL block header (copied-from-upstream
|
|
130
|
+
* provenance) is valid in an EUPL/GPL/0BSD project too. Before 0.35.0
|
|
131
|
+
* this acceptance only existed behind a `license === 'MPL-2.0'` gate in
|
|
132
|
+
* patch-lint, making it dead code for every other project license and
|
|
133
|
+
* forcing repo-side audit workarounds.
|
|
134
|
+
*
|
|
135
|
+
* @param content - File content to check
|
|
136
|
+
*/
|
|
137
|
+
export function hasUpstreamMplBlockHeader(content) {
|
|
138
|
+
const blockHeader = getLicenseHeader('MPL-2.0', 'css');
|
|
139
|
+
return (content.startsWith(blockHeader) || stripLeadingEditorDirectives(content).startsWith(blockHeader));
|
|
140
|
+
}
|
|
122
141
|
/**
|
|
123
142
|
* Returns true if `content` starts with any known license header in any
|
|
124
143
|
* comment style (js, css, hash).
|
|
@@ -174,4 +193,3 @@ export async function addLicenseHeaderToFile(filePath, license, style) {
|
|
|
174
193
|
await writeText(filePath, header + '\n' + content);
|
|
175
194
|
return true;
|
|
176
195
|
}
|
|
177
|
-
//# sourceMappingURL=license-headers.js.map
|
|
@@ -56,6 +56,33 @@ export const MACH_ERROR_HINTS = [
|
|
|
56
56
|
'remove any `pub type basic_string___self_view = …<_CharT>;` line from ' +
|
|
57
57
|
'`<objdir>/release/build/gecko-profiler-*/out/gecko/bindings.rs`.',
|
|
58
58
|
},
|
|
59
|
+
{
|
|
60
|
+
// Firefox declares per-release toolchain minimums in-tree
|
|
61
|
+
// (`build/moz.configure/bindgen.configure` for cbindgen; mozboot's
|
|
62
|
+
// MINIMUM_RUST_VERSION for rustc/cargo), and a source hop can move
|
|
63
|
+
// them. The 152.0b7 → 153.0b8 source-refresh drill hit exactly this:
|
|
64
|
+
// the first post-hop build died ~8s into `mach configure` with
|
|
65
|
+
// "ERROR: cbindgen version 0.29.1 is too old. At least version
|
|
66
|
+
// 0.29.4 is required." — and mach's own remediation text names
|
|
67
|
+
// "./mach bootstrap", the wrong entry point for a FireForge-managed
|
|
68
|
+
// repo. Pattern matches configure's cbindgen die() shape.
|
|
69
|
+
pattern: /\bversion [\d.]+ is too old\.?\s+At least version [\d.]+ is required/i,
|
|
70
|
+
hint: 'A toolchain component is older than the minimum this Firefox source declares — typical ' +
|
|
71
|
+
'after "fireforge download --force" moved the engine to a new Firefox major version. ' +
|
|
72
|
+
'Run "fireforge bootstrap" (not mach\'s suggested "./mach bootstrap") to update the ' +
|
|
73
|
+
'toolchain, then retry the build.',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
// Same family, rust.configure's die() shapes: "Rust compiler {v} is
|
|
77
|
+
// too old." / "Cargo package manager {v} is too old." — the minimum
|
|
78
|
+
// is only named further down that message, so the pattern keys on
|
|
79
|
+
// the first line.
|
|
80
|
+
pattern: /\b(?:Rust compiler|Cargo package manager) [\d.]+(?:[\w.-]*)? is too old/i,
|
|
81
|
+
hint: "The Rust toolchain is older than the minimum this Firefox source declares (mozboot's " +
|
|
82
|
+
'MINIMUM_RUST_VERSION) — typical after "fireforge download --force" moved the engine to a ' +
|
|
83
|
+
'new Firefox major version. Run "fireforge bootstrap" to update the toolchain, then retry ' +
|
|
84
|
+
'the build.',
|
|
85
|
+
},
|
|
59
86
|
{
|
|
60
87
|
// When `mach build` fails mid-compile, mach's own shutdown pipeline still
|
|
61
88
|
// runs its trailing "Config object not found by mach. / Configure
|
|
@@ -93,4 +120,3 @@ export function explainMachError(stderr) {
|
|
|
93
120
|
}
|
|
94
121
|
return hits;
|
|
95
122
|
}
|
|
96
|
-
//# sourceMappingURL=mach-error-hints.js.map
|
|
@@ -113,4 +113,3 @@ export async function generateMozconfig(configsDir, engineDir, config) {
|
|
|
113
113
|
// the single source of truth for both the render and the sanity-check.
|
|
114
114
|
await assertBrandingMozconfigAgreement(engineDir, outputPath, config);
|
|
115
115
|
}
|
|
116
|
-
//# sourceMappingURL=mach-mozconfig.js.map
|
package/dist/src/core/mach.js
CHANGED