manypkg icon indicating copy to clipboard operation
manypkg copied to clipboard

INVALID_PACKAGE_NAME & empty root workspace name

Open kachkaev opened this issue 1 year ago • 1 comments

👋 folks!

I wonder if you would be interested in a small change to INVALID_PACKAGE_NAME.ts. The rule is triggered even if the root workspace is not named, but turning this rule off makes all workspace names non-lintable.

We could allow root package name to be empty. It's not referred to from other namespaces and not published on npm, so the name is not used anywhere in practice.

Suggestion:

https://github.com/Thinkmill/manypkg/blob/a01efc9c25900b7d21b6d517a2021b021f8b3922/packages/cli/src/checks/INVALID_PACKAGE_NAME.ts#L14-L15

 validate: (workspace) => { 
-   if (!workspace.packageJson.name) { 
+   if (!workspace.packageJson.name && workspace.relativeDir !== ".") { 

WYDT?

kachkaev avatar Sep 01 '24 20:09 kachkaev

We could allow root package name to be empty. It's not referred to from other namespaces and not published on npm, so the name is not used anywhere in practice.

It's not used-used but IIRC some package managers still require it. Perhaps we could double-check which ones do and which ones don't and allow anonymous roots with those that don't. I'm not inclined to do that investigation myself though :p

Andarist avatar Sep 01 '24 22:09 Andarist