You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-8Lines changed: 25 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,21 +65,38 @@ $ yarn
65
65
$ yarn build
66
66
```
67
67
68
-
### Versioning a package
68
+
### Versioning and publishing packages
69
69
70
-
To version a package, run the following command from the root of the repository:
70
+
We use [changesets](https://github.com/changesets/changesets) to manage package versioning, this ensures that all packages are versioned together in a consistent manner and helps with generating changelogs.
71
+
72
+
#### Step 1: Creating a changeset
73
+
74
+
A changeset is a file that describes the changes that have been made to the packages in the repository. To create a changeset, run the following command from the root of the repository:
71
75
72
76
```bash
73
-
# Change directory to the package you want to version
74
-
$ cd packages/<package-name>
77
+
$ yarn changeset
78
+
```
79
+
80
+
Changeset files are stored in the `.changeset` directory until they are packaged into a release. You can commit these files and even merge them into your main branch without publishing a release.
81
+
82
+
#### Step 2: Creating a package release
83
+
84
+
When you are ready to create a new package release, run the following command to package all changesets, this will also bump package versions and dependencies:
75
85
76
-
# Bump the version
77
-
$ yarn version <major|minor|patch>
86
+
```bash
87
+
$ yarn changeset version
78
88
```
79
89
80
-
__Note on cross referenced packages__: Bumping the version of a package that is cross referenced by another package will automatically bump the dependency version in the other package. For example, if you bump the version of `sdk` from `0.0.1` to `0.0.2`, the required version of `sdk` in the `contracts` package will automatically be bumped to `0.0.2`. Depending on the nature of the change you might need to bump (and publish) a new version of the `contracts` package as well.
90
+
### Step 3: Tagging the release
91
+
92
+
After creating a package release, you will need to tag the release commit with the version number. To do this, run the following command from the root of the repository:
93
+
94
+
```bash
95
+
$ yarn changeset tag
96
+
$ git push --follow-tags
97
+
```
81
98
82
-
###Publishing a package
99
+
#### Step 4: Publishing a package release
83
100
84
101
Packages are published and distributed via NPM. To publish a package, run the following command from the root of the repository:
0 commit comments