Skip to content

Commit e850d55

Browse files
committed
fix: fix broken typedoc
1 parent 3eff973 commit e850d55

File tree

6 files changed

+59
-137
lines changed

6 files changed

+59
-137
lines changed

.typedoc/typedoc.cjs

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

.typedoc/typedoc.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
@font-face {
44
font-family: "FluentSystemIcons-Regular";
55
src:
6-
url("/media/fonts/FluentSystemIcons-Regular.woff2") format("woff2"),
7-
url("/media/fonts/FluentSystemIcons-Regular.ttf") format("truetype");
6+
url("./media/fonts/FluentSystemIcons-Regular.woff2") format("woff2"),
7+
url("./media/fonts/FluentSystemIcons-Regular.ttf") format("truetype");
88
}
99

1010
:root {

.typedoc/typedoc.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@
99
"entryPoints": ["../src/index.ts"],
1010
"name": "@okikio/sharedworker",
1111
"out": "../docs",
12-
"media": "../media",
1312
"lightHighlightTheme": "github-light",
1413
"darkHighlightTheme": "github-dark",
1514
"includeVersion": true,
1615
"readme": "../README.md",
1716
"customCss": "./typedoc.css",
1817
"tsconfig": "./tsconfig.json",
19-
"umami-id": "fdfbb304-443d-403a-91db-da0cb7f4aa12",
2018
"plugin": [
21-
"./typedoc.cjs",
19+
"./typedoc.mjs",
2220
"typedoc-plugin-extras",
2321
"typedoc-plugin-mdn-links",
2422
"typedoc-plugin-inline-sources"

.typedoc/typedoc.mjs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import { Application, ParameterType, JSX } from "typedoc";
2+
function load(app) {
3+
app.options.addDeclaration({
4+
name: "keywords",
5+
type: ParameterType.Array,
6+
help: "Website keywords",
7+
defaultValue: [
8+
"sharedworker",
9+
"polyfill",
10+
"ponyfill",
11+
"framework agnostic",
12+
"es2023",
13+
"web"
14+
]
15+
});
16+
app.renderer.hooks.on("head.begin", (ctx) => {
17+
const keywords = ctx.options.getValue("keywords");
18+
return /* @__PURE__ */ JSX.createElement(JSX.Fragment, null, /* @__PURE__ */ JSX.createElement("link", { rel: "preconnect", href: "https://fonts.googleapis.com" }), /* @__PURE__ */ JSX.createElement("link", { rel: "preconnect", href: "https://fonts.gstatic.com", crossorigin: true }), /* @__PURE__ */ JSX.createElement(
19+
"link",
20+
{
21+
href: "https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;700&display=swap",
22+
rel: "stylesheet"
23+
}
24+
), /* @__PURE__ */ JSX.createElement("meta", { name: "keyword", content: keywords.join(", ") }), /* @__PURE__ */ JSX.createElement("meta", { name: "color-scheme", content: "dark light" }), /* @__PURE__ */ JSX.createElement("link", { rel: "shortcut icon", href: "/media/favicon.ico" }), /* @__PURE__ */ JSX.createElement(
25+
"link",
26+
{
27+
rel: "icon",
28+
type: "image/svg+xml",
29+
href: "./media/assets/favicon.svg"
30+
}
31+
), /* @__PURE__ */ JSX.createElement("meta", { name: "web-author", content: "Okiki Ojo" }), /* @__PURE__ */ JSX.createElement("meta", { name: "robots", content: "index, follow" }), /* @__PURE__ */ JSX.createElement("meta", { name: "twitter:url", content: "https://sharedworker.okikio.dev" }), /* @__PURE__ */ JSX.createElement("meta", { name: "twitter:site", content: "@okikio_dev" }), /* @__PURE__ */ JSX.createElement("meta", { name: "twitter:creator", content: "@okikio_dev" }), /* @__PURE__ */ JSX.createElement("link", { href: "https://twitter.com/okikio_dev", rel: "me" }), /* @__PURE__ */ JSX.createElement(
32+
"link",
33+
{
34+
rel: "webmention",
35+
href: "https://webmention.io/sharedworker.okikio.dev/webmention"
36+
}
37+
), /* @__PURE__ */ JSX.createElement(
38+
"link",
39+
{
40+
rel: "pingback",
41+
href: "https://webmention.io/sharedworker.okikio.dev/xmlrpc"
42+
}
43+
), /* @__PURE__ */ JSX.createElement(
44+
"link",
45+
{
46+
rel: "pingback",
47+
href: "https://webmention.io/webmention?forward=https://sharedworker.okikio.dev/endpoint"
48+
}
49+
));
50+
});
51+
}
52+
export {
53+
load
54+
};

.typedoc/typedoc.tsx

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,6 @@
33
import { Application, ParameterType, JSX } from "typedoc";
44

55
export function load(app: Application) {
6-
app.options.addDeclaration({
7-
name: "umami-id",
8-
help: "The id you receive from umami analytics.",
9-
type: ParameterType.String, // The default
10-
defaultValue: "", // The default
11-
});
12-
13-
app.options.addDeclaration({
14-
name: "umami-src",
15-
help: "The website source for umami analytics.",
16-
type: ParameterType.String, // The default
17-
defaultValue: "/media/measure.js", // The default
18-
});
19-
206
app.options.addDeclaration({
217
name: "keywords",
228
type: ParameterType.Array,
@@ -33,8 +19,6 @@ export function load(app: Application) {
3319

3420
app.renderer.hooks.on("head.begin", (ctx) => {
3521
const keywords = ctx.options.getValue("keywords") as string[];
36-
const id = ctx.options.getValue("umami-id") as string;
37-
const src = ctx.options.getValue("umami-src") as string;
3822

3923
return (
4024
<>
@@ -51,7 +35,7 @@ export function load(app: Application) {
5135
<link
5236
rel="icon"
5337
type="image/svg+xml"
54-
href="/media/assets/favicon.svg"
38+
href="./media/assets/favicon.svg"
5539
/>
5640

5741
<meta name="web-author" content="Okiki Ojo" />
@@ -74,18 +58,6 @@ export function load(app: Application) {
7458
rel="pingback"
7559
href="https://webmention.io/webmention?forward=https://sharedworker.okikio.dev/endpoint"
7660
/>
77-
78-
{ctx.options.isSet("umami-id") && (
79-
<script
80-
async
81-
defer
82-
type="module"
83-
data-host-url="https://bundlejs.com"
84-
data-domains="sharedworker.okikio.dev,okikio.dev"
85-
data-website-id={id}
86-
src={src}
87-
></script>
88-
)}
8961
</>
9062
);
9163
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"provenance": true
6868
},
6969
"scripts": {
70-
"typedoc": "esbuild ./.typedoc/typedoc.tsx --format=cjs --outfile=./.typedoc/typedoc.cjs && typedoc --options ./.typedoc/typedoc.json",
70+
"typedoc": "esbuild ./.typedoc/typedoc.tsx --format=esm --outfile=./.typedoc/typedoc.mjs && typedoc --options ./.typedoc/typedoc.json",
7171
"vite": "vite --config vite.config.ts",
7272
"dev": "vite dev --config vite.config.ts",
7373
"start": "vite dev --config vite.config.ts",

0 commit comments

Comments
 (0)