-
Notifications
You must be signed in to change notification settings - Fork 145
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
Publishing Strategy for PkgJS packages #410
Comments
What would be the advantages of dual publishing? |
I personally would always use EDIT: and to be clear, I would be a fan of just publishing under the scope, but if there are blockers to that I would rather be pragmatic. |
If we did that, I'd expect |
Yeah, I am also fine with that. @dominykas proposed the other way around, but since I would like to use the |
I'm confused, why would you care whether you use the scoped or unscoped version? |
Well, I would prefer we never publish anything under the global scope (as in perhaps in the future it shouldn't exist). It is traditionally harder to manage access, discovery, and configuration with multiple registries. I recognize that I am not making a strong case, nor do I care to sell folks on my vision for this. So, if there are strong and compelling reasons to use the global scope (like npx issues, or UX of not typing the scope in a cli) then I think we should use it, but for me I would prefer to have orgs and scopes for things with shared ownership like this. |
That seems like a relatively uncompelling reason to me to add a bunch of complexity by having to manage two packages. The global scope will always exist, and new packages will continue to be created in it. Unscoped packages can be managed by npm orgs identically as well as scoped ones; as far as I'm aware the difference only appears with non-public packages, or with the local "registry per scope" feature that requires a scope. |
This is why I phrased it above as "traditionally harder". This feature is relatively new and was a concern which is not applicable anymore. It still does mean the extra step of moving it under the org after the first publish. But I agree, this is not a compelling reason.
This also is something which will become a historical side note when npm/rfcs#217 lands. |
Agree on that
I agree on dual publishing since exposing the content of a package could lead to misbehaviour - if
Could a GHaction do the work? |
My preferences are (in order)
Edited to remove dual publish as I agree its more likely to cause problems than help. |
I don't think dual publishing ever makes sense - I think the proper thing to do if we want two packages is have one of them be the source of truth, and the other be a thin wrapper. There should never be two sources of truth. My preference, thus, is:
|
Ok, so would guidance like this be agreeable to everyone?
The extra step will be required if teams decide to use the global scope, but we will land back with simple permission management via the org. In addition to this, we should consider how we indicate the package is managed by the PMWG/Node.js project. This is one of the benefits of using the |
What I typically do is create a user for the dual purpose of being a backup owner, as well as a visible link between org packages, to be an owner on all of the org's packages. |
So, the issue with scoped packages and
Either way, if you're exposing a And if you're going to squat a globally scoped package, then you may as well just publish the whole thing there and save people some typing. I don't have a strong opinion about dual publishing, but if it's just doing it for the sake of having everything under a scope, then I'm not sure that's a worthy goal. Some might argue that this needs to be fixed in |
Note that any package can expose any bin name it wants - if there's a bin conflict in your graph, you've got an unsolved problem. Using scoped packages doesn't alter this landscape (except perhaps that if you've never tested your scoped package and you've chosen a scoped bin name, which i expect to be quite uncommon, then you might not realize the conflict exists). |
Yup, the bin collisions are an old problem. I'm just highlighting the fact, that |
This sounds like something we need to work with npm on. Also, since this has moved into npm directly for npm@7 (along with changed behaviors) we should make sure this is still the behavior. @darcyclarke @ruyadorno @isaacs? |
And for this, we should use the the openjs user, right? |
Its currently https://www.npmjs.com/~nodejs-foundation which is used as the backup user for Node.js modules like node-addon-api |
Let's recap this during a meeting and see if we can close this? |
To recap: maintainers are free to choose what makes the most sense for their packages. Publish scoped or on the global. Last remaining item is to document the fact that ownership has to be transferred when new packages are published. I will look for where to add it and submit a PR later today. Done: #419 |
Also, ensure required 2fa is enabled on the packages when you onboard them. |
#419 is merged - closing this, please reopen if there's anything else we need to address. |
I would like to propose that we publish all PkgJS projects under the npm scope
@pkgjs
. We can dual publish on the global scope, but I think there is value in also always publishing under@pkgjs
. There are approaches we could take to the dual publish, but I first wanted to align on the naming.The text was updated successfully, but these errors were encountered: