ISSUE DESCRIPTION False positive unused file for Vercel vercel.ts config What happened?…
- User
ISSUE DESCRIPTION
False positive unused file for Vercel vercel.ts config
What happened?
fallow dead-codereportsapps/web/vercel.tsas an unused file, but Vercel treatsvercel.tsas a project configuration file that is discovered and executed by convention.The file is not imported by application source, so it looks unused to a pure import graph. It should be treated as a Vercel config entrypoint.
Vercel docs say:
vercel.tsconfigures and overrides Vercel project behavior.- Unlike
vercel.json,vercel.tsexecutes at build time. - The final config must be exported as
config. - Vercel also supports
vercel.js,vercel.mjs,vercel.cjs, andvercel.mts.
The
@vercel/configpackage also treatsvercel.tsas the config input:packages/config/README.mdsays to create avercel.tsfile in the project root.packages/config/README.mdsaysvercel.tsis automatically compiled duringvercel build,vercel dev, andvercel deploy.packages/config/src/cli.tsresolvesprocess.cwd()/vercel.ts.packages/config/src/cli.tsimports the config module and collects named exports.
- Assistant
I’ll first inspect the repository structure and locate Vercel/plugin configuration patterns and related tests. Then I’ll reproduce the current detection behavior, make the smallest convention-aligned change, and run the focused and broader relevant tests.
- Assistant
ripgrepis unavailable, so I’ll usegrep/find. The repository is Rust-based; I’ll now identify plugin definitions, fixtures, and the test harness conventions before editing anything. - Assistant
There is no existing Vercel plugin, so the likely fix is to add one and register it rather than tying Vercel conventions to Next.js. I’ll inspect several simple plugins, registry activation logic, and plugin tests to determine dependency/script detection semantics and root-relative glob behavior.
- Assistant
The initial output was truncated. I’ll extract only the trait, module declarations, registry list, and representative
always_used_patternsimplementations. This will clarify whether these config files should be entry patterns or always-used files and how extensions are represented. - Assistant
The API calls this list
always_used(). I’ll inspect its exact contract and simple macro-defined plugins, plus how registry output prefixes workspace paths. Then I can add Vercel consistently and verify all five app-root variants without suppressing similarly named nested files. - Assistant
A root-relative brace glob is the established way to cover extension variants, and omitting
**/ensures only each package/workspace root is protected. Activation should recognize either thevercelCLI package or@vercel/config, and thevercelbinary in scripts. I’ll verify macro syntax and registry script handling, then build the current CLI and reproduce the false positive in a temporary fixture before changing source. - Assistant
The implementation choice is now clear: a dedicated lightweight
vercelplugin with dependency and script enablers and one root-scoped brace pattern. Unlike OpenNext, no config parsing is needed because the issue is file liveness, not extracting arbitrary imports (the config itself becomes a graph root and its imports are traversed normally). I’ll build the CLI and run the reported fixture to capture baseline output. - Assistant
The baseline reproduces exactly one issue:
vercel.tsis unused. I’ll now add the plugin source and register it in the built-in registry. I’ll keep the pattern app-root-only and avoid config-pattern parsing, nested wildcard suppression, or unrelated dependency policy changes. - Assistant
The module file was added, but registry insertion intentionally aborted because the expected constructor adjacency differed from the import adjacency; no malformed registry edit was written. I’ll inspect the exact nearby lines and apply the two registration edits directly.
- Assistant
I’ll register
VercelPluginin the import list and in the deployment section beside Wrangler/OpenNext, which matches its domain better than “Other tools.” Then I’ll format and compile the core tests. - Assistant
Focused plugin tests all pass (1,012 tests). Next I’ll rebuild the CLI and verify: (1) the exact reported
vercel.tsfixture is clean, (2) all five documented extensions are protected, (3) activation works independently through@vercel/configand through avercelscript, and (4) a nestedsrc/vercel.tsremains reportable, confirming the suppression is not overbroad. - Assistant
The fix behaves correctly in the key dimensions: root configs are retained, script-only activation works, nested lookalikes remain unused, and no-Vercel projects are unaffected. The combined five-file case has one unrelated aggregate issue because multiple configs export the same symbol; real projects use one variant. I’ll validate each extension independently, inspect the exact aggregate issue for completeness, then run the entire
fallow-coretest suite and Clippy on the affected crate. - Assistant
Each documented extension independently has no unused-file or unused-export issue; the lone issue in the synthetic minimal cases is the deliberately unimported
@vercel/configdependency (the reported reproduction imports it and is therefore clean). Config patterns do not activate plugins generically; activation is explicitly dependency/script/file-based, so the implemented enablers fit the stated “when Vercel is active” requirement without treating any arbitraryvercel.tsas Vercel-owned. I’ll now run full core validation and the exact reproduction once more. - Assistant
All 2,461 core unit tests and 541 core integration tests pass, Clippy passes with warnings denied, and the exact reported fixture now returns zero issues. I’ll perform the final hygiene review: formatting, whitespace, complete diff including the new file, and repository status. Then I’ll summarize every requested checklist bullet before submitting.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.