From 2fe8f60681793cb406100827ff34e0714f523d37 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Tue, 8 Aug 2023 19:05:30 +0530 Subject: [PATCH 1/9] revert(theme): revert 'allow setting base path in sidebar items' closes #2752 --- docs/.vitepress/config.ts | 74 ++++++++++----------- src/client/theme-default/support/sidebar.ts | 17 +---- types/default-theme.d.ts | 7 +- 3 files changed, 40 insertions(+), 58 deletions(-) diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 0bbeef1b1269..43f6b9ccb6e6 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -53,8 +53,8 @@ export default defineConfig({ nav: nav(), sidebar: { - '/guide/': { base: '/guide/', items: sidebarGuide() }, - '/reference/': { base: '/reference/', items: sidebarReference() } + '/guide/': sidebarGuide(), + '/reference/': sidebarReference() }, editLink: { @@ -122,72 +122,72 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] { text: 'Introduction', collapsed: false, items: [ - { text: 'What is VitePress?', link: 'what-is-vitepress' }, - { text: 'Getting Started', link: 'getting-started' }, - { text: 'Routing', link: 'routing' }, - { text: 'Deploy', link: 'deploy' } + { text: 'What is VitePress?', link: '/guide/what-is-vitepress' }, + { text: 'Getting Started', link: '/guide/getting-started' }, + { text: 'Routing', link: '/guide/routing' }, + { text: 'Deploy', link: '/guide/deploy' } ] }, { text: 'Writing', collapsed: false, items: [ - { text: 'Markdown Extensions', link: 'markdown' }, - { text: 'Asset Handling', link: 'asset-handling' }, - { text: 'Frontmatter', link: 'frontmatter' }, - { text: 'Using Vue in Markdown', link: 'using-vue' }, - { text: 'Internationalization', link: 'i18n' } + { text: 'Markdown Extensions', link: '/guide/markdown' }, + { text: 'Asset Handling', link: '/guide/asset-handling' }, + { text: 'Frontmatter', link: '/guide/frontmatter' }, + { text: 'Using Vue in Markdown', link: '/guide/using-vue' }, + { text: 'Internationalization', link: '/guide/i18n' } ] }, { text: 'Customization', collapsed: false, items: [ - { text: 'Using a Custom Theme', link: 'custom-theme' }, - { text: 'Extending the Default Theme', link: 'extending-default-theme' }, - { text: 'Build-Time Data Loading', link: 'data-loading' }, - { text: 'SSR Compatibility', link: 'ssr-compat' }, - { text: 'Connecting to a CMS', link: 'cms' } + { text: 'Using a Custom Theme', link: '/guide/custom-theme' }, + { text: 'Extending the Default Theme', link: '/guide/extending-default-theme' }, + { text: 'Build-Time Data Loading', link: '/guide/data-loading' }, + { text: 'SSR Compatibility', link: '/guide/ssr-compat' }, + { text: 'Connecting to a CMS', link: '/guide/cms' } ] }, { text: 'Experimental', collapsed: false, items: [ - { text: 'MPA Mode', link: 'mpa-mode' }, - { text: 'Sitemap Generation', link: 'sitemap-generation' } + { text: 'MPA Mode', link: '/guide/mpa-mode' }, + { text: 'Sitemap Generation', link: '/guide/sitemap-generation' } ] }, - { text: 'Config & API Reference', base: '/reference/', link: 'site-config' } + { text: 'Config & API Reference', link: '/reference/site-config' } ] } +/* prettier-ignore */ function sidebarReference(): DefaultTheme.SidebarItem[] { return [ { text: 'Reference', items: [ - { text: 'Site Config', link: 'site-config' }, - { text: 'Frontmatter Config', link: 'frontmatter-config' }, - { text: 'Runtime API', link: 'runtime-api' }, - { text: 'CLI', link: 'cli' }, + { text: 'Site Config', link: '/reference/site-config' }, + { text: 'Frontmatter Config', link: '/reference/frontmatter-config' }, + { text: 'Runtime API', link: '/reference/runtime-api' }, + { text: 'CLI', link: '/reference/cli' }, { text: 'Default Theme', - base: '/reference/default-theme-', items: [ - { text: 'Overview', link: 'config' }, - { text: 'Nav', link: 'nav' }, - { text: 'Sidebar', link: 'sidebar' }, - { text: 'Home Page', link: 'home-page' }, - { text: 'Footer', link: 'footer' }, - { text: 'Layout', link: 'layout' }, - { text: 'Badge', link: 'badge' }, - { text: 'Team Page', link: 'team-page' }, - { text: 'Prev / Next Links', link: 'prev-next-links' }, - { text: 'Edit Link', link: 'edit-link' }, - { text: 'Last Updated Timestamp', link: 'last-updated' }, - { text: 'Search', link: 'search' }, - { text: 'Carbon Ads', link: 'carbon-ads' } + { text: 'Overview', link: '/reference/default-theme-config' }, + { text: 'Nav', link: '/reference/default-theme-nav' }, + { text: 'Sidebar', link: '/reference/default-theme-sidebar' }, + { text: 'Home Page', link: '/reference/default-theme-home-page' }, + { text: 'Footer', link: '/reference/default-theme-footer' }, + { text: 'Layout', link: '/reference/default-theme-layout' }, + { text: 'Badge', link: '/reference/default-theme-badge' }, + { text: 'Team Page', link: '/reference/default-theme-team-page' }, + { text: 'Prev / Next Links', link: '/reference/default-theme-prev-next-links' }, + { text: 'Edit Link', link: '/reference/default-theme-edit-link' }, + { text: 'Last Updated Timestamp', link: '/reference/default-theme-last-updated' }, + { text: 'Search', link: '/reference/default-theme-search' }, + { text: 'Carbon Ads', link: '/reference/default-theme-carbon-ads' } ] } ] diff --git a/src/client/theme-default/support/sidebar.ts b/src/client/theme-default/support/sidebar.ts index 955eb23eac7c..6385c55ef6fd 100644 --- a/src/client/theme-default/support/sidebar.ts +++ b/src/client/theme-default/support/sidebar.ts @@ -20,7 +20,7 @@ export function getSidebar( _sidebar: DefaultTheme.Sidebar | undefined, path: string ): SidebarItem[] { - if (Array.isArray(_sidebar)) return addBase(_sidebar) + if (Array.isArray(_sidebar)) return _sidebar if (_sidebar == null) return [] path = ensureStartingSlash(path) @@ -34,10 +34,7 @@ export function getSidebar( return path.startsWith(ensureStartingSlash(dir)) }) - const sidebar = dir ? _sidebar[dir] : [] - return Array.isArray(sidebar) - ? addBase(sidebar) - : addBase(sidebar.items, sidebar.base) + return dir ? _sidebar[dir] : [] } /** @@ -107,13 +104,3 @@ export function hasActiveLink( ? hasActiveLink(path, items.items) : false } - -function addBase(items: SidebarItem[], _base?: string): SidebarItem[] { - return [...items].map((_item) => { - const item = { ..._item } - const base = item.base || _base - if (base && item.link) item.link = base + item.link - if (item.items) item.items = addBase(item.items, base) - return item - }) -} diff --git a/types/default-theme.d.ts b/types/default-theme.d.ts index aa9ab6f32599..1e88c91d0bb8 100644 --- a/types/default-theme.d.ts +++ b/types/default-theme.d.ts @@ -202,7 +202,7 @@ export namespace DefaultTheme { export type Sidebar = SidebarItem[] | SidebarMulti export interface SidebarMulti { - [path: string]: SidebarItem[] | { items: SidebarItem[]; base: string } + [path: string]: SidebarItem[] } export type SidebarItem = { @@ -230,11 +230,6 @@ export namespace DefaultTheme { */ collapsed?: boolean - /** - * Base path for the children items. - */ - base?: string - /** * Customize text that appears on the footer of previous/next page. */ From 5ef1195da26b1fe0446220aedbf18a2a75771e7e Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Tue, 8 Aug 2023 19:09:35 +0530 Subject: [PATCH 2/9] release: v1.0.0-rc.2 --- CHANGELOG.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee639b560fff..99d3680071e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# [1.0.0-rc.2](https://github.com/vuejs/vitepress/compare/v1.0.0-rc.1...v1.0.0-rc.2) (2023-08-08) + +### Reverts + +- **theme:** allow setting base path in sidebar items ([2fe8f60](https://github.com/vuejs/vitepress/commit/2fe8f60681793cb406100827ff34e0714f523d37)), closes [#2752](https://github.com/vuejs/vitepress/issues/2752) + # [1.0.0-rc.1](https://github.com/vuejs/vitepress/compare/v1.0.0-beta.7...v1.0.0-rc.1) (2023-08-08) ### Bug Fixes diff --git a/package.json b/package.json index 72edaa2851b6..dc721a0c7a3b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vitepress", - "version": "1.0.0-rc.1", + "version": "1.0.0-rc.2", "description": "Vite & Vue powered static site generator", "type": "module", "packageManager": "pnpm@8.6.12", From 9a4ee07260191adeb4c3810d95b044439609525c Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Tue, 8 Aug 2023 20:39:49 +0530 Subject: [PATCH 3/9] fix(theme): fix sidebar collapsing and restore base property (#2753) --- docs/.vitepress/config.ts | 74 +++++++++---------- .../theme-default/composables/sidebar.ts | 19 +++-- src/client/theme-default/support/sidebar.ts | 17 ++++- types/default-theme.d.ts | 7 +- 4 files changed, 67 insertions(+), 50 deletions(-) diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 43f6b9ccb6e6..0bbeef1b1269 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -53,8 +53,8 @@ export default defineConfig({ nav: nav(), sidebar: { - '/guide/': sidebarGuide(), - '/reference/': sidebarReference() + '/guide/': { base: '/guide/', items: sidebarGuide() }, + '/reference/': { base: '/reference/', items: sidebarReference() } }, editLink: { @@ -122,72 +122,72 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] { text: 'Introduction', collapsed: false, items: [ - { text: 'What is VitePress?', link: '/guide/what-is-vitepress' }, - { text: 'Getting Started', link: '/guide/getting-started' }, - { text: 'Routing', link: '/guide/routing' }, - { text: 'Deploy', link: '/guide/deploy' } + { text: 'What is VitePress?', link: 'what-is-vitepress' }, + { text: 'Getting Started', link: 'getting-started' }, + { text: 'Routing', link: 'routing' }, + { text: 'Deploy', link: 'deploy' } ] }, { text: 'Writing', collapsed: false, items: [ - { text: 'Markdown Extensions', link: '/guide/markdown' }, - { text: 'Asset Handling', link: '/guide/asset-handling' }, - { text: 'Frontmatter', link: '/guide/frontmatter' }, - { text: 'Using Vue in Markdown', link: '/guide/using-vue' }, - { text: 'Internationalization', link: '/guide/i18n' } + { text: 'Markdown Extensions', link: 'markdown' }, + { text: 'Asset Handling', link: 'asset-handling' }, + { text: 'Frontmatter', link: 'frontmatter' }, + { text: 'Using Vue in Markdown', link: 'using-vue' }, + { text: 'Internationalization', link: 'i18n' } ] }, { text: 'Customization', collapsed: false, items: [ - { text: 'Using a Custom Theme', link: '/guide/custom-theme' }, - { text: 'Extending the Default Theme', link: '/guide/extending-default-theme' }, - { text: 'Build-Time Data Loading', link: '/guide/data-loading' }, - { text: 'SSR Compatibility', link: '/guide/ssr-compat' }, - { text: 'Connecting to a CMS', link: '/guide/cms' } + { text: 'Using a Custom Theme', link: 'custom-theme' }, + { text: 'Extending the Default Theme', link: 'extending-default-theme' }, + { text: 'Build-Time Data Loading', link: 'data-loading' }, + { text: 'SSR Compatibility', link: 'ssr-compat' }, + { text: 'Connecting to a CMS', link: 'cms' } ] }, { text: 'Experimental', collapsed: false, items: [ - { text: 'MPA Mode', link: '/guide/mpa-mode' }, - { text: 'Sitemap Generation', link: '/guide/sitemap-generation' } + { text: 'MPA Mode', link: 'mpa-mode' }, + { text: 'Sitemap Generation', link: 'sitemap-generation' } ] }, - { text: 'Config & API Reference', link: '/reference/site-config' } + { text: 'Config & API Reference', base: '/reference/', link: 'site-config' } ] } -/* prettier-ignore */ function sidebarReference(): DefaultTheme.SidebarItem[] { return [ { text: 'Reference', items: [ - { text: 'Site Config', link: '/reference/site-config' }, - { text: 'Frontmatter Config', link: '/reference/frontmatter-config' }, - { text: 'Runtime API', link: '/reference/runtime-api' }, - { text: 'CLI', link: '/reference/cli' }, + { text: 'Site Config', link: 'site-config' }, + { text: 'Frontmatter Config', link: 'frontmatter-config' }, + { text: 'Runtime API', link: 'runtime-api' }, + { text: 'CLI', link: 'cli' }, { text: 'Default Theme', + base: '/reference/default-theme-', items: [ - { text: 'Overview', link: '/reference/default-theme-config' }, - { text: 'Nav', link: '/reference/default-theme-nav' }, - { text: 'Sidebar', link: '/reference/default-theme-sidebar' }, - { text: 'Home Page', link: '/reference/default-theme-home-page' }, - { text: 'Footer', link: '/reference/default-theme-footer' }, - { text: 'Layout', link: '/reference/default-theme-layout' }, - { text: 'Badge', link: '/reference/default-theme-badge' }, - { text: 'Team Page', link: '/reference/default-theme-team-page' }, - { text: 'Prev / Next Links', link: '/reference/default-theme-prev-next-links' }, - { text: 'Edit Link', link: '/reference/default-theme-edit-link' }, - { text: 'Last Updated Timestamp', link: '/reference/default-theme-last-updated' }, - { text: 'Search', link: '/reference/default-theme-search' }, - { text: 'Carbon Ads', link: '/reference/default-theme-carbon-ads' } + { text: 'Overview', link: 'config' }, + { text: 'Nav', link: 'nav' }, + { text: 'Sidebar', link: 'sidebar' }, + { text: 'Home Page', link: 'home-page' }, + { text: 'Footer', link: 'footer' }, + { text: 'Layout', link: 'layout' }, + { text: 'Badge', link: 'badge' }, + { text: 'Team Page', link: 'team-page' }, + { text: 'Prev / Next Links', link: 'prev-next-links' }, + { text: 'Edit Link', link: 'edit-link' }, + { text: 'Last Updated Timestamp', link: 'last-updated' }, + { text: 'Search', link: 'search' }, + { text: 'Carbon Ads', link: 'carbon-ads' } ] } ] diff --git a/src/client/theme-default/composables/sidebar.ts b/src/client/theme-default/composables/sidebar.ts index c18a28dd0831..4d98edfc0284 100644 --- a/src/client/theme-default/composables/sidebar.ts +++ b/src/client/theme-default/composables/sidebar.ts @@ -1,16 +1,16 @@ +import { useMediaQuery } from '@vueuse/core' +import type { DefaultTheme } from 'vitepress/theme' import { - type ComputedRef, - type Ref, computed, onMounted, onUnmounted, ref, + watch, watchEffect, - watch + watchPostEffect, + type ComputedRef, + type Ref } from 'vue' -import { useMediaQuery } from '@vueuse/core' -import { useRoute } from 'vitepress' -import type { DefaultTheme } from 'vitepress/theme' import { inBrowser, isActive } from '../../shared' import { hasActiveLink as containsActiveLink, @@ -30,15 +30,14 @@ export interface SidebarControl { } export function useSidebar() { - const route = useRoute() - const { theme, frontmatter } = useData() + const { frontmatter, page, theme } = useData() const is960 = useMediaQuery('(min-width: 960px)') const isOpen = ref(false) const sidebar = computed(() => { const sidebarConfig = theme.value.sidebar - const relativePath = route.data.relativePath + const relativePath = page.value.relativePath return sidebarConfig ? getSidebar(sidebarConfig, relativePath) : [] }) @@ -176,7 +175,7 @@ export function useSidebarControl( collapsed.value = !!(collapsible.value && item.value.collapsed) }) - watchEffect(() => { + watchPostEffect(() => { ;(isActiveLink.value || hasActiveLink.value) && (collapsed.value = false) }) diff --git a/src/client/theme-default/support/sidebar.ts b/src/client/theme-default/support/sidebar.ts index 6385c55ef6fd..955eb23eac7c 100644 --- a/src/client/theme-default/support/sidebar.ts +++ b/src/client/theme-default/support/sidebar.ts @@ -20,7 +20,7 @@ export function getSidebar( _sidebar: DefaultTheme.Sidebar | undefined, path: string ): SidebarItem[] { - if (Array.isArray(_sidebar)) return _sidebar + if (Array.isArray(_sidebar)) return addBase(_sidebar) if (_sidebar == null) return [] path = ensureStartingSlash(path) @@ -34,7 +34,10 @@ export function getSidebar( return path.startsWith(ensureStartingSlash(dir)) }) - return dir ? _sidebar[dir] : [] + const sidebar = dir ? _sidebar[dir] : [] + return Array.isArray(sidebar) + ? addBase(sidebar) + : addBase(sidebar.items, sidebar.base) } /** @@ -104,3 +107,13 @@ export function hasActiveLink( ? hasActiveLink(path, items.items) : false } + +function addBase(items: SidebarItem[], _base?: string): SidebarItem[] { + return [...items].map((_item) => { + const item = { ..._item } + const base = item.base || _base + if (base && item.link) item.link = base + item.link + if (item.items) item.items = addBase(item.items, base) + return item + }) +} diff --git a/types/default-theme.d.ts b/types/default-theme.d.ts index 1e88c91d0bb8..aa9ab6f32599 100644 --- a/types/default-theme.d.ts +++ b/types/default-theme.d.ts @@ -202,7 +202,7 @@ export namespace DefaultTheme { export type Sidebar = SidebarItem[] | SidebarMulti export interface SidebarMulti { - [path: string]: SidebarItem[] + [path: string]: SidebarItem[] | { items: SidebarItem[]; base: string } } export type SidebarItem = { @@ -230,6 +230,11 @@ export namespace DefaultTheme { */ collapsed?: boolean + /** + * Base path for the children items. + */ + base?: string + /** * Customize text that appears on the footer of previous/next page. */ From 3695190adf423f94b5ad3145c9b2aa1bc27d40c3 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Tue, 8 Aug 2023 20:43:23 +0530 Subject: [PATCH 4/9] release: v1.0.0-rc.3 --- CHANGELOG.md | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99d3680071e3..5e9f737c2410 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ -# [1.0.0-rc.2](https://github.com/vuejs/vitepress/compare/v1.0.0-rc.1...v1.0.0-rc.2) (2023-08-08) +# [1.0.0-rc.3](https://github.com/vuejs/vitepress/compare/v1.0.0-rc.2...v1.0.0-rc.3) (2023-08-08) -### Reverts +### Bug Fixes -- **theme:** allow setting base path in sidebar items ([2fe8f60](https://github.com/vuejs/vitepress/commit/2fe8f60681793cb406100827ff34e0714f523d37)), closes [#2752](https://github.com/vuejs/vitepress/issues/2752) +- **regression/theme:** fix sidebar collapsing ([#2753](https://github.com/vuejs/vitepress/issues/2753)) ([9a4ee07](https://github.com/vuejs/vitepress/commit/9a4ee07260191adeb4c3810d95b044439609525c)) # [1.0.0-rc.1](https://github.com/vuejs/vitepress/compare/v1.0.0-beta.7...v1.0.0-rc.1) (2023-08-08) diff --git a/package.json b/package.json index dc721a0c7a3b..dea138ebd334 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vitepress", - "version": "1.0.0-rc.2", + "version": "1.0.0-rc.3", "description": "Vite & Vue powered static site generator", "type": "module", "packageManager": "pnpm@8.6.12", From c9d465587a3b2188ff9922483a15d7096e6a3e6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E9=9D=92=E5=B7=9D?= <46062972+ShenQingchuan@users.noreply.github.com> Date: Tue, 8 Aug 2023 23:40:19 +0800 Subject: [PATCH 5/9] fix(theme): language menu undefined text (#2755) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 三咲智子 Kevin Deng --- src/client/theme-default/components/VPFlyout.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/theme-default/components/VPFlyout.vue b/src/client/theme-default/components/VPFlyout.vue index 5a992e8e07a4..ede320d2a5b2 100644 --- a/src/client/theme-default/components/VPFlyout.vue +++ b/src/client/theme-default/components/VPFlyout.vue @@ -39,7 +39,7 @@ function onBlur() { > - + From 819eb515d06d542ea61d27deee38213fd1b31d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lehoczky=20Zolt=C3=A1n?= Date: Tue, 8 Aug 2023 17:55:20 +0200 Subject: [PATCH 6/9] docs: add root path to gitignore suggestion (#2488) --- src/node/init/init.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/node/init/init.ts b/src/node/init/init.ts index 792a354035dc..fd2c03f75dc8 100644 --- a/src/node/init/init.ts +++ b/src/node/init/init.ts @@ -159,6 +159,7 @@ export function scaffold({ const dir = root === './' ? `` : ` ${root.replace(/^\.\//, '').replace(/[/\\]$/, '')}` + const gitignorePrefix = dir ? `${dir}/.vitepress` : '.vitepress' const pkgPath = path.resolve('package.json') const userPkg = fs.existsSync(pkgPath) @@ -168,8 +169,9 @@ export function scaffold({ const tips = [] if (fs.existsSync('.git')) { tips.push( - `Make sure to add ${cyan(`.vitepress/dist`)} and ` + - `${cyan(`.vitepress/cache`)} to your ${cyan(`.gitignore`)} file.` + `Make sure to add ${cyan(`${gitignorePrefix}/dist`)} and ` + + `${cyan(`${gitignorePrefix}/cache`)} to your ` + + `${cyan(`.gitignore`)} file.` ) } if ( From 23d751165f6def6fa6b3a5d7efd89b993a2780d8 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Tue, 8 Aug 2023 21:38:35 +0530 Subject: [PATCH 7/9] fix(cli): generate mjs file on init if type: module is not present --- package.json | 1 + pnpm-lock.yaml | 13 ++++++++++ src/node/init/init.ts | 57 ++++++++++++++++++++++--------------------- 3 files changed, 43 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index dea138ebd334..1f66db7cd210 100644 --- a/package.json +++ b/package.json @@ -124,6 +124,7 @@ "@types/debug": "^4.1.8", "@types/escape-html": "^1.0.2", "@types/fs-extra": "^11.0.1", + "@types/lodash.template": "^4.5.1", "@types/mark.js": "^8.11.8", "@types/markdown-it": "^13.0.0", "@types/markdown-it-attrs": "^4.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 80137906fc7a..efd3a981f07d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -105,6 +105,9 @@ importers: '@types/fs-extra': specifier: ^11.0.1 version: 11.0.1 + '@types/lodash.template': + specifier: ^4.5.1 + version: 4.5.1 '@types/mark.js': specifier: ^8.11.8 version: 8.11.8 @@ -1048,6 +1051,16 @@ packages: resolution: {integrity: sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==} dev: true + /@types/lodash.template@4.5.1: + resolution: {integrity: sha512-0y71S2dGgmwdkSsyW95JBp8HSZchgKCsjr6F0lsT3eSMtaT3Nn9rcMHU1U4UKu6XjQT3YC6/PNwgFI7k9f+ltw==} + dependencies: + '@types/lodash': 4.14.196 + dev: true + + /@types/lodash@4.14.196: + resolution: {integrity: sha512-22y3o88f4a94mKljsZcanlNWPzO0uBsBdzLAngf2tp533LzZcQzb6+eZPJ+vCTt+bqF2XnvT9gejTLsAcJAJyQ==} + dev: true + /@types/mark.js@8.11.8: resolution: {integrity: sha512-BoWCd9ydi1hZxDfu/lF0v1hHMsNUjuxZEDJsdHlmm6GlKk4qxlLya7D3FS81QmabwFbYPpoDOh9603JESUkHbA==} dependencies: diff --git a/src/node/init/init.ts b/src/node/init/init.ts index fd2c03f75dc8..f68ac3336072 100644 --- a/src/node/init/init.ts +++ b/src/node/init/init.ts @@ -11,7 +11,6 @@ import fs from 'fs-extra' import path from 'path' import { black, cyan, bgCyan, bold, yellow } from 'picocolors' import { fileURLToPath } from 'url' -// @ts-ignore import template from 'lodash.template' export enum ScaffoldThemeType { @@ -30,13 +29,13 @@ export interface ScaffoldOptions { } export async function init() { - intro(bgCyan(bold(black(` Welcome to VitePress! `)))) + intro(bgCyan(bold(black(' Welcome to VitePress! ')))) const options: ScaffoldOptions = await group( { root: () => text({ - message: `Where should VitePress initialize the config?`, + message: 'Where should VitePress initialize the config?', initialValue: './', validate(value) { // TODO make sure directory is inside @@ -45,13 +44,13 @@ export async function init() { title: () => text({ - message: `Site title:`, + message: 'Site title:', placeholder: 'My Awesome Project' }), description: () => text({ - message: `Site description:`, + message: 'Site description:', placeholder: 'A VitePress Site' }), @@ -60,22 +59,19 @@ export async function init() { message: 'Theme:', options: [ { - // @ts-ignore value: ScaffoldThemeType.Default, - label: `Default Theme`, - hint: `Out of the box, good-looking docs` + label: 'Default Theme', + hint: 'Out of the box, good-looking docs' }, { - // @ts-ignore value: ScaffoldThemeType.DefaultCustom, - label: `Default Theme + Customization`, - hint: `Add custom CSS and layout slots` + label: 'Default Theme + Customization', + hint: 'Add custom CSS and layout slots' }, { - // @ts-ignore value: ScaffoldThemeType.Custom, - label: `Custom Theme`, - hint: `Build your own or use external` + label: 'Custom Theme', + hint: 'Build your own or use external' } ] }), @@ -85,7 +81,7 @@ export async function init() { injectNpmScripts: () => confirm({ - message: `Add VitePress npm scripts to package.json?` + message: 'Add VitePress npm scripts to package.json?' }) }, { @@ -122,11 +118,21 @@ export function scaffold({ theme === ScaffoldThemeType.DefaultCustom } + const pkgPath = path.resolve('package.json') + const userPkg = fs.existsSync(pkgPath) + ? JSON.parse(fs.readFileSync(pkgPath, 'utf-8')) + : {} + + const useMjs = userPkg.type !== 'module' + const renderFile = (file: string) => { const filePath = path.resolve(templateDir, file) let targetPath = path.resolve(resolvedRoot, file) + if (useMjs && targetPath.includes('.vitepress/config')) { + targetPath = targetPath.replace(/\.js$/, '.mjs') + } if (useTs) { - targetPath = targetPath.replace(/\.js$/, '.ts') + targetPath = targetPath.replace(/\.(m?)js$/, '.$1ts') } const src = fs.readFileSync(filePath, 'utf-8') const compiled = template(src)(data) @@ -137,19 +143,19 @@ export function scaffold({ 'index.md', 'api-examples.md', 'markdown-examples.md', - `.vitepress/config.js` + '.vitepress/config.js' ] if (theme === ScaffoldThemeType.DefaultCustom) { filesToScaffold.push( - `.vitepress/theme/index.js`, - `.vitepress/theme/style.css` + '.vitepress/theme/index.js', + '.vitepress/theme/style.css' ) } else if (theme === ScaffoldThemeType.Custom) { filesToScaffold.push( - `.vitepress/theme/index.js`, - `.vitepress/theme/style.css`, - `.vitepress/theme/Layout.vue` + '.vitepress/theme/index.js', + '.vitepress/theme/style.css', + '.vitepress/theme/Layout.vue' ) } @@ -158,14 +164,9 @@ export function scaffold({ } const dir = - root === './' ? `` : ` ${root.replace(/^\.\//, '').replace(/[/\\]$/, '')}` + root === './' ? '' : ` ${root.replace(/^\.\//, '').replace(/[/\\]$/, '')}` const gitignorePrefix = dir ? `${dir}/.vitepress` : '.vitepress' - const pkgPath = path.resolve('package.json') - const userPkg = fs.existsSync(pkgPath) - ? JSON.parse(fs.readFileSync(pkgPath, 'utf-8')) - : {} - const tips = [] if (fs.existsSync('.git')) { tips.push( From ae1042d1e4f7350e1c3cc29aab4720fbd546c09b Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Tue, 8 Aug 2023 21:44:50 +0530 Subject: [PATCH 8/9] chore: bump deps --- package.json | 2 +- pnpm-lock.yaml | 238 +++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 234 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 1f66db7cd210..e4d1699e600b 100644 --- a/package.json +++ b/package.json @@ -140,7 +140,7 @@ "conventional-changelog-cli": "^3.0.0", "cross-spawn": "^7.0.3", "debug": "^4.3.4", - "esbuild": "^0.18.20", + "esbuild": "^0.19.0", "escape-html": "^1.0.3", "execa": "^7.2.0", "fast-glob": "^3.3.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index efd3a981f07d..247f0846b7cf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -154,8 +154,8 @@ importers: specifier: ^4.3.4 version: 4.3.4(supports-color@9.4.0) esbuild: - specifier: ^0.18.20 - version: 0.18.20 + specifier: ^0.19.0 + version: 0.19.0 escape-html: specifier: ^1.0.3 version: 1.0.3 @@ -248,7 +248,7 @@ importers: version: 5.3.1(rollup@3.27.2)(typescript@5.1.6) rollup-plugin-esbuild: specifier: ^5.0.0 - version: 5.0.0(esbuild@0.18.20)(rollup@3.27.2)(supports-color@9.4.0) + version: 5.0.0(esbuild@0.19.0)(rollup@3.27.2)(supports-color@9.4.0) semver: specifier: ^7.5.4 version: 7.5.4 @@ -540,6 +540,15 @@ packages: requiresBuild: true optional: true + /@esbuild/android-arm64@0.19.0: + resolution: {integrity: sha512-AzsozJnB+RNaDncBCs3Ys5g3kqhPFUueItfEaCpp89JH2naFNX2mYDIvUgPYMqqjm8hiFoo+jklb3QHZyR3ubw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + /@esbuild/android-arm@0.18.20: resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} engines: {node: '>=12'} @@ -548,6 +557,15 @@ packages: requiresBuild: true optional: true + /@esbuild/android-arm@0.19.0: + resolution: {integrity: sha512-GAkjUyHgWTYuex3evPd5V7uV/XS4LMKr1PWHRPW1xNyy/Jx08x3uTrDFRefBYLKT/KpaWM8/YMQcwbp5a3yIDA==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + /@esbuild/android-x64@0.18.20: resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} engines: {node: '>=12'} @@ -556,6 +574,15 @@ packages: requiresBuild: true optional: true + /@esbuild/android-x64@0.19.0: + resolution: {integrity: sha512-SUG8/qiVhljBDpdkHQ9DvOWbp7hFFIP0OzxOTptbmVsgBgzY6JWowmMd6yJuOhapfxmj/DrvwKmjRLvVSIAKZg==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + /@esbuild/darwin-arm64@0.18.20: resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} engines: {node: '>=12'} @@ -564,6 +591,15 @@ packages: requiresBuild: true optional: true + /@esbuild/darwin-arm64@0.19.0: + resolution: {integrity: sha512-HkxZ8k3Jvcw0FORPNTavA8BMgQjLOB6AajT+iXmil7BwY3gU1hWvJJAyWyEogCmA4LdbGvKF8vEykdmJ4xNJJQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@esbuild/darwin-x64@0.18.20: resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} engines: {node: '>=12'} @@ -572,6 +608,15 @@ packages: requiresBuild: true optional: true + /@esbuild/darwin-x64@0.19.0: + resolution: {integrity: sha512-9IRWJjqpWFHM9a5Qs3r3bK834NCFuDY5ZaLrmTjqE+10B6w65UMQzeZjh794JcxpHolsAHqwsN/33crUXNCM2Q==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@esbuild/freebsd-arm64@0.18.20: resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} engines: {node: '>=12'} @@ -580,6 +625,15 @@ packages: requiresBuild: true optional: true + /@esbuild/freebsd-arm64@0.19.0: + resolution: {integrity: sha512-s7i2WcXcK0V1PJHVBe7NsGddsL62a9Vhpz2U7zapPrwKoFuxPP9jybwX8SXnropR/AOj3ppt2ern4ItblU6UQQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/freebsd-x64@0.18.20: resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} engines: {node: '>=12'} @@ -588,6 +642,15 @@ packages: requiresBuild: true optional: true + /@esbuild/freebsd-x64@0.19.0: + resolution: {integrity: sha512-NMdBSSdgwHCqCsucU5k1xflIIRU0qi1QZnM6+vdGy5fvxm1c8rKh50VzsWsIVTFUG3l91AtRxVwoz3Lcvy3I5w==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-arm64@0.18.20: resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} engines: {node: '>=12'} @@ -596,6 +659,15 @@ packages: requiresBuild: true optional: true + /@esbuild/linux-arm64@0.19.0: + resolution: {integrity: sha512-I4zvE2srSZxRPapFnNqj+NL3sDJ1wkvEZqt903OZUlBBgigrQMvzUowvP/TTTu2OGYe1oweg5MFilfyrElIFag==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-arm@0.18.20: resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} engines: {node: '>=12'} @@ -604,6 +676,15 @@ packages: requiresBuild: true optional: true + /@esbuild/linux-arm@0.19.0: + resolution: {integrity: sha512-2F1+lH7ZBcCcgxiSs8EXQV0PPJJdTNiNcXxDb61vzxTRJJkXX1I/ye9mAhfHyScXzHaEibEXg1Jq9SW586zz7w==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-ia32@0.18.20: resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} engines: {node: '>=12'} @@ -612,6 +693,15 @@ packages: requiresBuild: true optional: true + /@esbuild/linux-ia32@0.19.0: + resolution: {integrity: sha512-dz2Q7+P92r1Evc8kEN+cQnB3qqPjmCrOZ+EdBTn8lEc1yN8WDgaDORQQiX+mxaijbH8npXBT9GxUqE52Gt6Y+g==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-loong64@0.18.20: resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} engines: {node: '>=12'} @@ -620,6 +710,15 @@ packages: requiresBuild: true optional: true + /@esbuild/linux-loong64@0.19.0: + resolution: {integrity: sha512-IcVJovJVflih4oFahhUw+N7YgNbuMSVFNr38awb0LNzfaiIfdqIh518nOfYaNQU3aVfiJnOIRVJDSAP4k35WxA==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-mips64el@0.18.20: resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} engines: {node: '>=12'} @@ -628,6 +727,15 @@ packages: requiresBuild: true optional: true + /@esbuild/linux-mips64el@0.19.0: + resolution: {integrity: sha512-bZGRAGySMquWsKw0gIdsClwfvgbsSq/7oq5KVu1H1r9Il+WzOcfkV1hguntIuBjRVL8agI95i4AukjdAV2YpUw==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-ppc64@0.18.20: resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} engines: {node: '>=12'} @@ -636,6 +744,15 @@ packages: requiresBuild: true optional: true + /@esbuild/linux-ppc64@0.19.0: + resolution: {integrity: sha512-3LC6H5/gCDorxoRBUdpLV/m7UthYSdar0XcCu+ypycQxMS08MabZ06y1D1yZlDzL/BvOYliRNRWVG/YJJvQdbg==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-riscv64@0.18.20: resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} engines: {node: '>=12'} @@ -644,6 +761,15 @@ packages: requiresBuild: true optional: true + /@esbuild/linux-riscv64@0.19.0: + resolution: {integrity: sha512-jfvdKjWk+Cp2sgLtEEdSHXO7qckrw2B2eFBaoRdmfhThqZs29GMMg7q/LsQpybA7BxCLLEs4di5ucsWzZC5XPA==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-s390x@0.18.20: resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} engines: {node: '>=12'} @@ -652,6 +778,15 @@ packages: requiresBuild: true optional: true + /@esbuild/linux-s390x@0.19.0: + resolution: {integrity: sha512-ofcucfNLkoXmcnJaw9ugdEOf40AWKGt09WBFCkpor+vFJVvmk/8OPjl/qRtks2Z7BuZbG3ztJuK1zS9z5Cgx9A==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-x64@0.18.20: resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} engines: {node: '>=12'} @@ -660,6 +795,15 @@ packages: requiresBuild: true optional: true + /@esbuild/linux-x64@0.19.0: + resolution: {integrity: sha512-Fpf7zNDBti3xrQKQKLdXT0hTyOxgFdRJIMtNy8x1az9ATR9/GJ1brYbB/GLWoXhKiHsoWs+2DLkFVNNMTCLEwA==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/netbsd-x64@0.18.20: resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} engines: {node: '>=12'} @@ -668,6 +812,15 @@ packages: requiresBuild: true optional: true + /@esbuild/netbsd-x64@0.19.0: + resolution: {integrity: sha512-AMQAp/5oENgDOvVhvOlbhVe1pWii7oFAMRHlmTjSEMcpjTpIHtFXhv9uAFgUERHm3eYtNvS9Vf+gT55cwuI6Aw==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/openbsd-x64@0.18.20: resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} engines: {node: '>=12'} @@ -676,6 +829,15 @@ packages: requiresBuild: true optional: true + /@esbuild/openbsd-x64@0.19.0: + resolution: {integrity: sha512-fDztEve1QUs3h/Dw2AUmBlWGkNQbhDoD05ppm5jKvzQv+HVuV13so7m5RYeiSMIC2XQy7PAjZh+afkxAnCRZxA==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/sunos-x64@0.18.20: resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} engines: {node: '>=12'} @@ -684,6 +846,15 @@ packages: requiresBuild: true optional: true + /@esbuild/sunos-x64@0.19.0: + resolution: {integrity: sha512-bKZzJ2/rvUjDzA5Ddyva2tMk89WzNJEibZEaq+wY6SiqPlwgFbqyQLimouxLHiHh1itb5P3SNCIF1bc2bw5H9w==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + /@esbuild/win32-arm64@0.18.20: resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} engines: {node: '>=12'} @@ -692,6 +863,15 @@ packages: requiresBuild: true optional: true + /@esbuild/win32-arm64@0.19.0: + resolution: {integrity: sha512-NQJ+4jmnA79saI+sE+QzcEls19uZkoEmdxo7r//PDOjIpX8pmoWtTnWg6XcbnO7o4fieyAwb5U2LvgWynF4diA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@esbuild/win32-ia32@0.18.20: resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} engines: {node: '>=12'} @@ -700,6 +880,15 @@ packages: requiresBuild: true optional: true + /@esbuild/win32-ia32@0.19.0: + resolution: {integrity: sha512-uyxiZAnsfu9diHm9/rIH2soecF/HWLXYUhJKW4q1+/LLmNQ+55lRjvSUDhUmsgJtSUscRJB/3S4RNiTb9o9mCg==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@esbuild/win32-x64@0.18.20: resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} engines: {node: '>=12'} @@ -708,6 +897,15 @@ packages: requiresBuild: true optional: true + /@esbuild/win32-x64@0.19.0: + resolution: {integrity: sha512-jl+NXUjK2StMgqnZnqgNjZuerFG8zQqWXMBZdMMv4W/aO1ZKQaYWZBxTrtWKphkCBVEMh0wMVfGgOd2BjOZqUQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@hapi/hoek@9.3.0: resolution: {integrity: sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==} dev: true @@ -2250,6 +2448,36 @@ packages: '@esbuild/win32-ia32': 0.18.20 '@esbuild/win32-x64': 0.18.20 + /esbuild@0.19.0: + resolution: {integrity: sha512-i7i8TP4vuG55bKeLyqqk5sTPu1ZjPH3wkcLvAj/0X/222iWFo3AJUYRKjbOoY6BWFMH3teizxHEdV9Su5ESl0w==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/android-arm': 0.19.0 + '@esbuild/android-arm64': 0.19.0 + '@esbuild/android-x64': 0.19.0 + '@esbuild/darwin-arm64': 0.19.0 + '@esbuild/darwin-x64': 0.19.0 + '@esbuild/freebsd-arm64': 0.19.0 + '@esbuild/freebsd-x64': 0.19.0 + '@esbuild/linux-arm': 0.19.0 + '@esbuild/linux-arm64': 0.19.0 + '@esbuild/linux-ia32': 0.19.0 + '@esbuild/linux-loong64': 0.19.0 + '@esbuild/linux-mips64el': 0.19.0 + '@esbuild/linux-ppc64': 0.19.0 + '@esbuild/linux-riscv64': 0.19.0 + '@esbuild/linux-s390x': 0.19.0 + '@esbuild/linux-x64': 0.19.0 + '@esbuild/netbsd-x64': 0.19.0 + '@esbuild/openbsd-x64': 0.19.0 + '@esbuild/sunos-x64': 0.19.0 + '@esbuild/win32-arm64': 0.19.0 + '@esbuild/win32-ia32': 0.19.0 + '@esbuild/win32-x64': 0.19.0 + dev: true + /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} @@ -3844,7 +4072,7 @@ packages: '@babel/code-frame': 7.22.10 dev: true - /rollup-plugin-esbuild@5.0.0(esbuild@0.18.20)(rollup@3.27.2)(supports-color@9.4.0): + /rollup-plugin-esbuild@5.0.0(esbuild@0.19.0)(rollup@3.27.2)(supports-color@9.4.0): resolution: {integrity: sha512-1cRIOHAPh8WQgdQQyyvFdeOdxuiyk+zB5zJ5+YOwrZP4cJ0MT3Fs48pQxrZeyZHcn+klFherytILVfE4aYrneg==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} peerDependencies: @@ -3854,7 +4082,7 @@ packages: '@rollup/pluginutils': 5.0.2(rollup@3.27.2) debug: 4.3.4(supports-color@9.4.0) es-module-lexer: 1.3.0 - esbuild: 0.18.20 + esbuild: 0.19.0 joycon: 3.1.1 jsonc-parser: 3.2.0 rollup: 3.27.2 From 3b6760817d19ce0927ebaeef19256f1f139f6d8e Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Tue, 8 Aug 2023 21:48:51 +0530 Subject: [PATCH 9/9] release: v1.0.0-rc.4 --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e9f737c2410..ea34838b3486 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.0.0-rc.4](https://github.com/vuejs/vitepress/compare/v1.0.0-rc.3...v1.0.0-rc.4) (2023-08-08) + +### Bug Fixes + +- **cli:** generate mjs file on init if `"type": "module"` is not present ([23d7511](https://github.com/vuejs/vitepress/commit/23d751165f6def6fa6b3a5d7efd89b993a2780d8)) +- **theme:** language menu undefined text ([#2755](https://github.com/vuejs/vitepress/issues/2755)) ([c9d4655](https://github.com/vuejs/vitepress/commit/c9d465587a3b2188ff9922483a15d7096e6a3e6c)) + # [1.0.0-rc.3](https://github.com/vuejs/vitepress/compare/v1.0.0-rc.2...v1.0.0-rc.3) (2023-08-08) ### Bug Fixes diff --git a/package.json b/package.json index e4d1699e600b..1cb29dd70ecb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vitepress", - "version": "1.0.0-rc.3", + "version": "1.0.0-rc.4", "description": "Vite & Vue powered static site generator", "type": "module", "packageManager": "pnpm@8.6.12",