Repository navigation
v2.66.1 - Astro scripts, register() loaders, audit base node_modules
·
3936 commits
to main
since this release
Patch release with bug fixes for the Astro extractor, the node:module register() loader hook, fallow audit base-side worktrees, and tsconfig fallback when an extends chain is broken. Also a small cosmetic pass that swaps em-dashes for ASCII punctuation in user-facing CLI output.
Fixes
- Astro
<script src="...">and inline<script>ESM imports are followed. Astro pages route per-component client code through external<script src="../scripts/foo.ts">references and inline<script>import '../scripts/bar';</script>ESM bodies; both are bundled into the build output but were surfacing asunused-file. The extractor now scans the post-frontmatter template body for external script and link references and parses inline<script>bodies as TypeScript. Astro only processes a<script>tag when it has zero attributes or onlysrc=, so attributed inline scripts (e.g.is:inline) render as authored without bundling and are intentionally excluded from the import graph to match Astro's own behavior. Thanks @zaphir for the report. (Closes #295) node:moduleregister()loader specifiers credit their target packages.register('@swc-node/register/esm', pathToFileURL('./'))fromnode:module(or the baremodulebuiltin) loads a loader by string specifier rather than via a static or dynamic import, so registered packages like@swc-node/registerandtsxwere surfacing asunused-dependency. Named imports, aliased named imports, and namespace imports (import * as Module from 'node:module'; Module.register(...)) all engage; same-named functions from any other source are skipped. Thanks @ChrisJr404 for the patch and @pdeveltere for the report. (Closes #293)fallow auditbase-side worktrees see the samenode_modulesas HEAD. Audit base worktrees lackednode_modules, breaking tsconfigextendschains that point into installed packages and disabling path-alias resolution on the BASE side. The result was spuriousBroken tsconfig chainwarnings and false-positive attributions on React Native repos whose tsconfig extends./node_modules/@react-native/typescript-config/tsconfig.json. Fresh, reusable, and ready persistent base worktrees now symlinkrepo_root/node_modulesso the BASE-side analysis sees the same dependency context as HEAD. The audit base snapshot cache version is bumped so prior snapshots captured under the broken behavior are invalidated. Thanks @iarmankhan for the report. (Closes #292)- Local tsconfig
paths,baseUrl, androotDirsstay usable when anextendschain is broken. When a tsconfig'sextendstarget was missing or unparsable, the resolver previously fell back to a no-aliases mode for the entire config, so valid local imports againstpathsdefined in the same tsconfig surfaced asunresolved-import. The graph resolver now keeps the local tsconfig's alias contract alive and only drops the broken-extends parent's contributions, so React Native and Expo projects whose framework base tsconfig is untracked or out of sync continue to resolve their own aliases. Audit base snapshots also compare against the same merged config contract as the current run. Thanks @M-Hassan-Raza for the patch. (#299) - Combined-mode
--format jsonoutside a git repository is now exactly one JSON document. When the project root sat outside any git checkout, the hotspot pipeline emitted a structured error blob to stdout and combined mode then appended its normal report on top, sofallow --format json | jq .failed withtrailing characters at line 6 column 1. Missing git history is now treated as unavailable hotspot data: stdout stays a single document with empty hotspots, a non-fatalnote: hotspot analysis skipped: no git repository found at project rootgoes to stderr (suppressed by--quiet). Standalonefallow health --hotspots --format jsonoutside a git repo now exits 0 with empty hotspot fields instead of exiting 2 with a JSON error. Thanks @ChrisJr404 for the patch. (Closes #294)
Cosmetic
- User-facing CLI output uses ASCII punctuation in place of em-dashes. Rule descriptions in
fallow explain, the top-levelfallow --helpabout line,fallow listboundary output, the JSONactionsnote for refactor-together clone groups, the markdown health metric legend, hotspot stderr notes, the LSP test-only-dep diagnostic, the MCPlist_boundariestool description, and a handful of lower-traffic strings are now em-dash-free. Internal asserts, code comments, and clippy#[expect]reasons are out of scope.
Full Changelog: v2.66.0...v2.66.1