Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add new website using Astro Starlight #5246

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cec32f1
docs: add new website using Astro Starlight
JoshuaKGoldberg Nov 6, 2024
a1a9a29
chore: add docs command to package.json
JoshuaKGoldberg Nov 6, 2024
a358e97
Add supporters.js dependencies
JoshuaKGoldberg Nov 6, 2024
5d32931
add root-level install to npm run docs
JoshuaKGoldberg Nov 6, 2024
5746ba3
remove question mark
JoshuaKGoldberg Nov 6, 2024
acf9c98
docs-next/netlify.toml
JoshuaKGoldberg Nov 6, 2024
ec77192
console.log(process.env)
JoshuaKGoldberg Nov 6, 2024
619f043
Don't have /next base in Netlify
JoshuaKGoldberg Nov 6, 2024
ee4e7ca
More proper astro.config.mjs
JoshuaKGoldberg Nov 6, 2024
e73dc7d
linting
JoshuaKGoldberg Nov 6, 2024
d5b2d20
Smaller title
JoshuaKGoldberg Nov 6, 2024
45c8cbe
Dark mode fixups
JoshuaKGoldberg Nov 6, 2024
677435c
Slightly darker sl-color-white
JoshuaKGoldberg Nov 6, 2024
9c208fb
Mentioned this being WIP
JoshuaKGoldberg Nov 6, 2024
af8d486
Missing _
JoshuaKGoldberg Nov 6, 2024
cffc08b
Tweaked notice
JoshuaKGoldberg Nov 6, 2024
875980b
Tweaked notice colors
JoshuaKGoldberg Nov 6, 2024
ef1da33
Tweaked notice text
JoshuaKGoldberg Nov 6, 2024
8a3c2e8
fix /api and /example/tests.html links
JoshuaKGoldberg Nov 6, 2024
d597dd9
fix: responsive homepage title
JoshuaKGoldberg Nov 6, 2024
82f52da
fix: sized responsive homepage title
JoshuaKGoldberg Nov 6, 2024
f78e95f
Added <Head> override for mocha-thumbnail.svg
JoshuaKGoldberg Nov 6, 2024
7a7e3b0
Added starting buttons
JoshuaKGoldberg Nov 6, 2024
ab8a674
fix: starting buttons config link
JoshuaKGoldberg Nov 6, 2024
cdcf57b
fix: starting buttons 'ing'
JoshuaKGoldberg Nov 6, 2024
be6316b
Footer mobile responsiveness, and root netlify.toml revert
JoshuaKGoldberg Nov 7, 2024
83353e3
Simpler, more accurate test file
JoshuaKGoldberg Nov 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs-next/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.astro/
dist/
node_modules/
src/content/data/supporters.json
3 changes: 3 additions & 0 deletions docs-next/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"bracketSpacing": true
}
9 changes: 9 additions & 0 deletions docs-next/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Mocha Docs vNext: Built on Astro Starlight

After `cd`ing into this directory:

```shell
npm i
npm run prebuild
npm run dev
```
124 changes: 124 additions & 0 deletions docs-next/astro.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";

export default defineConfig({
// For now, this is only being deployed to mocha-docs-next.netlify.app.
// Soon we'll move it onto mochajs.org/next.
...(!process.env.NETLIFY_BUILD_BASE && { base: "/next" }),
integrations: [
starlight({
components: {
Footer: "./src/components/Footer.astro",
Head: "./src/components/Head.astro",
PageTitle: "./src/components/PageTitle.astro",
},
customCss: ["./src/style/custom.css"],
logo: {
dark: "./src/components/icon-dark.svg",
light: "./src/components/icon-light.svg",
},
sidebar: [
{ label: "Getting Started", slug: "getting-started" },
{
items: [
{ label: "CLI", slug: "running/cli" },
{ label: "Configuring", slug: "running/configuring" },
{ label: "Editor Plugins", slug: "running/editor-plugins" },
{ label: "Browsers", slug: "running/browsers" },
{ label: "Test Globs", slug: "running/test-globs" },
],
label: "Running Mocha",
},
{
items: [
{ label: "Dynamic Tests", slug: "declaring/dynamic-tests" },
{ label: "Exclusive Tests", slug: "declaring/exclusive-tests" },
{ label: "Inclusive Tests", slug: "declaring/inclusive-tests" },
{ label: "Pending Tests", slug: "declaring/pending-tests" },
{ label: "Retrying Tests", slug: "declaring/retrying-tests" },
],
label: "Declaring Tests",
},
{
items: [
{ label: "Arrow Functions", slug: "features/arrow-functions" },
{ label: "Assertions", slug: "features/assertions" },
{ label: "Asynchronous Code", slug: "features/asynchronous-code" },
{ label: "Error Codes", slug: "features/error-codes" },
{ label: "Global Fixtures", slug: "features/global-fixtures" },
{ label: "Hooks", slug: "features/hooks" },
{ label: "Parallel Mode", slug: "features/parallel-mode" },
{ label: "Root Hook Plugins", slug: "features/root-hook-plugins" },
{ label: "Timeouts", slug: "features/timeouts" },
],
label: "Features",
},
{
collapsed: true,
items: [
{ label: "BDD (Default)", slug: "interfaces/bdd" },
{ label: "TDD", slug: "interfaces/tdd" },
{ label: "Exports", slug: "interfaces/exports" },
{ label: "QUnit", slug: "interfaces/qunit" },
{ label: "Require", slug: "interfaces/require" },
{ label: "Third-Party", slug: "interfaces/third-party" },
],
label: "Interfaces",
},
{
collapsed: true,
items: [
{ label: "Spec (Default)", slug: "reporters/spec" },
{ label: "Doc", slug: "reporters/doc" },
{ label: "Dot", slug: "reporters/dot" },
{ label: "HTML", slug: "reporters/html" },
{ label: "JSON Stream", slug: "reporters/json-stream" },
{ label: "JSON", slug: "reporters/json" },
{ label: "Landing", slug: "reporters/landing" },
{ label: "List", slug: "reporters/list" },
{ label: "Markdown", slug: "reporters/markdown" },
{ label: "Min", slug: "reporters/min" },
{ label: "Nyan", slug: "reporters/nyan" },
{ label: "Progress", slug: "reporters/progress" },
{ label: "Tap", slug: "reporters/tap" },
{ label: "XUnit", slug: "reporters/xunit" },
{ label: "Third-Party", slug: "reporters/third-party" },
],
label: "Reporters",
},
{
collapsed: true,
items: [
{
label: "Detecting Multiple Calls to done()",
slug: "explainers/detecting-multiple-calls-to-done",
},
{
label: "Node.js Native ESM Support",
slug: "explainers/nodejs-native-esm-support",
},
{
label: "Run Cycle Overview",
slug: "explainers/run-cycle-overview",
},
{ label: "Test Duration", slug: "explainers/test-duration" },
{
label: "Test Fixture Decision Tree",
slug: "explainers/test-fixture-decision-tree",
},
],
label: "Explainers",
},
{
label: "API",
link: "https://mochajs.org/api",
},
],
social: {
discord: "https://discord.gg/KeDn2uXhER",
github: "https://github.com/mochajs/mocha",
},
title: "Mocha",
}),
],
});
11 changes: 11 additions & 0 deletions docs-next/netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[build]
command = "npm run docs"
publish = "dist/"

[build.environment]
DEBUG = "mocha:docs*"
NODE_VERSION = "20"

[context.deploy-preview]
command = "npm run docs"
publish = "dist/"
Loading
Loading