Introduction
In essence, publishing an npm package is just one command, but there are some things that you have to take care of before d...
For further actions, you may consider blocking this person and/or reporting abuse
Great post! I like posts like this that get straight to the nitty-gritty of how to get things done.
Just a word of warning though, since you have both
.gitignore
and.npmignore
as steps: these actually can conflict with each-other, and NPM will let.npmignore
completely overwrite rules in.gitignore
.For example, if you ignore a password file in
.gitignore
, but then add a completely empty.npmignore
file, the passwords will still end up in your published package (but not on Github).You're right, this could potentially lead to confusion, but I think that this is intended behaviour.
The .gitignore file is only for choosing what doesn't get commited to your git repository and .npmignore lets you specify what shouldn't get published to npm.
π Yeah, I like that description of the differences!
Good post π
Also for mention, it would be preferable to don't publish from a local repository, but from a CI platform instead.
For (my) open-source libs I've automatized some steps by using another open-source lib I've created for publishing via GH release tags π
Take a look and feel free to contribute
npmjs.com/package/versiona
Great work! I'll check it out :)
Too much overhead for now, unfortunately. Hope in 2021 it would be much easier.
Let us know in 2021 :)
With pleasure :-)
I wrote a pretty comprehensive post of how to automate this in gitlab ci.
vgarcia.dev/blog/2019-11-06--publi...
In case anyone's interested.
It covers typescript, testing, and using semantic release.
I love posts like this
Good post. Direct and concise. Thanks a lot! :)