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 the Vercel plugin/config detection and its tests, then reproduce the current classification before making the smallest convention-based change.
- Assistant
There is no obvious Vercel plugin match in the initial search, so I’ll enumerate the plugin registry and inspect how comparable deployment/framework plugins declare config files and activation dependencies.
- Assistant
Vercel is not currently registered, so extending another framework (such as Next.js) would miss non-Next Vercel projects. I’ll inspect the declarative plugin pattern and registry tests to add a dedicated Vercel plugin activated by the relevant packages/scripts, with root-scoped config globs.
- Assistant
The registry automatically prefixes package-level static patterns per workspace, which is exactly the needed app-root behavior. I’ll now inspect the plugin trait/macro definitions and complete built-in registration list to implement the plugin consistently.
- Assistant
The shell interpreted punctuation in the grep expression; I’ll rerun the inspection with safely quoted patterns.
- Assistant
A dedicated deployment plugin is appropriate. Before editing, I’ll verify macro syntax and module declaration ordering, then inspect dead-code fixture/test conventions so the reported end-to-end behavior can be reproduced without adding repository tests (as required).
- Assistant
For built-ins, config files discovered through
config_patternsare likely promoted to always-used during resolution, but the issue explicitly asks for config/always-used protection. I’ll trace that merge path to avoid redundant or behaviorally incomplete declarations, and identify the available CLI binary for a temporary reproduction. - Assistant
Static
config_patternsare for discovery/parsing and are not inherently always-used for built-ins, so both fields are needed. Activation should cover eithervercelor@vercel/config; I’ll also support avercelpackage-script command, matching the repository’s plugin activation model, and include all five documented executable extensions in one root-level brace glob. Before editing, I’ll capture the false positive using a temporary project and the current CLI. - Assistant
The reproduction confirms
vercel.tsis the sole unused file. I’ll add the plugin source and wire it into module declarations and the deployment registry. I’ll keep tooling dependency behavior unchanged:vercelis already credited when invoked by a script, and@vercel/configis credited by the config’s import. - Assistant
The plugin is wired correctly, but its script activation override duplicates the trait’s default implementation. I’ll simplify it to only declare
script_enablers, then compile the core crate before rerunning the reproduction across all supported extensions and activation modes. - Assistant
Core compilation passes. I’ll build the CLI once, then run temporary end-to-end checks for: all five extensions under dependency activation, script-only activation, inactive-project non-suppression, and workspace-root scoping. This validates both the fix and the key false-positive/over-broadness edges without modifying tests.
- Assistant
All end-to-end edge checks behave as intended: supported app-root configs are protected when active, script-only activation works, inactive projects still report the file, and nested same-named files remain reportable. I’ll now run the plugin/registry unit tests and core integration tests most likely affected, followed by clippy and a final diff review.
- Assistant
All 1,012 plugin unit tests, the targeted dead-code integration test, and strict clippy pass. I’ll perform a final source/status review, verify formatting and no unintended tracked changes, and then summarize the required checklist before submission.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.