Skip to content

Commit c8ef04b

Browse files
committed
docs: upgrade docs generation
1 parent c347a7b commit c8ef04b

File tree

7 files changed

+160
-228
lines changed

7 files changed

+160
-228
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@rollup/plugin-replace": "^6.0.1",
3737
"@rollup/plugin-terser": "^0.4.4",
3838
"@types/lodash.kebabcase": "^4.1.9",
39-
"@types/node": "^20.14.12",
39+
"@types/node": "^22.10.1",
4040
"@vitest/coverage-v8": "^2.1.8",
4141
"@vitest/ui": "^2.1.8",
4242
"@vue/compiler-sfc": "~3.5.13",
@@ -58,7 +58,7 @@
5858
"semver": "^7.6.3",
5959
"simple-git-hooks": "^2.11.1",
6060
"typedoc": "^0.26.11",
61-
"typedoc-plugin-markdown": "^4.2.10",
61+
"typedoc-plugin-markdown": "~4.2.0",
6262
"typescript": "~5.6.3",
6363
"vitest": "^2.1.8",
6464
"vue": "~3.5.13"

packages/docs/.vitepress/config/en.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { DefaultTheme, LocaleSpecificConfig } from 'vitepress'
2+
import typedocSidebar from '../../api/typedoc-sidebar.json'
23

34
export const META_URL = 'https://pinia.vuejs.org'
45
export const META_TITLE = 'Pinia 🍍'
@@ -53,18 +54,8 @@ export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
5354
sidebar: {
5455
'/api/': [
5556
{
56-
text: 'packages',
57-
items: [
58-
{ text: 'pinia', link: '/api/pinia/' },
59-
{
60-
text: '@pinia/nuxt',
61-
link: '/api/@pinia/nuxt/',
62-
},
63-
{
64-
text: '@pinia/testing',
65-
link: '/api/@pinia/testing/',
66-
},
67-
],
57+
text: 'API',
58+
items: typedocSidebar,
6859
},
6960
],
7061
// catch-all fallback

packages/docs/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7+
"predocs": "node run-typedoc.mjs",
78
"docs": "vitepress dev .",
89
"docs:api": "node run-typedoc.mjs",
910
"docs:translation:compare": "v-translation compare",
@@ -17,6 +18,7 @@
1718
"@vueuse/core": "^12.0.0",
1819
"pinia": "workspace:*",
1920
"vitepress": "1.5.0",
21+
"typedoc-vitepress-theme": "^1.1.1",
2022
"vitepress-translation-helper": "^0.2.2",
2123
"vue-use-spring": "^0.3.3"
2224
}

packages/docs/run-typedoc.mjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@ import { createTypeDocApp } from './typedoc-markdown.mjs'
44
const __dirname = path.dirname(new URL(import.meta.url).pathname)
55

66
createTypeDocApp({
7-
name: 'API Documentation',
7+
textContentMappings: {
8+
'title.indexPage': 'API Reference',
9+
'title.memberPage': '{name}',
10+
},
811
tsconfig: path.resolve(__dirname, './typedoc.tsconfig.json'),
912
// entryPointStrategy: 'packages',
1013
categorizeByGroup: true,
1114
githubPages: false,
15+
readme: 'none',
16+
indexFormat: 'table',
1217
disableSources: true,
13-
plugin: ['typedoc-plugin-markdown'],
18+
plugin: ['typedoc-plugin-markdown', 'typedoc-vitepress-theme'],
19+
useCodeBlocks: true,
1420
entryPoints: [
1521
path.resolve(__dirname, '../pinia/src/index.ts'),
1622
path.resolve(__dirname, '../testing/src/index.ts'),

packages/docs/typedoc-markdown.mjs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ import { Application, TSConfigReader, PageEvent } from 'typedoc'
55

66
const __dirname = path.dirname(new URL(import.meta.url).pathname)
77

8+
/** @satisfies {Partial<import('typedoc').TypeDocOptions & import('typedoc-plugin-markdown').PluginOptions>} */
89
const DEFAULT_OPTIONS = {
9-
// disableOutputCheck: true,
1010
cleanOutputDir: true,
1111
excludeInternal: true,
12-
readme: 'none',
1312
out: path.resolve(__dirname, './api'),
1413
entryFileName: 'index.md',
15-
hideBreadcrumbs: false,
16-
// hideInPageTOC: true,
14+
// hideBreadcrumbs: false,
1715
preserveAnchorCasing: true,
1816
}
1917

packages/pinia/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
],
7070
"license": "MIT",
7171
"devDependencies": {
72-
"@microsoft/api-extractor": "7.47.11",
72+
"@microsoft/api-extractor": "7.48.0",
7373
"@vue/test-utils": "^2.4.6"
7474
},
7575
"dependencies": {

0 commit comments

Comments
 (0)