Closed m90 closed 3 years ago
Publishing is out of scope for Studio Changes. It hooks into the version command and whether you actually publish to a registry or not is up to you to define in the postversion
script.
We could add this flag for the init
command, but I'm not sure whether it makes sense to maintain an edge case like this.
How about generating --access
automatically if a package has a scoped name and private: false
?
We could add this flag for the init command, but I'm not sure whether it makes sense to maintain an edge case like this.
Yeah, this PR is nothing more but an additional flag for the init command.
How about generating --access automatically if a package has a scoped name and private: false?
I think that sounds like a brilliant idea. Would you keep the flag for --init
too or remove it again?
How about generating --access automatically if a package has a scoped name and private: false?
I added this.
Let me know if you want to keep the flag or if it should be removed (I'm mostly impartial about it).
If you can think of a case where the automatic --access
generation would not be sufficient, we can keep the flag. Otherwise I'd remove it to keep things simple.
If you can think of a case where the automatic --access generation would not be sufficient, we can keep the flag. Otherwise I'd remove it to keep things simple.
Not really, I think inferring this from package.json is enough, i.e. I removed the flag.
📦 This has been published as v2.2.0
.
Thank you! 🙏
N.B.: This PR might not even be needed, but I noticed that after opening it :sweat_smile:
I use @studio/changes for some projects and always just copied over my npm scripts from the previous project. For the last package I just ran into the following situation:
@foo/pkg
) and public--init
with default optionsprivate: false
in package.json made no difference--access public
This PR would allow users to pass through a non-default
access
level tonpm publish
.The one thing I do not understand however: this very package (
@studio/changes
) does not pass--access public
when publishing, nor does it specifyprivate
in package.json. How does it work here?Documentation on
--access
can be found here: https://docs.npmjs.com/cli/v7/commands/npm-publish#description