Skip to content

Commit 531439b

Browse files
authored
Merge pull request #43 from ansidev/feature/command-leetcode
Developer Feature: Add CLI command `task lc`
2 parents 5ff2d08 + 5632403 commit 531439b

File tree

8 files changed

+75401
-3
lines changed

8 files changed

+75401
-3
lines changed

.taskfiles/task_leetcode.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: "3"
2+
3+
tasks:
4+
new:
5+
desc: Generate new post for LeetCode solution
6+
cmds:
7+
- pnpm lc:new {{.CLI_ARGS}}
8+
silent: true
9+
10+
commit:
11+
desc: Commit code for a specific LeetCode problem
12+
cmds:
13+
- |
14+
git commit -m "chore(solution): add solution for LeetCode problem No.{{.CLI_ARGS}}"
15+
silent: true

Taskfile.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ includes:
55
git: ./.taskfiles/task_git.yaml
66
release: ./.taskfiles/task_release.yaml
77
dep: ./.taskfiles/task_dep.yaml
8+
lc: ./.taskfiles/task_leetcode.yaml

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"version": "2.0.1",
66
"license": "MIT",
77
"scripts": {
8+
"lc:new": "tsx ./src/cmd/leetcode.ts",
89
"dev": "astro dev",
910
"start": "astro dev",
1011
"build": "astro build",
@@ -31,19 +32,24 @@
3132
"@tailwindcss/typography": "^0.5.9",
3233
"@types/lodash.get": "^4.4.7",
3334
"@types/lodash.kebabcase": "^4.1.7",
35+
"@types/mustache": "^4.2.2",
3436
"@types/node": "^18.14.1",
3537
"@typescript-eslint/eslint-plugin": "^5.53.0",
3638
"@typescript-eslint/parser": "^5.53.0",
39+
"commander": "^10.0.0",
3740
"commitizen": "^4.3.0",
41+
"dayjs": "^1.11.7",
3842
"dotenv": "^16.0.3",
3943
"eslint": "^8.34.0",
4044
"eslint-plugin-astro": "^0.23.0",
4145
"eslint-plugin-simple-import-sort": "^10.0.0",
4246
"husky": "^8.0.3",
4347
"lodash.get": "^4.4.2",
4448
"lodash.kebabcase": "^4.1.1",
49+
"mustache": "^4.2.0",
4550
"sass": "^1.58.3",
4651
"tailwindcss-themer": "^3.0.1",
52+
"tsx": "^3.12.3",
4753
"typescript": "^4.9.5"
4854
}
4955
}

0 commit comments

Comments
 (0)