Skip to content

Commit 41504fc

Browse files
authored
docs: use vitepress (#3921)
* docs: use vitepress * docs: update src docs references
1 parent 0a583d3 commit 41504fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1844
-2127
lines changed

.github/CONTRIBUTING.md

+31-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Please consider these guidelines when filing a pull request:
3838
_ What you added
3939
_ What you removed
4040

41-
## Coding Rules
41+
### Coding Rules
4242

4343
To keep the code base of commitlint neat and tidy the following rules apply to every change
4444

@@ -48,7 +48,7 @@ To keep the code base of commitlint neat and tidy the following rules apply to e
4848
- Favor micro library over swiss army knives (rimraf, ncp vs. fs-extra)
4949
- Be awesome
5050

51-
## Commit Rules
51+
### Commit Rules
5252

5353
To help everyone with understanding the commit history of commitlint the following commit rules are enforced.
5454
To make your life easier commitlint is commitizen-friendly and provides the npm run-script `commit`.
@@ -61,17 +61,43 @@ To make your life easier commitlint is commitizen-friendly and provides the npm
6161
- maximum of 100 characters
6262
- message format of `$type($scope): $message`
6363

64-
## Testing
64+
### Environment setup
6565

66-
From the project root directory, use the following commands to run the test suite
66+
This project uses `yarn`, so be sure that it is available in your shell environment.
67+
68+
After cloning the repo run
6769

6870
```sh
69-
yarn clean
7071
yarn install
72+
```
73+
74+
### Testing
75+
76+
From the project root directory, use the following commands to run the test suite
77+
78+
```sh
7179
yarn build
7280
yarn test
7381
```
7482

83+
### Documentation updates
84+
85+
Documentation uses `vitepress`.
86+
To run and edit the documentation locally run:
87+
88+
```sh
89+
yarn docs-dev
90+
```
91+
92+
To have a preview of the deployed doc run:
93+
94+
```sh
95+
yarn docs-build
96+
yarn docs-serve
97+
```
98+
99+
For more information refer to [vitepress documentation](https://vitepress.dev).
100+
75101
## Package dependency overview
76102

77103
![commitlint-dependencies](https://user-images.githubusercontent.com/4248851/58385093-34b79780-7feb-11e9-8f27-bffc4aca3eba.png)

.github/workflows/docs-deploy.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Deploy docs site to Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: false
17+
18+
jobs:
19+
# Build job
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Setup Node
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 18
32+
cache: yarn
33+
34+
- name: Setup Pages
35+
uses: actions/configure-pages@v4
36+
37+
- name: Install dependencies
38+
run: yarn install
39+
40+
- name: Build with VitePress
41+
run: |
42+
yarn docs-build
43+
touch ./docs/.vitepress/dist/.nojekyll
44+
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v3
47+
with:
48+
path: ./docs/.vitepress/dist
49+
50+
# Deployment job
51+
deploy:
52+
environment:
53+
name: docs
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
needs: build
56+
runs-on: ubuntu-latest
57+
name: Deploy
58+
steps:
59+
- name: Deploy to GitHub Pages
60+
id: deployment
61+
uses: actions/deploy-pages@v4

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@ package.json.lerna_backup
1313
tsconfig.tsbuildinfo
1414
coverage
1515

16+
docs/.vitepress/dist
17+
docs/.vitepress/cache
18+
1619
# For testing nested workspaces does not have the package's dependencies name in the scope
1720
!**/config-lerna-scopes/fixtures/nested-workspaces/**/node_modules

@commitlint/cli/README.md

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
> Lint commit messages
1+
# @commitlint/cli
22

33
<p align="center">
4-
<img width="750" src="https://conventional-changelog.github.io/commitlint/assets/commitlint.svg">
4+
<img width="750" src="https://commitlint.js.org/assets/commitlint.svg">
55
</p>
66

7-
# @commitlint/cli
8-
9-
## Getting started
7+
Lint commit messages
108

11-
```
12-
npm install --save-dev @commitlint/cli @commitlint/config-angular
13-
echo "module.exports = {extends: ['@commitlint/config-angular']};" > commitlint.config.js
14-
```
9+
## Documentation
1510

16-
Consult [docs/cli](https://conventional-changelog.github.io/commitlint/#/reference-cli) for comprehensive documentation.
11+
Consult [CLI reference](https://commitlint.js.org/reference/cli) for comprehensive documentation.

@commitlint/cli/src/cli.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ async function main(args: MainArgs): Promise<void> {
306306
name: 'empty-rules',
307307
message: [
308308
'Please add rules to your `commitlint.config.js`',
309-
' - Getting started guide: https://commitlint.js.org/#/?id=getting-started',
309+
' - Getting started guide: https://commitlint.js.org/guides/getting-started',
310310
' - Example config: https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/config-conventional/src/index.ts',
311311
].join('\n'),
312312
},

@commitlint/config-angular/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
> Lint your commits, angular-style
2-
31
# @commitlint/config-angular
42

3+
Lint your commits, angular-style
4+
55
Shareable `commitlint` config enforcing the [Angular commit convention](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit).
66
Use with [@commitlint/cli](../cli) and [@commitlint/prompt-cli](../prompt-cli).
77

88
## Getting started
99

1010
```sh
1111
npm install --save-dev @commitlint/config-angular @commitlint/cli
12-
echo "module.exports = {extends: ['@commitlint/config-angular']};" > commitlint.config.js
12+
echo "export default {extends: ['@commitlint/config-angular']};" > commitlint.config.js
1313
```
1414

1515
## Rules
1616

1717
### Problems
1818

1919
The following rules are considered problems for `@commitlint/config-angular` and will yield a non-zero exit code when not met.
20-
Consult [docs/rules](https://conventional-changelog.github.io/commitlint/#/reference-rules) for a list of available rules.
20+
Consult [Rules reference](https://commitlint.js.org/reference/rules) for a list of available rules.
2121

2222
#### type-enum
2323

@commitlint/config-conventional/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
> Lint your conventional commits
2-
31
# @commitlint/config-conventional
42

3+
Lint your conventional commits
4+
55
Shareable `commitlint` config enforcing [conventional commits](https://conventionalcommits.org/).
66
Use with [@commitlint/cli](https://npm.im/@commitlint/cli) and [@commitlint/prompt-cli](https://npm.im/@commitlint/prompt-cli).
77

88
## Getting started
99

1010
```sh
1111
npm install --save-dev @commitlint/config-conventional @commitlint/cli
12-
echo "module.exports = {extends: ['@commitlint/config-conventional']};" > commitlint.config.js
12+
echo "export default {extends: ['@commitlint/config-conventional']};" > commitlint.config.js
1313
```
1414

1515
## Rules
@@ -18,7 +18,7 @@ echo "module.exports = {extends: ['@commitlint/config-conventional']};" > commit
1818

1919
The following rules are considered problems for `@commitlint/config-conventional` and will yield a non-zero exit code when not met.
2020

21-
Consult [docs/rules](https://conventional-changelog.github.io/commitlint/#/reference-rules) for a list of available rules.
21+
Consult [Rules reference](https://commitlint.js.org/reference/rules) for a list of available rules.
2222

2323
#### type-enum
2424

@commitlint/config-lerna-scopes/readme.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
> Lint your lerna project commits
2-
31
# @commitlint/config-lerna-scopes
42

3+
Lint your lerna project commits
4+
55
Shareable `commitlint` config enforcing lerna package and workspace names as scopes.
66
Use with [@commitlint/cli](../cli) and [@commitlint/prompt-cli](../prompt-cli).
77

88
## Getting started
99

10-
```
10+
```sh
1111
npm install --save-dev @commitlint/config-lerna-scopes @commitlint/cli
12-
echo "module.exports = {extends: ['@commitlint/config-lerna-scopes']};" > commitlint.config.js
12+
echo "export default {extends: ['@commitlint/config-lerna-scopes']};" > commitlint.config.js
1313
```
1414

1515
## Examples
1616

17-
```
17+
```text
1818
❯ cat commitlint.config.js
1919
{
2020
extends: ['@commitlint/config-lerna-scopes']
@@ -41,4 +41,4 @@ packages
4141
✔ found 0 problems, 0 warnings
4242
```
4343

44-
Consult [docs/rules](https://conventional-changelog.github.io/commitlint/#/reference-rules) for a list of available rules.
44+
Consult [Rules reference](https://commitlint.js.org/reference/rules) for a list of available rules.

@commitlint/config-nx-scopes/readme.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
> Lint your nx project commits
2-
31
# @commitlint/config-nx-scopes
42

3+
Lint your nx project commits
4+
55
Shareable `commitlint` config enforcing nx project and workspace names as scopes.
66
Use with [@commitlint/cli](../cli) and [@commitlint/prompt-cli](../prompt-cli).
77

@@ -98,4 +98,4 @@ packages
9898
✔ found 0 problems, 0 warnings
9999
```
100100

101-
Consult [docs/rules](https://conventional-changelog.github.io/commitlint/#/reference-rules) for a list of available rules.
101+
Consult [Rules reference](https://commitlint.js.org/reference/rules) for a list of available rules.

@commitlint/config-patternplate/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
> Lint your commits, patternplate-style
2-
31
# @commitlint/config-patternplate
42

3+
Lint your commits, patternplate-style
4+
55
Shareable `commitlint` config enforcing the patternplate commit convention.
66
Use with [@commitlint/cli](../cli) and [@commitlint/prompt-cli](../prompt-cli).
77

@@ -27,4 +27,4 @@ The following rules are considered problems for `@commitlint/config-patternplate
2727
- **rule**: `always`
2828
- **value**: determined based on pattern tree. `system` and all pattern ids present in `patterns` are allowed
2929

30-
Consult [docs/rules](https://conventional-changelog.github.io/commitlint/#/reference-rules) for a list of available rules.
30+
Consult [Rules reference](https://commitlint.js.org/reference/rules) for a list of available rules.

@commitlint/config-pnpm-scopes/readme.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
> Lint your pnpm workspaces project commits
2-
31
# @commitlint/config-pnpm-scopes
42

3+
Lint your pnpm workspaces project commits
4+
55
Shareable `commitlint` config enforcing pnpm workspaces names as scopes.
66
Use with [@commitlint/cli](../cli) and [@commitlint/prompt-cli](../prompt-cli).
77

@@ -41,4 +41,4 @@ packages
4141
✔ found 0 problems, 0 warnings
4242
```
4343

44-
Consult [docs/rules](https://conventional-changelog.github.io/commitlint/#/reference-rules) for a list of available rules.
44+
Consult [Rules reference](https://commitlint.js.org/reference/rules) for a list of available rules.

@commitlint/config-rush-scopes/readme.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
> Lint your rush project commits
2-
31
# @commitlint/config-rush-scopes
42

3+
Lint your rush project commits
4+
55
Shareable `commitlint` config enforcing rush package and workspace names as scopes.
66
Use with [@commitlint/cli](../cli) and [@commitlint/prompt-cli](../prompt-cli).
77

88
## Getting started
99

10-
```
10+
```sh
1111
npm install --save-dev @commitlint/config-rush-scopes @commitlint/cli
12-
echo "module.exports = {extends: ['@commitlint/config-rush-scopes']};" > commitlint.config.js
12+
echo "export default {extends: ['@commitlint/config-rush-scopes']};" > commitlint.config.js
1313
```
1414

1515
## Examples
1616

17-
```
17+
```text
1818
❯ cat commitlint.config.js
1919
{
2020
extends: ['@commitlint/config-rush-scopes']
@@ -41,4 +41,4 @@ packages
4141
✔ found 0 problems, 0 warnings
4242
```
4343

44-
Consult [docs/rules](https://conventional-changelog.github.io/commitlint/#/reference-rules) for a list of available rules.
44+
Consult [Rules reference](https://commitlint.js.org/reference/rules) for a list of available rules.

@commitlint/cz-commitlint/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ yarn commit
5858

5959
## Related
6060

61-
- [Commitlint Reference Prompt](https://commitlint.js.org/#/reference-prompt) - How to customize prompt information by setting commitlint.config.js
61+
- [Commitlint Reference Prompt](https://commitlint.js.org/reference/prompt) - How to customize prompt information by setting commitlint.config.js

0 commit comments

Comments
 (0)