Skip to content

Commit

Permalink
chore: add config for docs generation
Browse files Browse the repository at this point in the history
  • Loading branch information
crutchcorn committed Dec 26, 2024
1 parent 118cb1e commit 09b13c8
Show file tree
Hide file tree
Showing 27 changed files with 223 additions and 14 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
"test:types": "lerna run test:types",
"test:eslint": "lerna run test:eslint",
"test:format": "pnpm run prettier --check",
"prepare": "playwright install chromium",
"do:publish": "lerna publish --no-private"
"docs:generate": "node scripts/generateDocs.js",
"do:publish": "lerna publish --no-private",
"prepare": "playwright install chromium"
},
"devDependencies": {
"@tanstack/config": "^0.14.2",
Expand Down
4 changes: 4 additions & 0 deletions packages/node-vibrant/tsconfig.docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["__tests__", "eslint.config.js", "vite.config.ts", "vitest.workspace.ts"]
}
2 changes: 1 addition & 1 deletion packages/node-vibrant/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"compilerOptions": {
"types": ["vite/client", "@vitest/browser/providers/playwright"]
},
"include": ["src", "__tests__", "vite.config.ts", "vitest.workspace.ts"]
"include": ["src", "__tests__", "eslint.config.js", "vite.config.ts", "vitest.workspace.ts"]
}
4 changes: 4 additions & 0 deletions packages/vibrant-color/tsconfig.docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["eslint.config.js", "vite.config.ts"]
}
2 changes: 1 addition & 1 deletion packages/vibrant-color/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src", "vite.config.ts"]
"include": ["src", "eslint.config.js", "vite.config.ts"]
}
4 changes: 4 additions & 0 deletions packages/vibrant-core/tsconfig.docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["__tests__", "eslint.config.js", "vite.config.ts"]
}
2 changes: 1 addition & 1 deletion packages/vibrant-core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["__tests__", "src", "vite.config.ts"]
"include": ["__tests__", "src", "eslint.config.js", "vite.config.ts"]
}
4 changes: 4 additions & 0 deletions packages/vibrant-generator-default/tsconfig.docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["eslint.config.js", "vite.config.ts"]
}
2 changes: 1 addition & 1 deletion packages/vibrant-generator-default/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src", "vite.config.ts"]
"include": ["src", "eslint.config.js", "vite.config.ts"]
}
4 changes: 4 additions & 0 deletions packages/vibrant-generator/tsconfig.docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["eslint.config.js", "vite.config.ts"]
}
2 changes: 1 addition & 1 deletion packages/vibrant-generator/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src", "vite.config.ts"]
"include": ["src", "eslint.config.js", "vite.config.ts"]
}
4 changes: 4 additions & 0 deletions packages/vibrant-image-browser/tsconfig.docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["__tests__", "eslint.config.js", "vite.config.ts", "vitest.config.ts"]
}
2 changes: 1 addition & 1 deletion packages/vibrant-image-browser/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src", "__tests__", "vite.config.ts", "vitest.config.ts"]
"include": ["src", "__tests__", "eslint.config.js", "vite.config.ts", "vitest.config.ts"]
}
4 changes: 4 additions & 0 deletions packages/vibrant-image-node/tsconfig.docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["eslint.config.js", "vite.config.ts"]
}
2 changes: 1 addition & 1 deletion packages/vibrant-image-node/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src", "vite.config.ts"]
"include": ["src", "eslint.config.js", "vite.config.ts"]
}
4 changes: 4 additions & 0 deletions packages/vibrant-image/tsconfig.docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["eslint.config.js", "vite.config.ts"]
}
2 changes: 1 addition & 1 deletion packages/vibrant-image/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src", "vite.config.ts"]
"include": ["src", "eslint.config.js", "vite.config.ts"]
}
4 changes: 4 additions & 0 deletions packages/vibrant-quantizer-mmcq/tsconfig.docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["eslint.config.js", "vite.config.ts"]
}
2 changes: 1 addition & 1 deletion packages/vibrant-quantizer-mmcq/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src", "vite.config.ts"]
"include": ["src", "eslint.config.js", "vite.config.ts"]
}
4 changes: 4 additions & 0 deletions packages/vibrant-quantizer/tsconfig.docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["eslint.config.js", "vite.config.ts"]
}
2 changes: 1 addition & 1 deletion packages/vibrant-quantizer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src", "vite.config.ts"]
"include": ["src", "eslint.config.js", "vite.config.ts"]
}
4 changes: 4 additions & 0 deletions packages/vibrant-types/tsconfig.docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["eslint.config.js", "vite.config.ts"]
}
2 changes: 1 addition & 1 deletion packages/vibrant-types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src", "vite.config.ts"]
"include": ["src", "eslint.config.js", "vite.config.ts"]
}
4 changes: 4 additions & 0 deletions packages/vibrant-worker/tsconfig.docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["eslint.config.js", "vite.config.ts"]
}
2 changes: 1 addition & 1 deletion packages/vibrant-worker/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src", "vite.config.ts"]
"include": ["src", "eslint.config.js", "vite.config.ts"]
}
156 changes: 156 additions & 0 deletions scripts/generateDocs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
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: "node-vibrant",
entryPoints: [resolve(__dirname, "../packages/node-vibrant/src/index.ts")],
tsconfig: resolve(__dirname, "../packages/node-vibrant/tsconfig.docs.json"),
outputDir: resolve(__dirname, "../docs/reference"),
exclude: [
"packages/vibrant-core/**/*",
"packages/vibrant-generator-default/**/*",
"packages/vibrant-image-browser/**/*",
"packages/vibrant-image-node/**/*",
"packages/vibrant-quantizer-mmcq/**/*",
],
},
{
name: "vibrant-color",
entryPoints: [resolve(__dirname, "../packages/vibrant-color/src/index.ts")],
tsconfig: resolve(
__dirname,
"../packages/vibrant-color/tsconfig.docs.json",
),
outputDir: resolve(__dirname, "../docs/package/vibrant-color/reference"),
},
{
name: "vibrant-core",
entryPoints: [resolve(__dirname, "../packages/vibrant-core/src/index.ts")],
tsconfig: resolve(__dirname, "../packages/vibrant-core/tsconfig.docs.json"),
outputDir: resolve(__dirname, "../docs/package/vibrant-core/reference"),
exclude: [
"packages/vibrant-color/**/*",
"packages/vibrant-generator/**/*",
"packages/vibrant-image/**/*",
"packages/vibrant-quantizer/**/*",
"packages/vibrant-types/**/*",
"packages/vibrant-worker/**/*",
],
},
{
name: "vibrant-generator",
entryPoints: [
resolve(__dirname, "../packages/vibrant-generator/src/index.ts"),
],
tsconfig: resolve(
__dirname,
"../packages/vibrant-generator/tsconfig.docs.json",
),
outputDir: resolve(__dirname, "../docs/package/vibrant-generator/reference"),
exclude: ["packages/vibrant-color/**/*", "packages/vibrant-types/**/*"],
},
{
name: "vibrant-generator-default",
entryPoints: [
resolve(__dirname, "../packages/vibrant-generator/src/index.ts"),
],
tsconfig: resolve(
__dirname,
"../packages/vibrant-generator/tsconfig.docs.json",
),
outputDir: resolve(__dirname, "../docs/package/vibrant-generator-default/reference"),
exclude: ["packages/vibrant-color/**/*", "packages/vibrant-generator/**/*"],
},
{
name: "vibrant-image",
entryPoints: [resolve(__dirname, "../packages/vibrant-image/src/index.ts")],
tsconfig: resolve(
__dirname,
"../packages/vibrant-image/tsconfig.docs.json",
),
outputDir: resolve(__dirname, "../docs/package/vibrant-image/reference"),
exclude: ["packages/vibrant-color/**/*", "packages/vibrant-types/**/*"],
},
{
name: "vibrant-image-browser",
entryPoints: [resolve(__dirname, "../packages/vibrant-image/src/index.ts")],
tsconfig: resolve(
__dirname,
"../packages/vibrant-image/tsconfig.docs.json",
),
outputDir: resolve(__dirname, "../docs/package/vibrant-image-browser/reference"),
exclude: ["packages/vibrant-image/**/*"],
},
{
name: "vibrant-image-node",
entryPoints: [resolve(__dirname, "../packages/vibrant-image/src/index.ts")],
tsconfig: resolve(
__dirname,
"../packages/vibrant-image/tsconfig.docs.json",
),
outputDir: resolve(__dirname, "../docs/package/vibrant-image-node/reference"),
exclude: ["packages/vibrant-image/**/*"],
},
{
name: "vibrant-quantizer",
entryPoints: [
resolve(__dirname, "../packages/vibrant-quantizer/src/index.ts"),
],
tsconfig: resolve(
__dirname,
"../packages/vibrant-quantizer/tsconfig.docs.json",
),
outputDir: resolve(__dirname, "../docs/package/vibrant-quantizer/reference"),
exclude: [
"packages/vibrant-color/**/*",
"packages/vibrant-image/**/*",
"packages/vibrant-types/**/*",
],
},
{
name: "vibrant-quantizer-mmcq",
entryPoints: [
resolve(__dirname, "../packages/vibrant-quantizer/src/index.ts"),
],
tsconfig: resolve(
__dirname,
"../packages/vibrant-quantizer/tsconfig.docs.json",
),
outputDir: resolve(__dirname, "../docs/package/vibrant-quantizer-mmcq/reference"),
exclude: [
"packages/vibrant-color/**/*",
"packages/vibrant-image/**/*",
"packages/vibrant-quantizer/**/*",
],
},
{
name: "vibrant-types",
entryPoints: [resolve(__dirname, "../packages/vibrant-types/src/index.ts")],
tsconfig: resolve(
__dirname,
"../packages/vibrant-types/tsconfig.docs.json",
),
outputDir: resolve(__dirname, "../docs/package/vibrant-types/reference"),
},
{
name: "vibrant-worker",
entryPoints: [
resolve(__dirname, "../packages/vibrant-worker/src/index.ts"),
],
tsconfig: resolve(
__dirname,
"../packages/vibrant-worker/tsconfig.docs.json",
),
outputDir: resolve(__dirname, "../docs/package/vibrant-worker/reference"),
exclude: ["packages/vibrant-types/**/*"],
},
];

await generateReferenceDocs({ packages });

process.exit(0);
4 changes: 4 additions & 0 deletions scripts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../tsconfig.json",
"include": ["**/*"]
}

0 comments on commit 09b13c8

Please sign in to comment.