@pho9ubenaa/siro 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/README.md +13 -3
- package/dist/cli.mjs +13 -2
- package/dist/index.d.mts +42 -22
- package/dist/index.mjs +1 -1
- package/dist/{node-io-BN34YwoL.mjs → node-io-CaqobxYp.mjs} +958 -196
- package/package.json +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,61 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.0]
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- Allow custom checks to return a nonempty `violations` group. Report unsupported settings separately per file and Aube lifecycle controls separately per missing file. JSON schema 2 is unchanged; exhaustive `CheckStatus` consumers must handle the new variant.
|
|
8
|
+
- Add optional `FileSystem.resolveDirectory` for Deno's native positive literal-prefix lookup, retaining minimatch and existing dependencies. Virtual filesystems without this port resolve exact child names. Negative patterns retain lexical applicability; conflicting overlapping bases fail explicitly.
|
|
9
|
+
|
|
10
|
+
- Add `unsupported-settings` to report configured settings introduced after a declared or explicit stable PM version. Cover 16 setting/file pairs across npm, pnpm, Yarn, Bun, and Deno, with a generated table of release sources.
|
|
11
|
+
- Resolve each manager's target from `package.json#packageManager`, `config.pmVersions`, or the higher-priority `--pm-version` / API `pmVersion` option (which requires `--pm` / `pm`). Expose the resolved target as `RuleContext.pmVersion` for custom rules.
|
|
12
|
+
- Preserve name detection when a declaration has no exact stable version. Reject ranges, tags, partial versions, and prereleases in explicit targets; accept build metadata such as Corepack hashes.
|
|
13
|
+
- Add opt-in `--workspaces` / API `workspaces: true` to inspect declared npm, pnpm, Yarn, Bun, Deno, and Aube members' publication metadata. Reuse existing rules, identify member file paths, and aggregate severity counts and CLI exit status.
|
|
14
|
+
- Add optional `FileSystem.readDirectories` for workspace discovery in virtual repositories, without falling back to host IO.
|
|
15
|
+
|
|
16
|
+
### Behavior and scope
|
|
17
|
+
|
|
18
|
+
- The new rule defaults to `error`; projects with previously accepted unsupported settings may now exit 1. Existing security checks, severity overrides, and JSON schema 2 remain in effect.
|
|
19
|
+
- Availability checks cover recorded introductions in the listed files, not whole PM schemas, runtime discovery, removals, backports, version-specific value syntax, or effective defaults. Deno coverage is limited to `.npmrc#min-release-age`; Aube retains its existing checks without introduction coverage in this release.
|
|
20
|
+
- Distinguish pnpm's strict-build setting introduction (10.3.0) from general workspace YAML support (10.6.0), and correct Bun's scanner introduction note to 1.2.21.
|
|
21
|
+
- Keep shared installation and lockfile checks at the root. Members infer their own publication status and use the root's PM target; child executable configs are not loaded. Workspace discovery requires explicit declarations, excludes directory symlinks, and does not cover effective configuration inheritance. Deno/Aube use bounded, source-derived declaration semantics.
|
|
22
|
+
|
|
23
|
+
### Fixes
|
|
24
|
+
|
|
25
|
+
- Update `smol-toml` to 1.8.0 and Vitest to 4.1.11 to include upstream security fixes.
|
|
26
|
+
- Honor Deno 2.8.1+'s project `.npmrc#min-release-age` fallback when `deno.json` does not provide an age, while retaining `deno.json` precedence and reporting an explicit zero opt-out.
|
|
27
|
+
- For pnpm targets before 10.9.0, recommend supported `strictDepBuilds` gating without claiming that the ignored future-version bypass requires pnpm 10.9.0.
|
|
28
|
+
- Keep nested workspace candidates visible when only their ancestor candidate is excluded. Prune traversal only when a trailing `/**` exclusion covers the subtree.
|
|
29
|
+
- Reject workspace patterns whose brace-expanded alternatives contain parent traversal or exceed 8,192 entries before compilation, and avoid backtracking in Aube exclusion matching.
|
|
30
|
+
- Match npm's odd/even interpretation of repeated leading `!` characters.
|
|
31
|
+
- Match Bun's workspace ordering and syntax classification: explicit members remain included, later positive globs can re-include earlier exclusions, and extglob punctuation stays literal.
|
|
32
|
+
- Exclude `CMakeFiles` from Bun glob traversal while retaining explicitly named members below it, matching Bun's walker and literal-member path.
|
|
33
|
+
- Honor npm's ordered cancellation of workspace exclusions, including its handling of adjacent repeated exclusions.
|
|
34
|
+
- Match npm's leading-`#` comment behavior while retaining `#` in nested path segments.
|
|
35
|
+
- Permit colons in ordinary relative workspace segments while continuing to reject absolute and drive-letter paths.
|
|
36
|
+
- Report rejected workspace glob patterns as configuration errors (exit 2) instead of internal crashes (exit 70).
|
|
37
|
+
- Reject non-file manifest inputs before reading, preventing root and workspace FIFO manifests from blocking the scan.
|
|
38
|
+
- Match literal workspace path segments and exclusions case-insensitively on macOS and Windows, so declaration casing does not silently omit members.
|
|
39
|
+
- Use minimatch consistently for workspace membership, exclusions, and traversal. Remove custom brace expansion and globstar matching.
|
|
40
|
+
- Limit workspace traversal using each applicable pattern's own depth, preserving errors from required directory reads.
|
|
41
|
+
- Wait for asynchronous reporters and propagate their failures through the command's error handling.
|
|
42
|
+
- Reject non-file entries at configuration and lockfile paths instead of accepting directories as existing files.
|
|
43
|
+
|
|
44
|
+
### Verification
|
|
45
|
+
|
|
46
|
+
- Exercise version boundaries, selection precedence, multi-manager isolation, invalid targets, CLI exit codes, custom-rule context, and the installed package's API and strict types.
|
|
47
|
+
- Exercise workspace patterns, exclusions, duplicate matches, malformed child manifests, private roots with public children, injected IO, and installed CLI/API member inspection.
|
|
48
|
+
|
|
49
|
+
## [0.4.3]
|
|
50
|
+
|
|
51
|
+
### Maintenance
|
|
52
|
+
|
|
53
|
+
- Verify the packed package from an isolated consumer on both supported Node majors in CI. Check distributed files, installed CLI exit codes, package exports, custom rules, JSON output, and strict TypeScript declaration resolution without development dependency types.
|
|
54
|
+
- Verify the same tarball before staging it for npm publication, preferring cached dependencies with install scripts disabled.
|
|
55
|
+
- Centralize packing, verification, and temporary-file cleanup in `pnpm test:package`; retain the verified artifact on request for publication.
|
|
56
|
+
- Move the release tag/version check into a standalone script while preserving the rejection of private packages and mismatched tags before installation and publication.
|
|
57
|
+
- Allow bounded startup headroom for audit subprocess tests on shared runners and report process failures before reading their output records.
|
|
58
|
+
|
|
3
59
|
## [0.4.2]
|
|
4
60
|
|
|
5
61
|
### Fixes
|
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ The CLI reads `siro.config.*` as executable code. Review repository configuratio
|
|
|
38
38
|
|
|
39
39
|
## Features
|
|
40
40
|
|
|
41
|
-
- **Rules across six managers.**
|
|
41
|
+
- **Rules across six managers.** 28 rules covering lifecycle scripts, version pinning, lockfiles
|
|
42
42
|
(`commit`/`frozen`), release age, publish provenance, `files`/`publishConfig`, SSL enforcement,
|
|
43
43
|
checksum verification, exotic subdependency blocking, audit suppression review, store integrity,
|
|
44
44
|
Bun's security scanner API, and Yarn 4's hardened-mode — each mapped to the right setting per
|
|
@@ -50,6 +50,12 @@ The CLI reads `siro.config.*` as executable code. Review repository configuratio
|
|
|
50
50
|
- **Machine-readable remediation.** A finding can carry automatic key operations or manual
|
|
51
51
|
instructions. Review proposed changes and rerun the linter after editing.
|
|
52
52
|
See [docs/json-output.md](docs/json-output.md).
|
|
53
|
+
- **Target PM versions.** Flag settings introduced after the declared or explicit stable PM
|
|
54
|
+
version. See [checked settings and sources](docs/rules.md#checked-introduction-versions)
|
|
55
|
+
for the npm, pnpm, Yarn, Bun, and Deno coverage.
|
|
56
|
+
- **Workspace members.** `--workspaces` adds publication-metadata checks for declared npm,
|
|
57
|
+
pnpm, Yarn, Bun, Deno, and Aube members, including public packages under a private root.
|
|
58
|
+
See [workspace inspection](docs/configuration.md#workspace-members) for scope and exclusions.
|
|
53
59
|
- **Lint with severities.** `error` fails CI by default; `--severity warn` tightens the gate.
|
|
54
60
|
- **Reporters.** `pretty` (default), `json` for CI, `github` for PR annotations; register your own.
|
|
55
61
|
- **Configurable.** Drop a `siro.config.ts` to disable rules, override severities, restrict PMs,
|
|
@@ -61,8 +67,10 @@ See the [rule reference](docs/rules.md) for what each check does and why, and th
|
|
|
61
67
|
## Versioning policy
|
|
62
68
|
|
|
63
69
|
siro evaluates the recorded policy snapshot in [docs/policy-sources.md](docs/policy-sources.md).
|
|
64
|
-
It detects package-manager names
|
|
65
|
-
|
|
70
|
+
It detects package-manager names and reads exact stable targets from `packageManager`,
|
|
71
|
+
`config.pmVersions`, or `--pm-version`. It does not inspect installed binaries. The
|
|
72
|
+
`unsupported-settings` rule checks recorded introduction versions; unlisted settings and
|
|
73
|
+
unknown targets are not evaluated for availability. A version-dependent safe-default annotation prevents an unverified
|
|
66
74
|
severity downgrade; it does not prove that the current version satisfies the rule. See
|
|
67
75
|
[configuration](docs/configuration.md) for defaults, applicability, and limits.
|
|
68
76
|
|
|
@@ -72,6 +80,8 @@ severity downgrade; it does not prove that the current version satisfies the rul
|
|
|
72
80
|
siro <lint|check> [path] [options]
|
|
73
81
|
|
|
74
82
|
--pm <npm|pnpm|yarn|bun|deno|aube> Target a specific package manager (auto-detected; required if detection finds nothing)
|
|
83
|
+
--pm-version <x.y.z> Exact stable target version (requires --pm)
|
|
84
|
+
--workspaces Also inspect workspace members' publication metadata
|
|
75
85
|
--project-type <application|package> Select application or published-package policy (default auto)
|
|
76
86
|
--reporter <pretty|json|github> Output format (default pretty)
|
|
77
87
|
--severity <error|warn|info> Show and fail on findings at or above this level
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as SUPPORTED_NODE_RANGE, D as isNodeError, M as UsageError, O as asAbsPath, S as isSeverity, T as assertDirectory, _ as PROJECT_TYPES, b as SEVERITIES, c as DEFAULT_REPORTER_NAME, f as version, j as SiroError, l as JSON_REPORTER_NAME, m as loadConfig, n as lintCommand, s as BUILTIN_REPORTER_NAMES, t as nodeIO, v as isProjectType, w as isSupportedNodeVersion, x as isPM, y as PMS } from "./node-io-
|
|
2
|
+
import { C as SUPPORTED_NODE_RANGE, D as isNodeError, M as UsageError, O as asAbsPath, S as isSeverity, T as assertDirectory, _ as PROJECT_TYPES, b as SEVERITIES, c as DEFAULT_REPORTER_NAME, f as version, j as SiroError, l as JSON_REPORTER_NAME, m as loadConfig, n as lintCommand, s as BUILTIN_REPORTER_NAMES, t as nodeIO, v as isProjectType, w as isSupportedNodeVersion, x as isPM, y as PMS } from "./node-io-CaqobxYp.mjs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
import { parseArgs } from "node:util";
|
|
@@ -33,6 +33,7 @@ const isCommandName = (value) => COMMANDS.some((cmd) => cmd === value);
|
|
|
33
33
|
//#region src/cli/parse-args.ts
|
|
34
34
|
const VALUE_FLAGS = new Set([
|
|
35
35
|
"pm",
|
|
36
|
+
"pm-version",
|
|
36
37
|
"project-type",
|
|
37
38
|
"reporter",
|
|
38
39
|
"severity"
|
|
@@ -40,7 +41,8 @@ const VALUE_FLAGS = new Set([
|
|
|
40
41
|
const BOOLEAN_FLAGS = new Set([
|
|
41
42
|
"help",
|
|
42
43
|
"version",
|
|
43
|
-
"json"
|
|
44
|
+
"json",
|
|
45
|
+
"workspaces"
|
|
44
46
|
]);
|
|
45
47
|
const parseCommand = (argv) => {
|
|
46
48
|
const { tokens } = parseArgs({
|
|
@@ -110,10 +112,13 @@ const parseCommand = (argv) => {
|
|
|
110
112
|
if (extra.length > 0) throw new UsageError(`Unexpected extra argument: ${extra.join(" ")}`);
|
|
111
113
|
if (flags.has("reporter") && flags.has("json")) throw new UsageError("Invalid reporter selection: use either --reporter or --json.");
|
|
112
114
|
const reporter = flags.get("reporter");
|
|
115
|
+
const pmVersion = flags.get("pm-version");
|
|
113
116
|
return {
|
|
114
117
|
kind: "lint",
|
|
115
118
|
cwd: asAbsPath(path.resolve(cwd ?? process.cwd())),
|
|
116
119
|
pm: parsePmFlag(flags.get("pm")),
|
|
120
|
+
pmVersion: typeof pmVersion === "string" ? pmVersion : void 0,
|
|
121
|
+
workspaces: flags.has("workspaces") || void 0,
|
|
117
122
|
projectType: parseProjectTypeFlag(flags.get("project-type")),
|
|
118
123
|
severity: parseSeverityFlag(flags.get("severity")),
|
|
119
124
|
reporter: typeof reporter === "string" ? reporter : flags.has("json") ? JSON_REPORTER_NAME : DEFAULT_REPORTER_NAME
|
|
@@ -128,6 +133,8 @@ const SEVERITIES_LIST = SEVERITIES.join("|");
|
|
|
128
133
|
const FLAG_LINES = {
|
|
129
134
|
json: " --json Shortcut for --reporter json",
|
|
130
135
|
pm: ` --pm <name> Target a specific package manager (${PMS_LIST})`,
|
|
136
|
+
pmVersion: " --pm-version <x.y.z> Target an exact stable PM version (requires --pm)",
|
|
137
|
+
workspaces: " --workspaces Also check workspace members' publication metadata",
|
|
131
138
|
projectType: ` --project-type <type> Project type (${PROJECT_TYPES_LIST}; default auto)`,
|
|
132
139
|
reporter: ` --reporter <name> Reporter (${REPORTERS_LIST}; additional reporters can be registered via siro.config.ts)`,
|
|
133
140
|
severity: ` --severity <level> Show + fail on findings at or above this level (${SEVERITIES_LIST})`
|
|
@@ -143,6 +150,8 @@ const HELP_ROOT = [
|
|
|
143
150
|
"",
|
|
144
151
|
"GLOBAL FLAGS",
|
|
145
152
|
FLAG_LINES.pm,
|
|
153
|
+
FLAG_LINES.pmVersion,
|
|
154
|
+
FLAG_LINES.workspaces,
|
|
146
155
|
FLAG_LINES.projectType,
|
|
147
156
|
" --version Print the siro version",
|
|
148
157
|
" --help Show help for siro or a command",
|
|
@@ -171,6 +180,8 @@ const HELP_LINT = [
|
|
|
171
180
|
"",
|
|
172
181
|
"FLAGS",
|
|
173
182
|
FLAG_LINES.pm,
|
|
183
|
+
FLAG_LINES.pmVersion,
|
|
184
|
+
FLAG_LINES.workspaces,
|
|
174
185
|
FLAG_LINES.projectType,
|
|
175
186
|
FLAG_LINES.reporter,
|
|
176
187
|
FLAG_LINES.json,
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import * as vb from "valibot";
|
|
2
2
|
|
|
3
|
+
//#region src/shared/paths.d.ts
|
|
4
|
+
declare const AbsPathBrand: unique symbol;
|
|
5
|
+
declare const RelPathBrand: unique symbol;
|
|
6
|
+
type AbsPath = string & {
|
|
7
|
+
readonly [AbsPathBrand]: true;
|
|
8
|
+
};
|
|
9
|
+
type RelPath = string & {
|
|
10
|
+
readonly [RelPathBrand]: true;
|
|
11
|
+
};
|
|
12
|
+
declare const asAbsPath: (value: string) => AbsPath;
|
|
13
|
+
declare const asRelPath: (value: string) => RelPath;
|
|
14
|
+
//#endregion
|
|
3
15
|
//#region src/domain/entities/config-value.d.ts
|
|
4
16
|
declare const CODEC_KINDS: readonly ["json", "npmrc", "toml", "yaml"];
|
|
5
17
|
type CodecKind = (typeof CODEC_KINDS)[number];
|
|
@@ -16,22 +28,16 @@ type ConfigReadValue = unknown;
|
|
|
16
28
|
/** Read an own key path; absent or non-mapping parents yield undefined. */
|
|
17
29
|
declare const getByPath: (config: ParsedConfig, keyPath: KeyPath) => ConfigReadValue;
|
|
18
30
|
//#endregion
|
|
19
|
-
//#region src/shared/paths.d.ts
|
|
20
|
-
declare const AbsPathBrand: unique symbol;
|
|
21
|
-
declare const RelPathBrand: unique symbol;
|
|
22
|
-
type AbsPath = string & {
|
|
23
|
-
readonly [AbsPathBrand]: true;
|
|
24
|
-
};
|
|
25
|
-
type RelPath = string & {
|
|
26
|
-
readonly [RelPathBrand]: true;
|
|
27
|
-
};
|
|
28
|
-
declare const asAbsPath: (value: string) => AbsPath;
|
|
29
|
-
declare const asRelPath: (value: string) => RelPath;
|
|
30
|
-
//#endregion
|
|
31
31
|
//#region src/domain/ports/file-system.d.ts
|
|
32
32
|
/** IO boundary: swap in memfs (or any other backend) for tests. */
|
|
33
33
|
interface FileSystem {
|
|
34
|
+
/** Ordinary child directory names, excluding symlinks. Required only for workspace discovery. Errors must propagate. */
|
|
35
|
+
readDirectories?: (path: AbsPath) => readonly string[];
|
|
36
|
+
/** Resolve one ordinary child using this filesystem's native name semantics, returning its enumerated name. No symlinks. Undefined for absence; other errors propagate. Without this optional port, Deno literal prefixes use exact names from readDirectories. */
|
|
37
|
+
resolveDirectory?: (parent: AbsPath, name: string) => string | undefined;
|
|
38
|
+
/** Read a regular file (including a symlink to one); undefined only for ENOENT. Other errors and non-file entries must throw. */
|
|
34
39
|
readText: (path: AbsPath) => string | undefined;
|
|
40
|
+
/** True for a regular file (including a symlink to one); false only for ENOENT. Other errors and non-file entries must throw. */
|
|
35
41
|
exists: (path: AbsPath) => boolean;
|
|
36
42
|
}
|
|
37
43
|
//#endregion
|
|
@@ -76,6 +82,8 @@ interface RepoContext {
|
|
|
76
82
|
}
|
|
77
83
|
/** Settings read during one evaluation share its parser and cache. */
|
|
78
84
|
interface RuleContext extends RepoContext {
|
|
85
|
+
/** Declared or explicit stable version of this binding's manager, if known. */
|
|
86
|
+
readonly pmVersion?: string;
|
|
79
87
|
readConfig: (file: ConfigFileRef) => ParsedConfig;
|
|
80
88
|
}
|
|
81
89
|
//#endregion
|
|
@@ -100,18 +108,24 @@ type Remediation = {
|
|
|
100
108
|
readonly steps: readonly [string, ...string[]];
|
|
101
109
|
readonly operations?: never;
|
|
102
110
|
};
|
|
103
|
-
|
|
104
|
-
readonly state: 'ok';
|
|
105
|
-
} | {
|
|
106
|
-
readonly state: 'na';
|
|
107
|
-
} | {
|
|
111
|
+
interface ViolationStatus {
|
|
108
112
|
readonly state: 'violation';
|
|
109
|
-
readonly message: string;
|
|
113
|
+
readonly message: string;
|
|
114
|
+
/** File responsible for this individual violation. */
|
|
110
115
|
readonly file?: RelPath;
|
|
111
116
|
readonly expected?: ConfigValue;
|
|
112
|
-
readonly actual?: ConfigReadValue;
|
|
117
|
+
readonly actual?: ConfigReadValue;
|
|
118
|
+
/** User configuration takes precedence over this per-result severity. */
|
|
113
119
|
readonly severity?: Severity;
|
|
114
120
|
readonly remediation?: Remediation;
|
|
121
|
+
}
|
|
122
|
+
type CheckStatus = {
|
|
123
|
+
readonly state: 'ok';
|
|
124
|
+
} | {
|
|
125
|
+
readonly state: 'na';
|
|
126
|
+
} | ViolationStatus | {
|
|
127
|
+
readonly state: 'violations'; /** Independent findings; a rule chooses its own grouping granularity. */
|
|
128
|
+
readonly violations: readonly [ViolationStatus, ...ViolationStatus[]];
|
|
115
129
|
};
|
|
116
130
|
/** Display-only package-manager version metadata. */
|
|
117
131
|
interface VersionNote {
|
|
@@ -141,7 +155,7 @@ interface Rule<Id extends string = string> {
|
|
|
141
155
|
declare const defineRule: <const Id extends string>(rule: Rule<Id>) => Rule<Id>;
|
|
142
156
|
//#endregion
|
|
143
157
|
//#region src/domain/builtin-rules.d.ts
|
|
144
|
-
declare const rules: readonly [Rule<"advisory-check">, Rule<"approved-git-repos">, Rule<"audit-suppression">, Rule<"block-auto-install">, Rule<"block-exotic-subdeps">, Rule<"bun-security-scanner">, Rule<"checksum-verification">, Rule<"commit-lockfile">, Rule<"dependency-overrides">, Rule<"disable-lifecycle-scripts">, Rule<"enforce-strict-ssl">, Rule<"files-field">, Rule<"frozen-lockfile">, Rule<"frozen-store">, Rule<"hardened-mode">, Rule<"minimum-release-age">, Rule<"named-registries">, Rule<"paranoid-mode">, Rule<"patched-dependencies">, Rule<"pin-exact-versions">, Rule<"provenance">, Rule<"publish-access">, Rule<"store-server">, Rule<"strict-allow-scripts">, Rule<"strict-release-age">, Rule<"strict-store-integrity">, Rule<"trust-policy">];
|
|
158
|
+
declare const rules: readonly [Rule<"advisory-check">, Rule<"approved-git-repos">, Rule<"audit-suppression">, Rule<"block-auto-install">, Rule<"block-exotic-subdeps">, Rule<"bun-security-scanner">, Rule<"checksum-verification">, Rule<"commit-lockfile">, Rule<"dependency-overrides">, Rule<"disable-lifecycle-scripts">, Rule<"enforce-strict-ssl">, Rule<"files-field">, Rule<"frozen-lockfile">, Rule<"frozen-store">, Rule<"hardened-mode">, Rule<"minimum-release-age">, Rule<"named-registries">, Rule<"paranoid-mode">, Rule<"patched-dependencies">, Rule<"pin-exact-versions">, Rule<"provenance">, Rule<"publish-access">, Rule<"store-server">, Rule<"strict-allow-scripts">, Rule<"strict-release-age">, Rule<"strict-store-integrity">, Rule<"trust-policy">, Rule<"unsupported-settings">];
|
|
145
159
|
type BuiltinRuleId = (typeof rules)[number]['id'];
|
|
146
160
|
//#endregion
|
|
147
161
|
//#region src/domain/ports/io.d.ts
|
|
@@ -172,7 +186,7 @@ interface LintResult {
|
|
|
172
186
|
//#region src/domain/ports/reporter.d.ts
|
|
173
187
|
interface Reporter<Name extends string = string> {
|
|
174
188
|
readonly name: Name;
|
|
175
|
-
format: (result: LintResult, io: IO) => void
|
|
189
|
+
format: (result: LintResult, io: IO) => void | Promise<void>;
|
|
176
190
|
}
|
|
177
191
|
//#endregion
|
|
178
192
|
//#region src/domain/entities/siro-config.d.ts
|
|
@@ -190,6 +204,8 @@ type RuleSetting = Severity | 'off';
|
|
|
190
204
|
*/
|
|
191
205
|
interface SiroConfig {
|
|
192
206
|
readonly pms?: readonly PM[];
|
|
207
|
+
/** Exact stable target versions; does not select managers or inspect installed binaries. */
|
|
208
|
+
readonly pmVersions?: Readonly<Partial<Record<PM, string>>>;
|
|
193
209
|
readonly projectType?: ProjectType;
|
|
194
210
|
readonly rules?: Readonly<Partial<Record<BuiltinRuleId | (string & Record<never, never>), RuleSetting>>>;
|
|
195
211
|
readonly customRules?: readonly Rule[];
|
|
@@ -203,6 +219,10 @@ interface LintOptions {
|
|
|
203
219
|
readonly cwd: AbsPath;
|
|
204
220
|
readonly fs?: FileSystem;
|
|
205
221
|
readonly pm?: PM;
|
|
222
|
+
/** Exact stable version for `pm`; overrides config.pmVersions and packageManager. */
|
|
223
|
+
readonly pmVersion?: string;
|
|
224
|
+
/** Also inspect declared workspace members' publication settings. */
|
|
225
|
+
readonly workspaces?: boolean;
|
|
206
226
|
readonly projectType?: ProjectType;
|
|
207
227
|
/** Explicit configuration; the library never imports files from the target repository. */
|
|
208
228
|
readonly config?: SiroConfig;
|
|
@@ -330,5 +350,5 @@ declare class UsageError extends SiroError {
|
|
|
330
350
|
//#region src/version.d.ts
|
|
331
351
|
declare const version: string;
|
|
332
352
|
//#endregion
|
|
333
|
-
export { type AbsPath, BUILTIN_REPORTER_NAMES, type BuiltinReporterName, CONFIG_FILES, type CheckStatus, ConfigError, type ConfigFileRef, type ConfigReadValue, type ConfigValue, type FileSystem, type Finding, type IO, type KeyPath, type LintCommandOptions, type LintOptions, type LintResult, type PM, PMS, PROJECT_TYPES, type ParsedConfig, type ProjectType, type RelPath, type Remediation, type RepoContext, type Reporter, type RequireConfigKeyOptions, type Rule, type RuleBinding, type RuleContext, type RuleSetting, SEVERITIES, type SetKeyOperation, type Severity, type SiroConfig, SiroError, UsageError, type VersionNote, asAbsPath, asRelPath, defineConfig, defineRule, getByPath, githubReporter, isPM, isSeverity, jsonReporter, lint, lintCommand, loadConfig, nodeFileSystem, nodeIO, overrideBindings, prettyReporter, requireConfigKey, version };
|
|
353
|
+
export { type AbsPath, BUILTIN_REPORTER_NAMES, type BuiltinReporterName, CONFIG_FILES, type CheckStatus, ConfigError, type ConfigFileRef, type ConfigReadValue, type ConfigValue, type FileSystem, type Finding, type IO, type KeyPath, type LintCommandOptions, type LintOptions, type LintResult, type PM, PMS, PROJECT_TYPES, type ParsedConfig, type ProjectType, type RelPath, type Remediation, type RepoContext, type Reporter, type RequireConfigKeyOptions, type Rule, type RuleBinding, type RuleContext, type RuleSetting, SEVERITIES, type SetKeyOperation, type Severity, type SiroConfig, SiroError, UsageError, type VersionNote, type ViolationStatus, asAbsPath, asRelPath, defineConfig, defineRule, getByPath, githubReporter, isPM, isSeverity, jsonReporter, lint, lintCommand, loadConfig, nodeFileSystem, nodeIO, overrideBindings, prettyReporter, requireConfigKey, version };
|
|
334
354
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as ConfigError, E as nodeFileSystem, M as UsageError, O as asAbsPath, S as isSeverity, _ as PROJECT_TYPES, a as
|
|
1
|
+
import { A as ConfigError, E as nodeFileSystem, M as UsageError, O as asAbsPath, S as isSeverity, _ as PROJECT_TYPES, a as requireConfigKey, b as SEVERITIES, d as jsonReporter, f as version, g as getByPath, h as defineRule, i as overrideBindings, j as SiroError, k as asRelPath, m as loadConfig, n as lintCommand, o as CONFIG_FILES, p as githubReporter, r as lint, s as BUILTIN_REPORTER_NAMES, t as nodeIO, u as prettyReporter, x as isPM, y as PMS } from "./node-io-CaqobxYp.mjs";
|
|
2
2
|
//#region src/domain/entities/siro-config.ts
|
|
3
3
|
/** Identity helper for type-checked config files. */
|
|
4
4
|
const defineConfig = (config) => config;
|