Skip to content

Latest commit

 

History

History
65 lines (47 loc) · 2.8 KB

CONTRIBUTING.MD

File metadata and controls

65 lines (47 loc) · 2.8 KB

Contributing

Thanks for your willingness to contribute!

Please check open issues. Please respond to questions/bug reports/feature requests!

Project setup

  1. Fork and clone the repo
  2. Run npm install to install dependencies. This also downloads the specmatic.jar file of the version specified in src/config.ts.
  3. Create a branch for your PR with git checkout -b your-branch-name

Tip: Keep your master branch pointing at the original repository and make pull requests from branches on your fork. To do this, run:

git remote add upstream https://github.com/znsio/specmatic-node.git
git fetch upstream
git branch --set-upstream-to=upstream/master master

This will add the original repository as a "remote" called "upstream," Then fetch the git information from that remote, then set your local master branch to use the upstream master branch whenever you run git pull. Then you can make all of your pull request branches based on this master branch. Whenever you want to update your version of master, do a regular git pull.

Committing and Pushing changes

Please make sure to run the tests before you commit your changes by using the command

npm test

Build the dist files locally once to make sure build works

npm run build

Finally commit

Publishing a new version to npm

Prerequisites

  • Push access to master branch
  • Node version 14 or higher

Step 1: Updating specmatic jar version

If the specmatic jar version is to be updated, modify the specmaticVersion property in package.json accordingly and check it in.

Step 2: Make a release via github releases

  • Goto github releases and draft a new release
  • Click choose a tag and enter the required version. If the tag exists then you might be releasing a wrong version. Reverify the tag and version number. Ideally the tag should not exist as this is a new version and thus you should be presented with option to + Create new tag: <version> on publish option. Click it.
  • Give a release title of format v<version>.
  • Describe the changes in this release briefly
  • You can either save this draft and come back later to publish it or publish it now.
  • On publish, a github action is triggered that updates the release on npm repository.

You can check the publish status in github actions. Though, it might take some time to reflect in the specmatic npm page because of the npm caching.

Developer notes

Building npm locally

  • npm run build
  • npm pack
  • And use the generated ".tgz" file with "file:.tgz"
  • Be sure to run npm remove before specmatic before installing the tgz file