Over the past couple of weeks, I've been working on cli-ssg, which is a command line tool to generate a website using .txt
/.md
files. A lot of changes had accumulated, and this was the perfect time to create an official release 1.0.0
.
Tagging the release
Firstly, as cli-ssg
was sitting at v0.1
, I used npm-version to bump it up:
npm version major
This changed the version in package.json
and package-lock.json
to:
"version": "1.0.1"
Then, I updated the README.md
and proceeded to create a git tag
using:
git tag -a v1.0.0 -m "Release 1.0"
At this point, I pushed my changes to GitHub but to my surprise the tags would not show up. After some digging, I realized that tags need to be pushed explicitly, so I used:
git push --tags origin
This fixed the problem, and I was finally able to create a release:
Publishing to npm
Before one can publish a package to npm
, you need to create an account and sign into npm using
npm adduser
Since I already had this setup, I proceeded to publish my package using npm-publish:
npm publish
This published cli-ssg
to the public registry and I could now view it on npm
:
https://www.npmjs.com/package/cli-ssg
Installing and testing through npm
While, everything looked great online, I wanted to ensure that users could install it through npm
and the functionality worked as expected. And after some testing, as expected, everything works!
To use the package, users can now simply type:
npm i cli-ssg
Once npm
installs it, the users can use all the features, for example:
cli-ssg -i "sample_input_file.md"
More examples can be found in our docs!
References
GitHub
: https://github.com/dhillonks/cli-ssg
npm
: https://www.npmjs.com/package/cli-ssg
Top comments (0)