Skip to content

Commit 02b8503

Browse files
committed
fix: add postversion hook
1 parent a22612c commit 02b8503

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# sync-npm-version-to-jsr
22

3-
[![JSR](https://jsr.io/badges/@eggjs/sync-npm-version-to-jsr)](https://jsr.io/@eggjs/sync-npm-version-to-jsr)
4-
[![JSR Score](https://jsr.io/badges/@eggjs/sync-npm-version-to-jsr/score)](https://jsr.io/@eggjs/sync-npm-version-to-jsr)
3+
[![JSR](https://jsr.io/badges/@nm/sync-npm-version-to-jsr)](https://jsr.io/@nm/sync-npm-version-to-jsr)
4+
[![JSR Score](https://jsr.io/badges/@nm/sync-npm-version-to-jsr/score)](https://jsr.io/@nm/sync-npm-version-to-jsr)
55
[![NPM Version](https://img.shields.io/npm/v/sync-npm-version-to-jsr)](https://www.npmjs.com/package/sync-npm-version-to-jsr)
66
[![NPM Downloads](https://img.shields.io/npm/dm/sync-npm-version-to-jsr)](https://www.npmjs.com/package/sync-npm-version-to-jsr)
77
[![NPM License](https://img.shields.io/npm/l/sync-npm-version-to-jsr)](https://github.com/node-modules/sync-npm-version-to-jsr/blob/master/LICENSE)
@@ -18,6 +18,20 @@ sync package.json version to jsr.json
1818
npx sync-npm-version-to-jsr
1919
```
2020

21+
Use `postversion` hook on [semantic-release](https://github.com/semantic-release/semantic-release/blob/fdc35bda3c00a5ae79234ea4e2e6ed05ef4ac501/docs/support/FAQ.md?plain=1#L61)
22+
23+
> the `postversion` hook so it will be executed during the `prepare` step of `@semantic-release/npm`, which allow for example to update files before committing them with the [`@semantic-release/git`](https://github.com/semantic-release/git) plugin
24+
25+
```json
26+
// package.json
27+
28+
{
29+
"scripts": {
30+
"postversion": "npx sync-npm-version-to-jsr"
31+
}
32+
}
33+
```
34+
2135
## License
2236

2337
[MIT](./LICENSE)

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@
3636
"pretest": "npm run lint -- --fix",
3737
"test": "node --test --experimental-strip-types",
3838
"preci": "npm run lint",
39-
"ci": "npm run prepublishOnly",
40-
"prepublishOnly": "tsc -b --clean && tsc && node dist/bin.js",
39+
"ci": "npm run prepublishOnly && npm run postversion",
40+
"postversion": "node dist/bin.js",
41+
"prepublishOnly": "tsc -b --clean && tsc",
4142
"prepare": "husky"
4243
},
4344
"lint-staged": {

0 commit comments

Comments
 (0)