Skip to content

Commit 27cf32f

Browse files
authored
docs: replace Jekyll with VitePress documentation site (#2720)
* chore: remove old Jekyll documentation site and dependencies Delete the Jekyll-based documentation site including: - _config.yml, _layouts, _includes, _sass, _data themes - Jekyll assets, how-to guides, release-source docs - Versioned release documentation infrastructure - Root Gemfile and Gemfile.lock * docs: add VitePress documentation site Replace the old docs with a VitePress-based site featuring: - Modern search, dark mode, and fast builds - Executable documentation examples via tap (imported via symlink) - Auto-generated sidebar from concept index pages - LLM-friendly plaintext output via vitepress-plugin-llms - Isolated dependencies in docs/package.json - Scripts for link-checking and sidebar generation * chore: remove Jekyll scripts and docs release copying Remove Jekyll-related npm scripts from root package.json: - docs:watch, lint:docs, docs:check-links Remove versioned docs release copying from postversion.sh. The new VitePress docs are built and deployed via GitHub Actions. * docs: update contributing guide for VitePress setup Replace Jekyll setup instructions with VitePress equivalents: - Local dev server via npm run docs:dev - Build and preview commands - Documentation testing instructions * ci: add GitHub Actions workflow for documentation Build, link-check, and deploy the VitePress docs site to GitHub Pages on every push to main. Requires switching Pages source to GitHub Actions after merge.
1 parent 6255b73 commit 27cf32f

666 files changed

Lines changed: 25683 additions & 18331 deletions

File tree

Some content is hidden

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

.github/workflows/codeql.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
schedule:
9+
- cron: "0 0 * * 1"
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
analyze:
16+
name: Analyze
17+
runs-on: ubuntu-latest
18+
permissions:
19+
actions: read
20+
contents: read
21+
security-events: write
22+
23+
steps:
24+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25+
with:
26+
persist-credentials: false
27+
28+
- name: Initialize CodeQL
29+
uses: github/codeql-action/init@d77b13a0df3134d64a457ea9003f600b09fa1c8a # v3.36.1
30+
with:
31+
languages: javascript
32+
33+
- name: Autobuild
34+
uses: github/codeql-action/autobuild@d77b13a0df3134d64a457ea9003f600b09fa1c8a # v3.36.1
35+
36+
- name: Perform CodeQL Analysis
37+
uses: github/codeql-action/analyze@d77b13a0df3134d64a457ea9003f600b09fa1c8a # v3.36.1

.github/workflows/docs.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'docs/**'
8+
- '.github/workflows/docs.yml'
9+
pull_request:
10+
branches: [main]
11+
paths:
12+
- 'docs/**'
13+
- '.github/workflows/docs.yml'
14+
workflow_dispatch:
15+
16+
permissions:
17+
contents: read
18+
19+
concurrency:
20+
group: pages-${{ github.ref }}
21+
cancel-in-progress: false
22+
23+
defaults:
24+
run:
25+
working-directory: docs
26+
27+
jobs:
28+
build:
29+
runs-on: ubuntu-latest
30+
permissions:
31+
contents: read
32+
pages: write
33+
steps:
34+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
35+
with:
36+
persist-credentials: false
37+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
38+
with:
39+
node-version: '20'
40+
cache: 'npm'
41+
cache-dependency-path: docs/package-lock.json
42+
- run: npm ci
43+
- run: npm run docs:build
44+
- uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
45+
with:
46+
path: docs/.vitepress/dist
47+
48+
deploy:
49+
if: github.ref == 'refs/heads/main'
50+
needs: build
51+
runs-on: ubuntu-latest
52+
permissions:
53+
contents: read
54+
pages: write
55+
id-token: write
56+
environment:
57+
name: github-pages
58+
url: ${{ steps.deployment.outputs.page_url }}
59+
steps:
60+
- uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
61+
id: deployment
62+
63+
link-check:
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
67+
with:
68+
persist-credentials: false
69+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
70+
with:
71+
node-version: '20'
72+
cache: 'npm'
73+
cache-dependency-path: docs/package-lock.json
74+
- run: npm ci
75+
- run: npm run docs:build
76+
- uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2.8.0
77+
with:
78+
args: >
79+
docs/.vitepress/dist
80+
--root-dir docs/.vitepress/dist
81+
--exclude "^file://"
82+
--exclude "opencollective"
83+
--exclude "llms"
84+
--exclude "node-tap.org"
85+
--accept '200..=299,403'
86+
fail: true

.prettierignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@ out/
33
pkg/
44
tmp/
55
.sass-cache
6-
docs/_site/
7-
docs/js/
8-
docs/assets/js/
6+
docs/
97
vendor

CONTRIBUTING.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
There are several ways of contributing to Sinon.JS
44

55
- Look into [issues tagged `help-wanted`](https://github.com/sinonjs/sinon/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+wanted%22)
6-
- Help [improve the documentation](https://github.com/sinonjs/sinon/tree/master/docs) published
7-
at [the Sinon.JS website](https://sinonjs.org). [Documentation issues](https://github.com/sinonjs/sinon/issues?q=is%3Aopen+is%3Aissue+label%3ADocumentation).
6+
- Help [improve the documentation](https://sinonjs.org) built with [VitePress](https://vitepress.dev). [Documentation issues](https://github.com/sinonjs/sinon/issues?q=is%3Aopen+is%3Aissue+label%3ADocumentation).
87
- Help someone understand and use Sinon.JS on [Stack Overflow](https://stackoverflow.com/questions/tagged/sinon)
98
- Report an issue, please read instructions below
109
- Help with triaging the [issues](https://github.com/sinonjs/sinon/issues). The clearer they are, the more likely they are to be fixed soon.
@@ -106,12 +105,11 @@ To ensure consistent reporting of lint warnings, you should use the same version
106105

107106
### Tooling
108107

109-
To transparently handle all issues with different tool versions we recommend using [_ASDF: The Multiple Runtime Manager_][asdf]. You would then need the Ruby and Node plugins.
108+
To transparently handle all issues with different tool versions we recommend using [_ASDF: The Multiple Runtime Manager_][asdf]. You would then need the Node plugin.
110109

111110
<details>
112111

113112
```
114-
asdf plugin add ruby
115113
asdf plugin add nodejs
116114
asdf install
117115
```
@@ -166,3 +164,42 @@ To build run
166164
$ node build.cjs
167165

168166
The `lib/` directory is generated output. Do not commit it; rebuild it locally with `npm run build` when you need fresh artifacts. The published npm tarball still includes `lib/` via the package allowlist.
167+
168+
## Contributing to documentation
169+
170+
The documentation is built with [VitePress](https://vitepress.dev).
171+
172+
### Local setup
173+
174+
```sh
175+
cd docs
176+
npm install
177+
npm run docs:dev
178+
```
179+
180+
All docs commands (`docs:build`, `test:docs`, etc.) should be run from the `docs/` directory.
181+
182+
### Build and preview
183+
184+
```sh
185+
npm run docs:build
186+
npm run docs:preview
187+
```
188+
189+
### Testing documentation examples
190+
191+
```sh
192+
npm run test:docs
193+
```
194+
195+
### Checking links
196+
197+
Link checking requires [lychee](https://lychee.cli.rs/installation/), which is not installed via npm. Install it separately, then run:
198+
199+
```sh
200+
npm run docs:link-check
201+
```
202+
203+
### Deploying
204+
205+
The site is deployed automatically via GitHub Actions when changes are merged to `main`.

Gemfile

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)