repo-contract 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +46 -0
  3. package/dist/.dts/config/define-repo-contract.d.ts +36 -0
  4. package/dist/.dts/config/define-repo-contract.d.ts.map +1 -0
  5. package/dist/.dts/config/tokenize-command.d.ts +33 -0
  6. package/dist/.dts/config/tokenize-command.d.ts.map +1 -0
  7. package/dist/.dts/config/validate-config.d.ts +32 -0
  8. package/dist/.dts/config/validate-config.d.ts.map +1 -0
  9. package/dist/.dts/errors.d.ts +172 -0
  10. package/dist/.dts/errors.d.ts.map +1 -0
  11. package/dist/.dts/evidence/build-evidence.d.ts +26 -0
  12. package/dist/.dts/evidence/build-evidence.d.ts.map +1 -0
  13. package/dist/.dts/execution/abort-signals.d.ts +29 -0
  14. package/dist/.dts/execution/abort-signals.d.ts.map +1 -0
  15. package/dist/.dts/execution/concurrency-pool.d.ts +14 -0
  16. package/dist/.dts/execution/concurrency-pool.d.ts.map +1 -0
  17. package/dist/.dts/execution/dependency-scheduler.d.ts +30 -0
  18. package/dist/.dts/execution/dependency-scheduler.d.ts.map +1 -0
  19. package/dist/.dts/execution/process-tree.d.ts +59 -0
  20. package/dist/.dts/execution/process-tree.d.ts.map +1 -0
  21. package/dist/.dts/execution/run-checks.d.ts +31 -0
  22. package/dist/.dts/execution/run-checks.d.ts.map +1 -0
  23. package/dist/.dts/execution/spawn-check.d.ts +49 -0
  24. package/dist/.dts/execution/spawn-check.d.ts.map +1 -0
  25. package/dist/.dts/index.d.ts +14 -0
  26. package/dist/.dts/index.d.ts.map +1 -0
  27. package/dist/.dts/parsing/format-schema-issues.d.ts +11 -0
  28. package/dist/.dts/parsing/format-schema-issues.d.ts.map +1 -0
  29. package/dist/.dts/parsing/parse-json.d.ts +8 -0
  30. package/dist/.dts/parsing/parse-json.d.ts.map +1 -0
  31. package/dist/.dts/parsing/parse-output.d.ts +25 -0
  32. package/dist/.dts/parsing/parse-output.d.ts.map +1 -0
  33. package/dist/.dts/parsing/parse-text.d.ts +8 -0
  34. package/dist/.dts/parsing/parse-text.d.ts.map +1 -0
  35. package/dist/.dts/parsing/parse-yaml.d.ts +21 -0
  36. package/dist/.dts/parsing/parse-yaml.d.ts.map +1 -0
  37. package/dist/.dts/policy/run-policies.d.ts +38 -0
  38. package/dist/.dts/policy/run-policies.d.ts.map +1 -0
  39. package/dist/.dts/presets/arethetypeswrong.d.ts +39 -0
  40. package/dist/.dts/presets/arethetypeswrong.d.ts.map +1 -0
  41. package/dist/.dts/presets/broken-links.d.ts +16 -0
  42. package/dist/.dts/presets/broken-links.d.ts.map +1 -0
  43. package/dist/.dts/presets/commitlint.d.ts +22 -0
  44. package/dist/.dts/presets/commitlint.d.ts.map +1 -0
  45. package/dist/.dts/presets/dead-code.d.ts +23 -0
  46. package/dist/.dts/presets/dead-code.d.ts.map +1 -0
  47. package/dist/.dts/presets/duplication.d.ts +14 -0
  48. package/dist/.dts/presets/duplication.d.ts.map +1 -0
  49. package/dist/.dts/presets/e2e.d.ts +4 -0
  50. package/dist/.dts/presets/e2e.d.ts.map +1 -0
  51. package/dist/.dts/presets/format.d.ts +4 -0
  52. package/dist/.dts/presets/format.d.ts.map +1 -0
  53. package/dist/.dts/presets/index.d.ts +31 -0
  54. package/dist/.dts/presets/index.d.ts.map +1 -0
  55. package/dist/.dts/presets/license.d.ts +4 -0
  56. package/dist/.dts/presets/license.d.ts.map +1 -0
  57. package/dist/.dts/presets/lint.d.ts +20 -0
  58. package/dist/.dts/presets/lint.d.ts.map +1 -0
  59. package/dist/.dts/presets/markdownlint.d.ts +23 -0
  60. package/dist/.dts/presets/markdownlint.d.ts.map +1 -0
  61. package/dist/.dts/presets/publint.d.ts +13 -0
  62. package/dist/.dts/presets/publint.d.ts.map +1 -0
  63. package/dist/.dts/presets/security-deps.d.ts +4 -0
  64. package/dist/.dts/presets/security-deps.d.ts.map +1 -0
  65. package/dist/.dts/presets/security-secrets.d.ts +4 -0
  66. package/dist/.dts/presets/security-secrets.d.ts.map +1 -0
  67. package/dist/.dts/presets/shared/error-warning-pass-policy.d.ts +13 -0
  68. package/dist/.dts/presets/shared/error-warning-pass-policy.d.ts.map +1 -0
  69. package/dist/.dts/presets/shared/exit-code-fail-rationale.d.ts +23 -0
  70. package/dist/.dts/presets/shared/exit-code-fail-rationale.d.ts.map +1 -0
  71. package/dist/.dts/presets/shared/missing-dependency.d.ts +19 -0
  72. package/dist/.dts/presets/shared/missing-dependency.d.ts.map +1 -0
  73. package/dist/.dts/presets/shared/read-json-report.d.ts +33 -0
  74. package/dist/.dts/presets/shared/read-json-report.d.ts.map +1 -0
  75. package/dist/.dts/presets/shared/terminal-status.d.ts +25 -0
  76. package/dist/.dts/presets/shared/terminal-status.d.ts.map +1 -0
  77. package/dist/.dts/presets/shared/vitest-json-policy.d.ts +20 -0
  78. package/dist/.dts/presets/shared/vitest-json-policy.d.ts.map +1 -0
  79. package/dist/.dts/presets/stylelint.d.ts +17 -0
  80. package/dist/.dts/presets/stylelint.d.ts.map +1 -0
  81. package/dist/.dts/presets/test.d.ts +4 -0
  82. package/dist/.dts/presets/test.d.ts.map +1 -0
  83. package/dist/.dts/presets/typecheck.d.ts +4 -0
  84. package/dist/.dts/presets/typecheck.d.ts.map +1 -0
  85. package/dist/.dts/run-repo-contract.d.ts +38 -0
  86. package/dist/.dts/run-repo-contract.d.ts.map +1 -0
  87. package/dist/.dts/standard-schema/types.d.ts +76 -0
  88. package/dist/.dts/standard-schema/types.d.ts.map +1 -0
  89. package/dist/.dts/types.d.ts +424 -0
  90. package/dist/.dts/types.d.ts.map +1 -0
  91. package/dist/index.cjs +99 -4
  92. package/dist/index.cjs.map +1 -1
  93. package/dist/index.d.cts +1 -0
  94. package/dist/index.d.ts +1 -0
  95. package/dist/index.js +99 -5
  96. package/dist/index.js.map +1 -1
  97. package/dist/presets.d.cts +1 -0
  98. package/dist/presets.d.ts +1 -0
  99. package/package.json +1 -1
  100. package/schemas/evidence.schema.json +2 -2
  101. package/src/config/validate-config.ts +55 -1
  102. package/src/errors.ts +26 -0
  103. package/src/evidence/build-evidence.ts +6 -1
  104. package/src/index.ts +3 -0
  105. package/src/parsing/format-schema-issues.ts +56 -0
  106. package/src/parsing/parse-output.ts +50 -3
  107. package/src/standard-schema/types.ts +93 -0
  108. package/src/types.ts +48 -12
