docs: update typedocs config to support new module structure

This commit is contained in:
braks
2022-10-08 21:19:54 +02:00
committed by Braks
parent c1bcc02797
commit afb3fc7b49
8 changed files with 47 additions and 53 deletions

View File

@@ -10,16 +10,16 @@
"typedoc": "typedoc --options ./typedoc.json"
},
"dependencies": {
"vue": "^3.2.37",
"@algolia/client-search": "^4.14.2",
"@animxyz/core": "^0.6.6",
"@animxyz/vue3": "^0.6.7",
"@stackblitz/sdk": "^1.8.0",
"@vue-flow/additional-components": "workspace:*",
"@vue-flow/core": "workspace:*",
"@stackblitz/sdk": "^1.8.0",
"@vue/repl": "1.1.2",
"blobity": "^0.2.1",
"canvas-confetti": "^1.5.1"
"canvas-confetti": "^1.5.1",
"vue": "^3.2.37"
},
"devDependencies": {
"@iconify/json": "^2.1.95",
@@ -30,6 +30,7 @@
"ohmyfetch": "^0.4.18",
"typedoc": "^0.22.18",
"typedoc-plugin-markdown": "^3.13.4",
"typedoc-plugin-merge-modules": "^4.0.1",
"unplugin-auto-import": "^0.10.3",
"unplugin-icons": "^0.14.8",
"unplugin-vue-components": "^0.21.2",

View File

@@ -2,19 +2,6 @@ import { existsSync, readFileSync } from 'fs'
import { resolve } from 'path'
import type { Plugin } from 'vite'
const copyFile = (path: string, pkgName: string) => {
const filePath = resolve(__dirname, `${path}/${pkgName}`)
if (!existsSync(filePath)) {
throw new Error(`${pkgName} not built. ` + `Run "pnpm -w build" first.`)
}
;(this as any).emitFile({
type: 'asset',
fileName: pkgName,
source: readFileSync(filePath, 'utf-8'),
})
}
export function copyVueFlowPlugin(): Plugin {
return {
name: 'copy-vue-flow',
@@ -22,8 +9,17 @@ export function copyVueFlowPlugin(): Plugin {
;[
{ path: '../../node_modules/@vue-flow/core/dist/', pkgName: 'vue-flow.es.js' },
{ path: '../../node_modules/@vue-flow/additional-components/dist/', pkgName: 'additional-components.es.js' },
].forEach((pkg) => {
copyFile.call(this, pkg.path, pkg.pkgName)
].forEach(({ path, pkgName }) => {
const filePath = resolve(__dirname, `${path}/${pkgName}`)
if (!existsSync(filePath)) {
throw new Error(`${pkgName} not built. ` + `Run "pnpm -w build" first.`)
}
;(this as any).emitFile({
type: 'asset',
fileName: pkgName,
source: readFileSync(filePath, 'utf-8'),
})
})
},
}

22
docs/tsconfig.docs.json Normal file
View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"baseUrl": ".",
"module": "ESNext",
"target": "es2017",
"lib": ["DOM", "ESNext"],
"strict": true,
"esModuleInterop": true,
"incremental": false,
"skipLibCheck": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"noUnusedLocals": false,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"~/*": ["../packages/vue-flow/src/*"]
}
},
"include": ["../packages/vue-flow", "../packages/additional-components"],
"exclude": ["node_modules"]
}

View File

@@ -1,14 +1,16 @@
{
"$schema": "https://typedoc.org/schema.json",
"readme": "none",
"plugin": "typedoc-plugin-markdown",
"entryPoints": ["../packages/vue-flow/src/index.ts"],
"plugin": ["typedoc-plugin-merge-modules","typedoc-plugin-markdown"],
"entryPoints": ["../packages/vue-flow/src/index.ts", "../packages/additional-components/src/index.ts"],
"allReflectionsHaveOwnDocument": true,
"categorizeByGroup": true,
"darkHighlightTheme": "vitesse-dark",
"lightHighlightTheme": "vitesse-light",
"hideBreadcrumbs": true,
"disableSources": true,
"cleanOutputDir": true,
"out": "src/typedocs",
"tsconfig": "../packages/vue-flow/tsconfig.docs.json",
"tsconfig": "./tsconfig.docs.json",
"entryDocument": "index.md"
}