From da2c4f694e6dd2d11ff061b8eb7cae2354ae930d Mon Sep 17 00:00:00 2001 From: Matias Capeletto Date: Mon, 4 Jan 2021 09:02:53 +0100 Subject: [PATCH 01/46] fix: bump vite and fix win32 path resolving (#198) --- package.json | 2 +- src/node/build/render.ts | 3 ++- yarn.lock | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 8102c7bd..ecd0d0a0 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "prismjs": "^1.20.0", "sirv": "^1.0.10", "slash": "^3.0.0", - "vite": "^2.0.0-beta.2", + "vite": "^2.0.0-beta.4", "vue": "^3.0.5" }, "devDependencies": { diff --git a/src/node/build/render.ts b/src/node/build/render.ts index 8ec778bb..4c2d54c8 100644 --- a/src/node/build/render.ts +++ b/src/node/build/render.ts @@ -2,6 +2,7 @@ import path from 'path' import fs from 'fs-extra' import { SiteConfig, resolveSiteDataByRoute } from '../config' import { HeadConfig } from '../../../types/shared' +import { normalizePath } from 'vite' import { RollupOutput, OutputChunk, OutputAsset } from 'rollup' const escape = require('escape-html') @@ -88,7 +89,7 @@ function resolvePageImports( // find the page's js chunk and inject script tags for its imports so that // they are start fetching as early as possible - const srcPath = path.resolve(config.root, page) + const srcPath = normalizePath(path.resolve(config.root, page)) const pageChunk = result.output.find( (chunk) => chunk.type === 'chunk' && chunk.facadeModuleId === srcPath ) as OutputChunk diff --git a/yarn.lock b/yarn.lock index 3723d480..f666a8e5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6031,10 +6031,10 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -vite@^2.0.0-beta.2: - version "2.0.0-beta.2" - resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.2.tgz#5ea8fd4a01d0f722db59bff2bdc4ae24ba9fa63a" - integrity sha512-bZ2IeW+Uo4A7HpRIqyyHUDk6/WOGIkNdTm5/0yLmgjvXgLErwUhzv7Z0T0C6lc4lwoQV9KEA8IbFkZ+ZyWzhWg== +vite@^2.0.0-beta.4: + version "2.0.0-beta.4" + resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.4.tgz#6ea8e08ae5e6b510548d02ec770d34046622aef7" + integrity sha512-V0HV6xyUPQ9ktJ8gLm0Et7zTFtp8WmISsH/K+FuGF3aJ4VJOlSYEaget1nHCauUPI7WDPe97suz7SCIVHW2iEg== dependencies: esbuild "^0.8.26" postcss "^8.2.1" From 9965ce6ae8ffa158fe55457d7e639d85f09cef16 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 4 Jan 2021 03:05:00 -0500 Subject: [PATCH 02/46] pass ssr option to vite build this will be required in next release --- src/node/build/bundle.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/node/build/bundle.ts b/src/node/build/bundle.ts index 9fc38db9..a9607a7b 100644 --- a/src/node/build/bundle.ts +++ b/src/node/build/bundle.ts @@ -40,6 +40,8 @@ export async function bundle( plugins: createVitePressPlugin(root, config, ssr, pageToHashMap), build: { ...options, + // @ts-ignore + ssr, base: config.site.base, outDir: ssr ? config.tempDir : config.outDir, cssCodeSplit: false, From fe83ec2848170373df98204b03dc3d9933713a56 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 4 Jan 2021 03:07:57 -0500 Subject: [PATCH 03/46] release: v0.10.6 --- CHANGELOG.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a9fd1e1..c0ba3f45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [0.10.6](https://github.com/vuejs/vitepress/compare/v0.10.5...v0.10.6) (2021-01-04) + +### Bug Fixes + +- bump vite and fix win32 path resolving ([#198](https://github.com/vuejs/vitepress/issues/198)) ([da2c4f6](https://github.com/vuejs/vitepress/commit/da2c4f694e6dd2d11ff061b8eb7cae2354ae930d)) + ## [0.10.5](https://github.com/vuejs/vitepress/compare/v0.10.4...v0.10.5) (2021-01-02) ### Bug Fixes diff --git a/package.json b/package.json index ecd0d0a0..e918272e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vitepress", - "version": "0.10.5", + "version": "0.10.6", "description": "Vite & Vue powered static site generator", "main": "dist/node/index.js", "typings": "types/index.d.ts", From 759bbd3f6132140eeecef684749681f1b33132d7 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 5 Jan 2021 13:53:34 -0500 Subject: [PATCH 04/46] chore: bump vite --- package.json | 2 +- src/node/plugin.ts | 1 - yarn.lock | 11 ++++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index e918272e..4b811ff0 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "prismjs": "^1.20.0", "sirv": "^1.0.10", "slash": "^3.0.0", - "vite": "^2.0.0-beta.4", + "vite": "^2.0.0-beta.6", "vue": "^3.0.5" }, "devDependencies": { diff --git a/src/node/plugin.ts b/src/node/plugin.ts index e9503dd5..53baae8a 100644 --- a/src/node/plugin.ts +++ b/src/node/plugin.ts @@ -43,7 +43,6 @@ export function createVitePressPlugin( config() { return { alias: aliases, - transformInclude: /\.md$/, define: { __CARBON__: !!site.themeConfig.carbonAds?.carbon, __BSA__: !!site.themeConfig.carbonAds?.custom, diff --git a/yarn.lock b/yarn.lock index f666a8e5..ef4f6292 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5120,7 +5120,7 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.17.0, resolve@^1.18.1: +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.19.0: version "1.19.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c" integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== @@ -6031,13 +6031,14 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -vite@^2.0.0-beta.4: - version "2.0.0-beta.4" - resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.4.tgz#6ea8e08ae5e6b510548d02ec770d34046622aef7" - integrity sha512-V0HV6xyUPQ9ktJ8gLm0Et7zTFtp8WmISsH/K+FuGF3aJ4VJOlSYEaget1nHCauUPI7WDPe97suz7SCIVHW2iEg== +vite@^2.0.0-beta.6: + version "2.0.0-beta.6" + resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.6.tgz#8f62e05027b0dbbcc9640c7e641b1f9a39310b62" + integrity sha512-VtzB5X5XUUNWBTnOrdsi6pqBj7V/95kJ2GmcVTdfnnmN1KzShEW2NH1e210adXiuuPn4wtGShg4ruIuq02Evzg== dependencies: esbuild "^0.8.26" postcss "^8.2.1" + resolve "^1.19.0" rollup "^2.35.1" optionalDependencies: fsevents "~2.1.2" From 161e0ea69cf1cbd3ee1132c892cc4419d31e7e0a Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 5 Jan 2021 13:56:01 -0500 Subject: [PATCH 05/46] types: add vite env --- src/client/env.d.ts | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/client/env.d.ts diff --git a/src/client/env.d.ts b/src/client/env.d.ts new file mode 100644 index 00000000..a8708975 --- /dev/null +++ b/src/client/env.d.ts @@ -0,0 +1 @@ +import 'vite/env' From 6ff76c4ea8adca955a4739509b6f39309ddddec2 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 5 Jan 2021 14:10:52 -0500 Subject: [PATCH 06/46] chore: bump vite --- package.json | 2 +- src/client/app/composables/head.ts | 2 +- src/client/app/index.ts | 3 ++- src/client/app/mixin.ts | 4 +--- src/client/env.d.ts | 1 - src/client/theme-default/composables/activeSidebarLink.ts | 2 +- src/client/tsconfig.json | 2 +- yarn.lock | 8 ++++---- 8 files changed, 11 insertions(+), 13 deletions(-) delete mode 100644 src/client/env.d.ts diff --git a/package.json b/package.json index 4b811ff0..4fd80d28 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "prismjs": "^1.20.0", "sirv": "^1.0.10", "slash": "^3.0.0", - "vite": "^2.0.0-beta.6", + "vite": "^2.0.0-beta.7", "vue": "^3.0.5" }, "devDependencies": { diff --git a/src/client/app/composables/head.ts b/src/client/app/composables/head.ts index 1230760a..fc55fca6 100644 --- a/src/client/app/composables/head.ts +++ b/src/client/app/composables/head.ts @@ -7,7 +7,7 @@ export function useUpdateHead(route: Route, siteDataByRouteRef: Ref) { let isFirstUpdate = true const updateHeadTags = (newTags: HeadConfig[]) => { - if (process.env.NODE_ENV === 'production' && isFirstUpdate) { + if (import.meta.env.PROD && isFirstUpdate) { // in production, the initial meta tags are already pre-rendered so we // skip the first update. isFirstUpdate = false diff --git a/src/client/app/index.ts b/src/client/app/index.ts index d450d859..ea308300 100644 --- a/src/client/app/index.ts +++ b/src/client/app/index.ts @@ -54,7 +54,7 @@ export function createApp() { } function newApp(): App { - return process.env.NODE_ENV === 'production' + return import.meta.env.PROD ? createSSRApp(VitePressApp) : createClientApp(VitePressApp) } @@ -85,6 +85,7 @@ function newRouter(): Router { } // SSR: sync require + // @ts-ignore return require(pageFilePath) }, NotFound) } diff --git a/src/client/app/mixin.ts b/src/client/app/mixin.ts index 9fb29376..24841ce8 100644 --- a/src/client/app/mixin.ts +++ b/src/client/app/mixin.ts @@ -65,13 +65,11 @@ export function mixinGlobalComputed( } export function mixinGlobalComponents(app: App) { - const isProd = process.env.NODE_ENV === 'production' - app.component('Content', Content) app.component('ClientOnly', ClientOnly) app.component( 'Debug', - isProd + import.meta.env.PROD ? () => null : defineAsyncComponent(() => import('./components/Debug.vue')) ) diff --git a/src/client/env.d.ts b/src/client/env.d.ts deleted file mode 100644 index a8708975..00000000 --- a/src/client/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -import 'vite/env' diff --git a/src/client/theme-default/composables/activeSidebarLink.ts b/src/client/theme-default/composables/activeSidebarLink.ts index 278e17c2..1b3b1d01 100644 --- a/src/client/theme-default/composables/activeSidebarLink.ts +++ b/src/client/theme-default/composables/activeSidebarLink.ts @@ -113,7 +113,7 @@ function isAnchorActive( } function throttleAndDebounce(fn: () => void, delay: number): () => void { - let timeout: NodeJS.Timeout + let timeout: number let called = false return () => { diff --git a/src/client/tsconfig.json b/src/client/tsconfig.json index 08160422..6182a129 100644 --- a/src/client/tsconfig.json +++ b/src/client/tsconfig.json @@ -6,7 +6,7 @@ "target": "esnext", "module": "esnext", "lib": ["ESNext", "DOM"], - "types": ["vite"], + "types": ["vite/client"], "paths": { "/@shared/*": ["shared/*"], "/@types/*": ["../../types/*"], diff --git a/yarn.lock b/yarn.lock index ef4f6292..4daa5367 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6031,10 +6031,10 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -vite@^2.0.0-beta.6: - version "2.0.0-beta.6" - resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.6.tgz#8f62e05027b0dbbcc9640c7e641b1f9a39310b62" - integrity sha512-VtzB5X5XUUNWBTnOrdsi6pqBj7V/95kJ2GmcVTdfnnmN1KzShEW2NH1e210adXiuuPn4wtGShg4ruIuq02Evzg== +vite@^2.0.0-beta.7: + version "2.0.0-beta.7" + resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.7.tgz#8200198ac3c0a5e9deb62579e01053cea89d6176" + integrity sha512-9tkmaq4PbBDWmcvIto07jpkMiD084EgDsizZxijYrpS3ojC9myksA/hlKA7RzK+uSEFetcb1ZY4ONpJQb/J+vw== dependencies: esbuild "^0.8.26" postcss "^8.2.1" From b6ba8a943cc0488410a438c6c2f277c1c33a90bf Mon Sep 17 00:00:00 2001 From: Matias Capeletto Date: Tue, 5 Jan 2021 22:47:56 +0100 Subject: [PATCH 07/46] fix: scrollbar when using line highlight (#200) --- src/client/theme-default/styles/code.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/theme-default/styles/code.css b/src/client/theme-default/styles/code.css index adc2a221..e27762ce 100644 --- a/src/client/theme-default/styles/code.css +++ b/src/client/theme-default/styles/code.css @@ -85,6 +85,7 @@ li > div[class*='language-'] { font-family: var(--code-font-family); font-size: var(--code-font-size); user-select: none; + overflow: hidden; } .highlight-lines .highlighted { From 64a08b35a3457027d0daa88420fece3052008664 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 5 Jan 2021 18:17:05 -0500 Subject: [PATCH 08/46] chore: bump vite again --- package.json | 2 +- src/client/app/index.ts | 1 + src/node/build/bundle.ts | 1 - yarn.lock | 8 ++++---- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 4fd80d28..58240fe9 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "prismjs": "^1.20.0", "sirv": "^1.0.10", "slash": "^3.0.0", - "vite": "^2.0.0-beta.7", + "vite": "^2.0.0-beta.8", "vue": "^3.0.5" }, "devDependencies": { diff --git a/src/client/app/index.ts b/src/client/app/index.ts index ea308300..f791f250 100644 --- a/src/client/app/index.ts +++ b/src/client/app/index.ts @@ -1,3 +1,4 @@ +import 'vite/dynamic-import-polyfill' import { App, createApp as createClientApp, createSSRApp, h } from 'vue' import { inBrowser, pathToFile } from './utils' import { Router, RouterSymbol, createRouter } from './router' diff --git a/src/node/build/bundle.ts b/src/node/build/bundle.ts index a9607a7b..9489364c 100644 --- a/src/node/build/bundle.ts +++ b/src/node/build/bundle.ts @@ -40,7 +40,6 @@ export async function bundle( plugins: createVitePressPlugin(root, config, ssr, pageToHashMap), build: { ...options, - // @ts-ignore ssr, base: config.site.base, outDir: ssr ? config.tempDir : config.outDir, diff --git a/yarn.lock b/yarn.lock index 4daa5367..79018573 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6031,10 +6031,10 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -vite@^2.0.0-beta.7: - version "2.0.0-beta.7" - resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.7.tgz#8200198ac3c0a5e9deb62579e01053cea89d6176" - integrity sha512-9tkmaq4PbBDWmcvIto07jpkMiD084EgDsizZxijYrpS3ojC9myksA/hlKA7RzK+uSEFetcb1ZY4ONpJQb/J+vw== +vite@^2.0.0-beta.8: + version "2.0.0-beta.8" + resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.8.tgz#3578e94bcba69f0d89808fd665c293570b22c70d" + integrity sha512-fl9cDM2KxgpMtU2+xUGLgVmDITpDNEEk1KhDPC+LwjrSvCV7Z84zt3ihvymyjeRmPH7jBWsvuyIPys76gidBWA== dependencies: esbuild "^0.8.26" postcss "^8.2.1" From d8bf3b2886b29d6cbe5719f14f3fd1d4b409c4d8 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 5 Jan 2021 18:20:24 -0500 Subject: [PATCH 09/46] release: v0.10.7 --- CHANGELOG.md | 10 ++++++++++ package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0ba3f45..9e90c397 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [0.10.7](https://github.com/vuejs/vitepress/compare/v0.10.6...v0.10.7) (2021-01-05) + +### Features + +Bump to Vite 2.0.0-beta.8 + +### Bug Fixes + +- scrollbar when using line highlight ([#200](https://github.com/vuejs/vitepress/issues/200)) ([b6ba8a9](https://github.com/vuejs/vitepress/commit/b6ba8a943cc0488410a438c6c2f277c1c33a90bf)) + ## [0.10.6](https://github.com/vuejs/vitepress/compare/v0.10.5...v0.10.6) (2021-01-04) ### Bug Fixes diff --git a/package.json b/package.json index 58240fe9..65a02216 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vitepress", - "version": "0.10.6", + "version": "0.10.7", "description": "Vite & Vue powered static site generator", "main": "dist/node/index.js", "typings": "types/index.d.ts", From bac1ce2d01469ff7586437f43b0d665b1c5eb278 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Mon, 11 Jan 2021 08:24:32 +0800 Subject: [PATCH 10/46] fix: resolve page hash case-insenstively, close #202 (#203) --- src/client/app/index.ts | 2 +- src/client/app/router.ts | 2 +- src/client/app/utils.ts | 4 ++-- src/node/build/render.ts | 2 +- src/node/plugin.ts | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/app/index.ts b/src/client/app/index.ts index f791f250..5eb688e3 100644 --- a/src/client/app/index.ts +++ b/src/client/app/index.ts @@ -113,7 +113,7 @@ function shouldHotReload(payload: any): boolean { if (inBrowser) { const { app, router } = createApp() - // wait unitl page component is fetched before mounting + // wait until page component is fetched before mounting router.go().then(() => { app.mount('#app') }) diff --git a/src/client/app/router.ts b/src/client/app/router.ts index 4c314ce3..6a99e132 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -23,7 +23,7 @@ const getDefaultRoute = (): Route => ({ path: '/', component: null, // this will be set upon initial page load, which is before - // the app is mounted, so it's guaranteed to be avaiable in + // the app is mounted, so it's guaranteed to be available in // components data: null as any }) diff --git a/src/client/app/utils.ts b/src/client/app/utils.ts index 0eee7e11..26383bf5 100644 --- a/src/client/app/utils.ts +++ b/src/client/app/utils.ts @@ -17,7 +17,7 @@ export function pathToFile(path: string): string { } if (import.meta.env.DEV) { - // awlays force re-fetch content in dev + // always force re-fetch content in dev pagePath += `.md?t=${Date.now()}` } else { // in production, each .md file is built into a .md.js file following @@ -28,7 +28,7 @@ export function pathToFile(path: string): string { pagePath = pagePath.slice(base.length).replace(/\//g, '_') + '.md' // client production build needs to account for page hash, which is // injected directly in the page's html - const pageHash = __VP_HASH_MAP__[pagePath] + const pageHash = __VP_HASH_MAP__[pagePath.toLowerCase()] pagePath = `${base}assets/${pagePath}.${pageHash}.js` } else { // ssr build uses much simpler name mapping diff --git a/src/node/build/render.ts b/src/node/build/render.ts index 4c2d54c8..89689166 100644 --- a/src/node/build/render.ts +++ b/src/node/build/render.ts @@ -29,7 +29,7 @@ export async function renderPage( const pageServerJsFileName = pageName + '.js' // for any initial page load, we only need the lean version of the page js // since the static content is already on the page! - const pageHash = pageToHashMap[pageName] + const pageHash = pageToHashMap[pageName.toLowerCase()] const pageClientJsFileName = `assets/${pageName}.${pageHash}.lean.js` // resolve page data so we can render head tags diff --git a/src/node/plugin.ts b/src/node/plugin.ts index 53baae8a..29449449 100644 --- a/src/node/plugin.ts +++ b/src/node/plugin.ts @@ -122,7 +122,7 @@ export function createVitePressPlugin( if (isPageChunk(chunk)) { // record page -> hash relations const hash = chunk.fileName.match(hashRE)![1] - pageToHashMap![chunk.name] = hash + pageToHashMap![chunk.name.toLowerCase()] = hash // inject another chunk with the content stripped bundle[name + '-lean'] = { From 0a85bb89a13e8bc84ff8230a70882cd43f78ef79 Mon Sep 17 00:00:00 2001 From: Evan You Date: Sun, 10 Jan 2021 19:32:22 -0500 Subject: [PATCH 11/46] bump vite --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 65a02216..86feae6a 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "prismjs": "^1.20.0", "sirv": "^1.0.10", "slash": "^3.0.0", - "vite": "^2.0.0-beta.8", + "vite": "^2.0.0-beta.20", "vue": "^3.0.5" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 79018573..c9f30cb3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6031,10 +6031,10 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -vite@^2.0.0-beta.8: - version "2.0.0-beta.8" - resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.8.tgz#3578e94bcba69f0d89808fd665c293570b22c70d" - integrity sha512-fl9cDM2KxgpMtU2+xUGLgVmDITpDNEEk1KhDPC+LwjrSvCV7Z84zt3ihvymyjeRmPH7jBWsvuyIPys76gidBWA== +vite@^2.0.0-beta.20: + version "2.0.0-beta.20" + resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.20.tgz#338d436345be7e3474b5077f9ff6e3e70048834b" + integrity sha512-QsFgitrsGNzFRnPSlbtzz0Q5boMmGx17P4gW9dKu1sqtbg5joMqQrbihh2Tf9xQWu1G0+xPEevrpu1FRI744Xw== dependencies: esbuild "^0.8.26" postcss "^8.2.1" From 04a0fc297faf444307dae6b0a7c98f67c0af319a Mon Sep 17 00:00:00 2001 From: Evan You Date: Sun, 10 Jan 2021 21:51:33 -0500 Subject: [PATCH 12/46] bump vite --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 86feae6a..00daa9b7 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "prismjs": "^1.20.0", "sirv": "^1.0.10", "slash": "^3.0.0", - "vite": "^2.0.0-beta.20", + "vite": "^2.0.0-beta.21", "vue": "^3.0.5" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index c9f30cb3..a837c342 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6031,10 +6031,10 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -vite@^2.0.0-beta.20: - version "2.0.0-beta.20" - resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.20.tgz#338d436345be7e3474b5077f9ff6e3e70048834b" - integrity sha512-QsFgitrsGNzFRnPSlbtzz0Q5boMmGx17P4gW9dKu1sqtbg5joMqQrbihh2Tf9xQWu1G0+xPEevrpu1FRI744Xw== +vite@^2.0.0-beta.21: + version "2.0.0-beta.21" + resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.21.tgz#9a7233c93ed59c5b5de28c3a74f1e94b815d746e" + integrity sha512-B6OhGHwh4DTkDBxZXtGhxmDkK75M3o0sKFz/cfZ2bdqxRze870sJgH66kPuYWjgSVDdPz0NTIKBaxrbcA8wwmw== dependencies: esbuild "^0.8.26" postcss "^8.2.1" From 69e172a56bbcd372ccb18e0c25c19541bcee9213 Mon Sep 17 00:00:00 2001 From: Evan You Date: Sun, 10 Jan 2021 21:57:11 -0500 Subject: [PATCH 13/46] release: v0.10.8 --- CHANGELOG.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e90c397..55a46651 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [0.10.8](https://github.com/vuejs/vitepress/compare/v0.10.7...v0.10.8) (2021-01-11) + +### Bug Fixes + +- resolve page hash case-insenstively, close [#202](https://github.com/vuejs/vitepress/issues/202) ([#203](https://github.com/vuejs/vitepress/issues/203)) ([bac1ce2](https://github.com/vuejs/vitepress/commit/bac1ce2d01469ff7586437f43b0d665b1c5eb278)) + ## [0.10.7](https://github.com/vuejs/vitepress/compare/v0.10.6...v0.10.7) (2021-01-05) ### Features diff --git a/package.json b/package.json index 00daa9b7..ccde2bdb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vitepress", - "version": "0.10.7", + "version": "0.10.8", "description": "Vite & Vue powered static site generator", "main": "dist/node/index.js", "typings": "types/index.d.ts", From 9c7906119e9e83faab27d86868d6ccc94a3a17a6 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 11 Jan 2021 18:53:59 -0500 Subject: [PATCH 14/46] refactor: rename site alias --- src/node/config.ts | 4 ++-- src/node/plugin.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/node/config.ts b/src/node/config.ts index e565e6ec..cfdcfe71 100644 --- a/src/node/config.ts +++ b/src/node/config.ts @@ -30,7 +30,7 @@ export interface SiteConfig { themeDir: string outDir: string tempDir: string - aliases: AliasOptions + alias: AliasOptions pages: string[] markdown?: MarkdownOptions } @@ -59,7 +59,7 @@ export async function resolveConfig( outDir: resolve(root, 'dist'), tempDir: path.resolve(APP_PATH, 'temp'), markdown: userConfig.markdown, - aliases: resolveAliases(root, themeDir, userConfig) + alias: resolveAliases(root, themeDir, userConfig) } return config diff --git a/src/node/plugin.ts b/src/node/plugin.ts index 29449449..3dcd70f8 100644 --- a/src/node/plugin.ts +++ b/src/node/plugin.ts @@ -24,7 +24,7 @@ const isPageChunk = ( export function createVitePressPlugin( root: string, - { configPath, aliases, markdown, themeDir, site }: SiteConfig, + { configPath, alias, markdown, site }: SiteConfig, ssr = false, pageToHashMap?: Record ): Plugin[] { @@ -42,7 +42,7 @@ export function createVitePressPlugin( config() { return { - alias: aliases, + alias, define: { __CARBON__: !!site.themeConfig.carbonAds?.carbon, __BSA__: !!site.themeConfig.carbonAds?.custom, From 4072dc5f7ede381709fce49e9a29d6af4f7ab81a Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 11 Jan 2021 21:55:59 -0500 Subject: [PATCH 15/46] feat: support customData in config --- src/node/config.ts | 5 +++-- types/shared.d.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/node/config.ts b/src/node/config.ts index cfdcfe71..f5625643 100644 --- a/src/node/config.ts +++ b/src/node/config.ts @@ -20,7 +20,7 @@ export interface UserConfig { locales?: Record alias?: Record markdown?: MarkdownOptions - // TODO locales support etc. + customData?: any } export interface SiteConfig { @@ -91,6 +91,7 @@ export async function resolveSiteData(root: string): Promise { base: userConfig.base ? userConfig.base.replace(/([^/])$/, '$1/') : '/', head: userConfig.head || [], themeConfig: userConfig.themeConfig || {}, - locales: userConfig.locales || {} + locales: userConfig.locales || {}, + customData: userConfig.customData || {} } } diff --git a/types/shared.d.ts b/types/shared.d.ts index cf2aa73a..1f14a6a5 100644 --- a/types/shared.d.ts +++ b/types/shared.d.ts @@ -17,6 +17,7 @@ export interface SiteData { head: HeadConfig[] themeConfig: ThemeConfig locales: Record + customData: any } export type HeadConfig = From a79e1e1916a71271728e6fe7c2b734fc2f209518 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 11 Jan 2021 21:56:08 -0500 Subject: [PATCH 16/46] refactor: move default theme to 'vitepress/theme' Fixes the case when using a completely custom theme, importing anything from vitepress causes the entire default theme to be imported too. BREAKING CHANGE: the default theme is now exposed via 'vitepress/theme', instead of a named export from 'vitepress'. --- src/client/index.ts | 5 +---- src/node/alias.ts | 4 ++++ theme.d.ts | 3 +++ types/index.d.ts | 3 +-- 4 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 theme.d.ts diff --git a/src/client/index.ts b/src/client/index.ts index 8dc04483..4bbc0251 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -5,7 +5,7 @@ export type { Router, Route } from './app/router' // theme types -export * from './app/theme' +export type { Theme, EnhanceAppContext } from './app/theme' // composables export { useRouter, useRoute } from './app/router' @@ -24,6 +24,3 @@ import { ComponentOptions } from 'vue' import _Debug from './app/components/Debug.vue' const Debug = _Debug as ComponentOptions export { Debug } - -// default theme -export { default as DefaultTheme } from './theme-default' diff --git a/src/node/alias.ts b/src/node/alias.ts index fbe2cea5..15bc8290 100644 --- a/src/node/alias.ts +++ b/src/node/alias.ts @@ -38,6 +38,10 @@ export function resolveAliases( find: /^vitepress$/, replacement: path.join(__dirname, '../client/index') }, + { + find: /^vitepress\/theme$/, + replacement: path.join(__dirname, '../client/theme-default/index') + }, // alias for local linked development { find: /^vitepress\//, replacement: PKG_ROOT + '/' }, // make sure it always use the same vue dependency that comes with diff --git a/theme.d.ts b/theme.d.ts new file mode 100644 index 00000000..dd034b53 --- /dev/null +++ b/theme.d.ts @@ -0,0 +1,3 @@ +// so that users can do `import DefaultTheme from 'vitepress/theme'` +import DefaultTheme from './dist/client/theme-default/index' +export default DefaultTheme diff --git a/types/index.d.ts b/types/index.d.ts index fb753f96..10a5d0c2 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,5 +1,4 @@ export * from './shared' export * from '../dist/node/index' -export * from '../dist/client/app/exports' +export * from '../dist/client/index' export * from '../dist/client/theme-default/config' -export { default as defaultTheme } from '../dist/client/theme-default/index' From 5a761343792697be450b3bb77c22aad03274400b Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 11 Jan 2021 23:25:13 -0500 Subject: [PATCH 17/46] release: v0.11.0 --- CHANGELOG.md | 17 +++++++++++++++++ package.json | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55a46651..5ab50f05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +# [0.11.0](https://github.com/vuejs/vitepress/compare/v0.10.8...v0.11.0) (2021-01-12) + +### Code Refactoring + +- move default theme to 'vitepress/theme' ([a79e1e1](https://github.com/vuejs/vitepress/commit/a79e1e1916a71271728e6fe7c2b734fc2f209518)) + +### Features + +- support customData in config ([4072dc5](https://github.com/vuejs/vitepress/commit/4072dc5f7ede381709fce49e9a29d6af4f7ab81a)) + +### BREAKING CHANGES + +- the default theme is now exposed via 'vitepress/theme', + instead of a named export from 'vitepress'. This change fixes the case where + when a completely custom theme is used, importing anything from 'vitepress' + also imports the entire default theme. + ## [0.10.8](https://github.com/vuejs/vitepress/compare/v0.10.7...v0.10.8) (2021-01-11) ### Bug Fixes diff --git a/package.json b/package.json index ccde2bdb..9b13eded 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vitepress", - "version": "0.10.8", + "version": "0.11.0", "description": "Vite & Vue powered static site generator", "main": "dist/node/index.js", "typings": "types/index.d.ts", From ca631c7f516ad6c643d252dd81e03e29fb3b9e05 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 12 Jan 2021 00:01:40 -0500 Subject: [PATCH 18/46] feat: render content on home page --- src/client/theme-default/components/Home.vue | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/client/theme-default/components/Home.vue b/src/client/theme-default/components/Home.vue index 38c0ae02..7c30ce59 100644 --- a/src/client/theme-default/components/Home.vue +++ b/src/client/theme-default/components/Home.vue @@ -3,6 +3,9 @@ +
+ +
@@ -19,4 +22,17 @@ import HomeFooter from './HomeFooter.vue' .home { padding-top: var(--header-height); } + +.home-content { + max-width: 960px; + margin: 0px auto; + padding: 0 1.5rem; +} + +@media (max-width: 720px) { + .home-content { + max-width: 392px; + padding: 0; + } +} From 8dfa70839f06c94f308a61863a62b722068ad17d Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 12 Jan 2021 00:02:26 -0500 Subject: [PATCH 19/46] release: v0.11.1 --- CHANGELOG.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ab50f05..95639246 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [0.11.1](https://github.com/vuejs/vitepress/compare/v0.11.0...v0.11.1) (2021-01-12) + +### Features + +- render content on home page ([ca631c7](https://github.com/vuejs/vitepress/commit/ca631c7f516ad6c643d252dd81e03e29fb3b9e05)) + # [0.11.0](https://github.com/vuejs/vitepress/compare/v0.10.8...v0.11.0) (2021-01-12) ### Code Refactoring diff --git a/package.json b/package.json index 9b13eded..f7464b3b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vitepress", - "version": "0.11.0", + "version": "0.11.1", "description": "Vite & Vue powered static site generator", "main": "dist/node/index.js", "typings": "types/index.d.ts", From a0f463af8fd828d24d9a01c3d808d85af8a71c9f Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 12 Jan 2021 16:49:42 -0500 Subject: [PATCH 20/46] fix: aria label id --- src/client/theme-default/components/HomeHero.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/theme-default/components/HomeHero.vue b/src/client/theme-default/components/HomeHero.vue index 145a0721..3e4072b0 100644 --- a/src/client/theme-default/components/HomeHero.vue +++ b/src/client/theme-default/components/HomeHero.vue @@ -4,7 +4,7 @@ -

{{ heroText }}

+

{{ heroText }}

{{ tagline }}

Date: Tue, 12 Jan 2021 17:11:12 -0500 Subject: [PATCH 21/46] chore: remove build setup in docs-serve script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f7464b3b..ae81f886 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "docs-dev": "node ./bin/vitepress dev docs", "docs-debug": "node --inspect-brk ./bin/vitepress dev docs", "docs-build": "yarn build && node ./bin/vitepress build docs", - "docs-serve": "yarn docs-build && node ./bin/vitepress serve docs" + "docs-serve": "node ./bin/vitepress serve docs" }, "engines": { "node": ">=12.0.0" From b9fc0cb78d43949b417376498939daa892a33334 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 12 Jan 2021 17:11:26 -0500 Subject: [PATCH 22/46] perf: generate preload directives for dynamicImport chunks too --- src/node/build/render.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/node/build/render.ts b/src/node/build/render.ts index 89689166..9102fd09 100644 --- a/src/node/build/render.ts +++ b/src/node/build/render.ts @@ -88,12 +88,18 @@ function resolvePageImports( ) { // find the page's js chunk and inject script tags for its imports so that // they are start fetching as early as possible - const srcPath = normalizePath(path.resolve(config.root, page)) const pageChunk = result.output.find( (chunk) => chunk.type === 'chunk' && chunk.facadeModuleId === srcPath ) as OutputChunk - return Array.from(new Set([...indexChunk.imports, ...pageChunk.imports])) + return Array.from( + new Set([ + ...indexChunk.imports, + ...indexChunk.dynamicImports, + ...pageChunk.imports, + ...pageChunk.dynamicImports + ]) + ) } function renderHead(head: HeadConfig[]) { From 122e0263bd8b738a8a909586e51f41268617e7bf Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 12 Jan 2021 17:23:21 -0500 Subject: [PATCH 23/46] release: v0.11.2 --- CHANGELOG.md | 10 ++++++++++ package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95639246..e96609dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [0.11.2](https://github.com/vuejs/vitepress/compare/v0.11.1...v0.11.2) (2021-01-12) + +### Bug Fixes + +- aria label id ([a0f463a](https://github.com/vuejs/vitepress/commit/a0f463af8fd828d24d9a01c3d808d85af8a71c9f)) + +### Performance Improvements + +- generate preload directives for dynamicImport chunks too ([b9fc0cb](https://github.com/vuejs/vitepress/commit/b9fc0cb78d43949b417376498939daa892a33334)) + ## [0.11.1](https://github.com/vuejs/vitepress/compare/v0.11.0...v0.11.1) (2021-01-12) ### Features diff --git a/package.json b/package.json index ae81f886..b3b37446 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vitepress", - "version": "0.11.1", + "version": "0.11.2", "description": "Vite & Vue powered static site generator", "main": "dist/node/index.js", "typings": "types/index.d.ts", From 3e6e61bcea8d4a34079428fcce3ecd25af1ae4f7 Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 13 Jan 2021 12:28:14 -0500 Subject: [PATCH 24/46] fix: ignore non-html links in router and prefetch --- src/client/app/composables/preFetch.ts | 5 +++++ src/client/app/router.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/client/app/composables/preFetch.ts b/src/client/app/composables/preFetch.ts index 04c8dfde..e35bcecb 100644 --- a/src/client/app/composables/preFetch.ts +++ b/src/client/app/composables/preFetch.ts @@ -75,6 +75,11 @@ export function usePrefetch() { rIC(() => { document.querySelectorAll('#app a').forEach((link) => { const { target, hostname, pathname } = link as HTMLAnchorElement + const extMatch = pathname.match(/\.\w+$/) + if (extMatch && extMatch[0] !== '.html') { + return + } + if ( // only prefetch same tab navigation, since a new tab will load // the lean js chunk instead. diff --git a/src/client/app/router.ts b/src/client/app/router.ts index 6a99e132..7e445d29 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -114,6 +114,7 @@ export function createRouter( if (link) { const { href, protocol, hostname, pathname, hash, target } = link const currentUrl = window.location + const extMatch = pathname.match(/\.\w+$/) // only intercept inbound links if ( !e.ctrlKey && @@ -122,7 +123,8 @@ export function createRouter( !e.metaKey && target !== `_blank` && protocol === currentUrl.protocol && - hostname === currentUrl.hostname + hostname === currentUrl.hostname && + !(extMatch && extMatch[0] !== '.html') ) { e.preventDefault() if (pathname === currentUrl.pathname) { From 187815cc9a143bc99db178cce379cd424d17201a Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 13 Jan 2021 12:28:42 -0500 Subject: [PATCH 25/46] release: v0.11.3 --- CHANGELOG.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e96609dc..82dd03d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [0.11.3](https://github.com/vuejs/vitepress/compare/v0.11.2...v0.11.3) (2021-01-13) + +### Bug Fixes + +- ignore non-html links in router and prefetch ([3e6e61b](https://github.com/vuejs/vitepress/commit/3e6e61bcea8d4a34079428fcce3ecd25af1ae4f7)) + ## [0.11.2](https://github.com/vuejs/vitepress/compare/v0.11.1...v0.11.2) (2021-01-12) ### Bug Fixes diff --git a/package.json b/package.json index b3b37446..92e717da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vitepress", - "version": "0.11.2", + "version": "0.11.3", "description": "Vite & Vue powered static site generator", "main": "dist/node/index.js", "typings": "types/index.d.ts", From b4bdaf648d4506fc3a75251cdeea41f631f815a3 Mon Sep 17 00:00:00 2001 From: Evan You Date: Sun, 17 Jan 2021 23:49:13 -0500 Subject: [PATCH 26/46] refactor: vite ssr compat --- src/node/alias.ts | 1 - src/node/build/bundle.ts | 36 ++++++------------------------------ src/node/config.ts | 2 +- src/node/plugin.ts | 6 ++---- 4 files changed, 9 insertions(+), 36 deletions(-) diff --git a/src/node/alias.ts b/src/node/alias.ts index 15bc8290..bb2314c2 100644 --- a/src/node/alias.ts +++ b/src/node/alias.ts @@ -18,7 +18,6 @@ export const SITE_DATA_ID = '@siteData' export const SITE_DATA_REQUEST_PATH = '/' + SITE_DATA_ID export function resolveAliases( - root: string, themeDir: string, userConfig: UserConfig ): AliasOptions { diff --git a/src/node/build/bundle.ts b/src/node/build/bundle.ts index 9489364c..7f499958 100644 --- a/src/node/build/bundle.ts +++ b/src/node/build/bundle.ts @@ -3,7 +3,7 @@ import path from 'path' import slash from 'slash' import { APP_PATH } from '../alias' import { SiteConfig } from '../config' -import { RollupOutput, ExternalOption } from 'rollup' +import { RollupOutput } from 'rollup' import { build, BuildOptions, UserConfig as ViteUserConfig } from 'vite' import { createVitePressPlugin } from '../plugin' @@ -38,8 +38,12 @@ export async function bundle( root, logLevel: 'warn', plugins: createVitePressPlugin(root, config, ssr, pageToHashMap), + ssr: { + noExternal: ['vitepress'] + }, build: { ...options, + emptyOutDir: true, ssr, base: config.site.base, outDir: ssr ? config.tempDir : config.outDir, @@ -47,20 +51,13 @@ export async function bundle( rollupOptions: { ...rollupOptions, input, - external: ssr - ? resolveExternal(rollupOptions?.external) - : rollupOptions?.external, // important so that each page chunk and the index export things for each // other preserveEntrySignatures: 'allow-extension', output: { ...rollupOptions?.output, ...(ssr - ? { - format: 'cjs', - exports: 'named', - entryFileNames: '[name].js' - } + ? {} : { chunkFileNames(chunk): string { if (!chunk.isEntry && /runtime/.test(chunk.name)) { @@ -97,24 +94,3 @@ export async function bundle( return [clientResult, serverResult, pageToHashMap] } - -function resolveExternal( - userExternal: ExternalOption | undefined -): ExternalOption { - const required = ['vue', /^@vue\//] - if (!userExternal) { - return required - } - if (Array.isArray(userExternal)) { - return [...required, ...userExternal] - } else if (typeof userExternal === 'function') { - return (src, importer, isResolved) => { - if (src === 'vue' || /^@vue\//.test(src)) { - return true - } - return userExternal(src, importer, isResolved) - } - } else { - return [...required, userExternal] - } -} diff --git a/src/node/config.ts b/src/node/config.ts index f5625643..d5af0e59 100644 --- a/src/node/config.ts +++ b/src/node/config.ts @@ -59,7 +59,7 @@ export async function resolveConfig( outDir: resolve(root, 'dist'), tempDir: path.resolve(APP_PATH, 'temp'), markdown: userConfig.markdown, - alias: resolveAliases(root, themeDir, userConfig) + alias: resolveAliases(themeDir, userConfig) } return config diff --git a/src/node/plugin.ts b/src/node/plugin.ts index 3dcd70f8..1cebd379 100644 --- a/src/node/plugin.ts +++ b/src/node/plugin.ts @@ -31,8 +31,7 @@ export function createVitePressPlugin( const markdownToVue = createMarkdownToVueRenderFn(root, markdown) const vuePlugin = createVuePlugin({ - include: [/\.vue$/, /\.md$/], - ssr + include: [/\.vue$/, /\.md$/] }) let siteData = site @@ -73,8 +72,7 @@ export function createVitePressPlugin( configureServer(server) { // serve our index.html after vite history fallback return () => { - // @ts-ignore - server.app.use((req, res, next) => { + server.middlewares.use((req, res, next) => { if (req.url!.endsWith('.html')) { res.statusCode = 200 res.end( From c11055c5fb31ff31502400de3e5f6f05011edd1d Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 19 Jan 2021 10:36:35 -0500 Subject: [PATCH 27/46] chore: bump vite --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 92e717da..8cf2fe4c 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "prismjs": "^1.20.0", "sirv": "^1.0.10", "slash": "^3.0.0", - "vite": "^2.0.0-beta.21", + "vite": "^2.0.0-beta.32", "vue": "^3.0.5" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index a837c342..32f9f6d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6031,10 +6031,10 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -vite@^2.0.0-beta.21: - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.21.tgz#9a7233c93ed59c5b5de28c3a74f1e94b815d746e" - integrity sha512-B6OhGHwh4DTkDBxZXtGhxmDkK75M3o0sKFz/cfZ2bdqxRze870sJgH66kPuYWjgSVDdPz0NTIKBaxrbcA8wwmw== +vite@^2.0.0-beta.32: + version "2.0.0-beta.32" + resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.32.tgz#c9281013dfd73794887fc0ed7e96579677beb79a" + integrity sha512-RluPnnm4Zyjfu/IBxEmGZe/2QcFqc7qXfhjxzFNiqzyVkmc935HcmSnejkVa7KoW/PeX0wKrtag432esByKVGg== dependencies: esbuild "^0.8.26" postcss "^8.2.1" From 8cd0023176793783315cfa5d9999788f53fe32d4 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 19 Jan 2021 10:46:43 -0500 Subject: [PATCH 28/46] chore: bump plugin-vue --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 8cf2fe4c..09338fbf 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "dependencies": { "@docsearch/css": "^1.0.0-alpha.28", "@docsearch/js": "^1.0.0-alpha.28", - "@vitejs/plugin-vue": "^1.0.3", + "@vitejs/plugin-vue": "^1.1.0", "@vue/compiler-sfc": "^3.0.5", "@vue/server-renderer": "^3.0.5", "chalk": "^4.1.0", diff --git a/yarn.lock b/yarn.lock index 32f9f6d9..bcf66913 100644 --- a/yarn.lock +++ b/yarn.lock @@ -948,10 +948,10 @@ dependencies: "@types/yargs-parser" "*" -"@vitejs/plugin-vue@^1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-1.0.3.tgz#2df3c22802f2d2142ae3bd8d3e93623df790446d" - integrity sha512-sOVHFS97zxuRLAMj10C9Vaiv3WeEwnhtee9V+yv/G/xoJTXPJIRct4Nj2unPtp5zAUoCL+iTVbIC6LnNmNE4Hw== +"@vitejs/plugin-vue@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-1.1.0.tgz#8ae0b11388897b07259c9e5198c0e3fb5e4b37d9" + integrity sha512-ExlAt3nb3PB31jV9AgRZSMoGd+aQRU53fc/seghV8/l0JCzaX2mqlgpG8iytWkRxbBPgtAx4TpCPdiVKnTFT/A== "@vue/compiler-core@3.0.5": version "3.0.5" From 1eed0536edb34f92efb5d523614db5985881872c Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 19 Jan 2021 10:50:15 -0500 Subject: [PATCH 29/46] release: v0.11.4 --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82dd03d7..7d89f259 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [0.11.4](https://github.com/vuejs/vitepress/compare/v0.11.3...v0.11.4) (2021-01-19) + +- Latest Vite beta.32 compat (internal changes). + ## [0.11.3](https://github.com/vuejs/vitepress/compare/v0.11.2...v0.11.3) (2021-01-13) ### Bug Fixes diff --git a/package.json b/package.json index 09338fbf..78f6b74f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vitepress", - "version": "0.11.3", + "version": "0.11.4", "description": "Vite & Vue powered static site generator", "main": "dist/node/index.js", "typings": "types/index.d.ts", From 417caf3c28a14e4c223a65823ab0d5705a3ef9a1 Mon Sep 17 00:00:00 2001 From: Kia King Ishii Date: Fri, 22 Jan 2021 23:05:34 +0900 Subject: [PATCH 30/46] docs: update serve command default port --- docs/guide/deploy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/deploy.md b/docs/guide/deploy.md index 056a7aff..e189cc27 100644 --- a/docs/guide/deploy.md +++ b/docs/guide/deploy.md @@ -34,7 +34,7 @@ $ yarn docs:build $ yarn docs:serve ``` -The `serve` command will boot up local static web server that serves the files from `.vitepress/dist` at http://localhost:3000. It's an easy way to check if the production build looks OK in your local environment. +The `serve` command will boot up local static web server that serves the files from `.vitepress/dist` at http://localhost:5000. It's an easy way to check if the production build looks OK in your local environment. You may configure the port of the server py passing `--port` flag as an argument. From 481c4513d78450951add6177824b7996b89ae034 Mon Sep 17 00:00:00 2001 From: Matias Capeletto Date: Fri, 22 Jan 2021 15:47:08 +0100 Subject: [PATCH 31/46] feat: $lang and $localePath globals (#166) (#167) close #166 Co-authored-by: Kia King Ishii --- docs/guide/global-computed.md | 8 ++++++++ src/client/app/mixin.ts | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/docs/guide/global-computed.md b/docs/guide/global-computed.md index d1c0d3f1..384d0e38 100644 --- a/docs/guide/global-computed.md +++ b/docs/guide/global-computed.md @@ -64,6 +64,14 @@ Reference of `$page.frontmatter`. } ``` +## $lang + +The language of the current page. Default: `en-US`. + +## $localePath + +The locale path prefix for the current page. Default: `/`. + ## $title Value of the `` label used for the current page. diff --git a/src/client/app/mixin.ts b/src/client/app/mixin.ts index 24841ce8..061c046a 100644 --- a/src/client/app/mixin.ts +++ b/src/client/app/mixin.ts @@ -42,6 +42,25 @@ export function mixinGlobalComputed( } }, + $lang: { + get() { + return siteByRoute.value.lang + } + }, + + $localePath: { + get() { + const { locales } = site.value + const { lang } = siteByRoute.value + + const path = Object.keys(locales).find( + (lp) => locales[lp].lang === lang + ) + + return (locales && path) || '/' + } + }, + $title: { get() { return page.value.title From 51906043d318b2485ea8fc3aff4b4644c95dd3f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Romanowicz?= <46789227+lukeromanowicz@users.noreply.github.com> Date: Fri, 22 Jan 2021 16:12:07 +0100 Subject: [PATCH 32/46] fix: support symbolic links in building docs dist (#184) (#185) fix #184 --- src/node/build/render.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node/build/render.ts b/src/node/build/render.ts index 9102fd09..0ae8e686 100644 --- a/src/node/build/render.ts +++ b/src/node/build/render.ts @@ -88,7 +88,9 @@ function resolvePageImports( ) { // find the page's js chunk and inject script tags for its imports so that // they are start fetching as early as possible - const srcPath = normalizePath(path.resolve(config.root, page)) + const srcPath = normalizePath( + fs.realpathSync(path.resolve(config.root, page)) + ) const pageChunk = result.output.find( (chunk) => chunk.type === 'chunk' && chunk.facadeModuleId === srcPath ) as OutputChunk From 78b026cb7aa5b40a7dd98a1337646b38b1fc5367 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote <posva@users.noreply.github.com> Date: Fri, 22 Jan 2021 16:28:53 +0100 Subject: [PATCH 33/46] fix: avoid layout shift due to ads (#176) --- src/client/theme-default/Layout.vue | 47 ++++++++++++++++--- .../theme-default/components/CarbonAds.vue | 13 ++--- 2 files changed, 45 insertions(+), 15 deletions(-) diff --git a/src/client/theme-default/Layout.vue b/src/client/theme-default/Layout.vue index 7cd3b565..ed68e60b 100644 --- a/src/client/theme-default/Layout.vue +++ b/src/client/theme-default/Layout.vue @@ -36,12 +36,16 @@ <Page v-else> <template #top> <slot name="page-top-ads"> - <CarbonAds - v-if="theme.carbonAds" - :key="'carbon' + page.relativePath" - :code="theme.carbonAds.carbon" - :placement="theme.carbonAds.placement" - /> + <div + id="ads-container" + v-if="theme.carbonAds && theme.carbonAds.carbon" + > + <CarbonAds + :key="'carbon' + page.relativePath" + :code="theme.carbonAds.carbon" + :placement="theme.carbonAds.placement" + /> + </div> </slot> <slot name="page-top" /> </template> @@ -154,3 +158,34 @@ const pageClasses = computed(() => { ] }) </script> + +<style> +#ads-container { + margin: 0 auto; +} + +@media (min-width: 420px) { + #ads-container { + position: relative; + right: 0; + float: right; + margin: -8px -8px 24px 24px; + width: 146px; + } +} + +@media (max-width: 420px) { + #ads-container { + /* Avoid layout shift */ + height: 105px; + } +} + +@media (min-width: 1400px) { + #ads-container { + position: fixed; + right: 8px; + bottom: 8px; + } +} +</style> diff --git a/src/client/theme-default/components/CarbonAds.vue b/src/client/theme-default/components/CarbonAds.vue index 796d9952..b6be7c25 100644 --- a/src/client/theme-default/components/CarbonAds.vue +++ b/src/client/theme-default/components/CarbonAds.vue @@ -26,21 +26,19 @@ onMounted(() => { border-radius: 4px; margin: 0 auto; max-width: 280px; - font-size: .75rem; - background-color: rgba(255, 255, 255, .8); + font-size: 0.75rem; + background-color: rgba(255, 255, 255, 0.8); min-height: 105.38px; /* avoid layout shift on mobile */ } .carbon-ads::after { clear: both; display: block; - content: ""; + content: ''; } @media (min-width: 420px) { .carbon-ads { - position: relative; - right: -8px; z-index: 1; float: right; margin: -8px -8px 24px 24px; @@ -53,10 +51,7 @@ onMounted(() => { @media (min-width: 1400px) { .carbon-ads { - position: fixed; - top: auto; right: 8px; - bottom: 8px; float: none; margin: 0; } @@ -64,7 +59,7 @@ onMounted(() => { .carbon-ads :deep(.carbon-img) { float: left; - margin-right: .75rem; + margin-right: 0.75rem; max-width: 100px; border: 1px solid var(--c-divider); } From 75519224d5881ac12ffb01de6a84045e0b586d28 Mon Sep 17 00:00:00 2001 From: Matias Capeletto <matias.capeletto@gmail.com> Date: Fri, 22 Jan 2021 16:30:53 +0100 Subject: [PATCH 34/46] docs: remove gh pages _assets warning (#124) (#211) --- docs/guide/deploy.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/guide/deploy.md b/docs/guide/deploy.md index e189cc27..65ac1734 100644 --- a/docs/guide/deploy.md +++ b/docs/guide/deploy.md @@ -90,10 +90,6 @@ cd - You can also run the above script in your CI setup to enable automatic deployment on each push. ::: -::: warning -GitHub pages have issues with the underscore in the dist `_assets` folder. To fix this an empty file name `.nojekyll` needs to be placed in the docs `public` directory. See [Bypassing Jekyll on GitHub Pages](https://github.blog/2009-12-29-bypassing-jekyll-on-github-pages/). -::: - ### GitHub Pages and Travis CI 1. Set the correct `base` in `docs/.vitepress/config.js`. From 64d2f536b6757eef257651d0f2b909c91f571cef Mon Sep 17 00:00:00 2001 From: Kia King Ishii <kia.king.08@gmail.com> Date: Sat, 23 Jan 2021 00:45:04 +0900 Subject: [PATCH 35/46] ci: add ci test --- .github/workflows/test.yml | 20 ++++++++++++++++++++ README.md | 1 + 2 files changed, 21 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..488ab91f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,20 @@ +name: Test + +on: [push] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [14, 15] + steps: + - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: install and test + run: | + yarn install + yarn test diff --git a/README.md b/README.md index b1d62227..349b8c79 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # (WIP) VitePress 📝💨 +[![Test](https://github.com/vuejs/vitepress/workflows/Unit%20Test/badge.svg)](https://github.com/vuejs/vitepress/actions) [![npm](https://img.shields.io/npm/v/vitepress)](https://www.npmjs.com/package/vitepress) --- From 820fe38b96a69d25a0d079ae0df8022be5e13637 Mon Sep 17 00:00:00 2001 From: Kia King Ishii <kia.king.08@gmail.com> Date: Sat, 23 Jan 2021 00:47:46 +0900 Subject: [PATCH 36/46] chore: fix github action badge link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 349b8c79..3cd5d343 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # (WIP) VitePress 📝💨 -[![Test](https://github.com/vuejs/vitepress/workflows/Unit%20Test/badge.svg)](https://github.com/vuejs/vitepress/actions) +[![Test](https://github.com/vuejs/vitepress/workflows/Test/badge.svg)](https://github.com/vuejs/vitepress/actions) [![npm](https://img.shields.io/npm/v/vitepress)](https://www.npmjs.com/package/vitepress) --- From 8cfdd1912dda9153daa7cb4db8e5c9f0cab4d654 Mon Sep 17 00:00:00 2001 From: Evan You <yyx990803@gmail.com> Date: Sun, 24 Jan 2021 02:20:03 -0500 Subject: [PATCH 37/46] fix: update base option usage --- src/node/build/bundle.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node/build/bundle.ts b/src/node/build/bundle.ts index 7f499958..f167ab6a 100644 --- a/src/node/build/bundle.ts +++ b/src/node/build/bundle.ts @@ -36,8 +36,10 @@ export async function bundle( const resolveViteConfig = (ssr: boolean): ViteUserConfig => ({ root, + base: config.site.base, logLevel: 'warn', plugins: createVitePressPlugin(root, config, ssr, pageToHashMap), + // @ts-ignore ssr: { noExternal: ['vitepress'] }, @@ -45,7 +47,6 @@ export async function bundle( ...options, emptyOutDir: true, ssr, - base: config.site.base, outDir: ssr ? config.tempDir : config.outDir, cssCodeSplit: false, rollupOptions: { From 8e0b8d184aad3f829469dbecec37cf846f903d76 Mon Sep 17 00:00:00 2001 From: Evan You <yyx990803@gmail.com> Date: Thu, 28 Jan 2021 20:16:04 -0500 Subject: [PATCH 38/46] chore: exclude docsearch from optimization --- src/node/plugin.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/node/plugin.ts b/src/node/plugin.ts index 1cebd379..8cd1eb4b 100644 --- a/src/node/plugin.ts +++ b/src/node/plugin.ts @@ -46,6 +46,9 @@ export function createVitePressPlugin( __CARBON__: !!site.themeConfig.carbonAds?.carbon, __BSA__: !!site.themeConfig.carbonAds?.custom, __ALGOLIA__: !!site.themeConfig.algolia + }, + optimizeDeps: { + exclude: ['@docsearch/js'] } } }, From 3ec35b02ffa25b73a5daca80c1bb3a7ce3364c32 Mon Sep 17 00:00:00 2001 From: Evan You <yyx990803@gmail.com> Date: Thu, 28 Jan 2021 20:18:39 -0500 Subject: [PATCH 39/46] deps: bump vite --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 78f6b74f..6a2d6edf 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "prismjs": "^1.20.0", "sirv": "^1.0.10", "slash": "^3.0.0", - "vite": "^2.0.0-beta.32", + "vite": "^2.0.0-beta.56", "vue": "^3.0.5" }, "devDependencies": { From 35e3bf20014392a530a258e96f0866ab78e93173 Mon Sep 17 00:00:00 2001 From: Evan You <yyx990803@gmail.com> Date: Thu, 28 Jan 2021 20:21:35 -0500 Subject: [PATCH 40/46] release: v0.11.5 --- CHANGELOG.md | 12 ++++++++++++ package.json | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d89f259..fdb651be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## [0.11.5](https://github.com/vuejs/vitepress/compare/v0.11.4...v0.11.5) (2021-01-29) + +### Bug Fixes + +- avoid layout shift due to ads ([#176](https://github.com/vuejs/vitepress/issues/176)) ([78b026c](https://github.com/vuejs/vitepress/commit/78b026cb7aa5b40a7dd98a1337646b38b1fc5367)) +- support symbolic links in building docs dist ([#184](https://github.com/vuejs/vitepress/issues/184)) ([#185](https://github.com/vuejs/vitepress/issues/185)) ([5190604](https://github.com/vuejs/vitepress/commit/51906043d318b2485ea8fc3aff4b4644c95dd3f4)) +- update base option usage ([8cfdd19](https://github.com/vuejs/vitepress/commit/8cfdd1912dda9153daa7cb4db8e5c9f0cab4d654)) + +### Features + +- $lang and $localePath globals ([#166](https://github.com/vuejs/vitepress/issues/166)) ([#167](https://github.com/vuejs/vitepress/issues/167)) ([481c451](https://github.com/vuejs/vitepress/commit/481c4513d78450951add6177824b7996b89ae034)) + ## [0.11.4](https://github.com/vuejs/vitepress/compare/v0.11.3...v0.11.4) (2021-01-19) - Latest Vite beta.32 compat (internal changes). diff --git a/package.json b/package.json index 6a2d6edf..3efcdb76 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vitepress", - "version": "0.11.4", + "version": "0.11.5", "description": "Vite & Vue powered static site generator", "main": "dist/node/index.js", "typings": "types/index.d.ts", From 8a71fd194490ce7de01f6d79b2c3599af14bc7ec Mon Sep 17 00:00:00 2001 From: Kia King Ishii <kia.king.08@gmail.com> Date: Fri, 5 Feb 2021 20:57:17 +0900 Subject: [PATCH 41/46] build: update npm packages --- package.json | 28 +++---- yarn.lock | 223 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 161 insertions(+), 90 deletions(-) diff --git a/package.json b/package.json index 3efcdb76..0d5d0187 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "dependencies": { "@docsearch/css": "^1.0.0-alpha.28", "@docsearch/js": "^1.0.0-alpha.28", - "@vitejs/plugin-vue": "^1.1.0", + "@vitejs/plugin-vue": "^1.1.4", "@vue/compiler-sfc": "^3.0.5", "@vue/server-renderer": "^3.0.5", "chalk": "^4.1.0", @@ -73,8 +73,8 @@ "debug": "^4.1.1", "diacritics": "^1.3.0", "escape-html": "^1.0.3", - "fs-extra": "^9.0.0", - "globby": "^11.0.1", + "fs-extra": "^9.1.0", + "globby": "^11.0.2", "gray-matter": "^4.0.2", "lru-cache": "^6.0.0", "markdown-it": "^10.0.0", @@ -83,36 +83,36 @@ "markdown-it-emoji": "^1.4.0", "markdown-it-table-of-contents": "^0.4.4", "minimist": "^1.2.5", - "ora": "^5.1.0", + "ora": "^5.3.0", "polka": "^0.5.2", - "prismjs": "^1.20.0", - "sirv": "^1.0.10", + "prismjs": "^1.23.0", + "sirv": "^1.0.11", "slash": "^3.0.0", - "vite": "^2.0.0-beta.56", + "vite": "2.0.0-beta.50", "vue": "^3.0.5" }, "devDependencies": { "@types/compression": "^1.7.0", "@types/fs-extra": "^9.0.1", - "@types/jest": "^26.0.15", - "@types/koa": "^2.11.6", + "@types/jest": "^26.0.20", + "@types/koa": "^2.11.7", "@types/koa-static": "^4.0.1", "@types/lru-cache": "^5.1.0", "@types/markdown-it": "^10.0.2", - "@types/node": "^13.13.4", + "@types/node": "^14.14.25", "@types/postcss-load-config": "^2.0.1", - "chokidar": "^3.4.2", + "chokidar": "^3.5.1", "conventional-changelog-cli": "^2.1.0", "enquirer": "^2.3.6", - "execa": "^4.1.0", + "execa": "^5.0.0", "jest": "^26.6.3", "lint-staged": "^10.3.0", "npm-run-all": "^4.1.5", "prettier": "^2.0.5", "rimraf": "^3.0.2", - "rollup": "^2.33.3", + "rollup": "^2.38.5", "semver": "^7.3.2", - "ts-jest": "^26.4.4", + "ts-jest": "^26.5.0", "typescript": "^4.1.3", "yorkie": "^2.0.0" } diff --git a/yarn.lock b/yarn.lock index bcf66913..bd8ac078 100644 --- a/yarn.lock +++ b/yarn.lock @@ -796,7 +796,7 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@26.x", "@types/jest@^26.0.15": +"@types/jest@26.x": version "26.0.19" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.19.tgz#e6fa1e3def5842ec85045bd5210e9bb8289de790" integrity sha512-jqHoirTG61fee6v6rwbnEuKhpSKih0tuhqeFbCmMmErhtu3BYlOZaXWjffgOstMM4S/3iQD31lI5bGLTrs97yQ== @@ -804,6 +804,14 @@ jest-diff "^26.0.0" pretty-format "^26.0.0" +"@types/jest@^26.0.20": + version "26.0.20" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.20.tgz#cd2f2702ecf69e86b586e1f5223a60e454056307" + integrity sha512-9zi2Y+5USJRxd0FsahERhBwlcvFh6D2GLQnY2FH2BzK8J9s9omvNHIbvABwIluXa0fD8XVKMLTO0aOEuUfACAA== + dependencies: + jest-diff "^26.0.0" + pretty-format "^26.0.0" + "@types/keygrip@*": version "1.0.2" resolved "https://registry.yarnpkg.com/@types/keygrip/-/keygrip-1.0.2.tgz#513abfd256d7ad0bf1ee1873606317b33b1b2a72" @@ -831,7 +839,7 @@ "@types/koa" "*" "@types/koa-send" "*" -"@types/koa@*", "@types/koa@^2.11.6": +"@types/koa@*": version "2.11.6" resolved "https://registry.yarnpkg.com/@types/koa/-/koa-2.11.6.tgz#b7030caa6b44af801c2aea13ba77d74aff7484d5" integrity sha512-BhyrMj06eQkk04C97fovEDQMpLpd2IxCB4ecitaXwOKGq78Wi2tooaDOWOFGajPk8IkQOAtMppApgSVkYe1F/A== @@ -845,6 +853,20 @@ "@types/koa-compose" "*" "@types/node" "*" +"@types/koa@^2.11.7": + version "2.11.7" + resolved "https://registry.yarnpkg.com/@types/koa/-/koa-2.11.7.tgz#3b38f3b9faa66315a84890a771d166fb36463100" + integrity sha512-1iXJZZWCePoMe9LGSIPWsu5k5RI4ooXijW78c+nljMn3YbUts8PXoEESu1OeFmrazLPl1l97vTxzwvmH32TWVQ== + dependencies: + "@types/accepts" "*" + "@types/content-disposition" "*" + "@types/cookies" "*" + "@types/http-assert" "*" + "@types/http-errors" "*" + "@types/keygrip" "*" + "@types/koa-compose" "*" + "@types/node" "*" + "@types/linkify-it@*": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-3.0.0.tgz#c0ca4c253664492dbf47a646f31cfd483a6bbc95" @@ -885,10 +907,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.16.tgz#3cc351f8d48101deadfed4c9e4f116048d437b4b" integrity sha512-naXYePhweTi+BMv11TgioE2/FXU4fSl29HAH1ffxVciNsH3rYXjNP2yM8wqmSm7jS20gM8TIklKiTen+1iVncw== -"@types/node@^13.13.4": - version "13.13.38" - resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.38.tgz#66a7c068305dbd64cf167d0f6b6b6be71dd453e1" - integrity sha512-oxo8j9doh7ab9NwDA9bCeFfjHRF/uzk+fTljCy8lMjZ3YzZGAXNDKhTE3Byso/oy32UTUQIXB3HCVHu3d2T3xg== +"@types/node@^14.14.25": + version "14.14.25" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.25.tgz#15967a7b577ff81383f9b888aa6705d43fbbae93" + integrity sha512-EPpXLOVqDvisVxtlbvzfyqSsFeQxltFbluZNRndIb8tr9KiBnYNLzrc1N3pyKUCww2RNrfHDViqDWWE1LCJQtQ== "@types/normalize-package-data@^2.4.0": version "2.4.0" @@ -948,10 +970,10 @@ dependencies: "@types/yargs-parser" "*" -"@vitejs/plugin-vue@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-1.1.0.tgz#8ae0b11388897b07259c9e5198c0e3fb5e4b37d9" - integrity sha512-ExlAt3nb3PB31jV9AgRZSMoGd+aQRU53fc/seghV8/l0JCzaX2mqlgpG8iytWkRxbBPgtAx4TpCPdiVKnTFT/A== +"@vitejs/plugin-vue@^1.1.4": + version "1.1.4" + resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-1.1.4.tgz#1dd388519b75439b7733601b55238ca691864796" + integrity sha512-cUDILd++9jdhdjpuhgJofQqOabOKe+kTWTE2HQY2PBHEUO2fgwTurLE0cJg9UcIo1x4lHfsp+59S9TBCHgTZkw== "@vue/compiler-core@3.0.5": version "3.0.5" @@ -1328,6 +1350,11 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" @@ -1358,6 +1385,15 @@ binary-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== +bl@^4.0.3: + version "4.0.4" + resolved "https://registry.yarnpkg.com/bl/-/bl-4.0.4.tgz#f4fda39f81a811d0df6368c1ed91dae499d1c900" + integrity sha512-7tdr4EpSd7jJ6tuQ21vu2ke8w7pNEstzj1O8wwq6sNNzO3UDi5MA8Gny/gquCj7r2C6fHudg8tKRGyjRgmvNxQ== + dependencies: + buffer "^5.5.0" + inherits "^2.0.4" + readable-stream "^3.4.0" + bluebird@^3.7.2: version "3.7.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" @@ -1418,6 +1454,14 @@ buffer-from@1.x, buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== +buffer@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + bytes@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" @@ -1531,10 +1575,10 @@ char-regex@^1.0.2: resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== -chokidar@^3.4.2: - version "3.4.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b" - integrity sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ== +chokidar@^3.5.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a" + integrity sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw== dependencies: anymatch "~3.1.1" braces "~3.0.2" @@ -1544,7 +1588,7 @@ chokidar@^3.4.2: normalize-path "~3.0.0" readdirp "~3.5.0" optionalDependencies: - fsevents "~2.1.2" + fsevents "~2.3.1" ci-info@^1.5.0: version "1.6.0" @@ -1583,7 +1627,7 @@ cli-cursor@^3.1.0: dependencies: restore-cursor "^3.1.0" -cli-spinners@^2.4.0: +cli-spinners@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.5.0.tgz#12763e47251bf951cb75c201dfa58ff1bcb2d047" integrity sha512-PC+AmIuK04E6aeSs/pUccSujsTzBhu4HzC2dL+CfJB/Jcc2qTRbEwZQDfIUpt2Xl8BodYBEq8w4fc0kU2I9DjQ== @@ -1940,7 +1984,7 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^7.0.0: +cross-spawn@^7.0.0, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -2221,10 +2265,10 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" -esbuild@^0.8.26: - version "0.8.26" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.8.26.tgz#a85491617ebd2bd35ca4bf479239487eb6819d71" - integrity sha512-u3MMHOOumdWoAKF+073GHPpzvVB2cM+y9VD4ZwYs1FAQ6atRPISya35dbrbOu/mM68mQ42P+nwPzQVBTfQhkvQ== +esbuild@^0.8.34: + version "0.8.42" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.8.42.tgz#26101cf17fe4c4602c7c767e3177cf0c538073ac" + integrity sha512-zUtj5RMqROCCCH0vV/a7cd8YQg8I0GWBhV3A3PklWRT+oM/YwVbnrtFnITzE1otGdnXplWHWdZ4OcYiV0PN+JQ== escape-html@^1.0.3: version "1.0.3" @@ -2319,6 +2363,21 @@ execa@^4.0.0, execa@^4.1.0: signal-exit "^3.0.2" strip-final-newline "^2.0.0" +execa@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.0.0.tgz#4029b0007998a841fbd1032e5f4de86a3c1e3376" + integrity sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" @@ -2507,15 +2566,15 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" -fs-extra@^9.0.0: - version "9.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc" - integrity sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ== +fs-extra@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" + integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== dependencies: at-least-node "^1.0.0" graceful-fs "^4.2.0" jsonfile "^6.0.1" - universalify "^1.0.0" + universalify "^2.0.0" fs.realpath@^1.0.0: version "1.0.0" @@ -2532,6 +2591,11 @@ fsevents@~2.1.2: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== +fsevents@~2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.1.tgz#b209ab14c61012636c8863507edf7fb68cc54e9f" + integrity sha512-YR47Eg4hChJGAB1O3yEAOkGO+rlzutoICGqGo9EZ4lKWokzZRSyIW1QmTzqjtw8MJdj9srP869CuWw/hyzSiBw== + function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -2608,6 +2672,11 @@ get-stream@^5.0.0: dependencies: pump "^3.0.0" +get-stream@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.0.tgz#3e0012cb6827319da2706e601a1583e8629a6718" + integrity sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg== + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -2678,10 +2747,10 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globby@^11.0.1: - version "11.0.1" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.1.tgz#9a2bf107a068f3ffeabc49ad702c79ede8cfd357" - integrity sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ== +globby@^11.0.2: + version "11.0.2" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.2.tgz#1af538b766a3b540ebfb58a32b2e2d5897321d83" + integrity sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og== dependencies: array-union "^2.1.0" dir-glob "^3.0.1" @@ -2848,6 +2917,11 @@ human-signals@^1.1.1: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + iconv-lite@0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" @@ -2867,6 +2941,11 @@ icss-utils@^4.0.0, icss-utils@^4.1.1: dependencies: postcss "^7.0.14" +ieee754@^1.1.13: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + ignore@^5.1.4: version "5.1.8" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" @@ -2923,7 +3002,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.3, inherits@~2.0.3: +inherits@2, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -3896,11 +3975,6 @@ lodash.ismatch@^4.4.0: resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" integrity sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc= -lodash.memoize@4.x: - version "4.1.2" - resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" - integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= - lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" @@ -3921,7 +3995,7 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" -lodash@^4.17.15, lodash@^4.17.19: +lodash@4.x, lodash@^4.17.15, lodash@^4.17.19: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== @@ -4255,11 +4329,6 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -mute-stream@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" - integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== - nanoid@^3.1.20: version "3.1.20" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.20.tgz#badc263c6b1dcf14b71efaa85f6ab4c1d6cfc788" @@ -4383,7 +4452,7 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" -npm-run-path@^4.0.0: +npm-run-path@^4.0.0, npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== @@ -4465,7 +4534,7 @@ once@^1.3.0, once@^1.3.1, once@^1.4.0: dependencies: wrappy "1" -onetime@^5.1.0: +onetime@^5.1.0, onetime@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== @@ -4484,17 +4553,17 @@ optionator@^0.8.1: type-check "~0.3.2" word-wrap "~1.2.3" -ora@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/ora/-/ora-5.1.0.tgz#b188cf8cd2d4d9b13fd25383bc3e5cba352c94f8" - integrity sha512-9tXIMPvjZ7hPTbk8DFq1f7Kow/HU/pQYB60JbNq+QnGwcyhWVZaQ4hM9zQDEsPxw/muLpgiHSaumUZxCAmod/w== +ora@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/ora/-/ora-5.3.0.tgz#fb832899d3a1372fe71c8b2c534bbfe74961bb6f" + integrity sha512-zAKMgGXUim0Jyd6CXK9lraBnD3H5yPGBPPOkC23a2BG6hsm4Zu6OQSjQuEtV0BHDf4aKHcUFvJiGRrFuW3MG8g== dependencies: + bl "^4.0.3" chalk "^4.1.0" cli-cursor "^3.1.0" - cli-spinners "^2.4.0" + cli-spinners "^2.5.0" is-interactive "^1.0.0" log-symbols "^4.0.0" - mute-stream "0.0.8" strip-ansi "^6.0.0" wcwidth "^1.0.1" @@ -4835,10 +4904,10 @@ pretty-format@^26.0.0, pretty-format@^26.6.2: ansi-styles "^4.0.0" react-is "^17.0.1" -prismjs@^1.20.0: - version "1.22.0" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.22.0.tgz#73c3400afc58a823dd7eed023f8e1ce9fd8977fa" - integrity sha512-lLJ/Wt9yy0AiSYBf212kK3mM5L8ycwlyTlSxHBAneXLR0nzFMlZ5y7riFPF3E33zXOF2IH95xdY5jIyZbM9z/w== +prismjs@^1.23.0: + version "1.23.0" + resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.23.0.tgz#d3b3967f7d72440690497652a9d40ff046067f33" + integrity sha512-c29LVsqOaLbBHuIbsTxaKENh1N2EQBOHaWv7gkHN4dgRbxSREqDnDbtFJYdpPauS4YCplMSNCABQ6Eeor69bAA== optionalDependencies: clipboard "^2.0.0" @@ -4956,7 +5025,7 @@ read-pkg@^5.2.0: parse-json "^5.0.0" type-fest "^0.6.0" -readable-stream@3: +readable-stream@3, readable-stream@^3.4.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -5153,13 +5222,20 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" -rollup@^2.33.3, rollup@^2.35.1: +rollup@^2.35.1: version "2.35.1" resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.35.1.tgz#e6bc8d10893556a638066f89e8c97f422d03968c" integrity sha512-q5KxEyWpprAIcainhVy6HfRttD9kutQpHbeqDTWnqAFNJotiojetK6uqmcydNMymBEtC4I8bCYR+J3mTMqeaUA== optionalDependencies: fsevents "~2.1.2" +rollup@^2.38.5: + version "2.38.5" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.38.5.tgz#be41ad4fe0c103a8794377afceb5f22b8f603d6a" + integrity sha512-VoWt8DysFGDVRGWuHTqZzT02J0ASgjVq/hPs9QcBOGMd7B+jfTr/iqMVEyOi901rE3xq+Deq66GzIT1yt7sGwQ== + optionalDependencies: + fsevents "~2.3.1" + rsvp@^4.8.4: version "4.8.5" resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" @@ -5314,15 +5390,15 @@ shellwords@^0.1.1: resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== -signal-exit@^3.0.0, signal-exit@^3.0.2: +signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== -sirv@^1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/sirv/-/sirv-1.0.10.tgz#3e591f5a9ae2520f50d5830f5fae38d97e7be194" - integrity sha512-H5EZCoZaggEUQy8ocKsF7WAToGuZhjJlLvM3XOef46CbdIgbNeQ1p32N1PCuCjkVYwrAVOSMacN6CXXgIzuspg== +sirv@^1.0.11: + version "1.0.11" + resolved "https://registry.yarnpkg.com/sirv/-/sirv-1.0.11.tgz#81c19a29202048507d6ec0d8ba8910fda52eb5a4" + integrity sha512-SR36i3/LSWja7AJNRBz4fF/Xjpn7lQFI30tZ434dIy+bitLYSP+ZEenHg36i23V2SGEz+kqjksg0uOGZ5LPiqg== dependencies: "@polka/url" "^1.0.0-next.9" mime "^2.3.1" @@ -5847,10 +5923,10 @@ trouter@^2.0.1: dependencies: matchit "^1.0.0" -ts-jest@^26.4.4: - version "26.4.4" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.4.4.tgz#61f13fb21ab400853c532270e52cc0ed7e502c49" - integrity sha512-3lFWKbLxJm34QxyVNNCgXX1u4o/RV0myvA2y2Bxm46iGIjKlaY0own9gIckbjZJPn+WaJEnfPPJ20HHGpoq4yg== +ts-jest@^26.5.0: + version "26.5.0" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.5.0.tgz#3e3417d91bc40178a6716d7dacc5b0505835aa21" + integrity sha512-Ya4IQgvIFNa2Mgq52KaO8yBw2W8tWp61Ecl66VjF0f5JaV8u50nGoptHVILOPGoI7SDnShmEqnYQEmyHdQ+56g== dependencies: "@types/jest" "26.x" bs-logger "0.x" @@ -5858,7 +5934,7 @@ ts-jest@^26.4.4: fast-json-stable-stringify "2.x" jest-util "^26.1.0" json5 "2.x" - lodash.memoize "4.x" + lodash "4.x" make-error "1.x" mkdirp "1.x" semver "7.x" @@ -5950,11 +6026,6 @@ uniq@^1.0.1: resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" integrity sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8= -universalify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-1.0.0.tgz#b61a1da173e8435b2fe3c67d29b9adf8594bd16d" - integrity sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug== - universalify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" @@ -6031,12 +6102,12 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -vite@^2.0.0-beta.32: - version "2.0.0-beta.32" - resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.32.tgz#c9281013dfd73794887fc0ed7e96579677beb79a" - integrity sha512-RluPnnm4Zyjfu/IBxEmGZe/2QcFqc7qXfhjxzFNiqzyVkmc935HcmSnejkVa7KoW/PeX0wKrtag432esByKVGg== +vite@2.0.0-beta.50: + version "2.0.0-beta.50" + resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.50.tgz#04e66d009470ca90ab8a4a43687e899b670a0f25" + integrity sha512-zzMgrWJK92/aQ1rxvc+0QKeOCdOP4m2EPGwK2HKhlifQVnSdpYQzQkWLzaGh1GQAp61W+Su8cu6cWINpFgNrfQ== dependencies: - esbuild "^0.8.26" + esbuild "^0.8.34" postcss "^8.2.1" resolve "^1.19.0" rollup "^2.35.1" From 1026a20488f049a16fc134539c02867d684fd1fb Mon Sep 17 00:00:00 2001 From: Domantas <domantas@zyro.com> Date: Fri, 5 Feb 2021 16:18:56 +0200 Subject: [PATCH 42/46] dx: replace . with / at the end of served url (#210) --- src/node/serve/serve.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/serve/serve.ts b/src/node/serve/serve.ts index d5351806..8f5cb6cb 100644 --- a/src/node/serve/serve.ts +++ b/src/node/serve/serve.ts @@ -30,6 +30,6 @@ export async function serve(options: ServeOptions = {}) { .use(compress, serve) .listen(port, (err: any) => { if (err) throw err - console.log(`Built site served at http://localhost:${port}.\n`) + console.log(`Built site served at http://localhost:${port}/\n`) }) } From 0b5b306f85ada7e670345d31cb52931d0e46f784 Mon Sep 17 00:00:00 2001 From: Kia King Ishii <kia.king.08@gmail.com> Date: Fri, 5 Feb 2021 23:35:44 +0900 Subject: [PATCH 43/46] fix: `base` option not working on dev mode (#223) --- src/node/server.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node/server.ts b/src/node/server.ts index a4f9e914..1a87f0b7 100644 --- a/src/node/server.ts +++ b/src/node/server.ts @@ -10,6 +10,7 @@ export async function createServer( return createViteServer({ root, + base: config.site.base, // logLevel: 'warn', plugins: createVitePressPlugin(root, config), server: serverOptions From c95e9c63c420eb6c7004a281b0992b1f9c907759 Mon Sep 17 00:00:00 2001 From: Kia King Ishii <kia.king.08@gmail.com> Date: Fri, 5 Feb 2021 23:39:16 +0900 Subject: [PATCH 44/46] docs: update default theme import path --- docs/guide/customization.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guide/customization.md b/docs/guide/customization.md index 6406d6be..9caec3be 100644 --- a/docs/guide/customization.md +++ b/docs/guide/customization.md @@ -39,11 +39,11 @@ export default { } ``` -If you want to extend the default theme, you can import it from `vitepress/dist/client/theme-default`. +If you want to extend the default theme, you can import it from `vitepress/theme`. ```js // .vitepress/theme/index.js -import DefaultTheme from 'vitepress/dist/client/theme-default' +import DefaultTheme from 'vitepress/theme' export default { ...DefaultTheme From 027412906f3cd8a51e7267b4cd87f2af841e093a Mon Sep 17 00:00:00 2001 From: Kia King Ishii <kia.king.08@gmail.com> Date: Fri, 5 Feb 2021 23:40:04 +0900 Subject: [PATCH 45/46] chore: fix github sponsor error --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 48e0a06b..d71a0f86 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ -github: [yyx990803, kiaking, posva, antfu, pikax] +github: [yyx990803, kiaking, posva, pikax] open_collective: vuejs patreon: evanyou From 2330023d99741ea18fd606a7601ab19815333f7c Mon Sep 17 00:00:00 2001 From: Evan You <yyx990803@gmail.com> Date: Fri, 5 Feb 2021 12:32:44 -0500 Subject: [PATCH 46/46] fix: use brand color in algolia search box --- src/client/theme-default/components/AlgoliaSearchBox.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/theme-default/components/AlgoliaSearchBox.vue b/src/client/theme-default/components/AlgoliaSearchBox.vue index 14e66873..638149a1 100644 --- a/src/client/theme-default/components/AlgoliaSearchBox.vue +++ b/src/client/theme-default/components/AlgoliaSearchBox.vue @@ -156,7 +156,7 @@ function initialize(userOptions: any) { } .DocSearch { - --docsearch-primary-color: #42b983; + --docsearch-primary-color: var(--c-brand); --docsearch-highlight-color: var(--docsearch-primary-color); --docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color); --docsearch-text-color: var(--c-text-light);