Skip to content

Commit 37b63a0

Browse files
authored
chore: add changeset and changelog generation script (#84)
* chore: add changeset and changelog generation script * chore: prepare release changeset with multiple improvements
1 parent 916e5b6 commit 37b63a0

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

.changeset/light-books-count.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'msw-auto-mock': minor
3+
---
4+
5+
- chore: switch to pnpm 10.6.1 and fix tests ([#83](https://github.com/zoubingwu/msw-auto-mock/pull/83))
6+
- fix: resolve type object allOf recursively ([#69](https://github.com/zoubingwu/msw-auto-mock/pull/69))
7+
- Allow for different resource keys than application/json ([#73](https://github.com/zoubingwu/msw-auto-mock/pull/73))
8+
- Extend transform string logic to return faker's fromRegExp() if a regexp pattern is provided ([#74](https://github.com/zoubingwu/msw-auto-mock/pull/74))
9+
- Change createOpenAI option baseURL source ([#77](https://github.com/zoubingwu/msw-auto-mock/pull/77))
10+
- improved the handling of date-time strings and time strings. ([#80](https://github.com/zoubingwu/msw-auto-mock/pull/80))
11+

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"build": "tsup",
1111
"fmt": "prettier {example,src}/**/*.{js,jsx,ts,tsx,css,md,html} --write",
1212
"test": "vitest run",
13+
"changeset": "changeset",
1314
"release": "changeset publish"
1415
},
1516
"author": "zoubingwu<zoubingwu@gmail.com>",
@@ -44,7 +45,7 @@
4445
},
4546
"repository": {
4647
"type": "git",
47-
"url": "git+https://github.com/zoubingwu/msw-auto-mock.git"
48+
"url": "https://github.com/zoubingwu/msw-auto-mock.git"
4849
},
4950
"bugs": {
5051
"url": "https://github.com/zoubingwu/msw-auto-mock/issues"

scripts/changelog.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# Get the repository URL from package.json
4+
REPO_URL=$(node -e "console.log(require('./package.json').repository.url.replace(/\.git$/, ''))")
5+
6+
# Fetch all tags
7+
git fetch --all --tags
8+
9+
# Get the last tag
10+
LAST_TAG=$(git describe --tags --abbrev=0)
11+
12+
# Generate and store changelog
13+
CHANGELOG=$(git log ${LAST_TAG}..HEAD --pretty=format:"- %s" | \
14+
sed -E "s|#([0-9]+)|[#\1](${REPO_URL}/pull/\1)|g")
15+
16+
# Print to terminal
17+
echo "Changelog since ${LAST_TAG}:"
18+
echo "$CHANGELOG"
19+
echo
20+
21+
# Copy to clipboard
22+
echo "$CHANGELOG" | pbcopy
23+
24+
echo "Changelog has been copied to clipboard!"

0 commit comments

Comments
 (0)