diff --git a/.github/contributing.md b/.github/contributing.md index 9604e8ed..02139849 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -7,7 +7,7 @@ Hi! We're really excited that you are interested in contributing to VitePress. B ## Pull Request Guidelines -- Checkout a topic branch from the relevant branch, e.g. `master`, and merge back against that branch. +- Checkout a topic branch from the relevant branch, e.g. `main`, and merge back against that branch. - If adding a new feature: @@ -23,26 +23,27 @@ Hi! We're really excited that you are interested in contributing to VitePress. B ## Development Setup -You will need [Yarn](https://classic.yarnpkg.com/en/docs/cli/install/)/ +You will need [pnpm](https://pnpm.io/) After cloning the repo, run: ```bash -$ yarn # install the dependencies of the project +# install the dependencies of the project +$ pnpm install ``` ### Setup VitePress Dev Environment -You may start VitePress local dev environment by running `yarn dev`. +You may start VitePress local dev environment by running `pnpm run dev`. ```bash -$ yarn dev +$ pnpm run dev ``` -The easiest way to start testing out VitePress is to tweak the VitePress docs. You may run `yarn docs` folder to boot up VitePress documentation site locally, with live reloading of the source code. +The easiest way to start testing out VitePress is to tweak the VitePress docs. You may run `pnpm run docs` folder to boot up VitePress documentation site locally, with live reloading of the source code. ```bash -$ yarn docs +$ pnpm run docs ``` After executing the above command, visit http://localhost:3000 and try modifying the source code. You'll get live update. diff --git a/CHANGELOG.md b/CHANGELOG.md index 53c13239..031001ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,32 @@ +## [0.20.5](https://github.com/vuejs/vitepress/compare/v0.20.4...v0.20.5) (2021-12-12) + +- Bump vue & vite versions + +## [0.20.4](https://github.com/vuejs/vitepress/compare/v0.20.3...v0.20.4) (2021-12-07) + +### Bug Fixes + +- **build:** fix typing files ([ae11dc0](https://github.com/vuejs/vitepress/commit/ae11dc0b59ac90375079f1ebf0efacf1b1e58e8d)) + +## [0.20.3](https://github.com/vuejs/vitepress/compare/v0.20.2...v0.20.3) (2021-12-07) + +### Features + +- expose createMarkdownRenderer ([d54c7d8](https://github.com/vuejs/vitepress/commit/d54c7d8c56973dac138bfe96ff16dfab162ef64b)) + +## [0.20.2](https://github.com/vuejs/vitepress/compare/v0.20.1...v0.20.2) (2021-12-06) + +### Bug Fixes + +- handle potential string quote mismatch in generated code ([dfa7c05](https://github.com/vuejs/vitepress/commit/dfa7c0525f010994437acb060867d9ca1572867d)) +- improve createStaticVNode match for rollup codegen compat ([abb1b57](https://github.com/vuejs/vitepress/commit/abb1b578cdedf184ae386ce455e60a23672adfcb)) +- lazy require @vitejs/plugin-vue to respect NODE_ENV ([a051e66](https://github.com/vuejs/vitepress/commit/a051e66f1ae211174cf470d4430427dc0189194b)) +- static string strip regex for mulitiline static strings ([bc486aa](https://github.com/vuejs/vitepress/commit/bc486aae563fd77f38da44d9ae3ea28c021f6df0)) + +### Features + +- upgrade docsearch version ([#441](https://github.com/vuejs/vitepress/issues/441)) ([1b245e2](https://github.com/vuejs/vitepress/commit/1b245e22d8a00ea7c01c052ac1ea3d8d94aaeefb)) + ## [0.20.1](https://github.com/vuejs/vitepress/compare/v0.20.0...v0.20.1) (2021-11-05) ### Bug Fixes diff --git a/api-extractor.client.json b/api-extractor.client.json index 1dbc3a78..76d72a58 100644 --- a/api-extractor.client.json +++ b/api-extractor.client.json @@ -7,7 +7,7 @@ "dtsRollup": { "enabled": true, - "untrimmedFilePath": "./dist/client/index.d.ts" + "publicTrimmedFilePath": "./dist/client/index.d.ts" }, "apiReport": { diff --git a/api-extractor.node.json b/api-extractor.node.json index eb7509a1..92e11e79 100644 --- a/api-extractor.node.json +++ b/api-extractor.node.json @@ -7,7 +7,7 @@ "dtsRollup": { "enabled": true, - "untrimmedFilePath": "./dist/node/index.d.ts" + "publicTrimmedFilePath": "./dist/node/index.d.ts" }, "apiReport": { diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index c7f6e5aa..8dff7daf 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -6,7 +6,7 @@ export default { themeConfig: { repo: 'vuejs/vitepress', docsDir: 'docs', - + docsBranch: 'main', editLinks: true, editLinkText: 'Edit this page on GitHub', lastUpdated: 'Last Updated', diff --git a/docs/config/algolia-search.md b/docs/config/algolia-search.md index a4e7bb45..9f5208f6 100644 --- a/docs/config/algolia-search.md +++ b/docs/config/algolia-search.md @@ -47,7 +47,7 @@ module.exports = { } ``` -VitePress will automatically add a `language` _facetFilter_ to the `searchParams.facetFilter` array with the correct language value. **Make sure to properly configure your DocSearch config as well** by adding `language` as a _custom attribute for faceting_ and by setting it based on the `lang` attribute of the `` element. Here is a short example of DocSearch config: +VitePress will automatically add a `language` _facetFilter_ to the `searchParameters.facetFilter` array with the correct language value. **Make sure to properly configure your DocSearch config as well** by adding `language` as a _custom attribute for faceting_ and by setting it based on the `lang` attribute of the `` element. Here is a short example of DocSearch config: ```json { diff --git a/docs/guide/theming.md b/docs/guide/theming.md index 5797f843..78d288f2 100644 --- a/docs/guide/theming.md +++ b/docs/guide/theming.md @@ -42,7 +42,7 @@ export default { NotFound: () => 'custom 404', // <- this is a Vue 3 functional component enhanceApp({ app, router, siteData }) { // app is the Vue 3 app instance from `createApp()`. router is VitePress' - // custom router. `siteData`` is a `ref`` of current site-level metadata. + // custom router. `siteData` is a `ref` of current site-level metadata. } } ``` diff --git a/package.json b/package.json index 1c16d3d2..b7b7ad09 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vitepress", - "version": "0.20.1", + "version": "0.20.5", "description": "Vite & Vue powered static site generator", "main": "dist/node/index.js", "typings": "types/index.d.ts", @@ -71,10 +71,10 @@ "dependencies": { "@docsearch/css": "^3.0.0-alpha.41", "@docsearch/js": "^3.0.0-alpha.41", - "@vitejs/plugin-vue": "^1.9.0", + "@vitejs/plugin-vue": "^2.0.0", "prismjs": "^1.25.0", - "vite": "^2.6.5", - "vue": "^3.2.19" + "vite": "^2.7.0", + "vue": "^3.2.26" }, "devDependencies": { "@microsoft/api-extractor": "^7.18.9", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a2a4c850..d8a8ed72 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,7 +21,7 @@ importers: '@types/markdown-it': ^12.0.1 '@types/node': ^15.6.1 '@types/polka': ^0.5.3 - '@vitejs/plugin-vue': ^1.9.0 + '@vitejs/plugin-vue': ^2.0.0 chalk: ^4.1.1 chokidar: ^3.5.1 compression: ^1.7.4 @@ -57,16 +57,16 @@ importers: sirv: ^1.0.12 ts-jest: ^27.0.1 typescript: ^4.3.2 - vite: ^2.6.5 - vue: ^3.2.19 + vite: ^2.7.0 + vue: ^3.2.26 yorkie: ^2.0.0 dependencies: '@docsearch/css': 3.0.0-alpha.41 '@docsearch/js': 3.0.0-alpha.41 - '@vitejs/plugin-vue': 1.9.2_vite@2.6.5 + '@vitejs/plugin-vue': 2.0.0_vite@2.7.1+vue@3.2.26 prismjs: 1.25.0 - vite: 2.6.5 - vue: 3.2.19 + vite: 2.7.1 + vue: 3.2.26 devDependencies: '@microsoft/api-extractor': 7.18.11 '@rollup/plugin-alias': 3.1.5_rollup@2.57.0 @@ -266,7 +266,7 @@ packages: '@babel/helper-compilation-targets': 7.15.4_@babel+core@7.15.5 '@babel/helper-module-transforms': 7.15.7 '@babel/helpers': 7.15.4 - '@babel/parser': 7.15.7 + '@babel/parser': 7.16.4 '@babel/template': 7.15.4 '@babel/traverse': 7.15.4 '@babel/types': 7.15.6 @@ -427,6 +427,12 @@ packages: resolution: {integrity: sha512-rycZXvQ+xS9QyIcJ9HXeDWf1uxqlbVFAUq0Rq0dbc50Zb/+wUe/ehyfzGfm9KZZF0kBejYgxltBXocP+gKdL2g==} engines: {node: '>=6.0.0'} hasBin: true + dev: true + + /@babel/parser/7.16.4: + resolution: {integrity: sha512-6V0qdPUaiVHH3RtZeLIsc+6pDhbYzHR8ogA8w+f+Wc77DuXto19g2QUwveINoS34Uw+W8/hQDGJCx+i4n7xcng==} + engines: {node: '>=6.0.0'} + hasBin: true /@babel/plugin-syntax-async-generators/7.8.4_@babel+core@7.15.5: resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} @@ -552,7 +558,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.14.5 - '@babel/parser': 7.15.7 + '@babel/parser': 7.16.4 '@babel/types': 7.15.6 dev: true @@ -565,7 +571,7 @@ packages: '@babel/helper-function-name': 7.15.4 '@babel/helper-hoist-variables': 7.15.4 '@babel/helper-split-export-declaration': 7.15.4 - '@babel/parser': 7.15.7 + '@babel/parser': 7.16.4 '@babel/types': 7.15.6 debug: 4.3.2 globals: 11.12.0 @@ -1037,7 +1043,7 @@ packages: /@types/babel__core/7.1.16: resolution: {integrity: sha512-EAEHtisTMM+KaKwfWdC3oyllIqswlznXCIVCt7/oRNrh+DhgT4UEBNC/jlADNjvw7UnfbcdkGQcPVZ1xYiLcrQ==} dependencies: - '@babel/parser': 7.15.7 + '@babel/parser': 7.16.4 '@babel/types': 7.15.6 '@types/babel__generator': 7.6.3 '@types/babel__template': 7.4.1 @@ -1053,7 +1059,7 @@ packages: /@types/babel__template/7.4.1: resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==} dependencies: - '@babel/parser': 7.15.7 + '@babel/parser': 7.16.4 '@babel/types': 7.15.6 dev: true @@ -1311,96 +1317,98 @@ packages: '@types/yargs-parser': 20.2.1 dev: true - /@vitejs/plugin-vue/1.9.2_vite@2.6.5: - resolution: {integrity: sha512-QnUQJvGmY+YT9xTidLcjr6NAjKWNdSuul1M+BZ6uwTQaO5vpAY9USBncXESATk742dYMZGJenegJgeJhG/HMNQ==} + /@vitejs/plugin-vue/2.0.0_vite@2.7.1+vue@3.2.26: + resolution: {integrity: sha512-4Xn1h9OcaAf7KYrvz2oEi52fCCCLcCzyr3pDOrzYTWrs0DrzNOXt9fT5IiGb1f/uoNTdX3aAkXVGNXrGkzF/zw==} engines: {node: '>=12.0.0'} peerDependencies: vite: ^2.5.10 + vue: ^3.2.25 dependencies: - vite: 2.6.5 + vite: 2.7.1 + vue: 3.2.26 dev: false - /@vue/compiler-core/3.2.19: - resolution: {integrity: sha512-8dOPX0YOtaXol0Zf2cfLQ4NU/yHYl2H7DCKsLEZ7gdvPK6ZSEwGLJ7IdghhY2YEshEpC5RB9QKdC5I07z8Dtjg==} + /@vue/compiler-core/3.2.26: + resolution: {integrity: sha512-N5XNBobZbaASdzY9Lga2D9Lul5vdCIOXvUMd6ThcN8zgqQhPKfCV+wfAJNNJKQkSHudnYRO2gEB+lp0iN3g2Tw==} dependencies: - '@babel/parser': 7.15.7 - '@vue/shared': 3.2.19 + '@babel/parser': 7.16.4 + '@vue/shared': 3.2.26 estree-walker: 2.0.2 source-map: 0.6.1 dev: false - /@vue/compiler-dom/3.2.19: - resolution: {integrity: sha512-WzQoE8rfkFjPtIioc7SSgTsnz9g2oG61DU8KHnzPrRS7fW/lji6H2uCYJfp4Z6kZE8GjnHc1Ljwl3/gxDes0cw==} + /@vue/compiler-dom/3.2.26: + resolution: {integrity: sha512-smBfaOW6mQDxcT3p9TKT6mE22vjxjJL50GFVJiI0chXYGU/xzC05QRGrW3HHVuJrmLTLx5zBhsZ2dIATERbarg==} dependencies: - '@vue/compiler-core': 3.2.19 - '@vue/shared': 3.2.19 + '@vue/compiler-core': 3.2.26 + '@vue/shared': 3.2.26 dev: false - /@vue/compiler-sfc/3.2.19: - resolution: {integrity: sha512-pLlbgkO1UHTO02MSpa/sFOXUwIDxSMiKZ1ozE5n71CY4DM+YmI+G3gT/ZHZ46WBId7f3VTF/D8pGwMygcQbrQA==} + /@vue/compiler-sfc/3.2.26: + resolution: {integrity: sha512-ePpnfktV90UcLdsDQUh2JdiTuhV0Skv2iYXxfNMOK/F3Q+2BO0AulcVcfoksOpTJGmhhfosWfMyEaEf0UaWpIw==} dependencies: - '@babel/parser': 7.15.7 - '@vue/compiler-core': 3.2.19 - '@vue/compiler-dom': 3.2.19 - '@vue/compiler-ssr': 3.2.19 - '@vue/ref-transform': 3.2.19 - '@vue/shared': 3.2.19 + '@babel/parser': 7.16.4 + '@vue/compiler-core': 3.2.26 + '@vue/compiler-dom': 3.2.26 + '@vue/compiler-ssr': 3.2.26 + '@vue/reactivity-transform': 3.2.26 + '@vue/shared': 3.2.26 estree-walker: 2.0.2 magic-string: 0.25.7 - postcss: 8.3.8 + postcss: 8.4.1 source-map: 0.6.1 dev: false - /@vue/compiler-ssr/3.2.19: - resolution: {integrity: sha512-oLon0Cn3O7WEYzzmzZavGoqXH+199LT+smdjBT3Uf3UX4HwDNuBFCmvL0TsqV9SQnIgKvBRbQ7lhbpnd4lqM3w==} + /@vue/compiler-ssr/3.2.26: + resolution: {integrity: sha512-2mywLX0ODc4Zn8qBoA2PDCsLEZfpUGZcyoFRLSOjyGGK6wDy2/5kyDOWtf0S0UvtoyVq95OTSGIALjZ4k2q/ag==} dependencies: - '@vue/compiler-dom': 3.2.19 - '@vue/shared': 3.2.19 + '@vue/compiler-dom': 3.2.26 + '@vue/shared': 3.2.26 dev: false - /@vue/reactivity/3.2.19: - resolution: {integrity: sha512-FtachoYs2SnyrWup5UikP54xDX6ZJ1s5VgHcJp4rkGoutU3Ry61jhs+nCX7J64zjX992Mh9gGUC0LqTs8q9vCA==} + /@vue/reactivity-transform/3.2.26: + resolution: {integrity: sha512-XKMyuCmzNA7nvFlYhdKwD78rcnmPb7q46uoR00zkX6yZrUmcCQ5OikiwUEVbvNhL5hBJuvbSO95jB5zkUon+eQ==} dependencies: - '@vue/shared': 3.2.19 + '@babel/parser': 7.16.4 + '@vue/compiler-core': 3.2.26 + '@vue/shared': 3.2.26 + estree-walker: 2.0.2 + magic-string: 0.25.7 dev: false - /@vue/ref-transform/3.2.19: - resolution: {integrity: sha512-03wwUnoIAeKti5IGGx6Vk/HEBJ+zUcm5wrUM3+PQsGf7IYnXTbeIfHHpx4HeSeWhnLAjqZjADQwW8uA4rBmVbg==} + /@vue/reactivity/3.2.26: + resolution: {integrity: sha512-h38bxCZLW6oFJVDlCcAiUKFnXI8xP8d+eO0pcDxx+7dQfSPje2AO6M9S9QO6MrxQB7fGP0DH0dYQ8ksf6hrXKQ==} dependencies: - '@babel/parser': 7.15.7 - '@vue/compiler-core': 3.2.19 - '@vue/shared': 3.2.19 - estree-walker: 2.0.2 - magic-string: 0.25.7 + '@vue/shared': 3.2.26 dev: false - /@vue/runtime-core/3.2.19: - resolution: {integrity: sha512-qArZSWKxWsgKfxk9BelZ32nY0MZ31CAW2kUUyVJyxh4cTfHaXGbjiQB5JgsvKc49ROMNffv9t3/qjasQqAH+RQ==} + /@vue/runtime-core/3.2.26: + resolution: {integrity: sha512-BcYi7qZ9Nn+CJDJrHQ6Zsmxei2hDW0L6AB4vPvUQGBm2fZyC0GXd/4nVbyA2ubmuhctD5RbYY8L+5GUJszv9mQ==} dependencies: - '@vue/reactivity': 3.2.19 - '@vue/shared': 3.2.19 + '@vue/reactivity': 3.2.26 + '@vue/shared': 3.2.26 dev: false - /@vue/runtime-dom/3.2.19: - resolution: {integrity: sha512-hIRboxXwafeHhbZEkZYNV0MiJXPNf4fP0X6hM2TJb0vssz8BKhD9cF92BkRgZztTQevecbhk0gu4uAPJ3dxL9A==} + /@vue/runtime-dom/3.2.26: + resolution: {integrity: sha512-dY56UIiZI+gjc4e8JQBwAifljyexfVCkIAu/WX8snh8vSOt/gMSEGwPRcl2UpYpBYeyExV8WCbgvwWRNt9cHhQ==} dependencies: - '@vue/runtime-core': 3.2.19 - '@vue/shared': 3.2.19 + '@vue/runtime-core': 3.2.26 + '@vue/shared': 3.2.26 csstype: 2.6.18 dev: false - /@vue/server-renderer/3.2.19_vue@3.2.19: - resolution: {integrity: sha512-A9FNT7fgQJXItwdzWREntAgWKVtKYuXHBKGev/H4+ByTu8vB7gQXGcim01QxaJshdNg4dYuH2tEBZXCNCNx+/w==} + /@vue/server-renderer/3.2.26_vue@3.2.26: + resolution: {integrity: sha512-Jp5SggDUvvUYSBIvYEhy76t4nr1vapY/FIFloWmQzn7UxqaHrrBpbxrqPcTrSgGrcaglj0VBp22BKJNre4aA1w==} peerDependencies: - vue: 3.2.19 + vue: 3.2.26 dependencies: - '@vue/compiler-ssr': 3.2.19 - '@vue/shared': 3.2.19 - vue: 3.2.19 + '@vue/compiler-ssr': 3.2.26 + '@vue/shared': 3.2.26 + vue: 3.2.26 dev: false - /@vue/shared/3.2.19: - resolution: {integrity: sha512-Knqhx7WieLdVgwCAZgTVrDCXZ50uItuecLh9JdLC8O+a5ayaSyIQYveUK3hCRNC7ws5zalHmZwfdLMGaS8r4Ew==} + /@vue/shared/3.2.26: + resolution: {integrity: sha512-vPV6Cq+NIWbH5pZu+V+2QHE9y1qfuTq49uNWw4f7FDEeZaDU2H2cx5jcUZOAKW7qTrUS4k6qZPbMy1x4N96nbA==} dev: false /JSONStream/1.3.5: @@ -2360,11 +2368,28 @@ packages: is-symbol: 1.0.4 dev: true + /esbuild-android-arm64/0.13.15: + resolution: {integrity: sha512-m602nft/XXeO8YQPUDVoHfjyRVPdPgjyyXOxZ44MK/agewFFkPa8tUo6lAzSWh5Ui5PB4KR9UIFTSBKh/RrCmg==} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: false + optional: true + /esbuild-android-arm64/0.13.4: resolution: {integrity: sha512-elDJt+jNyoHFId0/dKsuVYUPke3EcquIyUwzJCH17a3ERglN3A9aMBI5zbz+xNZ+FbaDNdpn0RaJHCFLbZX+fA==} cpu: [arm64] os: [android] requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-64/0.13.15: + resolution: {integrity: sha512-ihOQRGs2yyp7t5bArCwnvn2Atr6X4axqPpEdCFPVp7iUj4cVSdisgvEKdNR7yH3JDjW6aQDw40iQFoTqejqxvQ==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false optional: true /esbuild-darwin-64/0.13.4: @@ -2372,6 +2397,15 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-arm64/0.13.15: + resolution: {integrity: sha512-i1FZssTVxUqNlJ6cBTj5YQj4imWy3m49RZRnHhLpefFIh0To05ow9DTrXROTE1urGTQCloFUXTX8QfGJy1P8dQ==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false optional: true /esbuild-darwin-arm64/0.13.4: @@ -2379,6 +2413,15 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-64/0.13.15: + resolution: {integrity: sha512-G3dLBXUI6lC6Z09/x+WtXBXbOYQZ0E8TDBqvn7aMaOCzryJs8LyVXKY4CPnHFXZAbSwkCbqiPuSQ1+HhrNk7EA==} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: false optional: true /esbuild-freebsd-64/0.13.4: @@ -2386,6 +2429,15 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-arm64/0.13.15: + resolution: {integrity: sha512-KJx0fzEDf1uhNOZQStV4ujg30WlnwqUASaGSFPhznLM/bbheu9HhqZ6mJJZM32lkyfGJikw0jg7v3S0oAvtvQQ==} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: false optional: true /esbuild-freebsd-arm64/0.13.4: @@ -2393,6 +2445,15 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true + dev: true + optional: true + + /esbuild-linux-32/0.13.15: + resolution: {integrity: sha512-ZvTBPk0YWCLMCXiFmD5EUtB30zIPvC5Itxz0mdTu/xZBbbHJftQgLWY49wEPSn2T/TxahYCRDWun5smRa0Tu+g==} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: false optional: true /esbuild-linux-32/0.13.4: @@ -2400,6 +2461,15 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true + dev: true + optional: true + + /esbuild-linux-64/0.13.15: + resolution: {integrity: sha512-eCKzkNSLywNeQTRBxJRQ0jxRCl2YWdMB3+PkWFo2BBQYC5mISLIVIjThNtn6HUNqua1pnvgP5xX0nHbZbPj5oA==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false optional: true /esbuild-linux-64/0.13.4: @@ -2407,6 +2477,15 @@ packages: cpu: [x64] os: [linux] requiresBuild: true + dev: true + optional: true + + /esbuild-linux-arm/0.13.15: + resolution: {integrity: sha512-wUHttDi/ol0tD8ZgUMDH8Ef7IbDX+/UsWJOXaAyTdkT7Yy9ZBqPg8bgB/Dn3CZ9SBpNieozrPRHm0BGww7W/jA==} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: false optional: true /esbuild-linux-arm/0.13.4: @@ -2414,6 +2493,15 @@ packages: cpu: [arm] os: [linux] requiresBuild: true + dev: true + optional: true + + /esbuild-linux-arm64/0.13.15: + resolution: {integrity: sha512-bYpuUlN6qYU9slzr/ltyLTR9YTBS7qUDymO8SV7kjeNext61OdmqFAzuVZom+OLW1HPHseBfJ/JfdSlx8oTUoA==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false optional: true /esbuild-linux-arm64/0.13.4: @@ -2421,6 +2509,15 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true + dev: true + optional: true + + /esbuild-linux-mips64le/0.13.15: + resolution: {integrity: sha512-KlVjIG828uFPyJkO/8gKwy9RbXhCEUeFsCGOJBepUlpa7G8/SeZgncUEz/tOOUJTcWMTmFMtdd3GElGyAtbSWg==} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: false optional: true /esbuild-linux-mips64le/0.13.4: @@ -2428,6 +2525,15 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true + dev: true + optional: true + + /esbuild-linux-ppc64le/0.13.15: + resolution: {integrity: sha512-h6gYF+OsaqEuBjeesTBtUPw0bmiDu7eAeuc2OEH9S6mV9/jPhPdhOWzdeshb0BskRZxPhxPOjqZ+/OqLcxQwEQ==} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: false optional: true /esbuild-linux-ppc64le/0.13.4: @@ -2435,6 +2541,23 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true + dev: true + optional: true + + /esbuild-netbsd-64/0.13.15: + resolution: {integrity: sha512-3+yE9emwoevLMyvu+iR3rsa+Xwhie7ZEHMGDQ6dkqP/ndFzRHkobHUKTe+NCApSqG5ce2z4rFu+NX/UHnxlh3w==} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: false + optional: true + + /esbuild-openbsd-64/0.13.15: + resolution: {integrity: sha512-wTfvtwYJYAFL1fSs8yHIdf5GEE4NkbtbXtjLWjM3Cw8mmQKqsg8kTiqJ9NJQe5NX/5Qlo7Xd9r1yKMMkHllp5g==} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: false optional: true /esbuild-openbsd-64/0.13.4: @@ -2442,6 +2565,15 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true + dev: true + optional: true + + /esbuild-sunos-64/0.13.15: + resolution: {integrity: sha512-lbivT9Bx3t1iWWrSnGyBP9ODriEvWDRiweAs69vI+miJoeKwHWOComSRukttbuzjZ8r1q0mQJ8Z7yUsDJ3hKdw==} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: false optional: true /esbuild-sunos-64/0.13.4: @@ -2449,6 +2581,15 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true + dev: true + optional: true + + /esbuild-windows-32/0.13.15: + resolution: {integrity: sha512-fDMEf2g3SsJ599MBr50cY5ve5lP1wyVwTe6aLJsM01KtxyKkB4UT+fc5MXQFn3RLrAIAZOG+tHC+yXObpSn7Nw==} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: false optional: true /esbuild-windows-32/0.13.4: @@ -2456,6 +2597,15 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true + dev: true + optional: true + + /esbuild-windows-64/0.13.15: + resolution: {integrity: sha512-9aMsPRGDWCd3bGjUIKG/ZOJPKsiztlxl/Q3C1XDswO6eNX/Jtwu4M+jb6YDH9hRSUflQWX0XKAfWzgy5Wk54JQ==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false optional: true /esbuild-windows-64/0.13.4: @@ -2463,6 +2613,15 @@ packages: cpu: [x64] os: [win32] requiresBuild: true + dev: true + optional: true + + /esbuild-windows-arm64/0.13.15: + resolution: {integrity: sha512-zzvyCVVpbwQQATaf3IG8mu1IwGEiDxKkYUdA4FpoCHi1KtPa13jeScYDjlW0Qh+ebWzpKfR2ZwvqAQkSWNcKjA==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: false optional: true /esbuild-windows-arm64/0.13.4: @@ -2470,8 +2629,33 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true + dev: true optional: true + /esbuild/0.13.15: + resolution: {integrity: sha512-raCxt02HBKv8RJxE8vkTSCXGIyKHdEdGfUmiYb8wnabnaEmHzyW7DCHb5tEN0xU8ryqg5xw54mcwnYkC4x3AIw==} + hasBin: true + requiresBuild: true + optionalDependencies: + esbuild-android-arm64: 0.13.15 + esbuild-darwin-64: 0.13.15 + esbuild-darwin-arm64: 0.13.15 + esbuild-freebsd-64: 0.13.15 + esbuild-freebsd-arm64: 0.13.15 + esbuild-linux-32: 0.13.15 + esbuild-linux-64: 0.13.15 + esbuild-linux-arm: 0.13.15 + esbuild-linux-arm64: 0.13.15 + esbuild-linux-mips64le: 0.13.15 + esbuild-linux-ppc64le: 0.13.15 + esbuild-netbsd-64: 0.13.15 + esbuild-openbsd-64: 0.13.15 + esbuild-sunos-64: 0.13.15 + esbuild-windows-32: 0.13.15 + esbuild-windows-64: 0.13.15 + esbuild-windows-arm64: 0.13.15 + dev: false + /esbuild/0.13.4: resolution: {integrity: sha512-wMA5eUwpavTBiNl+It6j8OQuKVh69l6z4DKDLzoTIqC+gChnPpcmqdA8WNHptUHRnfyML+mKEQPlW7Mybj8gHg==} hasBin: true @@ -2493,6 +2677,7 @@ packages: esbuild-windows-32: 0.13.4 esbuild-windows-64: 0.13.4 esbuild-windows-arm64: 0.13.4 + dev: true /escalade/3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} @@ -4194,12 +4379,8 @@ packages: resolution: {integrity: sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ==} dev: true - /nanocolors/0.2.3: - resolution: {integrity: sha512-RxGTOApG8prHMA08UBMOT6qYzcBBW2EMBv7SRBqoXg/Dqp6G3yT7kLy1tpFuYLO+5h7eajmdiIHJA8oewN58XQ==} - dev: false - - /nanoid/3.1.25: - resolution: {integrity: sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==} + /nanoid/3.1.30: + resolution: {integrity: sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true dev: false @@ -4485,6 +4666,10 @@ packages: engines: {node: '>=8'} dev: true + /picocolors/1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + dev: false + /picomatch/2.3.0: resolution: {integrity: sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==} engines: {node: '>=8.6'} @@ -4533,13 +4718,13 @@ packages: trouter: 2.0.1 dev: true - /postcss/8.3.8: - resolution: {integrity: sha512-GT5bTjjZnwDifajzczOC+r3FI3Cu+PgPvrsjhQdRqa2kTJ4968/X9CUce9xttIB0xOs5c6xf0TCWZo/y9lF6bA==} + /postcss/8.4.1: + resolution: {integrity: sha512-WqLs/TTzXdG+/A4ZOOK9WDZiikrRaiA+eoEb/jz2DT9KUhMNHgP7yKPO8vwi62ZCsb703Gwb7BMZwDzI54Y2Ag==} engines: {node: ^10 || ^12 || >=14} dependencies: - nanocolors: 0.2.3 - nanoid: 3.1.25 - source-map-js: 0.6.2 + nanoid: 3.1.30 + picocolors: 1.0.0 + source-map-js: 1.0.1 dev: false /preact/10.5.15: @@ -4777,6 +4962,15 @@ packages: hasBin: true optionalDependencies: fsevents: 2.3.2 + dev: true + + /rollup/2.60.1: + resolution: {integrity: sha512-akwfnpjY0rXEDSn1UTVfKXJhPsEBu+imi1gqBA1ZkHGydUnkV/fWCC90P7rDaLEW8KTwBcS1G3N4893Ndz+jwg==} + engines: {node: '>=10.0.0'} + hasBin: true + optionalDependencies: + fsevents: 2.3.2 + dev: false /run-parallel/1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} @@ -4916,8 +5110,8 @@ packages: is-fullwidth-code-point: 3.0.0 dev: true - /source-map-js/0.6.2: - resolution: {integrity: sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==} + /source-map-js/1.0.1: + resolution: {integrity: sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA==} engines: {node: '>=0.10.0'} dev: false @@ -5399,8 +5593,8 @@ packages: engines: {node: '>= 0.8'} dev: true - /vite/2.6.5: - resolution: {integrity: sha512-vavXMChDUb4Oh4YunrK9BrH5Ox74cu0eOp0VuyI/iqFz1FqbWD72So2c9I87lLL2n0+6tFPV5ijow60KrtxuZg==} + /vite/2.7.1: + resolution: {integrity: sha512-TDXXhcu5lyQ6uosK4ZWaOyB4VzOiizk0biitRzDzaEtgSUi8rVYPc4k1xgOjLSf0OuceDJmojFKXHOX9DB1WuQ==} engines: {node: '>=12.2.0'} hasBin: true peerDependencies: @@ -5415,22 +5609,22 @@ packages: stylus: optional: true dependencies: - esbuild: 0.13.4 - postcss: 8.3.8 + esbuild: 0.13.15 + postcss: 8.4.1 resolve: 1.20.0 - rollup: 2.57.0 + rollup: 2.60.1 optionalDependencies: fsevents: 2.3.2 dev: false - /vue/3.2.19: - resolution: {integrity: sha512-6KAMdIfAtlK+qohTIUE4urwAv4A3YRuo8uAbByApUmiB0CziGAAPs6qVugN6oHPia8YIafHB/37K0O6KZ7sGmA==} + /vue/3.2.26: + resolution: {integrity: sha512-KD4lULmskL5cCsEkfhERVRIOEDrfEL9CwAsLYpzptOGjaGFNWo3BQ9g8MAb7RaIO71rmVOziZ/uEN/rHwcUIhg==} dependencies: - '@vue/compiler-dom': 3.2.19 - '@vue/compiler-sfc': 3.2.19 - '@vue/runtime-dom': 3.2.19 - '@vue/server-renderer': 3.2.19_vue@3.2.19 - '@vue/shared': 3.2.19 + '@vue/compiler-dom': 3.2.26 + '@vue/compiler-sfc': 3.2.26 + '@vue/runtime-dom': 3.2.26 + '@vue/server-renderer': 3.2.26_vue@3.2.26 + '@vue/shared': 3.2.26 dev: false /w3c-hr-time/1.0.2: diff --git a/src/node/index.ts b/src/node/index.ts index 8781ffab..f671e921 100644 --- a/src/node/index.ts +++ b/src/node/index.ts @@ -2,5 +2,6 @@ export * from './server' export * from './build/build' export * from './serve/serve' export * from './config' +export * from './markdown/markdown' export type { SiteData, HeadConfig, LocaleConfig } from '../../types/shared' diff --git a/src/node/markdown/markdown.ts b/src/node/markdown/markdown.ts index 3338b240..ff8a637f 100644 --- a/src/node/markdown/markdown.ts +++ b/src/node/markdown/markdown.ts @@ -44,6 +44,8 @@ export interface MarkdownRenderer { render: (src: string, env?: any) => { html: string; data: any } } +export type { Header } + export const createMarkdownRenderer = ( srcDir: string, options: MarkdownOptions = {} diff --git a/src/node/plugin.ts b/src/node/plugin.ts index 46f8a7e0..e348c94f 100644 --- a/src/node/plugin.ts +++ b/src/node/plugin.ts @@ -6,14 +6,13 @@ import { MarkdownCompileResult } from './markdownToVue' import { DIST_CLIENT_PATH, APP_PATH, SITE_DATA_REQUEST_PATH } from './alias' -import createVuePlugin from '@vitejs/plugin-vue' import { slash } from './utils/slash' import { OutputAsset, OutputChunk } from 'rollup' const hashRE = /\.(\w+)\.js$/ const staticInjectMarkerRE = - /\b(const _hoisted_\d+ = \/\*#__PURE__\*\/createStaticVNode)\("(.*)", (\d+)\)/g -const staticStripRE = /__VP_STATIC_START__.*?__VP_STATIC_END__/g + /\b(const _hoisted_\d+ = \/\*(?:#|@)__PURE__\*\/\s*createStaticVNode)\("(.*)", (\d+)\)/g +const staticStripRE = /['"`]__VP_STATIC_START__[^]*?__VP_STATIC_END__['"`]/g const staticRestoreRE = /__VP_STATIC_(START|END)__/g // matches client-side js blocks in MPA mode. @@ -55,7 +54,8 @@ export function createVitePressPlugin( publicDir: string ) => MarkdownCompileResult - const vuePlugin = createVuePlugin({ + // lazy require plugin-vue to respect NODE_ENV in @vue/compiler-x + const vuePlugin = require('@vitejs/plugin-vue')({ include: [/\.vue$/, /\.md$/], ...userVuePluginOptions }) @@ -224,8 +224,9 @@ export function createVitePressPlugin( bundle[name + '-lean'] = { ...chunk, fileName: chunk.fileName.replace(/\.js$/, '.lean.js'), - code: chunk.code.replace(staticStripRE, ``) + code: chunk.code.replace(staticStripRE, `""`) } + // remove static markers from original code chunk.code = chunk.code.replace(staticRestoreRE, '') }