diff --git a/.config/typedoc/plugin-fix-cfpages.js b/.config/typedoc/plugin-fix-cfpages.js new file mode 100644 index 00000000..4f955a06 --- /dev/null +++ b/.config/typedoc/plugin-fix-cfpages.js @@ -0,0 +1,15 @@ +import { DefaultTheme } from 'typedoc' + +class FixedTheme extends DefaultTheme { + constructor(renderer) { + super(renderer) + this.mappings.find(it => it.directory === 'functions').directory = 'funcs' + } +} + +export function load(app) { + // https://github.com/TypeStrong/typedoc/issues/2111 + // https://github.com/cloudflare/workers-sdk/issues/2240 + // (tldr: /functions/ is treated incorrectly on cloudflare pages) + app.renderer.themes.set('default', FixedTheme) +} diff --git a/.forgejo/workflows/docs.yaml b/.forgejo/workflows/docs.yaml index 11365f79..d2b35d12 100644 --- a/.forgejo/workflows/docs.yaml +++ b/.forgejo/workflows/docs.yaml @@ -24,9 +24,12 @@ jobs: touch docs/.nojekyll echo "ref.mtcute.dev" > docs/CNAME echo "ignore-workspace-root-check=true" >> .npmrc + + curl -O https://gist.githubusercontent.com/j0nl1/7f9b5210c9e6ecbabe322baa16dcb5db/raw/760de77327bf83671cfb6bd4e64181299ba26113/typedoc-fix-cf.mjs + node typedoc-fix-cf.mjs docs - name: Deploy # do not run on forks and releases - if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.actor == 'desu-bot' + # if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.actor == 'desu-bot' uses: https://github.com/cloudflare/wrangler-action@v3 with: apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }} diff --git a/build.config.js b/build.config.js index b1a3971d..35335a54 100644 --- a/build.config.js +++ b/build.config.js @@ -63,7 +63,9 @@ export default { plugin: [ './.config/typedoc/plugin-external-links.js', './.config/typedoc/plugin-umami.js', + './.config/typedoc/plugin-fix-cfpages.js', ], + gitRemote: 'https://github.com/mtcute/mtcute', }, viteConfig: '.config/vite.build.ts', } diff --git a/package.json b/package.json index 5556efa5..35ed0e8e 100644 --- a/package.json +++ b/package.json @@ -46,9 +46,9 @@ "@antfu/eslint-config": "^3.11.2", "@fuman/build": "https://pkg.pr.new/teidesu/fuman/@fuman/build@c0e740b", "@fuman/utils": "0.0.4", + "@types/bun": "1.1.14", "@types/deno": "npm:@teidesu/deno-types@1.46.3", "@types/node": "20.10.0", - "@types/bun": "1.1.14", "@types/ws": "8.5.4", "@vitest/browser": "2.0.5", "@vitest/coverage-v8": "2.0.5", @@ -66,6 +66,7 @@ "rimraf": "6.0.1", "rollup-plugin-node-externals": "7.1.3", "semver": "7.5.1", + "tinyglobby": "^0.2.10", "tsx": "4.17.0", "typedoc": "0.27.6", "typescript": "5.5.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 99526879..68837bee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -80,6 +80,9 @@ importers: semver: specifier: 7.5.1 version: 7.5.1 + tinyglobby: + specifier: ^0.2.10 + version: 0.2.10 tsx: specifier: 4.17.0 version: 4.17.0