If you plan to contribute back to this repo, please fork & open a PR.
We use conventional-changelog for commit messages. For committing changes, we recommend using a wizard:
yarn commit
If you prefer using git
, try installing commitizen
utility:
npm install commitizen -g
Then you can use a simple alias for generating commit messages:
git cz
If you prefer using VSCode, try using VSCode Commitizen extension.
- Clone this repo to wherever you want:
git clone https://github.com/wix-incubator/autoviews.git
- Go into the repo folder:
cd autoviews
- Install dependencies (Node.js and
yarn
are required):yarn
To develop core library locally start test server:
yarn workspace @autoviews/core test:watch
Write tests and add new functionality.
To start development server in for docs, run:
# Go to website folder
cd website
# Start development server
yarn start
Note: the website is dependent on the core package and requires a build of the core package.
We use lerna
for releases. Releases are generated automatically by CI most of the time, but can also be done manually.
By default, releases are completely automated. Upon every commit to the master
branch a new release job will be triggered. The job will:
- Determine the next version number based on the commit messages since the last release.
- Bump the version of the package according to the commit message.
- Generate a changelog based on the commit messages.
- Create a new tag and release on GitHub with release notes.
- Publish the packages to npm.
- Create a release commit with the updated version number.
This process happens automatically and requires no manual intervention. Just merge your changes to the master
branch.
If necessary, you can make a manual release. Here's how:
First, you have to obtain a GitHub token (under Settings > Developer settings > Personal access tokens), please give it repo:public_repo
scope. This token is required to create a release on GitHub.
Make this token available to the release script by setting it as an environment variable somewhere in your .bashrc
or .zshrc
:
export GH_TOKEN='<your_token_here>'
Alternatively, you can also use a GitHub CLI to generate and store your token automatically:
# Login to GitHub CLI with token (choose token method when prompted)
gh auth login
# After logging in, you can use the token in the release script
GH_TOKEN=$(gh auth token) yarn release
When you have a GitHub token, you can run the release script:
yarn release
# or
yarn lerna publish
You can pass additional flags to the script to customize the release:
You can also create pre-releases. You need to have GH_TOKEN
set in your environment.
You can create a pre-release from a beta
, alpha
or next
branches. Here's an example of creating a beta
pre-release:
yarn release --conventional-prerelease --preid beta
You can omit the --preid
flag to create a alpha
pre-release. More info of how --conventional-prerelease
works.
After creating a pre-release, you can just push to the beta
, alpha
, next
and the next pre-release version will be published automatically.
When you've finished testing a pre-release, you can graduate it to a stable release. Here's an example of graduating a beta
pre-release to a stable release:
Merge beta
branch to master
and run:
yarn release --conventional-graduate
This will automatically graduate the pre-release to a stable release. More info of how --conventional-graduate
works