@@ -0,0 +1,49 @@
1
+ import type { CheckDefinition, CheckEvidence, Spawner, SyncSpawner } from "../types.js";
2
+ /**
3
+ * The trusted execution capabilities a run supplies once (see
4
+ * specs/decisions/0011-process-spawning-and-ambient-environment-access-are-consumer-supplied-capabilities-not-package-owned.md)
5
+ * and every spawned check draws from -- `spawn`/`env` verbatim from
6
+ * `RepoContractConfig`, `shell` already resolved to its effective global
7
+ * default (`config.shell ?? false`). Internal only: not exported from
8
+ * `src/types.ts` or `src/index.ts`. Grouped into one object, rather than
9
+ * threaded as independent parameters through `run-repo-contract.ts` ->
10
+ * `run-checks.ts` -> `spawn-check.ts`, purely to keep related
11
+ * execution-capability concerns from drifting into unrelated positional
12
+ * parameters as more get added later.
13
+ */
14
+ export interface ExecutionCapability {
15
+ readonly spawn: Spawner;
16
+ readonly env: NodeJS.ProcessEnv;
17
+ readonly shell: boolean;
18
+ readonly killProcessTree?: SyncSpawner;
19
+ }
20
+ export declare const SIGKILL_GRACE_PERIOD_MS = 2000;
21
+ /** Handle a caller can use to forcibly terminate one in-flight check's process tree, independent of that check's own timeout/abort wiring -- used by run-checks.ts to clean up every active check when the host process itself receives SIGINT/SIGTERM. */
22
+ export interface ActiveCheckHandle {
23
+ kill(signal: NodeJS.Signals): void;
24
+ }
25
+ /**
26
+ * Runs one configured check end to end: resolves its command, spawns it,
27
+ * enforces its timeout (if any), reacts to the run-level `AbortSignal` (if
28
+ * any), captures stdout/stderr, and resolves to a fully-formed
29
+ * `CheckEvidence` no matter how the process ended -- this function never
30
+ * rejects. `activeHandles` is a shared registry the caller (run-checks.ts)
31
+ * uses to kill every in-flight check on a host-process SIGINT/SIGTERM; this
32
+ * function adds its own handle once the process has a pid and removes it
33
+ * once the process has settled.
34
+ *
35
+ * A check whose `runSignal` is already aborted before this function is even
36
+ * invoked (queued behind the concurrency limit when the run was cancelled)
37
+ * never spawns at all, but still resolves to a well-formed `status:
38
+ * "aborted"` evidence entry -- every configured check gets evidence and a
39
+ * policy invocation regardless of whether it ever ran (see
40
+ * specs/architecture.md).
41
+ * @param checkId - the check's id, used for logging and passed through to `resolveCommand`
42
+ * @param check - the check definition to run (command, timeout, env, cwd, shell, etc.)
43
+ * @param runSignal - the whole run's abort signal, if any; already-aborted before this is called means the check never spawns
44
+ * @param activeHandles - the shared registry this check's kill handle is added to while running, so a host-process SIGINT/SIGTERM can terminate it
45
+ * @param execution - the run's trusted execution capabilities (`spawn`, `env`, resolved global `shell` default) -- see `ExecutionCapability`
46
+ * @returns a fully-formed `CheckEvidence` reflecting however the process ended; this function itself never rejects
47
+ */
48
+ export declare function spawnCheck(checkId: string, check: CheckDefinition, runSignal: AbortSignal | undefined, activeHandles: Set<ActiveCheckHandle>, execution: ExecutionCapability): Promise<CheckEvidence>;
49
+ //# sourceMappingURL=spawn-check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spawn-check.d.ts","sourceRoot":"","sources":["../../../src/execution/spawn-check.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAe,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAIpG;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAA;IAC/B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,eAAe,CAAC,EAAE,WAAW,CAAA;CACvC;AA2BD,eAAO,MAAM,uBAAuB,OAAO,CAAA;AA6D3C,2PAA2P;AAC3P,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAA;CACnC;AAyHD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,UAAU,CAC9B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,eAAe,EACtB,SAAS,EAAE,WAAW,GAAG,SAAS,EAClC,aAAa,EAAE,GAAG,CAAC,iBAAiB,CAAC,EACrC,SAAS,EAAE,mBAAmB,GAC7B,OAAO,CAAC,aAAa,CAAC,CA4QxB"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Public API of repo-contract. Curated barrel -- internal implementation
3
+ * modules (src/execution/, src/parsing/, src/policy/, src/config/'s
4
+ * lower-level pieces) are not re-exported here even though they exist as
5
+ * real files; only the two functions and the types a consumer needs to
6
+ * author a config and interpret its result are part of the public surface.
7
+ * @packageDocumentation
8
+ */
9
+ export { defineRepoContract } from "./config/define-repo-contract.js";
10
+ export { runRepoContract } from "./run-repo-contract.js";
11
+ export { DependencyDeclaredLaterError, InvalidCheckConfigError, InvalidRepoContractConfigError, ParserDependencyMissingError, PolicyReadFailedParseValueError, PolicyReadUnrequestedOutputError, PolicyThrewError, RepoContractError, StandardSchemaValidateThrewError, UnknownCheckIdError, } from "./errors.js";
12
+ export type { StandardSchemaV1 } from "./standard-schema/types.js";
13
+ export type { CheckDefinition, CheckDefinitionConfig, CheckEvidence, CheckSchema, CheckStatus, Evidence, OutputFormat, ParsedOutput, ParsedOutputFailure, ParsedOutputSuccess, Policy, PolicyContext, PolicyOutcome, PolicyResult, RepoContractConfig, RunRepoContractOptions, Spawner, SyncSpawner, ValidatedCheckSchema, Verdict, } from "./types.js";
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExD,OAAO,EACL,4BAA4B,EAC5B,uBAAuB,EACvB,8BAA8B,EAC9B,4BAA4B,EAC5B,+BAA+B,EAC/B,gCAAgC,EAChC,gBAAgB,EAChB,iBAAiB,EACjB,gCAAgC,EAChC,mBAAmB,GACpB,MAAM,aAAa,CAAA;AAEpB,YAAY,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAElE,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,WAAW,EACX,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,MAAM,EACN,aAAa,EACb,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,sBAAsB,EACtB,OAAO,EACP,WAAW,EACX,oBAAoB,EACpB,OAAO,GACR,MAAM,YAAY,CAAA"}
@@ -0,0 +1,11 @@
1
+ import type { StandardSchemaV1 } from "../standard-schema/types.js";
2
+ /**
3
+ * Renders a failed `output.schema` validation's issues as a single, human-readable string for
4
+ * `ParsedOutputFailure.error` -- e.g. `Schema validation failed: foo.bar: Expected string;
5
+ * items[2].name: Required`. Kept as its own small module, independent of `parseOutput`, so its
6
+ * path-rendering logic (the only non-trivial part) can be unit-tested directly.
7
+ * @param issues - the failed `StandardSchemaV1.Result`'s `issues`.
8
+ * @returns the formatted error string.
9
+ */
10
+ export declare function formatSchemaIssues(issues: readonly StandardSchemaV1.Issue[]): string;
11
+ //# sourceMappingURL=format-schema-issues.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-schema-issues.d.ts","sourceRoot":"","sources":["../../../src/parsing/format-schema-issues.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,gBAAgB,CAAC,KAAK,EAAE,GAAG,MAAM,CAEpF"}
@@ -0,0 +1,8 @@
1
+ import type { ParsedOutput } from "../types.js";
2
+ /**
3
+ * Parses `stdout` as JSON. A malformed-JSON failure preserves the raw stdout on the caller's `CheckEvidence` unchanged and never throws -- the failure is reported as data, per repo-contract's "parsing failures are deterministic evidence, never a silent reinterpretation" contract.
4
+ * @param stdout - the check's raw stdout to parse as JSON.
5
+ * @returns the parsed value on success, or the unparsed failure with `stdout` preserved.
6
+ */
7
+ export declare function parseJson(stdout: string): ParsedOutput<unknown>;
8
+ //# sourceMappingURL=parse-json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-json.d.ts","sourceRoot":"","sources":["../../../src/parsing/parse-json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,CAU/D"}
@@ -0,0 +1,25 @@
1
+ import type { StandardSchemaV1 } from "../standard-schema/types.js";
2
+ import type { OutputFormat, ParsedOutput } from "../types.js";
3
+ /**
4
+ * Dispatches to the parser for `format`, then -- only on a successful parse, and only if `schema`
5
+ * is supplied -- runs `schema["~standard"].validate()` against the parsed value
6
+ * (https://standardschema.dev). `parse-json.ts`/`parse-yaml.ts`/`parse-text.ts` stay entirely
7
+ * unaware of `schema`; this is the sole orchestration point. `validate()` may return its `Result`
8
+ * synchronously or as a `Promise` -- `await`ing either uniformly is a no-op for the synchronous
9
+ * case, so this doesn't need its own reason to be async on top of the one this function already
10
+ * has (the dynamic `import("yaml")` for `format: "yaml"`). A successful `Result` (`issues ===
11
+ * undefined`) *replaces* `value` with the schema's own (possibly transformed) output; a failing
12
+ * `Result` becomes a `ParsedOutputFailure` whose `error` is built by `formatSchemaIssues`.
13
+ * `schema.validate()` itself throwing or rejecting is a bug in the consumer-supplied schema, not
14
+ * malformed output -- it throws `StandardSchemaValidateThrewError` rather than becoming a
15
+ * `ParsedOutputFailure`. Never throws for a malformed-output parse failure -- see each parser's
16
+ * own documentation. May throw `ParserDependencyMissingError` for `format: "yaml"` if the
17
+ * optional `yaml` peer dependency is unavailable.
18
+ * @param format - which parser to dispatch to.
19
+ * @param stdout - the check's raw stdout to parse.
20
+ * @param checkId - identifies which check's output is being parsed, used in a thrown `ParserDependencyMissingError`/`StandardSchemaValidateThrewError`.
21
+ * @param schema - an optional Standard Schema-compliant validator to run against a successful parse's value.
22
+ * @returns the parsed (and, if `schema` was supplied and validation succeeded, schema-transformed) output.
23
+ */
24
+ export declare function parseOutput(format: OutputFormat, stdout: string, checkId: string, schema?: StandardSchemaV1): Promise<ParsedOutput<unknown>>;
25
+ //# sourceMappingURL=parse-output.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-output.d.ts","sourceRoot":"","sources":["../../../src/parsing/parse-output.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAM7D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAkBhC"}
@@ -0,0 +1,8 @@
1
+ import type { ParsedOutput } from "../types.js";
2
+ /**
3
+ * "Parses" `stdout` as text -- a trimmed passthrough that always succeeds. Exists as an explicit, self-documenting alternative to omitting `output` entirely: `format: "text"` gives a consumer `result.output.value` as a plain trimmed string, rather than needing to read `result.stdout` and trim it themselves every time.
4
+ * @param stdout - the check's raw stdout to trim.
5
+ * @returns the always-successful result wrapping the trimmed string.
6
+ */
7
+ export declare function parseText(stdout: string): ParsedOutput<string>;
8
+ //# sourceMappingURL=parse-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-text.d.ts","sourceRoot":"","sources":["../../../src/parsing/parse-text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAE9D"}
@@ -0,0 +1,21 @@
1
+ import type { ParsedOutput } from "../types.js";
2
+ /**
3
+ * Parses `stdout` as YAML using the optional `yaml` peer dependency, loaded
4
+ * via a dynamic `import()` only when a check actually requests
5
+ * `output.format: "yaml"` -- consumers who never use YAML never pay for it.
6
+ * If `yaml` cannot be loaded at all (not installed, or any other import-time
7
+ * failure), throws `ParserDependencyMissingError` with the original failure
8
+ * preserved as `cause`, rather than guessing at a specific module-resolution
9
+ * error code that could vary across Node versions and module systems (ESM
10
+ * vs. the package's own CJS build output).
11
+ *
12
+ * A malformed-YAML failure (the dependency loaded fine, but `stdout` isn't
13
+ * valid YAML) is a normal parse failure, not a missing-dependency error --
14
+ * it's returned as `{ success: false }`, following the same "preserve raw
15
+ * output, report failure as data" contract as `parseJson`.
16
+ * @param stdout - the check's raw stdout to parse as YAML.
17
+ * @param checkId - identifies which check's output is being parsed, used in the thrown `ParserDependencyMissingError`.
18
+ * @returns the parsed value on success, or the unparsed failure with `stdout` preserved.
19
+ */
20
+ export declare function parseYaml(stdout: string, checkId: string): Promise<ParsedOutput<unknown>>;
21
+ //# sourceMappingURL=parse-yaml.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-yaml.d.ts","sourceRoot":"","sources":["../../../src/parsing/parse-yaml.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAiB/F"}
@@ -0,0 +1,38 @@
1
+ import type { ParsedCheckEntry } from "../evidence/build-evidence.js";
2
+ import type { Evidence, Verdict } from "../types.js";
3
+ /**
4
+ * Invokes every check's `policy` against the complete, already-assembled
5
+ * `evidence` and aggregates the results into a `Verdict`. Each check's
6
+ * `PolicyResult` is stored verbatim under `checks[checkId]`; `passed` is
7
+ * `true` only if every check's `outcome` is `"pass"` or `"warn"` -- no
8
+ * check's failure is ever collapsed into another's or into one generic
9
+ * message.
10
+ *
11
+ * Every `policy` call is isolated: the call itself is wrapped in `try/catch`
12
+ * (a policy doesn't have to be `async` to misbehave), and its returned
13
+ * value is `await`-ed inside that same `try`, so a promise that rejects
14
+ * later is caught identically to a synchronous throw. The resolved value is
15
+ * then validated against the `PolicyResult` contract itself (`outcome` is
16
+ * exactly `"pass"`, `"fail"`, or `"warn"`; `rationale` is a string) before
17
+ * it is trusted -- a malformed result is treated exactly like a throw
18
+ * rather than silently coerced into a pass. Every one of these failure
19
+ * modes is wrapped in `PolicyThrewError`, with the original thrown value
20
+ * (or a descriptive validation error, for a malformed result) preserved via
21
+ * `cause` -- never stringified or discarded. Two specific, common mistakes
22
+ * get a more actionable error instead, chosen by `wrapPolicyFailure` (see
23
+ * its own doc comment): reading a `result.output` property on a check that
24
+ * never requested a format (`PolicyReadUnrequestedOutputError`), and reading
25
+ * `result.output.value` on a check whose requested parse actually failed
26
+ * (`PolicyReadFailedParseValueError`) -- both still preserve the original
27
+ * `TypeError` via `cause`, exactly like the plain `PolicyThrewError` case.
28
+ * One policy failing this way never stops any other check's policy from
29
+ * running. If more than one policy fails this way in the same run, this
30
+ * function throws a native `AggregateError` whose `errors` holds one such
31
+ * error per failing check, rather than surfacing only the first one found;
32
+ * if exactly one policy fails, it throws that single error directly.
33
+ * @param entries - each check's id, definition, and final (possibly parsed-output) evidence to invoke its policy against
34
+ * @param evidence - the complete, already-assembled evidence for the whole run, passed to every policy call
35
+ * @returns the aggregated `Verdict` (throws instead if one or more policies failed to produce a valid `PolicyResult`)
36
+ */
37
+ export declare function runPolicies(entries: readonly ParsedCheckEntry[], evidence: Evidence): Promise<Verdict>;
38
+ //# sourceMappingURL=run-policies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-policies.d.ts","sourceRoot":"","sources":["../../../src/policy/run-policies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAMrE,OAAO,KAAK,EAEV,QAAQ,EAIR,OAAO,EACR,MAAM,aAAa,CAAA;AA4HpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,OAAO,CAAC,CAsFlB"}
@@ -0,0 +1,39 @@
1
+ import type { CheckDefinitionConfig, PolicyResult } from "../types.js";
2
+ /**
3
+ * attw's own `--format json` contract -- not published as a TypeScript type
4
+ * by the tool. `problems` is a flat record keyed by problem kind (e.g.
5
+ * "FalseCJS", "NoResolution"), each entry carrying whichever context fields
6
+ * that kind of problem produces.
7
+ */
8
+ export interface AttwReport {
9
+ readonly problems?: Record<string, readonly AttwProblem[]>;
10
+ }
11
+ export interface AttwProblem {
12
+ readonly kind: string;
13
+ readonly entrypoint?: string;
14
+ readonly resolutionKind?: string;
15
+ readonly typesFileName?: string;
16
+ readonly implementationFileName?: string;
17
+ }
18
+ /**
19
+ * Interprets an already-parsed attw JSON report -- exported (unlike this
20
+ * package's other internal evaluators) because a repository whose package
21
+ * has enough entrypoints to make attw's own `--format json` output exceed
22
+ * ~64KB can hit a real, reproducible upstream bug: attw truncates its own
23
+ * stdout when it's a pipe (confirmed independently of repo-contract, via
24
+ * plain shell piping) rather than a TTY or regular file. Redirecting attw's
25
+ * output to a file sidesteps that bug; a consumer doing so needs this same
26
+ * interpretation logic without re-deriving it. repo-contract's own
27
+ * `repo-contract.config.ts` does exactly this once it has more than one real
28
+ * entrypoint (see that file's `arethetypeswrong` override).
29
+ * Accepts `unknown` and validates the shape itself: its inputs are always
30
+ * untrusted parsed JSON (a tool's stdout, a report file), and valid JSON of an
31
+ * unexpected shape must produce a clean fail verdict here rather than a
32
+ * `TypeError` in the caller.
33
+ * @param report - the parsed attw JSON report to evaluate.
34
+ * @returns the pass/fail outcome and its rationale.
35
+ */
36
+ export declare function evaluateAttwReport(report: unknown): PolicyResult;
37
+ /** Published-package type-resolution correctness via `@arethetypeswrong/cli`. */
38
+ export declare const arethetypeswrong: CheckDefinitionConfig;
39
+ //# sourceMappingURL=arethetypeswrong.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arethetypeswrong.d.ts","sourceRoot":"","sources":["../../../src/presets/arethetypeswrong.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAItE;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC,CAAA;CAC3D;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAA;CACzC;AAkBD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,YAAY,CA6BhE;AAUD,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,EAAE,qBAmB9B,CAAA"}
@@ -0,0 +1,16 @@
1
+ import type { CheckDefinitionConfig } from "../types.js";
2
+ /** Options accepted by {@link brokenLinks}. */
3
+ interface BrokenLinksOptions {
4
+ /** File or directory passed straight through to linkinator as its positional target. Defaults to `"."`. */
5
+ readonly start?: string;
6
+ }
7
+ /**
8
+ * Broken-link detection via linkinator, recursing through local files and
9
+ * following both local and remote links. `--skip node_modules` avoids
10
+ * wasting the crawl on vendored files that were never authored content.
11
+ * @param options - configuration for this check; see {@link BrokenLinksOptions}.
12
+ * @returns the configured check.
13
+ */
14
+ export declare function brokenLinks(options?: BrokenLinksOptions): CheckDefinitionConfig;
15
+ export {};
16
+ //# sourceMappingURL=broken-links.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"broken-links.d.ts","sourceRoot":"","sources":["../../../src/presets/broken-links.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAgBxD,+CAA+C;AAC/C,UAAU,kBAAkB;IAC1B,2GAA2G;IAC3G,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB;AAYD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,qBAAqB,CAuDnF"}
@@ -0,0 +1,22 @@
1
+ import type { CheckDefinitionConfig } from "../types.js";
2
+ /** Options accepted by {@link commitlint}. */
3
+ interface CommitlintOptions {
4
+ /** The ref commitlint lints commits *from* (exclusive). Defaults to `"origin/main"`. */
5
+ readonly from?: string;
6
+ /** The ref commitlint lints commits *to* (inclusive). Defaults to `"HEAD"`. */
7
+ readonly to?: string;
8
+ }
9
+ /**
10
+ * Commit-message governance via commitlint, using whatever commitlint
11
+ * config the consumer's own repository already has (commitlint ships no
12
+ * rules of its own -- e.g. `@commitlint/config-conventional`). Exit-code
13
+ * based rather than `--format json`: commitlint has no broadly-documented,
14
+ * stable JSON CLI output, so this preset reads its plain-text report the
15
+ * same way the `format`/`typecheck` presets already do for their tools,
16
+ * rather than relying on an unconfirmed flag.
17
+ * @param options - configuration for this check; see {@link CommitlintOptions}.
18
+ * @returns the configured check.
19
+ */
20
+ export declare function commitlint(options?: CommitlintOptions): CheckDefinitionConfig;
21
+ export {};
22
+ //# sourceMappingURL=commitlint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commitlint.d.ts","sourceRoot":"","sources":["../../../src/presets/commitlint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAKxD,8CAA8C;AAC9C,UAAU,iBAAiB;IACzB,wFAAwF;IACxF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CACrB;AA2BD;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,qBAAqB,CA2BjF"}
@@ -0,0 +1,23 @@
1
+ import type { CheckDefinitionConfig } from "../types.js";
2
+ /** Options accepted by {@link deadCode}. */
3
+ interface DeadCodeOptions {
4
+ /**
5
+ * devDependency names to exclude from the "unused devDependency" issue
6
+ * category -- e.g. CLI tools knip has no way to see are used, because
7
+ * nothing `import`s them. Round-tripped through knip's own
8
+ * `--reporter-options` flag (see `readReporterOptions`) rather than kept in
9
+ * a closure, so the exempt list this check actually ran with is visible on
10
+ * the recorded command line and in persisted evidence, not just in this
11
+ * file's source. Defaults to an empty list -- repo-contract ships no
12
+ * built-in exemptions; add your own repository's here.
13
+ */
14
+ readonly exemptUnusedDevDependencies?: readonly string[];
15
+ }
16
+ /**
17
+ * Dead/unused-code detection via knip.
18
+ * @param options - configuration for this check; see {@link DeadCodeOptions}.
19
+ * @returns the configured check.
20
+ */
21
+ export declare function deadCode(options?: DeadCodeOptions): CheckDefinitionConfig;
22
+ export {};
23
+ //# sourceMappingURL=dead-code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dead-code.d.ts","sourceRoot":"","sources":["../../../src/presets/dead-code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AA8CxD,4CAA4C;AAC5C,UAAU,eAAe;IACvB;;;;;;;;;OASG;IACH,QAAQ,CAAC,2BAA2B,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CACzD;AA6DD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG,qBAAqB,CAiG7E"}
@@ -0,0 +1,14 @@
1
+ import type { CheckDefinitionConfig } from "../types.js";
2
+ /** Options accepted by {@link duplication}. */
3
+ interface DuplicationOptions {
4
+ /** Directory to scan for duplicated code, passed straight through to jscpd as its positional target. Defaults to `"."` -- narrow it (e.g. `"src"`) to scope the scan to your own source tree. */
5
+ readonly path?: string;
6
+ }
7
+ /**
8
+ * Duplicated-code detection via jscpd.
9
+ * @param options - configuration for this check; see {@link DuplicationOptions}.
10
+ * @returns the configured check.
11
+ */
12
+ export declare function duplication(options?: DuplicationOptions): CheckDefinitionConfig;
13
+ export {};
14
+ //# sourceMappingURL=duplication.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duplication.d.ts","sourceRoot":"","sources":["../../../src/presets/duplication.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAkCxD,+CAA+C;AAC/C,UAAU,kBAAkB;IAC1B,iMAAiM;IACjM,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB;AAgBD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,qBAAqB,CA4EnF"}
@@ -0,0 +1,4 @@
1
+ import type { CheckDefinitionConfig } from "../types.js";
2
+ /** End-to-end test execution via Playwright, reading its JSON reporter output. */
3
+ export declare const e2e: CheckDefinitionConfig;
4
+ //# sourceMappingURL=e2e.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"e2e.d.ts","sourceRoot":"","sources":["../../../src/presets/e2e.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AA+ExD,kFAAkF;AAClF,eAAO,MAAM,GAAG,EAAE,qBA+DjB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { CheckDefinitionConfig } from "../types.js";
2
+ /** Code formatting via Prettier, applied in place. */
3
+ export declare const format: CheckDefinitionConfig;
4
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/presets/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAKxD,sDAAsD;AACtD,eAAO,MAAM,MAAM,EAAE,qBAkBpB,CAAA"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Curated, growing catalog of preset checks for tools common across
3
+ * TypeScript/JavaScript repositories -- each preset encodes how to execute
4
+ * and interpret a common tool, never a repository's definition of quality
5
+ * (see specs/decisions/0004-public-surface-stays-narrow-no-cli-experimental-presets.md). Import a preset,
6
+ * spread it into your own `checks` record, and override whatever you need
7
+ * -- most often `policy`; a factory preset's options are the preferred way
8
+ * to change what it executes, a direct `run` override is an escape hatch.
9
+ * Never re-exported from the package root (`src/index.ts`) -- presets are
10
+ * an opt-in extra, not part of the core execution/evidence/policy surface
11
+ * those exports describe, and this barrel never re-exports anything from
12
+ * there either; the two stay independent.
13
+ * @packageDocumentation
14
+ */
15
+ export { arethetypeswrong } from "./arethetypeswrong.js";
16
+ export { brokenLinks } from "./broken-links.js";
17
+ export { commitlint } from "./commitlint.js";
18
+ export { deadCode } from "./dead-code.js";
19
+ export { duplication } from "./duplication.js";
20
+ export { e2e } from "./e2e.js";
21
+ export { format } from "./format.js";
22
+ export { license } from "./license.js";
23
+ export { lint } from "./lint.js";
24
+ export { markdownlint } from "./markdownlint.js";
25
+ export { publint } from "./publint.js";
26
+ export { securityDeps } from "./security-deps.js";
27
+ export { securitySecrets } from "./security-secrets.js";
28
+ export { stylelint } from "./stylelint.js";
29
+ export { test } from "./test.js";
30
+ export { typecheck } from "./typecheck.js";
31
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/presets/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { CheckDefinitionConfig } from "../types.js";
2
+ /** Dependency license compliance via licensee. */
3
+ export declare const license: CheckDefinitionConfig;
4
+ //# sourceMappingURL=license.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../../../src/presets/license.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAuBxD,kDAAkD;AAClD,eAAO,MAAM,OAAO,EAAE,qBAiErB,CAAA"}
@@ -0,0 +1,20 @@
1
+ import type { CheckDefinitionConfig } from "../types.js";
2
+ /** Options accepted by {@link lint}. */
3
+ interface LintOptions {
4
+ /** Path (or glob) passed straight through to ESLint as its positional target. Defaults to `"."` -- narrow it (e.g. `"src"`) to scope linting to your own source tree. */
5
+ readonly path?: string;
6
+ }
7
+ /**
8
+ * Static analysis via ESLint, using whatever `eslint.config.js` the
9
+ * consumer's own repository already has -- this preset makes no assumption
10
+ * about rule configuration, only about how to run the tool and interpret
11
+ * its JSON output. Severity `2` (error) blocks; severity `1` (warning) is
12
+ * reported but never blocks -- ESLint's own severities already encode that
13
+ * distinction, so this preset just respects it rather than treating every
14
+ * finding as equally blocking.
15
+ * @param options - configuration for this check; see {@link LintOptions}.
16
+ * @returns the configured check.
17
+ */
18
+ export declare function lint(options?: LintOptions): CheckDefinitionConfig;
19
+ export {};
20
+ //# sourceMappingURL=lint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../../src/presets/lint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AA0BxD,wCAAwC;AACxC,UAAU,WAAW;IACnB,yKAAyK;IACzK,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB;AAoBD;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAgB,GAAG,qBAAqB,CAsDrE"}
@@ -0,0 +1,23 @@
1
+ import type { CheckDefinitionConfig } from "../types.js";
2
+ /** Options accepted by {@link markdownlint}. */
3
+ interface MarkdownlintOptions {
4
+ /** Glob passed straight through to markdownlint-cli2 as its positional target. Defaults to `"**\/*.md"`. */
5
+ readonly glob?: string;
6
+ }
7
+ /**
8
+ * Markdown structure/style lint via markdownlint-cli2. Unlike this
9
+ * package's other file-based-report presets, the report path is
10
+ * config-driven rather than a CLI flag -- markdownlint-cli2 only writes
11
+ * JSON when its own config file requests it. This preset assumes the
12
+ * consumer's `.markdownlint-cli2.jsonc` includes:
13
+ * ```jsonc
14
+ * "outputFormatters": [["markdownlint-cli2-formatter-json", { "name": "reports/markdownlint.json" }]]
15
+ * ```
16
+ * which also requires the `markdownlint-cli2-formatter-json` package
17
+ * alongside `markdownlint-cli2` itself.
18
+ * @param options - configuration for this check; see {@link MarkdownlintOptions}.
19
+ * @returns the configured check.
20
+ */
21
+ export declare function markdownlint(options?: MarkdownlintOptions): CheckDefinitionConfig;
22
+ export {};
23
+ //# sourceMappingURL=markdownlint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdownlint.d.ts","sourceRoot":"","sources":["../../../src/presets/markdownlint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAmBxD,gDAAgD;AAChD,UAAU,mBAAmB;IAC3B,4GAA4G;IAC5G,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB;AAeD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,qBAAqB,CAmDrF"}
@@ -0,0 +1,13 @@
1
+ import type { CheckDefinitionConfig } from "../types.js";
2
+ /**
3
+ * publint has no machine-readable output mode -- only a plain-text CLI
4
+ * reporter (see its own `src/cli.js` `formatMessages`). Its process exit
5
+ * code reflects only 'error'-level findings; 'warning'/'suggestion'-level
6
+ * findings never affect it. This preset reads the same three section
7
+ * headers publint's own CLI writes ("Errors:", "Warnings:", "Suggestions:")
8
+ * to distinguish blocking findings from non-blocking ones, without
9
+ * depending on any per-message structure publint doesn't expose. Relevant
10
+ * only to repositories that publish an npm package.
11
+ */
12
+ export declare const publint: CheckDefinitionConfig;
13
+ //# sourceMappingURL=publint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publint.d.ts","sourceRoot":"","sources":["../../../src/presets/publint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAKxD;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO,EAAE,qBAsBrB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { CheckDefinitionConfig } from "../types.js";
2
+ /** Dependency vulnerability scanning via `npm audit`. */
3
+ export declare const securityDeps: CheckDefinitionConfig;
4
+ //# sourceMappingURL=security-deps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security-deps.d.ts","sourceRoot":"","sources":["../../../src/presets/security-deps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AA0CxD,yDAAyD;AACzD,eAAO,MAAM,YAAY,EAAE,qBAkG1B,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { CheckDefinitionConfig } from "../types.js";
2
+ /** Secret-leak scanning via secretlint. */
3
+ export declare const securitySecrets: CheckDefinitionConfig;
4
+ //# sourceMappingURL=security-secrets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security-secrets.d.ts","sourceRoot":"","sources":["../../../src/presets/security-secrets.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAsBxD,2CAA2C;AAC3C,eAAO,MAAM,eAAe,EAAE,qBAoE7B,CAAA"}
@@ -0,0 +1,13 @@
1
+ import type { PolicyResult } from "../../types.js";
2
+ /**
3
+ * The shared three-branch shape behind every lint-style preset's pass/warn/fail decision: fail,
4
+ * listing every error, if there are any; else warn, listing every warning, if there are any; else
5
+ * pass -- shared by `lint` (ESLint) and `stylelint`, whose only difference was the tool name
6
+ * substituted into each rationale string.
7
+ * @param toolName - the tool's own display name, substituted into every rationale (e.g. "ESLint", "stylelint").
8
+ * @param errorDetails - one rendered line per error-severity finding.
9
+ * @param warningDetails - one rendered line per warning-severity finding.
10
+ * @returns the fail/warn/pass `PolicyResult`.
11
+ */
12
+ export declare function errorWarningPassPolicy(toolName: string, errorDetails: readonly string[], warningDetails: readonly string[]): PolicyResult;
13
+ //# sourceMappingURL=error-warning-pass-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-warning-pass-policy.d.ts","sourceRoot":"","sources":["../../../../src/presets/shared/error-warning-pass-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,SAAS,MAAM,EAAE,EAC/B,cAAc,EAAE,SAAS,MAAM,EAAE,GAChC,YAAY,CAsBd"}
@@ -0,0 +1,23 @@
1
+ import type { CheckEvidence } from "../../types.js";
2
+ /**
3
+ * A check's captured stdout and stderr, trimmed and joined into one block -- either stream may be
4
+ * empty and is dropped rather than contributing a blank line. Shared by `exitCodeFailRationale`
5
+ * below and by `publint` (which needs the combined text itself, not just a rendered failure
6
+ * message, to detect its own "Warnings:"/"Suggestions:" section headers).
7
+ * @param result - the check's execution evidence (only `stdout`/`stderr` are read).
8
+ * @returns the combined, trimmed stdout+stderr text, or `""` if the tool produced neither.
9
+ */
10
+ export declare function combinedOutput(result: CheckEvidence): string;
11
+ /**
12
+ * Shared by every preset whose policy is a plain "exitCode 0 = pass, else
13
+ * render captured stdout/stderr (or fall back to an exit-code-only message
14
+ * if the tool produced neither)" -- `format`, `typecheck`, `commitlint`.
15
+ * Each preset still owns its own pass rationale and its own description of
16
+ * what failed; this only renders the shared "here's what the tool printed"
17
+ * half.
18
+ * @param result - the check's execution evidence (only `stdout`/`stderr`/`exitCode` are read).
19
+ * @param description - a present-tense description of the failure, e.g. "Prettier reported formatting failures".
20
+ * @returns `"{description}:\n{output}"` when the tool produced output, or `"{description} (exit code {N})."` otherwise.
21
+ */
22
+ export declare function exitCodeFailRationale(result: CheckEvidence, description: string): string;
23
+ //# sourceMappingURL=exit-code-fail-rationale.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exit-code-fail-rationale.d.ts","sourceRoot":"","sources":["../../../../src/presets/shared/exit-code-fail-rationale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAI5D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAMxF"}
@@ -0,0 +1,19 @@
1
+ import type { CheckEvidence, PolicyResult } from "../../types.js";
2
+ /**
3
+ * Every preset in `src/presets/*.ts` (except `securityDeps`, which shells out
4
+ * to `npm` itself -- something that cannot be "missing" in any environment
5
+ * capable of running `npm run <script>` at all) calls this first, before its
6
+ * own pass/fail/warn logic. `CheckEvidence.status === "spawn_error"` already
7
+ * distinguishes "the OS couldn't even launch the executable" from "the tool
8
+ * ran and exited non-zero" -- but not every spawn failure means the package
9
+ * is missing (a permission error or an invalid executable format lands here
10
+ * too), so this checks the structured `spawnErrorCode` for `"ENOENT"`
11
+ * specifically rather than treating every spawn error as "not installed."
12
+ * A non-ENOENT spawn error falls through to the preset's normal handling,
13
+ * unchanged, rather than getting a misleading "not installed" message.
14
+ * @param result - the check's raw execution evidence to inspect.
15
+ * @param packageName - the npm package a consumer would install to fix this (may differ from the binary name, e.g. `tsc` comes from `typescript`).
16
+ * @returns an actionable, package-manager-neutral `PolicyResult` if the tool appears to be missing, or `undefined` if the caller should proceed with its own interpretation.
17
+ */
18
+ export declare function checkDependencyInstalled(result: CheckEvidence, packageName: string): PolicyResult | undefined;
19
+ //# sourceMappingURL=missing-dependency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"missing-dependency.d.ts","sourceRoot":"","sources":["../../../../src/presets/shared/missing-dependency.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAEjE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,aAAa,EACrB,WAAW,EAAE,MAAM,GAClB,YAAY,GAAG,SAAS,CAS1B"}