From dcf7fda29d6761969e30b98b10172b8d82e30358 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Fri, 4 Sep 2026 16:22:14 +0530 Subject: [PATCH] chore: named imports don't work with json natively --- docs/config.ts | 4 ++-- docs/es/config.ts | 4 ++-- docs/fa/config.ts | 4 ++-- docs/ja/config.ts | 4 ++-- docs/ko/config.ts | 4 ++-- docs/pt/config.ts | 4 ++-- docs/ru/config.ts | 4 ++-- docs/zh/config.ts | 4 ++-- scripts/release.ts | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/config.ts b/docs/config.ts index aa751983..1989a8e6 100644 --- a/docs/config.ts +++ b/docs/config.ts @@ -1,5 +1,5 @@ import { defineAdditionalConfig, type DefaultTheme } from 'vitepress' -import { version } from 'vitepress/package.json' with { type: 'json' } +import pkg from 'vitepress/package.json' with { type: 'json' } export default defineAdditionalConfig({ description: 'Vite & Vue powered static site generator.', @@ -37,7 +37,7 @@ function nav(): DefaultTheme.NavItem[] { activeMatch: '/reference/' }, { - text: version, + text: pkg.version, items: [ { text: '1.6.4', diff --git a/docs/es/config.ts b/docs/es/config.ts index 43b2dfb7..547182e0 100644 --- a/docs/es/config.ts +++ b/docs/es/config.ts @@ -3,7 +3,7 @@ import { type DefaultTheme, type MarkdownLocaleOptions } from 'vitepress' -import { version } from 'vitepress/package.json' with { type: 'json' } +import pkg from 'vitepress/package.json' with { type: 'json' } export const markdown: MarkdownLocaleOptions = { container: { @@ -89,7 +89,7 @@ function nav(): DefaultTheme.NavItem[] { activeMatch: '/es/reference/' }, { - text: version, + text: pkg.version, items: [ { text: '1.6.4', diff --git a/docs/fa/config.ts b/docs/fa/config.ts index 2b7dcc1c..773571a9 100644 --- a/docs/fa/config.ts +++ b/docs/fa/config.ts @@ -3,7 +3,7 @@ import { type DefaultTheme, type MarkdownLocaleOptions } from 'vitepress' -import { version } from 'vitepress/package.json' with { type: 'json' } +import pkg from 'vitepress/package.json' with { type: 'json' } export const markdown: MarkdownLocaleOptions = { container: { @@ -97,7 +97,7 @@ function nav(): DefaultTheme.NavItem[] { activeMatch: '/reference/' }, { - text: version, + text: pkg.version, items: [ { text: '1.6.4', diff --git a/docs/ja/config.ts b/docs/ja/config.ts index 3930ab7c..97a5deb2 100644 --- a/docs/ja/config.ts +++ b/docs/ja/config.ts @@ -3,7 +3,7 @@ import { type DefaultTheme, type MarkdownLocaleOptions } from 'vitepress' -import { version } from 'vitepress/package.json' with { type: 'json' } +import pkg from 'vitepress/package.json' with { type: 'json' } export const markdown: MarkdownLocaleOptions = { container: { @@ -60,7 +60,7 @@ function nav(): DefaultTheme.NavItem[] { activeMatch: '/reference/' }, { - text: version, + text: pkg.version, items: [ { text: '1.6.4', diff --git a/docs/ko/config.ts b/docs/ko/config.ts index 2226254d..ef8f941b 100644 --- a/docs/ko/config.ts +++ b/docs/ko/config.ts @@ -3,7 +3,7 @@ import { type DefaultTheme, type MarkdownLocaleOptions } from 'vitepress' -import { version } from 'vitepress/package.json' with { type: 'json' } +import pkg from 'vitepress/package.json' with { type: 'json' } export const markdown: MarkdownLocaleOptions = { container: { @@ -89,7 +89,7 @@ function nav(): DefaultTheme.NavItem[] { activeMatch: '/ko/reference/' }, { - text: version, + text: pkg.version, items: [ { text: '1.6.4', diff --git a/docs/pt/config.ts b/docs/pt/config.ts index 9b99bef3..f52eb484 100644 --- a/docs/pt/config.ts +++ b/docs/pt/config.ts @@ -3,7 +3,7 @@ import { type DefaultTheme, type MarkdownLocaleOptions } from 'vitepress' -import { version } from 'vitepress/package.json' with { type: 'json' } +import pkg from 'vitepress/package.json' with { type: 'json' } export const markdown: MarkdownLocaleOptions = { container: { @@ -89,7 +89,7 @@ function nav(): DefaultTheme.NavItem[] { activeMatch: '/pt/reference/' }, { - text: version, + text: pkg.version, items: [ { text: '1.6.4', diff --git a/docs/ru/config.ts b/docs/ru/config.ts index 4a4fa3d7..ef695544 100644 --- a/docs/ru/config.ts +++ b/docs/ru/config.ts @@ -3,7 +3,7 @@ import { type DefaultTheme, type MarkdownLocaleOptions } from 'vitepress' -import { version } from 'vitepress/package.json' with { type: 'json' } +import pkg from 'vitepress/package.json' with { type: 'json' } export const markdown: MarkdownLocaleOptions = { container: { @@ -87,7 +87,7 @@ function nav(): DefaultTheme.NavItem[] { activeMatch: '/ru/reference/' }, { - text: version, + text: pkg.version, items: [ { text: '1.6.4', diff --git a/docs/zh/config.ts b/docs/zh/config.ts index 41a557a5..376736c4 100644 --- a/docs/zh/config.ts +++ b/docs/zh/config.ts @@ -3,7 +3,7 @@ import { type DefaultTheme, type MarkdownLocaleOptions } from 'vitepress' -import { version } from 'vitepress/package.json' with { type: 'json' } +import pkg from 'vitepress/package.json' with { type: 'json' } export const markdown: MarkdownLocaleOptions = { container: { @@ -89,7 +89,7 @@ function nav(): DefaultTheme.NavItem[] { activeMatch: '/zh/reference/' }, { - text: version, + text: pkg.version, items: [ { text: '1.6.4', diff --git a/scripts/release.ts b/scripts/release.ts index 3d861c1b..f6da9f84 100644 --- a/scripts/release.ts +++ b/scripts/release.ts @@ -8,7 +8,7 @@ import * as prompts from '@clack/prompts' import { spawn } from 'cross-spawn' import semver from 'semver' -import { version as currentVersion } from '../package.json' with { type: 'json' } +import pkg from '../package.json' with { type: 'json' } const { inc: _inc, valid } = semver @@ -17,7 +17,7 @@ const versionIncrements = ['patch', 'minor', 'major'] as const const tags = ['latest', 'next'] as const const dir = fileURLToPath(new URL('.', import.meta.url)) -const inc = (i: semver.ReleaseType) => _inc(currentVersion, i) +const inc = (i: semver.ReleaseType) => _inc(pkg.version, i) const run = async (bin: string, args: string[], opts: SpawnOptions = {}) => { const child = spawn(bin, args, { stdio: 'inherit', ...opts }) const [code, signal] = (await once(child, 'close')) as [ @@ -50,7 +50,7 @@ async function main() { if (release === 3) { const customVersion = await prompts.text({ message: 'Input custom version', - initialValue: currentVersion + initialValue: pkg.version }) if (prompts.isCancel(customVersion)) return cancel() targetVersion = customVersion