diff --git a/package.json b/package.json index 5446ed5713..354906c5ad 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "prettier:write": "pnpm run prettier --write", "format": "pnpm run prettier:write", "lint:fix": "pnpm run format && nx run-many --targets=lint --fix", + "docs:generate": "node scripts/generateDocs.js", "cipublish": "node scripts/publish.js" }, "nx": { diff --git a/scripts/generateDocs.js b/scripts/generateDocs.js new file mode 100644 index 0000000000..3e840a0b0f --- /dev/null +++ b/scripts/generateDocs.js @@ -0,0 +1,26 @@ +import { resolve } from 'node:path' +import { fileURLToPath } from 'node:url' +import { generateReferenceDocs } from '@tanstack/config/typedoc' + +const __dirname = fileURLToPath(new URL('.', import.meta.url)) + +/** @type {import('@tanstack/config/typedoc').Package[]} */ +const packages = [ + { + name: 'table-core', + entryPoints: [resolve(__dirname, '../packages/table-core/src/index.ts')], + tsconfig: resolve(__dirname, '../packages/table-core/tsconfig.json'), + outputDir: resolve(__dirname, '../docs/reference'), + }, + { + name: 'react-table', + entryPoints: [resolve(__dirname, '../packages/react-table/src/index.tsx')], + tsconfig: resolve(__dirname, '../packages/react-table/tsconfig.json'), + outputDir: resolve(__dirname, '../docs/framework/react/reference'), + exclude: ['packages/table-core/**/*'], + }, +] + +await generateReferenceDocs({ packages }) + +process.exit(0)