fallow 3.2.0 → 3.3.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/capabilities.json +887 -2
- package/issue-registry.json +357 -0
- package/package.json +9 -9
- package/schema.json +132 -1
- package/scripts/platform-package.js +1 -1
- package/scripts/platform-package.test.js +3 -3
- package/scripts/run-binary.js +15 -1
- package/scripts/run-binary.test.js +17 -0
- package/skills/fallow/SKILL.md +21 -51
- package/skills/fallow/references/cli-reference.md +21 -10
- package/skills/fallow/references/mcp.md +63 -0
- package/types/output-contract.d.ts +332 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fallow",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "Codebase intelligence for TypeScript and JavaScript. Free static analysis of code and styles, optional paid runtime intelligence (Fallow Runtime). Quality, risk, architecture, dependencies, duplication, and design-system drift for humans, CI, and the agents writing your code. Zero-config framework support.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -87,13 +87,13 @@
|
|
|
87
87
|
"@tanstack/intent": "0.3.2"
|
|
88
88
|
},
|
|
89
89
|
"optionalDependencies": {
|
|
90
|
-
"@fallow-cli/darwin-arm64": "3.
|
|
91
|
-
"@fallow-cli/darwin-x64": "3.
|
|
92
|
-
"@fallow-cli/linux-x64-gnu": "3.
|
|
93
|
-
"@fallow-cli/linux-arm64-gnu": "3.
|
|
94
|
-
"@fallow-cli/linux-x64-musl": "3.
|
|
95
|
-
"@fallow-cli/linux-arm64-musl": "3.
|
|
96
|
-
"@fallow-cli/win32-arm64-msvc": "3.
|
|
97
|
-
"@fallow-cli/win32-x64-msvc": "3.
|
|
90
|
+
"@fallow-cli/darwin-arm64": "3.3.0",
|
|
91
|
+
"@fallow-cli/darwin-x64": "3.3.0",
|
|
92
|
+
"@fallow-cli/linux-x64-gnu": "3.3.0",
|
|
93
|
+
"@fallow-cli/linux-arm64-gnu": "3.3.0",
|
|
94
|
+
"@fallow-cli/linux-x64-musl": "3.3.0",
|
|
95
|
+
"@fallow-cli/linux-arm64-musl": "3.3.0",
|
|
96
|
+
"@fallow-cli/win32-arm64-msvc": "3.3.0",
|
|
97
|
+
"@fallow-cli/win32-x64-msvc": "3.3.0"
|
|
98
98
|
}
|
|
99
99
|
}
|
package/schema.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
6
6
|
"$schema": {
|
|
7
|
+
"description": "A string pointing at fallow's JSON Schema URL, used only by editors for autocomplete and validation of the config file; it has no effect on analysis and is stripped before serialization (serde skip_serializing, writeOnly in the schema). Set it to `https://fallow.dev/schema.json` to get editor IntelliSense; any other value is ignored by fallow.",
|
|
7
8
|
"type": [
|
|
8
9
|
"string",
|
|
9
10
|
"null"
|
|
@@ -11,6 +12,7 @@
|
|
|
11
12
|
"writeOnly": true
|
|
12
13
|
},
|
|
13
14
|
"extends": {
|
|
15
|
+
"description": "An ordered array of parent config sources to inherit before this file's own keys apply; each entry is a file-relative path, an `npm:<package>` specifier, or an `https://` URL (`http://` is rejected), deep-merged in order so objects merge field-by-field while arrays and scalars in this file replace the parent's, with cycle and depth guards. Set it to share a base config across a monorepo or team; it is consumed at load and stripped before serialization (serde skip_serializing).",
|
|
14
16
|
"type": "array",
|
|
15
17
|
"items": {
|
|
16
18
|
"type": "string"
|
|
@@ -18,6 +20,7 @@
|
|
|
18
20
|
"writeOnly": true
|
|
19
21
|
},
|
|
20
22
|
"entry": {
|
|
23
|
+
"description": "An array of project-root-relative glob patterns whose matching files are seeded as manual entry points, on top of the framework and package.json entries fallow discovers automatically, so their transitive imports are not reported as unused. Set it (e.g. `[\"src/main.ts\"]`) when a file is a real runtime root that no plugin or manifest declares; patterns are validated at load and matched against discovered files.",
|
|
21
24
|
"type": "array",
|
|
22
25
|
"items": {
|
|
23
26
|
"type": "string"
|
|
@@ -25,6 +28,7 @@
|
|
|
25
28
|
"default": []
|
|
26
29
|
},
|
|
27
30
|
"ignorePatterns": {
|
|
31
|
+
"description": "An array of project-root-relative glob patterns for files to exclude from analysis entirely; entries are unioned with fallow's built-in defaults (**/node_modules/**, **/dist/**, build/**, **/.git/**, **/coverage/**, **/*.min.js, **/*.min.mjs, **/*.min.cjs, **/*.bundle.js), so custom globs add to rather than replace them. Set it (e.g. `[\"generated/**\"]`) to drop generated or vendored trees from every detector; patterns are validated at load.",
|
|
28
32
|
"type": "array",
|
|
29
33
|
"items": {
|
|
30
34
|
"type": "string"
|
|
@@ -32,6 +36,7 @@
|
|
|
32
36
|
"default": []
|
|
33
37
|
},
|
|
34
38
|
"framework": {
|
|
39
|
+
"description": "Declares inline external framework plugins as data (array of plugin objects), each with `name` plus optional `enablers` (package names that activate it) or richer `detection` (dependency/file-existence/`all`/`any` checks, taking priority over `enablers`), `entryPoints` (+ `entryPointRole` runtime/support/test), `configPatterns`, `alwaysUsed`, `toolingDependencies`, `usedExports` (`{ pattern, exports }`), and `usedClassMembers`. Set it to keep a custom or in-house framework's entry points, config files, and conventions reachable without a Rust plugin; these definitions are appended to plugins discovered via `plugins`, `.fallow/plugins/`, and root `fallow-plugin-*` files (first occurrence of a name wins), and cannot do AST-based config parsing.",
|
|
35
40
|
"type": "array",
|
|
36
41
|
"items": {
|
|
37
42
|
"$ref": "#/$defs/ExternalPluginDef"
|
|
@@ -39,6 +44,7 @@
|
|
|
39
44
|
"default": []
|
|
40
45
|
},
|
|
41
46
|
"workspaces": {
|
|
47
|
+
"description": "Monorepo workspace configuration whose sole sub-key patterns (array of globs) adds workspace package roots beyond those discovered from package.json workspaces, pnpm-workspace.yaml, and tsconfig references. Optional and absent by default (discovery uses the manifests alone); set it only when workspaces live in directories the standard manifests do not declare.",
|
|
42
48
|
"anyOf": [
|
|
43
49
|
{
|
|
44
50
|
"$ref": "#/$defs/WorkspaceConfig"
|
|
@@ -50,6 +56,7 @@
|
|
|
50
56
|
"default": null
|
|
51
57
|
},
|
|
52
58
|
"ignoreDependencies": {
|
|
59
|
+
"description": "A list of exact package names excluded from BOTH unused-dependency and unlisted-dependency detection, so a runtime-provided or otherwise-untracked package (e.g. `bun:sqlite`, a peer supplied at deploy time) is never flagged as unused when declared nor as unlisted when imported. Set it for packages fallow cannot observe being used and cannot observe being declared; matching is exact string equality against the package name, not a glob.",
|
|
53
60
|
"type": "array",
|
|
54
61
|
"items": {
|
|
55
62
|
"type": "string"
|
|
@@ -57,6 +64,7 @@
|
|
|
57
64
|
"default": []
|
|
58
65
|
},
|
|
59
66
|
"ignoreUnresolvedImports": {
|
|
67
|
+
"description": "A list of glob patterns that suppress only `unresolved-import` findings whose raw import specifier matches; it does not change dependency usage accounting or resolver behavior. Patterns match the import string as written (not a filesystem path), so list both `@example/icons` and `@example/icons/**` to cover a bare package and its subpaths; parent-relative generated specifiers like `../generated/**` are valid, and broad values like `**` can hide real missing modules.",
|
|
60
68
|
"type": "array",
|
|
61
69
|
"items": {
|
|
62
70
|
"type": "string"
|
|
@@ -64,6 +72,7 @@
|
|
|
64
72
|
"default": []
|
|
65
73
|
},
|
|
66
74
|
"ignoreExports": {
|
|
75
|
+
"description": "A list of per-file rules that exempt named exports from `unused-export` and from duplicate-exports grouping for files matching a glob. Each entry is `{ file: <glob>, exports: [<name>, ...] }` where `exports: [\"*\"]` exempts every export in the file and a name list exempts only those names; built for component-library barrels (shadcn/Radix/bits-ui `index.ts`) that intentionally re-export the same short names across many files.",
|
|
67
76
|
"type": "array",
|
|
68
77
|
"items": {
|
|
69
78
|
"$ref": "#/$defs/IgnoreExportRule"
|
|
@@ -71,28 +80,33 @@
|
|
|
71
80
|
"default": []
|
|
72
81
|
},
|
|
73
82
|
"ignoreCatalogReferences": {
|
|
83
|
+
"description": "A list of rules that suppress `unresolved-catalog-reference` findings (a workspace `package.json` referencing a `catalog:` or `catalog:<name>` that the catalog does not declare); config-only because `package.json` has no inline-suppression comment surface. Each entry needs a `package` (exact match) plus optional `catalog` (exact catalog-name match) and `consumer` (glob on the consuming package.json path); use it for staged catalog migrations where the catalog edit lands in a separate change.",
|
|
74
84
|
"type": "array",
|
|
75
85
|
"items": {
|
|
76
86
|
"$ref": "#/$defs/IgnoreCatalogReferenceRule"
|
|
77
87
|
}
|
|
78
88
|
},
|
|
79
89
|
"ignoreDependencyOverrides": {
|
|
90
|
+
"description": "A list of rules that suppress `unused-dependency-override` and `misconfigured-dependency-override` findings for pnpm `overrides` entries; config-only, matched against the override's target package. Each entry needs a `package` (exact match) plus an optional `source` to scope the suppression to `\"pnpm-workspace.yaml\"` or `\"package.json\"`.",
|
|
80
91
|
"type": "array",
|
|
81
92
|
"items": {
|
|
82
93
|
"$ref": "#/$defs/IgnoreDependencyOverrideRule"
|
|
83
94
|
}
|
|
84
95
|
},
|
|
85
96
|
"ignoreExportsUsedInFile": {
|
|
97
|
+
"description": "Controls whether an export referenced only by another symbol in the same file is treated as used (suppressed from `unused-export`) until it becomes completely unreferenced; references inside an export specifier itself (`export { foo }`, `export default foo`) do not count as same-file uses. Accepts `true`/`false` (default `false`, suppress nothing) or the knip-parity object `{ \"type\": true, \"interface\": true }`, which restricts the suppression to type-only exports; fallow groups type aliases and interfaces under one kind, so both object fields behave identically.",
|
|
86
98
|
"$ref": "#/$defs/IgnoreExportsUsedInFileConfig",
|
|
87
99
|
"default": false
|
|
88
100
|
},
|
|
89
101
|
"ignoreDecorators": {
|
|
102
|
+
"description": "A list of decorator names that no longer grant a class member automatic exemption from `unused-class-member`: a member whose every decorator is in this set is checked normally, while a member carrying any decorator NOT listed here stays skipped (frameworks consume decorated members reflectively). Dotted entries match the full decorator path (`ns.foo`) and bare entries match the leftmost segment (so `\"decorators\"` collapses every `@decorators.*`); both `\"@step\"` and `\"step\"` are accepted (leading `@` stripped), and an unmatched entry emits a one-time warning.",
|
|
90
103
|
"type": "array",
|
|
91
104
|
"items": {
|
|
92
105
|
"type": "string"
|
|
93
106
|
}
|
|
94
107
|
},
|
|
95
108
|
"usedClassMembers": {
|
|
109
|
+
"description": "A list of class-member names or glob patterns treated as framework-used, so a method a library invokes reflectively (ag-Grid `agInit`/`refresh`, Web Component `connectedCallback`) is not reported as `unused-class-member`; it applies to class members only, not enum members. Each entry is either a plain string/glob (`\"agInit\"`, `\"enter*\"`, `\"*\"`) applied to every class, or a scoped object `{ extends?, implements?, members: [...] }` that applies only when the class matches that heritage clause (a scoped rule requires `extends` or `implements`); patterns matching zero members warn once.",
|
|
96
110
|
"type": "array",
|
|
97
111
|
"items": {
|
|
98
112
|
"$ref": "#/$defs/UsedClassMemberRule"
|
|
@@ -100,6 +114,7 @@
|
|
|
100
114
|
"default": []
|
|
101
115
|
},
|
|
102
116
|
"duplicates": {
|
|
117
|
+
"description": "Configures clone detection: `enabled` (default true), `mode` (`strict`, `mild` default, `weak`, `semantic`, from least to most identifier/literal blinding; `strict` and `mild` are equivalent under fallow's AST tokenizer, `weak` blinds string literals, `semantic` blinds all identifiers and literals for Type-2 renamed-variable detection), `minTokens` (50), `minLines` (5), `minOccurrences` (integer >= 2, deserialization fails below 2), `threshold` (max duplication percentage, 0 = no limit), `ignore` globs, `ignoreDefaults` (true, merge built-in generated-file ignores), `skipLocal` (only report cross-directory clones), `crossLanguage` (strip TS type annotations to match .ts against .js), `ignoreImports` (true, strip ES import/re-export/top-level require wiring from the token stream), and `normalization` (per-flag `ignoreIdentifiers`/`ignoreStringValues`/`ignoreNumericValues` overrides on top of `mode`). Raise `minOccurrences` to focus on widespread copy-paste, or set `mode` to `semantic` to catch renamed-variable clones.",
|
|
103
118
|
"$ref": "#/$defs/DuplicatesConfig",
|
|
104
119
|
"default": {
|
|
105
120
|
"enabled": true,
|
|
@@ -119,6 +134,7 @@
|
|
|
119
134
|
}
|
|
120
135
|
},
|
|
121
136
|
"health": {
|
|
137
|
+
"description": "Sets complexity and health thresholds for `fallow health` (also applied in combined `fallow` and `fallow audit`): `maxCyclomatic` (20), `maxCognitive` (15), `maxCrap` (30.0, findings at or above this are reported), `crapRefactorBand` (5, cyclomatic band below `maxCyclomatic` where a secondary refactor action is added), `maxUnitSize` (max function lines before a large-function finding, 60), `coverage`/`coverageRoot` (Istanbul coverage path and path-prefix strip for accurate CRAP), `ignore` globs (remove files from findings AND the health score), `thresholdOverrides` (per-file/per-function ceilings via `files`/`functions`/`maxCyclomatic`/`maxCognitive`/`maxCrap`/`maxUnitSize`/`reason`), `ownership` (`botPatterns` and `emailMode` for `--ownership`), and `suggestInlineSuppression` (true, emit `suppress-line` action hints in JSON). Raise thresholds to relax which functions are flagged, wire `coverage` for real CRAP scores, or exempt generated/test files via `ignore` (drops them from the score too) or `thresholdOverrides` (keeps them visible under a higher ceiling).",
|
|
122
138
|
"$ref": "#/$defs/HealthConfig",
|
|
123
139
|
"default": {
|
|
124
140
|
"maxCyclomatic": 20,
|
|
@@ -144,6 +160,7 @@
|
|
|
144
160
|
}
|
|
145
161
|
},
|
|
146
162
|
"rules": {
|
|
163
|
+
"description": "Sets per-issue-type severity, keyed by kebab-case rule id: `error` reports and fails CI (non-zero exit), `warn` reports without failing, `off` disables detection and reporting entirely (e.g. `{ \"unused-files\": \"error\", \"unused-exports\": \"warn\", \"private-type-leaks\": \"off\" }`). Set a rule `off` to silence it, `warn` to demote below CI gating, or `error` to promote a warn/off-default rule to gating; most rules default to `error`, dev/optional-dependency and component/store/inject/CSS/catalog rules default to `warn`, and opt-in rules (`private-type-leaks`, `security-*`, `prop-drilling`, `thin-wrapper`, `duplicate-prop-shape`, `coverage-gaps`, `feature-flags`, `require-suppression-reason`) default to `off`. Singular aliases (`unused-file`) and `warning`/`none` severity spellings are accepted.",
|
|
147
164
|
"$ref": "#/$defs/RulesConfig",
|
|
148
165
|
"default": {
|
|
149
166
|
"unused-files": "error",
|
|
@@ -202,9 +219,11 @@
|
|
|
202
219
|
}
|
|
203
220
|
},
|
|
204
221
|
"unusedComponentProps": {
|
|
222
|
+
"description": "Options for the `unused-component-props` rule, currently only `ignorePattern`: a regex matched against each declared prop's local destructure binding name (falling back to the public prop name when unaliased) to exempt intentionally-unused props such as the leading-underscore convention. Set `{ \"ignorePattern\": \"^_\" }` to skip props like `_stage`; matching is unanchored (substring, like ESLint's `RegExp.test`) so anchor with `^`, the pattern is validated at config load (invalid regex fails load), and it applies to Vue, Svelte, Astro, and React/Preact props (unset leaves the rule unchanged).",
|
|
205
223
|
"$ref": "#/$defs/UnusedComponentPropsConfig"
|
|
206
224
|
},
|
|
207
225
|
"boundaries": {
|
|
226
|
+
"description": "Configures architecture boundary enforcement: which source directories belong to which named zone and which zones may import which others, reported as boundary-violation, boundary-coverage-violation, and boundary-call-violation findings (severity via rules.boundary-violation, default error). Set to enforce a layered/module architecture; the object holds `preset` (one of layered, hexagonal, feature-sliced, bulletproof, whose default zones/rules are merged in with the user-declared zones/rules taking precedence), `zones` (each with `name`, `patterns`, `autoDiscover`, optional `root`), `rules` (each with `from`, `allow`, `allowTypeOnly` target-zone lists), `coverage` (`requireAllFiles` plus `allowUnmatched` globs for files matching no zone), and `calls` (a `forbidden` list of `{from, callee}` banned-call rules per zone).",
|
|
208
227
|
"$ref": "#/$defs/BoundaryConfig",
|
|
209
228
|
"default": {
|
|
210
229
|
"zones": [],
|
|
@@ -212,16 +231,19 @@
|
|
|
212
231
|
}
|
|
213
232
|
},
|
|
214
233
|
"flags": {
|
|
234
|
+
"description": "Configures feature-flag detection: `sdkPatterns` (custom flag-evaluating call signatures, each `{ function, nameArg (zero-based arg index of the flag name, default 0), provider? }`, merged with built-ins for LaunchDarkly, Statsig, Unleash, GrowthBook, Split, PostHog, Vercel Flags, ConfigCat, Flagsmith, Optimizely, and Eppo), `envPrefixes` (env-var prefixes marking `process.env.*` accesses as flags, merged with built-ins), and `configObjectHeuristics` (default false; when true, property accesses on objects whose name contains `feature`/`flag`/`toggle` are reported as low-confidence flags). Set `sdkPatterns`/`envPrefixes` to teach fallow a proprietary flag SDK or naming convention, or enable `configObjectHeuristics` for projects that read flags off config objects (higher false-positive rate). Feature-flag findings surface only when the `feature-flags` rule is enabled (default `off`).",
|
|
215
235
|
"$ref": "#/$defs/FlagsConfig",
|
|
216
236
|
"default": {
|
|
217
237
|
"configObjectHeuristics": false
|
|
218
238
|
}
|
|
219
239
|
},
|
|
220
240
|
"security": {
|
|
241
|
+
"description": "Scopes the opt-in `fallow security` catalogue: which candidate categories run and which extra local identifiers count as HTTP request objects. Set when tuning security-candidate detection; the object holds `categories` (an object with `include` and/or `exclude` string arrays of catalogue category ids, where `include` restricts to a whitelist and `exclude` removes from the admitted set, both unset admits all ordinary categories) and `requestReceivers` (a string array of project-local names that extend, not replace, the built-in `*.query`/`*.params`/`*.body` source-receiver allowlist). The `hardcoded-secret` and `secret-to-network` categories are include-required: they fire only when explicitly listed in `categories.include`, even when no include list is otherwise set. The valid category ids are enumerated (with title, CWE, and include-required flag) in the `security_categories` block of `fallow schema`, and also listed by `fallow security --help`; they are not in this config-schema.",
|
|
221
242
|
"$ref": "#/$defs/SecurityConfig",
|
|
222
243
|
"default": {}
|
|
223
244
|
},
|
|
224
245
|
"fix": {
|
|
246
|
+
"description": "Configures `fallow fix` behavior. Currently holds one nested section, `catalog` (a `CatalogFixConfig`), whose only key `deletePrecedingComments` (`auto` default, `always`, `never`) governs whether comment lines directly above a removed unused `pnpm-workspace.yaml` catalog entry are deleted with it.",
|
|
225
247
|
"$ref": "#/$defs/FixConfig",
|
|
226
248
|
"default": {
|
|
227
249
|
"catalog": {
|
|
@@ -230,14 +252,17 @@
|
|
|
230
252
|
}
|
|
231
253
|
},
|
|
232
254
|
"resolve": {
|
|
255
|
+
"description": "Configures the module resolver. Its one key `conditions` is a list of additional package.json `exports`/`imports` condition names to honor, matched at higher priority than fallow's built-ins (`development`, `import`, `require`, `default`, `types`, `node`, plus `react-native`/`browser` when the React Native or Expo plugin is active). Set it when a package's `exports` map has custom branches (e.g. `worker`, `deno`, `edge`) that fallow should follow instead of the default branch.",
|
|
233
256
|
"$ref": "#/$defs/ResolveConfig",
|
|
234
257
|
"default": {}
|
|
235
258
|
},
|
|
236
259
|
"production": {
|
|
260
|
+
"description": "Enables production mode, which excludes test/spec/story/dev files from discovery and forces `unused-dev-dependencies` and `unused-optional-dependencies` to `off`. Accepts a boolean (default false) applied to all analyses, or a per-analysis object `{ deadCode?, health?, dupes? }` (each boolean, default false) that scopes production mode to individual analyses in combined `fallow` and `fallow audit`. Set it to analyze only shipped code; the `--production`/`--no-production` and `--production-{dead-code,health,dupes}` CLI flags and `FALLOW_PRODUCTION*` env vars override this value (CLI flags win, then per-analysis env, then global env, then config).",
|
|
237
261
|
"$ref": "#/$defs/ProductionConfig",
|
|
238
262
|
"default": false
|
|
239
263
|
},
|
|
240
264
|
"plugins": {
|
|
265
|
+
"description": "List of paths (relative to the project root, must resolve within it) to external plugin definition files or directories in JSONC/JSON/TOML, loaded in addition to the auto-discovered `.fallow/plugins/` directory and root `fallow-plugin-*` files. Set it to load plugin definitions kept outside those default locations; a path resolving outside the project root is skipped with a `tracing::warn`, and paths listed here are searched before the auto-discovered locations (first occurrence of a plugin name wins).",
|
|
241
266
|
"type": "array",
|
|
242
267
|
"items": {
|
|
243
268
|
"type": "string"
|
|
@@ -252,6 +277,7 @@
|
|
|
252
277
|
}
|
|
253
278
|
},
|
|
254
279
|
"dynamicallyLoaded": {
|
|
280
|
+
"description": "An array of project-root-relative glob patterns for files loaded at runtime by a mechanism the static graph cannot see (dynamic path resolution, config-driven loading); matching files are seeded as entry points so they and their imports stay reachable. Empty by default; set it (e.g. `[\"plugins/**/*.ts\", \"locales/**/*.json\"]`) for plugin or locale trees pulled in dynamically.",
|
|
255
281
|
"type": "array",
|
|
256
282
|
"items": {
|
|
257
283
|
"type": "string"
|
|
@@ -259,6 +285,7 @@
|
|
|
259
285
|
"default": []
|
|
260
286
|
},
|
|
261
287
|
"overrides": {
|
|
288
|
+
"description": "An ordered list of per-file rule-severity overrides: each entry re-severities specific analysis rules for files its globs match, layered on top of the top-level `rules` defaults. Set to relax or tighten rules for a subset of paths (e.g. downgrade unused-exports to warn under a generated directory); each entry has `files` (glob-pattern array) and `rules` (a partial per-rule severity map of error/warn/off). Entries apply in list order and a file matched by several entries takes every matching entry's overrides (later entries win on conflict); inter-file rules (duplicate-exports, circular-dependencies, re-export-cycle) have no effect in an override (fallow warns during analysis and points to the right mechanism: top-level `ignoreExports` for duplicate-exports, a file-level `// fallow-ignore-file` comment for the others).",
|
|
262
289
|
"type": "array",
|
|
263
290
|
"items": {
|
|
264
291
|
"$ref": "#/$defs/ConfigOverride"
|
|
@@ -266,12 +293,14 @@
|
|
|
266
293
|
"default": []
|
|
267
294
|
},
|
|
268
295
|
"codeowners": {
|
|
296
|
+
"description": "A project-root-relative path to a CODEOWNERS file, used by fallow health --hotspots --ownership to attribute declared owners and compute unowned/drifting ownership state; setting it overrides the default probe order (CODEOWNERS, .github/CODEOWNERS, .gitlab/CODEOWNERS, docs/CODEOWNERS). String, defaults to null (auto-probe the standard locations); set it only when the CODEOWNERS file lives at a non-standard location.",
|
|
269
297
|
"type": [
|
|
270
298
|
"string",
|
|
271
299
|
"null"
|
|
272
300
|
]
|
|
273
301
|
},
|
|
274
302
|
"publicPackages": {
|
|
303
|
+
"description": "An array of internal workspace package names (or globs matched against workspace package names) whose public API is intentionally consumed outside the analyzed graph; their entry points and re-export surface become reachability roots, so their exported files, exports, and class members are not reported as unused. Set it (e.g. `[\"@myorg/shared-lib\", \"@myorg/*\"]`) for library packages in a monorepo that ship an API to external consumers; only meaningful when workspaces are present (an empty list or no workspaces is a no-op).",
|
|
275
304
|
"type": "array",
|
|
276
305
|
"items": {
|
|
277
306
|
"type": "string"
|
|
@@ -279,6 +308,7 @@
|
|
|
279
308
|
"default": []
|
|
280
309
|
},
|
|
281
310
|
"regression": {
|
|
311
|
+
"description": "Holds a saved issue-count baseline that the `--fail-on-regression` gate compares the current run against, failing only when counts grow beyond tolerance relative to the baseline. Usually written by `--save-baseline` rather than hand-authored; the object has a single `baseline` sub-key holding per-issue-type counts (total_issues plus per-kind fields like unused_exports, boundary_violations, policy_violations, each defaulting to 0). Absent means no baseline is embedded in config.",
|
|
282
312
|
"anyOf": [
|
|
283
313
|
{
|
|
284
314
|
"$ref": "#/$defs/RegressionConfig"
|
|
@@ -289,21 +319,26 @@
|
|
|
289
319
|
]
|
|
290
320
|
},
|
|
291
321
|
"audit": {
|
|
322
|
+
"description": "Sets in-repo defaults for `fallow audit` (the changed-files quality gate) so CLI flags need not repeat per run. Set to pin audit behavior; the object holds `gate` (`new-only` or `all`, which findings drive the verdict), `css`/`cssDeep` (booleans toggling styling analysis and the project-wide CSS reachability pass), `deadCodeBaseline`/`healthBaseline`/`dupesBaseline` (per-sub-analysis baseline file paths), and `cacheMaxAgeDays` (GC window in days for the reusable base-snapshot worktree cache). The matching CLI flag overrides each field.",
|
|
292
323
|
"$ref": "#/$defs/AuditConfig"
|
|
293
324
|
},
|
|
294
325
|
"sealed": {
|
|
326
|
+
"description": "When true, restricts this config's extends entries to file-relative paths that resolve inside the config file's own directory; any https:// URL, npm: package, or relative path escaping that directory is rejected at load with a hard error. Boolean, defaults to false (URL, npm, and any-relative extends are permitted); set it to true to harden a config against pulling in remote or out-of-tree bases.",
|
|
295
327
|
"type": "boolean",
|
|
296
328
|
"default": false
|
|
297
329
|
},
|
|
298
330
|
"includeEntryExports": {
|
|
331
|
+
"description": "When true, exports of entry-point files are subject to unused-export detection instead of being auto-credited as used, so a typo'd or stray export in a framework route or package entry (e.g. meatdata for metadata) is flagged; plugin used_exports allowlists are still honored. Boolean, defaults to false; the CLI flag --include-entry-exports applies the same behavior for one run.",
|
|
299
332
|
"type": "boolean",
|
|
300
333
|
"default": false
|
|
301
334
|
},
|
|
302
335
|
"autoImports": {
|
|
336
|
+
"description": "When true, drops Nuxt convention-based entry-pattern fallbacks: component fallbacks are dropped unless nuxt.config declares components:, and composable/util fallbacks are dropped unless it declares imports:, so genuinely-unreferenced convention files surface as unused-file. Boolean, defaults to false; set it for a Nuxt project that has explicitly configured its auto-import directories. Synthesis of auto-import graph edges (resolving `<Card />` or `useUserStore()` to their convention files) happens regardless of this flag.",
|
|
303
337
|
"type": "boolean",
|
|
304
338
|
"default": false
|
|
305
339
|
},
|
|
306
340
|
"cache": {
|
|
341
|
+
"description": "Overrides the location and size ceiling of fallow's persistent extraction cache (default `.fallow/cache.bin` under the project root). Set to relocate the cache or cap its footprint; the object holds `dir` (cache directory, relative paths resolve from the project root) and `maxSizeMb` (extraction-cache size limit in megabytes). The `FALLOW_CACHE_MAX_SIZE` environment variable overrides `maxSizeMb`.",
|
|
307
342
|
"$ref": "#/$defs/CacheConfig"
|
|
308
343
|
}
|
|
309
344
|
},
|
|
@@ -350,6 +385,14 @@
|
|
|
350
385
|
"$ref": "#/$defs/EntryPointRole",
|
|
351
386
|
"default": "support"
|
|
352
387
|
},
|
|
388
|
+
"manifestEntries": {
|
|
389
|
+
"description": "Entry points DERIVED from framework manifest files.\n\nUnlike `entryPoints` (static globs), each rule finds manifest files by a\nrecursive glob, parses them, and seeds sibling entries resolved relative\nto each manifest's directory, gated on the manifest's own fields. Seeded\nentries use this plugin's `entryPointRole`.",
|
|
390
|
+
"type": "array",
|
|
391
|
+
"items": {
|
|
392
|
+
"$ref": "#/$defs/ManifestEntryRule"
|
|
393
|
+
},
|
|
394
|
+
"default": []
|
|
395
|
+
},
|
|
353
396
|
"configPatterns": {
|
|
354
397
|
"description": "Glob patterns for config files (marked as always-used when active).",
|
|
355
398
|
"type": "array",
|
|
@@ -494,6 +537,72 @@
|
|
|
494
537
|
}
|
|
495
538
|
]
|
|
496
539
|
},
|
|
540
|
+
"ManifestEntryRule": {
|
|
541
|
+
"description": "A rule that seeds entry points DERIVED from framework manifest files.\n\nFor every file matching `manifests` (a recursive glob) that passes the\nmanifest-level `when` gate, each rule in `entries` is resolved relative to\nthe manifest's directory (with `${dotted.field}` interpolation) into an entry\npoint. Seeded entries use the owning plugin's `entryPointRole`.\n\n```jsonc\n{\n \"manifests\": \"**/kibana.jsonc\",\n \"when\": { \"type\": \"plugin\" },\n \"entries\": [\n { \"path\": \"public/index.{ts,tsx}\", \"when\": { \"plugin.browser\": true } },\n { \"path\": \"server/index.{ts,tsx}\", \"when\": { \"plugin.server\": true } },\n { \"path\": \"${plugin.extraPublicDirs}/index.{ts,tsx}\" }\n ]\n}\n```",
|
|
542
|
+
"type": "object",
|
|
543
|
+
"properties": {
|
|
544
|
+
"manifests": {
|
|
545
|
+
"description": "Recursive glob selecting the manifest files to read (e.g. `**/kibana.jsonc`).",
|
|
546
|
+
"type": "string"
|
|
547
|
+
},
|
|
548
|
+
"format": {
|
|
549
|
+
"description": "Manifest format. Defaults to `jsonc` (which also parses plain JSON).",
|
|
550
|
+
"$ref": "#/$defs/ManifestFormat",
|
|
551
|
+
"default": "jsonc"
|
|
552
|
+
},
|
|
553
|
+
"when": {
|
|
554
|
+
"description": "Manifest-level gate: a map of dotted field path to an expected scalar\nvalue. ALL entries must match by STRICT EQUALITY for the manifest to be\nprocessed. An empty map matches every manifest.",
|
|
555
|
+
"type": "object",
|
|
556
|
+
"additionalProperties": true,
|
|
557
|
+
"default": {}
|
|
558
|
+
},
|
|
559
|
+
"entries": {
|
|
560
|
+
"description": "Entry rules seeded per matching manifest.",
|
|
561
|
+
"type": "array",
|
|
562
|
+
"items": {
|
|
563
|
+
"$ref": "#/$defs/ManifestSeedRule"
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
},
|
|
567
|
+
"required": [
|
|
568
|
+
"manifests",
|
|
569
|
+
"entries"
|
|
570
|
+
]
|
|
571
|
+
},
|
|
572
|
+
"ManifestFormat": {
|
|
573
|
+
"description": "Format of the manifest files a [`ManifestEntryRule`] reads.\n\n`jsonc` (the default) also parses plain JSON, so it is the tolerant choice.",
|
|
574
|
+
"oneOf": [
|
|
575
|
+
{
|
|
576
|
+
"description": "JSONC (comments + trailing commas). Also accepts plain JSON.",
|
|
577
|
+
"type": "string",
|
|
578
|
+
"const": "jsonc"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"description": "Strict JSON.",
|
|
582
|
+
"type": "string",
|
|
583
|
+
"const": "json"
|
|
584
|
+
}
|
|
585
|
+
]
|
|
586
|
+
},
|
|
587
|
+
"ManifestSeedRule": {
|
|
588
|
+
"description": "A single entry seeded by a [`ManifestEntryRule`], resolved relative to the\nmanifest's directory.",
|
|
589
|
+
"type": "object",
|
|
590
|
+
"properties": {
|
|
591
|
+
"path": {
|
|
592
|
+
"description": "Entry glob relative to the manifest directory. May contain\n`${dotted.field}` interpolation that fans out over string / array\nmanifest field values (a missing or empty field seeds nothing). The glob\nmust encode its own extension (e.g. `public/index.{ts,tsx}`); glob entry\npatterns are matched literally against discovered files without\nsource-extension probing.",
|
|
593
|
+
"type": "string"
|
|
594
|
+
},
|
|
595
|
+
"when": {
|
|
596
|
+
"description": "Per-entry gate (strict equality), evaluated against the same manifest.\nAn empty map always passes.",
|
|
597
|
+
"type": "object",
|
|
598
|
+
"additionalProperties": true,
|
|
599
|
+
"default": {}
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
"required": [
|
|
603
|
+
"path"
|
|
604
|
+
]
|
|
605
|
+
},
|
|
497
606
|
"ExternalUsedExport": {
|
|
498
607
|
"description": "Exports considered used for files matching a pattern.",
|
|
499
608
|
"type": "object",
|
|
@@ -564,7 +673,7 @@
|
|
|
564
673
|
"type": "object",
|
|
565
674
|
"properties": {
|
|
566
675
|
"patterns": {
|
|
567
|
-
"description": "Additional workspace patterns (beyond what's in root package.json).",
|
|
676
|
+
"description": "Additional workspace patterns (beyond what's in root package.json).\n\n`packages` is accepted as a back-compat alias: an older `fallow init --toml`\nwrote `[workspaces]` with a `packages` key, and reading it as `patterns`\nkeeps those existing configs scoping correctly. schemars omits serde\naliases, so `schema.json` documents only `patterns`.",
|
|
568
677
|
"type": "array",
|
|
569
678
|
"items": {
|
|
570
679
|
"type": "string"
|
|
@@ -599,15 +708,18 @@
|
|
|
599
708
|
"type": "object",
|
|
600
709
|
"properties": {
|
|
601
710
|
"package": {
|
|
711
|
+
"description": "Required exact package name whose `unresolved-catalog-reference` finding this rule suppresses; compared by string equality against the referenced package, so one rule targets one package's catalog reference (further narrowed by the optional `catalog` and `consumer` filters, all of which must match).",
|
|
602
712
|
"type": "string"
|
|
603
713
|
},
|
|
604
714
|
"catalog": {
|
|
715
|
+
"description": "Optional catalog-name filter: when set, the rule suppresses only references to this exact catalog name (string equality), and when omitted it applies regardless of which catalog is referenced. Use it to scope suppression to one catalog (e.g. `\"react18\"`) while leaving other catalog references for the same package reportable.",
|
|
605
716
|
"type": [
|
|
606
717
|
"string",
|
|
607
718
|
"null"
|
|
608
719
|
]
|
|
609
720
|
},
|
|
610
721
|
"consumer": {
|
|
722
|
+
"description": "Optional glob matched against the consuming workspace `package.json` path (compiled into a glob matcher at config load): when set, the rule suppresses the finding only for consumers whose path matches, and when omitted it applies to every consumer. Use it to suppress a catalog reference in one specific workspace during a staged migration.",
|
|
611
723
|
"type": [
|
|
612
724
|
"string",
|
|
613
725
|
"null"
|
|
@@ -624,9 +736,11 @@
|
|
|
624
736
|
"type": "object",
|
|
625
737
|
"properties": {
|
|
626
738
|
"package": {
|
|
739
|
+
"description": "Required exact package name whose `unused-dependency-override` or `misconfigured-dependency-override` finding this rule suppresses; compared by string equality against the override's target package, so one rule targets one override entry (further narrowable with the optional `source` filter).",
|
|
627
740
|
"type": "string"
|
|
628
741
|
},
|
|
629
742
|
"source": {
|
|
743
|
+
"description": "Optional source filter matched by exact string equality against the override's declaring-file label: set it to `\"pnpm-workspace.yaml\"` or `\"package.json\"` to scope the suppression to overrides declared in that file, or omit it to suppress the package's override regardless of where it is declared.",
|
|
630
744
|
"type": [
|
|
631
745
|
"string",
|
|
632
746
|
"null"
|
|
@@ -652,10 +766,12 @@
|
|
|
652
766
|
"type": "object",
|
|
653
767
|
"properties": {
|
|
654
768
|
"type": {
|
|
769
|
+
"description": "When `true`, enables the same-file-use suppression for type-only exports (serialized as `type`; part of the object form of `ignoreExportsUsedInFile`). Because fallow groups type aliases and interfaces under one issue kind, setting either `type` or `interface` enables the identical type-only suppression, applied only to exports fallow classifies as type-only.",
|
|
655
770
|
"type": "boolean",
|
|
656
771
|
"default": false
|
|
657
772
|
},
|
|
658
773
|
"interface": {
|
|
774
|
+
"description": "When `true`, enables the same-file-use suppression for type-only exports (part of the object form of `ignoreExportsUsedInFile`). Fallow does not distinguish interfaces from type aliases in this issue kind, so `interface` behaves identically to `type`: setting either one turns on the type-only same-file suppression.",
|
|
659
775
|
"type": "boolean",
|
|
660
776
|
"default": false
|
|
661
777
|
}
|
|
@@ -1596,6 +1712,7 @@
|
|
|
1596
1712
|
"type": "object",
|
|
1597
1713
|
"properties": {
|
|
1598
1714
|
"catalog": {
|
|
1715
|
+
"description": "Groups `fallow fix` settings for pnpm workspace catalog cleanup. Its only key, `deletePrecedingComments` (`auto` default, `always`, `never`), controls whether a comment block directly above a removed unused `pnpm-workspace.yaml` catalog entry is deleted with the entry.",
|
|
1599
1716
|
"$ref": "#/$defs/CatalogFixConfig",
|
|
1600
1717
|
"default": {
|
|
1601
1718
|
"deletePrecedingComments": "auto"
|
|
@@ -1607,6 +1724,7 @@
|
|
|
1607
1724
|
"type": "object",
|
|
1608
1725
|
"properties": {
|
|
1609
1726
|
"deletePrecedingComments": {
|
|
1727
|
+
"description": "Controls whether comment lines immediately above an unused `pnpm-workspace.yaml` catalog entry are removed when `fallow fix` deletes that entry: `auto` (default: delete only when the comment block is preceded by a blank line or sits directly under the parent catalog header, and never when it is a section banner like `# ====`), `always` (always remove the adjacent comment block), or `never` (leave all preceding comments). A `fallow-keep` marker anywhere in the block always preserves it regardless of this setting. Set `never` for teams that keep hand-authored notes above catalog pins.",
|
|
1610
1728
|
"$ref": "#/$defs/CatalogPrecedingCommentPolicy",
|
|
1611
1729
|
"default": "auto"
|
|
1612
1730
|
}
|
|
@@ -1647,14 +1765,17 @@
|
|
|
1647
1765
|
"type": "object",
|
|
1648
1766
|
"properties": {
|
|
1649
1767
|
"deadCode": {
|
|
1768
|
+
"description": "When `production` is a per-analysis object, enables production mode for dead-code analysis only (boolean, default false): unused-files/exports/dependencies detection excludes test/spec/story/dev files and forces `unused-dev-dependencies`/`unused-optional-dependencies` to `off`, while health and dupes stay on the full tree. Set it to scope production analysis to dead code independently.",
|
|
1650
1769
|
"type": "boolean",
|
|
1651
1770
|
"default": false
|
|
1652
1771
|
},
|
|
1653
1772
|
"health": {
|
|
1773
|
+
"description": "When `production` is a per-analysis object, enables production mode for the health/complexity analysis only (boolean, default false), so `fallow health` in combined `fallow` and `fallow audit` scores only shipped code (test/spec/story/dev files excluded) while dead-code and dupes stay on the full tree. Set it to scope production analysis to health independently.",
|
|
1654
1774
|
"type": "boolean",
|
|
1655
1775
|
"default": false
|
|
1656
1776
|
},
|
|
1657
1777
|
"dupes": {
|
|
1778
|
+
"description": "When `production` is a per-analysis object, enables production mode for duplication analysis only (boolean, default false), so clone detection runs on shipped code only (test/spec/story/dev files excluded) while dead-code and health stay on the full tree. Set it to scope production analysis to dupes independently.",
|
|
1658
1779
|
"type": "boolean",
|
|
1659
1780
|
"default": false
|
|
1660
1781
|
}
|
|
@@ -1666,12 +1787,14 @@
|
|
|
1666
1787
|
"type": "object",
|
|
1667
1788
|
"properties": {
|
|
1668
1789
|
"files": {
|
|
1790
|
+
"description": "Glob-pattern string array selecting which source files this override entry applies to (patterns are validated and compiled to matchers at config load). Set to scope the entry's rule severities to a subset of paths (e.g. `[\"src/generated/**\", \"**/*.test.ts\"]`); when several override entries match one file, its severities come from every matching entry, applied in list order (later entries win on conflict).",
|
|
1669
1791
|
"type": "array",
|
|
1670
1792
|
"items": {
|
|
1671
1793
|
"type": "string"
|
|
1672
1794
|
}
|
|
1673
1795
|
},
|
|
1674
1796
|
"rules": {
|
|
1797
|
+
"description": "Partial per-rule severity map applied only to files matching this entry's `files` globs; each rule key takes `error`, `warn`, or `off`, and omitted rules keep their top-level severity. Set to change how specific rules (e.g. unused-exports, unused-files) behave for the scoped paths. Inter-file rules (duplicate-exports, circular-dependencies, re-export-cycle) have no effect in an override; fallow warns during analysis and names the right mechanism instead (top-level `ignoreExports` for duplicate-exports, a file-level `// fallow-ignore-file` comment for circular-dependencies and re-export-cycle).",
|
|
1675
1798
|
"$ref": "#/$defs/PartialRulesConfig",
|
|
1676
1799
|
"default": {}
|
|
1677
1800
|
}
|
|
@@ -2220,6 +2343,7 @@
|
|
|
2220
2343
|
"type": "object",
|
|
2221
2344
|
"properties": {
|
|
2222
2345
|
"baseline": {
|
|
2346
|
+
"description": "The saved per-issue-type issue counts that `--fail-on-regression` compares the current run against; the gate fails only when counts grow beyond the configured tolerance. Typically written by `--save-baseline` rather than hand-authored; each field (total_issues plus per-kind counts like unused_exports, boundary_violations, policy_violations) is an integer defaulting to 0 when omitted. Absent means no baseline is embedded.",
|
|
2223
2347
|
"anyOf": [
|
|
2224
2348
|
{
|
|
2225
2349
|
"$ref": "#/$defs/RegressionBaseline"
|
|
@@ -2366,39 +2490,46 @@
|
|
|
2366
2490
|
"type": "object",
|
|
2367
2491
|
"properties": {
|
|
2368
2492
|
"gate": {
|
|
2493
|
+
"description": "Selects which findings affect the `fallow audit` verdict: `new-only` (default) fails only on findings introduced by the current changeset (running a base-snapshot attribution pass), while `all` fails on every finding in changed files and skips that pass. Set to `all` to gate the full backlog in changed files; the `--gate` CLI flag overrides this.",
|
|
2369
2494
|
"$ref": "#/$defs/AuditGate"
|
|
2370
2495
|
},
|
|
2371
2496
|
"css": {
|
|
2497
|
+
"description": "Toggles styling analytics (CSS and CSS-in-JS) in the `fallow audit` health sub-pass; these findings are descriptive and verdict-neutral by default (they change the exit code only when a css-* rule is set to error). Defaults to on when unset; set `false` to skip styling analysis. The `--no-css` CLI flag forces it off regardless.",
|
|
2372
2498
|
"type": [
|
|
2373
2499
|
"boolean",
|
|
2374
2500
|
"null"
|
|
2375
2501
|
]
|
|
2376
2502
|
},
|
|
2377
2503
|
"cssDeep": {
|
|
2504
|
+
"description": "Toggles the project-wide CSS reachability pass in `fallow audit`, whose cross-file findings are narrowed back to changed anchors. Defaults to on when unset and runs only when css analytics are enabled; set `false` to keep local styling analytics but skip the whole-project scan. The `--css-deep` flag re-enables it and `--no-css-deep` forces it off.",
|
|
2378
2505
|
"type": [
|
|
2379
2506
|
"boolean",
|
|
2380
2507
|
"null"
|
|
2381
2508
|
]
|
|
2382
2509
|
},
|
|
2383
2510
|
"deadCodeBaseline": {
|
|
2511
|
+
"description": "Path to a saved dead-code baseline file (produced by `fallow dead-code --save-baseline`) that the audit's dead-code sub-analysis compares against, suppressing pre-existing dead-code issues. The `--dead-code-baseline` CLI flag overrides it and both resolve relative to the project root; each sub-analysis uses a distinct baseline format, so this is separate from `healthBaseline` and `dupesBaseline`.",
|
|
2384
2512
|
"type": [
|
|
2385
2513
|
"string",
|
|
2386
2514
|
"null"
|
|
2387
2515
|
]
|
|
2388
2516
|
},
|
|
2389
2517
|
"healthBaseline": {
|
|
2518
|
+
"description": "Path to a saved health/complexity baseline file (produced by `fallow health --save-baseline`) that the audit's health sub-analysis compares against, suppressing pre-existing complexity/health findings. The `--health-baseline` CLI flag overrides it and both resolve relative to the project root; its baseline format is distinct from the dead-code and dupes baselines.",
|
|
2390
2519
|
"type": [
|
|
2391
2520
|
"string",
|
|
2392
2521
|
"null"
|
|
2393
2522
|
]
|
|
2394
2523
|
},
|
|
2395
2524
|
"dupesBaseline": {
|
|
2525
|
+
"description": "Path to a saved duplication baseline file (produced by `fallow dupes --save-baseline`) that the audit's duplication sub-analysis compares clone groups against, suppressing pre-existing duplicate clones. The `--dupes-baseline` CLI flag overrides it and both resolve relative to the project root; its baseline format is distinct from the dead-code and health baselines.",
|
|
2396
2526
|
"type": [
|
|
2397
2527
|
"string",
|
|
2398
2528
|
"null"
|
|
2399
2529
|
]
|
|
2400
2530
|
},
|
|
2401
2531
|
"cacheMaxAgeDays": {
|
|
2532
|
+
"description": "Garbage-collection threshold, in whole days, for the persistent reusable base-snapshot worktree caches `fallow audit` creates: entries older than this window are swept on each audit run. Set to control cache accumulation; `0` disables the sweep and unset defaults to 30 days. The `FALLOW_AUDIT_CACHE_MAX_AGE_DAYS` environment variable overrides this field.",
|
|
2402
2533
|
"type": [
|
|
2403
2534
|
"integer",
|
|
2404
2535
|
"null"
|
|
@@ -13,7 +13,7 @@ function getPlatformPackage(platform, arch, libcFamily) {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
if (platform === "linux") {
|
|
16
|
-
const libc = libcFamily === "
|
|
16
|
+
const libc = libcFamily === "glibc" ? "gnu" : "musl";
|
|
17
17
|
if (arch === "x64" || arch === "arm64") {
|
|
18
18
|
return `@fallow-cli/linux-${arch}-${libc}`;
|
|
19
19
|
}
|
|
@@ -9,9 +9,9 @@ test("maps Windows x64 and arm64 to MSVC packages", () => {
|
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
test("maps Linux packages with libc awareness", () => {
|
|
12
|
-
assert.equal(getPlatformPackage("linux", "x64", "
|
|
13
|
-
assert.equal(getPlatformPackage("linux", "
|
|
14
|
-
assert.equal(getPlatformPackage("linux", "
|
|
12
|
+
assert.equal(getPlatformPackage("linux", "x64", "glibc"), "@fallow-cli/linux-x64-gnu");
|
|
13
|
+
assert.equal(getPlatformPackage("linux", "x64", "musl"), "@fallow-cli/linux-x64-musl");
|
|
14
|
+
assert.equal(getPlatformPackage("linux", "x64", null), "@fallow-cli/linux-x64-musl");
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
test("maps macOS packages by architecture", () => {
|
package/scripts/run-binary.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
const { execFileSync } = require("node:child_process");
|
|
12
12
|
const path = require("node:path");
|
|
13
13
|
const fs = require("node:fs");
|
|
14
|
+
const os = require("node:os");
|
|
14
15
|
|
|
15
16
|
const { getPlatformPackage } = require("./platform-package");
|
|
16
17
|
const { ensureVerified } = require("./lazy-verify");
|
|
@@ -107,6 +108,15 @@ function writeVerifiedLineIfVersionQuery(verifyResult, version) {
|
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
|
|
111
|
+
// Exit code for a child failure caught from execFileSync. A signal death has
|
|
112
|
+
// status === null; map it to the shell convention 128 + signal number so CI
|
|
113
|
+
// gates see a crash, never a success.
|
|
114
|
+
function exitCodeForChildFailure(e) {
|
|
115
|
+
if (e.status !== null) return e.status;
|
|
116
|
+
const signalNumber = os.constants.signals[e.signal];
|
|
117
|
+
return signalNumber ? 128 + signalNumber : 1;
|
|
118
|
+
}
|
|
119
|
+
|
|
110
120
|
// Read the resolved CLI version from the platform package manifest (its version
|
|
111
121
|
// is released in lockstep with the CLI). Best-effort: never throws, so a
|
|
112
122
|
// missing/garbled manifest just omits the signing annotation on --version.
|
|
@@ -159,10 +169,13 @@ function runBinary(binaryBaseName) {
|
|
|
159
169
|
execFileSync(binaryPath, process.argv.slice(2), { stdio: "inherit" });
|
|
160
170
|
} catch (e) {
|
|
161
171
|
if (e.status === undefined) throw e;
|
|
172
|
+
if (e.status === null) {
|
|
173
|
+
process.stderr.write(`fallow binary terminated by signal ${e.signal ?? "unknown"}\n`);
|
|
174
|
+
}
|
|
162
175
|
// Child has already written its --version line via inherited stdio;
|
|
163
176
|
// append the verified line here only on a clean exit.
|
|
164
177
|
if (e.status === 0) writeVerifiedLineIfVersionQuery(verifyResult, resolvedVersion);
|
|
165
|
-
process.exit(e
|
|
178
|
+
process.exit(exitCodeForChildFailure(e));
|
|
166
179
|
}
|
|
167
180
|
|
|
168
181
|
writeVerifiedLineIfVersionQuery(verifyResult, resolvedVersion);
|
|
@@ -173,4 +186,5 @@ module.exports = {
|
|
|
173
186
|
describeVerified, // test-only
|
|
174
187
|
isVersionQuery, // test-only
|
|
175
188
|
guardBrokenStdout, // test-only
|
|
189
|
+
exitCodeForChildFailure, // test-only
|
|
176
190
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const test = require("node:test");
|
|
2
2
|
const assert = require("node:assert/strict");
|
|
3
|
+
const os = require("node:os");
|
|
3
4
|
const { spawnSync } = require("node:child_process");
|
|
4
5
|
const path = require("node:path");
|
|
5
6
|
|
|
@@ -74,3 +75,19 @@ test("describeVerified annotates the resolved version's signing status", () => {
|
|
|
74
75
|
assert.equal(describeVerified(ok, undefined), "verified: yes (sentinel /c/s)");
|
|
75
76
|
assert.equal(describeVerified(ok, ""), "verified: yes (sentinel /c/s)");
|
|
76
77
|
});
|
|
78
|
+
|
|
79
|
+
test("exitCodeForChildFailure preserves status codes and maps signal deaths", () => {
|
|
80
|
+
const { exitCodeForChildFailure } = require(RUN_BINARY);
|
|
81
|
+
assert.equal(exitCodeForChildFailure({ status: 3 }), 3);
|
|
82
|
+
assert.equal(exitCodeForChildFailure({ status: 0 }), 0);
|
|
83
|
+
assert.equal(
|
|
84
|
+
exitCodeForChildFailure({ status: null, signal: "SIGSEGV" }),
|
|
85
|
+
128 + os.constants.signals.SIGSEGV,
|
|
86
|
+
);
|
|
87
|
+
assert.equal(
|
|
88
|
+
exitCodeForChildFailure({ status: null, signal: "SIGKILL" }),
|
|
89
|
+
128 + os.constants.signals.SIGKILL,
|
|
90
|
+
);
|
|
91
|
+
assert.equal(exitCodeForChildFailure({ status: null, signal: undefined }), 1);
|
|
92
|
+
assert.equal(exitCodeForChildFailure({ status: null, signal: "NOT_A_SIGNAL" }), 1);
|
|
93
|
+
});
|