-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm maintained module naming conventions #369
Comments
npmoss seems like a strange name to me; all the packages discussed here are OSS. Why not “npm” or “npmjs”? |
|
Everything in npmcli falls into that category too :-) it’s not for npm to declare that only npm can find its open source software useful. |
No, it's not, but there is a clear and distinct separation between modules that are only capable of working on npm related tasks and those that are valuable to anyone. For example make-fetch-happen is just a fetch implementation with caching and retries, while npm-registry-fetch is specifically for fetching package data from an npm registry |
npm-related tasks are automatically valuable to everyone. |
Update (07/26/2021)Decisions/outcomes from internal conversation
|
the npm cli team is responsible for maintenance of a rather large number of modules, these range from truly general purpose, to literal npm cli implementations of commands and anywhere in between. listed below are a few examples.
general purpose:
for npm (cli or packages) specifically, but have outside use cases:
literal npm cli command implementations:
it's clear that overall these package names do not follow a consistent convention, and in some cases the inclusion (or exclusion) of a scope may imply meaning to the package that is undesirable. for example the name
@npmcli/promise-spawn
seems to imply the module is specifically for the npm cli, while in reality it is nothing more than a wrapper aroundchild_process.spawn()
that returns a promise and is very widely useful.to that end, we should introduce another scope
@npmoss
and formalize in writing how we determine which scope to place a module in.@npmoss
: truly general purpose modules, such as@npmcli/promise-spawn
andmake-fetch-happen
@npmcli
: modules that are specific to the npm cli or npm packages, such as@npmcli/arborst
,libnpmpublish
, andpacote
while this is easy to adopt for net new packages, it does also mean that quite a few packages will have to be categorized and renamed for their new scopes. when renaming, we should select a scope based on the module's documented purpose and then consider if further name changes are warranted for clarity or simplification.
as an example,
make-fetch-happen
is a truly general purposefetch
implementation with retries and caching that can be used for any purpose and so belongs in@npmoss
. in addition the full package name is to avoid collisions in the unscoped namespace, but moving it to a scope removes that limitation allowing us to sensibly name it@npmoss/fetch
.packages such as
libpmpublish
are literal cli command implementations so belong in@npmcli
, and due to the scope we no longer need to specify that they're for npm, so a sensible new name would be@npmcli/libpublish
.TL;DR
we should:
@npmoss
scope@npmoss
scope, consider renaming further for clarity.@npmcli
scope, consider renaming further for clarity.there will be some exceptions to these guidelines, such as
tar
which was written to support the npm cli and is highly general purpose, but is already named the best possible thing.Bike shed
is
@npmoss
the right name for the new scope? some alternatives:@npmutils
,@npm-utils
(we'd also make@npm-cli
for consistency),@npm-oss
(also with@npm-cli
),@npmjs
The text was updated successfully, but these errors were encountered: