@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
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EUPL-1.2
|
|
2
|
+
/**
|
|
3
|
+
* `token-scale`: values of governed CSS properties must resolve to a token
|
|
4
|
+
* on the property's scale (`patchLint.tokenScales`).
|
|
5
|
+
*
|
|
6
|
+
* The raw-colour and token-prefix rules stop a patch from inventing colours
|
|
7
|
+
* or referencing foreign custom properties, but say nothing about
|
|
8
|
+
* `gap: 7px`, `font-size: 13px` or `z-index: 9999`. Those are the values a
|
|
9
|
+
* design scale exists to remove, and without a rule they drift back one
|
|
10
|
+
* literal at a time. A scale names its properties, the token prefix (or
|
|
11
|
+
* prefixes) that defines its steps, and the literals that are not steps at
|
|
12
|
+
* all (`0`, `auto`, a percentage).
|
|
13
|
+
*
|
|
14
|
+
* Judged per value atom, after peeling `var()` innermost-first so a fallback
|
|
15
|
+
* is held to the same scale as the token it backs: `var(--x-gap, 7px)` is a
|
|
16
|
+
* literal in disguise. `calc()`, `min()`, `max()` and `clamp()` are
|
|
17
|
+
* transparent, so a value built from tokens passes and one that adds a raw
|
|
18
|
+
* length does not. Inside them, `allowInCalc` names literals legal only
|
|
19
|
+
* there (a unitless multiplier), and `offsetCap` lets a declaration
|
|
20
|
+
* subtract a few px from a token (a border inset) without allowing the px
|
|
21
|
+
* value anywhere else.
|
|
22
|
+
*
|
|
23
|
+
* Declarations inside descriptor at-rules (`@font-face`, `@counter-style`,
|
|
24
|
+
* `@property`, `@page`, …) are not property declarations and are not
|
|
25
|
+
* judged: `font-weight` in `@font-face` names a face, not a type step.
|
|
26
|
+
*
|
|
27
|
+
* Runs over CSS files the patch creates, not files it modifies: an upstream
|
|
28
|
+
* stylesheet is not the fork's to put on a scale. A file a scale `exclude`s
|
|
29
|
+
* is not judged against that scale. A line carrying
|
|
30
|
+
* `fireforge-ignore: token-scale` is skipped. A scale with `minFiles` also
|
|
31
|
+
* fails the queue (`token-scale-vacuous`) when fewer created files carry
|
|
32
|
+
* its properties, so an emptied scan set cannot pass by judging nothing.
|
|
33
|
+
*/
|
|
34
|
+
import { matchesAnyGlob } from '../utils/path-glob.js';
|
|
35
|
+
import { escapeRegex } from '../utils/regex.js';
|
|
36
|
+
const IGNORE_MARKER = 'fireforge-ignore: token-scale';
|
|
37
|
+
/** CSS-wide keywords: never a step on any scale, always legal. */
|
|
38
|
+
const CSS_WIDE_KEYWORDS = new Set(['inherit', 'initial', 'unset', 'revert', 'revert-layer']);
|
|
39
|
+
const TOKEN_PLACEHOLDER = '\u0000token\u0000';
|
|
40
|
+
const MATH_FUNCTION = /^(?:calc|min|max|clamp)$/i;
|
|
41
|
+
const OPERATORS = new Set(['+', '-', '*', '/']);
|
|
42
|
+
/**
|
|
43
|
+
* At-rules whose blocks hold descriptors, not property declarations. A
|
|
44
|
+
* block nested in one (an `@page` margin box, a `@font-feature-values`
|
|
45
|
+
* feature block) is a descriptor block too.
|
|
46
|
+
*/
|
|
47
|
+
const DESCRIPTOR_AT_RULE = /^@(?:font-face|counter-style|property|font-feature-values|font-palette-values|page|view-transition)\b/i;
|
|
48
|
+
/** Exact name, or a `*`-suffixed prefix. */
|
|
49
|
+
function matchesName(name, patterns) {
|
|
50
|
+
return patterns.some((pattern) => pattern.endsWith('*') ? name.startsWith(pattern.slice(0, -1)) : name === pattern);
|
|
51
|
+
}
|
|
52
|
+
function matchesLiteral(atom, patterns) {
|
|
53
|
+
return patterns.some((pattern) => new RegExp(`^${pattern.split('*').map(escapeRegex).join('.*')}$`).test(atom));
|
|
54
|
+
}
|
|
55
|
+
/** The scale's token prefixes, whether configured as one or a list. */
|
|
56
|
+
function scalePrefixes(scale) {
|
|
57
|
+
return typeof scale.prefix === 'string' ? [scale.prefix] : scale.prefix;
|
|
58
|
+
}
|
|
59
|
+
/** The scale as a message names it: `--x-space-*`, or `--x-space-* / --x-gap-*`. */
|
|
60
|
+
function scaleLabel(scale) {
|
|
61
|
+
return scalePrefixes(scale)
|
|
62
|
+
.map((prefix) => `${prefix}*`)
|
|
63
|
+
.join(' / ');
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Splits a value into atoms, keeping operators as atoms and noting which
|
|
67
|
+
* atoms sit inside a math function. A math function's name is dropped; any
|
|
68
|
+
* other function's name stays an atom, judged like a literal.
|
|
69
|
+
*/
|
|
70
|
+
function valueAtoms(value) {
|
|
71
|
+
const atoms = [];
|
|
72
|
+
const mathStack = [];
|
|
73
|
+
let current = '';
|
|
74
|
+
const flush = () => {
|
|
75
|
+
if (current !== '')
|
|
76
|
+
atoms.push({ text: current, inMath: mathStack.includes(true) });
|
|
77
|
+
current = '';
|
|
78
|
+
};
|
|
79
|
+
for (const char of value) {
|
|
80
|
+
if (char === '(') {
|
|
81
|
+
const isMath = MATH_FUNCTION.test(current);
|
|
82
|
+
if (isMath)
|
|
83
|
+
current = '';
|
|
84
|
+
else
|
|
85
|
+
flush();
|
|
86
|
+
mathStack.push(isMath);
|
|
87
|
+
}
|
|
88
|
+
else if (char === ')') {
|
|
89
|
+
flush();
|
|
90
|
+
mathStack.pop();
|
|
91
|
+
}
|
|
92
|
+
else if (char === '*' || char === '/') {
|
|
93
|
+
flush();
|
|
94
|
+
atoms.push({ text: char, inMath: mathStack.includes(true) });
|
|
95
|
+
}
|
|
96
|
+
else if (char === ',' || /\s/.test(char)) {
|
|
97
|
+
flush();
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
current += char;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
flush();
|
|
104
|
+
return atoms;
|
|
105
|
+
}
|
|
106
|
+
const PX_LITERAL = /^(\d*\.?\d+)px$/;
|
|
107
|
+
/**
|
|
108
|
+
* Returns the first atom of `value` that is off `scale`, or undefined when
|
|
109
|
+
* every atom resolves to the scale.
|
|
110
|
+
*/
|
|
111
|
+
export function findOffScaleAtom(value, scale) {
|
|
112
|
+
let rest = value.replace(/!\s*important\s*$/i, '');
|
|
113
|
+
const prefixes = scalePrefixes(scale);
|
|
114
|
+
const varPattern = /var\(\s*(--[\w-]+)\s*(?:,([^()]*))?\)/;
|
|
115
|
+
for (let match = varPattern.exec(rest); match !== null; match = varPattern.exec(rest)) {
|
|
116
|
+
const name = match[1] ?? '';
|
|
117
|
+
const onScale = prefixes.some((prefix) => name.startsWith(prefix));
|
|
118
|
+
if (!onScale && !matchesName(name, scale.allow ?? [])) {
|
|
119
|
+
return `var(${name})`;
|
|
120
|
+
}
|
|
121
|
+
const fallback = match[2];
|
|
122
|
+
if (fallback !== undefined && fallback.trim() !== '') {
|
|
123
|
+
const offending = findOffScaleAtom(fallback, scale);
|
|
124
|
+
if (offending !== undefined)
|
|
125
|
+
return offending;
|
|
126
|
+
}
|
|
127
|
+
rest = `${rest.slice(0, match.index)} ${TOKEN_PLACEHOLDER} ${rest.slice(match.index + match[0].length)}`;
|
|
128
|
+
}
|
|
129
|
+
const atoms = valueAtoms(rest);
|
|
130
|
+
// A px offset subtracted from a token (`token - 1px`, `token - 1px - 1px`)
|
|
131
|
+
// counts toward `offsetCap`, summed over the declaration.
|
|
132
|
+
let offsetTotal = 0;
|
|
133
|
+
let lastOffsetIndex = -1;
|
|
134
|
+
for (const [index, atom] of atoms.entries()) {
|
|
135
|
+
if (OPERATORS.has(atom.text) || atom.text === TOKEN_PLACEHOLDER)
|
|
136
|
+
continue;
|
|
137
|
+
if (CSS_WIDE_KEYWORDS.has(atom.text.toLowerCase()))
|
|
138
|
+
continue;
|
|
139
|
+
if (matchesLiteral(atom.text, scale.allowLiterals ?? []))
|
|
140
|
+
continue;
|
|
141
|
+
if (atom.inMath && matchesLiteral(atom.text, scale.allowInCalc ?? []))
|
|
142
|
+
continue;
|
|
143
|
+
const px = PX_LITERAL.exec(atom.text);
|
|
144
|
+
if (atom.inMath && px !== null && scale.offsetCap !== undefined) {
|
|
145
|
+
const subtrahendOf = atoms[index - 2]?.text;
|
|
146
|
+
const subtracted = atoms[index - 1]?.text === '-' &&
|
|
147
|
+
(subtrahendOf === TOKEN_PLACEHOLDER || lastOffsetIndex === index - 2);
|
|
148
|
+
if (subtracted) {
|
|
149
|
+
offsetTotal += Number(px[1]);
|
|
150
|
+
lastOffsetIndex = index;
|
|
151
|
+
if (offsetTotal <= scale.offsetCap)
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return atom.text;
|
|
156
|
+
}
|
|
157
|
+
return undefined;
|
|
158
|
+
}
|
|
159
|
+
/** Blanks block comments, keeping newlines so offsets map to lines. */
|
|
160
|
+
function maskComments(css) {
|
|
161
|
+
return css.replace(/\/\*[\s\S]*?\*\//g, (comment) => comment.replace(/[^\n]/g, ' '));
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Blanks the contents of descriptor at-rule blocks (keeping braces and
|
|
165
|
+
* newlines), so the declaration scan never sees their descriptors.
|
|
166
|
+
*/
|
|
167
|
+
function maskDescriptorBlocks(css) {
|
|
168
|
+
const out = css.split('');
|
|
169
|
+
const stack = [];
|
|
170
|
+
let preludeStart = 0;
|
|
171
|
+
for (let i = 0; i < css.length; i++) {
|
|
172
|
+
const char = css.charAt(i);
|
|
173
|
+
const inDescriptor = stack[stack.length - 1] === true;
|
|
174
|
+
if (char === '{') {
|
|
175
|
+
const prelude = css.slice(preludeStart, i).trim();
|
|
176
|
+
stack.push(inDescriptor || DESCRIPTOR_AT_RULE.test(prelude));
|
|
177
|
+
preludeStart = i + 1;
|
|
178
|
+
}
|
|
179
|
+
else if (char === '}') {
|
|
180
|
+
stack.pop();
|
|
181
|
+
preludeStart = i + 1;
|
|
182
|
+
}
|
|
183
|
+
else if (char === ';') {
|
|
184
|
+
preludeStart = i + 1;
|
|
185
|
+
}
|
|
186
|
+
if (inDescriptor && char !== '\n' && char !== '{' && char !== '}')
|
|
187
|
+
out[i] = ' ';
|
|
188
|
+
}
|
|
189
|
+
return out.join('');
|
|
190
|
+
}
|
|
191
|
+
/** Every property declaration of a stylesheet, descriptors and comments left out. */
|
|
192
|
+
function scanDeclarations(css) {
|
|
193
|
+
const masked = maskDescriptorBlocks(maskComments(css));
|
|
194
|
+
const declarations = [];
|
|
195
|
+
const pattern = /(^|[{;\s])([a-zA-Z][a-zA-Z-]*)\s*:\s*([^;{}]*)/g;
|
|
196
|
+
for (let match = pattern.exec(masked); match !== null; match = pattern.exec(masked)) {
|
|
197
|
+
const start = match.index + (match[1] ?? '').length;
|
|
198
|
+
declarations.push({
|
|
199
|
+
property: (match[2] ?? '').toLowerCase(),
|
|
200
|
+
value: (match[3] ?? '').trim(),
|
|
201
|
+
line: masked.slice(0, start).split('\n').length,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
return declarations;
|
|
205
|
+
}
|
|
206
|
+
/** The scales that govern `file`: those that do not `exclude` it. */
|
|
207
|
+
function scalesFor(file, scales) {
|
|
208
|
+
return scales.filter((scale) => !matchesAnyGlob(file, scale.exclude ?? []));
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Lints one patch-created CSS file against the configured scales.
|
|
212
|
+
*
|
|
213
|
+
* @param file - Engine-relative path, for the issue and the `exclude` globs
|
|
214
|
+
* @param css - The file's full content
|
|
215
|
+
* @param scales - `patchLint.tokenScales`
|
|
216
|
+
* @returns One `token-scale` error per off-scale declaration
|
|
217
|
+
*/
|
|
218
|
+
export function lintTokenScales(file, css, scales) {
|
|
219
|
+
const governing = scalesFor(file, scales);
|
|
220
|
+
if (governing.length === 0)
|
|
221
|
+
return [];
|
|
222
|
+
const rawLines = css.split('\n');
|
|
223
|
+
const issues = [];
|
|
224
|
+
for (const { property, value, line } of scanDeclarations(css)) {
|
|
225
|
+
const scale = governing.find((candidate) => matchesName(property, candidate.properties));
|
|
226
|
+
if (scale === undefined || value === '')
|
|
227
|
+
continue;
|
|
228
|
+
if ((rawLines[line - 1] ?? '').includes(IGNORE_MARKER))
|
|
229
|
+
continue;
|
|
230
|
+
const atom = findOffScaleAtom(value, scale);
|
|
231
|
+
if (atom === undefined)
|
|
232
|
+
continue;
|
|
233
|
+
const label = scaleLabel(scale);
|
|
234
|
+
issues.push({
|
|
235
|
+
file,
|
|
236
|
+
check: 'token-scale',
|
|
237
|
+
fingerprint: `token-scale:${file}:${property}:${value}`,
|
|
238
|
+
message: `Line ${String(line)}: ${property}: ${value} is off the ${label} scale ` +
|
|
239
|
+
`("${atom}"). Use a ${label} token, or list a reviewed exception in ` +
|
|
240
|
+
`patchLint.tokenScales (allowLiterals / allowInCalc / allow) or mark the line "${IGNORE_MARKER}".`,
|
|
241
|
+
severity: 'error',
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
return issues;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* The `minFiles` floor of every scale over the queue's created stylesheets:
|
|
248
|
+
* one `token-scale-vacuous` error per scale that fewer created CSS files
|
|
249
|
+
* (outside its `exclude`) carry a declaration of.
|
|
250
|
+
*
|
|
251
|
+
* @param createdFiles - Every patch-created file's path and content
|
|
252
|
+
* @param scales - `patchLint.tokenScales`
|
|
253
|
+
*/
|
|
254
|
+
export function lintTokenScaleFloors(createdFiles, scales) {
|
|
255
|
+
const floored = scales.filter((scale) => scale.minFiles !== undefined);
|
|
256
|
+
if (floored.length === 0)
|
|
257
|
+
return [];
|
|
258
|
+
const counts = new Map(floored.map((scale) => [scale, 0]));
|
|
259
|
+
for (const [file, content] of createdFiles) {
|
|
260
|
+
if (!file.endsWith('.css'))
|
|
261
|
+
continue;
|
|
262
|
+
const properties = new Set(scanDeclarations(content).map((entry) => entry.property));
|
|
263
|
+
for (const scale of scalesFor(file, floored)) {
|
|
264
|
+
if ([...properties].some((property) => matchesName(property, scale.properties))) {
|
|
265
|
+
counts.set(scale, (counts.get(scale) ?? 0) + 1);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
const issues = [];
|
|
270
|
+
for (const [scale, count] of counts) {
|
|
271
|
+
const floor = scale.minFiles ?? 0;
|
|
272
|
+
if (count >= floor)
|
|
273
|
+
continue;
|
|
274
|
+
const label = scaleLabel(scale);
|
|
275
|
+
issues.push({
|
|
276
|
+
file: 'fireforge.json',
|
|
277
|
+
check: 'token-scale-vacuous',
|
|
278
|
+
fingerprint: `token-scale-vacuous:${label}`,
|
|
279
|
+
message: `The ${label} scale governs ${String(count)} patch-created stylesheet(s), under its ` +
|
|
280
|
+
`minFiles ${String(floor)}. A scale that judges nothing passes vacuously: check its ` +
|
|
281
|
+
'properties and exclude globs, or lower minFiles after a reviewed move.',
|
|
282
|
+
severity: 'error',
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
return issues;
|
|
286
|
+
}
|
|
@@ -2,29 +2,19 @@ import type { PatchLintIssue } from '../types/commands/index.js';
|
|
|
2
2
|
import type { FireForgeConfig, ProjectLicense } from '../types/config.js';
|
|
3
3
|
import { type CommentStyle } from './license-headers.js';
|
|
4
4
|
import { lintPatchedCss } from './patch-lint-css.js';
|
|
5
|
+
import { type LintIgnoreChecks } from './patch-lint-ignore.js';
|
|
6
|
+
import { type PatchSizeMeasurement } from './patch-lint-size.js';
|
|
5
7
|
export * from './patch-lint-cross.js';
|
|
6
8
|
export { buildModifiedFileAdditionsFromDiff, detectNewFilesInDiff } from './patch-lint-diff.js';
|
|
7
9
|
export { lintPatchedCss };
|
|
10
|
+
export { countNonBinaryDiffLines, getPatchSizeThresholds, isTestFile, lintPatchSize, measurePatchSize, type PatchSizeMeasurement, type PatchSizeTierDecision, resolvePatchSizeTier, } from './patch-lint-size.js';
|
|
11
|
+
export type { PatchSizeThresholds } from './patch-lint-size-thresholds.js';
|
|
8
12
|
/**
|
|
9
13
|
* Canonical `[check] file: message` rendering of a patch-lint issue. It is
|
|
10
14
|
* the one string shape every reporter and refusal message uses, so operators
|
|
11
15
|
* can grep one format across lint output and refusal details.
|
|
12
16
|
*/
|
|
13
17
|
export declare function formatPatchLintIssue(issue: Pick<PatchLintIssue, 'check' | 'file' | 'message'>): string;
|
|
14
|
-
/**
|
|
15
|
-
* Counts the total lines in a unified diff and the number of non-binary
|
|
16
|
-
* text lines, so binary hunks do not inflate patch size checks.
|
|
17
|
-
*
|
|
18
|
-
* Line counting agrees with `wc -l`: a trailing newline does not add a
|
|
19
|
-
* phantom empty line to either `total` or the binary-hunk accounting.
|
|
20
|
-
*
|
|
21
|
-
* @param diffContent - Raw unified diff string
|
|
22
|
-
* @returns Object with `total` line count and `textLines` (total minus binary hunk lines)
|
|
23
|
-
*/
|
|
24
|
-
export declare function countNonBinaryDiffLines(diffContent: string): {
|
|
25
|
-
total: number;
|
|
26
|
-
textLines: number;
|
|
27
|
-
};
|
|
28
18
|
/**
|
|
29
19
|
* The files the `file-too-large` rule measures for a patch: the JS files
|
|
30
20
|
* (`.js`, `.mjs`, `.sys.mjs`, …) the patch creates. A modified file is
|
|
@@ -36,12 +26,6 @@ export declare function countNonBinaryDiffLines(diffContent: string): {
|
|
|
36
26
|
* @returns Engine-relative paths the rule would size-check
|
|
37
27
|
*/
|
|
38
28
|
export declare function filesMeasuredByFileTooLarge(patchText: string): Set<string>;
|
|
39
|
-
/**
|
|
40
|
-
* Returns true if the file path looks like a test file.
|
|
41
|
-
* Matches paths containing `/test/` or filenames starting with
|
|
42
|
-
* `browser_`, `test_`, or `xpcshell_` (all `.js`).
|
|
43
|
-
*/
|
|
44
|
-
export declare function isTestFile(file: string): boolean;
|
|
45
29
|
/** True when `strippedContent` contains at least one assertion call. */
|
|
46
30
|
export declare function hasBrowserChromeAssertion(strippedContent: string): boolean;
|
|
47
31
|
/**
|
|
@@ -115,68 +99,6 @@ export declare function lintPatchedJs(repoDir: string, affectedFiles: string[],
|
|
|
115
99
|
* @returns Array of lint issues
|
|
116
100
|
*/
|
|
117
101
|
export declare function lintModificationComments(diffContent: string, config: FireForgeConfig): PatchLintIssue[];
|
|
118
|
-
/**
|
|
119
|
-
* Describes which tier `resolvePatchSizeTier` selected and why.
|
|
120
|
-
* Consumers that want to surface the tier choice to the operator
|
|
121
|
-
* (e.g. a one-line `info()` when branding thresholds kick in) read
|
|
122
|
-
* this alongside the issues array from `lintPatchSize`.
|
|
123
|
-
*/
|
|
124
|
-
export type PatchSizeTierDecision = {
|
|
125
|
-
tier: 'general';
|
|
126
|
-
} | {
|
|
127
|
-
tier: 'test';
|
|
128
|
-
} | {
|
|
129
|
-
tier: 'branding';
|
|
130
|
-
source: 'auto' | 'explicit';
|
|
131
|
-
};
|
|
132
|
-
/**
|
|
133
|
-
* Decides which `large-patch-lines` threshold tier applies to a patch.
|
|
134
|
-
* Exported so `runPatchLint` and the per-patch `lint` command can
|
|
135
|
-
* surface the tier choice to the operator *without* depending on
|
|
136
|
-
* `lintPatchSize`'s internal return shape. The rule itself stays a
|
|
137
|
-
* pure issues-array API, and the decision is computed separately for
|
|
138
|
-
* the sole purpose of reporting.
|
|
139
|
-
*
|
|
140
|
-
* Precedence: test > branding (explicit) > branding (auto) > general.
|
|
141
|
-
* The test tier beats branding because a table-driven regression test
|
|
142
|
-
* is legitimately large independent of whether the patch also claims
|
|
143
|
-
* branding shape, and the test-tier thresholds are already more
|
|
144
|
-
* permissive than branding, so "tests beat branding" is the
|
|
145
|
-
* defensive-for-tests choice.
|
|
146
|
-
*/
|
|
147
|
-
export declare function resolvePatchSizeTier(filesAffected: ReadonlyArray<string>, patchTier?: 'branding'): PatchSizeTierDecision;
|
|
148
|
-
/** Line and file-count thresholds governing one patch-size tier. */
|
|
149
|
-
export interface PatchSizeThresholds {
|
|
150
|
-
/** Added-line counts at which notice/warning/error issues fire. */
|
|
151
|
-
lines: {
|
|
152
|
-
notice: number;
|
|
153
|
-
warning: number;
|
|
154
|
-
error: number;
|
|
155
|
-
};
|
|
156
|
-
/** Maximum number of files a patch may touch before an issue fires. */
|
|
157
|
-
maxFiles: number;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Read-only view of the size thresholds a tier enforces.
|
|
161
|
-
* Public-API companion to {@link resolvePatchSizeTier} /
|
|
162
|
-
* {@link countNonBinaryDiffLines} so consumers can build waiver-freshness
|
|
163
|
-
* checks against the same numbers `large-patch-lines` /
|
|
164
|
-
* `large-patch-files` fire on instead of mirroring them.
|
|
165
|
-
*/
|
|
166
|
-
export declare function getPatchSizeThresholds(tier: 'general' | 'test' | 'branding'): PatchSizeThresholds;
|
|
167
|
-
/**
|
|
168
|
-
* Checks patch size and emits advisory warnings.
|
|
169
|
-
*
|
|
170
|
-
* @param filesAffected - Files touched by the patch
|
|
171
|
-
* @param lineCount - Non-binary line count of the unified diff
|
|
172
|
-
* @param patchTier - Optional explicit tier override declared on
|
|
173
|
-
* `PatchMetadata.tier`. When `"branding"`, forces the branding
|
|
174
|
-
* thresholds regardless of `filesAffected`. Tests still win over
|
|
175
|
-
* branding (precedence `test > branding > general`) because the
|
|
176
|
-
* test-tier thresholds are already more permissive and an all-tests
|
|
177
|
-
* patch that is also branding-shaped is vanishingly rare.
|
|
178
|
-
*/
|
|
179
|
-
export declare function lintPatchSize(filesAffected: string[], lineCount: number, patchTier?: 'branding'): PatchLintIssue[];
|
|
180
102
|
/**
|
|
181
103
|
* Checks that modified (non-new) files with a supported extension still
|
|
182
104
|
* start with a recognized license header.
|
|
@@ -204,7 +126,7 @@ export interface LintExportedPatchOptions {
|
|
|
204
126
|
* of a specific rule without reaching for the blunt `--skip-lint` hammer.
|
|
205
127
|
* Not mutated.
|
|
206
128
|
*/
|
|
207
|
-
ignoreChecks?:
|
|
129
|
+
ignoreChecks?: LintIgnoreChecks;
|
|
208
130
|
/**
|
|
209
131
|
* Explicit tier override, threaded from `PatchMetadata.tier`. When
|
|
210
132
|
* `"branding"` forces the branding thresholds on the
|
|
@@ -246,6 +168,12 @@ export interface LintExportedPatchOptions {
|
|
|
246
168
|
* and the `--report` JSON) instead of losing it entirely.
|
|
247
169
|
*/
|
|
248
170
|
onSuppressed?: (suppressed: PatchLintIssue[]) => void;
|
|
171
|
+
/**
|
|
172
|
+
* The patch's {@link measurePatchSize} result, when the caller already
|
|
173
|
+
* measured it for its own report or cache row. Absent, the size rules
|
|
174
|
+
* measure the diff themselves.
|
|
175
|
+
*/
|
|
176
|
+
patchSizeMeasurement?: PatchSizeMeasurement;
|
|
249
177
|
}
|
|
250
178
|
/**
|
|
251
179
|
* Runs all patch lint checks and returns combined issues.
|