Skip to content

Commit 42a1703

Browse files
committed
chore: 合并冲突
2 parents 5793d8d + 83be063 commit 42a1703

File tree

10 files changed

+276
-29
lines changed

10 files changed

+276
-29
lines changed

.github/workflows/contributors.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: gen-org-contributors
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
generate:
10+
runs-on: ubuntu-latest
11+
if: github.repository == 'EternalHeartTeam/leetcode-practice'
12+
steps:
13+
- uses: thinkasany/organize-contributors@master
14+
with:
15+
organize_name: EternalHeartTeam
16+
github_token: ${{ secrets.ACTION_TOKEN }}
17+
png_path: images/contributors.png
18+
json_path: contributors.json
19+
branch: svg
20+
commit_message: 'chore: update contributors'
21+
excludes_list: 'ImgBotApp,github-actions[bot],actions-user,imgbot[bot],dependabot[bot]'

.github/workflows/pr-add-label.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: pr-add-label
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, edited, reopened, synchronize]
6+
7+
jobs:
8+
add-label:
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check PR number
15+
id: pr_number
16+
run: echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV
17+
18+
- name: Run add-label Action
19+
uses: thinkasany/pr-label-action@master
20+
with:
21+
github_token: ${{ secrets.ACTION_TOKEN }}
22+
pr_number: ${{ env.PR_NUMBER }}
23+
organize_name: EternalHeartTeam
24+
team_name: eternalheartteam

.github/workflows/release-cli.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Create Cli Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'cli-v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
if: github.repository == 'EternalHeartTeam/leetcode-practice'
12+
steps:
13+
- uses: actions/checkout@v3
14+
# Setup .npmrc file to publish to npm
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: '20'
18+
registry-url: 'https://registry.npmjs.org'
19+
- run: npm install
20+
- run: npm run build-cli
21+
- run: npm run publish-cli
22+
env:
23+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

.npmignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.tgz
2+
httpData/

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://registry.npmjs.org

.release-it.json

+11-7
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,26 @@
55
"autoGenerate": true
66
},
77
"git": {
8-
"commitMessage": "release: v${version}"
9-
},
10-
"publishConfig": {
11-
"registry": "https://registry.npmjs.org"
8+
"commitMessage": "feat: v${version}",
9+
"tagName": "cli-v${version}",
10+
"tag": true,
11+
"push": true,
12+
"pushArgs": ["--follow-tags"]
1213
},
1314
"npm": {
14-
"publish": true,
15-
"skipChecks": true
15+
"publish": false
1616
},
1717
"hooks": {
1818
"after:bump": "echo 更新版本成功"
1919
},
2020
"plugins": {
21+
"@release-it/bumper": {
22+
"preset": "angular"
23+
},
2124
"@release-it/conventional-changelog": {
2225
"preset": "angular",
23-
"infile": "CHANGELOG.md"
26+
"infile": "CHANGELOG.md",
27+
"ignoreRecommendedBump": true
2428
}
2529
}
2630
}

CHANGELOG.md

+134-18
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,157 @@
1-
# CHANGELOG
21

