@hominis/fireforge 0.49.2 → 0.51.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 +87 -1
- package/README.md +1 -1
- package/dist/bin/fireforge.js +6 -0
- package/dist/build-info.json +4 -4
- package/dist/src/commands/build-prelock.d.ts +20 -0
- package/dist/src/commands/build-prelock.js +50 -0
- package/dist/src/commands/build.d.ts +3 -1
- package/dist/src/commands/build.js +13 -6
- package/dist/src/commands/check-report.d.ts +41 -0
- package/dist/src/commands/check-report.js +91 -0
- package/dist/src/commands/check-run.d.ts +33 -0
- package/dist/src/commands/check-run.js +112 -0
- package/dist/src/commands/check-steps.d.ts +75 -0
- package/dist/src/commands/check-steps.js +200 -0
- package/dist/src/commands/check.d.ts +32 -0
- package/dist/src/commands/check.js +160 -0
- package/dist/src/commands/config.js +5 -6
- package/dist/src/commands/declarations-report.d.ts +43 -0
- package/dist/src/commands/declarations-report.js +76 -0
- package/dist/src/commands/doctor-engine-eslint.js +6 -1
- package/dist/src/commands/doctor-source-pin.js +4 -1
- package/dist/src/commands/export-adopt-check.d.ts +38 -0
- package/dist/src/commands/export-adopt-check.js +98 -0
- package/dist/src/commands/export-flow.js +29 -14
- package/dist/src/commands/export-placement-gate.d.ts +6 -2
- package/dist/src/commands/export-placement-gate.js +8 -0
- package/dist/src/commands/export-shared.d.ts +2 -1
- package/dist/src/commands/export-staged-registration.d.ts +46 -0
- package/dist/src/commands/export-staged-registration.js +91 -0
- package/dist/src/commands/forward-import-remedy.d.ts +32 -0
- package/dist/src/commands/forward-import-remedy.js +63 -0
- package/dist/src/commands/furnace/apply.js +3 -3
- package/dist/src/commands/furnace/chrome-doc-remove.d.ts +2 -1
- package/dist/src/commands/furnace/chrome-doc-remove.js +2 -2
- package/dist/src/commands/furnace/chrome-doc.d.ts +2 -1
- package/dist/src/commands/furnace/chrome-doc.js +2 -2
- package/dist/src/commands/furnace/create.js +2 -2
- package/dist/src/commands/furnace/deploy-named.d.ts +48 -0
- package/dist/src/commands/furnace/deploy-named.js +107 -0
- package/dist/src/commands/furnace/deploy.d.ts +3 -2
- package/dist/src/commands/furnace/deploy.js +50 -86
- package/dist/src/commands/furnace/diff.js +26 -3
- package/dist/src/commands/furnace/index.js +66 -41
- package/dist/src/commands/furnace/init.js +13 -6
- package/dist/src/commands/furnace/override.js +4 -2
- package/dist/src/commands/furnace/preview.js +4 -3
- package/dist/src/commands/furnace/refresh.js +2 -2
- package/dist/src/commands/furnace/remove.js +4 -3
- package/dist/src/commands/furnace/rename-dry-run.d.ts +29 -0
- package/dist/src/commands/furnace/rename-dry-run.js +127 -0
- package/dist/src/commands/furnace/rename-helpers.d.ts +7 -0
- package/dist/src/commands/furnace/rename-helpers.js +15 -1
- package/dist/src/commands/furnace/rename-registrations.d.ts +41 -0
- package/dist/src/commands/furnace/rename-registrations.js +98 -0
- package/dist/src/commands/furnace/rename.d.ts +2 -1
- package/dist/src/commands/furnace/rename.js +28 -66
- package/dist/src/commands/furnace/scan.d.ts +9 -4
- package/dist/src/commands/furnace/scan.js +11 -9
- package/dist/src/commands/furnace/sync.js +3 -2
- package/dist/src/commands/furnace/validate-report.d.ts +45 -0
- package/dist/src/commands/furnace/validate-report.js +91 -0
- package/dist/src/commands/furnace/validate.d.ts +1 -1
- package/dist/src/commands/furnace/validate.js +151 -113
- package/dist/src/commands/furnace/validation-output.js +14 -3
- package/dist/src/commands/lint-per-patch.js +36 -61
- package/dist/src/commands/lint-per-run-checkjs.js +2 -2
- package/dist/src/commands/lint-report.d.ts +8 -4
- package/dist/src/commands/lint-report.js +20 -5
- package/dist/src/commands/lint.js +15 -34
- package/dist/src/commands/manifest.js +4 -0
- package/dist/src/commands/park.d.ts +22 -0
- package/dist/src/commands/park.js +232 -0
- package/dist/src/commands/patch/delete-gap-notice.js +3 -1
- package/dist/src/commands/patch/delete.d.ts +1 -1
- package/dist/src/commands/patch/delete.js +24 -104
- package/dist/src/commands/patch/index.d.ts +3 -3
- package/dist/src/commands/patch/index.js +10 -4
- package/dist/src/commands/patch/lint-ignore-from.d.ts +44 -0
- package/dist/src/commands/patch/lint-ignore-from.js +142 -0
- package/dist/src/commands/patch/lint-ignore.d.ts +5 -1
- package/dist/src/commands/patch/lint-ignore.js +78 -31
- package/dist/src/commands/patch/move-files-create.js +34 -18
- package/dist/src/commands/patch/move-files-into.js +15 -7
- package/dist/src/commands/patch/move-files.js +6 -2
- package/dist/src/commands/patch/removal-created-files.d.ts +48 -0
- package/dist/src/commands/patch/removal-created-files.js +83 -0
- package/dist/src/commands/patch/removal-dependents.d.ts +63 -0
- package/dist/src/commands/patch/removal-dependents.js +133 -0
- package/dist/src/commands/patch/rename.js +20 -1
- package/dist/src/commands/patch/reserve.d.ts +33 -0
- package/dist/src/commands/patch/reserve.js +152 -0
- package/dist/src/commands/patch/retire.d.ts +34 -0
- package/dist/src/commands/patch/retire.js +133 -0
- package/dist/src/commands/patch/split-plan.d.ts +17 -8
- package/dist/src/commands/patch/split-plan.js +60 -28
- package/dist/src/commands/patch/split-staged.d.ts +108 -0
- package/dist/src/commands/patch/split-staged.js +202 -0
- package/dist/src/commands/patch/split.d.ts +5 -0
- package/dist/src/commands/patch/split.js +62 -17
- package/dist/src/commands/patch/stage.d.ts +34 -0
- package/dist/src/commands/patch/stage.js +153 -0
- package/dist/src/commands/patch/staged-dependency-batch.d.ts +48 -0
- package/dist/src/commands/patch/staged-dependency-batch.js +176 -0
- package/dist/src/commands/patch/staged-dependency-entries.d.ts +36 -0
- package/dist/src/commands/patch/staged-dependency-entries.js +52 -0
- package/dist/src/commands/patch/staged-dependency-from.d.ts +14 -0
- package/dist/src/commands/patch/staged-dependency-from.js +108 -0
- package/dist/src/commands/patch/staged-dependency-remove.d.ts +31 -0
- package/dist/src/commands/patch/staged-dependency-remove.js +80 -0
- package/dist/src/commands/patch/staged-dependency.js +54 -139
- package/dist/src/commands/re-export-adjacent-registrations.d.ts +20 -0
- package/dist/src/commands/re-export-adjacent-registrations.js +75 -0
- package/dist/src/commands/re-export-adjacent.d.ts +50 -2
- package/dist/src/commands/re-export-adjacent.js +160 -40
- package/dist/src/commands/re-export-bulk-scan.d.ts +2 -1
- package/dist/src/commands/re-export-bulk-scan.js +22 -7
- package/dist/src/commands/re-export-drift.d.ts +36 -8
- package/dist/src/commands/re-export-drift.js +73 -49
- package/dist/src/commands/re-export-files.js +11 -8
- package/dist/src/commands/re-export-hunks.d.ts +35 -0
- package/dist/src/commands/re-export-hunks.js +220 -0
- package/dist/src/commands/re-export-lint.d.ts +2 -1
- package/dist/src/commands/re-export-lint.js +23 -10
- package/dist/src/commands/re-export-options.js +74 -6
- package/dist/src/commands/re-export-preflight.d.ts +23 -0
- package/dist/src/commands/re-export-preflight.js +160 -0
- package/dist/src/commands/re-export-purity-scope.d.ts +18 -0
- package/dist/src/commands/re-export-purity-scope.js +131 -0
- package/dist/src/commands/re-export-register.js +56 -17
- package/dist/src/commands/re-export-removed.d.ts +13 -2
- package/dist/src/commands/re-export-removed.js +57 -12
- package/dist/src/commands/re-export-scan-owner.d.ts +44 -0
- package/dist/src/commands/re-export-scan-owner.js +116 -0
- package/dist/src/commands/re-export-scan.d.ts +19 -9
- package/dist/src/commands/re-export-scan.js +60 -24
- package/dist/src/commands/re-export-single.js +122 -46
- package/dist/src/commands/re-export-stale-registrations.d.ts +18 -0
- package/dist/src/commands/re-export-stale-registrations.js +62 -0
- package/dist/src/commands/re-export-summary.d.ts +28 -0
- package/dist/src/commands/re-export-summary.js +36 -0
- package/dist/src/commands/re-export.js +71 -57
- package/dist/src/commands/rebase/index.js +17 -17
- package/dist/src/commands/run.js +16 -2
- package/dist/src/commands/status-check.d.ts +55 -16
- package/dist/src/commands/status-check.js +92 -37
- package/dist/src/commands/status-json.d.ts +22 -9
- package/dist/src/commands/status-json.js +47 -32
- package/dist/src/commands/status-output.js +3 -1
- package/dist/src/commands/status-scope.d.ts +37 -0
- package/dist/src/commands/status-scope.js +54 -0
- package/dist/src/commands/status.js +66 -23
- package/dist/src/commands/test-browser-preflight.js +19 -3
- package/dist/src/commands/test-build-furnace.d.ts +22 -0
- package/dist/src/commands/test-build-furnace.js +54 -0
- package/dist/src/commands/test-build-phase.js +64 -41
- package/dist/src/commands/test-checkjs.js +10 -2
- package/dist/src/commands/test-diagnose.js +7 -0
- package/dist/src/commands/test-dispatch.d.ts +39 -0
- package/dist/src/commands/test-dispatch.js +211 -0
- package/dist/src/commands/test-furnace-reach.d.ts +37 -0
- package/dist/src/commands/test-furnace-reach.js +132 -0
- package/dist/src/commands/test-modes.d.ts +16 -1
- package/dist/src/commands/test-modes.js +24 -1
- package/dist/src/commands/test-multi-verdict.d.ts +61 -0
- package/dist/src/commands/test-multi-verdict.js +111 -0
- package/dist/src/commands/test-orchestrate.d.ts +52 -0
- package/dist/src/commands/test-orchestrate.js +240 -0
- package/dist/src/commands/test-perf-scope.d.ts +50 -0
- package/dist/src/commands/test-perf-scope.js +138 -0
- package/dist/src/commands/test-prelock.d.ts +51 -0
- package/dist/src/commands/test-prelock.js +273 -0
- package/dist/src/commands/test-register.js +69 -10
- package/dist/src/commands/test-results.d.ts +62 -0
- package/dist/src/commands/test-results.js +62 -0
- package/dist/src/commands/test-run.d.ts +13 -55
- package/dist/src/commands/test-run.js +74 -99
- package/dist/src/commands/test-shards.d.ts +110 -0
- package/dist/src/commands/test-shards.js +255 -0
- package/dist/src/commands/test-stale-gate.d.ts +5 -1
- package/dist/src/commands/test-stale-gate.js +60 -28
- package/dist/src/commands/test-verdict.d.ts +11 -1
- package/dist/src/commands/test-verdict.js +28 -1
- package/dist/src/commands/test.d.ts +6 -1
- package/dist/src/commands/test.js +120 -124
- package/dist/src/commands/token-lint.d.ts +14 -0
- package/dist/src/commands/token-lint.js +151 -0
- package/dist/src/commands/token.js +10 -0
- package/dist/src/commands/verify-scope.d.ts +28 -0
- package/dist/src/commands/verify-scope.js +67 -0
- package/dist/src/commands/verify.d.ts +10 -2
- package/dist/src/commands/verify.js +67 -36
- package/dist/src/core/build-baseline-types.d.ts +46 -0
- package/dist/src/core/build-baseline-validate.js +19 -0
- package/dist/src/core/build-baseline.d.ts +5 -1
- package/dist/src/core/build-baseline.js +3 -1
- package/dist/src/core/build-overwrite-guard.d.ts +50 -0
- package/dist/src/core/build-overwrite-guard.js +84 -4
- package/dist/src/core/build-prepare.d.ts +13 -0
- package/dist/src/core/build-prepare.js +42 -10
- package/dist/src/core/build-run-record.d.ts +74 -0
- package/dist/src/core/build-run-record.js +136 -0
- package/dist/src/core/checkjs-support-heads.d.ts +41 -0
- package/dist/src/core/checkjs-support-heads.js +104 -0
- package/dist/src/core/config-paths.d.ts +2 -2
- package/dist/src/core/config-paths.js +10 -0
- package/dist/src/core/config-validate-check.d.ts +8 -0
- package/dist/src/core/config-validate-check.js +219 -0
- package/dist/src/core/config-validate-file-size.d.ts +9 -6
- package/dist/src/core/config-validate-file-size.js +91 -2
- package/dist/src/core/config-validate-history.d.ts +11 -0
- package/dist/src/core/config-validate-history.js +38 -0
- package/dist/src/core/config-validate-patch-policy.js +100 -0
- package/dist/src/core/config-validate-test-toolchains.js +21 -0
- package/dist/src/core/config-validate-token-scales.d.ts +9 -0
- package/dist/src/core/config-validate-token-scales.js +92 -0
- package/dist/src/core/config-validate.js +20 -5
- package/dist/src/core/config.d.ts +5 -0
- package/dist/src/core/config.js +16 -0
- package/dist/src/core/coverage-dispatch.d.ts +24 -0
- package/dist/src/core/coverage-dispatch.js +44 -0
- package/dist/src/core/coverage-extend.d.ts +70 -45
- package/dist/src/core/coverage-extend.js +199 -144
- package/dist/src/core/coverage-records.d.ts +108 -0
- package/dist/src/core/coverage-records.js +384 -0
- package/dist/src/core/destructive.d.ts +7 -4
- package/dist/src/core/destructive.js +10 -10
- package/dist/src/core/engine-session-lock.d.ts +16 -1
- package/dist/src/core/engine-session-lock.js +38 -10
- package/dist/src/core/export-moved-code-shape.d.ts +49 -11
- package/dist/src/core/export-moved-code-shape.js +135 -44
- package/dist/src/core/file-lock-queue.d.ts +67 -0
- package/dist/src/core/file-lock-queue.js +221 -0
- package/dist/src/core/file-lock-shared.d.ts +57 -0
- package/dist/src/core/file-lock-shared.js +117 -0
- package/dist/src/core/file-lock.d.ts +13 -25
- package/dist/src/core/file-lock.js +163 -140
- package/dist/src/core/furnace-apply-output.d.ts +10 -0
- package/dist/src/core/furnace-apply-output.js +31 -1
- package/dist/src/core/furnace-apply.js +22 -12
- package/dist/src/core/furnace-composed-source.d.ts +76 -0
- package/dist/src/core/furnace-composed-source.js +167 -0
- package/dist/src/core/furnace-config-validate-exceptions.d.ts +16 -0
- package/dist/src/core/furnace-config-validate-exceptions.js +102 -0
- package/dist/src/core/furnace-config-validate.js +14 -0
- package/dist/src/core/furnace-css-fragments.d.ts +10 -0
- package/dist/src/core/furnace-css-fragments.js +26 -0
- package/dist/src/core/furnace-operation.d.ts +3 -3
- package/dist/src/core/furnace-registration-jar-inplace.d.ts +12 -0
- package/dist/src/core/furnace-registration-jar-inplace.js +80 -0
- package/dist/src/core/furnace-registration-remove.d.ts +22 -1
- package/dist/src/core/furnace-registration-remove.js +53 -17
- package/dist/src/core/furnace-registration-rename.d.ts +26 -0
- package/dist/src/core/furnace-registration-rename.js +77 -0
- package/dist/src/core/furnace-registration.d.ts +14 -4
- package/dist/src/core/furnace-registration.js +44 -10
- package/dist/src/core/furnace-staleness.d.ts +7 -0
- package/dist/src/core/furnace-staleness.js +34 -24
- package/dist/src/core/furnace-validate-accessibility.d.ts +8 -4
- package/dist/src/core/furnace-validate-accessibility.js +71 -28
- package/dist/src/core/furnace-validate-exceptions.d.ts +48 -0
- package/dist/src/core/furnace-validate-exceptions.js +80 -0
- package/dist/src/core/furnace-validate-icon-button.d.ts +7 -0
- package/dist/src/core/furnace-validate-icon-button.js +78 -0
- package/dist/src/core/furnace-validate.js +1 -1
- package/dist/src/core/harness-port-fallback.d.ts +60 -0
- package/dist/src/core/harness-port-fallback.js +96 -0
- package/dist/src/core/history-log-file.d.ts +61 -0
- package/dist/src/core/history-log-file.js +164 -0
- package/dist/src/core/history-log.d.ts +2 -1
- package/dist/src/core/history-log.js +2 -1
- package/dist/src/core/json-preserving-edit.d.ts +22 -0
- package/dist/src/core/json-preserving-edit.js +199 -0
- package/dist/src/core/line-prefixer.d.ts +18 -0
- package/dist/src/core/line-prefixer.js +34 -0
- package/dist/src/core/mach.d.ts +7 -0
- package/dist/src/core/mach.js +32 -10
- package/dist/src/core/module-resolution-preflight.d.ts +19 -3
- package/dist/src/core/module-resolution-preflight.js +24 -6
- package/dist/src/core/negative-control-compiled.d.ts +27 -0
- package/dist/src/core/negative-control-compiled.js +73 -0
- package/dist/src/core/negative-control-diff.d.ts +51 -0
- package/dist/src/core/negative-control-diff.js +179 -0
- package/dist/src/core/negative-control.d.ts +150 -0
- package/dist/src/core/negative-control.js +399 -0
- package/dist/src/core/objdir-install-manifests.d.ts +73 -0
- package/dist/src/core/objdir-install-manifests.js +226 -0
- package/dist/src/core/park-store.d.ts +63 -0
- package/dist/src/core/park-store.js +216 -0
- package/dist/src/core/patch-export-update.d.ts +6 -0
- package/dist/src/core/patch-export-update.js +13 -3
- package/dist/src/core/patch-export.d.ts +3 -2
- package/dist/src/core/patch-export.js +22 -16
- package/dist/src/core/patch-files.js +26 -8
- package/dist/src/core/patch-lint-checkjs-any-import.d.ts +39 -0
- package/dist/src/core/patch-lint-checkjs-any-import.js +63 -0
- package/dist/src/core/patch-lint-checkjs-diagnostics.d.ts +17 -0
- package/dist/src/core/patch-lint-checkjs-diagnostics.js +32 -0
- package/dist/src/core/patch-lint-checkjs.d.ts +10 -1
- package/dist/src/core/patch-lint-checkjs.js +20 -13
- package/dist/src/core/patch-lint-code-lines.d.ts +59 -0
- package/dist/src/core/patch-lint-code-lines.js +105 -0
- package/dist/src/core/patch-lint-cross.d.ts +3 -1
- package/dist/src/core/patch-lint-cross.js +17 -4
- package/dist/src/core/patch-lint-css.d.ts +8 -2
- package/dist/src/core/patch-lint-css.js +24 -14
- package/dist/src/core/patch-lint-file-size.d.ts +12 -5
- package/dist/src/core/patch-lint-file-size.js +22 -11
- package/dist/src/core/patch-lint-forward-registration-extended.d.ts +23 -0
- package/dist/src/core/patch-lint-forward-registration-extended.js +36 -11
- package/dist/src/core/patch-lint-forward-registration.js +10 -0
- package/dist/src/core/patch-lint-ignore.d.ts +196 -0
- package/dist/src/core/patch-lint-ignore.js +429 -0
- package/dist/src/core/patch-lint-ownership.d.ts +10 -0
- package/dist/src/core/patch-lint-ownership.js +26 -0
- package/dist/src/core/patch-lint-size-thresholds.d.ts +52 -0
- package/dist/src/core/patch-lint-size-thresholds.js +110 -0
- package/dist/src/core/patch-lint-size.d.ts +117 -0
- package/dist/src/core/patch-lint-size.js +331 -0
- package/dist/src/core/patch-lint-staged-registration.d.ts +18 -1
- package/dist/src/core/patch-lint-staged-registration.js +20 -0
- package/dist/src/core/patch-lint-token-scale.d.ts +57 -0
- package/dist/src/core/patch-lint-token-scale.js +286 -0
- package/dist/src/core/patch-lint.d.ts +11 -83
- package/dist/src/core/patch-lint.js +66 -288
- package/dist/src/core/patch-lock.js +7 -6
- package/dist/src/core/patch-manifest-consistency.js +7 -6
- package/dist/src/core/patch-manifest-io.d.ts +6 -3
- package/dist/src/core/patch-manifest-io.js +27 -9
- package/dist/src/core/patch-manifest-key-order.d.ts +24 -0
- package/dist/src/core/patch-manifest-key-order.js +61 -0
- package/dist/src/core/patch-manifest-stage.d.ts +46 -0
- package/dist/src/core/patch-manifest-stage.js +96 -0
- package/dist/src/core/patch-manifest-validate.js +61 -3
- package/dist/src/core/patch-order-legal.d.ts +26 -0
- package/dist/src/core/patch-order-legal.js +88 -0
- package/dist/src/core/patch-policy-content.d.ts +40 -0
- package/dist/src/core/patch-policy-content.js +216 -0
- package/dist/src/core/patch-policy.d.ts +22 -5
- package/dist/src/core/patch-policy.js +26 -12
- package/dist/src/core/patch-retired.d.ts +57 -0
- package/dist/src/core/patch-retired.js +92 -0
- package/dist/src/core/patch-subset.d.ts +16 -0
- package/dist/src/core/patch-subset.js +66 -0
- package/dist/src/core/preflight-wait.d.ts +20 -0
- package/dist/src/core/preflight-wait.js +38 -0
- package/dist/src/core/rebase-from-version.d.ts +46 -0
- package/dist/src/core/rebase-from-version.js +71 -0
- package/dist/src/core/run-log.d.ts +26 -0
- package/dist/src/core/run-log.js +106 -4
- package/dist/src/core/run-profile.d.ts +7 -0
- package/dist/src/core/run-profile.js +7 -1
- package/dist/src/core/smoke-patterns.d.ts +5 -0
- package/dist/src/core/smoke-patterns.js +13 -0
- package/dist/src/core/test-harness-crash.d.ts +19 -1
- package/dist/src/core/test-harness-crash.js +8 -9
- package/dist/src/core/test-harness-signature.d.ts +33 -0
- package/dist/src/core/test-harness-signature.js +23 -1
- package/dist/src/core/test-raw-log.d.ts +66 -0
- package/dist/src/core/test-raw-log.js +122 -0
- package/dist/src/core/test-run-completeness.d.ts +90 -0
- package/dist/src/core/test-run-completeness.js +184 -0
- package/dist/src/core/test-stale-check.d.ts +27 -1
- package/dist/src/core/test-stale-check.js +39 -49
- package/dist/src/core/test-stale-exempt.d.ts +40 -0
- package/dist/src/core/test-stale-exempt.js +70 -0
- package/dist/src/core/test-xpcshell-retry.d.ts +2 -0
- package/dist/src/core/test-xpcshell-retry.js +2 -1
- package/dist/src/core/token-lint.d.ts +53 -0
- package/dist/src/core/token-lint.js +131 -0
- package/dist/src/core/token-sibling-sheets.d.ts +46 -0
- package/dist/src/core/token-sibling-sheets.js +119 -0
- package/dist/src/core/tree-guard.js +5 -0
- package/dist/src/core/typecheck-shim.d.ts +6 -2
- package/dist/src/core/typecheck-shim.js +205 -4
- package/dist/src/core/typecheck.js +3 -1
- package/dist/src/index.d.ts +14 -3
- package/dist/src/index.js +6 -1
- package/dist/src/types/commands/index.d.ts +2 -2
- package/dist/src/types/commands/options.d.ts +212 -24
- package/dist/src/types/commands/patches.d.ts +118 -1
- package/dist/src/types/config.d.ts +264 -0
- package/dist/src/types/config.js +9 -0
- package/dist/src/types/furnace.d.ts +63 -1
- package/dist/src/types/furnace.js +7 -0
- package/dist/src/types/index.d.ts +1 -1
- package/dist/src/utils/options.d.ts +36 -7
- package/dist/src/utils/options.js +94 -8
- package/dist/src/utils/path-glob.d.ts +15 -0
- package/dist/src/utils/path-glob.js +47 -0
- package/dist/src/utils/regex.d.ts +15 -3
- package/dist/src/utils/regex.js +37 -16
- package/docs/configuration.md +369 -11
- package/docs/exit-codes.md +18 -1
- package/docs/furnace.md +139 -3
- package/docs/lifecycle-invariants.md +65 -30
- package/docs/machine-output.md +120 -12
- package/docs/patch-workflow.md +458 -22
- package/docs/run-logs.md +20 -1
- package/docs/testing.md +346 -21
- package/package.json +3 -3
|
@@ -20,7 +20,8 @@ import { collectNewFileCreatorsByPath } from './patch-lint-creators.js';
|
|
|
20
20
|
import { detectNewFilesInDiff, extractAddedLinesPerFile } from './patch-lint-diff.js';
|
|
21
21
|
import { lintPatchQueueForwardRegistrations } from './patch-lint-forward-registration.js';
|
|
22
22
|
import { lintPatchQueueModuleRegistrations } from './patch-lint-module-registration.js';
|
|
23
|
-
import { describeRegistrationFailure, findStagedRegistrationFailure, isLaterOwner, quoteRegistrationLine, } from './patch-lint-staged-registration.js';
|
|
23
|
+
import { describeRegistrationFailure, findStagedRegistrationFailure, isLaterOwner, quoteRegistrationLine, STAGED_DEPENDENCY_REASON_PLACEHOLDER, stagedDependencyUnusedFingerprint, } from './patch-lint-staged-registration.js';
|
|
24
|
+
import { lintTokenScaleFloors } from './patch-lint-token-scale.js';
|
|
24
25
|
import { loadPatchesManifest } from './patch-manifest-io.js';
|
|
25
26
|
import { categoryRangeForOrder, categoryRangeLabel } from './patch-policy.js';
|
|
26
27
|
import { extractNewFileContentsFromDiff } from './patch-transform.js';
|
|
@@ -88,6 +89,9 @@ export async function buildPatchQueueContext(patchesDir, config) {
|
|
|
88
89
|
...(config?.patchLint?.forwardRegistration !== undefined
|
|
89
90
|
? { forwardRegistration: config.patchLint.forwardRegistration }
|
|
90
91
|
: {}),
|
|
92
|
+
...(config?.patchLint?.tokenScales !== undefined
|
|
93
|
+
? { tokenScales: config.patchLint.tokenScales }
|
|
94
|
+
: {}),
|
|
91
95
|
};
|
|
92
96
|
}
|
|
93
97
|
// The creators map (split out of `lintPatchQueueDuplicateCreations` so
|
|
@@ -493,13 +497,21 @@ export function lintPatchQueueForwardImports(ctx) {
|
|
|
493
497
|
const stagedCommands = laterOwners
|
|
494
498
|
.map((o) => `fireforge patch staged-dependency ${entry.filename} --add ` +
|
|
495
499
|
`--file ${sitePath} --specifier "${specifier}" ` +
|
|
496
|
-
`--creates ${o.fullPath} --owner ${o.filename}`)
|
|
500
|
+
`--creates ${o.fullPath} --owner ${o.filename} ${STAGED_DEPENDENCY_REASON_PLACEHOLDER}`)
|
|
497
501
|
.join('; ');
|
|
498
502
|
issues.push({
|
|
499
503
|
file: sitePath,
|
|
500
504
|
check: 'forward-import',
|
|
501
505
|
patches: [entry.filename],
|
|
502
506
|
fingerprint: `forward-import|${sitePath}|${cleaned}|${fingerprintOwners}`,
|
|
507
|
+
stagedDeclarations: laterOwners.map((o) => ({
|
|
508
|
+
patch: entry.filename,
|
|
509
|
+
kind: 'import',
|
|
510
|
+
file: sitePath,
|
|
511
|
+
specifier,
|
|
512
|
+
creates: o.fullPath,
|
|
513
|
+
owner: o.filename,
|
|
514
|
+
})),
|
|
503
515
|
message: `${sitePath} in ${entry.filename} imports "${specifier}", ` +
|
|
504
516
|
`but the matching new file is created by a later patch: ${ownersSummary}. ` +
|
|
505
517
|
'Reorder the patches so the dependency is created first, move the import ' +
|
|
@@ -518,7 +530,7 @@ export function lintPatchQueueForwardImports(ctx) {
|
|
|
518
530
|
file: dependency.file,
|
|
519
531
|
check: 'staged-dependency-unused',
|
|
520
532
|
patches: [entry.filename],
|
|
521
|
-
fingerprint:
|
|
533
|
+
fingerprint: stagedDependencyUnusedFingerprint(entry.filename, dependency),
|
|
522
534
|
message: `${entry.filename} declares a staged forward import from ${dependency.file} ` +
|
|
523
535
|
`to "${dependency.specifier}" / ${dependency.creates}, but that exact forward dependency was not found. ` +
|
|
524
536
|
'Remove the stale declaration with "fireforge patch staged-dependency --remove" or update it to match the current queue.',
|
|
@@ -541,7 +553,7 @@ export function lintPatchQueueForwardImports(ctx) {
|
|
|
541
553
|
file: registration.file,
|
|
542
554
|
check: 'staged-dependency-unused',
|
|
543
555
|
patches: [entry.filename],
|
|
544
|
-
fingerprint:
|
|
556
|
+
fingerprint: stagedDependencyUnusedFingerprint(entry.filename, registration),
|
|
545
557
|
message: `${entry.filename} declares a staged registration in ${registration.file} ` +
|
|
546
558
|
`("${registration.line}") for ${registration.creates}, but ${describeRegistrationFailure(failure)} ` +
|
|
547
559
|
'Remove the stale declaration with: ' +
|
|
@@ -573,5 +585,6 @@ export function lintPatchQueue(ctx) {
|
|
|
573
585
|
...lintPatchQueueModuleRegistrations(ctx),
|
|
574
586
|
...lintPatchQueueForwardRegistrations(ctx),
|
|
575
587
|
...lintPatchQueueBinaryBodies(ctx),
|
|
588
|
+
...lintTokenScaleFloors(ctx.entries.flatMap((entry) => [...entry.newFiles]), ctx.tokenScales ?? []),
|
|
576
589
|
];
|
|
577
590
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CSS patch-lint rules: introduced raw color values
|
|
3
|
-
* custom-property references.
|
|
2
|
+
* CSS patch-lint rules: introduced raw color values, non-tokenized
|
|
3
|
+
* custom-property references, and (opt-in) token scales over created CSS.
|
|
4
4
|
*
|
|
5
5
|
* Split out of `patch-lint.ts` so each rule family stays within the
|
|
6
6
|
* per-file line budget. `patch-lint.ts` re-exports `lintPatchedCss` so
|
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { PatchLintIssue } from '../types/commands/index.js';
|
|
10
10
|
import type { FireForgeConfig } from '../types/config.js';
|
|
11
|
+
/**
|
|
12
|
+
* Masks CSS block comments with spaces, preserving newlines so line
|
|
13
|
+
* numbers stay stable. An unclosed trailing `/*` is masked to EOF,
|
|
14
|
+
* matching how a CSS parser treats it.
|
|
15
|
+
*/
|
|
16
|
+
export declare function maskCssComments(source: string): string;
|
|
11
17
|
/**
|
|
12
18
|
* Lints patched CSS files for introduced raw color values and non-tokenized
|
|
13
19
|
* custom properties.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: EUPL-1.2
|
|
2
2
|
/**
|
|
3
|
-
* CSS patch-lint rules: introduced raw color values
|
|
4
|
-
* custom-property references.
|
|
3
|
+
* CSS patch-lint rules: introduced raw color values, non-tokenized
|
|
4
|
+
* custom-property references, and (opt-in) token scales over created CSS.
|
|
5
5
|
*
|
|
6
6
|
* Split out of `patch-lint.ts` so each rule family stays within the
|
|
7
7
|
* per-file line budget. `patch-lint.ts` re-exports `lintPatchedCss` so
|
|
@@ -13,7 +13,8 @@ import { pathExists, readText } from '../utils/fs.js';
|
|
|
13
13
|
import { verbose } from '../utils/logger.js';
|
|
14
14
|
import { hasRawCssColors } from '../utils/regex.js';
|
|
15
15
|
import { loadFurnaceConfig } from './furnace-config.js';
|
|
16
|
-
import { extractAddedLineNumbersPerFile, extractAddedLinesPerFile } from './patch-lint-diff.js';
|
|
16
|
+
import { detectNewFilesInDiff, extractAddedLineNumbersPerFile, extractAddedLinesPerFile, } from './patch-lint-diff.js';
|
|
17
|
+
import { lintTokenScales } from './patch-lint-token-scale.js';
|
|
17
18
|
/**
|
|
18
19
|
* Loads the furnace token-prefix lint inputs gracefully. Returns
|
|
19
20
|
* undefined (skipping the token-prefix check) when furnace.json cannot
|
|
@@ -41,17 +42,21 @@ async function loadCssTokenContext(repoDir) {
|
|
|
41
42
|
* numbers stay stable. An unclosed trailing `/*` is masked to EOF,
|
|
42
43
|
* matching how a CSS parser treats it.
|
|
43
44
|
*/
|
|
44
|
-
function maskCssComments(source) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
export function maskCssComments(source) {
|
|
46
|
+
// Linear indexOf scan rather than a lazy `/\*[\s\S]*?\*\/` regex: with
|
|
47
|
+
// many openers and no closer, the regex retries from every `/*` to EOF
|
|
48
|
+
// (quadratic in file size).
|
|
49
|
+
let masked = '';
|
|
50
|
+
let cursor = 0;
|
|
51
|
+
for (;;) {
|
|
52
|
+
const open = source.indexOf('/*', cursor);
|
|
53
|
+
if (open === -1)
|
|
54
|
+
return masked + source.slice(cursor);
|
|
55
|
+
const close = source.indexOf('*/', open + 2);
|
|
56
|
+
const end = close === -1 ? source.length : close + 2;
|
|
57
|
+
masked += source.slice(cursor, open) + source.slice(open, end).replace(/[^\n]/g, ' ');
|
|
58
|
+
cursor = end;
|
|
59
|
+
}
|
|
55
60
|
}
|
|
56
61
|
const RAW_COLOR_IGNORE_MARKER = 'fireforge-ignore: raw-color-value';
|
|
57
62
|
/**
|
|
@@ -197,6 +202,9 @@ export async function lintPatchedCss(repoDir, affectedFiles, diffContent, config
|
|
|
197
202
|
const addedLineNumbersByFile = diffContent
|
|
198
203
|
? extractAddedLineNumbersPerFile(diffContent)
|
|
199
204
|
: undefined;
|
|
205
|
+
// `patchLint.tokenScales` governs only CSS the patch creates.
|
|
206
|
+
const tokenScales = config?.patchLint?.tokenScales ?? [];
|
|
207
|
+
const createdFiles = diffContent && tokenScales.length > 0 ? detectNewFilesInDiff(diffContent) : new Set();
|
|
200
208
|
for (const file of cssFiles) {
|
|
201
209
|
const filePath = join(repoDir, file);
|
|
202
210
|
if (!(await pathExists(filePath)))
|
|
@@ -213,6 +221,8 @@ export async function lintPatchedCss(repoDir, affectedFiles, diffContent, config
|
|
|
213
221
|
issues,
|
|
214
222
|
});
|
|
215
223
|
checkTokenPrefixViolations(file, cssContent, addedLinesByFile, tokenContext, issues);
|
|
224
|
+
if (createdFiles.has(file))
|
|
225
|
+
issues.push(...lintTokenScales(file, rawCss, tokenScales));
|
|
216
226
|
}
|
|
217
227
|
return issues;
|
|
218
228
|
}
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
* lines failed a gate with a message calling 750 soft. The message below
|
|
14
14
|
* says what the band is (a warning) and what a zero-warning gate does with
|
|
15
15
|
* it, and the thresholds are now tunable, so a project whose file-size
|
|
16
|
-
* policy differs has a dial instead of an argument.
|
|
16
|
+
* policy differs has a dial instead of an argument. The notice band is the
|
|
17
|
+
* design target: advisory, and its message says so rather than borrowing
|
|
18
|
+
* the warning band's gate sentence.
|
|
17
19
|
*/
|
|
18
20
|
import type { PatchLintFileSizeThresholds } from '../types/config.js';
|
|
19
21
|
/** A fully resolved threshold triple. */
|
|
@@ -38,14 +40,19 @@ export declare function resolveFileSizeThresholds(overrides: PatchLintFileSizeTh
|
|
|
38
40
|
/**
|
|
39
41
|
* Renders the `file-too-large` message for a given band.
|
|
40
42
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
43
|
+
* Each band says what it means for a gate. A notice is over the design
|
|
44
|
+
* target and advisory: it never fails `--max-warnings 0`, and saying it
|
|
45
|
+
* did once got a test suite split for nothing. A warning is what a
|
|
46
|
+
* zero-warning gate fails on, so it names that and the dial. Only the
|
|
47
|
+
* error band suggests splitting, because a test-file split pushes against
|
|
48
|
+
* one suite per subject and should not be the default advice below it.
|
|
49
|
+
* Every band names the unit, which matters once `fileSizeMetric` makes
|
|
50
|
+
* code lines a choice.
|
|
45
51
|
*/
|
|
46
52
|
export declare function formatFileTooLargeMessage(args: {
|
|
47
53
|
label: string;
|
|
48
54
|
lineCount: number;
|
|
55
|
+
unit: 'lines' | 'code lines';
|
|
49
56
|
thresholds: ResolvedFileSizeTier;
|
|
50
57
|
band: 'notice' | 'warning' | 'error';
|
|
51
58
|
verb: string;
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
* lines failed a gate with a message calling 750 soft. The message below
|
|
15
15
|
* says what the band is (a warning) and what a zero-warning gate does with
|
|
16
16
|
* it, and the thresholds are now tunable, so a project whose file-size
|
|
17
|
-
* policy differs has a dial instead of an argument.
|
|
17
|
+
* policy differs has a dial instead of an argument. The notice band is the
|
|
18
|
+
* design target: advisory, and its message says so rather than borrowing
|
|
19
|
+
* the warning band's gate sentence.
|
|
18
20
|
*/
|
|
19
21
|
/** Built-in defaults, per file class. */
|
|
20
22
|
export const DEFAULT_FILE_SIZE_THRESHOLDS = {
|
|
@@ -36,18 +38,27 @@ export function resolveFileSizeThresholds(overrides, isTest) {
|
|
|
36
38
|
/**
|
|
37
39
|
* Renders the `file-too-large` message for a given band.
|
|
38
40
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
41
|
+
* Each band says what it means for a gate. A notice is over the design
|
|
42
|
+
* target and advisory: it never fails `--max-warnings 0`, and saying it
|
|
43
|
+
* did once got a test suite split for nothing. A warning is what a
|
|
44
|
+
* zero-warning gate fails on, so it names that and the dial. Only the
|
|
45
|
+
* error band suggests splitting, because a test-file split pushes against
|
|
46
|
+
* one suite per subject and should not be the default advice below it.
|
|
47
|
+
* Every band names the unit, which matters once `fileSizeMetric` makes
|
|
48
|
+
* code lines a choice.
|
|
43
49
|
*/
|
|
44
50
|
export function formatFileTooLargeMessage(args) {
|
|
45
|
-
const { label, lineCount, thresholds, band, verb } = args;
|
|
51
|
+
const { label, lineCount, unit, thresholds, band, verb } = args;
|
|
52
|
+
const measured = `${label} has ${lineCount} ${unit}`;
|
|
46
53
|
if (band === 'error') {
|
|
47
|
-
return `${
|
|
54
|
+
return `${measured} (error threshold: ${thresholds.error}). Consider ${verb}.`;
|
|
48
55
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
const limits = `(warning threshold: ${thresholds.warning}, error threshold: ${thresholds.error})`;
|
|
57
|
+
if (band === 'notice') {
|
|
58
|
+
return (`${measured}, over the design target of ${thresholds.notice} ${limits}. ` +
|
|
59
|
+
'Advisory; does not fail --max-warnings 0.');
|
|
60
|
+
}
|
|
61
|
+
return (`${measured} ${limits}. ` +
|
|
62
|
+
'Reported as a warning, which a gate running --max-warnings 0 treats as a failure; ' +
|
|
63
|
+
'tune "patchLint.fileSizeThresholds" if these limits are wrong for this project.');
|
|
53
64
|
}
|
|
@@ -24,6 +24,29 @@ export interface ForwardRegistration {
|
|
|
24
24
|
/** Paste-and-run declaration that records the stage as intentional. */
|
|
25
25
|
command: string;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* jar target → packaged source, over every jar.mn line the queue adds. Only
|
|
29
|
+
* exact (wildcard-free) sources can back a chrome URL lookup.
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildJarTargetIndex(entries: readonly PatchQueueForwardRegistrationEntry[]): Map<string, string>;
|
|
32
|
+
/** True for a jar.mn, moz.build or test manifest, the carriers {@link resolveCarrierReferences} reads. */
|
|
33
|
+
export declare function isRegistrationCarrier(file: string): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The engine paths named by the lines of one jar.mn, moz.build or test
|
|
36
|
+
* manifest, resolved the way this rule resolves them. Exported for a caller
|
|
37
|
+
* outside the queue lint (re-export's adjacency belt asks which files a
|
|
38
|
+
* patch's added registration lines name). A `customElements.js` chrome URL
|
|
39
|
+
* resolves only through the queue's jar.mn index, so it is not covered.
|
|
40
|
+
*
|
|
41
|
+
* @param rawPath - Engine-relative path of the carrier
|
|
42
|
+
* @param content - The carrier lines to read (typically the added ones)
|
|
43
|
+
* @returns One entry per resolvable token. `exact` is set when it has no wildcard.
|
|
44
|
+
*/
|
|
45
|
+
export declare function resolveCarrierReferences(rawPath: string, content: string): {
|
|
46
|
+
line: string;
|
|
47
|
+
exact?: string;
|
|
48
|
+
matches: (candidate: string) => boolean;
|
|
49
|
+
}[];
|
|
27
50
|
/** The discharge command, in the exact shape the support-files arm prints. */
|
|
28
51
|
export declare function formatRegistrationDeclaration(patch: string, file: string, line: string, creates: string, owner: string): string;
|
|
29
52
|
/**
|
|
@@ -28,7 +28,7 @@ import { basename, dirname, posix } from 'node:path';
|
|
|
28
28
|
import { normalizePathSlashes } from '../utils/paths.js';
|
|
29
29
|
import { escapeRegex } from '../utils/regex.js';
|
|
30
30
|
import { parseJarMnEntry } from './build-audit-registration.js';
|
|
31
|
-
import { isLaterOwner, quoteRegistrationLine } from './patch-lint-staged-registration.js';
|
|
31
|
+
import { isLaterOwner, quoteRegistrationLine, STAGED_DEPENDENCY_REASON_PLACEHOLDER, } from './patch-lint-staged-registration.js';
|
|
32
32
|
const TEST_MANIFEST_BASENAMES = new Set([
|
|
33
33
|
'xpcshell.toml',
|
|
34
34
|
'xpcshell.ini',
|
|
@@ -116,7 +116,7 @@ function testManifestReferences(file, content) {
|
|
|
116
116
|
* jar target → packaged source, over every jar.mn line the queue adds. Only
|
|
117
117
|
* exact (wildcard-free) sources can back a chrome URL lookup.
|
|
118
118
|
*/
|
|
119
|
-
function buildJarTargetIndex(entries) {
|
|
119
|
+
export function buildJarTargetIndex(entries) {
|
|
120
120
|
const index = new Map();
|
|
121
121
|
for (const entry of entries) {
|
|
122
122
|
for (const [file, content] of [...entry.newFiles, ...entry.modifiedFileAdditions]) {
|
|
@@ -153,20 +153,45 @@ function customElementsReferences(file, content, jarTargets) {
|
|
|
153
153
|
}
|
|
154
154
|
return refs;
|
|
155
155
|
}
|
|
156
|
+
/** True for a jar.mn, moz.build or test manifest, the carriers {@link resolveCarrierReferences} reads. */
|
|
157
|
+
export function isRegistrationCarrier(file) {
|
|
158
|
+
const name = basename(normalizePathSlashes(file));
|
|
159
|
+
return name === 'jar.mn' || name === 'moz.build' || TEST_MANIFEST_BASENAMES.has(name);
|
|
160
|
+
}
|
|
161
|
+
function carrierReferences(file, content) {
|
|
162
|
+
const name = basename(file);
|
|
163
|
+
if (name === 'jar.mn')
|
|
164
|
+
return jarMnReferences(file, content);
|
|
165
|
+
if (name === 'moz.build')
|
|
166
|
+
return mozBuildReferences(file, content);
|
|
167
|
+
if (TEST_MANIFEST_BASENAMES.has(name))
|
|
168
|
+
return testManifestReferences(file, content);
|
|
169
|
+
return [];
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* The engine paths named by the lines of one jar.mn, moz.build or test
|
|
173
|
+
* manifest, resolved the way this rule resolves them. Exported for a caller
|
|
174
|
+
* outside the queue lint (re-export's adjacency belt asks which files a
|
|
175
|
+
* patch's added registration lines name). A `customElements.js` chrome URL
|
|
176
|
+
* resolves only through the queue's jar.mn index, so it is not covered.
|
|
177
|
+
*
|
|
178
|
+
* @param rawPath - Engine-relative path of the carrier
|
|
179
|
+
* @param content - The carrier lines to read (typically the added ones)
|
|
180
|
+
* @returns One entry per resolvable token. `exact` is set when it has no wildcard.
|
|
181
|
+
*/
|
|
182
|
+
export function resolveCarrierReferences(rawPath, content) {
|
|
183
|
+
return carrierReferences(normalizePathSlashes(rawPath), content);
|
|
184
|
+
}
|
|
156
185
|
function referencesFor(entry, jarTargets) {
|
|
157
186
|
const refs = [];
|
|
158
187
|
for (const [rawPath, content] of [...entry.newFiles, ...entry.modifiedFileAdditions]) {
|
|
159
188
|
const file = normalizePathSlashes(rawPath);
|
|
160
|
-
|
|
161
|
-
if (name === 'jar.mn')
|
|
162
|
-
refs.push(...jarMnReferences(file, content));
|
|
163
|
-
else if (name === 'moz.build')
|
|
164
|
-
refs.push(...mozBuildReferences(file, content));
|
|
165
|
-
else if (TEST_MANIFEST_BASENAMES.has(name))
|
|
166
|
-
refs.push(...testManifestReferences(file, content));
|
|
167
|
-
else if (name === 'customElements.js') {
|
|
189
|
+
if (basename(file) === 'customElements.js') {
|
|
168
190
|
refs.push(...customElementsReferences(file, content, jarTargets));
|
|
169
191
|
}
|
|
192
|
+
else {
|
|
193
|
+
refs.push(...carrierReferences(file, content));
|
|
194
|
+
}
|
|
170
195
|
}
|
|
171
196
|
return refs;
|
|
172
197
|
}
|
|
@@ -178,7 +203,7 @@ function isDeclared(entry, file, created) {
|
|
|
178
203
|
export function formatRegistrationDeclaration(patch, file, line, creates, owner) {
|
|
179
204
|
return (`fireforge patch staged-dependency ${patch} --add --kind registration ` +
|
|
180
205
|
`--file ${file} --line "${quoteRegistrationLine(line)}" ` +
|
|
181
|
-
`--creates ${creates} --owner ${owner}`);
|
|
206
|
+
`--creates ${creates} --owner ${owner} ${STAGED_DEPENDENCY_REASON_PLACEHOLDER}`);
|
|
182
207
|
}
|
|
183
208
|
/**
|
|
184
209
|
* Finds every undeclared forward registration in the extended carriers:
|
|
@@ -243,6 +243,16 @@ export function lintPatchQueueForwardRegistrations(ctx) {
|
|
|
243
243
|
check: 'forward-registration',
|
|
244
244
|
patches: [found.patch],
|
|
245
245
|
fingerprint: `forward-registration|${found.patch}|${found.file}|${found.token}|${found.creates}|${found.owner}`,
|
|
246
|
+
stagedDeclarations: [
|
|
247
|
+
{
|
|
248
|
+
patch: found.patch,
|
|
249
|
+
kind: 'registration',
|
|
250
|
+
file: found.file,
|
|
251
|
+
line: found.line,
|
|
252
|
+
creates: found.creates,
|
|
253
|
+
owner: found.owner,
|
|
254
|
+
},
|
|
255
|
+
],
|
|
246
256
|
message: `${found.file} in ${found.patch} registers "${found.token}" ${KIND_PHRASES[found.kind]}, ` +
|
|
247
257
|
`but ${found.creates} is created by the later patch ${found.owner}. ` +
|
|
248
258
|
'Applying the queue up to this patch leaves the registration dangling. ' +
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `PatchMetadata.lintIgnore` entries and the waiver filter they drive.
|
|
3
|
+
*
|
|
4
|
+
* An entry is either a bare check ID, which suppresses that rule at any
|
|
5
|
+
* size, or a ceiling `{ rule, max, reason }`, which suppresses a size rule
|
|
6
|
+
* only while its measurement is at or below `max`. The bare form let a
|
|
7
|
+
* waived file grow without bound: nothing re-examined the waiver once it
|
|
8
|
+
* was written, so a 950-line file waived at review time was still waived at
|
|
9
|
+
* 2,000 lines. The ceiling makes growth past the reviewed size fire again,
|
|
10
|
+
* and lets a gate say when the waiver is no longer needed at all.
|
|
11
|
+
*
|
|
12
|
+
* Its own module so every caller that turns a manifest list into a filter
|
|
13
|
+
* (export, re-export, per-patch and aggregate lint, split, move-files)
|
|
14
|
+
* shares one reading of an entry, and so `patch-lint.ts` only calls into it.
|
|
15
|
+
*/
|
|
16
|
+
import type { LintIgnoreCeiling, LintIgnoreEntry, PatchLintIssue, PatchSizeShare } from '../types/commands/index.js';
|
|
17
|
+
/**
|
|
18
|
+
* The size rules whose findings carry a `measurement`, and therefore the
|
|
19
|
+
* only rules a ceiling can bound. A ceiling on any other rule could never
|
|
20
|
+
* suppress anything, so the manifest validator refuses it.
|
|
21
|
+
*/
|
|
22
|
+
export declare const LINT_IGNORE_CEILING_RULES: readonly string[];
|
|
23
|
+
/**
|
|
24
|
+
* A waiver filter: the bare check IDs as a set (so a plain `Set<string>`
|
|
25
|
+
* still satisfies the type), plus the ceilings keyed by {@link ceilingKey}.
|
|
26
|
+
*
|
|
27
|
+
* Bare IDs and ceilings are kept apart on purpose. A caller that only knows
|
|
28
|
+
* `has()` treats a ceiling-waived rule as not waived, which fails closed.
|
|
29
|
+
*/
|
|
30
|
+
export type LintIgnoreChecks = ReadonlySet<string> & {
|
|
31
|
+
readonly ceilings?: ReadonlyMap<string, LintIgnoreCeiling>;
|
|
32
|
+
};
|
|
33
|
+
/** Narrows an entry to the ceiling form. */
|
|
34
|
+
export declare function isLintIgnoreCeiling(entry: LintIgnoreEntry): entry is LintIgnoreCeiling;
|
|
35
|
+
/** The check ID an entry names, whatever its form. */
|
|
36
|
+
export declare function lintIgnoreRule(entry: LintIgnoreEntry): string;
|
|
37
|
+
/**
|
|
38
|
+
* One-word rendering for summaries and dry runs: `file-too-large<=1200`,
|
|
39
|
+
* `large-patch-lines[test]<=900`.
|
|
40
|
+
*/
|
|
41
|
+
export declare function formatLintIgnoreEntry(entry: LintIgnoreEntry): string;
|
|
42
|
+
/** Renders a list for messages, `(empty)` when there is nothing to show. */
|
|
43
|
+
export declare function formatLintIgnoreList(entries: readonly LintIgnoreEntry[]): string;
|
|
44
|
+
/**
|
|
45
|
+
* Validates a raw `lintIgnore` value from `patches.json`.
|
|
46
|
+
*
|
|
47
|
+
* Bare strings keep their historical leniency (any ID, duplicates collapse
|
|
48
|
+
* later). A ceiling must name a measured size rule, carry a positive
|
|
49
|
+
* integer `max` and a non-empty `reason`, and must be the only entry for
|
|
50
|
+
* its rule: a bare ID beside a ceiling for the same rule would make the
|
|
51
|
+
* ceiling dead, and two ceilings would leave the effective one ambiguous.
|
|
52
|
+
* The one exception is `large-patch-lines`, which may carry one ceiling
|
|
53
|
+
* per `share` instead of a single share-less one. `meta` must be a JSON
|
|
54
|
+
* object and is kept verbatim.
|
|
55
|
+
*
|
|
56
|
+
* @param raw - The value under `lintIgnore`
|
|
57
|
+
* @param label - Field label for error messages, e.g. `patches[3].lintIgnore`
|
|
58
|
+
* @returns The validated entries
|
|
59
|
+
* @throws Error naming the offending element
|
|
60
|
+
*/
|
|
61
|
+
export declare function parseLintIgnoreEntries(raw: unknown, label: string): LintIgnoreEntry[];
|
|
62
|
+
/**
|
|
63
|
+
* Builds the waiver filter for a patch's entries.
|
|
64
|
+
*
|
|
65
|
+
* @param entries - `PatchMetadata.lintIgnore`, possibly merged with CLI flags
|
|
66
|
+
* @returns The filter, or undefined when there is nothing to waive
|
|
67
|
+
*/
|
|
68
|
+
export declare function buildLintIgnoreChecks(entries: readonly LintIgnoreEntry[] | undefined): LintIgnoreChecks | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Canonical string form of a filter for the per-patch lint cache's waiver
|
|
71
|
+
* comparison: bare IDs as themselves, ceilings as `rule<=max`.
|
|
72
|
+
*/
|
|
73
|
+
export declare function lintIgnoreCacheTokens(checks: LintIgnoreChecks | undefined): string[];
|
|
74
|
+
/**
|
|
75
|
+
* Unions CLI-flag check IDs into an existing list, the append-only
|
|
76
|
+
* semantics `export` / `re-export --lint-ignore` have always had. A bare ID
|
|
77
|
+
* whose rule already has an entry (bare or ceiling) is a no-op: widening a
|
|
78
|
+
* reviewed ceiling to an unbounded waiver is `patch lint-ignore`'s job, where
|
|
79
|
+
* it is confirmed explicitly. Ceilings deduplicate by rule and share, so a
|
|
80
|
+
* rule's per-share ceilings all survive.
|
|
81
|
+
*
|
|
82
|
+
* @returns The merged list, or undefined when it is empty
|
|
83
|
+
*/
|
|
84
|
+
export declare function mergeLintIgnoreIds(existing: readonly LintIgnoreEntry[] | undefined, ids: readonly string[] | undefined): LintIgnoreEntry[] | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Adds or replaces entries, the `patch lint-ignore --add` semantics: an
|
|
87
|
+
* explicit `--add <rule>` turns a rule's ceilings into a bare waiver,
|
|
88
|
+
* `--add <rule> --max <n>` sets or moves the rule's ceiling, and a
|
|
89
|
+
* share-scoped ceiling replaces only its own share (plus any bare or
|
|
90
|
+
* share-less entry for the rule, which it would contradict).
|
|
91
|
+
*
|
|
92
|
+
* @returns The new list, or undefined when it is empty
|
|
93
|
+
*/
|
|
94
|
+
export declare function upsertLintIgnoreEntries(existing: readonly LintIgnoreEntry[], additions: readonly LintIgnoreEntry[]): LintIgnoreEntry[] | undefined;
|
|
95
|
+
/** Removes every entry naming one of `rules`. Undefined when nothing is left. */
|
|
96
|
+
export declare function removeLintIgnoreRules(existing: readonly LintIgnoreEntry[], rules: readonly string[]): LintIgnoreEntry[] | undefined;
|
|
97
|
+
/** Entries present in `after` but not (identically) in `before`. */
|
|
98
|
+
export declare function addedLintIgnoreEntries(before: readonly LintIgnoreEntry[], after: readonly LintIgnoreEntry[]): LintIgnoreEntry[];
|
|
99
|
+
/**
|
|
100
|
+
* Splits issues into the ones that still surface and the ones a waiver
|
|
101
|
+
* drops.
|
|
102
|
+
*
|
|
103
|
+
* A bare ID drops every finding of its rule. A ceiling drops a finding only
|
|
104
|
+
* when it carries a measurement at or below `max`. Past the ceiling the
|
|
105
|
+
* finding surfaces at its own severity with the ceiling named, and a
|
|
106
|
+
* finding with no measurement surfaces too (fail closed).
|
|
107
|
+
*/
|
|
108
|
+
export declare function partitionLintIgnoredIssues(issues: readonly PatchLintIssue[], checks: LintIgnoreChecks | undefined): {
|
|
109
|
+
kept: PatchLintIssue[];
|
|
110
|
+
suppressed: PatchLintIssue[];
|
|
111
|
+
};
|
|
112
|
+
/** True when `checks` waives `issue` (see {@link partitionLintIgnoredIssues}). */
|
|
113
|
+
export declare function isLintIgnored(issue: PatchLintIssue, checks: LintIgnoreChecks | undefined): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Drops issues that a patch owning `issue.file` (via `filesAffected`)
|
|
116
|
+
* waives. Used where findings carry no patch scope of their own (aggregate
|
|
117
|
+
* `lint`). Each owner keeps its own filter, so a ceiling stays bounded by
|
|
118
|
+
* the patch that declared it instead of merging into a file-wide union; an
|
|
119
|
+
* issue is dropped when any owner waives it.
|
|
120
|
+
*/
|
|
121
|
+
export declare function filterLintIgnoredByOwners(issues: PatchLintIssue[], owners: ReadonlyArray<{
|
|
122
|
+
lintIgnore?: LintIgnoreEntry[];
|
|
123
|
+
filesAffected: readonly string[];
|
|
124
|
+
} | null | undefined>): PatchLintIssue[];
|
|
125
|
+
/** Where a ceiling stands against the patch's current measurements. */
|
|
126
|
+
export type LintIgnoreCeilingState = 'within' | 'exceeded' | 'removable';
|
|
127
|
+
/** One ceiling's standing, as `lint --per-patch --report` records it. */
|
|
128
|
+
export interface LintIgnoreCeilingStatus {
|
|
129
|
+
rule: string;
|
|
130
|
+
max: number;
|
|
131
|
+
reason: string;
|
|
132
|
+
/** The share the ceiling bounds, when it is share-scoped. */
|
|
133
|
+
share?: PatchSizeShare;
|
|
134
|
+
/** The ceiling's `meta`, verbatim, when it has one. */
|
|
135
|
+
meta?: Record<string, unknown>;
|
|
136
|
+
/** Largest current measurement for the rule, null when none was taken. */
|
|
137
|
+
measurement: number | null;
|
|
138
|
+
/**
|
|
139
|
+
* `exceeded`: a warning- or error-band finding measured past `max` and
|
|
140
|
+
* surfaced. A notice never exceeds a ceiling: it gates nothing.
|
|
141
|
+
* `removable`: the rule no longer reaches its own warning band, so the
|
|
142
|
+
* waiver changes no gate and can be dropped.
|
|
143
|
+
* `within`: the waiver is doing its job.
|
|
144
|
+
*/
|
|
145
|
+
state: LintIgnoreCeilingState;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* One waiver's standing, bare or ceiling, as the report's
|
|
149
|
+
* `lintIgnoreWaivers` records it. A bare waiver has `max: null`; its
|
|
150
|
+
* `state` is `within` while the rule still finds something to suppress at
|
|
151
|
+
* warning band or above, and `removable` otherwise (informational: a bare
|
|
152
|
+
* waiver of a rule this lint does not run reads as removable too).
|
|
153
|
+
*/
|
|
154
|
+
export interface LintIgnoreWaiverStatus {
|
|
155
|
+
kind: 'bare' | 'ceiling';
|
|
156
|
+
rule: string;
|
|
157
|
+
max: number | null;
|
|
158
|
+
reason: string | null;
|
|
159
|
+
share?: PatchSizeShare;
|
|
160
|
+
meta?: Record<string, unknown>;
|
|
161
|
+
measurement: number | null;
|
|
162
|
+
state: LintIgnoreCeilingState;
|
|
163
|
+
}
|
|
164
|
+
/** Patch-level measurements a size rule falls back to when it did not fire. */
|
|
165
|
+
interface PatchMeasurements {
|
|
166
|
+
lines: number;
|
|
167
|
+
files: number;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Evaluates each ceiling on a patch against the findings its lint produced
|
|
171
|
+
* (both surfaced and suppressed).
|
|
172
|
+
*
|
|
173
|
+
* @param entries - The patch's `lintIgnore`
|
|
174
|
+
* @param issues - Every finding of the patch's lint, surfaced and suppressed
|
|
175
|
+
* @param patchMeasurements - Patch-level measurements used when a
|
|
176
|
+
* patch-size rule did not fire at all, so the report still shows the
|
|
177
|
+
* current number
|
|
178
|
+
*/
|
|
179
|
+
export declare function evaluateLintIgnoreCeilings(entries: readonly LintIgnoreEntry[] | undefined, issues: readonly PatchLintIssue[], patchMeasurements: PatchMeasurements): LintIgnoreCeilingStatus[];
|
|
180
|
+
/**
|
|
181
|
+
* Evaluates every waiver on a patch, bare IDs included, so a waiver audit
|
|
182
|
+
* reads each one's current measurement from the report instead of
|
|
183
|
+
* re-measuring bare waivers from `suppressedIssues`.
|
|
184
|
+
*
|
|
185
|
+
* @param entries - The patch's `lintIgnore`
|
|
186
|
+
* @param issues - Every finding of the patch's lint, surfaced and suppressed
|
|
187
|
+
* @param patchMeasurements - See {@link evaluateLintIgnoreCeilings}
|
|
188
|
+
*/
|
|
189
|
+
export declare function evaluateLintIgnoreWaivers(entries: readonly LintIgnoreEntry[] | undefined, issues: readonly PatchLintIssue[], patchMeasurements: PatchMeasurements): LintIgnoreWaiverStatus[];
|
|
190
|
+
/**
|
|
191
|
+
* Notice-severity findings for ceilings that are no longer needed, so the
|
|
192
|
+
* waiver's removal is prompted by the tool that enforces it rather than
|
|
193
|
+
* discovered by hand.
|
|
194
|
+
*/
|
|
195
|
+
export declare function removableCeilingIssues(patchFilename: string, statuses: readonly LintIgnoreCeilingStatus[]): PatchLintIssue[];
|
|
196
|
+
export {};
|