@hailstails/hone 1.4.0 → 2.0.0-pre.1
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/ADOPTING.md +239 -168
- package/CHANGELOG.md +141 -0
- package/MIGRATING.md +145 -45
- package/README.md +148 -182
- package/chunks/chunk-5HRMJ4O2.js +608 -0
- package/chunks/chunk-5U4JMWNV.js +9 -0
- package/chunks/{chunk-FEWCJU7H.js → chunk-ASUN4AVC.js} +31 -12
- package/chunks/chunk-DGOLOS5A.js +9 -0
- package/chunks/{chunk-HJA4CX7C.js → chunk-FBZBSDED.js} +1 -1
- package/chunks/{chunk-Y2KPZDDV.js → chunk-GNOMK7CR.js} +201 -98
- package/chunks/chunk-IX2VZTBO.js +887 -0
- package/chunks/{chunk-QWA6OVLC.js → chunk-K2W3D3NB.js} +8 -2
- package/chunks/chunk-L7BGRC6D.js +22 -0
- package/chunks/chunk-M6SOGWT7.js +82 -0
- package/chunks/chunk-MWLBA4B3.js +849 -0
- package/chunks/chunk-NRIQD3PI.js +38 -0
- package/chunks/chunk-OKLYWD2Z.js +823 -0
- package/chunks/{chunk-3HFJHJDO.js → chunk-QP5TLOBY.js} +17 -8
- package/chunks/chunk-R75QELTA.js +481 -0
- package/chunks/chunk-RANAKCTW.js +31 -0
- package/chunks/{chunk-NA5L6PUE.js → chunk-RANIXNWY.js} +1 -2
- package/chunks/chunk-RFR3ITBS.js +9 -0
- package/chunks/{chunk-Z4UBS7WI.js → chunk-RGSHTPLA.js} +26 -7
- package/chunks/{chunk-T32FOWZA.js → chunk-TNY2PASL.js} +14 -18
- package/chunks/{chunk-Y4SMWOD2.js → chunk-UJONWHA4.js} +2 -2
- package/chunks/{chunk-WF3PPYRR.js → chunk-VYBO2Q65.js} +4 -2
- package/chunks/chunk-Z6JHBNDS.js +15 -0
- package/chunks/eslint-10-boundary-A4JIQ734.js +14 -0
- package/chunks/eslint-9-boundary-CL5DDBHX.js +34 -0
- package/docs/adding-a-discipline-or-mechanism.md +23 -19
- package/docs/extending.md +6 -5
- package/docs/output-contract.md +713 -16
- package/docs/why-chain-contract.md +6 -6
- package/methods/README.md +2 -2
- package/methods/assessment-template.md +3 -3
- package/methods/lenses/clean-architecture.md +26 -62
- package/methods/lenses/decomposition.md +7 -7
- package/methods/lenses/defended-on-intent.md +6 -6
- package/methods/lenses/di-discipline.md +18 -21
- package/methods/lenses/errors-as-data.md +6 -6
- package/methods/lenses/function-first.md +25 -27
- package/methods/lenses/naming.md +6 -6
- package/methods/lenses/test-discipline.md +8 -8
- package/methods/lenses/type-soundness.md +6 -6
- package/methods/lenses/zod-boundary.md +9 -9
- package/package.json +30 -28
- package/rules/README.md +335 -54
- package/rules/SPIRIT.md +4 -4
- package/rules/cases/a-value-is-one-of-several-kinds-or-states.md +20 -0
- package/rules/cases/an-adopter-is-not-handed-our-risk.md +17 -0
- package/rules/cases/an-operation-can-fail.md +20 -0
- package/rules/cases/builds-the-real-implementations.md +25 -0
- package/rules/cases/causes-an-effect.md +26 -0
- package/rules/cases/checks-a-value-that-may-be-one-of-several-outcomes.md +20 -0
- package/rules/cases/checks-conditions-before-its-work.md +20 -0
- package/rules/cases/coordinates-other-units.md +20 -0
- package/rules/cases/does-one-job.md +23 -0
- package/rules/cases/explains-something-in-prose.md +20 -0
- package/rules/cases/gives-a-value-its-type.md +26 -0
- package/rules/cases/gives-each-unit-its-test.md +20 -0
- package/rules/cases/keeps-state-or-settings-across-calls.md +20 -0
- package/rules/cases/makes-a-new-value-from-what-it-has.md +17 -0
- package/rules/cases/names-something.md +20 -0
- package/rules/cases/needs-the-current-time-a-random-value-a-new-id-or-an-outside-ordering.md +26 -0
- package/rules/cases/puts-code-in-a-file-or-folder.md +20 -0
- package/rules/cases/reads-data-from-outside.md +23 -0
- package/rules/cases/reuses-behaviour-from-another-unit-or-type.md +20 -0
- package/rules/cases/sends-data-out-of-the-program.md +20 -0
- package/rules/cases/sets-how-strictly-the-checker-works.md +14 -0
- package/rules/cases/ships-code-for-others.md +17 -0
- package/rules/cases/states-what-the-unit-gives-back-for-one-case-or-several.md +20 -0
- package/rules/cases/takes-an-outside-dependency.md +38 -0
- package/rules/cases/tests-across-units-or-against-a-real-system.md +20 -0
- package/rules/cases/uses-a-system-or-service-outside-the-program.md +29 -0
- package/rules/cases/uses-what-a-collaborator-gives-back.md +20 -0
- package/rules/cases/writes-basic-logic.md +17 -0
- package/rules/cases.md +71 -0
- package/rules/numbers.md +155 -0
- package/rules/principles/external-behaviour-sits-at-a-boundary.md +12 -0
- package/rules/principles/no-hidden-effects.md +17 -0
- package/rules/principles/no-leak-across-a-boundary.md +19 -0
- package/rules/principles/one-place-decides.md +12 -0
- package/rules/principles/our-code-reads-in-the-common-language.md +12 -0
- package/rules/principles/outside-risk-is-carried-on-purpose.md +13 -0
- package/rules/principles/tests-are-ours.md +12 -0
- package/rules/principles/the-type-checker-proves-it.md +12 -0
- package/rules/principles.md +93 -0
- package/rules/record-kinds/authorised-location.md +26 -0
- package/rules/record-kinds/boundary-record.md +9 -0
- package/rules/record-kinds/debt.md +23 -0
- package/rules/record-kinds/dependency-record.md +9 -0
- package/rules/record-kinds/deviation.md +9 -0
- package/rules/records.md +137 -0
- package/rules/rules/declared-not-asserted.md +16 -0
- package/rules/rules/doer-or-orchestrator.md +16 -0
- package/rules/rules/failures-are-values.md +15 -0
- package/rules/rules/fixed-versions.md +11 -0
- package/rules/rules/guard-first.md +14 -0
- package/rules/rules/handed-what-it-uses.md +16 -0
- package/rules/rules/kinds-are-named.md +16 -0
- package/rules/rules/one-reason-per-module.md +18 -0
- package/rules/rules/one-word-everywhere.md +19 -0
- package/rules/rules/outside-dependencies-justified.md +14 -0
- package/rules/rules/outside-dependencies-stay-at-boundaries.md +18 -0
- package/rules/rules/ports-declared-inside.md +22 -0
- package/rules/rules/shipped-risk-declared.md +11 -0
- package/rules/rules/straight-through-tests.md +15 -0
- package/rules/rules/tested-where-its-owned.md +20 -0
- package/rules/rules/tools-live-in-the-repo.md +11 -0
- package/rules/rules/upstream-stays-untouched.md +11 -0
- package/rules/rules/written-out-answers.md +17 -0
- package/rules/rules.md +185 -0
- package/rules/sources.md +142 -0
- package/rules/typescript/checks.md +1685 -0
- package/rules/typescript/recipes/adapter-per-outside-party.md +18 -0
- package/rules/typescript/recipes/assert-to-narrow.md +18 -0
- package/rules/typescript/recipes/bounded-context-generic.md +19 -0
- package/rules/typescript/recipes/closure-factory.md +20 -0
- package/rules/typescript/recipes/companion-test-file.md +18 -0
- package/rules/typescript/recipes/composed-orchestrator.md +18 -0
- package/rules/typescript/recipes/composition-root.md +18 -0
- package/rules/typescript/recipes/copy-never-write-in.md +18 -0
- package/rules/typescript/recipes/declared-not-bundled.md +17 -0
- package/rules/typescript/recipes/dependency-record.md +20 -0
- package/rules/typescript/recipes/domain-vocabulary-list.md +18 -0
- package/rules/typescript/recipes/entity-module.md +20 -0
- package/rules/typescript/recipes/exact-pins-and-a-lock-file.md +18 -0
- package/rules/typescript/recipes/extension-outside-the-vendored-code.md +18 -0
- package/rules/typescript/recipes/failure-asserted-as-a-value.md +18 -0
- package/rules/typescript/recipes/failure-mapping-at-the-adapter.md +20 -0
- package/rules/typescript/recipes/fix-the-declaration-not-the-value.md +18 -0
- package/rules/typescript/recipes/functional-iteration.md +18 -0
- package/rules/typescript/recipes/guard-clauses.md +18 -0
- package/rules/typescript/recipes/integration-test-owns-its-scratch.md +18 -0
- package/rules/typescript/recipes/integration-test-suffix.md +18 -0
- package/rules/typescript/recipes/iteach-over-typed-rows.md +18 -0
- package/rules/typescript/recipes/map-out-at-the-adapter.md +18 -0
- package/rules/typescript/recipes/meaning-in-names-not-comments.md +22 -0
- package/rules/typescript/recipes/named-exported-type.md +18 -0
- package/rules/typescript/recipes/narrow-ports.md +18 -0
- package/rules/typescript/recipes/one-argument-object.md +19 -0
- package/rules/typescript/recipes/port-in-the-domain.md +19 -0
- package/rules/typescript/recipes/ports-in-the-argument.md +18 -0
- package/rules/typescript/recipes/repo-scripts-only.md +18 -0
- package/rules/typescript/recipes/result-union.md +22 -0
- package/rules/typescript/recipes/screaming-folders.md +20 -0
- package/rules/typescript/recipes/shared-strict-base-config.md +20 -0
- package/rules/typescript/recipes/stub-with-vifn.md +20 -0
- package/rules/typescript/recipes/tagged-union-and-exhaustive-switch.md +18 -0
- package/rules/typescript/recipes/whole-words.md +18 -0
- package/rules/typescript/recipes/whole-written-out-expectation.md +18 -0
- package/rules/typescript/recipes/world-values-through-a-port.md +18 -0
- package/rules/typescript/recipes/zod-at-the-producers-adapter.md +19 -0
- package/rules/typescript/recipes.md +390 -0
- package/rules/typescript/symptoms/absence-standing-for-a-state.md +36 -0
- package/rules/typescript/symptoms/adapter-built-outside-the-root.md +30 -0
- package/rules/typescript/symptoms/ambient-randomness.md +36 -0
- package/rules/typescript/symptoms/answer-set-in-a-hook.md +45 -0
- package/rules/typescript/symptoms/authored-class-or-this/class-keyword.md +30 -0
- package/rules/typescript/symptoms/authored-class-or-this/static-members-only.md +18 -0
- package/rules/typescript/symptoms/authored-class-or-this.md +49 -0
- package/rules/typescript/symptoms/behaviour-tested-away-from-its-owner.md +44 -0
- package/rules/typescript/symptoms/boolean-in-a-signature/boolean-annotation.md +30 -0
- package/rules/typescript/symptoms/boolean-in-a-signature.md +43 -0
- package/rules/typescript/symptoms/branch-in-a-test/test-body.md +213 -0
- package/rules/typescript/symptoms/branch-in-a-test.md +48 -0
- package/rules/typescript/symptoms/bundled-dependency.md +28 -0
- package/rules/typescript/symptoms/catch-all-failure-kind.md +37 -0
- package/rules/typescript/symptoms/change-spread-across-modules.md +27 -0
- package/rules/typescript/symptoms/claimed-type/cast-to-any.md +29 -0
- package/rules/typescript/symptoms/claimed-type/non-null-assertions.md +34 -0
- package/rules/typescript/symptoms/claimed-type/unlisted-cast-site.md +34 -0
- package/rules/typescript/symptoms/claimed-type.md +56 -0
- package/rules/typescript/symptoms/computed-value-in-a-test/test-body.md +144 -0
- package/rules/typescript/symptoms/computed-value-in-a-test.md +36 -0
- package/rules/typescript/symptoms/coverage-gate.md +27 -0
- package/rules/typescript/symptoms/date-used-directly/clock-sources.md +31 -0
- package/rules/typescript/symptoms/date-used-directly.md +46 -0
- package/rules/typescript/symptoms/default-for-a-required-value.md +45 -0
- package/rules/typescript/symptoms/default-on-a-closed-union/default-arm.md +32 -0
- package/rules/typescript/symptoms/default-on-a-closed-union.md +32 -0
- package/rules/typescript/symptoms/dependency-without-a-record.md +33 -0
- package/rules/typescript/symptoms/doer-calling-our-own-unit.md +36 -0
- package/rules/typescript/symptoms/double-with-a-body/logic-in-a-passed-function.md +32 -0
- package/rules/typescript/symptoms/double-with-a-body/stub-implementation.md +31 -0
- package/rules/typescript/symptoms/double-with-a-body.md +55 -0
- package/rules/typescript/symptoms/drawer-path/drawer-names.md +28 -0
- package/rules/typescript/symptoms/drawer-path.md +32 -0
- package/rules/typescript/symptoms/duplicate-decision.md +36 -0
- package/rules/typescript/symptoms/edit-inside-vendored-code.md +33 -0
- package/rules/typescript/symptoms/failure-shaped-as-success.md +28 -0
- package/rules/typescript/symptoms/floating-version.md +27 -0
- package/rules/typescript/symptoms/inherited-environment-in-a-subprocess/git-spawn-environment.md +30 -0
- package/rules/typescript/symptoms/inherited-environment-in-a-subprocess.md +33 -0
- package/rules/typescript/symptoms/inner-layer-imports-outer.md +33 -0
- package/rules/typescript/symptoms/integration-heavy-suite.md +29 -0
- package/rules/typescript/symptoms/large-input-for-a-few-fields.md +37 -0
- package/rules/typescript/symptoms/library-class-built-in-place.md +42 -0
- package/rules/typescript/symptoms/long-function/function-length.md +47 -0
- package/rules/typescript/symptoms/long-function.md +75 -0
- package/rules/typescript/symptoms/loop-keyword/loop-statement.md +34 -0
- package/rules/typescript/symptoms/loop-keyword.md +49 -0
- package/rules/typescript/symptoms/machine-touched-in-a-unit-test.md +40 -0
- package/rules/typescript/symptoms/many-spellings-of-one-concept.md +29 -0
- package/rules/typescript/symptoms/module-level-state.md +30 -0
- package/rules/typescript/symptoms/module-or-global-patched/module-mock-call.md +29 -0
- package/rules/typescript/symptoms/module-or-global-patched.md +38 -0
- package/rules/typescript/symptoms/name-off-its-casing/filename-case.md +16 -0
- package/rules/typescript/symptoms/name-off-its-casing/naming-convention.md +20 -0
- package/rules/typescript/symptoms/name-off-its-casing.md +31 -0
- package/rules/typescript/symptoms/no-lock-file.md +27 -0
- package/rules/typescript/symptoms/orchestrator-that-computes.md +27 -0
- package/rules/typescript/symptoms/outside-dependency-vocabulary-for-basic-logic.md +33 -0
- package/rules/typescript/symptoms/outside-import-past-a-boundary/import-or-require.md +44 -0
- package/rules/typescript/symptoms/outside-import-past-a-boundary.md +45 -0
- package/rules/typescript/symptoms/outside-type-in-a-signature.md +37 -0
- package/rules/typescript/symptoms/own-type-guard.md +36 -0
- package/rules/typescript/symptoms/port-named-for-a-mechanism.md +34 -0
- package/rules/typescript/symptoms/port-outside-the-domain.md +28 -0
- package/rules/typescript/symptoms/positional-parameters/parameter-count.md +30 -0
- package/rules/typescript/symptoms/positional-parameters.md +43 -0
- package/rules/typescript/symptoms/process-global-used-in-place.md +53 -0
- package/rules/typescript/symptoms/prose-in-code.md +27 -0
- package/rules/typescript/symptoms/rebinding/parameter-reassignment.md +18 -0
- package/rules/typescript/symptoms/rebinding/test-body.md +32 -0
- package/rules/typescript/symptoms/rebinding.md +36 -0
- package/rules/typescript/symptoms/schema-past-its-adapter.md +41 -0
- package/rules/typescript/symptoms/shorthand-name/identifier-names.md +29 -0
- package/rules/typescript/symptoms/shorthand-name.md +32 -0
- package/rules/typescript/symptoms/strictness-weakened/exact-optional-property-types.md +51 -0
- package/rules/typescript/symptoms/strictness-weakened/no-fallthrough-cases-in-switch.md +51 -0
- package/rules/typescript/symptoms/strictness-weakened/no-implicit-override.md +51 -0
- package/rules/typescript/symptoms/strictness-weakened/no-property-access-from-index-signature.md +51 -0
- package/rules/{CD-3/CHECKS.md → typescript/symptoms/strictness-weakened/no-unchecked-indexed-access.md} +23 -38
- package/rules/typescript/symptoms/strictness-weakened/strict.md +51 -0
- package/rules/typescript/symptoms/strictness-weakened/use-unknown-in-catch-variables.md +51 -0
- package/rules/typescript/symptoms/strictness-weakened.md +32 -0
- package/rules/typescript/symptoms/tangled-function/cognitive-complexity.md +42 -0
- package/rules/typescript/symptoms/tangled-function.md +75 -0
- package/rules/typescript/symptoms/test-of-the-type-checker.md +24 -0
- package/rules/typescript/symptoms/test-switched-off/focused-tests.md +15 -0
- package/rules/typescript/symptoms/test-switched-off/skipped-tests.md +15 -0
- package/rules/typescript/symptoms/test-switched-off.md +25 -0
- package/rules/typescript/symptoms/text-past-its-reader/test-body.md +30 -0
- package/rules/typescript/symptoms/text-past-its-reader.md +71 -0
- package/rules/typescript/symptoms/throw-between-our-units.md +46 -0
- package/rules/typescript/symptoms/throw-or-catch-in-a-test/throw-statement.md +32 -0
- package/rules/typescript/symptoms/throw-or-catch-in-a-test/try-block.md +39 -0
- package/rules/typescript/symptoms/throw-or-catch-in-a-test.md +35 -0
- package/rules/typescript/symptoms/thrown-non-error/throw-only-error.md +15 -0
- package/rules/typescript/symptoms/thrown-non-error.md +27 -0
- package/rules/typescript/symptoms/tool-fetched-at-run-time.md +27 -0
- package/rules/typescript/symptoms/tuple-as-data.md +29 -0
- package/rules/typescript/symptoms/type-derived-from-code/factory-return-types.md +29 -0
- package/rules/typescript/symptoms/type-derived-from-code.md +41 -0
- package/rules/typescript/symptoms/types-only-file.md +36 -0
- package/rules/typescript/symptoms/unasserted-call.md +29 -0
- package/rules/typescript/symptoms/unit-without-a-running-test/companion-test-file.md +28 -0
- package/rules/typescript/symptoms/unit-without-a-running-test.md +28 -0
- package/rules/{CD-5/CHECKS.md → typescript/symptoms/untracked-escape/directive-pointers.md} +12 -23
- package/rules/typescript/symptoms/untracked-escape.md +32 -0
- package/rules/typescript/symptoms/untyped-value/explicit-any.md +14 -0
- package/rules/typescript/symptoms/untyped-value/implicit-any-let.md +14 -0
- package/rules/typescript/symptoms/untyped-value.md +36 -0
- package/rules/typescript/symptoms/wide-input.md +37 -0
- package/rules/typescript/symptoms/wide-port.md +32 -0
- package/rules/typescript/symptoms/work-inside-a-condition/else-after-an-exit.md +40 -0
- package/rules/typescript/symptoms/work-inside-a-condition.md +41 -0
- package/rules/typescript/symptoms/write-into-a-parameter/parameter-mutation.md +33 -0
- package/rules/typescript/symptoms/write-into-a-parameter.md +34 -0
- package/rules/typescript/symptoms.md +821 -0
- package/{core → src/application}/conformance/conformance-testing-types.d.ts +16 -6
- package/src/audit.d.ts +20 -0
- package/{api → src}/audit.js +6 -5
- package/{core/rule-set-reader → src/domain/rule-set}/authored-rule-set-types.d.ts +2 -2
- package/{core/values → src/domain/rule-set}/edition-types.d.ts +3 -3
- package/{core/values → src/domain/rule-set}/identifier-types.d.ts +2 -2
- package/{core/conformance → src/domain/runner}/conformance-types.d.ts +1 -1
- package/{core/mechanism-port → src/domain/runner}/piece-failure-types.d.ts +1 -1
- package/{core/mechanism-port → src/domain/runner}/runner-module-types.d.ts +4 -4
- package/src/domain/runner/runner-result-types.d.ts +88 -0
- package/src/eslint-plugin.d.ts +16 -0
- package/src/eslint-plugin.js +72 -0
- package/src/hone.js +13385 -0
- package/src/infrastructure/disciplines-file/version-one-names.json +634 -0
- package/src/infrastructure/engines/eslint/authored-class-or-this/class-keyword/class-keyword.examples.json +84 -0
- package/{mechanisms/eslint/CD-14/cd14/cd14.eslint-plugin.js → src/infrastructure/engines/eslint/authored-class-or-this/class-keyword/eslint-plugin.js} +9 -10
- package/src/infrastructure/engines/eslint/authored-class-or-this/class-keyword/piece.json +12 -0
- package/src/infrastructure/engines/eslint/authored-class-or-this/static-members-only/piece.json +24 -0
- package/src/infrastructure/engines/eslint/authored-class-or-this/static-members-only/static-members-only.examples.json +36 -0
- package/src/infrastructure/engines/eslint/claimed-type/non-null-assertions/eslint-plugin.js +16 -0
- package/src/infrastructure/engines/eslint/claimed-type/non-null-assertions/non-null-assertions.examples.json +48 -0
- package/src/infrastructure/engines/eslint/claimed-type/non-null-assertions/piece.json +22 -0
- package/src/infrastructure/engines/eslint/long-function/function-length/function-length.examples.json +42 -0
- package/src/infrastructure/engines/eslint/long-function/function-length/piece.json +16 -0
- package/{mechanisms/eslint/CD-7/cd7/cd7.eslint-plugin.js → src/infrastructure/engines/eslint/name-off-its-casing/filename-case/eslint-plugin.js} +5 -4
- package/src/infrastructure/engines/eslint/name-off-its-casing/filename-case/filename-case.examples.json +60 -0
- package/src/infrastructure/engines/eslint/name-off-its-casing/filename-case/piece.json +11 -0
- package/src/infrastructure/engines/eslint/name-off-its-casing/naming-convention/eslint-plugin.js +16 -0
- package/src/infrastructure/engines/eslint/name-off-its-casing/naming-convention/naming-convention.examples.json +78 -0
- package/src/infrastructure/engines/eslint/name-off-its-casing/naming-convention/piece.json +214 -0
- package/src/infrastructure/engines/eslint/positional-parameters/parameter-count/eslint-plugin.js +16 -0
- package/src/infrastructure/engines/eslint/positional-parameters/parameter-count/parameter-count.examples.json +30 -0
- package/src/infrastructure/engines/eslint/positional-parameters/parameter-count/piece.json +18 -0
- package/src/infrastructure/engines/eslint/rebinding/parameter-reassignment/eslint-plugin.js +16 -0
- package/src/infrastructure/engines/eslint/rebinding/parameter-reassignment/parameter-reassignment.examples.json +30 -0
- package/src/infrastructure/engines/eslint/rebinding/parameter-reassignment/piece.json +17 -0
- package/{mechanisms → src/infrastructure/engines}/eslint/runner/README.md +5 -5
- package/{mechanisms/eslint/runner → src/infrastructure/engines/eslint/runner/pieces}/eslint-piece-settings-types.d.ts +1 -1
- package/{mechanisms → src/infrastructure/engines}/eslint/runner/runner.js +2189 -1371
- package/{mechanisms/eslint/CD-41 → src/infrastructure/engines/eslint/tangled-function/cognitive-complexity}/README.md +1 -1
- package/src/infrastructure/engines/eslint/tangled-function/cognitive-complexity/cognitive-complexity.examples.json +48 -0
- package/{mechanisms/eslint/CD-41/cd41/cd41.eslint-plugin.js → src/infrastructure/engines/eslint/tangled-function/cognitive-complexity/eslint-plugin.js} +58 -14
- package/src/infrastructure/engines/eslint/tangled-function/cognitive-complexity/piece.json +12 -0
- package/{mechanisms/eslint/CD-27/cd27/cd27.eslint-plugin.js → src/infrastructure/engines/eslint/test-switched-off/focused-tests/eslint-plugin.js} +5 -4
- package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/focused-tests.examples.json +60 -0
- package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/piece.json +12 -0
- package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/piece.json +16 -0
- package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/skipped-tests.examples.json +54 -0
- package/{mechanisms/eslint/CD-10/cd10/cd10.eslint-plugin.js → src/infrastructure/engines/eslint/thrown-non-error/throw-only-error/eslint-plugin.js} +5 -4
- package/src/infrastructure/engines/eslint/thrown-non-error/throw-only-error/piece.json +12 -0
- package/src/infrastructure/engines/eslint/thrown-non-error/throw-only-error/throw-only-error.examples.json +54 -0
- package/{mechanisms/eslint/CD-1/cd1/cd1.eslint-plugin.js → src/infrastructure/engines/eslint/untyped-value/explicit-any/eslint-plugin.js} +14 -9
- package/src/infrastructure/engines/eslint/untyped-value/explicit-any/explicit-any.examples.json +36 -0
- package/src/infrastructure/engines/eslint/untyped-value/explicit-any/piece.json +12 -0
- package/src/infrastructure/engines/eslint/untyped-value/implicit-any-let/implicit-any-let.examples.json +48 -0
- package/src/infrastructure/engines/eslint/untyped-value/implicit-any-let/piece.json +16 -0
- package/src/infrastructure/engines/eslint/work-inside-a-condition/else-after-an-exit/else-after-an-exit.examples.json +36 -0
- package/{mechanisms/eslint/CD-42/cd42/cd42.eslint-plugin.js → src/infrastructure/engines/eslint/work-inside-a-condition/else-after-an-exit/eslint-plugin.js} +29 -13
- package/src/infrastructure/engines/eslint/work-inside-a-condition/else-after-an-exit/piece.json +12 -0
- package/src/infrastructure/engines/walker/authored-class-or-this/class-keyword/class-keyword.examples.json +84 -0
- package/{mechanisms/audit/CD-14 → src/infrastructure/engines/walker/authored-class-or-this/class-keyword}/class-syntax.js +6 -3
- package/src/infrastructure/engines/walker/authored-class-or-this/class-keyword/piece.json +10 -0
- package/src/infrastructure/engines/walker/boolean-in-a-signature/boolean-annotation/boolean-annotation.examples.json +42 -0
- package/{mechanisms/audit/CD-43 → src/infrastructure/engines/walker/boolean-in-a-signature/boolean-annotation}/boolean-signatures.js +14 -6
- package/src/infrastructure/engines/walker/boolean-in-a-signature/boolean-annotation/piece.json +9 -0
- package/src/infrastructure/engines/walker/branch-in-a-test/test-body/piece.json +95 -0
- package/{mechanisms/audit/CD-27 → src/infrastructure/engines/walker/branch-in-a-test/test-body}/test-body-logic.js +188 -56
- package/src/infrastructure/engines/walker/branch-in-a-test/test-body/test-body.examples.json +280 -0
- package/{mechanisms/audit/CD-1 → src/infrastructure/engines/walker/claimed-type/cast-to-any}/any-cast.js +7 -4
- package/src/infrastructure/engines/walker/claimed-type/cast-to-any/cast-to-any.examples.json +48 -0
- package/src/infrastructure/engines/walker/claimed-type/cast-to-any/piece.json +9 -0
- package/{mechanisms/audit/CD-2 → src/infrastructure/engines/walker/claimed-type/unlisted-cast-site}/cast-expressions.js +13 -6
- package/src/infrastructure/engines/walker/claimed-type/unlisted-cast-site/piece.json +14 -0
- package/src/infrastructure/engines/walker/claimed-type/unlisted-cast-site/unlisted-cast-site.examples.json +54 -0
- package/src/infrastructure/engines/walker/computed-value-in-a-test/test-body/piece.json +18 -0
- package/src/infrastructure/engines/walker/date-used-directly/clock-sources/clock-sources.examples.json +30 -0
- package/src/infrastructure/engines/walker/date-used-directly/clock-sources/clock-sources.js +36 -0
- package/src/infrastructure/engines/walker/date-used-directly/clock-sources/piece.json +9 -0
- package/src/infrastructure/engines/walker/default-on-a-closed-union/default-arm/default-arm.examples.json +36 -0
- package/src/infrastructure/engines/walker/default-on-a-closed-union/default-arm/piece.json +9 -0
- package/src/infrastructure/engines/walker/default-on-a-closed-union/default-arm/switch-defaults.js +54 -0
- package/src/infrastructure/engines/walker/double-with-a-body/logic-in-a-passed-function/piece.json +18 -0
- package/{mechanisms/audit/CD-25 → src/infrastructure/engines/walker/double-with-a-body/stub-implementation}/dependency-isolation.js +8 -4
- package/src/infrastructure/engines/walker/double-with-a-body/stub-implementation/piece.json +9 -0
- package/src/infrastructure/engines/walker/double-with-a-body/stub-implementation/stub-implementation.examples.json +36 -0
- package/{mechanisms/audit/CD-7 → src/infrastructure/engines/walker/drawer-path/drawer-names}/categorical-paths.js +23 -8
- package/src/infrastructure/engines/walker/drawer-path/drawer-names/drawer-names.examples.json +42 -0
- package/src/infrastructure/engines/walker/drawer-path/drawer-names/piece.json +9 -0
- package/src/infrastructure/engines/walker/inherited-environment-in-a-subprocess/git-spawn-environment/git-spawn-environment.examples.json +36 -0
- package/{mechanisms/audit/CD-47 → src/infrastructure/engines/walker/inherited-environment-in-a-subprocess/git-spawn-environment}/hermetic-git-spawns.js +13 -4
- package/src/infrastructure/engines/walker/inherited-environment-in-a-subprocess/git-spawn-environment/piece.json +9 -0
- package/src/infrastructure/engines/walker/loop-keyword/loop-statement/loop-statement.examples.json +48 -0
- package/{mechanisms/audit/CD-15 → src/infrastructure/engines/walker/loop-keyword/loop-statement}/loops.js +12 -4
- package/src/infrastructure/engines/walker/loop-keyword/loop-statement/piece.json +9 -0
- package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/module-mock-call.examples.json +36 -0
- package/{mechanisms/audit/CD-26 → src/infrastructure/engines/walker/module-or-global-patched/module-mock-call}/module-mocking.js +8 -4
- package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/piece.json +9 -0
- package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/import-boundaries.js +133 -0
- package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/import-or-require.examples.json +42 -0
- package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/piece.json +14 -0
- package/src/infrastructure/engines/walker/rebinding/test-body/piece.json +18 -0
- package/{mechanisms/audit/runner → src/infrastructure/engines/walker/runner/pieces}/walker-piece.d.ts +8 -14
- package/{mechanisms/audit → src/infrastructure/engines/walker}/runner/runner.js +194 -121
- package/{mechanisms/audit/runner → src/infrastructure/engines/walker/runner/toolchain}/typescript-parse.d.ts +1 -0
- package/src/infrastructure/engines/walker/shorthand-name/identifier-names/identifier-names.examples.json +42 -0
- package/{mechanisms/audit/CD-6 → src/infrastructure/engines/walker/shorthand-name/identifier-names}/identifier-names.js +32 -15
- package/src/infrastructure/engines/walker/shorthand-name/identifier-names/piece.json +9 -0
- package/src/infrastructure/engines/walker/strictness-weakened/exact-optional-property-types/exact-optional-property-types.examples.json +71 -0
- package/src/infrastructure/engines/walker/strictness-weakened/exact-optional-property-types/piece.json +17 -0
- package/src/infrastructure/engines/walker/strictness-weakened/no-fallthrough-cases-in-switch/no-fallthrough-cases-in-switch.examples.json +71 -0
- package/src/infrastructure/engines/walker/strictness-weakened/no-fallthrough-cases-in-switch/piece.json +17 -0
- package/src/infrastructure/engines/walker/strictness-weakened/no-implicit-override/no-implicit-override.examples.json +71 -0
- package/src/infrastructure/engines/walker/strictness-weakened/no-implicit-override/piece.json +17 -0
- package/src/infrastructure/engines/walker/strictness-weakened/no-property-access-from-index-signature/no-property-access-from-index-signature.examples.json +71 -0
- package/src/infrastructure/engines/walker/strictness-weakened/no-property-access-from-index-signature/piece.json +17 -0
- package/src/infrastructure/engines/walker/strictness-weakened/no-unchecked-indexed-access/no-unchecked-indexed-access.examples.json +71 -0
- package/src/infrastructure/engines/walker/strictness-weakened/no-unchecked-indexed-access/piece.json +17 -0
- package/{mechanisms/audit/CD-3 → src/infrastructure/engines/walker/strictness-weakened/strict}/compiler-overrides.js +102 -38
- package/src/infrastructure/engines/walker/strictness-weakened/strict/piece.json +13 -0
- package/src/infrastructure/engines/walker/strictness-weakened/strict/strict.examples.json +64 -0
- package/src/infrastructure/engines/walker/strictness-weakened/use-unknown-in-catch-variables/piece.json +17 -0
- package/src/infrastructure/engines/walker/strictness-weakened/use-unknown-in-catch-variables/use-unknown-in-catch-variables.examples.json +71 -0
- package/src/infrastructure/engines/walker/text-past-its-reader/test-body/piece.json +18 -0
- package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/piece.json +9 -0
- package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/throw-statement.examples.json +36 -0
- package/{mechanisms/audit/CD-10 → src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement}/throws-in-tests.js +6 -3
- package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/try-block/piece.json +18 -0
- package/src/infrastructure/engines/walker/type-derived-from-code/factory-return-types/factory-return-types.examples.json +36 -0
- package/{mechanisms/audit/CD-7a → src/infrastructure/engines/walker/type-derived-from-code/factory-return-types}/factory-return-types.js +5 -3
- package/src/infrastructure/engines/walker/type-derived-from-code/factory-return-types/piece.json +9 -0
- package/src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file/companion-test-file.examples.json +36 -0
- package/{mechanisms/audit/CD-23 → src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file}/export-test-sibling.js +7 -4
- package/src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file/piece.json +9 -0
- package/{mechanisms/audit/CD-5 → src/infrastructure/engines/walker/untracked-escape/directive-pointers}/comments-directives.js +40 -19
- package/src/infrastructure/engines/walker/untracked-escape/directive-pointers/directive-pointers.examples.json +96 -0
- package/src/infrastructure/engines/walker/untracked-escape/directive-pointers/piece.json +16 -0
- package/src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation/parameter-mutation.examples.json +42 -0
- package/{mechanisms/audit/CD-44 → src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation}/parameter-mutation.js +22 -7
- package/src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation/piece.json +9 -0
- package/src/rule-set.d.ts +4 -0
- package/src/testing.d.ts +7 -0
- package/src/testing.js +524 -0
- package/api/audit.d.ts +0 -20
- package/api/rule-set.d.ts +0 -4
- package/api/testing.d.ts +0 -5
- package/api/testing.js +0 -238
- package/chunks/chunk-335ITLPO.js +0 -7
- package/chunks/chunk-6SM3HKWO.js +0 -1912
- package/chunks/chunk-E6VR3VRV.js +0 -268
- package/chunks/chunk-FR4FASVM.js +0 -108
- package/chunks/chunk-LDQUT742.js +0 -15
- package/chunks/chunk-MXSIQPCV.js +0 -13
- package/chunks/chunk-RWQ4UNKY.js +0 -24
- package/core/check/tool-command.js +0 -2586
- package/core/mechanism-port/runner-result-types.d.ts +0 -15
- package/mechanisms/audit/CD-1/piece.json +0 -13
- package/mechanisms/audit/CD-10/piece.json +0 -13
- package/mechanisms/audit/CD-14/piece.json +0 -13
- package/mechanisms/audit/CD-15/piece.json +0 -13
- package/mechanisms/audit/CD-17/clock-sources.js +0 -28
- package/mechanisms/audit/CD-17/piece.json +0 -13
- package/mechanisms/audit/CD-19/import-boundaries.js +0 -99
- package/mechanisms/audit/CD-19/piece.json +0 -18
- package/mechanisms/audit/CD-2/piece.json +0 -18
- package/mechanisms/audit/CD-23/piece.json +0 -13
- package/mechanisms/audit/CD-25/piece.json +0 -13
- package/mechanisms/audit/CD-26/piece.json +0 -13
- package/mechanisms/audit/CD-27/piece.json +0 -17
- package/mechanisms/audit/CD-3/piece.json +0 -77
- package/mechanisms/audit/CD-43/piece.json +0 -13
- package/mechanisms/audit/CD-44/piece.json +0 -13
- package/mechanisms/audit/CD-47/piece.json +0 -13
- package/mechanisms/audit/CD-5/piece.json +0 -20
- package/mechanisms/audit/CD-6/piece.json +0 -13
- package/mechanisms/audit/CD-7/piece.json +0 -13
- package/mechanisms/audit/CD-7a/piece.json +0 -13
- package/mechanisms/audit/CD-8/piece.json +0 -13
- package/mechanisms/audit/CD-8/switch-defaults.js +0 -42
- package/mechanisms/eslint/CD-1/piece.json +0 -23
- package/mechanisms/eslint/CD-10/piece.json +0 -15
- package/mechanisms/eslint/CD-14/piece.json +0 -31
- package/mechanisms/eslint/CD-2/cd2/cd2.eslint-plugin.js +0 -15
- package/mechanisms/eslint/CD-2/piece.json +0 -25
- package/mechanisms/eslint/CD-27/piece.json +0 -23
- package/mechanisms/eslint/CD-40/cd40/cd40.eslint-plugin.js +0 -15
- package/mechanisms/eslint/CD-40/piece.json +0 -21
- package/mechanisms/eslint/CD-41/piece.json +0 -23
- package/mechanisms/eslint/CD-42/piece.json +0 -15
- package/mechanisms/eslint/CD-44/cd44/cd44.eslint-plugin.js +0 -15
- package/mechanisms/eslint/CD-44/piece.json +0 -20
- package/mechanisms/eslint/CD-6/cd6/cd6.eslint-plugin.js +0 -15
- package/mechanisms/eslint/CD-6/piece.json +0 -217
- package/mechanisms/eslint/CD-7/piece.json +0 -15
- package/rules/CD-1/CHECKS.md +0 -39
- package/rules/CD-1/README.md +0 -28
- package/rules/CD-1/discipline.json +0 -195
- package/rules/CD-10/CHECKS.md +0 -49
- package/rules/CD-10/README.md +0 -27
- package/rules/CD-10/discipline.json +0 -133
- package/rules/CD-11/CHECKS.md +0 -13
- package/rules/CD-11/README.md +0 -25
- package/rules/CD-11/discipline.json +0 -12
- package/rules/CD-12/CHECKS.md +0 -13
- package/rules/CD-12/README.md +0 -25
- package/rules/CD-12/discipline.json +0 -12
- package/rules/CD-13/CHECKS.md +0 -13
- package/rules/CD-13/README.md +0 -25
- package/rules/CD-13/discipline.json +0 -12
- package/rules/CD-14/CHECKS.md +0 -49
- package/rules/CD-14/README.md +0 -28
- package/rules/CD-14/discipline.json +0 -173
- package/rules/CD-15/CHECKS.md +0 -42
- package/rules/CD-15/README.md +0 -30
- package/rules/CD-15/discipline.json +0 -73
- package/rules/CD-16/CHECKS.md +0 -7
- package/rules/CD-16/README.md +0 -15
- package/rules/CD-17/CHECKS.md +0 -37
- package/rules/CD-17/README.md +0 -28
- package/rules/CD-17/discipline.json +0 -51
- package/rules/CD-18/CHECKS.md +0 -13
- package/rules/CD-18/README.md +0 -25
- package/rules/CD-18/discipline.json +0 -12
- package/rules/CD-19/CHECKS.md +0 -49
- package/rules/CD-19/README.md +0 -29
- package/rules/CD-19/discipline.json +0 -63
- package/rules/CD-2/CHECKS.md +0 -58
- package/rules/CD-2/README.md +0 -30
- package/rules/CD-2/discipline.json +0 -151
- package/rules/CD-20/CHECKS.md +0 -7
- package/rules/CD-20/README.md +0 -15
- package/rules/CD-21/CHECKS.md +0 -13
- package/rules/CD-21/README.md +0 -24
- package/rules/CD-21/discipline.json +0 -12
- package/rules/CD-22/CHECKS.md +0 -13
- package/rules/CD-22/README.md +0 -24
- package/rules/CD-22/discipline.json +0 -12
- package/rules/CD-23/CHECKS.md +0 -35
- package/rules/CD-23/README.md +0 -26
- package/rules/CD-23/discipline.json +0 -57
- package/rules/CD-24/CHECKS.md +0 -7
- package/rules/CD-24/README.md +0 -15
- package/rules/CD-25/CHECKS.md +0 -38
- package/rules/CD-25/README.md +0 -31
- package/rules/CD-25/discipline.json +0 -57
- package/rules/CD-26/CHECKS.md +0 -36
- package/rules/CD-26/README.md +0 -29
- package/rules/CD-26/discipline.json +0 -57
- package/rules/CD-27/CHECKS.md +0 -451
- package/rules/CD-27/README.md +0 -29
- package/rules/CD-27/discipline.json +0 -437
- package/rules/CD-28/CHECKS.md +0 -13
- package/rules/CD-28/README.md +0 -25
- package/rules/CD-28/discipline.json +0 -12
- package/rules/CD-29/CHECKS.md +0 -13
- package/rules/CD-29/README.md +0 -23
- package/rules/CD-29/discipline.json +0 -12
- package/rules/CD-3/README.md +0 -26
- package/rules/CD-3/discipline.json +0 -641
- package/rules/CD-30/CHECKS.md +0 -13
- package/rules/CD-30/README.md +0 -24
- package/rules/CD-30/discipline.json +0 -12
- package/rules/CD-31/CHECKS.md +0 -13
- package/rules/CD-31/README.md +0 -23
- package/rules/CD-31/discipline.json +0 -12
- package/rules/CD-32/CHECKS.md +0 -13
- package/rules/CD-32/README.md +0 -24
- package/rules/CD-32/discipline.json +0 -12
- package/rules/CD-33/CHECKS.md +0 -13
- package/rules/CD-33/README.md +0 -24
- package/rules/CD-33/discipline.json +0 -12
- package/rules/CD-34/CHECKS.md +0 -13
- package/rules/CD-34/README.md +0 -23
- package/rules/CD-34/discipline.json +0 -12
- package/rules/CD-39/CHECKS.md +0 -13
- package/rules/CD-39/README.md +0 -24
- package/rules/CD-39/discipline.json +0 -12
- package/rules/CD-4/CHECKS.md +0 -13
- package/rules/CD-4/README.md +0 -26
- package/rules/CD-4/discipline.json +0 -12
- package/rules/CD-40/CHECKS.md +0 -39
- package/rules/CD-40/README.md +0 -29
- package/rules/CD-40/discipline.json +0 -58
- package/rules/CD-41/CHECKS.md +0 -64
- package/rules/CD-41/README.md +0 -31
- package/rules/CD-41/discipline.json +0 -138
- package/rules/CD-42/CHECKS.md +0 -47
- package/rules/CD-42/README.md +0 -25
- package/rules/CD-42/discipline.json +0 -61
- package/rules/CD-43/CHECKS.md +0 -37
- package/rules/CD-43/README.md +0 -27
- package/rules/CD-43/discipline.json +0 -65
- package/rules/CD-44/CHECKS.md +0 -48
- package/rules/CD-44/README.md +0 -26
- package/rules/CD-44/discipline.json +0 -111
- package/rules/CD-45/CHECKS.md +0 -13
- package/rules/CD-45/README.md +0 -25
- package/rules/CD-45/discipline.json +0 -12
- package/rules/CD-46/CHECKS.md +0 -7
- package/rules/CD-46/README.md +0 -25
- package/rules/CD-47/CHECKS.md +0 -37
- package/rules/CD-47/README.md +0 -31
- package/rules/CD-47/discipline.json +0 -57
- package/rules/CD-5/README.md +0 -28
- package/rules/CD-5/discipline.json +0 -131
- package/rules/CD-6/CHECKS.md +0 -51
- package/rules/CD-6/README.md +0 -28
- package/rules/CD-6/discipline.json +0 -165
- package/rules/CD-7/CHECKS.md +0 -46
- package/rules/CD-7/README.md +0 -29
- package/rules/CD-7/discipline.json +0 -142
- package/rules/CD-7a/CHECKS.md +0 -38
- package/rules/CD-7a/README.md +0 -26
- package/rules/CD-7a/discipline.json +0 -57
- package/rules/CD-8/CHECKS.md +0 -42
- package/rules/CD-8/README.md +0 -26
- package/rules/CD-8/discipline.json +0 -57
- package/rules/CD-9/CHECKS.md +0 -13
- package/rules/CD-9/README.md +0 -26
- package/rules/CD-9/discipline.json +0 -12
- /package/{core/values → src/domain/finding}/anchor.d.ts +0 -0
- /package/{core/values → src/domain/repository}/branded.d.ts +0 -0
- /package/{core/values → src/domain/repository}/repo-path-types.d.ts +0 -0
- /package/{core/values → src/domain}/result.d.ts +0 -0
- /package/{core/values → src/domain/rule-set}/clause-address-types.d.ts +0 -0
- /package/{core/values → src/domain/settings/json-values}/json-value.d.ts +0 -0
- /package/{mechanisms/eslint/CD-14 → src/infrastructure/engines/eslint/authored-class-or-this/class-keyword}/README.md +0 -0
- /package/{mechanisms/eslint/CD-2 → src/infrastructure/engines/eslint/claimed-type/non-null-assertions}/README.md +0 -0
- /package/{mechanisms/eslint/CD-7 → src/infrastructure/engines/eslint/name-off-its-casing/filename-case}/README.md +0 -0
- /package/{mechanisms/eslint/CD-6 → src/infrastructure/engines/eslint/name-off-its-casing/naming-convention}/README.md +0 -0
- /package/{mechanisms/eslint/CD-40 → src/infrastructure/engines/eslint/positional-parameters/parameter-count}/README.md +0 -0
- /package/{mechanisms/eslint/CD-44 → src/infrastructure/engines/eslint/rebinding/parameter-reassignment}/README.md +0 -0
- /package/{mechanisms/eslint/CD-27 → src/infrastructure/engines/eslint/test-switched-off/focused-tests}/README.md +0 -0
- /package/{mechanisms/eslint/CD-10 → src/infrastructure/engines/eslint/thrown-non-error/throw-only-error}/README.md +0 -0
- /package/{mechanisms/eslint/CD-1 → src/infrastructure/engines/eslint/untyped-value/explicit-any}/README.md +0 -0
- /package/{mechanisms/eslint/CD-42 → src/infrastructure/engines/eslint/work-inside-a-condition/else-after-an-exit}/README.md +0 -0
- /package/{mechanisms/audit → src/infrastructure/engines/walker}/runner/README.md +0 -0
- /package/{api → src}/rule-set.js +0 -0
|
@@ -0,0 +1,608 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ENGINE_REGISTRY,
|
|
3
|
+
NO_VERSION_ONE_NAMES,
|
|
4
|
+
SUPPORTED_VERSION,
|
|
5
|
+
VERSION_ONE_NAMES_SEGMENTS,
|
|
6
|
+
caseWireSchema,
|
|
7
|
+
catalogueClausesOf,
|
|
8
|
+
catalogueContentFromFile,
|
|
9
|
+
catalogueFileSchema,
|
|
10
|
+
checkWireSchema,
|
|
11
|
+
readVersionOneNames,
|
|
12
|
+
recordKindNameSchema,
|
|
13
|
+
recordKindWireSchema,
|
|
14
|
+
symptomWireSchema
|
|
15
|
+
} from "./chunk-IX2VZTBO.js";
|
|
16
|
+
import {
|
|
17
|
+
checkAddressTextOf,
|
|
18
|
+
checkNamesOf,
|
|
19
|
+
engineFolderOf,
|
|
20
|
+
enginesFolderSegmentsOf,
|
|
21
|
+
isCatalogueName,
|
|
22
|
+
parsedJson,
|
|
23
|
+
pieceFileSchema,
|
|
24
|
+
readNamedPiece,
|
|
25
|
+
readVersionOneJson
|
|
26
|
+
} from "./chunk-R75QELTA.js";
|
|
27
|
+
import {
|
|
28
|
+
absolutePathSchema
|
|
29
|
+
} from "./chunk-GNOMK7CR.js";
|
|
30
|
+
|
|
31
|
+
// src/domain/language-layer/symptom-catalogue-location.ts
|
|
32
|
+
var SYMPTOM_CATALOGUE_SEGMENTS = ["rules"];
|
|
33
|
+
var CHECK_ITEMS_SEGMENTS = [
|
|
34
|
+
...SYMPTOM_CATALOGUE_SEGMENTS,
|
|
35
|
+
"typescript",
|
|
36
|
+
"symptoms"
|
|
37
|
+
];
|
|
38
|
+
var checkItemSegments = (request) => [
|
|
39
|
+
...CHECK_ITEMS_SEGMENTS,
|
|
40
|
+
request.check.symptom.name,
|
|
41
|
+
`${request.check.name}.md`
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
// src/domain/language-layer/catalogue-binding.ts
|
|
45
|
+
var boundCheckOf = (request) => ({
|
|
46
|
+
check: request.check,
|
|
47
|
+
engines: request.bindings.get(checkAddressTextOf(request)) ?? []
|
|
48
|
+
});
|
|
49
|
+
var checkOf = (bound) => ({ ...bound.check, engines: bound.engines });
|
|
50
|
+
var catalogueBoundTo = (request) => {
|
|
51
|
+
const bound = request.content.checks.map(
|
|
52
|
+
(check) => boundCheckOf({ check, bindings: request.bindings })
|
|
53
|
+
);
|
|
54
|
+
const unrun = bound.filter((each) => each.engines.length === 0).map((each) => checkAddressTextOf({ check: each.check }));
|
|
55
|
+
return unrun.length > 0 ? { outcome: "failed", error: `no piece runs the clause of ${unrun.join(", ")}` } : { outcome: "ok", value: { ...request.content, checks: bound.map(checkOf) } };
|
|
56
|
+
};
|
|
57
|
+
var holdingBoundTo = (request) => {
|
|
58
|
+
if (request.holding.held === "none") {
|
|
59
|
+
return { outcome: "ok", value: request.holding };
|
|
60
|
+
}
|
|
61
|
+
const catalogue = catalogueBoundTo({
|
|
62
|
+
content: request.holding.content,
|
|
63
|
+
bindings: request.bindings
|
|
64
|
+
});
|
|
65
|
+
return catalogue.outcome === "failed" ? catalogue : { outcome: "ok", value: { held: "catalogue", catalogue: catalogue.value } };
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// src/infrastructure/engines/piece-engines.ts
|
|
69
|
+
import { z } from "zod";
|
|
70
|
+
var PIECE_FILE = "piece.json";
|
|
71
|
+
var allBound = (bounds) => {
|
|
72
|
+
const failure = bounds.find((bound) => bound.outcome === "failed");
|
|
73
|
+
return failure ?? {
|
|
74
|
+
outcome: "ok",
|
|
75
|
+
value: bounds.flatMap((bound) => bound.outcome === "ok" ? bound.value : [])
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
var bindingsOfPiece = (request) => {
|
|
79
|
+
const path = request.source.path.join({
|
|
80
|
+
segments: [request.mechanismFolder, request.piece, PIECE_FILE]
|
|
81
|
+
});
|
|
82
|
+
if (request.source.fileText.exists({ path }) === "absent") {
|
|
83
|
+
return { outcome: "ok", value: [] };
|
|
84
|
+
}
|
|
85
|
+
const document = readVersionOneJson({ fileText: request.source.fileText, path });
|
|
86
|
+
if (document.outcome === "failed") {
|
|
87
|
+
return document;
|
|
88
|
+
}
|
|
89
|
+
const piece = pieceFileSchema.safeParse(document.value);
|
|
90
|
+
return piece.success ? {
|
|
91
|
+
outcome: "ok",
|
|
92
|
+
value: request.checks.filter(
|
|
93
|
+
({ clause }) => clause.discipline === piece.data.discipline && piece.data.clauses.some((entry) => entry.clause === clause.clause)
|
|
94
|
+
).map((check) => ({ address: checkAddressTextOf({ check }), engine: request.engine }))
|
|
95
|
+
} : {
|
|
96
|
+
outcome: "failed",
|
|
97
|
+
error: { kind: "file-malformed", path, detail: z.prettifyError(piece.error) }
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
var bindingsOfEngine = (request) => {
|
|
101
|
+
const joined = request.source.path.join({
|
|
102
|
+
segments: [
|
|
103
|
+
...request.enginesFolder,
|
|
104
|
+
engineFolderOf({ ...request.source, mechanism: request.engine.name })
|
|
105
|
+
]
|
|
106
|
+
});
|
|
107
|
+
const mechanismFolder = absolutePathSchema.safeParse(joined);
|
|
108
|
+
if (!mechanismFolder.success) {
|
|
109
|
+
return {
|
|
110
|
+
outcome: "failed",
|
|
111
|
+
error: { kind: "file-unreadable", path: joined, detail: "is not an absolute path" }
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
if (request.source.fileText.exists({ path: mechanismFolder.data }) === "absent") {
|
|
115
|
+
return { outcome: "ok", value: [] };
|
|
116
|
+
}
|
|
117
|
+
const entries = request.source.directory.list({ path: mechanismFolder.data });
|
|
118
|
+
if (entries.outcome === "failed") {
|
|
119
|
+
return {
|
|
120
|
+
outcome: "failed",
|
|
121
|
+
error: { kind: "file-unreadable", path: entries.error.path, detail: entries.error.detail }
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
const pieces = entries.value.filter((entry) => entry.kind === "directory").map((entry) => entry.name);
|
|
125
|
+
return allBound(
|
|
126
|
+
pieces.toSorted().map(
|
|
127
|
+
(piece) => bindingsOfPiece({ ...request, mechanismFolder: mechanismFolder.data, piece })
|
|
128
|
+
)
|
|
129
|
+
);
|
|
130
|
+
};
|
|
131
|
+
var bindingsByAddress = (bindings) => {
|
|
132
|
+
const byAddress = /* @__PURE__ */ new Map();
|
|
133
|
+
bindings.forEach(({ address, engine }) => {
|
|
134
|
+
const engines = byAddress.get(address) ?? [];
|
|
135
|
+
if (!engines.some(({ name }) => name === engine.name)) {
|
|
136
|
+
byAddress.set(address, [...engines, engine]);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
return byAddress;
|
|
140
|
+
};
|
|
141
|
+
var namedBindingOf = (request) => {
|
|
142
|
+
const address = checkAddressTextOf(request);
|
|
143
|
+
const names = checkNamesOf({ text: address });
|
|
144
|
+
if (names === void 0) {
|
|
145
|
+
return { outcome: "ok", value: [] };
|
|
146
|
+
}
|
|
147
|
+
const piece = readNamedPiece({ ...request.source, ...names, mechanism: request.engine.name });
|
|
148
|
+
if (piece.outcome === "ok") {
|
|
149
|
+
return { outcome: "ok", value: [{ address, engine: request.engine }] };
|
|
150
|
+
}
|
|
151
|
+
return piece.error.kind === "piece-missing" ? { outcome: "ok", value: [] } : piece;
|
|
152
|
+
};
|
|
153
|
+
var readEngineBindings = (source, checks) => {
|
|
154
|
+
const enginesFolder = [source.ruleSetRoot, ...enginesFolderSegmentsOf(source)];
|
|
155
|
+
const installed = source.ruleSetRoot === source.installRoot;
|
|
156
|
+
const bound = allBound(
|
|
157
|
+
ENGINE_REGISTRY.flatMap(
|
|
158
|
+
(engine) => installed ? checks.map((check) => namedBindingOf({ source, engine, check })) : [bindingsOfEngine({ source, enginesFolder, engine, checks })]
|
|
159
|
+
)
|
|
160
|
+
);
|
|
161
|
+
return bound.outcome === "failed" ? bound : { outcome: "ok", value: bindingsByAddress(bound.value) };
|
|
162
|
+
};
|
|
163
|
+
var createEngineBindingsRepository = (options) => ({
|
|
164
|
+
read: (request) => readEngineBindings(options, request.checks)
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// src/infrastructure/content-files/item-folders/item-document.ts
|
|
168
|
+
var ofKind = (kind) => (placed2) => placed2.item.kind === kind;
|
|
169
|
+
var allAssembled = (assembled) => {
|
|
170
|
+
const failure = assembled.find((each) => each.outcome === "failed");
|
|
171
|
+
return failure?.outcome === "failed" ? failure : {
|
|
172
|
+
outcome: "ok",
|
|
173
|
+
value: assembled.flatMap((each) => each.outcome === "ok" ? [each.value] : [])
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
var recordKindOf = (request) => {
|
|
177
|
+
const { placed: placed2 } = request;
|
|
178
|
+
const name = recordKindNameSchema.safeParse(placed2.name);
|
|
179
|
+
return name.success ? {
|
|
180
|
+
outcome: "ok",
|
|
181
|
+
value: {
|
|
182
|
+
name: name.data,
|
|
183
|
+
title: placed2.title,
|
|
184
|
+
...placed2.item.facts,
|
|
185
|
+
todaysFormat: request.formatsOfToday[name.data] ?? "none-yet"
|
|
186
|
+
}
|
|
187
|
+
} : { outcome: "failed", error: `${placed2.name} is not the name of a record kind` };
|
|
188
|
+
};
|
|
189
|
+
var ruleOf = (placed2) => ({
|
|
190
|
+
name: placed2.name,
|
|
191
|
+
title: placed2.title,
|
|
192
|
+
principle: placed2.item.facts.principle,
|
|
193
|
+
standing: placed2.item.facts.standing
|
|
194
|
+
});
|
|
195
|
+
var checkOf2 = (request) => {
|
|
196
|
+
const symptom = request.placed.within ?? "";
|
|
197
|
+
const address = `${symptom}#${request.placed.name}`;
|
|
198
|
+
const clause = request.clauseOfCheck.get(address);
|
|
199
|
+
return clause === void 0 ? { outcome: "failed", error: `${address} is named by no clause in the version 1 names` } : {
|
|
200
|
+
outcome: "ok",
|
|
201
|
+
value: { symptom, name: request.placed.name, clause, ...request.placed.item.facts }
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
var unheldChecksOf = (request) => {
|
|
205
|
+
const held = new Set(request.checks.map((check) => `${check.symptom}#${check.name}`));
|
|
206
|
+
return [...request.clauseOfCheck.keys()].filter((address) => !held.has(address));
|
|
207
|
+
};
|
|
208
|
+
var catalogueFileOf = (request) => {
|
|
209
|
+
const { items, beside } = request;
|
|
210
|
+
const recordKinds = allAssembled(
|
|
211
|
+
items.filter(ofKind("record-kind")).map((placed2) => recordKindOf({ placed: placed2, formatsOfToday: beside.formatsOfToday }))
|
|
212
|
+
);
|
|
213
|
+
if (recordKinds.outcome === "failed") {
|
|
214
|
+
return recordKinds;
|
|
215
|
+
}
|
|
216
|
+
const checks = allAssembled(
|
|
217
|
+
items.filter(ofKind("check")).map((placed2) => checkOf2({ placed: placed2, clauseOfCheck: beside.clauseOfCheck }))
|
|
218
|
+
);
|
|
219
|
+
if (checks.outcome === "failed") {
|
|
220
|
+
return checks;
|
|
221
|
+
}
|
|
222
|
+
const [unheld] = unheldChecksOf({ checks: checks.value, clauseOfCheck: beside.clauseOfCheck });
|
|
223
|
+
if (unheld !== void 0) {
|
|
224
|
+
return { outcome: "failed", error: `the version 1 names give ${unheld}, which no item holds` };
|
|
225
|
+
}
|
|
226
|
+
const rules = items.filter(ofKind("rule"));
|
|
227
|
+
return {
|
|
228
|
+
outcome: "ok",
|
|
229
|
+
value: {
|
|
230
|
+
version: SUPPORTED_VERSION,
|
|
231
|
+
principles: items.filter(ofKind("principle")).map((placed2) => ({ name: placed2.name, title: placed2.title })),
|
|
232
|
+
rules: rules.map(ruleOf),
|
|
233
|
+
cases: items.filter(ofKind("case")).map((placed2) => ({ name: placed2.name, title: placed2.title, ...placed2.item.facts })),
|
|
234
|
+
recipes: items.filter(ofKind("recipe")).map((placed2) => ({ name: placed2.name, title: placed2.title, ...placed2.item.facts })),
|
|
235
|
+
recordKinds: recordKinds.value,
|
|
236
|
+
engines: beside.engines,
|
|
237
|
+
symptoms: items.filter(ofKind("symptom")).map((placed2) => ({ name: placed2.name, title: placed2.title, ...placed2.item.facts })),
|
|
238
|
+
clauses: beside.clauses,
|
|
239
|
+
checks: checks.value,
|
|
240
|
+
namedBans: rules.flatMap((placed2) => placed2.item.facts.namedBans ?? []).map((outsideDependency) => ({ outsideDependency }))
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
// src/infrastructure/content-files/item-folders/item-facts.ts
|
|
246
|
+
import { z as z2 } from "zod";
|
|
247
|
+
var OMITTED_NAME_AND_TITLE = { name: true, title: true };
|
|
248
|
+
var reviewLensSchema = z2.enum([
|
|
249
|
+
"clean-architecture",
|
|
250
|
+
"decomposition",
|
|
251
|
+
"di-discipline",
|
|
252
|
+
"errors-as-data",
|
|
253
|
+
"function-first",
|
|
254
|
+
"naming",
|
|
255
|
+
"test-discipline",
|
|
256
|
+
"type-soundness",
|
|
257
|
+
"zod-boundary"
|
|
258
|
+
]);
|
|
259
|
+
var reviewLensesSchema = z2.array(reviewLensSchema).min(1).optional();
|
|
260
|
+
var principleFactsSchema = catalogueFileSchema.shape.principles.element.omit(OMITTED_NAME_AND_TITLE).extend({ lenses: reviewLensesSchema });
|
|
261
|
+
var ruleFactsSchema = catalogueFileSchema.shape.rules.element.omit(OMITTED_NAME_AND_TITLE).extend({ namedBans: z2.array(z2.string().min(1)).min(1).optional(), lenses: reviewLensesSchema });
|
|
262
|
+
var caseFactsSchema = caseWireSchema.omit(OMITTED_NAME_AND_TITLE);
|
|
263
|
+
var recipeFactsSchema = catalogueFileSchema.shape.recipes.element.omit(OMITTED_NAME_AND_TITLE);
|
|
264
|
+
var recordKindFactsSchema = recordKindWireSchema.omit({
|
|
265
|
+
...OMITTED_NAME_AND_TITLE,
|
|
266
|
+
todaysFormat: true
|
|
267
|
+
});
|
|
268
|
+
var symptomFactsSchema = symptomWireSchema.omit(OMITTED_NAME_AND_TITLE);
|
|
269
|
+
var checkFactsSchema = checkWireSchema.omit({ symptom: true, name: true, clause: true });
|
|
270
|
+
var itemOf = (request) => request.result.success ? { outcome: "ok", value: request.toItem(request.result.data) } : { outcome: "failed", error: z2.prettifyError(request.result.error) };
|
|
271
|
+
var itemFactsOf = (request) => {
|
|
272
|
+
const { facts } = request;
|
|
273
|
+
switch (request.kind) {
|
|
274
|
+
case "principle":
|
|
275
|
+
return itemOf({
|
|
276
|
+
result: principleFactsSchema.safeParse(facts),
|
|
277
|
+
toItem: (parsed) => ({ kind: "principle", facts: parsed })
|
|
278
|
+
});
|
|
279
|
+
case "rule":
|
|
280
|
+
return itemOf({
|
|
281
|
+
result: ruleFactsSchema.safeParse(facts),
|
|
282
|
+
toItem: (parsed) => ({ kind: "rule", facts: parsed })
|
|
283
|
+
});
|
|
284
|
+
case "case":
|
|
285
|
+
return itemOf({
|
|
286
|
+
result: caseFactsSchema.safeParse(facts),
|
|
287
|
+
toItem: (parsed) => ({ kind: "case", facts: parsed })
|
|
288
|
+
});
|
|
289
|
+
case "recipe":
|
|
290
|
+
return itemOf({
|
|
291
|
+
result: recipeFactsSchema.safeParse(facts),
|
|
292
|
+
toItem: (parsed) => ({ kind: "recipe", facts: parsed })
|
|
293
|
+
});
|
|
294
|
+
case "record-kind":
|
|
295
|
+
return itemOf({
|
|
296
|
+
result: recordKindFactsSchema.safeParse(facts),
|
|
297
|
+
toItem: (parsed) => ({ kind: "record-kind", facts: parsed })
|
|
298
|
+
});
|
|
299
|
+
case "symptom":
|
|
300
|
+
return itemOf({
|
|
301
|
+
result: symptomFactsSchema.safeParse(facts),
|
|
302
|
+
toItem: (parsed) => ({ kind: "symptom", facts: parsed })
|
|
303
|
+
});
|
|
304
|
+
case "check":
|
|
305
|
+
return itemOf({
|
|
306
|
+
result: checkFactsSchema.safeParse(facts),
|
|
307
|
+
toItem: (parsed) => ({ kind: "check", facts: parsed })
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
// src/infrastructure/content-files/item-folders/item-identity.ts
|
|
313
|
+
var ITEM_EXTENSION = ".md";
|
|
314
|
+
var LIST_PAGE_FILE = "README.md";
|
|
315
|
+
var SEGMENT_SEPARATOR = "/";
|
|
316
|
+
var ROOT_KIND_FOLDERS = /* @__PURE__ */ new Map([
|
|
317
|
+
["principles", "principle"],
|
|
318
|
+
["rules", "rule"],
|
|
319
|
+
["cases", "case"],
|
|
320
|
+
["record-kinds", "record-kind"]
|
|
321
|
+
]);
|
|
322
|
+
var LANGUAGE_KIND_FOLDERS = /* @__PURE__ */ new Map([
|
|
323
|
+
["symptoms", "symptom"],
|
|
324
|
+
["recipes", "recipe"]
|
|
325
|
+
]);
|
|
326
|
+
var CHECKS_UNDER = "symptoms";
|
|
327
|
+
var NOT_A_NAME = "is not a lower-case hyphenated name";
|
|
328
|
+
var placed = (identity) => ({ outcome: "ok", value: identity });
|
|
329
|
+
var refused = (refusal) => ({ outcome: "failed", error: { refusal } });
|
|
330
|
+
var nameRefusalOf = (request) => {
|
|
331
|
+
switch (request.kind) {
|
|
332
|
+
case "record-kind":
|
|
333
|
+
return recordKindNameSchema.safeParse(request.name).success ? void 0 : `${request.name} is not the name of a record kind`;
|
|
334
|
+
case "principle":
|
|
335
|
+
case "rule":
|
|
336
|
+
case "case":
|
|
337
|
+
case "recipe":
|
|
338
|
+
case "symptom":
|
|
339
|
+
case "check":
|
|
340
|
+
return isCatalogueName(request.name) ? void 0 : `${request.name} ${NOT_A_NAME}`;
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
var named = (request) => {
|
|
344
|
+
const refusal = nameRefusalOf(request);
|
|
345
|
+
return refusal === void 0 ? placed(request) : refused(refusal);
|
|
346
|
+
};
|
|
347
|
+
var checkOf3 = (request) => isCatalogueName(request.symptom) ? named({ kind: "check", name: request.stem, within: request.symptom }) : refused(`${request.symptom} ${NOT_A_NAME}, and a check sits in the folder of its symptom`);
|
|
348
|
+
var placementOfFolders = (request) => {
|
|
349
|
+
const [first, second, third] = request.folders;
|
|
350
|
+
const rootKind = first === void 0 ? void 0 : ROOT_KIND_FOLDERS.get(first);
|
|
351
|
+
const languageKind = second === void 0 ? void 0 : LANGUAGE_KIND_FOLDERS.get(second);
|
|
352
|
+
if (request.folders.length === 1 && rootKind !== void 0) {
|
|
353
|
+
return named({ kind: rootKind, name: request.stem, within: void 0 });
|
|
354
|
+
}
|
|
355
|
+
if (request.folders.length === 2 && languageKind !== void 0) {
|
|
356
|
+
return named({ kind: languageKind, name: request.stem, within: void 0 });
|
|
357
|
+
}
|
|
358
|
+
if (request.folders.length === 3 && second === CHECKS_UNDER && third !== void 0) {
|
|
359
|
+
return checkOf3({ stem: request.stem, symptom: third });
|
|
360
|
+
}
|
|
361
|
+
return refused("sits where no kind of item is kept");
|
|
362
|
+
};
|
|
363
|
+
var segmentsOf = (request) => request.path.split(SEGMENT_SEPARATOR);
|
|
364
|
+
var fileOf = (request) => segmentsOf(request).at(-1) ?? "";
|
|
365
|
+
var folderPlaceOf = (request) => {
|
|
366
|
+
const [first, second] = request.folders;
|
|
367
|
+
const underRootKind = first !== void 0 && ROOT_KIND_FOLDERS.has(first);
|
|
368
|
+
const underLanguageKind = second !== void 0 && LANGUAGE_KIND_FOLDERS.has(second);
|
|
369
|
+
return underRootKind || underLanguageKind ? "under-a-kind-folder" : "elsewhere";
|
|
370
|
+
};
|
|
371
|
+
var fileRoleOf = (request) => {
|
|
372
|
+
const file = fileOf(request);
|
|
373
|
+
return file !== LIST_PAGE_FILE && file.endsWith(ITEM_EXTENSION) && folderPlaceOf({ folders: segmentsOf(request).slice(0, -1) }) === "under-a-kind-folder" ? "item" : "other";
|
|
374
|
+
};
|
|
375
|
+
var identityOf = (request) => placementOfFolders({
|
|
376
|
+
folders: segmentsOf(request).slice(0, -1),
|
|
377
|
+
stem: fileOf(request).slice(0, -ITEM_EXTENSION.length)
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
// src/infrastructure/content-files/item-folders/item-listing.ts
|
|
381
|
+
var PATH_SEPARATOR = "/";
|
|
382
|
+
var byCodePoint = (left, right) => left < right ? -1 : left > right ? 1 : 0;
|
|
383
|
+
var folderAt = (request) => {
|
|
384
|
+
const joined = request.path.join({ segments: [request.root, ...request.within] });
|
|
385
|
+
const folder = absolutePathSchema.safeParse(joined);
|
|
386
|
+
return folder.success ? { outcome: "ok", value: folder.data } : {
|
|
387
|
+
outcome: "failed",
|
|
388
|
+
error: {
|
|
389
|
+
kind: "directory-unreadable",
|
|
390
|
+
path: request.root,
|
|
391
|
+
detail: `${joined} is not an absolute path`
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
var joinedLists = (lists) => {
|
|
396
|
+
const failure = lists.find((list) => list.outcome === "failed");
|
|
397
|
+
return failure ?? {
|
|
398
|
+
outcome: "ok",
|
|
399
|
+
value: lists.flatMap((list) => list.outcome === "ok" ? list.value : [])
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
var listedEntry = (request) => request.entry.kind === "directory" ? listedWithin({ ...request, within: [...request.within, request.entry.name] }) : { outcome: "ok", value: [[...request.within, request.entry.name].join(PATH_SEPARATOR)] };
|
|
403
|
+
var listedWithin = (request) => {
|
|
404
|
+
const folder = folderAt(request);
|
|
405
|
+
if (folder.outcome === "failed") {
|
|
406
|
+
return folder;
|
|
407
|
+
}
|
|
408
|
+
const entries = request.directory.list({ path: folder.value });
|
|
409
|
+
return entries.outcome === "failed" ? entries : joinedLists(entries.value.map((entry) => listedEntry({ ...request, entry })));
|
|
410
|
+
};
|
|
411
|
+
var filesUnder = (request) => {
|
|
412
|
+
const listed = listedWithin({ ...request, within: [] });
|
|
413
|
+
return listed.outcome === "failed" ? listed : { outcome: "ok", value: [...listed.value].sort(byCodePoint) };
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
// src/infrastructure/content-files/item-folders/item-text.ts
|
|
417
|
+
var TITLE_LINE = /^# (?<title>\S.*)$/;
|
|
418
|
+
var FENCE_LINE = /^```(?<language>[A-Za-z0-9_-]*)\s*$/;
|
|
419
|
+
var FACTS_LANGUAGE = "json";
|
|
420
|
+
var LINE_BREAK = /\r?\n/;
|
|
421
|
+
var scanned = (scan, numbered) => {
|
|
422
|
+
const fence = FENCE_LINE.exec(numbered.line);
|
|
423
|
+
if (scan.open === void 0) {
|
|
424
|
+
return fence === null ? scan : { open: { language: fence.groups?.language ?? "", lines: [] }, closed: scan.closed };
|
|
425
|
+
}
|
|
426
|
+
return fence === null ? {
|
|
427
|
+
open: { language: scan.open.language, lines: [...scan.open.lines, numbered.line] },
|
|
428
|
+
closed: scan.closed
|
|
429
|
+
} : { open: void 0, closed: [...scan.closed, { ...scan.open, closedAt: numbered.index }] };
|
|
430
|
+
};
|
|
431
|
+
var titleOf = (request) => {
|
|
432
|
+
const first = request.lines.find((line) => line.trim().length > 0);
|
|
433
|
+
const title = first === void 0 ? void 0 : TITLE_LINE.exec(first)?.groups?.title;
|
|
434
|
+
return title === void 0 ? { outcome: "failed", error: "does not start with a title line, # <title>" } : { outcome: "ok", value: title.trim() };
|
|
435
|
+
};
|
|
436
|
+
var factsFenceOf = (request) => {
|
|
437
|
+
const scan = request.lines.map((line, index) => ({ line, index })).reduce(scanned, { open: void 0, closed: [] });
|
|
438
|
+
if (scan.open !== void 0) {
|
|
439
|
+
return { outcome: "failed", error: "has a fenced block that is never closed" };
|
|
440
|
+
}
|
|
441
|
+
const [only, ...others] = scan.closed.filter((fence) => fence.language === FACTS_LANGUAGE);
|
|
442
|
+
if (only === void 0) {
|
|
443
|
+
return { outcome: "failed", error: "holds no fenced json block of facts" };
|
|
444
|
+
}
|
|
445
|
+
return others.length > 0 ? { outcome: "failed", error: "holds more than one fenced json block; the facts are one block" } : { outcome: "ok", value: only };
|
|
446
|
+
};
|
|
447
|
+
var itemTextOf = (request) => {
|
|
448
|
+
const lines = request.text.split(LINE_BREAK);
|
|
449
|
+
const title = titleOf({ lines });
|
|
450
|
+
if (title.outcome === "failed") {
|
|
451
|
+
return title;
|
|
452
|
+
}
|
|
453
|
+
const fence = factsFenceOf({ lines });
|
|
454
|
+
if (fence.outcome === "failed") {
|
|
455
|
+
return fence;
|
|
456
|
+
}
|
|
457
|
+
const facts = parsedJson({ text: fence.value.lines.join("\n") });
|
|
458
|
+
const prose = lines.slice(fence.value.closedAt + 1).join("\n").trim();
|
|
459
|
+
return facts.outcome === "failed" ? { outcome: "failed", error: `has facts that are not JSON: ${facts.error}` } : { outcome: "ok", value: { title: title.value, facts: facts.value, prose } };
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
// src/infrastructure/content-files/item-folders/read-item-folder-catalogue.ts
|
|
463
|
+
var malformed = (request) => ({
|
|
464
|
+
kind: "file-malformed",
|
|
465
|
+
path: request.path,
|
|
466
|
+
detail: request.detail
|
|
467
|
+
});
|
|
468
|
+
var placedItemAt = (request) => {
|
|
469
|
+
const path = request.path.join({ segments: [request.root, request.file] });
|
|
470
|
+
const identity = identityOf({ path: request.file });
|
|
471
|
+
if (identity.outcome === "failed") {
|
|
472
|
+
return { outcome: "failed", error: malformed({ path, detail: identity.error.refusal }) };
|
|
473
|
+
}
|
|
474
|
+
const text = request.fileText.read({ path });
|
|
475
|
+
if (text.outcome === "failed") {
|
|
476
|
+
return {
|
|
477
|
+
outcome: "failed",
|
|
478
|
+
error: { kind: "file-unreadable", path, detail: text.error.detail }
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
const read = itemTextOf({ text: text.value });
|
|
482
|
+
if (read.outcome === "failed") {
|
|
483
|
+
return { outcome: "failed", error: malformed({ path, detail: read.error }) };
|
|
484
|
+
}
|
|
485
|
+
const facts = itemFactsOf({ kind: identity.value.kind, facts: read.value.facts });
|
|
486
|
+
return facts.outcome === "failed" ? { outcome: "failed", error: malformed({ path, detail: facts.error }) } : {
|
|
487
|
+
outcome: "ok",
|
|
488
|
+
value: {
|
|
489
|
+
name: identity.value.name,
|
|
490
|
+
within: identity.value.within,
|
|
491
|
+
title: read.value.title,
|
|
492
|
+
item: facts.value
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
};
|
|
496
|
+
var placedItemsOf = (request) => {
|
|
497
|
+
const reads = request.files.filter((file) => fileRoleOf({ path: file }) === "item").map((file) => placedItemAt({ ...request, file }));
|
|
498
|
+
const failure = reads.find((each) => each.outcome === "failed");
|
|
499
|
+
return failure?.outcome === "failed" ? failure : {
|
|
500
|
+
outcome: "ok",
|
|
501
|
+
value: reads.flatMap((each) => each.outcome === "ok" ? [each.value] : [])
|
|
502
|
+
};
|
|
503
|
+
};
|
|
504
|
+
var holdingOf = (request) => {
|
|
505
|
+
const file = catalogueFileOf({ items: request.items, beside: request.beside });
|
|
506
|
+
const content = file.outcome === "failed" ? file : catalogueContentFromFile({ file: file.value });
|
|
507
|
+
return content.outcome === "failed" ? { outcome: "failed", error: malformed({ path: request.root, detail: content.error }) } : { outcome: "ok", value: { held: "catalogue", content: content.value } };
|
|
508
|
+
};
|
|
509
|
+
var readItemFolderCatalogue = (request) => {
|
|
510
|
+
if (request.fileText.exists({ path: request.root }) === "absent") {
|
|
511
|
+
return { outcome: "ok", value: { held: "none" } };
|
|
512
|
+
}
|
|
513
|
+
const files = filesUnder(request);
|
|
514
|
+
if (files.outcome === "failed") {
|
|
515
|
+
return {
|
|
516
|
+
outcome: "failed",
|
|
517
|
+
error: { kind: "file-unreadable", path: files.error.path, detail: files.error.detail }
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
const items = placedItemsOf({ ...request, files: files.value });
|
|
521
|
+
if (items.outcome === "failed") {
|
|
522
|
+
return items;
|
|
523
|
+
}
|
|
524
|
+
return items.value.length === 0 ? { outcome: "ok", value: { held: "none" } } : holdingOf({ root: request.root, beside: request.beside, items: items.value });
|
|
525
|
+
};
|
|
526
|
+
var createItemFolderCatalogueRepository = (options) => ({
|
|
527
|
+
read: (_request) => readItemFolderCatalogue(options)
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
// src/infrastructure/content-files/symptom-catalogues/read-symptom-catalogue.ts
|
|
531
|
+
var namesOfRuleSet = (request) => request.ruleSetRoot === request.installRoot ? readVersionOneNames({
|
|
532
|
+
fileText: request.fileText,
|
|
533
|
+
path: request.path.join({ segments: [request.installRoot, ...VERSION_ONE_NAMES_SEGMENTS] })
|
|
534
|
+
}) : { outcome: "ok", value: NO_VERSION_ONE_NAMES };
|
|
535
|
+
var readSymptomCatalogue = (request) => {
|
|
536
|
+
const itemRoot = request.path.join({
|
|
537
|
+
segments: [request.ruleSetRoot, ...SYMPTOM_CATALOGUE_SEGMENTS]
|
|
538
|
+
});
|
|
539
|
+
const root = absolutePathSchema.safeParse(itemRoot);
|
|
540
|
+
if (!root.success) {
|
|
541
|
+
return {
|
|
542
|
+
outcome: "failed",
|
|
543
|
+
error: { kind: "file-unreadable", path: itemRoot, detail: "is not an absolute path" }
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
const names = namesOfRuleSet(request);
|
|
547
|
+
if (names.outcome === "failed") {
|
|
548
|
+
return names;
|
|
549
|
+
}
|
|
550
|
+
const clauses = catalogueClausesOf({
|
|
551
|
+
...request,
|
|
552
|
+
installRoot: request.ruleSetRoot,
|
|
553
|
+
names: names.value
|
|
554
|
+
});
|
|
555
|
+
if (clauses.outcome === "failed") {
|
|
556
|
+
return clauses;
|
|
557
|
+
}
|
|
558
|
+
const beside = {
|
|
559
|
+
engines: ENGINE_REGISTRY,
|
|
560
|
+
clauses: clauses.value,
|
|
561
|
+
clauseOfCheck: names.value.clauseOfCheck,
|
|
562
|
+
formatsOfToday: names.value.formatsOfToday
|
|
563
|
+
};
|
|
564
|
+
return createItemFolderCatalogueRepository({
|
|
565
|
+
fileText: request.fileText,
|
|
566
|
+
directory: request.directory,
|
|
567
|
+
path: request.path,
|
|
568
|
+
root: root.data,
|
|
569
|
+
beside
|
|
570
|
+
}).read({});
|
|
571
|
+
};
|
|
572
|
+
var createSymptomCatalogueRepository = (options) => ({
|
|
573
|
+
read: (_request) => readSymptomCatalogue(options)
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
// src/infrastructure/content-files/symptom-catalogues/bound-catalogue.ts
|
|
577
|
+
var readBoundCatalogue = (source) => {
|
|
578
|
+
const holding = createSymptomCatalogueRepository(source).read({});
|
|
579
|
+
if (holding.outcome === "failed") {
|
|
580
|
+
return holding;
|
|
581
|
+
}
|
|
582
|
+
const checks = holding.value.held === "catalogue" ? holding.value.content.checks : [];
|
|
583
|
+
const bindings = createEngineBindingsRepository(source).read({ checks });
|
|
584
|
+
if (bindings.outcome === "failed") {
|
|
585
|
+
return bindings;
|
|
586
|
+
}
|
|
587
|
+
const bound = holdingBoundTo({ holding: holding.value, bindings: bindings.value });
|
|
588
|
+
return bound.outcome === "failed" ? {
|
|
589
|
+
outcome: "failed",
|
|
590
|
+
error: {
|
|
591
|
+
kind: "file-malformed",
|
|
592
|
+
path: source.path.join({ segments: [source.ruleSetRoot, ...SYMPTOM_CATALOGUE_SEGMENTS] }),
|
|
593
|
+
detail: bound.error
|
|
594
|
+
}
|
|
595
|
+
} : bound;
|
|
596
|
+
};
|
|
597
|
+
var createBoundCatalogueOf = (options) => {
|
|
598
|
+
const boundCatalogueOf = (request) => readBoundCatalogue({ ...request, directory: options.directory });
|
|
599
|
+
return boundCatalogueOf;
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
export {
|
|
603
|
+
SYMPTOM_CATALOGUE_SEGMENTS,
|
|
604
|
+
CHECK_ITEMS_SEGMENTS,
|
|
605
|
+
checkItemSegments,
|
|
606
|
+
readBoundCatalogue,
|
|
607
|
+
createBoundCatalogueOf
|
|
608
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/infrastructure/engines/eslint/runner/toolchain/eslint-major-boundary.ts
|
|
2
|
+
var PROJECTION_DECLARATION_TEXT = `import type { Linter } from ${JSON.stringify("eslint")};
|
|
3
|
+
declare const projection: Linter.Config[];
|
|
4
|
+
export default projection;
|
|
5
|
+
`;
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
PROJECTION_DECLARATION_TEXT
|
|
9
|
+
};
|