fallow 3.16.0 → 3.17.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 +3 -3
- package/package.json +10 -10
- package/scripts/run-binary.js +30 -10
- package/scripts/run-binary.test.js +22 -1
- package/types/output-contract.d.ts +41 -12
package/capabilities.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fallow",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.17.0",
|
|
4
4
|
"manifest_version": "1",
|
|
5
5
|
"description": "Codebase analyzer for TypeScript/JavaScript: unused code, circular dependencies, code duplication, complexity hotspots, and architecture boundary violations",
|
|
6
6
|
"global_flags": [
|
|
@@ -302,7 +302,7 @@
|
|
|
302
302
|
"name": "--report-path-prefix",
|
|
303
303
|
"type": "string",
|
|
304
304
|
"required": false,
|
|
305
|
-
"description": "Prefix prepended to every path in the CI-facing formats (`github-annotations`, `github-summary`, `codeclimate`, `review-github`, `review-gitlab`). CI platforms address files by repository-root-relative path, so when the analyzed project lives in a subdirectory (e.g. `packages/app/`), paths need that offset. fallow detects the offset via the git toplevel automatically; this flag overrides the detection. Pass an empty string to disable rebasing and emit paths relative to `--root`"
|
|
305
|
+
"description": "Prefix prepended to every path in the CI-facing formats (`github-annotations`, `github-summary`, `codeclimate`, `pr-comment-github`, `pr-comment-gitlab`, `review-github`, `review-gitlab`). CI platforms address files by repository-root-relative path, so when the analyzed project lives in a subdirectory (e.g. `packages/app/`), paths need that offset. fallow detects the offset via the git toplevel automatically; this flag overrides the detection. Pass an empty string to disable rebasing and emit paths relative to `--root`"
|
|
306
306
|
},
|
|
307
307
|
{
|
|
308
308
|
"name": "--fail-on-regression",
|
|
@@ -1897,7 +1897,7 @@
|
|
|
1897
1897
|
},
|
|
1898
1898
|
{
|
|
1899
1899
|
"name": "report",
|
|
1900
|
-
"description": "Render a saved `--format json` results file in another format without re-running analysis (analyze once, render
|
|
1900
|
+
"description": "Render a saved `--format json` results file in another format without re-running analysis (analyze once, then render every CI surface from the same file). Supports GitHub annotations/summary, CodeClimate, SARIF, and GitHub/GitLab PR-comment and review formats",
|
|
1901
1901
|
"flags": [
|
|
1902
1902
|
{
|
|
1903
1903
|
"name": "--from",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fallow",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.17.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,14 +87,14 @@
|
|
|
87
87
|
"@tanstack/intent": "0.3.6"
|
|
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.
|
|
98
|
-
"fallow-type-aware": "3.
|
|
90
|
+
"@fallow-cli/darwin-arm64": "3.17.0",
|
|
91
|
+
"@fallow-cli/darwin-x64": "3.17.0",
|
|
92
|
+
"@fallow-cli/linux-x64-gnu": "3.17.0",
|
|
93
|
+
"@fallow-cli/linux-arm64-gnu": "3.17.0",
|
|
94
|
+
"@fallow-cli/linux-x64-musl": "3.17.0",
|
|
95
|
+
"@fallow-cli/linux-arm64-musl": "3.17.0",
|
|
96
|
+
"@fallow-cli/win32-arm64-msvc": "3.17.0",
|
|
97
|
+
"@fallow-cli/win32-x64-msvc": "3.17.0",
|
|
98
|
+
"fallow-type-aware": "3.17.0"
|
|
99
99
|
}
|
|
100
100
|
}
|
package/scripts/run-binary.js
CHANGED
|
@@ -145,18 +145,38 @@ function resolveTypeAwareCompanion(
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
function
|
|
148
|
+
function typeAwareCommand(
|
|
149
|
+
companion,
|
|
150
|
+
{ platform = process.platform, execPath = process.execPath } = {},
|
|
151
|
+
) {
|
|
152
|
+
return platform === "win32"
|
|
153
|
+
? { binary: execPath, script: companion }
|
|
154
|
+
: { binary: companion, script: undefined };
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function childEnvironment(
|
|
158
|
+
resolvedVersion,
|
|
159
|
+
resolveCompanion = resolveTypeAwareCompanion,
|
|
160
|
+
commandOptions,
|
|
161
|
+
) {
|
|
149
162
|
if (process.env.FALLOW_TYPE_AWARE_BIN) return process.env;
|
|
150
163
|
const companion = resolveCompanion(resolvedVersion);
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
164
|
+
if (companion === undefined) return process.env;
|
|
165
|
+
|
|
166
|
+
const command = typeAwareCommand(companion, commandOptions);
|
|
167
|
+
const environment = {
|
|
168
|
+
...process.env,
|
|
169
|
+
FALLOW_TYPE_AWARE_BIN: command.binary,
|
|
170
|
+
// Marks the wiring as launcher-provided node_modules resolution so
|
|
171
|
+
// `type-aware status` does not report it as a user-set override.
|
|
172
|
+
FALLOW_TYPE_AWARE_BIN_SOURCE: "npm-wrapper",
|
|
173
|
+
};
|
|
174
|
+
if (command.script) {
|
|
175
|
+
environment.FALLOW_TYPE_AWARE_SCRIPT = command.script;
|
|
176
|
+
} else {
|
|
177
|
+
delete environment.FALLOW_TYPE_AWARE_SCRIPT;
|
|
178
|
+
}
|
|
179
|
+
return environment;
|
|
160
180
|
}
|
|
161
181
|
|
|
162
182
|
// Swallow EPIPE on stdout. When fallow's output is piped into a reader that
|
|
@@ -162,16 +162,32 @@ test("resolveTypeAwareCompanion accepts only an exact matching package", (t) =>
|
|
|
162
162
|
test("childEnvironment marks launcher-wired companions as npm-wrapper", (t) => {
|
|
163
163
|
const { childEnvironment } = require(RUN_BINARY);
|
|
164
164
|
const previousBin = process.env.FALLOW_TYPE_AWARE_BIN;
|
|
165
|
+
const previousScript = process.env.FALLOW_TYPE_AWARE_SCRIPT;
|
|
165
166
|
delete process.env.FALLOW_TYPE_AWARE_BIN;
|
|
167
|
+
delete process.env.FALLOW_TYPE_AWARE_SCRIPT;
|
|
166
168
|
t.after(() => {
|
|
167
169
|
if (previousBin === undefined) delete process.env.FALLOW_TYPE_AWARE_BIN;
|
|
168
170
|
else process.env.FALLOW_TYPE_AWARE_BIN = previousBin;
|
|
171
|
+
if (previousScript === undefined) delete process.env.FALLOW_TYPE_AWARE_SCRIPT;
|
|
172
|
+
else process.env.FALLOW_TYPE_AWARE_SCRIPT = previousScript;
|
|
169
173
|
});
|
|
170
174
|
|
|
171
|
-
const env = childEnvironment("3.8.0", () => "/tmp/fallow-type-aware.mjs"
|
|
175
|
+
const env = childEnvironment("3.8.0", () => "/tmp/fallow-type-aware.mjs", {
|
|
176
|
+
platform: "linux",
|
|
177
|
+
execPath: "/usr/bin/node",
|
|
178
|
+
});
|
|
172
179
|
assert.equal(env.FALLOW_TYPE_AWARE_BIN, "/tmp/fallow-type-aware.mjs");
|
|
180
|
+
assert.equal(env.FALLOW_TYPE_AWARE_SCRIPT, undefined);
|
|
173
181
|
assert.equal(env.FALLOW_TYPE_AWARE_BIN_SOURCE, "npm-wrapper");
|
|
174
182
|
|
|
183
|
+
const windowsEnv = childEnvironment("3.8.0", () => "C:\\pkg\\fallow-type-aware.mjs", {
|
|
184
|
+
platform: "win32",
|
|
185
|
+
execPath: "C:\\Program Files\\nodejs\\node.exe",
|
|
186
|
+
});
|
|
187
|
+
assert.equal(windowsEnv.FALLOW_TYPE_AWARE_BIN, "C:\\Program Files\\nodejs\\node.exe");
|
|
188
|
+
assert.equal(windowsEnv.FALLOW_TYPE_AWARE_SCRIPT, "C:\\pkg\\fallow-type-aware.mjs");
|
|
189
|
+
assert.equal(windowsEnv.FALLOW_TYPE_AWARE_BIN_SOURCE, "npm-wrapper");
|
|
190
|
+
|
|
175
191
|
// No resolvable companion: the environment passes through untouched.
|
|
176
192
|
const untouched = childEnvironment("3.8.0", () => undefined);
|
|
177
193
|
assert.equal(untouched, process.env);
|
|
@@ -181,14 +197,19 @@ test("childEnvironment marks launcher-wired companions as npm-wrapper", (t) => {
|
|
|
181
197
|
test("childEnvironment leaves a user-set override unmarked", (t) => {
|
|
182
198
|
const { childEnvironment } = require(RUN_BINARY);
|
|
183
199
|
const previousBin = process.env.FALLOW_TYPE_AWARE_BIN;
|
|
200
|
+
const previousScript = process.env.FALLOW_TYPE_AWARE_SCRIPT;
|
|
184
201
|
process.env.FALLOW_TYPE_AWARE_BIN = "/opt/custom-sidecar";
|
|
202
|
+
process.env.FALLOW_TYPE_AWARE_SCRIPT = "/opt/custom-sidecar.mjs";
|
|
185
203
|
t.after(() => {
|
|
186
204
|
if (previousBin === undefined) delete process.env.FALLOW_TYPE_AWARE_BIN;
|
|
187
205
|
else process.env.FALLOW_TYPE_AWARE_BIN = previousBin;
|
|
206
|
+
if (previousScript === undefined) delete process.env.FALLOW_TYPE_AWARE_SCRIPT;
|
|
207
|
+
else process.env.FALLOW_TYPE_AWARE_SCRIPT = previousScript;
|
|
188
208
|
});
|
|
189
209
|
|
|
190
210
|
const env = childEnvironment("3.8.0", () => "/tmp/fallow-type-aware.mjs");
|
|
191
211
|
assert.equal(env, process.env);
|
|
212
|
+
assert.equal(env.FALLOW_TYPE_AWARE_SCRIPT, "/opt/custom-sidecar.mjs");
|
|
192
213
|
assert.equal(env.FALLOW_TYPE_AWARE_BIN_SOURCE, undefined);
|
|
193
214
|
});
|
|
194
215
|
|
|
@@ -102,7 +102,7 @@ kind: "type-aware-status"
|
|
|
102
102
|
/**
|
|
103
103
|
* Schema projection for the audit envelope's exact version.
|
|
104
104
|
*/
|
|
105
|
-
export type AuditSchemaVersion =
|
|
105
|
+
export type AuditSchemaVersion = 10
|
|
106
106
|
/**
|
|
107
107
|
* Fallow CLI version that produced this envelope. Renders to the JSON wire as
|
|
108
108
|
* a bare string (e.g. `"2.74.0"`).
|
|
@@ -144,7 +144,7 @@ export type SemanticCompletenessRequirement = ("best-effort" | "complete")
|
|
|
144
144
|
/**
|
|
145
145
|
* Stable reason why semantic evidence is partial or unavailable.
|
|
146
146
|
*/
|
|
147
|
-
export type SemanticGapReason = ("no-project" | "ambiguous-project" | "blocking-diagnostics" | "unknown-symbol" | "unknown-entry-point" | "evidence-limit" | "dynamic-behavior" | "virtual-dispatch" | "dynamic-member-access" | "decorated-declaration" | "optional-contract" | "accessor-pair" | "overload-set" | "attached-comment" | "abstract-declaration" | "incomplete-project-coverage" | "framework-contract-provenance" | "capacity" | "unsupported-syntax")
|
|
147
|
+
export type SemanticGapReason = ("no-project" | "ambiguous-project" | "blocking-diagnostics" | "svelte-virtual-module-exports" | "unknown-symbol" | "unknown-entry-point" | "evidence-limit" | "dynamic-behavior" | "virtual-dispatch" | "dynamic-member-access" | "decorated-declaration" | "optional-contract" | "accessor-pair" | "overload-set" | "attached-comment" | "abstract-declaration" | "incomplete-project-coverage" | "framework-contract-provenance" | "capacity" | "unsupported-syntax")
|
|
148
148
|
/**
|
|
149
149
|
* Value or type namespace for one exact declaration or reference.
|
|
150
150
|
*/
|
|
@@ -184,7 +184,7 @@ export type TypeAwareAbstentionReason = ("no-project" | "ambiguous-project" | "b
|
|
|
184
184
|
/**
|
|
185
185
|
* Schema projection for the dead-code envelope's exact version.
|
|
186
186
|
*/
|
|
187
|
-
export type CheckSchemaVersion =
|
|
187
|
+
export type CheckSchemaVersion = 9
|
|
188
188
|
/**
|
|
189
189
|
* A suggested action attached to a finding in the JSON output. Each finding
|
|
190
190
|
* carries an `actions` array; consumers (agents, IDE clients, CI bots) can
|
|
@@ -782,7 +782,7 @@ export type GitLabReviewPositionType = "text"
|
|
|
782
782
|
/**
|
|
783
783
|
* Schema-version discriminator for the review envelope.
|
|
784
784
|
*/
|
|
785
|
-
export type ReviewEnvelopeSchema = ("fallow-review-envelope/v1" | "fallow-review-envelope/v2")
|
|
785
|
+
export type ReviewEnvelopeSchema = ("fallow-review-envelope/v1" | "fallow-review-envelope/v2" | "fallow-review-envelope/v3")
|
|
786
786
|
/**
|
|
787
787
|
* Review-envelope provider tag.
|
|
788
788
|
*/
|
|
@@ -821,7 +821,7 @@ export type CoverageSetupRuntimeTarget = ("node" | "browser")
|
|
|
821
821
|
/**
|
|
822
822
|
* Schema-version discriminator for [`CoverageAnalyzeOutput`].
|
|
823
823
|
*/
|
|
824
|
-
export type CoverageAnalyzeSchemaVersion = "1"
|
|
824
|
+
export type CoverageAnalyzeSchemaVersion = ("1" | "2")
|
|
825
825
|
/**
|
|
826
826
|
* Discovery outcome for a [`LogicalGroup`].
|
|
827
827
|
*/
|
|
@@ -829,7 +829,7 @@ export type LogicalGroupStatus = ("ok" | "empty" | "invalid_path")
|
|
|
829
829
|
/**
|
|
830
830
|
* Exact schema version for [`HealthOutput`].
|
|
831
831
|
*/
|
|
832
|
-
export type HealthSchemaVersion =
|
|
832
|
+
export type HealthSchemaVersion = 11
|
|
833
833
|
/**
|
|
834
834
|
* Resolver mode label for grouped envelopes (dead-code, dupes, health).
|
|
835
835
|
*
|
|
@@ -842,7 +842,7 @@ export type GroupByMode = ("owner" | "directory" | "package" | "section")
|
|
|
842
842
|
* Schema projection for the duplication envelope's CLI and programmatic
|
|
843
843
|
* version lineages.
|
|
844
844
|
*/
|
|
845
|
-
export type DupesSchemaVersion = (
|
|
845
|
+
export type DupesSchemaVersion = (3 | 9)
|
|
846
846
|
/**
|
|
847
847
|
* Wire-version discriminator for [`ImpactReport`]. Independent from the global
|
|
848
848
|
* `SchemaVersion` (the impact report versions on its own cadence) and from the
|
|
@@ -851,7 +851,7 @@ export type DupesSchemaVersion = (2 | 8)
|
|
|
851
851
|
* it, matching the other independently-versioned envelopes (e.g.
|
|
852
852
|
* `CoverageAnalyzeSchemaVersion`).
|
|
853
853
|
*/
|
|
854
|
-
export type ImpactReportSchemaVersion = "1"
|
|
854
|
+
export type ImpactReportSchemaVersion = ("1" | "2")
|
|
855
855
|
/**
|
|
856
856
|
* Why Impact tracking is (or is not) active for a project. `Project` = an
|
|
857
857
|
* explicit per-repo `enable`; `User` = the user-global default with no per-repo
|
|
@@ -867,12 +867,12 @@ export type ImpactTrendDirection = ("improving" | "declining" | "stable")
|
|
|
867
867
|
* versions separately from the per-project `ImpactReportSchemaVersion` and the
|
|
868
868
|
* on-disk `STORE_SCHEMA_VERSION`).
|
|
869
869
|
*/
|
|
870
|
-
export type CrossRepoImpactSchemaVersion = "1"
|
|
870
|
+
export type CrossRepoImpactSchemaVersion = ("1" | "2")
|
|
871
871
|
/**
|
|
872
872
|
* The `fallow security --format json` schema version. Independently versioned
|
|
873
873
|
* from the main contract, mirroring `ImpactReportSchemaVersion`.
|
|
874
874
|
*/
|
|
875
|
-
export type SecuritySchemaVersion = ("1" | "2" | "3" | "4" | "5" | "6" | "7")
|
|
875
|
+
export type SecuritySchemaVersion = ("1" | "2" | "3" | "4" | "5" | "6" | "7" | "8")
|
|
876
876
|
/**
|
|
877
877
|
* Severity level for rules.
|
|
878
878
|
*
|
|
@@ -954,7 +954,7 @@ export type SecurityBlindSpotsSchemaVersion = "1"
|
|
|
954
954
|
/**
|
|
955
955
|
* Schema projection for the combined envelope's exact version.
|
|
956
956
|
*/
|
|
957
|
-
export type CombinedSchemaVersion =
|
|
957
|
+
export type CombinedSchemaVersion = 11
|
|
958
958
|
/**
|
|
959
959
|
* Schema projection for the feature-flags envelope's exact version.
|
|
960
960
|
*/
|
|
@@ -975,7 +975,7 @@ export type FeatureFlagActionType = ("investigate-flag" | "suppress-line")
|
|
|
975
975
|
* Independently-versioned wire-version newtype for the brief envelope.
|
|
976
976
|
* Serializes as the integer `REVIEW_BRIEF_SCHEMA_VERSION`.
|
|
977
977
|
*/
|
|
978
|
-
export type ReviewBriefSchemaVersion =
|
|
978
|
+
export type ReviewBriefSchemaVersion = 7
|
|
979
979
|
/**
|
|
980
980
|
* The exactly-three shippable decision categories (the SOLID-3). No cut category
|
|
981
981
|
* (abstraction / deletion / convention / irreversibility) is representable: this
|
|
@@ -1940,6 +1940,11 @@ ambiguous_project: number
|
|
|
1940
1940
|
* Candidates retained because structural diagnostics block scanning.
|
|
1941
1941
|
*/
|
|
1942
1942
|
blocking_diagnostics: number
|
|
1943
|
+
/**
|
|
1944
|
+
* Candidates retained because the raw TypeScript-Go host cannot expose
|
|
1945
|
+
* named exports from Svelte virtual modules.
|
|
1946
|
+
*/
|
|
1947
|
+
svelte_virtual_module_exports: number
|
|
1943
1948
|
/**
|
|
1944
1949
|
* Candidates whose exact declaration identity could not be resolved.
|
|
1945
1950
|
*/
|
|
@@ -9366,6 +9371,14 @@ callees?: (ChainHop[] | null)
|
|
|
9366
9371
|
* Present only when `--callees` was requested.
|
|
9367
9372
|
*/
|
|
9368
9373
|
unresolved_callees?: (UnresolvedCallee[] | null)
|
|
9374
|
+
/**
|
|
9375
|
+
* Set when the name is unresolvable because two different `export *`
|
|
9376
|
+
* sources of this file supply it. `symbol_found` is `false` in that case
|
|
9377
|
+
* for the same reason it is false for an unknown name (the file exports
|
|
9378
|
+
* nothing under it per ECMA-262 ResolveExport), so this field is the only
|
|
9379
|
+
* thing that separates a barrel mistake from a typo.
|
|
9380
|
+
*/
|
|
9381
|
+
star_export_ambiguity?: (StarExportAmbiguity | null)
|
|
9369
9382
|
/**
|
|
9370
9383
|
* A human-readable summary of the trace outcome.
|
|
9371
9384
|
*/
|
|
@@ -9410,6 +9423,22 @@ export interface UnresolvedCallee {
|
|
|
9410
9423
|
callee: string
|
|
9411
9424
|
reason: UnresolvedReason
|
|
9412
9425
|
}
|
|
9426
|
+
/**
|
|
9427
|
+
* The `export *` collision that keeps a name from being exported.
|
|
9428
|
+
*/
|
|
9429
|
+
export interface StarExportAmbiguity {
|
|
9430
|
+
/**
|
|
9431
|
+
* Files that each declare a colliding declaration under the traced name
|
|
9432
|
+
* (project-root-relative), sorted. These are the origins to fix: keep one,
|
|
9433
|
+
* rename or explicitly re-export the rest.
|
|
9434
|
+
*/
|
|
9435
|
+
sources: string[]
|
|
9436
|
+
/**
|
|
9437
|
+
* The namespaces the collision occurs in, type before value. A name can
|
|
9438
|
+
* collide in type space, value space, or both.
|
|
9439
|
+
*/
|
|
9440
|
+
namespaces: SemanticNamespace[]
|
|
9441
|
+
}
|
|
9413
9442
|
/**
|
|
9414
9443
|
* Envelope emitted by `fallow --format review-github` / `review-gitlab`.
|
|
9415
9444
|
*/
|