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
There's no vercel.rs explicitly listed yet in this partial list; let's check further and search for "vercel.json" pattern.
Assistant
This is a great minimal template. Let's check how pm2 is registered in mod.rs and the define_plugin! macro, plus tests file location.
Assistant
Now let's look at the registry/builtin.rs file to see the full structure.
Assistant
Good, we'll set both config_patterns and always_used to be consistent with other plugins. Now let's create the vercel.rs plugin file.
Assistant
Now register this plugin in mod.rs and registry/builtin.rs.
Assistant
Now update registry/builtin.rs to import and register VercelPlugin.
Assistant
Now let's check
enablerslist — should "vercel" be added to any generic list like RUNTIME_ENTRY_POINT_PLUGINS in mod.rs? Since this plugin has no entry_patterns, not needed. Let's check if there's a place that needs deployment tools listed, e.g. flags.rs or knip_tables.rs mentioned in initial grep.Assistant
Not related. Now let's build.
Assistant
Build succeeds. Now let's run the plugin tests.
Assistant
Let's run the full test suite for the plugins module to make sure nothing else breaks (e.g., the global sanity checks over all builtin plugins).
Assistant
All tests passed (2462 passed, 0 failed). Now let's write a reproduction test using the actual CLI to simulate the issue scenario.
Assistant
Now let's create the reproduction scenario.
Assistant
No issues found — vercel.ts is not reported as unused. Let's verify by first reverting the fix temporarily to confirm the repro triggers the bug without the fix (sanity check).
Assistant
Confirmed the bug reproduces without the fix. Now let's restore the fix.
Assistant
Fix confirmed working. Now let's also test edge cases: enabler via
@vercel/configonly (withoutvercelpackage), and other extensions like.js,.mjs,.cjs,.mts.Assistant
vercel.mjs is correctly excluded (only pages/index.tsx flagged as unused, unrelated to next.js entry detection since no next dependency here). Now let's confirm cjs, mts, js too, and root-level (not nested) as sanity.
Assistant
All extensions work correctly. Let's clean up temp test dirs and run the full test suite once more for good measure.
Assistant
All tests pass. Now let's also check other places that might list plugin names, docs, migrate tables (knip migrate), schema.json for plugin registry documentation, README etc., to keep things consistent.
Assistant
Let's update the README count from 116 to 117.
Assistant
That's just a lower bound check
>= 80, fine either way. Now let's checkdocs/folder for a "Full plugin list" generation script that might need regenerating (e.g., docs website has a generated list from source).Assistant
Good. Now let's check
docs/plugin-authoring.mdfor any registry list needing update, and check for apluginscount test that might specifically check "117" somewhere else (like a snapshot test).Assistant
That's just a lower bound check, no hardcoded exact count elsewhere. Now let's run the whole workspace test suite (cli tests too) briefly to make sure nothing else broke, focusing on registry-related tests.
Assistant
This passed now with our change — it was just a flaky/env-dependent test (likely PATH/env race with parallel tests), unrelated to our change. Let's run the full test suite once more to confirm all green.
Assistant
Confirmed pre-existing failure unrelated to our change (running as root ignores read-only permission checks). This is an environment issue, not something introduced by our change. Let's rebuild with our changes back in place and confirm no other regressions.
Assistant
Confirmed identical pre-existing failure due to root permissions, unrelated to our change. This is fine since it fails identically with and without our fix. Now let's run the whole workspace test suite for other crates as well, to be thorough.
Assistant
Whole workspace builds fine. Let's finalize by reviewing the diff.
Assistant
Now let's run clippy to catch any lints.
Assistant
No clippy warnings. Let's run the full core test suite once more as final verification.
Assistant
All green. Let's view the final diff and new file content for a final review.
Assistant
This looks good. Now let's finalize the checklist review as requested.
Assistant
Everything looks good. Let's review the checklist:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.