Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore(repo): Add publish and monorepo setup docs
  • Loading branch information
igneel64 committed Jan 13, 2022
commit b64e2b8db548a85575ecef13f365a0f5b289fa54
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,9 @@ For package specific details on installation, architecture and usage usage, you
- [`@clerk/clerk-sdk-node`](https://github.com/clerkinc/javascript/tree/main/packages/sdk-node): SDK for native Node.js environment and frameworks.

Additionally there are packages which act as shared utilities or building blocks.

## Setup
- Clone the repository.
- `npm install`.

\* See the [docs folder](./docs) for additional repository documentation.
13 changes: 13 additions & 0 deletions docs/MONOREPO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Monorepo setup

The current monorepo setup is based on:
- [Lerna](https://github.com/lerna/lerna) used mostly for task running and versioning.
- [npm workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces) used for package linking.

## A note on commit messages
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.

## TODOs / Next steps
- Add [turborepo](https://turborepo.org/docs/guides/migrate-from-lerna) for performance optimizations.
- Add GitHub releases using the `--create-release` option.
- Document the process for `beta` and `pre` versions.
16 changes: 16 additions & 0 deletions docs/PUBLISH.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Publishing packages

_Version updates and publishing is managed using Lerna._

After all the features have been merged and we want to create a new release, we use `npm run bump`.

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.

The command will guide you through the version changes that are detected and will:
- Bump the package versions.
- Create new tags and a "release" commit.
- Push the commit and tags to the origin.

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.

\*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.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
},
"scripts": {
"lint-fix": "eslint . --ext .ts",
"bump": "lerna version --no-push",
"bump": "lerna version --conventional-commits",
"release": "lerna publish from-git",
"build": "lerna run build",
"test": "lerna run test",
"prepare": "husky install"
Expand All @@ -38,4 +39,4 @@
"node": ">=16.8.0",
"npm": ">=8"
}
}
}