Skip to content

Commit b27c82f

Browse files
committed
chore: husky config can be rebase
1 parent 57bcbcd commit b27c82f

File tree

9 files changed

+20
-27
lines changed

9 files changed

+20
-27
lines changed

.husky/pre-commit

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
#!/usr/bin/env sh
22
# 导入 Husky 脚本
33
. "$(dirname -- "$0")/_/husky.sh"
4-
5-
# 检查是否处于 rebase 状态
6-
if [ -z "$GIT_DIR" ]; then
7-
# 处于 rebase 状态,退出脚本
8-
exit 0
9-
fi
10-
11-
# 不处于 rebase 状态,执行 pre-commit 脚本
4+
# 如果要执行 rebase 需要跳过当前所有hooks
5+
# todo-highlight HUSKY_SKIP_HOOKS=1 git rebase ...
126
echo "Running pre-commit script..."
137
npm run lint && npm run format

CHANGELOG.md

+9-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1-
2-
31
## [1.0.7](https://github.com/wh131462/leetcode-practice/compare/cli-v1.0.6...cli-v1.0.7) (2024-03-12)
42

5-
63
### Bug Fixes
74

8-
* change plan list question title to cn ([57f15d5](https://github.com/wh131462/leetcode-practice/commit/57f15d5befc23d11ce6211c30e3ee7a7e8bbe52d))
9-
* change plan list question title to cn ([cb6fbfd](https://github.com/wh131462/leetcode-practice/commit/cb6fbfd4cd783f57d031abe3add9d85f3e271a4c))
10-
* change the config ([2b9bb11](https://github.com/wh131462/leetcode-practice/commit/2b9bb1149c6db0dbede22f10830ccd8661b0a83f))
11-
* delete hot100 add study plan list ([e94aaa1](https://github.com/wh131462/leetcode-practice/commit/e94aaa166e80e7e54f3ce5b570352cb798799b77))
12-
* delete hot100 add study plan list ([9d7a22f](https://github.com/wh131462/leetcode-practice/commit/9d7a22fde8cc72264766f707ea3f51e81956c111))
13-
* get all is not success ([9108219](https://github.com/wh131462/leetcode-practice/commit/91082196dc005b0b23314966a09304ba948416b8))
14-
* get all is not success ([3f5bfef](https://github.com/wh131462/leetcode-practice/commit/3f5bfef7857e6c9869c40e3d12a60d50b14be2cd))
15-
* update realm version to fix windows env ([00d2bc4](https://github.com/wh131462/leetcode-practice/commit/00d2bc4942b2b02f97ad41d23da64f8bedc23741))
16-
* use logger instead console ([fddc458](https://github.com/wh131462/leetcode-practice/commit/fddc4581efbd5186a17aa1415aa2738283f820b7))
5+
- change plan list question title to cn ([57f15d5](https://github.com/wh131462/leetcode-practice/commit/57f15d5befc23d11ce6211c30e3ee7a7e8bbe52d))
6+
- change plan list question title to cn ([cb6fbfd](https://github.com/wh131462/leetcode-practice/commit/cb6fbfd4cd783f57d031abe3add9d85f3e271a4c))
7+
- change the config ([2b9bb11](https://github.com/wh131462/leetcode-practice/commit/2b9bb1149c6db0dbede22f10830ccd8661b0a83f))
8+
- delete hot100 add study plan list ([e94aaa1](https://github.com/wh131462/leetcode-practice/commit/e94aaa166e80e7e54f3ce5b570352cb798799b77))
9+
- delete hot100 add study plan list ([9d7a22f](https://github.com/wh131462/leetcode-practice/commit/9d7a22fde8cc72264766f707ea3f51e81956c111))
10+
- get all is not success ([9108219](https://github.com/wh131462/leetcode-practice/commit/91082196dc005b0b23314966a09304ba948416b8))
11+
- get all is not success ([3f5bfef](https://github.com/wh131462/leetcode-practice/commit/3f5bfef7857e6c9869c40e3d12a60d50b14be2cd))
12+
- update realm version to fix windows env ([00d2bc4](https://github.com/wh131462/leetcode-practice/commit/00d2bc4942b2b02f97ad41d23da64f8bedc23741))
13+
- use logger instead console ([fddc458](https://github.com/wh131462/leetcode-practice/commit/fddc4581efbd5186a17aa1415aa2738283f820b7))
1714

1815
## [1.0.6](https://github.com/wh131462/leetcode-practice/compare/cli-v1.0.5...cli-v1.0.6) (2024-03-11)
1916

CONTRIBUTORS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# CONTRIBUTORS
22

3-
参考链接: [分支管理](https://www.ruanyifeng.com/blog/2012/07/git.html)
3+
参考链接: [分支管理](https://www.ruanyifeng.com/blog/2012/07/git.html)

common/utils/logger/logger.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import chalk from 'chalk'
22
import { getStore } from '#common/utils/store/controller/store.js'
33

44
class Logger {
5-
constructor(env) {
5+
constructor(_env) {
66
// console.log(
77
// chalk.bgGray(`[logger init] The current env is ${env ?? 'not plugin'}.`)
88
// )

common/utils/question-getter/getStudyPlanList.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { getStudyPlanListJson } from '#resources/headers/studyPlanListJson.js'
44
export async function getStudyPlanList(type) {
55
const res = await graphql(getStudyPlanListJson(type))
66
const {
7-
data: { studyPlansV2ByCatalog: { studyPlans } }
7+
data: {
8+
studyPlansV2ByCatalog: { studyPlans }
9+
}
810
} = res
911
return studyPlans
1012
}

common/utils/question-handler/getQuestionListCodeBySlug.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { createQuestionByTitleSlug } from '../create-check/createUtil.js'
22
import { getPlanQuestionList } from '#common/utils/question-getter/getPlanQuestionList.js'
3-
import { logger } from '#common/utils/logger/logger.js'
43

54
// 获取创建promise列表
65
async function createCreatePromiseList(slugList, baseDir = process.cwd()) {

common/view/finder.view.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import path from 'node:path'
12
import select, { Separator } from '@inquirer/select'
23
import input from '@inquirer/input'
34
import {
@@ -9,7 +10,6 @@ import { getStudyPlanList } from '#common/utils/question-getter/getStudyPlanList
910
import { getPlanQuestionList } from '#common/utils/question-getter/getPlanQuestionList.js'
1011
import { logger } from '#common/utils/logger/logger.js'
1112
import { getQuestionListCodeBySlug } from '#common/utils/question-handler/getQuestionListCodeBySlug.js'
12-
import path from 'node:path'
1313

1414
function handleQuestionList(list) {
1515
return list.map((item) => ({

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
"prepare": "husky install",
4444
"create-color-font": "node scripts/create-color-font.js",
4545
"release": "release-it",
46-
"try-release": "release-it --dry-run"
46+
"try-release": "release-it --dry-run",
47+
"rebase": "HUSKY_SKIP_HOOKS=1 git rebase "
4748
},
4849
"dependencies": {
4950
"@inquirer/input": "^2.0.1",

resources/headers/studyPlanListJson.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ export function getStudyPlanListJson(type) {
55
return {
66
headers: { 'content-type': 'application/json' },
77
body: `{\"query\":\"\\n query GetStudyPlanByCatalog($catalogSlug: String!, $offset: Int!, $limit: Int!) {\\n studyPlansV2ByCatalog(catalogSlug: $catalogSlug, offset: $offset, limit: $limit) {\\n hasMore\\n total\\n studyPlans {\\n slug\\n questionNum\\n premiumOnly\\n onGoing\\n name\\n highlight\\n cover\\n }\\n }\\n}\\n \",\"variables\":{\"offset\":0,\"catalogSlug\":\"${type}\",\"limit\":12},\"operationName\":\"GetStudyPlanByCatalog\"}`,
8-
method: "POST"
8+
method: 'POST'
99
}
1010
}

0 commit comments

Comments
 (0)