Skip to content

Commit 5ca7b1f

Browse files
feat(typedoc): release @tanstack/typedoc-config (#220)
* feat: release @tanstack/typedoc-config * Fic snap
1 parent 1e963e8 commit 5ca7b1f

File tree

16 files changed

+172
-92
lines changed

16 files changed

+172
-92
lines changed

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"updateInternalDependencies": "patch",
88
"fixed": [],
99
"linked": [],
10-
"ignore": []
10+
"ignore": ["@tanstack/integration-*"]
1111
}

.changeset/long-apples-fix.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/typedoc-config': minor
3+
---
4+
5+
feat: release @tanstack/typedoc-config

integrations/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "react-integration",
2+
"name": "@tanstack/integration-react",
33
"version": "1.0.0",
44
"private": true,
55
"type": "module",

integrations/vanilla/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "vanilla-integration",
2+
"name": "@tanstack/integration-vanilla",
33
"version": "1.0.0",
44
"private": true,
55
"type": "module",

integrations/vue/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "vue-integration",
2+
"name": "@tanstack/integration-vue",
33
"version": "1.0.0",
44
"private": true,
55
"type": "module",
File renamed without changes.

packages/config/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"@commitlint/parse": "catalog:",
6363
"@eslint/js": "catalog:",
6464
"@stylistic/eslint-plugin-js": "catalog:",
65+
"@tanstack/typedoc-config": "workspace:",
6566
"commander": "catalog:",
6667
"esbuild-register": "catalog:",
6768
"eslint-plugin-import-x": "catalog:",
@@ -74,9 +75,6 @@
7475
"rollup-plugin-preserve-directives": "catalog:",
7576
"semver": "catalog:",
7677
"simple-git": "catalog:",
77-
"typedoc": "catalog:",
78-
"typedoc-plugin-frontmatter": "catalog:",
79-
"typedoc-plugin-markdown": "catalog:",
8078
"typescript-eslint": "catalog:",
8179
"v8flags": "catalog:",
8280
"vite-plugin-dts": "catalog:",
Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
import type { UserConfig } from 'vite'
2-
3-
export type Package = {
4-
name: string
5-
entryPoints: Array<string>
6-
tsconfig: string
7-
outputDir: string
8-
exclude?: Array<string>
9-
}
10-
11-
export type Options = {
12-
/** Config for packages that need reference docs */
13-
packages: Array<Package>
14-
/** Override branch for GitHub links */
15-
gitBranch?: string
16-
}
17-
18-
export function generateReferenceDocs(config: Options): Promise<void>
1+
export type {
2+
Package,
3+
Options,
4+
generateReferenceDocs,
5+
} from '@tanstack/typedoc-config'
Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1 @@
1-
import { resolve } from 'node:path'
2-
import { fileURLToPath } from 'node:url'
3-
import { mkdir, rm } from 'node:fs/promises'
4-
import * as TypeDoc from 'typedoc'
5-
6-
const __dirname = fileURLToPath(new URL('.', import.meta.url))
7-
8-
/**
9-
* @type {Partial<import("typedoc").TypeDocOptions & import("typedoc-plugin-markdown").PluginOptions>}
10-
*/
11-
const settings = {
12-
plugin: [
13-
'typedoc-plugin-markdown',
14-
'typedoc-plugin-frontmatter',
15-
resolve(__dirname, './typedoc-custom-settings.js'),
16-
],
17-
hideGenerator: true,
18-
readme: 'none',
19-
entryFileName: 'index',
20-
hideBreadcrumbs: true,
21-
hidePageHeader: true,
22-
useCodeBlocks: true,
23-
excludePrivate: true,
24-
}
25-
26-
/**
27-
* @param {import('./index.js').Options} options
28-
* @returns {Promise<void>}
29-
*/
30-
export const generateReferenceDocs = async (options) => {
31-
for (const pkg of options.packages) {
32-
// Clean and recreate the output directories
33-
try {
34-
await rm(pkg.outputDir, { recursive: true })
35-
} catch (error) {
36-
// @ts-expect-error
37-
if (error.code !== 'ENOENT') {
38-
throw error
39-
}
40-
}
41-
await mkdir(pkg.outputDir, { recursive: true })
42-
43-
const app = await TypeDoc.Application.bootstrapWithPlugins({
44-
...settings,
45-
gitRevision: options.gitBranch ?? 'main',
46-
entryPoints: pkg.entryPoints,
47-
tsconfig: pkg.tsconfig,
48-
exclude: pkg.exclude,
49-
out: pkg.outputDir,
50-
})
51-
52-
const project = await app.convert()
53-
54-
if (project) {
55-
await app.generateOutputs(project)
56-
}
57-
}
58-
}
1+
export { generateReferenceDocs } from '@tanstack/typedoc-config'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// @ts-check
2+
3+
import { tanstackConfig } from '../config/src/eslint/index.js'
4+
5+
export default [...tanstackConfig]

0 commit comments

Comments
 (0)