Skip to content

Commit 8155043

Browse files
authored
docs: add every package manager (conventional-changelog#4501)
1 parent 030f287 commit 8155043

File tree

2 files changed

+92
-4
lines changed

2 files changed

+92
-4
lines changed

docs/guides/local-setup.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,30 @@ Info about git hooks can be found on [Git documentation](https://git-scm.com/boo
147147
148148
For a first simple usage test of commitlint you can do the following:
149149
150-
```bash
150+
::: code-group
151+
152+
```sh [npm]
151153
npx commitlint --from HEAD~1 --to HEAD --verbose
152154
```
153155
156+
```sh [yarn]
157+
yarn commitlint --from HEAD~1 --to HEAD --verbose
158+
```
159+
160+
```sh [pnpm]
161+
pnpm dlx commitlint --from HEAD~1 --to HEAD --verbose
162+
```
163+
164+
```sh [bun]
165+
bunx commitlint --from HEAD~1 --to HEAD --verbose
166+
```
167+
168+
```sh [deno]
169+
deno task --eval commitlint --from HEAD~1 --to HEAD --verbose
170+
```
171+
172+
:::
173+
154174
This will check your last commit and return an error if invalid or a positive output if valid.
155175
156176
### Test the hook

docs/guides/use-prompt.md

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,62 @@
1212

1313
2. Create a package.json if needed
1414

15-
```sh
15+
::: code-group
16+
17+
```sh [npm]
1618
npm init
1719
```
1820

21+
```sh [yarn]
22+
yarn init
23+
```
24+
25+
```sh [pnpm]
26+
pnpm init
27+
```
28+
29+
```sh [bun]
30+
bun init
31+
```
32+
33+
:::
34+
1935
3. Install and configure if needed
2036

21-
```sh
37+
::: code-group
38+
39+
```sh [npm]
2240
npm install --save-dev @commitlint/cli @commitlint/config-conventional @commitlint/prompt-cli
2341

2442
echo "export default { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
2543
```
2644

45+
```sh [yarn]
46+
yarn add --dev @commitlint/cli @commitlint/config-conventional @commitlint/prompt-cli
47+
48+
echo "export default { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
49+
```
50+
51+
```sh [pnpm]
52+
pnpm add --save-dev @commitlint/cli @commitlint/config-conventional @commitlint/prompt-cli
53+
54+
echo "export default { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
55+
```
56+
57+
```sh [bun]
58+
bun add --dev @commitlint/cli @commitlint/config-conventional @commitlint/prompt-cli
59+
60+
echo "export default { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
61+
```
62+
63+
```sh [deno]
64+
deno add --dev npm:@commitlint/cli npm:@commitlint/config-conventional npm:@commitlint/prompt-cli
65+
66+
echo "export default { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
67+
```
68+
69+
:::
70+
2771
## Provide a shortcut
2872

2973
To make prompt-cli easy to use, add a npm run-script to your `package.json`
@@ -38,11 +82,35 @@ To make prompt-cli easy to use, add a npm run-script to your `package.json`
3882

3983
Test the prompt by executing
4084

41-
```bash
85+
::: code-group
86+
87+
```sh [npm]
4288
git add .
4389
npm run commit
4490
```
4591

92+
```sh [yarn]
93+
git add .
94+
yarn commit
95+
```
96+
97+
```sh [pnpm]
98+
git add .
99+
pnpm commit
100+
```
101+
102+
```sh [bun]
103+
git add .
104+
bun commit
105+
```
106+
107+
```sh [deno]
108+
git add .
109+
deno task commit
110+
```
111+
112+
:::
113+
46114
## An alternative to `@commitlint/prompt-cli`: commitizen
47115

48116
Another way to author commit messages that adhere to the commit convention configured in `commitlint.config.js` is to use `commitizen`.

0 commit comments

Comments
 (0)