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: CONTRIBUTING.md
+72-19Lines changed: 72 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ Our examples are spread out across multiple projects depending on where the core
41
41
We have various deck scenarios in `examples` in this repository that are part of the development process.
42
42
43
43
We follow the convention of `start:NAME` to run an in-memory dev server for a specific
44
-
example, but we also have a `pnpm run build-examples` script task to make sure we're actually
44
+
example, but we also have a `pnpm run build:examples` script task to make sure we're actually
45
45
producing non-broken sample presentations as a CI / assurance test.
46
46
47
47
#### `examples/js`
@@ -94,7 +94,7 @@ $ pnpm run start:one-page
94
94
95
95
**Note**: This file is published and used by `spectacle-cli`.
96
96
97
-
**Development Note**: This JS code portion of this file is programmatically updated from the source in `examples/js/index.js` directly into `one-page.html`. Rather than editing directly, please run `pnpm run build-one-page` and verify changes look good.
97
+
**Development Note**: This JS code portion of this file is programmatically updated from the source in `examples/js/index.js` directly into `one-page.html`. Rather than editing directly, please run `pnpm run build:one-page` and verify changes look good.
98
98
99
99
### Examples integration with `spectacle-cli`
100
100
@@ -141,14 +141,14 @@ To check (and fix) code:
141
141
142
142
```bash
143
143
$ pnpm run lint
144
-
$ pnpm run lint-fix
144
+
$ pnpm run lint:fix
145
145
```
146
146
147
147
To check (and fix) formatting of MD, JSON, _and_ code:
148
148
149
149
```bash
150
-
$ pnpm run prettier-check
151
-
$ pnpm run prettier-fix
150
+
$ pnpm run prettier:check
151
+
$ pnpm run prettier:fix
152
152
```
153
153
154
154
We also have a simple one-liner for running both of these fix-checks back-to-back:
@@ -166,34 +166,87 @@ Thanks for taking the time to help us make Spectacle even better! Before you go
166
166
ahead and submit a PR, make sure that you have done the following:
167
167
168
168
- Run all checks using `pnpm run check-ci`.
169
-
- Run `pnpm run build-one-page` and check + commit changes to `examples/one-page/index.html`
169
+
- Run `pnpm run build:one-page` and check + commit changes to `examples/one-page/index.html`
170
170
- Check that both the core library and _all_ examples build: `pnpm run build`.
171
+
- Add a [changeset](#changeset) if your PR requires a version change for any of the packages in this repo.
171
172
- Everything else included in our [pull request checklist](.github/PULL_REQUEST_TEMPLATE.md).
172
173
174
+
### Changesets
175
+
176
+
We use [changesets](https://github.com/changesets/changesets) to create package versions and publish them.
177
+
178
+
If your work contributes changes that require a change in version to any of the packages, add a changeset by running:
179
+
180
+
```bash
181
+
pnpm changeset
182
+
```
183
+
184
+
which will open an interactive CLI menu. Use this menu to select which packages need versioning, which semantic version changes are needed, and add appropriate messages accordingly.
185
+
186
+
After this, you'll see a new uncommitted file in `.changesets` that looks something like:
187
+
188
+
```
189
+
$ git status
190
+
# ....
191
+
Untracked files:
192
+
(use "git add <file>..." to include in what will be committed)
193
+
.changeset/flimsy-pandas-marry.md
194
+
```
195
+
196
+
Review this file, make any necessary adjustments, and commit the file to source. During the next package release, the changes (and changeset notes) will be automatically incorporated based on these changeset files.
197
+
173
198
### Releasing a new version to NPM
174
199
175
200
<details>
176
201
<summary>
177
202
<i>Only for project administrators</i>
178
203
</summary>
179
204
180
-
```sh
181
-
# (1) Update the Changelog, following format from previous versions
182
-
# and commit those changes independently of other updates
We use [changesets](https://github.com/changesets/changesets) to create package versions and publish them.
184
206
185
-
# (2) Run tests, lint, build published dir, update package.json
186
-
$ npm version [patch|minor|major|<version>]
207
+
Our official release path is to use automation (via GitHub actions) to perform the actual publishing of our packages. The steps are:
187
208
188
-
# (3) If all is well, publish the new version to the npm registry
189
-
$ npm publish
209
+
1. Developers add changesets, ideally as part of their PR that have version impacts.
210
+
2. On merge of a PR with a changeset file, our automation opens a "Version Packages" PR.
211
+
3. On merging the "Version Packages" PR, the automation system publishes the packages.
190
212
191
-
# (4) Then, update github with the associated tag
192
-
$ git push --tags && git push
193
-
```
213
+
This streamlines releasing to: ensuring PRs have changeset files added as necessary, and approving the "Version Packages" PR generated from GitHub actions to publish a release to all affected packages.
214
+
215
+
#### Manual Releases
216
+
217
+
For exceptional circumstances, here is a quick guide to manually publish from a local machine using changesets.
218
+
219
+
1. Add a changeset with `pnpm changeset`. Generate the changeset file, review it, and commit it.
220
+
2. Make a version. Due to our changelog formatting package you will need to create a personal token and pass it to the environment.
221
+
```shell
222
+
GITHUB_TOKEN=<INSERT TOKEN> pnpm run version
223
+
```
224
+
Review git changes, tweak, and commit.
225
+
3. Publish.
226
+
227
+
First, build necessary files:
228
+
229
+
```sh
230
+
pnpm run build
231
+
```
232
+
233
+
Then publish:
234
+
235
+
```sh
236
+
# Test things out first
237
+
$ pnpm -r publish --dry-run
238
+
239
+
# The real publish
240
+
$ pnpm changeset publish --otp=<insert otp code>
241
+
```
242
+
243
+
Note that publishing multiple pacakges via `changeset` to npm with an OTP code can often fail with `429 Too Many Requests` rate limiting error. Take a 5+ minute coffee break, then come back and try again.
244
+
245
+
Then issue the following to also push git tags:
194
246
195
-
Then, go and manually draft a release for your recently pushed tag with notes in
196
-
the [Github UI](https://github.com/FormidableLabs/spectacle/releases/new).
0 commit comments