Skip to content

Commit b64e2b8

Browse files
committed
chore(repo): Add publish and monorepo setup docs
1 parent d131086 commit b64e2b8

4 files changed

Lines changed: 38 additions & 2 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,9 @@ For package specific details on installation, architecture and usage usage, you
3838
- [`@clerk/clerk-sdk-node`](https://github.com/clerkinc/javascript/tree/main/packages/sdk-node): SDK for native Node.js environment and frameworks.
3939

4040
Additionally there are packages which act as shared utilities or building blocks.
41+
42+
## Setup
43+
- Clone the repository.
44+
- `npm install`.
45+
46+
\* See the [docs folder](./docs) for additional repository documentation.

docs/MONOREPO.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Monorepo setup
2+
3+
The current monorepo setup is based on:
4+
- [Lerna](https://github.com/lerna/lerna) used mostly for task running and versioning.
5+
- [npm workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces) used for package linking.
6+
7+
## A note on commit messages
8+
The processes required for Lerna to manage releases and changelogs is done through the [conventional-commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
9+
10+
## TODOs / Next steps
11+
- Add [turborepo](https://turborepo.org/docs/guides/migrate-from-lerna) for performance optimizations.
12+
- Add GitHub releases using the `--create-release` option.
13+
- Document the process for `beta` and `pre` versions.

docs/PUBLISH.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Publishing packages
2+
3+
_Version updates and publishing is managed using Lerna._
4+
5+
After all the features have been merged and we want to create a new release, we use `npm run bump`.
6+
7+
This script will use `lerna version` to check which packages need to be updated and in what way based on the updates since the previous release.
8+
9+
The command will guide you through the version changes that are detected and will:
10+
- Bump the package versions.
11+
- Create new tags and a "release" commit.
12+
- Push the commit and tags to the origin.
13+
14+
After that is done, and all seems valid, you can run `npm run release` which will go through the publish process of the packages included in the release commit.
15+
16+
\*For more info you can check the [lerna version](https://github.com/lerna/lerna/tree/main/commands/version) and [lerna publish](https://github.com/lerna/lerna/tree/main/commands/publish) documentation.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
},
3030
"scripts": {
3131
"lint-fix": "eslint . --ext .ts",
32-
"bump": "lerna version --no-push",
32+
"bump": "lerna version --conventional-commits",
33+
"release": "lerna publish from-git",
3334
"build": "lerna run build",
3435
"test": "lerna run test",
3536
"prepare": "husky install"
@@ -38,4 +39,4 @@
3839
"node": ">=16.8.0",
3940
"npm": ">=8"
4041
}
41-
}
42+
}

0 commit comments

Comments
 (0)