Skip to content

Commit c5ccc92

Browse files
committed
chore: remove fallow tooling and fix Import-LibModule scoping
- Remove .fallowrc.json, .fallowignore, .fallow/ cache — fallow is a JS/TS-only tool; this project has no JS/TS source files - Remove fallow devDependency from package.json and run pnpm install to drop it from pnpm-lock.yaml - Remove all fallow:* npm scripts from package.json - Remove all fallow-* tasks from Taskfile.yml - Clear .mcp.json fallow MCP server entry - Delete dead code: profile.d/dev-tools-modules/api/api-tools.ps1 (incomplete WIP copy of profile.d/api-tools.ps1, never loaded by any fragment or module registry) - Fix ConvertToJsonObject duplication in sexpr.ps1: extract shared helper as _ConvertSexprItemToJson global function; both _ConvertFrom-SexprToJson and _ConvertFrom-SexprToYaml now call it - Fix systemic Import-LibModule scoping bug: add -Global flag to all Import-LibModule calls in 57 .ps1 scripts under scripts/. Without -Global, imported modules stayed in the calling module's scope and their functions (Write-ScriptMessage, Exit-WithCode, etc.) were silently unavailable to script code - Rewrite find-duplicate-functions.ps1: replace broken Invoke-Parallel (Start-Job runspaces lack lib module access) with a direct sequential scan using [System.IO.File]::ReadAllText; also fixes function regex to skip global: scope qualifier to avoid false positives
1 parent ede29ca commit c5ccc92

48 files changed

Lines changed: 171 additions & 948 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.fallowignore

Lines changed: 0 additions & 16 deletions
This file was deleted.

.fallowrc.json

Lines changed: 0 additions & 58 deletions
This file was deleted.

.mcp.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
{
2-
"mcpServers": {
3-
"fallow": {
4-
"command": "node_modules/.bin/fallow-mcp",
5-
"description": "Fallow codebase intelligence: dead-code detection, duplication, complexity, circular deps for JS/TS files in this project"
6-
}
7-
}
2+
"mcpServers": {}
83
}

Taskfile.yml

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -301,46 +301,6 @@ tasks:
301301
cmds:
302302
- pwsh -NoProfile -File scripts/utils/task-parity/check-task-parity.ps1 -Generate {{.CLI_ARGS}}
303303

304-
fallow:
305-
desc: Run fallow dead-code analysis on JS/TS files
306-
cmds:
307-
- fallow dead-code
308-
309-
fallow-duplication:
310-
desc: Run fallow code duplication analysis
311-
cmds:
312-
- fallow dupes
313-
314-
fallow-complexity:
315-
desc: Run fallow health/complexity analysis
316-
cmds:
317-
- fallow health
318-
319-
fallow-circular:
320-
desc: Run fallow circular-dependency / dead-code analysis
321-
cmds:
322-
- fallow dead-code
323-
324-
fallow-all:
325-
desc: Run all fallow analyses combined (dead-code + dupes + health)
326-
cmds:
327-
- fallow
328-
329-
fallow-audit:
330-
desc: Review changed files for dead code, complexity, and duplication
331-
cmds:
332-
- fallow audit
333-
334-
fallow-watch:
335-
desc: Re-run fallow analysis as files change
336-
cmds:
337-
- fallow watch
338-
339-
fallow-mcp:
340-
desc: Start fallow MCP server (for AI assistant integration)
341-
cmds:
342-
- node_modules/.bin/fallow-mcp
343-
344304
drift-check:
345305
desc: Check that all doc-to-code bindings are current (drift)
346306
cmds:

