"lint:fix": "eslint . --cache --fix",
"lint:report": "eslint . --cache --format json --output-file reports/eslint.json",
"release": "release-it",
- "typedoc": "mkdir ./tmp && cp ./docs/*.md ./tmp && typedoc && cp ./tmp/*.md ./docs && rm -rf ./tmp",
+ "typedoc": "node typedoc.mjs",
"prepublishOnly": "pnpm build:prod"
},
"ts-standard": {
{
"$schema": "https://typedoc.org/schema.json",
- "tsconfig": "./tsconfig.production.json",
+ "tsconfig": "tsconfig.production.json",
"entryPoints": ["src"],
"out": "docs",
"readme": "none",
--- /dev/null
+import { copyFileSync, mkdirSync, readdirSync, rmSync } from 'node:fs'
+import { dirname, join } from 'node:path'
+import { fileURLToPath } from 'node:url'
+import { execSync } from 'node:child_process'
+
+try {
+ mkdirSync(join(dirname(fileURLToPath(import.meta.url)), 'tmp'), {
+ recursive: true
+ })
+ const markdownFiles = readdirSync(
+ join(dirname(fileURLToPath(import.meta.url)), 'docs')
+ ).filter(file => file.endsWith('.md'))
+ for (const markdownFile of markdownFiles) {
+ copyFileSync(
+ join(dirname(fileURLToPath(import.meta.url)), 'docs', markdownFile),
+ join(dirname(fileURLToPath(import.meta.url)), 'tmp', markdownFile)
+ )
+ }
+ execSync('npx typedoc', { stdio: 'inherit' })
+ for (const markdownFile of markdownFiles) {
+ copyFileSync(
+ join(dirname(fileURLToPath(import.meta.url)), 'tmp', markdownFile),
+ join(dirname(fileURLToPath(import.meta.url)), 'docs', markdownFile)
+ )
+ }
+ rmSync(join(dirname(fileURLToPath(import.meta.url)), 'tmp'), {
+ recursive: true,
+ force: true
+ })
+} catch (e) {
+ console.error(e)
+}