chore: update deps (#1410)

pull/1419/head
Divyansh Singh 2 years ago committed by GitHub
parent 1793b87163
commit 2f23eb96ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -84,13 +84,12 @@
"@docsearch/css": "^3.2.1",
"@docsearch/js": "^3.2.1",
"@vitejs/plugin-vue": "^3.1.0",
"@vue/devtools-api": "^6.2.1",
"@vueuse/core": "^9.1.1",
"body-scroll-lock": "^4.0.0-beta.0",
"nprogress": "^0.2.0",
"@vue/devtools-api": "^6.4.1",
"@vueuse/core": "^9.3.0",
"body-scroll-lock": "4.0.0-beta.0",
"shiki": "^0.11.1",
"vite": "^3.1.0",
"vue": "^3.2.38"
"vite": "^3.1.4",
"vue": "^3.2.40"
},
"devDependencies": {
"@mdit-vue/plugin-component": "^0.11.1",
@ -103,7 +102,7 @@
"@rollup/plugin-alias": "^3.1.9",
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.3.0",
"@rollup/plugin-node-resolve": "^14.1.0",
"@rollup/plugin-replace": "^4.0.0",
"@types/body-scroll-lock": "^3.1.0",
"@types/compression": "^1.7.2",
@ -120,9 +119,7 @@
"@types/markdown-it-emoji": "^2.0.2",
"@types/micromatch": "^4.0.2",
"@types/minimist": "^1.2.2",
"@types/node": "^18.7.15",
"@types/nprogress": "^0.2.0",
"@types/polka": "^0.5.4",
"@types/node": "^18.7.23",
"@types/prompts": "^2.0.14",
"chokidar": "^3.5.3",
"compression": "^1.7.4",
@ -131,15 +128,15 @@
"debug": "^4.3.4",
"diacritics": "^1.3.0",
"enquirer": "^2.3.6",
"esbuild": "^0.15.7",
"esbuild": "^0.15.9",
"escape-html": "^1.0.3",
"execa": "^6.1.0",
"fast-glob": "^3.2.11",
"fast-glob": "^3.2.12",
"fs-extra": "^10.1.0",
"lint-staged": "^13.0.3",
"lru-cache": "^7.14.0",
"markdown-it": "^13.0.1",
"markdown-it-anchor": "^8.6.4",
"markdown-it-anchor": "^8.6.5",
"markdown-it-attrs": "^4.1.4",
"markdown-it-container": "^3.0.0",
"markdown-it-emoji": "^2.0.2",
@ -149,22 +146,22 @@
"ora": "^5.4.1",
"picocolors": "^1.0.0",
"pkg-dir": "^5.0.0",
"playwright-chromium": "^1.25.1",
"polka": "^0.5.2",
"playwright-chromium": "^1.26.1",
"polka": "1.0.0-next.22",
"prettier": "^2.7.1",
"prompts": "^2.4.2",
"punycode": "^2.1.1",
"rimraf": "^3.0.2",
"rollup": "^2.79.0",
"rollup": "^2.79.1",
"rollup-plugin-dts": "^4.2.2",
"rollup-plugin-esbuild": "^4.10.1",
"semver": "^7.3.7",
"simple-git-hooks": "^2.8.0",
"sirv": "^2.0.2",
"supports-color": "^9.2.2",
"typescript": "^4.8.2",
"vitest": "^0.23.1",
"vue-tsc": "^0.40.7",
"supports-color": "^9.2.3",
"typescript": "~4.8.4",
"vitest": "^0.23.4",
"vue-tsc": "^1.0.0-beta.1",
"wait-on": "^6.0.1"
},
"pnpm": {

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
<script setup lang="ts">
import type { DefaultTheme } from 'vitepress/theme'
import { default as docsearch } from '@docsearch/js'
import docsearch from '@docsearch/js'
import { onMounted } from 'vue'
import { useRouter, useRoute, useData } from 'vitepress'
@ -29,7 +29,8 @@ function poll() {
}, 16)
}
type DocSearchProps = Parameters<typeof docsearch>[0]
const docsearch$ = docsearch.default ?? docsearch
type DocSearchProps = Parameters<typeof docsearch$>[0]
function initialize(userOptions: DefaultTheme.AlgoliaSearchOptions) {
// note: multi-lang search support is removed since the theme
@ -74,7 +75,7 @@ function initialize(userOptions: DefaultTheme.AlgoliaSearchOptions) {
}
})
docsearch(options)
docsearch$(options)
}
function getRelativePath(absoluteUrl: string) {

@ -1,8 +1,8 @@
import fs from 'fs'
import path from 'path'
import sirv from 'sirv'
import compression from 'compression'
import polka from 'polka'
import polka, { IOptions } from 'polka'
import sirv, { RequestHandler } from 'sirv'
import { resolveConfig } from '../config'
function trimChar(str: string, char: string) {
@ -30,13 +30,13 @@ export async function serve(options: ServeOptions = {}) {
const notAnAsset = (pathname: string) => !pathname.includes('/assets/')
const notFound = fs.readFileSync(path.resolve(site.outDir, './404.html'))
const onNoMatch: polka.Options['onNoMatch'] = (req, res) => {
const onNoMatch: IOptions['onNoMatch'] = (req, res) => {
res.statusCode = 404
if (notAnAsset(req.path)) res.write(notFound.toString())
res.end()
}
const compress = compression()
const compress = compression() as RequestHandler
const serve = sirv(site.outDir, {
etag: true,
maxAge: 31536000,
@ -53,15 +53,13 @@ export async function serve(options: ServeOptions = {}) {
if (base) {
polka({ onNoMatch })
.use(base, compress, serve)
.listen(port, (err: any) => {
if (err) throw err
.listen(port, () => {
console.log(`Built site served at http://localhost:${port}/${base}/\n`)
})
} else {
polka({ onNoMatch })
.use(compress, serve)
.listen(port, (err: any) => {
if (err) throw err
.listen(port, () => {
console.log(`Built site served at http://localhost:${port}/\n`)
})
}

Loading…
Cancel
Save