package.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,6 @@
7171
"dev-setup": "pwsh -NoProfile -File scripts/dev/setup.ps1",
7272
"check-task-parity": "pwsh -NoProfile -File scripts/utils/task-parity/check-task-parity.ps1",
7373
"generate-task-parity": "pwsh -NoProfile -File scripts/utils/task-parity/check-task-parity.ps1 -Generate",
74-
"fallow": "fallow dead-code",
75-
"fallow:duplication": "fallow dupes",
76-
"fallow:complexity": "fallow health",
77-
"fallow:circular": "fallow dead-code",
78-
"fallow:all": "fallow",
79-
"fallow:audit": "fallow audit",
80-
"fallow:watch": "fallow watch",
81-
"fallow:mcp": "node_modules/.bin/fallow-mcp",
8274
"drift:check": "drift check",
8375
"drift:update": "drift update"
8476
},
@@ -121,7 +113,6 @@
121113
"@cspell/dict-python": "^4.2.26",
122114
"@cspell/dict-software-terms": "^5.2.2",
123115
"cspell": "^10.0.0",
124-
"fallow": "^2.83.0",
125116
"markdownlint-cli": "^0.48.0"
126117
}
127118
}

pnpm-lock.yaml

Lines changed: 0 additions & 91 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

profile.d/conversion-modules/data/structured/sexpr.ps1

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@
2121
Reference: https://en.wikipedia.org/wiki/S-expression
2222
#>
2323
function Initialize-FileConversion-Sexpr {
24+
# Shared helper: convert a parsed S-expression tree node to a JSON-serialisable value.
25+
# Defined once here as a Global function so both _ConvertFrom-SexprToJson and
26+
# _ConvertFrom-SexprToYaml can use it without duplicating the body.
27+
Set-Item -Path Function:Global:_ConvertSexprItemToJson -Value {
28+
param($Item)
29+
if ($null -eq $Item) { return $null }
30+
if ($Item -is [System.Collections.IList] -or $Item -is [System.Array]) {
31+
$result = @()
32+
foreach ($subItem in $Item) { $result += & $_ConvertSexprItemToJson $subItem }
33+
return $result
34+
}
35+
return $Item
36+
} -Force
37+
2438
# Helper function to parse S-Expression
2539
Set-Item -Path Function:Global:_Parse-Sexpr -Value {
2640
param([string]$SexprContent)
@@ -243,23 +257,7 @@ function Initialize-FileConversion-Sexpr {
243257
$sexprContent = Get-Content -LiteralPath $InputPath -Raw
244258
$parsed = _Parse-Sexpr -SexprContent $sexprContent
245259

246-
# Convert parsed structure to JSON
247-
function ConvertToJsonObject {
248-
param($Item)
249-
if ($null -eq $Item) {
250-
return $null
251-
}
252-
if ($Item -is [System.Collections.IList] -or $Item -is [System.Array]) {
253-
$result = @()
254-
foreach ($subItem in $Item) {
255-
$result += ConvertToJsonObject -Item $subItem
256-
}
257-
return $result
258-
}
259-
return $Item
260-
}
261-
262-
$jsonObj = ConvertToJsonObject -Item $parsed
260+
$jsonObj = & $Function:_ConvertSexprItemToJson $parsed
263261
$json = $jsonObj | ConvertTo-Json -Depth 100
264262
Set-Content -LiteralPath $OutputPath -Value $json -Encoding UTF8
265263
}
@@ -297,22 +295,7 @@ function Initialize-FileConversion-Sexpr {
297295
$parsed = _Parse-Sexpr -SexprContent $sexprContent
298296

299297
# Convert to JSON first, then to YAML (simple approach)
300-
function ConvertToJsonObject {
301-
param($Item)
302-
if ($null -eq $Item) {
303-
return $null
304-
}
305-
if ($Item -is [System.Collections.IList] -or $Item -is [System.Array]) {
306-
$result = @()
307-
foreach ($subItem in $Item) {
308-
$result += ConvertToJsonObject -Item $subItem
309-
}
310-
return $result
311-
}
312-
return $Item
313-
}
314-
315-
$jsonObj = ConvertToJsonObject -Item $parsed
298+
$jsonObj = & $Function:_ConvertSexprItemToJson $parsed
316299
$json = $jsonObj | ConvertTo-Json -Depth 100
317300
$yamlObj = $json | ConvertFrom-Json
318301
$yaml = $yamlObj | ConvertTo-Yaml -ErrorAction SilentlyContinue

0 commit comments

Comments
 (0)