Description
Dub historically accepted package.json as a recipe filename (same name npm uses). Overlapping keys (name, version, dependencies) make heuristics brittle. Related work already refuses obvious npm files (#3118, #3136) and discusses deprecating the alias (#789).
Proposal
Beyond deny-lists of foreign keys: require (or strongly prefer) an explicit ecosystem claim when loading a file named package.json, for example:
{
"packageFormat": "dub",
"name": "my-pkg",
"targetType": "library"
}Suggested rules for Dub:
- Prefer
dub.json/dub.sdl(already true). - If the recipe file is named
package.jsonandpackageFormatis present:"dub"→ load as today- anything else → refuse with a clear error
- If
packageFormatis absent onpackage.json: keep today's legacy/heuristic path for a deprecation window, then refuse or ignore (so bare unclaimedpackage.jsonstops being treated as Dub by default).
Exact field name is negotiable (packageFormat, ecosystem, etc.). The point is a positive claim, not only "looks like npm."
Cross-ecosystem ask
The same field only helps if JS tooling documents a matching claim ("packageFormat": "npm" or equivalent). Filing this with Dub and with the OpenJS Package Metadata Interoperability group so both sides can pick one key.
Motivation
Mixed monorepo: Antora/npm package.json at repo root, Dub recipe under app/dub.json. Root dub build misread the npm file until heuristics / a root dub.json intervened. An explicit claim would make that class of failure obvious and tool-agnostic.
Activity
AMDphreak commentedon Jul 25, 2026
Cross-posted for coordination:
Geod24 commentedon Jul 26, 2026
We're just going to drop
package.jsonand rely entirely ondub.json.