Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vuejs/vitepress
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.0-rc.18
Choose a base ref
...
head repository: vuejs/vitepress
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.0.0-rc.19
Choose a head ref
  • 2 commits
  • 9 files changed
  • 1 contributor

Commits on Sep 24, 2023

  1. build: improve types (#3009)

    brc-dd authored Sep 24, 2023
    Copy the full SHA
    8b10848 View commit details
  2. release: v1.0.0-rc.19

    brc-dd committed Sep 24, 2023
    Copy the full SHA
    b5833f3 View commit details
Showing with 44 additions and 26 deletions.
  1. +2 −0 CHANGELOG.md
  2. +6 −2 package.json
  3. +3 −0 pnpm-lock.yaml
  4. +9 −2 rollup.config.ts
  5. +1 −1 src/client/index.ts
  6. +2 −2 src/client/shim.d.ts
  7. +1 −1 src/node/index.ts
  8. +3 −3 src/node/postcss/index.ts
  9. +17 −15 theme.d.ts
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# [1.0.0-rc.19](https://github.com/vuejs/vitepress/compare/v1.0.0-rc.18...v1.0.0-rc.19) (2023-09-24)

# [1.0.0-rc.18](https://github.com/vuejs/vitepress/compare/v1.0.0-rc.17...v1.0.0-rc.18) (2023-09-24)

### Bug Fixes
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vitepress",
"version": "1.0.0-rc.18",
"version": "1.0.0-rc.19",
"description": "Vite & Vue powered static site generator",
"type": "module",
"packageManager": "pnpm@8.7.6",
@@ -103,11 +103,15 @@
"vue": "^3.3.4"
},
"peerDependencies": {
"markdown-it-mathjax3": "^4.3.2"
"markdown-it-mathjax3": "^4.3.2",
"postcss": "^8.4.30"
},
"peerDependenciesMeta": {
"markdown-it-mathjax3": {
"optional": true
},
"postcss": {
"optional": true
}
},
"devDependencies": {
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions rollup.config.ts
Original file line number Diff line number Diff line change
@@ -62,13 +62,20 @@ const esmBuild: RollupOptions = {
}
}

const typesExternal = [
...external,
/\/vitepress\/(?!(dist|node_modules)\/).*\.d\.ts$/,
'source-map-js',
'fast-glob'
]

const nodeTypes: RollupOptions = {
input: r('src/node/index.ts'),
output: {
format: 'esm',
file: 'dist/node/index.d.ts'
},
external: [...external, r('types/shared.d.ts'), 'postcss', 'source-map-js'],
external: typesExternal,
plugins: [dts({ respectExternal: true })]
}

@@ -78,7 +85,7 @@ const clientTypes: RollupOptions = {
format: 'esm',
file: 'dist/client/index.d.ts'
},
external,
external: typesExternal,
plugins: [
dts({ respectExternal: true }),
{
2 changes: 1 addition & 1 deletion src/client/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// exports in this file are exposed to themes and md files via 'vitepress'
// so the user can do `import { useRoute, useSiteData } from 'vitepress'`
// so the user can do `import { useRoute, useData } from 'vitepress'`

// generic types
export type { VitePressData } from './app/data'
4 changes: 2 additions & 2 deletions src/client/shim.d.ts
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ declare module '@localSearchIndex' {
}

declare module 'mark.js/src/vanilla.js' {
import type { Mark } from 'mark.js'
const mark: Mark
import type Mark from 'mark.js'
const mark: typeof Mark
export default mark
}
2 changes: 1 addition & 1 deletion src/node/index.ts
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ export * from './init/init'
export * from './contentLoader'
export * from './postcss'
export { defineLoader, type LoaderModule } from './plugins/staticDataPlugin'
export { loadEnv } from 'vite'
export { loadEnv, type Plugin } from 'vite'

// shared types
export type {
6 changes: 3 additions & 3 deletions src/node/postcss/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import postcssPrefixSelector from 'postcss-prefix-selector'

type Options = Parameters<typeof postcssPrefixSelector>[0]

export function postcssIsolateStyles(options: Options = {}) {
export function postcssIsolateStyles(
options: Parameters<typeof postcssPrefixSelector>[0] = {}
): ReturnType<typeof postcssPrefixSelector> {
return postcssPrefixSelector({
prefix: ':not(:where(.vp-raw, .vp-raw *))',
includeFiles: [/base\.css/],
32 changes: 17 additions & 15 deletions theme.d.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
// so that users can do `import DefaultTheme from 'vitepress/theme'`

import type { DefineComponent } from 'vue'
import { EnhanceAppContext } from './dist/client/index.js'
import type { EnhanceAppContext } from './dist/client/index.js'
import type { DefaultTheme } from './types/default-theme.js'

// TODO: add props for these
export const VPImage: DefineComponent
export const VPButton: DefineComponent
export const VPHomeHero: DefineComponent
export const VPHomeFeatures: DefineComponent
export const VPHomeSponsors: DefineComponent
export const VPDocAsideSponsors: DefineComponent
export const VPSponsors: DefineComponent
export const VPTeamPage: DefineComponent
export const VPTeamPageTitle: DefineComponent
export const VPTeamPageSection: DefineComponent
export const VPTeamMembers: DefineComponent
export type { DefaultTheme } from './types/default-theme.js'

declare const theme: {
Layout: DefineComponent
enhanceApp: (ctx: EnhanceAppContext) => void
}

export default theme
export type { DefaultTheme } from './types/default-theme.js'
export declare const useSidebar: () => DefaultTheme.DocSidebar

export const useSidebar: () => DefaultTheme.DocSidebar
// TODO: add props for these
export declare const VPButton: DefineComponent
export declare const VPDocAsideSponsors: DefineComponent
export declare const VPHomeFeatures: DefineComponent
export declare const VPHomeHero: DefineComponent
export declare const VPHomeSponsors: DefineComponent
export declare const VPImage: DefineComponent
export declare const VPSponsors: DefineComponent
export declare const VPTeamMembers: DefineComponent
export declare const VPTeamPage: DefineComponent
export declare const VPTeamPageSection: DefineComponent
export declare const VPTeamPageTitle: DefineComponent