False positive unused file for Vercel vercel.ts config
What happened?
fallow dead-code reports apps/web/vercel.ts as an unused file, but Vercel treats vercel.ts as 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.
This is a perfect template. Now let's write the vercel.rs plugin.
Assistant
Now register the module and plugin in mod.rs and builtin.rs.
Assistant
Good — sentry and changesets aren't in any of those categorized lists, so vercel doesn't need to be either. Now let's update builtin.rs.
Assistant
Now let's build to check for errors.
Assistant
Good, it compiles. Now let's run the plugin tests to ensure existing tests pass.
Assistant
All existing tests pass. Now let's write a reproduction script to actually test with the fallow CLI, mimicking the issue scenario.
Assistant
Let's confirm this without the fix (revert temporarily) to verify the original bug reproduces.
Assistant
Confirmed the bug reproduces without the fix. Now restore the fix.
Assistant
Fixed confirmed. Now let's also test the other extensions (js, mjs, cjs, mts) and a non-monorepo (root-level) scenario.
Assistant
Let's also test enabler via @vercel/config only (without vercel package), and mts/mjs/cjs variants.
Assistant
All tests pass. Let's also check the entry_point_role default for this plugin doesn't break the "unused files" count categorization, and check other test suites (e.g. cli, snapshot tests) plus check for plugin count in docs/schema that might need updating.
Assistant
No mentions — that doc is generic, no changes needed there. Let's run full workspace test suite (cli crate too) to be thorough.
Assistant
Confirmed pre-existing failure unrelated to our change (likely due to running as root, where read-only permissions don't block writes). Rebuild and run remaining test suite excluding that test.
Assistant
All good. Let's check overall summary for pass/fail counts by scrolling further up in output.
Assistant
All pass. Now let's run full workspace test suite for the config crate too, and clippy check for our new file.
Assistant
No warnings. Let's also verify cargo fmt --check doesn't complain about the new file.
Assistant
Now let's re-run build/tests once more after formatting to make sure nothing broke.
Assistant
Let's re-verify the reproduction test once more with the final build, and clean up temp dirs.
Assistant
Now let's review final diff.
Assistant
Let's view the new plugin file content once more.
Assistant
Now format and run the full core test suite + clippy once more.
Assistant
Clean. Now run full test suite once more for both crates.
Assistant
Confirmed that was a flaky test unrelated to our change — it passed on rerun. All test suites pass. Let's do a final review of the diff and the checklist.
Assistant
Summary
I resolved the issue by adding a new built-in VercelPlugin to the plugin system:
New file: crates/core/src/plugins/vercel.rs
Activates when vercel or @vercel/config is a dependency (matching the reproduction case's ).
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Fallow should treat Vercel programmatic config files as used config entrypoints when Vercel is active.
At minimum, the Vercel plugin/config detection should mark these app-root files as always used:
vercel.ts
vercel.js
vercel.mjs
vercel.cjs
vercel.mts
A fix could add these to the relevant Vercel plugin config/always-used patterns, similar to how other framework config files are protected from unused-file reporting.
Fallow version
2.85.0
Operating system
macOS
Configuration
Interface
No new interfaces are introduced.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work.
For example, if you made a mistake and want to revert your changes, you can use git checkout <file> to restore the file to its original state.
You can also reset all changes in the repository using git reset --hard command.
Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later.
Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands.
However you don't need to use git add or git commit before submitting your changes. In fact,
submit only submits currently unstaged changes because it uses git diff to get the changes that need to be submitted.
CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
If an error was reported in the issue description, I have successfully reproduced it.
If an error was reported in the issue description, I have confirmed that my fix resolves the error.
I have thought about edge cases and made sure my fix handles them as well.
I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass.
I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /fallow, current file: none) bash-$
devDependencies
Marks vercel.ts, vercel.js, vercel.mjs, vercel.cjs, and vercel.mts as always_used, so they're treated as reachable config entrypoints rather than unused files — mirroring how SentryPlugin/WranglerPlugin already protect their own convention-discovered config files.
Includes unit tests validating activation and the always-used glob coverage.
Wiring changes:
crates/core/src/plugins/mod.rs: registered the vercel module.
crates/core/src/plugins/registry/builtin.rs: imported VercelPlugin and added it to the "Deployment" category of create_builtin_plugins().
CHANGELOG.md: added a ### Fixed entry under [Unreleased] documenting the fix.
Checklist review
Reproduced the reported error: Yes — built a monorepo fixture (apps/web/vercel.ts with the exact package.json from the issue) and confirmed fallow dead-code reported apps/web/vercel.ts as an unused file before the fix (verified via git stash).
Confirmed the fix resolves it: Yes — after the fix, the same fixture shows vercel.ts counted as a "plugin" entry point and ✓ No issues found.
Edge cases considered: Tested all five documented extensions (ts, js, mjs, cjs, mts), a single-package (non-monorepo) root project, and activation via @vercel/config alone (without the vercel CLI package) — all worked correctly. The workspace-prefixing mechanism already used by other plugins (e.g. Wrangler) correctly scopes the always-used pattern to each package's own vercel.*, so it doesn't leak across unrelated workspace packages.
Ran existing tests: cargo test -p fallow-core (2465 passed) and cargo test -p fallow-cli (all passed except one pre-existing unrelated flaky/environment-dependent test — fix_batch_aborts_when_a_target_directory_is_read_only, which fails identically on the unmodified codebase because the sandbox runs as root and ignores read-only permissions — and one confirmed-flaky test that passed on rerun). Also ran cargo clippy -D warnings and cargo fmt --check clean on the touched crate.