Skip to content

Commit 97aec26

Browse files
Jiří Fenclmjancarik
authored andcommitted
Migrate build and publish tooling from Lerna to NX and Changesets.
1 parent 79cd1fe commit 97aec26

50 files changed

Lines changed: 10245 additions & 20616 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@2.1.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "master",
9+
"updateInternalDependencies": "minor",
10+
"ignore": [],
11+
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
12+
"onlyUpdatePeerDependentsWhenOutOfRange": true
13+
}
14+
}

.changeset/curly-books-knock.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
"@merkur/integration-custom-element": patch
3+
"@merkur/plugin-session-storage": patch
4+
"@merkur/plugin-graphql-client": patch
5+
"@merkur/plugin-css-scrambler": patch
6+
"@merkur/plugin-event-emitter": patch
7+
"@merkur/plugin-select-preact": patch
8+
"@merkur/plugin-http-client": patch
9+
"@merkur/integration-react": patch
10+
"@merkur/plugin-http-cache": patch
11+
"@merkur/plugin-component": patch
12+
"@merkur/tool-storybook": patch
13+
"@merkur/create-widget": patch
14+
"@merkur/plugin-router": patch
15+
"@merkur/plugin-validation": patch
16+
"@merkur/plugin-error": patch
17+
"@merkur/tool-webpack": patch
18+
"@merkur/integration": patch
19+
"@merkur/preact": patch
20+
"@merkur/svelte": patch
21+
"@merkur/tools": patch
22+
"@merkur/uhtml": patch
23+
"@merkur/core": patch
24+
"@merkur/cli": patch
25+
---
26+
27+
Migrate build and publish tooling from Lerna to NX and Changesets.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ es/
99
lib/
1010
coverage/
1111
current-changelog.txt
12+
.nx
1213
!packages/create-widget/template/src/lib

.husky/commit-msg

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ To check out [live demo](https://merkur.js.org/demo) and [docs](https://merkur.j
3838

3939
Contribute to this project via [Pull-Requests](https://github.com/mjancarik/merkur/pulls).
4040

41-
We are following [Conventional Commits Specification](https://www.conventionalcommits.org/en/v1.0.0/#summary). To simplify the commit process, you can use `npm run commit` command. It opens an interactive interface, which should help you with commit message composition.
41+
We are using [Changesets](https://github.com/changesets/changesets) for versioning and releasing. To add a changeset describing your changes, run `npm run changeset`.
42+
43+
> **Note:** The release process is documented **only** in this root README. Any per-package README sections that still describe a Lerna/Conventional Commits–based release flow are outdated and should be ignored in favour of the instructions below.
4244
4345

4446
### Release
@@ -48,32 +50,43 @@ To release a version you must have the right permissions, please contact one of
4850

4951
#### Regular version release
5052

51-
To do a regular release, in the root of the monorepo run:
53+
To do a regular release, from the `master` branch with no uncommitted changes, run:
5254

5355
```
5456
npm run release
5557
```
5658

57-
#### RC (preversion) release
58-
59-
1. From the specific package directory, use this `lerna version` command to bump package versions:
60-
```
61-
npx lerna version <preminor | prepatch | prerelease> --no-git-tag-version --no-push
62-
// prerelease increments the pre* version's last number, e.g. v0.44.0-rc.0 => v0.44.0-rc.1
63-
```
64-
- alternatively, manually change the version in the package's `package.json` and in `lerna.json`, and run `npm install` from the root of the monorepo.
65-
2. Restore all files not related to the package you intend to release. These files should remain:
66-
- the package's own `package.json`
67-
- `lerna.json` (otherwise lerna will stop incrementing the pre-version's number, for some reason)
68-
- `package-lock.json`
69-
3. Commit the changes (must still be a conventional commit. Suggested: `chore(release): publish`).
70-
4. Tag the commit with the version (e.g. `v0.44.0-rc.0`).
71-
5. Push the commit to the repo.
72-
6. Push the tag to the repo: `git push origin tag <tagname>` (e.g. `git push origin tag v0.44.0-rc.0`).
73-
74-
The packages are released from a GitHub Action that is triggered when a new version tag is pushed to the repository.
75-
76-
Before the actual release, it's safer to return all version numbers to the last stable version. Another option is to release from a separate branch, so your feature branch stays clean.
59+
This runs `release:prepare` (applies pending changesets, bumps versions, updates `package-lock.json`) followed by `release:push` (commits, tags, and pushes to the repository).
60+
61+
Packages are published from a GitHub Action triggered when a new version tag is pushed.
62+
63+
#### RC (pre-release) release
64+
65+
1. Enter pre-release mode (only needs to be done once per RC cycle):
66+
```
67+
npm run release:next:init
68+
```
69+
This sets pre-release mode to `rc`, so subsequent version bumps produce `rc` versions (e.g. `v0.44.0-rc.0`).
70+
71+
2. Add a changeset describing your changes:
72+
```
73+
npm run changeset
74+
```
75+
76+
3. Bump versions and push the RC release:
77+
```
78+
npm run release
79+
```
80+
Repeat steps 2–3 for each subsequent RC iteration (e.g. `rc.0 → rc.1`).
81+
82+
4. When ready to graduate to a stable release, exit pre-release mode and prepare the final version:
83+
```
84+
npm run release:graduate
85+
```
86+
Then push with:
87+
```
88+
npm run release:push
89+
```
7790

7891
---
7992

commitlint.config.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

lerna.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

nx.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "./node_modules/nx/schemas/nx-schema.json",
3+
"namedInputs": {
4+
"default": [
5+
"{projectRoot}/**/*",
6+
"{workspaceRoot}/tsconfig.json"
7+
]
8+
},
9+
"targetDefaults": {
10+
"build": {
11+
"dependsOn": [
12+
"^build"
13+
],
14+
"outputs": [
15+
"{projectRoot}/lib/**"
16+
],
17+
"inputs": [
18+
"default",
19+
"^default"
20+
],
21+
"cache": true
22+
},
23+
"test": {
24+
"dependsOn": [
25+
"^build"
26+
],
27+
"cache": true
28+
},
29+
"test:es:version": {
30+
"dependsOn": [
31+
"build"
32+
],
33+
"cache": true
34+
}
35+
},
36+
"analytics": false
37+
}

0 commit comments

Comments
 (0)