3-
## 1.0.5 release [2024-3-]
2+
3+
## [1.0.5-beta.0](https://github.com/wh131462/leetcode-practice/compare/cli-v1.0.5-bera.0...cli-v1.0.5-beta.0) (2024-03-11)
4+
5+
## [1.0.5-bera.0](https://github.com/wh131462/leetcode-practice/compare/cli-v1.0.4-beta...cli-v1.0.5-bera.0) (2024-03-11)
6+
7+
## [1.0.4-beta](https://github.com/wh131462/leetcode-practice/compare/cli-v0.0.1...cli-v1.0.4-beta) (2024-03-11)
8+
9+
## 1.0.4 (2024-03-11)
10+
11+
### Bug Fixes
12+
13+
- add break before default ([08094b4](https://github.com/wh131462/leetcode-practice/commit/08094b4389a3fd1e442615dd687a55a08bd5ac62))
14+
- change ([1eb6e3c](https://github.com/wh131462/leetcode-practice/commit/1eb6e3c5ba35b22d7d3ef6893b6ace2d80050d6e))
15+
- change ([0801a1d](https://github.com/wh131462/leetcode-practice/commit/0801a1d6c63fef76d570ed7d943bd0d6f85c70e6))
16+
- change template ([872e867](https://github.com/wh131462/leetcode-practice/commit/872e867021c347e1fe4236e94cbd67aed47010a9))
17+
- console table text length verflow dislocation error ([3a563a2](https://github.com/wh131462/leetcode-practice/commit/3a563a2169bae2dd0ef26fb16e9bdedce21c8be2))
18+
- correct packageManager's format (fix [#7](https://github.com/wh131462/leetcode-practice/issues/7)) ([faa2280](https://github.com/wh131462/leetcode-practice/commit/faa2280746facefd2bd11d45d85cc70026821c0c))
19+
- delete src ([a932ce4](https://github.com/wh131462/leetcode-practice/commit/a932ce42227a8fab5d83d8bbe7a2add78c0d26a6))
20+
- delete src file ([2a53e63](https://github.com/wh131462/leetcode-practice/commit/2a53e634bbb7da7f0bf9df129901bb4c7839ba57))
21+
- find question by keyword error ([69da517](https://github.com/wh131462/leetcode-practice/commit/69da51740ff7f78a89c05ea534f80cc56f588d7f))
22+
- find question list ([6f78bfa](https://github.com/wh131462/leetcode-practice/commit/6f78bfa8fbab5d375f48d541c1b50bbfec55f9aa))
23+
- fix all lint error ([e99e76b](https://github.com/wh131462/leetcode-practice/commit/e99e76b2e1c7c9d387ab658a4c1f4057bf1a60da))
24+
- format readme form ([f002d77](https://github.com/wh131462/leetcode-practice/commit/f002d77f6e3f9e9a1259de2a5fee4b1858768620))
25+
- format readme form ([df5e45c](https://github.com/wh131462/leetcode-practice/commit/df5e45c9d55fc98dbe6bbc5b7fc80d6716d5bd34))
26+
- format readme form ([2f182ca](https://github.com/wh131462/leetcode-practice/commit/2f182ca85575fa8d2963fc0e657ee425b2215153))
27+
- format readme lint ([85b97f6](https://github.com/wh131462/leetcode-practice/commit/85b97f64258eadf4dcf1b29747e0ed0c3d161440))
28+
- getTestCase ([4ac7f65](https://github.com/wh131462/leetcode-practice/commit/4ac7f6505a47ab60d4ea74c659bb49c0d19667e6))
29+
- **headers:** remove useless header configuration ([105c841](https://github.com/wh131462/leetcode-practice/commit/105c84141206dfcf11d6a4ea46775f7546150acd))
30+
- **headers:** remove useless header configuration ([3ba1a98](https://github.com/wh131462/leetcode-practice/commit/3ba1a982a5e1d4c3b29d09af40df910f9d9dd3a5))
31+
- ignore lint ([46a9135](https://github.com/wh131462/leetcode-practice/commit/46a91358376a387b1e395e99424012685c21e09b))
32+
- ignore lint ([d376299](https://github.com/wh131462/leetcode-practice/commit/d376299a7f7e20453aaee978bba4178079b1e931))
33+
- lint ([cc63e57](https://github.com/wh131462/leetcode-practice/commit/cc63e572de4afa50b82791e1e896234b8d6b8ee4))
34+
- listnode check ([b8b3b47](https://github.com/wh131462/leetcode-practice/commit/b8b3b475637647035ac3eb9bfc5b27b61bde9a49))
35+
- log ([bd1d01b](https://github.com/wh131462/leetcode-practice/commit/bd1d01b4a440f8f80dfc67b04180dde29bac9da9))
36+
- memory calc error ([c09b344](https://github.com/wh131462/leetcode-practice/commit/c09b3440f81d0a3d6bf740aec06b320e00574b2c))
37+
- perfect version for cli install ([5a257f4](https://github.com/wh131462/leetcode-practice/commit/5a257f43fe897be40dd64a8ff8532387290a15fa))
38+
- readme_cn ([63dab20](https://github.com/wh131462/leetcode-practice/commit/63dab20f3956ae5f2abbc5df721c4ccc61d90bd2))
39+
- rename README ([2b8c294](https://github.com/wh131462/leetcode-practice/commit/2b8c294b0259d3476285ca985b8ad1e3fb2c6c2b))
40+
- rewrite log ([53d15b4](https://github.com/wh131462/leetcode-practice/commit/53d15b491c57d9e36a6fd6c36193517edb915425))
41+
- search ([5bb93dd](https://github.com/wh131462/leetcode-practice/commit/5bb93dd323c0786a17b1a4e4eae1ae3e1ba9625b))
42+
- **store:** fix the bug for create dir outside ([7254f29](https://github.com/wh131462/leetcode-practice/commit/7254f2988a656c28c0e7fbc685e16ff85cc1cbe6))
43+
- **tempate:** 修复空格导致字符串匹配失效问题 ([07bdbdc](https://github.com/wh131462/leetcode-practice/commit/07bdbdc88b1e50c781a65863dd1ba45c98eb5d79))
44+
- **test:** 修复挂掉的测试用例 ([4593058](https://github.com/wh131462/leetcode-practice/commit/4593058a065accc9e55e916352013de7bc6d4533))
45+
- update view for cli ([0b8ecf0](https://github.com/wh131462/leetcode-practice/commit/0b8ecf0ac7b2567168e35a6513308825aa514070))
46+
- 优化代码 ([da6aa6d](https://github.com/wh131462/leetcode-practice/commit/da6aa6d5ab87c4ecb626f1762033062a9ac432e4))
47+
- 修复原始创建不中止问题 ([ddb0ea1](https://github.com/wh131462/leetcode-practice/commit/ddb0ea11ca02abe73ee80ec8b0130466efbce457))
48+
- 模版文件路径错误 ([e46c94c](https://github.com/wh131462/leetcode-practice/commit/e46c94c85583b367d831326e4e873512b6ccf504))
49+
50+
### Code Refactoring
51+
52+
- directory refactor ([7a3a948](https://github.com/wh131462/leetcode-practice/commit/7a3a94806a1843e1c4bb86ece65d4e19ef9817fa))
53+
54+
- cli finish basically (#5) ([5af52e3](https://github.com/wh131462/leetcode-practice/commit/5af52e31b466517d2fdea9443376d27bff646bdf)), closes [#5](https://github.com/wh131462/leetcode-practice/issues/5)
455

556
### Features
657

7-
- Added eslint, prettier, and commit-lint to development dependencies.
8-
- Implemented a hot 100 list feature and added keyword search functionality.
58+
- add ([fb3fadc](https://github.com/wh131462/leetcode-practice/commit/fb3fadc7fca166be0eefe51a817899466ab48b27))
59+
- add cz plugin ([4fd5af1](https://github.com/wh131462/leetcode-practice/commit/4fd5af151ac32d3daabcdc862505962fcd32f129))
60+
- add eslint ([be523ea](https://github.com/wh131462/leetcode-practice/commit/be523ea0f3085e003a2e0b5fb1c568b65cc21714))
61+
- add get question ([e5572b6](https://github.com/wh131462/leetcode-practice/commit/e5572b6357c8c056aa32eab53476736561261ebe))
62+
- add get question by keyword function ([097302a](https://github.com/wh131462/leetcode-practice/commit/097302afe095ad70d1c58942dc8ac8fb516e1eed))
63+
- add getQuestionChineseName function to get chinese name ([9520e75](https://github.com/wh131462/leetcode-practice/commit/9520e757741ff008439affd20db582458a37b674))
64+
- add getQuestionCode ([dbdb255](https://github.com/wh131462/leetcode-practice/commit/dbdb2553a2c47c9ee40fada33bfec7458ae4ccb6))
65+
- add memory calculate ([e6c315a](https://github.com/wh131462/leetcode-practice/commit/e6c315ab1524327697278e3b41c622fb22928896))
66+
- add memory demo ([8065924](https://github.com/wh131462/leetcode-practice/commit/8065924ca451e043f80644a31eb5d9543946f026))
67+
- add open process ([80dc9f5](https://github.com/wh131462/leetcode-practice/commit/80dc9f530eaae98e5449b3ebdf5c9e69ec452a17))
68+
- add prettier and commitlint ([608f4df](https://github.com/wh131462/leetcode-practice/commit/608f4dfdc4c0aebb9ead3e46abcde71fcc962b39))
69+
- change git push rules ([ee3e558](https://github.com/wh131462/leetcode-practice/commit/ee3e558496ef72f2daee071b88e79ddd06503e7c))
70+
- **cli:** 简化命令 使得命令可以在任何路径下运行 ([26fcffb](https://github.com/wh131462/leetcode-practice/commit/26fcffb8daa0e0a70e78c47772ef5059c1c825d1))
71+
- **commit:** finish set question range tag in file and get code in file by range tag ([61e2924](https://github.com/wh131462/leetcode-practice/commit/61e2924d2607e96bbd37947f05e718a10ac9edd6))
72+
- eslint忽略文件 ([f91889c](https://github.com/wh131462/leetcode-practice/commit/f91889c8348766a63136ada6fcd49e79a0e54378))
73+
- finish the view create & check ([9e96e0a](https://github.com/wh131462/leetcode-practice/commit/9e96e0a24f0232827196ce2bdb6c3d04966f42bd))
74+
- get js code ([b1fd6bb](https://github.com/wh131462/leetcode-practice/commit/b1fd6bb8d85d080c1f89a53cd99416c84e3abd10))
75+
- hot100合并代码 ([3ddd7c6](https://github.com/wh131462/leetcode-practice/commit/3ddd7c6237bd43655c4e3d0e490bd997afb1df5a))
76+
- node vm执行index.js脚本 ([f894e30](https://github.com/wh131462/leetcode-practice/commit/f894e3096c15d9939e0b93688f37c4272775d300))
77+
- publish config & build config ([1affd2a](https://github.com/wh131462/leetcode-practice/commit/1affd2ab7b1e1ad942d5dc3fbe5c300b5a92f240))
78+
- sucess log with green and fail log with red ([1eccefb](https://github.com/wh131462/leetcode-practice/commit/1eccefb023d28ca734c1886e0dc64a576d03f860))
79+
- update function basic ([a01c873](https://github.com/wh131462/leetcode-practice/commit/a01c8738aa060221421f2f17158c92a9069929a0))
80+
- update project using github ([a879d29](https://github.com/wh131462/leetcode-practice/commit/a879d29f9686f5c71d02bfe5c9122bc6fc90dc81))
81+
- v1.0.4 ([87428c2](https://github.com/wh131462/leetcode-practice/commit/87428c2c18200492e79e332a149d5af3c8eb6408))
82+
- v1.0.4 ([8356a57](https://github.com/wh131462/leetcode-practice/commit/8356a57b4d6908d40906d4759cb04367f34e09c3))
83+
- v1.0.4 ([9c6fca0](https://github.com/wh131462/leetcode-practice/commit/9c6fca0e433f013340dfed5c3e495789dc7e84ca))
84+
- version 1.0.2 ([4afe55e](https://github.com/wh131462/leetcode-practice/commit/4afe55e35ecea82dedbba3e6a3d9a2738365aa79))
85+
- **忽略测试覆盖率文件:** 忽略测试覆盖率文件 ([b05e380](https://github.com/wh131462/leetcode-practice/commit/b05e380ef84384f5f1ebbfb64628bd689933f755))
86+
- 新增填充markdown功能 ([1b8324d](https://github.com/wh131462/leetcode-practice/commit/1b8324d212898e8d0b7b2edc15244da31157a3c9))
87+
- 新增无向连通图数据结构 parse toArray实现,补充测试用例等 fix: 优化了转换逻辑 ([08f3787](https://github.com/wh131462/leetcode-practice/commit/08f3787f70de41d82610c1ce940f35c878dbf0d1))
88+
- 新增测试覆盖率 ([2627ecd](https://github.com/wh131462/leetcode-practice/commit/2627ecd00105d4af59e5c2fa59608da1144f17a8))
89+
- 测试用例中补充树和链表的数据结构以及转换逻辑,新增单元测试模块 ([ac9ccd1](https://github.com/wh131462/leetcode-practice/commit/ac9ccd155358306f667e9ffaa0aac9f16d58988a))
90+
- 统一数据结构 ([f15a8da](https://github.com/wh131462/leetcode-practice/commit/f15a8dad2500cef476e1340b93053be48364bf3e))
91+
92+
### Performance Improvements
93+
94+
- better scripts and easy mode to create question in project ([ffd9e29](https://github.com/wh131462/leetcode-practice/commit/ffd9e29ca35d9f4b8b6b2f8b94516e8f053261a5))
95+
- http dir structure and functions modify ([553ad58](https://github.com/wh131462/leetcode-practice/commit/553ad5861aa67423c1092f798f39b2bd4faf68f6))
96+
97+
### BREAKING CHANGES
98+
99+
- srcipts即将废弃,视图交互性代码完善1/3
100+
101+
- feat: finish the view create & check
102+
103+
- feat:完成lc&lk指令
104+
105+
- fix: 优化代码
106+
107+
- feat: add getQuestionChineseName function to get chinese name
108+
109+
- chore: del scripts and .vscode files & ignore .vscode
110+
111+
- docs: update todo & achive
112+
113+
- perf: better scripts and easy mode to create question in project
114+
115+
- feat: publish config & build config
116+
117+
- chore: del src
118+
119+
- fix: perfect version for cli install
120+
121+
- fix:指令打包完善
122+
123+
- fix:easy mode script
9124

10-
## 1.0.4 release [2024-3-5 22:10]
125+
- docs:todo 拆分成单独文件
11126

12-
### Fixes
127+
- chore:路径调整成全局路径
13128

14-
- fix the bug cannot create question
129+
- docs: add CHANGELOG and TO-DO
130+
- srcipts即将废弃,视图交互性代码完善1/3
15131

16-
## 1.0.3 release [2024-3-3 20:26]
132+
# 1.0.3 [2024-03-03]
17133

18134
### Features
19135

20-
- you can create question in any supported language file
21-
- the file name from 'index' to 'question'
136+
- You can now create questions in any supported language file.
137+
- Renamed the file from 'index' to 'question'.
22138

23-
## 1.0.2 release [2024-2-29 19:02]
139+
# 1.0.2 [2024-02-29]
24140

25141
### Features
26142

27-
- add i18n docs
143+
- Added i18n docs.
28144

29-
## 1.0.1 release [2024-2-8 13:49]
145+
# 1.0.1 [2024-02-08]
30146

31147
### Features
32148

33-
- add `author` info and `repository` in package.json
149+
- Added `author` info and `repository` in package.json.
34150

35-
## 1.0.0 release [2024-2-8 13:49]
151+
# 1.0.0 [2024-02-08]
36152

37153
### Features
38154

39-
- cli: lk/lf/lc 脚本实现 检测/查找/创建 功能,强而有力地支持了题目的便捷创建.
40-
- template project: easy mode 实现交互性创建,leet-create和leet-check保持src目录下创建题解.
41-
- plugin: 插件化的设计完善,进行立项.
155+
- **CLI:** Implemented scripts lk/lf/lc for detection, search, and creation functions, providing convenient creation of questions.
156+
- **Template Project:** Implemented interactive creation with easy mode, leet-create and leet-check now create solutions under the src directory.
157+
- **Plugin:** Perfected the plugin design and initiated the project.

README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -489,12 +489,14 @@ To be developed...
489489
490490
## Contributors
491491
492-
[<img src="https://avatars.githubusercontent.com/u/48346853" style="border-radius:50%;" width="30" height="30" alt="EternalHeart"/>](https://github.com/wh131462)
493-
[<img src="https://avatars.githubusercontent.com/u/61453917" style="border-radius:50%;" width="30" height="30" alt="SmartTeddy"/>](https://github.com/SmallTeddy)
494-
[<img src="https://avatars.githubusercontent.com/u/35305691" style="border-radius:50%;" width="30" height="30" alt="Hedwig-Fang"/>](https://github.com/Hedwig-Fang)
492+
<a href="https://github.com/EternalHeartTeam/leetcode-practice/graphs/contributors" target="_blank"><img src="https://raw.githubusercontent.com/EternalHeartTeam/leetcode-practice/svg/images/contributors.png" /></a>
495493
496494
## Feedback
497495
498496
If you encounter any `issues` or have some `great suggestions`, feel free to join our `Feedback Group` for providing `feedback`! We will address them promptly!
499497
500498
![Feedback Group](resources/images/service-qrcode.png)
499+
500+
## Star History
501+
502+
[![Star History Chart](https://api.star-history.com/svg?repos=EternalHeartTeam/leetcode-practice&type=Date)](https://star-history.com/#EternalHeartTeam/leetcode-practice&Date)

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "leetcode-practice",
33
"type": "module",
4-
"version": "1.0.4",
4+
"version": "1.0.5-beta.0",
55
"packageManager": "yarn@1.22.0",
66
"description": "A powerful practice platform for leetcode.Using any way you want to create questions.",
77
"author": {
@@ -29,6 +29,7 @@
2929
"lc": "node bin/lc.js -d src",
3030
"lk": "node bin/lk.js -d src",
3131
"lf": "node bin/lf.js -d src",
32+
"release:cli": "node scripts/release.js",
3233
"update": "node scripts/update.js",
3334
"build-cli": "node esbuild.config.js",
3435
"publish-cli": "cd pl-cli && npm publish --registry https://registry.npmjs.org/",
@@ -62,6 +63,7 @@
6263
"@antfu/eslint-config": "^2.8.0",
6364
"@commitlint/cli": "^17.0.3",
6465
"@commitlint/config-conventional": "^17.0.3",
66+
"@release-it/bumper": "^6.0.1",
6567
"@release-it/conventional-changelog": "^8.0.1",
6668
"@types/node": "^20.11.5",
6769
"@vitest/coverage-v8": "^1.2.2",

scripts/release.js

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import fs from 'node:fs'
2+
import { fileURLToPath } from 'node:url'
3+
import path, { dirname } from 'node:path'
4+
import * as child_process from 'node:child_process'
5+
import packageJson from '../package.json' assert { type: 'json' }
6+
7+
const __filename = fileURLToPath(import.meta.url)
8+
const __dirname = dirname(__filename)
9+
;(async function () {
10+
// 自动更新版本
11+
// version可以传递如 6.1.1 | patch | minor | major
12+
const execCommand = (arr) =>
13+
(Array.isArray(arr) ? arr : [arr]).forEach((c) => {
14+
try {
15+
console.log(`start: ${c}...`)
16+
console.log(child_process.execSync(c).toString('utf8'))
17+
} catch (error) {
18+
console.log('\x1B[31m%s\x1B[0m', error.stdout.toString())
19+
process.exit(1)
20+
}
21+
})
22+
const getNewVersion = (oldVersion, version = 'patch') => {
23+
// [<newversion> | major | minor | patch]
24+
if (/^([0-9]+\.*)+$/.test(version)) return version
25+
const types = ['major', 'minor', 'patch']
26+
const index = types.indexOf(version)
27+
if (index >= 0) {
28+
const versionArr = oldVersion.split('.')
29+
versionArr[index] = Number(versionArr[index]) + 1
30+
return versionArr.map((e, i) => (i > index ? 0 : e)).join('.')
31+
}
32+
return getNewVersion(oldVersion)
33+
}
34+
const newVersionObj = {
35+
version: getNewVersion(packageJson.version, process.argv[2])
36+
}
37+
fs.writeFileSync(
38+
path.resolve(__dirname, '../package.json'),
39+
`${JSON.stringify(
40+
Object.assign({}, packageJson, newVersionObj),
41+
null,
42+
2
43+
)}\n`
44+
)
45+
console.log(newVersionObj)
46+
execCommand([
47+
`git commit -a -m 'chore: update version cli-v${newVersionObj.version}'`,
48+
`git tag cli-v${newVersionObj.version}`,
49+
'git push && git push --tags'
50+
])
51+
console.log('\x1B[32m%s\x1B[0m', '发布完成,请关注github CI构建')
52+
})()

0 commit comments

Comments
 (0)