vitepress
Advanced tools
Comparing version 0.20.10 to 0.21.0
@@ -12,4 +12,4 @@ import { reactive, inject, markRaw, nextTick, readonly } from 'vue'; | ||
// the app is mounted, so it's guaranteed to be available in | ||
// components | ||
data: null | ||
// components. We just need enough data for 404 pages to render. | ||
data: { frontmatter: {} } | ||
}); | ||
@@ -16,0 +16,0 @@ export function createRouter(loadPageModule, fallbackComponent) { |
@@ -18,3 +18,3 @@ import { computed } from 'vue'; | ||
} | ||
// if it's `atuo`, render headers of the current page | ||
// if it's `auto`, render headers of the current page | ||
if (frontSidebar === 'auto') { | ||
@@ -21,0 +21,0 @@ return resolveAutoSidebar(headers, sidebarDepth); |
'use strict'; | ||
var serve = require('./serve-b109daa0.js'); | ||
var serve = require('./serve-de785cbb.js'); | ||
require('fs'); | ||
@@ -5,0 +5,0 @@ require('path'); |
@@ -18,7 +18,159 @@ import { AliasOptions } from 'vite'; | ||
export declare namespace DefaultTheme { | ||
export interface Config { | ||
logo?: string | ||
nav?: NavItem[] | false | ||
sidebar?: SideBarConfig | MultiSideBarConfig | ||
/** | ||
* GitHub repository following the format <user>/<project>. | ||
* | ||
* @example `"vuejs/vue-next"` | ||
*/ | ||
repo?: string | ||
/** | ||
* Customize the header label. Defaults to GitHub/Gitlab/Bitbucket | ||
* depending on the provided repo. | ||
* | ||
* @example `"Contribute!"` | ||
*/ | ||
repoLabel?: string | ||
/** | ||
* If your docs are in a different repository from your main project. | ||
* | ||
* @example `"vuejs/docs-next"` | ||
*/ | ||
docsRepo?: string | ||
/** | ||
* If your docs are not at the root of the repo. | ||
* | ||
* @example `"docs"` | ||
*/ | ||
docsDir?: string | ||
/** | ||
* If your docs are in a different branch. Defaults to `master`. | ||
* | ||
* @example `"next"` | ||
*/ | ||
docsBranch?: string | ||
/** | ||
* Enable links to edit pages at the bottom of the page. | ||
*/ | ||
editLinks?: boolean | ||
/** | ||
* Custom text for edit link. Defaults to "Edit this page". | ||
*/ | ||
editLinkText?: string | ||
/** | ||
* Show last updated time at the bottom of the page. Defaults to `false`. | ||
* If given a string, it will be displayed as a prefix (default value: | ||
* "Last Updated"). | ||
*/ | ||
lastUpdated?: string | boolean | ||
prevLinks?: boolean | ||
nextLinks?: boolean | ||
locales?: Record<string, LocaleConfig & Omit<Config, 'locales'>> | ||
algolia?: AlgoliaSearchOptions | ||
carbonAds?: { | ||
carbon: string | ||
custom?: string | ||
placement: string | ||
} | ||
} | ||
// navbar -------------------------------------------------------------------- | ||
export type NavItem = NavItemWithLink | NavItemWithChildren | ||
export interface NavItemBase { | ||
text: string | ||
target?: string | ||
rel?: string | ||
ariaLabel?: string | ||
activeMatch?: string | ||
} | ||
export interface NavItemWithLink extends NavItemBase { | ||
link: string | ||
} | ||
export interface NavItemWithChildren extends NavItemBase { | ||
items: NavItemWithLink[] | ||
} | ||
// sidebar ------------------------------------------------------------------- | ||
export type SideBarConfig = SideBarItem[] | 'auto' | false | ||
export interface MultiSideBarConfig { | ||
[path: string]: SideBarConfig | ||
} | ||
export type SideBarItem = SideBarLink | SideBarGroup | ||
export interface SideBarLink { | ||
text: string | ||
link: string | ||
} | ||
export interface SideBarGroup { | ||
text: string | ||
link?: string | ||
/** | ||
* @default false | ||
*/ | ||
collapsable?: boolean | ||
children: SideBarItem[] | ||
} | ||
// algolia ------------------------------------------------------------------ | ||
// partially copied from @docsearch/react/dist/esm/DocSearch.d.ts | ||
export interface AlgoliaSearchOptions { | ||
appId?: string | ||
apiKey: string | ||
indexName: string | ||
placeholder?: string | ||
searchParameters?: any | ||
disableUserPersonalization?: boolean | ||
initialQuery?: string | ||
} | ||
// locales ------------------------------------------------------------------- | ||
export interface LocaleConfig { | ||
/** | ||
* Text for the language dropdown. | ||
*/ | ||
selectText?: string | ||
/** | ||
* Label for this locale in the language dropdown. | ||
*/ | ||
label?: string | ||
} | ||
} | ||
/** | ||
* Type config helper | ||
*/ | ||
export declare function defineConfig(config: RawConfigExports): RawConfigExports; | ||
export declare function defineConfig(config: UserConfig<DefaultTheme.Config>): UserConfig<DefaultTheme.Config>; | ||
/** | ||
* Type config helper for custom theme config | ||
*/ | ||
export declare function defineConfigWithTheme<ThemeConfig>(config: UserConfig<ThemeConfig>): UserConfig<ThemeConfig>; | ||
export declare type HeadConfig = | ||
@@ -64,11 +216,9 @@ | [string, Record<string, string>] | ||
export declare interface MarkdownRenderer { | ||
export declare interface MarkdownRenderer extends MarkdownIt { | ||
__path: string; | ||
__relativePath: string; | ||
__data: MarkdownParsedData; | ||
render: (src: string, env?: any) => { | ||
html: string; | ||
data: any; | ||
}; | ||
} | ||
export declare type RawConfigExports = UserConfig | Promise<UserConfig> | (() => UserConfig | Promise<UserConfig>); | ||
export declare type RawConfigExports<ThemeConfig = any> = UserConfig<ThemeConfig> | Promise<UserConfig<ThemeConfig>> | (() => UserConfig<ThemeConfig> | Promise<UserConfig<ThemeConfig>>); | ||
@@ -135,3 +285,3 @@ export declare function resolveConfig(root?: string, command?: 'serve' | 'build', mode?: string): Promise<SiteConfig>; | ||
export declare interface UserConfig<ThemeConfig = any> { | ||
extends?: RawConfigExports; | ||
extends?: RawConfigExports<ThemeConfig>; | ||
lang?: string; | ||
@@ -146,3 +296,3 @@ base?: string; | ||
/** | ||
* Opitons to pass on to `@vitejs/plugin-vue` | ||
* Options to pass on to `@vitejs/plugin-vue` | ||
*/ | ||
@@ -156,2 +306,3 @@ vue?: Options; | ||
srcExclude?: string[]; | ||
outDir?: string; | ||
shouldPreload?: (link: string, page: string) => boolean; | ||
@@ -158,0 +309,0 @@ /** |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var serve = require('./serve-b109daa0.js'); | ||
var serve = require('./serve-de785cbb.js'); | ||
require('vite'); | ||
@@ -33,2 +33,3 @@ require('readline'); | ||
exports.defineConfig = serve.defineConfig; | ||
exports.defineConfigWithTheme = serve.defineConfigWithTheme; | ||
exports.resolveConfig = serve.resolveConfig; | ||
@@ -35,0 +36,0 @@ exports.resolveSiteData = serve.resolveSiteData; |
@@ -18,7 +18,159 @@ import { AliasOptions } from 'vite'; | ||
export declare namespace DefaultTheme { | ||
export interface Config { | ||
logo?: string | ||
nav?: NavItem[] | false | ||
sidebar?: SideBarConfig | MultiSideBarConfig | ||
/** | ||
* GitHub repository following the format <user>/<project>. | ||
* | ||
* @example `"vuejs/vue-next"` | ||
*/ | ||
repo?: string | ||
/** | ||
* Customize the header label. Defaults to GitHub/Gitlab/Bitbucket | ||
* depending on the provided repo. | ||
* | ||
* @example `"Contribute!"` | ||
*/ | ||
repoLabel?: string | ||
/** | ||
* If your docs are in a different repository from your main project. | ||
* | ||
* @example `"vuejs/docs-next"` | ||
*/ | ||
docsRepo?: string | ||
/** | ||
* If your docs are not at the root of the repo. | ||
* | ||
* @example `"docs"` | ||
*/ | ||
docsDir?: string | ||
/** | ||
* If your docs are in a different branch. Defaults to `master`. | ||
* | ||
* @example `"next"` | ||
*/ | ||
docsBranch?: string | ||
/** | ||
* Enable links to edit pages at the bottom of the page. | ||
*/ | ||
editLinks?: boolean | ||
/** | ||
* Custom text for edit link. Defaults to "Edit this page". | ||
*/ | ||
editLinkText?: string | ||
/** | ||
* Show last updated time at the bottom of the page. Defaults to `false`. | ||
* If given a string, it will be displayed as a prefix (default value: | ||
* "Last Updated"). | ||
*/ | ||
lastUpdated?: string | boolean | ||
prevLinks?: boolean | ||
nextLinks?: boolean | ||
locales?: Record<string, LocaleConfig & Omit<Config, 'locales'>> | ||
algolia?: AlgoliaSearchOptions | ||
carbonAds?: { | ||
carbon: string | ||
custom?: string | ||
placement: string | ||
} | ||
} | ||
// navbar -------------------------------------------------------------------- | ||
export type NavItem = NavItemWithLink | NavItemWithChildren | ||
export interface NavItemBase { | ||
text: string | ||
target?: string | ||
rel?: string | ||
ariaLabel?: string | ||
activeMatch?: string | ||
} | ||
export interface NavItemWithLink extends NavItemBase { | ||
link: string | ||
} | ||
export interface NavItemWithChildren extends NavItemBase { | ||
items: NavItemWithLink[] | ||
} | ||
// sidebar ------------------------------------------------------------------- | ||
export type SideBarConfig = SideBarItem[] | 'auto' | false | ||
export interface MultiSideBarConfig { | ||
[path: string]: SideBarConfig | ||
} | ||
export type SideBarItem = SideBarLink | SideBarGroup | ||
export interface SideBarLink { | ||
text: string | ||
link: string | ||
} | ||
export interface SideBarGroup { | ||
text: string | ||
link?: string | ||
/** | ||
* @default false | ||
*/ | ||
collapsable?: boolean | ||
children: SideBarItem[] | ||
} | ||
// algolia ------------------------------------------------------------------ | ||
// partially copied from @docsearch/react/dist/esm/DocSearch.d.ts | ||
export interface AlgoliaSearchOptions { | ||
appId?: string | ||
apiKey: string | ||
indexName: string | ||
placeholder?: string | ||
searchParameters?: any | ||
disableUserPersonalization?: boolean | ||
initialQuery?: string | ||
} | ||
// locales ------------------------------------------------------------------- | ||
export interface LocaleConfig { | ||
/** | ||
* Text for the language dropdown. | ||
*/ | ||
selectText?: string | ||
/** | ||
* Label for this locale in the language dropdown. | ||
*/ | ||
label?: string | ||
} | ||
} | ||
/** | ||
* Type config helper | ||
*/ | ||
export declare function defineConfig(config: RawConfigExports): RawConfigExports; | ||
export declare function defineConfig(config: UserConfig<DefaultTheme.Config>): UserConfig<DefaultTheme.Config>; | ||
/** | ||
* Type config helper for custom theme config | ||
*/ | ||
export declare function defineConfigWithTheme<ThemeConfig>(config: UserConfig<ThemeConfig>): UserConfig<ThemeConfig>; | ||
export declare type HeadConfig = | ||
@@ -64,11 +216,9 @@ | [string, Record<string, string>] | ||
export declare interface MarkdownRenderer { | ||
export declare interface MarkdownRenderer extends MarkdownIt { | ||
__path: string; | ||
__relativePath: string; | ||
__data: MarkdownParsedData; | ||
render: (src: string, env?: any) => { | ||
html: string; | ||
data: any; | ||
}; | ||
} | ||
export declare type RawConfigExports = UserConfig | Promise<UserConfig> | (() => UserConfig | Promise<UserConfig>); | ||
export declare type RawConfigExports<ThemeConfig = any> = UserConfig<ThemeConfig> | Promise<UserConfig<ThemeConfig>> | (() => UserConfig<ThemeConfig> | Promise<UserConfig<ThemeConfig>>); | ||
@@ -135,3 +285,3 @@ export declare function resolveConfig(root?: string, command?: 'serve' | 'build', mode?: string): Promise<SiteConfig>; | ||
export declare interface UserConfig<ThemeConfig = any> { | ||
extends?: RawConfigExports; | ||
extends?: RawConfigExports<ThemeConfig>; | ||
lang?: string; | ||
@@ -146,3 +296,3 @@ base?: string; | ||
/** | ||
* Opitons to pass on to `@vitejs/plugin-vue` | ||
* Options to pass on to `@vitejs/plugin-vue` | ||
*/ | ||
@@ -156,2 +306,3 @@ vue?: Options; | ||
srcExclude?: string[]; | ||
outDir?: string; | ||
shouldPreload?: (link: string, page: string) => boolean; | ||
@@ -158,0 +309,0 @@ /** |
{ | ||
"name": "vitepress", | ||
"version": "0.20.10", | ||
"version": "0.21.0", | ||
"description": "Vite & Vue powered static site generator", | ||
@@ -5,0 +5,0 @@ "main": "dist/node/index.js", |
export * from './shared' | ||
export * from './default-theme' | ||
export * from '../dist/node/index' | ||
export * from '../dist/client/index' | ||
export * from '../dist/client/theme-default/config' |
// types shared between server and client | ||
export { DefaultTheme } from './default-theme' | ||
export interface LocaleConfig { | ||
@@ -4,0 +6,0 @@ lang: string |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1593218
69
62550