UNPKG

3.3 kBMarkdownView Raw
1# Chromatic CLI
2
3Publishes your Storybook to Chromatic and kicks off tests if they're enabled.
4
5<img width="100%" src="https://user-images.githubusercontent.com/321738/82901859-d820ec80-9f5e-11ea-81e7-78d494c103ad.gif" alt="">
6
7<a href="https://www.npmjs.com/package/chromatic">
8 <img src="https://badgen.net/npm/v/chromatic" alt="Published on npm">
9</a>
10<a href="https://www.chromatic.com/builds?appId=5d67dc0374b2e300209c41e7">
11 <img src="https://badgen.net/badge/tested%20with/chromatic/fc521f" alt="Tested with Chromatic">
12</a>
13
14## Documentation
15
16👉 Read the [Chromatic CLI docs](https://www.chromatic.com/docs/cli)
17
18đź“ť View the [Changelog](https://github.com/chromaui/chromatic-cli/blob/master/CHANGELOG.md#readme)
19
20## Contributing
21
22Contributions of any kind are welcome! We're available to chat via the Intercom widget on the documentation site.
23
24### Compatibility & versioning
25
26Compatibility is guaranteed between this package and Chromatic like so:
27
28- Production Chromatic ensures it’s compatible with what’s on npm
29- What's on the master branch is equal to what's published on npm
30- This package ensures it’s compatible with production Chromatic
31
32To facilitate upgrading in the future, removing and adding features, this is the process:
33
34- Any new features will have to be on Chromatic production before they could be used in this package
35- We can add feature flags to be able to test new functionality
36- Chromatic production can not remove any features this package depends on until after the usage has been removed from this package in addition to a grace period to allow users to upgrade
37
38### Publishing a new version to npm
39
40Before publishing, make sure you've done the following:
41
42- `yarn build`
43- Updated CHANGELOG.md
44- Committed and pushed everything
45- Decide on the proper semver bump (major/minor/patch)
46
47#### Doing a `canary` or `next` release
48
49We have two types of pre-releases: `canary` and `next`. `canary` releases are intended for development purposes and should not be used in production, as they may only work against a staging or dev environment. `next` releases should be valid, working releases that can potentially be used by early adopters of new features, for example to handle a support request.
50
51> As a consumer, **you should not specify a tag** (e.g. `chromatic@next`) in your package dependencies, but rather a specific version number (e.g. `chromatic@5.6.2-next.0`). Otherwise you'll end up with a broken build when we remove or update the tag.
52
53For the first `canary` (or `next`) release, bump the version like so (depending on the semver bump):
54
55```sh
56npm version <premajor|preminor|prepatch> --preid canary
57```
58
59For consecutive `canary` releases on the same version:
60
61```sh
62npm version prerelease --preid=canary
63```
64
65Then push and publish:
66
67```sh
68git push --follow-tags
69npm publish --tag canary
70```
71
72Make sure to replace `canary` with `next` if appropriate.
73
74#### Doing a `latest` release
75
76A final release is automatically tagged `latest` by npm.
77
78```sh
79npm version <major|minor|patch>
80git push --follow-tags
81npm publish
82```
83
84And finally, remove the `canary` and/or `next` tag, if any:
85
86```
87npm dist-tag rm chromatic canary
88```
89
90This ensures we can safely do a new `canary` or `next` release later, without anyone getting an unexpected update.