diff --git a/packages/core/src/app/appInit.ts b/packages/core/src/app/appInit.ts index 1db287fd28..95ce110178 100644 --- a/packages/core/src/app/appInit.ts +++ b/packages/core/src/app/appInit.ts @@ -9,6 +9,8 @@ const log = debug('vuepress:core/app') * Initialize a vuepress app * * Plugins should be used before initialization. + * + * @internal */ export const appInit = async (app: App): Promise => { log('init start') diff --git a/packages/core/src/app/appPrepare.ts b/packages/core/src/app/appPrepare.ts index f8d2585f50..15dd6986b7 100644 --- a/packages/core/src/app/appPrepare.ts +++ b/packages/core/src/app/appPrepare.ts @@ -18,6 +18,8 @@ const log = debug('vuepress:core/app') * - routes * - site data * - other files that generated by plugins + * + * @internal */ export const appPrepare = async (app: App): Promise => { log('prepare start') diff --git a/packages/core/src/app/appUse.ts b/packages/core/src/app/appUse.ts index df53e43cab..9c98443a39 100644 --- a/packages/core/src/app/appUse.ts +++ b/packages/core/src/app/appUse.ts @@ -4,6 +4,13 @@ import { resolvePluginObject } from './resolvePluginObject.js' const log = debug('vuepress:core/app') +/** + * Use a plugin in vuepress app. + * + * Should be called before initialization. + * + * @internal + */ export const appUse = (app: App, rawPlugin: Plugin): App => { const pluginObject = resolvePluginObject(app, rawPlugin) diff --git a/packages/core/src/app/createBaseApp.ts b/packages/core/src/app/createBaseApp.ts index dc2b2ecaf4..624d18ac91 100644 --- a/packages/core/src/app/createBaseApp.ts +++ b/packages/core/src/app/createBaseApp.ts @@ -18,6 +18,8 @@ import { setupAppThemeAndPlugins } from './setupAppThemeAndPlugins.js' /** * Create vuepress app + * + * @internal */ export const createBaseApp = (config: AppConfig): App => { const options = resolveAppOptions(config) diff --git a/packages/core/src/app/prepare/prepareClientConfigs.ts b/packages/core/src/app/prepare/prepareClientConfigs.ts index 59bb1f5624..4636bd5556 100644 --- a/packages/core/src/app/prepare/prepareClientConfigs.ts +++ b/packages/core/src/app/prepare/prepareClientConfigs.ts @@ -2,6 +2,8 @@ import type { App } from '../../types/index.js' /** * Generate client configs temp file + * + * @internal */ export const prepareClientConfigs = async (app: App): Promise => { // plugin hook: clientConfigFile diff --git a/packages/core/src/app/prepare/preparePageChunk.ts b/packages/core/src/app/prepare/preparePageChunk.ts index 353a98eee1..e401d9cfce 100644 --- a/packages/core/src/app/prepare/preparePageChunk.ts +++ b/packages/core/src/app/prepare/preparePageChunk.ts @@ -17,6 +17,8 @@ if (import.meta.hot) { /** * Generate page chunk temp file of a single page + * + * @internal */ export const preparePageChunk = async (app: App, page: Page): Promise => { // page chunk file content diff --git a/packages/core/src/app/prepare/preparePageComponent.ts b/packages/core/src/app/prepare/preparePageComponent.ts index 569d63697a..c37fe9c2c9 100644 --- a/packages/core/src/app/prepare/preparePageComponent.ts +++ b/packages/core/src/app/prepare/preparePageComponent.ts @@ -3,6 +3,8 @@ import type { App, Page } from '../../types/index.js' /** * Generate page component temp file of a single page + * + * @internal */ export const preparePageComponent = async ( app: App, diff --git a/packages/core/src/app/prepare/prepareRoutes.ts b/packages/core/src/app/prepare/prepareRoutes.ts index b3556e8041..a4f8d6f549 100644 --- a/packages/core/src/app/prepare/prepareRoutes.ts +++ b/packages/core/src/app/prepare/prepareRoutes.ts @@ -22,6 +22,8 @@ if (import.meta.hot) { /** * Resolve page redirects + * + * @internal */ const resolvePageRedirects = ({ path, pathInferred }: Page): string[] => { // paths that should redirect to this page, use set to dedupe diff --git a/packages/core/src/app/prepare/prepareSiteData.ts b/packages/core/src/app/prepare/prepareSiteData.ts index c2749c0dc2..7121e72845 100644 --- a/packages/core/src/app/prepare/prepareSiteData.ts +++ b/packages/core/src/app/prepare/prepareSiteData.ts @@ -17,6 +17,8 @@ if (import.meta.hot) { /** * Generate site data temp file + * + * @internal */ export const prepareSiteData = async (app: App): Promise => { let content = `\ diff --git a/packages/core/src/app/resolveAppDir.ts b/packages/core/src/app/resolveAppDir.ts index 5e78b9d344..18819dca9d 100644 --- a/packages/core/src/app/resolveAppDir.ts +++ b/packages/core/src/app/resolveAppDir.ts @@ -6,6 +6,8 @@ const require = createRequire(import.meta.url) /** * Create directory util function + * + * @internal */ export const createAppDirFunction = (baseDir: string): AppDirFunction => diff --git a/packages/core/src/app/resolveAppEnv.ts b/packages/core/src/app/resolveAppEnv.ts index 7ec4bf96c0..d0b069c6a4 100644 --- a/packages/core/src/app/resolveAppEnv.ts +++ b/packages/core/src/app/resolveAppEnv.ts @@ -2,6 +2,8 @@ import type { AppEnv, AppOptions } from '../types/index.js' /** * Resolve environment flags for vuepress app + * + * @internal */ export const resolveAppEnv = (options: AppOptions): AppEnv => ({ isBuild: false, diff --git a/packages/core/src/app/resolveAppMarkdown.ts b/packages/core/src/app/resolveAppMarkdown.ts index 84ce7d0a1a..d3b35b4ef2 100644 --- a/packages/core/src/app/resolveAppMarkdown.ts +++ b/packages/core/src/app/resolveAppMarkdown.ts @@ -4,6 +4,8 @@ import type { App } from '../types/index.js' /** * Resolve markdown-it instance for vuepress app + * + * @internal */ export const resolveAppMarkdown = async (app: App): Promise => { // plugin hook: extendsMarkdownOptions diff --git a/packages/core/src/app/resolveAppOptions.ts b/packages/core/src/app/resolveAppOptions.ts index 63b9379962..756227ffe5 100644 --- a/packages/core/src/app/resolveAppOptions.ts +++ b/packages/core/src/app/resolveAppOptions.ts @@ -6,6 +6,8 @@ const require = createRequire(import.meta.url) /** * Create app options with default values + * + * @internal */ export const resolveAppOptions = ({ // site config diff --git a/packages/core/src/app/resolveAppPages.ts b/packages/core/src/app/resolveAppPages.ts index d8cd00bd41..51ed100308 100644 --- a/packages/core/src/app/resolveAppPages.ts +++ b/packages/core/src/app/resolveAppPages.ts @@ -6,6 +6,8 @@ const log = debug('vuepress:core/app') /** * Resolve pages for vuepress app + * + * @internal */ export const resolveAppPages = async (app: App): Promise => { log('resolveAppPages start') diff --git a/packages/core/src/app/resolveAppSiteData.ts b/packages/core/src/app/resolveAppSiteData.ts index 9f2b654e3e..bc37720131 100644 --- a/packages/core/src/app/resolveAppSiteData.ts +++ b/packages/core/src/app/resolveAppSiteData.ts @@ -4,6 +4,8 @@ import type { AppOptions, SiteData } from '../types/index.js' * Resolve site data for vuepress app * * Site data will also be used in client + * + * @internal */ export const resolveAppSiteData = (options: AppOptions): SiteData => ({ base: options.base, diff --git a/packages/core/src/app/resolveAppVersion.ts b/packages/core/src/app/resolveAppVersion.ts index 590340ffc4..5f356432a3 100644 --- a/packages/core/src/app/resolveAppVersion.ts +++ b/packages/core/src/app/resolveAppVersion.ts @@ -5,6 +5,8 @@ const require = createRequire(import.meta.url) /** * Resolve version of vuepress app + * + * @internal */ export const resolveAppVersion = (): string => { const pkgJson = fs.readJsonSync( diff --git a/packages/core/src/app/resolveAppWriteTemp.ts b/packages/core/src/app/resolveAppWriteTemp.ts index f4e3b6c7d5..2a3560f072 100644 --- a/packages/core/src/app/resolveAppWriteTemp.ts +++ b/packages/core/src/app/resolveAppWriteTemp.ts @@ -3,6 +3,8 @@ import type { AppDir, AppWriteTemp } from '../types/index.js' /** * Resolve write temp file util for vuepress app + * + * @internal */ export const resolveAppWriteTemp = (dir: AppDir): AppWriteTemp => { const writeTemp: AppWriteTemp = async (file: string, content: string) => { diff --git a/packages/core/src/app/resolvePluginObject.ts b/packages/core/src/app/resolvePluginObject.ts index 8ccdd72aaa..4636f48ac0 100644 --- a/packages/core/src/app/resolvePluginObject.ts +++ b/packages/core/src/app/resolvePluginObject.ts @@ -3,6 +3,8 @@ import type { App, Plugin, PluginObject } from '../types/index.js' /** * Resolve a plugin object according to name / path / module and config + * + * @internal */ export const resolvePluginObject = ( app: App, diff --git a/packages/core/src/app/resolveThemeInfo.ts b/packages/core/src/app/resolveThemeInfo.ts index 34e9ff3b0d..b16c371429 100644 --- a/packages/core/src/app/resolveThemeInfo.ts +++ b/packages/core/src/app/resolveThemeInfo.ts @@ -3,6 +3,8 @@ import { resolvePluginObject } from './resolvePluginObject.js' /** * Resolve theme info and its parent theme info + * + * @internal */ export const resolveThemeInfo = (app: App, theme: Theme): ThemeInfo => { // resolve current theme info diff --git a/packages/core/src/app/setupAppThemeAndPlugins.ts b/packages/core/src/app/setupAppThemeAndPlugins.ts index f28c9f04e7..39aceda92b 100644 --- a/packages/core/src/app/setupAppThemeAndPlugins.ts +++ b/packages/core/src/app/setupAppThemeAndPlugins.ts @@ -3,6 +3,8 @@ import { resolveThemeInfo } from './resolveThemeInfo.js' /** * Setup theme and plugins for vuepress app + * + * @internal */ export const setupAppThemeAndPlugins = (app: App, config: AppConfig): void => { // recursively resolve theme info diff --git a/packages/core/src/page/createPage.ts b/packages/core/src/page/createPage.ts index 600d60d63d..8234621208 100644 --- a/packages/core/src/page/createPage.ts +++ b/packages/core/src/page/createPage.ts @@ -13,6 +13,11 @@ import { resolvePagePermalink } from './resolvePagePermalink.js' import { resolvePageRouteMeta } from './resolvePageRouteMeta.js' import { resolvePageSlug } from './resolvePageSlug.js' +/** + * Create vuepress page object + * + * @internal + */ export const createPage = async ( app: App, options: PageOptions, diff --git a/packages/core/src/page/inferPagePath.ts b/packages/core/src/page/inferPagePath.ts index 8d082ea93c..2a406c7b66 100644 --- a/packages/core/src/page/inferPagePath.ts +++ b/packages/core/src/page/inferPagePath.ts @@ -7,6 +7,8 @@ import type { App } from '../types/index.js' /** * Infer page path according to file path + * + * @internal */ export const inferPagePath = ({ app, diff --git a/packages/core/src/page/parsePageContent.ts b/packages/core/src/page/parsePageContent.ts index 8af9d92b96..03e036a87e 100644 --- a/packages/core/src/page/parsePageContent.ts +++ b/packages/core/src/page/parsePageContent.ts @@ -9,6 +9,8 @@ import type { App, PageFrontmatter, PageOptions } from '../types/index.js' /** * Render page content and extract related info + * + * @internal */ export const parsePageContent = ({ app, diff --git a/packages/core/src/page/renderPageSfcBlocksToVue.ts b/packages/core/src/page/renderPageSfcBlocksToVue.ts index 7428643823..79f15e92ca 100644 --- a/packages/core/src/page/renderPageSfcBlocksToVue.ts +++ b/packages/core/src/page/renderPageSfcBlocksToVue.ts @@ -2,6 +2,8 @@ import type { MarkdownSfcBlocks } from '@vuepress/markdown' /** * Render page sfc blocks to vue component + * + * @internal */ export const renderPageSfcBlocksToVue = ( sfcBlocks: MarkdownSfcBlocks, diff --git a/packages/core/src/page/resolvePageChunkInfo.ts b/packages/core/src/page/resolvePageChunkInfo.ts index 037018c6cc..0d5c6b994f 100644 --- a/packages/core/src/page/resolvePageChunkInfo.ts +++ b/packages/core/src/page/resolvePageChunkInfo.ts @@ -3,6 +3,8 @@ import type { App } from '../types/index.js' /** * Resolve page data file path + * + * @internal */ export const resolvePageChunkInfo = ({ app, diff --git a/packages/core/src/page/resolvePageComponentInfo.ts b/packages/core/src/page/resolvePageComponentInfo.ts index b1ee312cc4..1e5d4d6156 100644 --- a/packages/core/src/page/resolvePageComponentInfo.ts +++ b/packages/core/src/page/resolvePageComponentInfo.ts @@ -3,6 +3,8 @@ import type { App } from '../types/index.js' /** * Resolve page component and related info + * + * @internal */ export const resolvePageComponentInfo = ({ app, diff --git a/packages/core/src/page/resolvePageContent.ts b/packages/core/src/page/resolvePageContent.ts index c4bda0732b..51a1aa3ab2 100644 --- a/packages/core/src/page/resolvePageContent.ts +++ b/packages/core/src/page/resolvePageContent.ts @@ -9,6 +9,8 @@ const FALLBACK_CONTENT = '' /** * Resolve page content according to `content` or `filePath` + * + * @internal */ export const resolvePageContent = async ({ filePath, diff --git a/packages/core/src/page/resolvePageDate.ts b/packages/core/src/page/resolvePageDate.ts index d371062f68..f9b2d5312c 100644 --- a/packages/core/src/page/resolvePageDate.ts +++ b/packages/core/src/page/resolvePageDate.ts @@ -10,6 +10,8 @@ const DEFAULT_DATE = '0000-00-00' * Resolve page date according to frontmatter or file path * * It will be resolved as 'yyyy-MM-dd' format + * + * @internal */ export const resolvePageDate = ({ frontmatter, diff --git a/packages/core/src/page/resolvePageFilePath.ts b/packages/core/src/page/resolvePageFilePath.ts index ee5a1b01ed..32d34e23a5 100644 --- a/packages/core/src/page/resolvePageFilePath.ts +++ b/packages/core/src/page/resolvePageFilePath.ts @@ -3,6 +3,8 @@ import type { App, PageOptions } from '../types/index.js' /** * Resolve absolute and relative path of page file + * + * @internal */ export const resolvePageFilePath = ({ app, diff --git a/packages/core/src/page/resolvePageHtmlInfo.ts b/packages/core/src/page/resolvePageHtmlInfo.ts index 677921ed04..0417e4edbe 100644 --- a/packages/core/src/page/resolvePageHtmlInfo.ts +++ b/packages/core/src/page/resolvePageHtmlInfo.ts @@ -3,6 +3,8 @@ import type { App } from '../types/index.js' /** * Resolve page rendered html file path + * + * @internal */ export const resolvePageHtmlInfo = ({ app, diff --git a/packages/core/src/page/resolvePageLang.ts b/packages/core/src/page/resolvePageLang.ts index 3f2f243256..d0774e871c 100644 --- a/packages/core/src/page/resolvePageLang.ts +++ b/packages/core/src/page/resolvePageLang.ts @@ -3,6 +3,8 @@ import type { App, PageFrontmatter } from '../types/index.js' /** * Resolve language of page + * + * @internal */ export const resolvePageLang = ({ app, diff --git a/packages/core/src/page/resolvePagePath.ts b/packages/core/src/page/resolvePagePath.ts index c40e366455..0edac439de 100644 --- a/packages/core/src/page/resolvePagePath.ts +++ b/packages/core/src/page/resolvePagePath.ts @@ -3,6 +3,8 @@ import type { PageOptions } from '../types/index.js' /** * Resolve the final route path of a page + * + * @internal */ export const resolvePagePath = ({ permalink, diff --git a/packages/core/src/page/resolvePagePermalink.ts b/packages/core/src/page/resolvePagePermalink.ts index 15a421dec1..4b62c069f7 100644 --- a/packages/core/src/page/resolvePagePermalink.ts +++ b/packages/core/src/page/resolvePagePermalink.ts @@ -4,6 +4,8 @@ import type { App, PageFrontmatter } from '../types/index.js' /** * Resolve page permalink from frontmatter / options / pattern + * + * @internal */ export const resolvePagePermalink = ({ app, diff --git a/packages/core/src/page/resolvePageRouteMeta.ts b/packages/core/src/page/resolvePageRouteMeta.ts index 76e5030a91..fa66e39d36 100644 --- a/packages/core/src/page/resolvePageRouteMeta.ts +++ b/packages/core/src/page/resolvePageRouteMeta.ts @@ -2,6 +2,8 @@ import type { PageFrontmatter } from '../types/index.js' /** * Resolve page route meta + * + * @internal */ export const resolvePageRouteMeta = ({ frontmatter, diff --git a/packages/core/src/page/resolvePageSlug.ts b/packages/core/src/page/resolvePageSlug.ts index a7329ffbaa..f9c3704571 100644 --- a/packages/core/src/page/resolvePageSlug.ts +++ b/packages/core/src/page/resolvePageSlug.ts @@ -4,6 +4,8 @@ const DATE_RE = /(\d{4}-\d{1,2}(-\d{1,2})?)-(.*)/ /** * Resolve page slug from filename + * + * @internal */ export const resolvePageSlug = ({ filePathRelative, diff --git a/packages/core/src/pluginApi/createHookQueue.ts b/packages/core/src/pluginApi/createHookQueue.ts index 09331eee3e..9fb70cc9ad 100644 --- a/packages/core/src/pluginApi/createHookQueue.ts +++ b/packages/core/src/pluginApi/createHookQueue.ts @@ -10,6 +10,8 @@ const log = debug('vuepress:core/plugin-api') /** * Create hook queue for plugin system + * + * @internal */ export const createHookQueue = (name: T): HookQueue => { const items: HookItem[] = [] diff --git a/packages/core/src/pluginApi/createPluginApi.ts b/packages/core/src/pluginApi/createPluginApi.ts index 4f90cda435..18aa270ed7 100644 --- a/packages/core/src/pluginApi/createPluginApi.ts +++ b/packages/core/src/pluginApi/createPluginApi.ts @@ -2,6 +2,11 @@ import type { PluginApi } from '../types/index.js' import { createPluginApiHooks } from './createPluginApiHooks.js' import { createPluginApiRegisterHooks } from './createPluginApiRegisterHooks.js' +/** + * Create vuepress plugin api + * + * @internal + */ export const createPluginApi = (): PluginApi => { const plugins: PluginApi['plugins'] = [] const hooks = createPluginApiHooks() diff --git a/packages/core/src/pluginApi/createPluginApiHooks.ts b/packages/core/src/pluginApi/createPluginApiHooks.ts index 0cefc33067..d8369985bb 100644 --- a/packages/core/src/pluginApi/createPluginApiHooks.ts +++ b/packages/core/src/pluginApi/createPluginApiHooks.ts @@ -1,6 +1,11 @@ import type { PluginApi } from '../types/index.js' import { createHookQueue } from './createHookQueue.js' +/** + * Create hooks for plugin api + * + * @internal + */ export const createPluginApiHooks = (): PluginApi['hooks'] => ({ // life cycle hooks onInitialized: createHookQueue('onInitialized'), diff --git a/packages/core/src/pluginApi/createPluginApiRegisterHooks.ts b/packages/core/src/pluginApi/createPluginApiRegisterHooks.ts index 79ee344016..22c94c4a01 100644 --- a/packages/core/src/pluginApi/createPluginApiRegisterHooks.ts +++ b/packages/core/src/pluginApi/createPluginApiRegisterHooks.ts @@ -2,6 +2,11 @@ import type { PluginApi } from '../types/index.js' import { normalizeAliasDefineHook } from './normalizeAliasDefineHook.js' import { normalizeClientConfigFileHook } from './normalizeClientConfigFileHook.js' +/** + * Create registerHooks method for plugin api + * + * @internal + */ export const createPluginApiRegisterHooks = ( plugins: PluginApi['plugins'], diff --git a/packages/core/src/pluginApi/normalizeAliasDefineHook.ts b/packages/core/src/pluginApi/normalizeAliasDefineHook.ts index 6c3da1a21b..1b12ac361b 100644 --- a/packages/core/src/pluginApi/normalizeAliasDefineHook.ts +++ b/packages/core/src/pluginApi/normalizeAliasDefineHook.ts @@ -3,6 +3,8 @@ import type { AliasDefineHook } from '../types/index.js' /** * Normalize alias and define hook + * + * @internal */ export const normalizeAliasDefineHook = (hook: AliasDefineHook['exposed']): AliasDefineHook['normalized'] => diff --git a/packages/core/src/pluginApi/normalizeClientConfigFileHook.ts b/packages/core/src/pluginApi/normalizeClientConfigFileHook.ts index bba349702c..a6475852e4 100644 --- a/packages/core/src/pluginApi/normalizeClientConfigFileHook.ts +++ b/packages/core/src/pluginApi/normalizeClientConfigFileHook.ts @@ -4,6 +4,8 @@ import type { ClientConfigFileHook } from '../types/index.js' /** * Normalize hook for client config file + * + * @internal */ export const normalizeClientConfigFileHook = (hook: ClientConfigFileHook['exposed']): ClientConfigFileHook['normalized'] =>