Skip to content

Commit d8c310e

Browse files
chore: remove legacy docs/ (#5583)
1 parent 33ce345 commit d8c310e

Some content is hidden

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

84 files changed

+52
-25899
lines changed

.eleventy.js

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

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Mocha-specific
2-
docs/_site
32
docs/images/supporters
4-
docs/api
53
mocha.js
64
mocha.js.map
75
.karma/

.knip.jsonc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"bin/mocha.js!",
55
"bin/_mocha!",
66
"browser-entry.js!",
7+
"docs/_data/supporters.js",
78
"index.js!",
89
"lib/cli/index.js!",
910
],
@@ -13,11 +14,9 @@
1314
"test/integration/fixtures/options/watch/test-with-dependency.fixture.js",
1415
],
1516
"ignoreDependencies": [
16-
"@mocha/docdash",
1717
"@test/esm-only-loader",
1818
"coffeescript",
1919
"fake",
20-
"jsdoc-ts-utils",
2120
"non-existent-package",
2221
],
2322
"mocha": {

.prettierignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
/.nyc_output
33
/CHANGELOG.md
44
/coverage
5-
/docs/_site/
6-
/docs/api/
7-
/docs/css/normalize.css
8-
/docs/css/prism.css
9-
/docs/js/
105
/pnpm-lock.yaml
116
/test/*/fixtures/**
127

docs-next/README.md

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,16 @@
11
# Mocha Docs: Built on Astro Starlight
22

3-
This is the new site, hosted at https://mochajs.org/next and built with [Astro Starlight](https://starlight.astro.build). For details on how to build alongside the old site, see the `docs` directory.
3+
This is the current Mocha documentation website, hosted at [mochajs.org](https://mochajs.org) and built with [Astro Starlight](https://starlight.astro.build).
44

5-
## Preview the new site on its own
5+
> For details on the legacy site, see [https://github.com/mochajs/docs-legacy](mochajs/docs-legacy).
66
7-
To run this site alone:
7+
## Preview the new site
8+
9+
To run this site:
810

911
```shell
1012
cd docs-next
1113
npm i
1214
npm run generate
1315
npm run dev
1416
```
15-
16-
## Build the new site into a folder with the old site
17-
18-
```shell
19-
cd docs-next
20-
npm i
21-
npm run build-with-old
22-
```
23-
24-
## Preview the old and new site together
25-
26-
First, build the new site into a folder with the old site above.
27-
28-
```shell
29-
cd .. # back to root dir
30-
npm run docs:preview
31-
```
32-
33-
The new site will be at `http://localhost:8080/next`
34-
35-
However, note that relative links may resolve with `dev` but fail with `build` and `preview` (see https://github.com/mochajs/mocha/issues/5415).

docs-next/_redirects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/api/* https://legacy.mochajs.org/api/:splat 301

docs-next/astro.config.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
11
import { defineConfig } from "astro/config";
22
import starlight from "@astrojs/starlight";
3-
import { visit } from "unist-util-visit";
4-
5-
const base = "/next";
6-
7-
/** Prepend base URL to non-`/api` absolute links */
8-
const rewriteLinks = ({ base }: { base: string }) => {
9-
return (tree: any) => {
10-
visit(tree, "link", (node) => {
11-
if (node.url.startsWith("/") && !node.url.startsWith("/api")) {
12-
node.url = base + node.url;
13-
}
14-
});
15-
};
16-
};
173

184
export default defineConfig({
19-
base,
205
integrations: [
216
starlight({
227
components: {
@@ -196,7 +181,4 @@ export default defineConfig({
196181
title: "Mocha",
197182
}),
198183
],
199-
markdown: {
200-
remarkPlugins: [[rewriteLinks, { base }]],
201-
},
202184
});

docs-next/netlify.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[build]
22
command = "npm run docs"
3-
publish = "dist/"
3+
publish = "docs-next/dist/"
44

55
[build.environment]
66
DEBUG = "mocha:docs*"
7-
NODE_VERSION = "20"
7+
NODE_VERSION = "24"
88

99
[context.deploy-preview]
1010
command = "npm run docs"
11-
publish = "dist/"
11+
publish = "docs-next/dist/"

docs-next/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
"scripts": {
66
"astro": "astro",
77
"build": "astro check && astro build",
8-
"build-with-old": "npm run generate && npm run build -- --outDir ../docs/_site/next",
98
"dev": "astro dev",
10-
"docs": "cd .. && npm i && cd docs-next && npm run generate && npm run build",
9+
"docs": "cd .. && npm i && cd docs-next && npm i && npm run generate && npm run build && cp _redirects dist/_redirects",
1110
"generate": "node ../docs/_data/supporters.js --write-supporters-json",
1211
"preview": "astro preview",
1312
"start": "astro dev"

docs-next/src/content/docs/index.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ import Badges from "../../components/Badges.astro";
1414
import ClientRedirects from "../../components/ClientRedirects.astro";
1515
import Supporters from "../../components/Supporters.astro";
1616

17-
:::note[New Site Preview]
17+
:::note[New Documentation Site]
1818
Hello!
19-
Welcome to this preview of a revamped [**mochajs.org**](https://mochajs.org) docs site!
19+
Welcome to the newly revamped mochajs.org!
2020

21-
This is an early stage preview.
22-
If you see any **bugs** or **typos**, please [file a docs issue on mochajs/mocha](https://github.com/mochajs/mocha/issues/new?template=02-documentation.yml).
21+
If you see any bugs or typos, please [file a docs issue on mochajs/mocha](https://github.com/mochajs/mocha/issues/new?template=02-documentation.yml).
2322
Thanks!
2423
🤎
24+
25+
_For the old docs website, see: [legacy.mochajs.org](https://legacy.mochajs.org)_.
2526
:::
2627

2728
<Badges />
@@ -57,4 +58,4 @@ For a running example of Mocha, view [example/tests.html](example/tests.html).
5758

5859
For the JavaScript API, view the [API documentation](/api) or the [source](https://github.com/mochajs/mocha/blob/main/lib/mocha.js).
5960

60-
<ClientRedirects client:load />
61+
<ClientRedirects />

0 commit comments

Comments
 (0)