Skip to content

Commit 564defa

Browse files
Merge pull request #44 from MovByte/feat-scramjet-typedoc
feat: Scramjet TypeDoc Mirror
2 parents 5f59bce + fa574f2 commit 564defa

10 files changed

Lines changed: 118 additions & 13 deletions

File tree

‎.gitignore‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ dist/
55

66
# dependencies
77
node_modules/
8+
pnpm-lock.yaml
89

910
# logs
1011
npm-debug.log*
@@ -20,5 +21,9 @@ pnpm-debug.log*
2021
# macOS-specific files
2122
.DS_Store
2223

24+
# Starlight-TypeDoc generated
25+
src/content/docs/api
26+
27+
# Git
2328
package-lock.json
24-
pnpm-lock.yaml
29+
pnpm-lock.yaml

‎.gitmodules‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "typedoc-repos/scramjet"]
2+
path = typedoc-repos/scramjet
3+
url = https://github.com/MercuryWorkshop/scramjet.git

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Requirements are Node.js (v20+).
1111
Using `pnpm` is more recommended.
1212

1313
```
14-
git clone https://github.com/titaniumnetwork-dev/Oxide-Docs.git
14+
git clone https://github.com/titaniumnetwork-dev/Oxide-Docs.git --recursive
1515
cd Oxide-Docs
1616
npm i
1717

‎astro.config.ts‎

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { defineConfig } from "astro/config";
22
import starlight from "@astrojs/starlight";
3+
import starlightTypeDoc, { typeDocSidebarGroup } from "starlight-typedoc";
34
import rehypeAstroRelativeMarkdownLinks from "astro-rehype-relative-markdown-links";
45
import rehypeShiki from "@shikijs/rehype";
56

@@ -30,10 +31,32 @@ export default defineConfig({
3031
starlight({
3132
title: "Titanium Network",
3233
favicon: "/favicon.png",
33-
social: {
34-
github: "https://github.com/titaniumnetwork-dev/Oxide-Docs",
35-
discord: "https://discord.gg/unblock",
36-
},
34+
social: [
35+
{
36+
icon: "github",
37+
label: "GitHub",
38+
href: "https://github.com/titaniumnetwork-dev/Oxide-Docs",
39+
},
40+
{
41+
icon: "discord",
42+
label: "Discord",
43+
href: "https://discord.gg/unblock",
44+
},
45+
],
46+
plugins: [
47+
starlightTypeDoc({
48+
entryPoints: ["./typedoc-repos/scramjet/src/entry.ts"],
49+
tsconfig: "./tsconfig-scramjet.json",
50+
sidebar: {
51+
label: "Scramjet API",
52+
},
53+
typeDoc: {
54+
skipErrorChecking: true,
55+
excludeNotDocumented: false,
56+
treatWarningsAsErrors: false,
57+
},
58+
})
59+
],
3760
components: {
3861
Head: "./src/components/MetadataHead.astro",
3962
PageTitle: "./src/components/PageTitle.astro",
@@ -49,7 +72,12 @@ export default defineConfig({
4972
},
5073
{
5174
label: "Proxies",
52-
autogenerate: { directory: "proxies" },
75+
items: [
76+
"proxies/rammerhead",
77+
"proxies/ultraviolet",
78+
"proxies/scramjet",
79+
typeDocSidebarGroup,
80+
],
5381
},
5482
{
5583
label: "Technologies",

‎package.json‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@
2323
},
2424
"dependencies": {
2525
"@astrojs/check": "^0.9.4",
26-
"@astrojs/starlight": "^0.29.3",
26+
"@astrojs/starlight": "^0.35.2",
2727
"@fontsource/raleway": "^5.2.6",
2828
"@shikijs/rehype": "^3.12.0",
2929
"@shikijs/themes": "^3.12.0",
30-
"astro": "^4.16.19",
30+
"astro": "^5.13.5",
3131
"astro-rehype-relative-markdown-links": "^0.18.1",
3232
"gray-matter": "^4.0.3",
3333
"sharp": "^0.32.6",
34+
"starlight-typedoc": "^0.21.3",
35+
"typedoc": "^0.28.11",
3436
"typescript": "^5.9.2"
3537
},
3638
"devDependencies": {

‎src/components/MetadataHead.astro‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ interface MetadataFrontmatter {
1313
}
1414
1515
const { entry } = Astro.props as Props;
16-
const { data: frontmatter } = entry;
16+
17+
const frontmatter = entry?.data || {};
1718
const { title, description } = frontmatter;
1819
1920
/**
@@ -36,15 +37,15 @@ const FRONTMATTER = frontmatter as MetadataFrontmatter;
3637
/**
3738
* The image to generate for the metadata
3839
*/
39-
const IMAGE = FRONTMATTER.image || DEFAULT_METADATA.defaultImage;
40+
const IMAGE = FRONTMATTER?.image || DEFAULT_METADATA.defaultImage;
4041
/**
4142
* The keywords to generate for the metadata
4243
*/
43-
const KEYWORDS = FRONTMATTER.keywords || [];
44+
const KEYWORDS = FRONTMATTER?.keywords || [];
4445
/**
4546
* The theme color to generate for the metadata
4647
*/
47-
const THEME_COLOR = FRONTMATTER.themeColor || DEFAULT_METADATA.themeColor;
48+
const THEME_COLOR = FRONTMATTER?.themeColor || DEFAULT_METADATA.themeColor;
4849
---
4950

5051
<!-- Unofficial Web Standards -->

‎src/content/docs/proxies/scramjet.mdx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,7 @@ With:
102102
## Upgrading from Ultraviolet
103103

104104
Scramjet is easier to setup than UV. You may still use UV alongside Scramjet if you really find it necessary, however UV is unmaintained software and has far less site support than Scramjet.
105+
106+
# Official docs
107+
108+
You can read the [full Scramjet Typedocs](https://scramjet.mercurywork.shop/typedoc) for better API documentation.

‎tsconfig-scramjet.json‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2022",
4+
"moduleResolution": "Bundler",
5+
"module": "ES2022",
6+
"skipLibCheck": true,
7+
"lib": ["ES2022", "WebWorker", "DOM"],
8+
"skipDefaultLibCheck": true,
9+
"noResolve": false,
10+
"isolatedModules": true,
11+
"paths": {
12+
"@rewriters/*": ["./typedoc-repos/scramjet/src/shared/rewriters/*"],
13+
"@client/*": ["./typedoc-repos/scramjet/src/client/*"],
14+
"@/*": ["./typedoc-repos/scramjet/src/*"]
15+
}
16+
},
17+
"include": [
18+
"typedoc-repos/scramjet/src/entry.ts",
19+
"typedoc-scramjet-globals.d.ts"
20+
],
21+
"exclude": [
22+
"node_modules",
23+
"**/__tests__/**",
24+
"**/*.spec.ts",
25+
"**/*.test.ts",
26+
"**/rewriters/**",
27+
"**/shared/rewriters/**",
28+
"**/client/**",
29+
"**/worker/**",
30+
"**/controller/**",
31+
"**/*.d.ts"
32+
]
33+
}

‎typedoc-repos/scramjet‎

Submodule scramjet added at e70d6b0

‎typedoc-scramjet.json‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "https://typedoc.org/schema.json",
3+
"skipErrorChecking": true,
4+
"entryPointStrategy": "resolve",
5+
"excludeExternals": true,
6+
"exclude": [
7+
"**/__tests__/**",
8+
"**/*.spec.ts",
9+
"**/*.test.ts",
10+
"**/rewriters/**",
11+
"**/shared/rewriters/**",
12+
"**/worker/fetch/**",
13+
"**/worker/rewrite/**",
14+
"**/worker/fakesw.ts"
15+
],
16+
"excludePrivate": true,
17+
"excludeProtected": false,
18+
"excludeInternal": true,
19+
"excludeNotDocumented": false,
20+
"includeVersion": true,
21+
"sort": ["source-order"],
22+
"categorizeByGroup": true,
23+
"categoryOrder": ["Window Context", "Service Worker Context"],
24+
"defaultCategory": "Window Context",
25+
"searchInComments": true,
26+
"searchInDocuments": true,
27+
"treatWarningsAsErrors": false
28+
}

0 commit comments

Comments
 (0)