Bojagi CLI requirements:
- React 16.8+
- Webpack 4+
- Node.js 12+
The @bojagi/cli CLI is to be installed within your repositories
$ yarn add -D @bojagi/cli
$ npm install --save-dev @bojagi/cli
$ yarn bojagi preview
$ npx bojagi preview
Opens a local preview of how stories render inside the Bojagi webapp.
The easiest way to do this is with the following command:
$ yarn bojagi deploy
$ npx bojagi deploy
This command does component analysis, builds the components with webpack and uploads them to Bojagi.
The above command works without specifying the commit. In the case your CI is not supported or the
commit couldn't be received through the
git client, use the
$ yarn bojagi deploy --commit commit-sha1-id
$ npx bojagi deploy --commit commit-sha1-id
deploy command is an all-in-one command that does the same as the following commands
Because of this, the
deploy command accepts all arguments, that you can pass to these commands. For more detailed descriptions see further below.
Going through the process step by step
In some cases you need to have more control over the
deploy process. For those cases, the process can be split into smaller subtasks with the following commands:
$ yarn bojagi build
$ npx bojagi build
build command scans the repository for stories and bundles the matching components. Currently, the supported module bundler is webpack.
$ yarn bojagi upload
$ npx bojagi upload
After the components build they can be uploaded. The
upload command optionally accepts the commit ID with the
The commit is automatically retrieved from the environment variables. When the commit can't be detected, it needs to be passed specifically.
Note that when specifying the commit via an argument, it overrides the commit detected from your CI or Git.
$ yarn bojagi scan
$ npx bojagi scan
Lists the number of found stories. Convenient when testing a custom storyPath configuration.