Skip to content

Commit

Permalink
fix: fix broken typedoc
Browse files Browse the repository at this point in the history
  • Loading branch information
okikio committed Nov 20, 2024
1 parent 3eff973 commit e850d55
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 137 deletions.
102 changes: 0 additions & 102 deletions .typedoc/typedoc.cjs

This file was deleted.

4 changes: 2 additions & 2 deletions .typedoc/typedoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
@font-face {
font-family: "FluentSystemIcons-Regular";
src:
url("/media/fonts/FluentSystemIcons-Regular.woff2") format("woff2"),
url("/media/fonts/FluentSystemIcons-Regular.ttf") format("truetype");
url("./media/fonts/FluentSystemIcons-Regular.woff2") format("woff2"),
url("./media/fonts/FluentSystemIcons-Regular.ttf") format("truetype");
}

:root {
Expand Down
4 changes: 1 addition & 3 deletions .typedoc/typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@
"entryPoints": ["../src/index.ts"],
"name": "@okikio/sharedworker",
"out": "../docs",
"media": "../media",
"lightHighlightTheme": "github-light",
"darkHighlightTheme": "github-dark",
"includeVersion": true,
"readme": "../README.md",
"customCss": "./typedoc.css",
"tsconfig": "./tsconfig.json",
"umami-id": "fdfbb304-443d-403a-91db-da0cb7f4aa12",
"plugin": [
"./typedoc.cjs",
"./typedoc.mjs",
"typedoc-plugin-extras",
"typedoc-plugin-mdn-links",
"typedoc-plugin-inline-sources"
Expand Down
54 changes: 54 additions & 0 deletions .typedoc/typedoc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { Application, ParameterType, JSX } from "typedoc";
function load(app) {
app.options.addDeclaration({
name: "keywords",
type: ParameterType.Array,
help: "Website keywords",
defaultValue: [
"sharedworker",
"polyfill",
"ponyfill",
"framework agnostic",
"es2023",
"web"
]
});
app.renderer.hooks.on("head.begin", (ctx) => {
const keywords = ctx.options.getValue("keywords");
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(
"link",
{
href: "https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;700&display=swap",
rel: "stylesheet"
}
), /* @__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(
"link",
{
rel: "icon",
type: "image/svg+xml",
href: "./media/assets/favicon.svg"
}
), /* @__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(
"link",
{
rel: "webmention",
href: "https://webmention.io/sharedworker.okikio.dev/webmention"
}
), /* @__PURE__ */ JSX.createElement(
"link",
{
rel: "pingback",
href: "https://webmention.io/sharedworker.okikio.dev/xmlrpc"
}
), /* @__PURE__ */ JSX.createElement(
"link",
{
rel: "pingback",
href: "https://webmention.io/webmention?forward=https://sharedworker.okikio.dev/endpoint"
}
));
});
}
export {
load
};
30 changes: 1 addition & 29 deletions .typedoc/typedoc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,6 @@
import { Application, ParameterType, JSX } from "typedoc";

export function load(app: Application) {
app.options.addDeclaration({
name: "umami-id",
help: "The id you receive from umami analytics.",
type: ParameterType.String, // The default
defaultValue: "", // The default
});

app.options.addDeclaration({
name: "umami-src",
help: "The website source for umami analytics.",
type: ParameterType.String, // The default
defaultValue: "/media/measure.js", // The default
});

app.options.addDeclaration({
name: "keywords",
type: ParameterType.Array,
Expand All @@ -33,8 +19,6 @@ export function load(app: Application) {

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

return (
<>
Expand All @@ -51,7 +35,7 @@ export function load(app: Application) {
<link
rel="icon"
type="image/svg+xml"
href="/media/assets/favicon.svg"
href="./media/assets/favicon.svg"
/>

<meta name="web-author" content="Okiki Ojo" />
Expand All @@ -74,18 +58,6 @@ export function load(app: Application) {
rel="pingback"
href="https://webmention.io/webmention?forward=https://sharedworker.okikio.dev/endpoint"
/>

{ctx.options.isSet("umami-id") && (
<script
async
defer
type="module"
data-host-url="https://bundlejs.com"
data-domains="sharedworker.okikio.dev,okikio.dev"
data-website-id={id}
src={src}
></script>
)}
</>
);
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"provenance": true
},
"scripts": {
"typedoc": "esbuild ./.typedoc/typedoc.tsx --format=cjs --outfile=./.typedoc/typedoc.cjs && typedoc --options ./.typedoc/typedoc.json",
"typedoc": "esbuild ./.typedoc/typedoc.tsx --format=esm --outfile=./.typedoc/typedoc.mjs && typedoc --options ./.typedoc/typedoc.json",
"vite": "vite --config vite.config.ts",
"dev": "vite dev --config vite.config.ts",
"start": "vite dev --config vite.config.ts",
Expand Down

0 comments on commit e850d55

Please sign in to comment.