fix(license): resolve wrong version and missing license text - #23356
fix(license): resolve wrong version and missing license text#23356btea wants to merge 5 commits into
Conversation
bluwy
left a comment
There was a problem hiding this comment.
We use findNearestMainPackageData in many places to get a dependency's main package.json, so I don't think fixing only in the license plugin is right here.
We could put the fix directly in the findNearestMainPackageData, but will need to consider the possible breaking change of this in some setups, eg local workspace packages without version somehow.
But also, is putting the name in a nested package.json correct? Maybe it's harmless but worth checking if this is covered by the spec.
Yes, we use
A nested package.json starts a new package scope, but Node only reads type/main/exports/imports from it—name only matters to Node for self-reference via exports, which markers don't have. So a nested name is a community convention with no spec-defined semantics, making name + version a fair heuristic for the real package root. https://nodejs.org/api/packages.html#introduction |
|
Node only reads type/main for nested package.json from nodejs/node#58827. I also tested and pnpm seems to allow workspace packages without version to be linked, e.g. via So if we want to check both name + version, I think this might affect some workspace setups. Also, name + version doesn't necessarily match the root if you encounter packages like these (don't know why they publish that way). So I think the solution to this comes down to tradeoffs. Checking by I'd prefer investigating if we can fix for |
|
That makes sense. Let's verify and proceed step by step. |
|
/ecosystem-ci run |
@vitejs/plugin-legacy
vite
commit: |
|
📝 Ran ecosystem CI on
✅ nitro, analogjs, astro, laravel, marko, vike, quasar, vite-plugin-pwa, module-federation, unocss, vite-setup-catalogue, tanstack-start, vite-plugin-vue, nuxt, vite-plugin-svelte, vite-plugin-cloudflare, vinext, vitepress, vuepress, vite-plugin-react |
fix #23355