Skip to content

Commit fb8af47

Browse files
committed
Document build commands and release process
1 parent 704aa14 commit fb8af47

2 files changed

Lines changed: 38 additions & 4 deletions

File tree

CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ To run the integration tests (requires an `ABLY_API_KEY` environment variable):
2323
npm run test:integration
2424
```
2525

26+
## Building
27+
28+
```shell
29+
npm run build # Build all entry points
30+
npm run build:core # Build core entry point only
31+
npm run build:react # Build react entry point only
32+
npm run build:vercel # Build vercel entry point only
33+
npm run build:vercel-react # Build vercel/react entry point only
34+
```
35+
36+
The build uses Vite library mode producing ESM + UMD/CJS bundles with `.d.ts` declarations and sourcemaps in `dist/`.
37+
2638
## Formatting and linting
2739

2840
This repository uses Prettier and ESLint for formatting and linting respectively. The rules are enforced in CI, so please make sure you run the checks before pushing your code:
@@ -34,3 +46,24 @@ npm run lint:fix # Check for linting errors and fix
3446
npm run typecheck # Type check
3547
npm run precommit # Run all checks (format, lint, typecheck)
3648
```
49+
50+
## Release process
51+
52+
1. Ensure tests pass in CI on `main`.
53+
2. Create a new branch for the release (e.g., `release/0.0.1`).
54+
3. Choose the new version following [Semantic Versioning](https://semver.org/) (M.m.p):
55+
- Major: breaking changes requiring action from consumers.
56+
- Minor: new functionality or features.
57+
- Patch: bug fixes requiring no action from consumers.
58+
4. Add a version commit with the following changes:
59+
1. Update the `version` field in `package.json`.
60+
2. Run `npm install` at the repo root to update `package-lock.json`.
61+
3. Delete `node_modules` in each app under `demo/` and run `npm install` there to pick up the new version.
62+
4. Update `CHANGELOG.md` with customer-affecting changes since the last release.
63+
5. Open a PR, get it reviewed and merged to `main`.
64+
6. Create a [GitHub release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release):
65+
- Tag: use the version without a `v` prefix (e.g., `0.0.1`).
66+
- Release title: use a `v` prefix (e.g., `v0.0.1`).
67+
- Use the "Generate release notes" button to populate the description and edit as needed.
68+
7. Verify the npm publish workflow (`release.yml`) completes successfully.
69+
8. Update the [Ably Changelog](https://changelog.ably.com/) (via [Headway](https://headwayapp.co/)) with the release notes.

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,12 @@ Working demo applications live in the [`demo/`](./demo/) directory:
396396

397397
```bash
398398
npm install
399-
npm run typecheck # Type check
400-
npm run lint # Lint
401-
npm test # Unit tests (mocks only)
399+
npm run build # Build all entry points (ESM + UMD/CJS + .d.ts)
400+
npm run typecheck # Type check
401+
npm run lint # Lint
402+
npm test # Unit tests (mocks only)
402403
npm run test:integration # Integration tests (needs ABLY_API_KEY)
403-
npm run precommit # format:check + lint + typecheck
404+
npm run precommit # format:check + lint + typecheck
404405
```
405406

406407
### Project structure

0 commit comments

Comments
 (0)