v2.75.0: AdonisJS plugin + Glimmer multi-template + vitest auto-mock + Istanbul coverage fixes
Highlights
- AdonisJS plugin (v5/v6/v7) ships under the framework category, taking the built-in plugin count from 94 to 95. Fallow now understands AdonisJS folder conventions, both rc shapes (
.adonisrc.jsonandadonisrc.ts), the@ioc:virtual import prefix, and the assembler-hook arrays underdefineConfig. Real-project validation on six AdonisJS playgrounds and starter kits cutsunused_filesfrom 19/15/18/13/42/34 down to 2/0/0/0/3/1. - Three correctness fixes for Glimmer
.gtsparsing, vitestvi.mock()resolution, and Istanbul coverage matching on multiline typed async arrows.
Added
-
AdonisJS plugin (v5/v6/v7) added under the framework category. Covers controllers, models, middleware, validators, services, providers, preloads, commands, configs, contracts, database migrations / seeders / factories, the bootstrap files (
server.{ts,js},ace,bin/**/*.{ts,js}), the@ioc:virtual import prefix in v5, and the framework-managed peer packages that ship via the runtime container.resolve_configunderstands both rc shapes:.adonisrc.json(v5): parsespreloads,providers,commands,aceProviders(string and{ file, environment }forms),aliases,metaFiles[].pattern, andtypes[].adonisrc.ts(v6/v7): walksdefineConfig({...})for thunk-wrapped lazy imports plus the assembler hook arrays underhooks.*, appliesdirectories.*overrides as entry patterns, and reads the project'spackage.json#importsfor the resolver's path-alias table.
Real-project validation (release build,
total_issues / unused_files):Project Before After AdonisJS 6 playground (graphql) 68 / 42 17 / 3 AdonisJS 6 playground (openapi) 55 / 34 14 / 1 web-starter-kit 32 / 19 11 / 2 api-starter-kit 27 / 15 9 / 0 inertia-starter-kit 32 / 18 10 / 0 slim-starter-kit 22 / 13 9 / 0 Zero regression on zod, preact, vite, next.js. As part of the change,
fallow-extractexposes three shared dynamic-import peel helpers (extract_import_expression,extract_import_from_return_body,extract_import_from_callable) so the v6/v7 rc parser and existing visitor sites share one canonical peel path. (PR #364. Thanks @AlphaLawless for the patch.)
Fixed
-
.gtsfiles with multiple<template>blocks now extract imports and exports correctly. The Glimmer<template>stripper blanked every block to spaces, which works for class-body templates (an empty class body is valid) but producesconst x = ;for module-level template expressions, a TypeScript syntax error that caused oxc to bail and drop every import in the file. Real Ember/Glimmer route templates that combine an inlineTemplateOnlyComponentwith a class-body template silently parsed as zero-edge files, and every component they referenced was reported asunused-file. The stripper now detects expression position (previous non-whitespace byte is=,,,(,?, or:) and replaces the block with a byte-length-preserving parenthesized template literal so the surrounding statement stays syntactically valid. Class-body templates retain the existing blank-out behavior.CACHE_VERSIONbumped 77 to 78 so the fix takes effect on warm caches. (Closes #375. Thanks @ShockwaVee for the report.) -
vi.mock()without a factory no longer surfaces a phantomunresolved-importpointing at a__mocks__/path the user never wrote. Fallow synthesises a<dir>/__mocks__/<file>dynamic import next to everyvi.mock('./foo')call so vitest's optional manual-mock convention credits the sibling when it does exist. When the sibling did NOT exist on disk, the synthesised path flowed through tounresolved-importsas if the user had typed it, producing findings like@/utils/__mocks__/exportElementAsPngfor projects that rely on vitest's in-memory auto-mocking. The synthesised entry is now marked speculative and the resolver drops it silently when the target cannot be found; the credit path is unchanged (a__mocks__/<file>that DOES exist on disk is still credited as referenced).CACHE_VERSIONbumped 76 to 77 so the change takes effect on warm caches. (Closes #377 and #378. Thanks @cloud-walker for the report.) -
Istanbul
--coveragenow matches functions written as multiline typed async arrows. Istanbul producers (Jest, nyc, c8, babel-plugin-istanbul) are inconsistent aboutFnEntry.line: some emit the declaration line, others the body start. Fallow extracts function positions at the declaration, so multiline TS signatures likeexport const elementsFrom = async (...): Promise<T> => {...}lost their coverage match whenever the producer pointedlineat the body. The loader now indexes both the producer's effective line and the declaration start as aliases so lookups by declaration position resolve through the exact and name-fuzzy paths, and the anonymous-by-position fallback is guarded by a column-distance cap so the new aliases never credit unrelated functions sitting above a multiline arrow. (Closes #370. Thanks @Guria for the report.)
Full Changelog: v2.74.0...v2.75.0