chore: named imports don't work with json natively

pull/5421/head
Divyansh Singh 6 days ago
parent a6573ff60c
commit dcf7fda29d

@ -1,5 +1,5 @@
import { defineAdditionalConfig, type DefaultTheme } from 'vitepress' 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({ export default defineAdditionalConfig({
description: 'Vite & Vue powered static site generator.', description: 'Vite & Vue powered static site generator.',
@ -37,7 +37,7 @@ function nav(): DefaultTheme.NavItem[] {
activeMatch: '/reference/' activeMatch: '/reference/'
}, },
{ {
text: version, text: pkg.version,
items: [ items: [
{ {
text: '1.6.4', text: '1.6.4',

@ -3,7 +3,7 @@ import {
type DefaultTheme, type DefaultTheme,
type MarkdownLocaleOptions type MarkdownLocaleOptions
} from 'vitepress' } from 'vitepress'
import { version } from 'vitepress/package.json' with { type: 'json' } import pkg from 'vitepress/package.json' with { type: 'json' }
export const markdown: MarkdownLocaleOptions = { export const markdown: MarkdownLocaleOptions = {
container: { container: {
@ -89,7 +89,7 @@ function nav(): DefaultTheme.NavItem[] {
activeMatch: '/es/reference/' activeMatch: '/es/reference/'
}, },
{ {
text: version, text: pkg.version,
items: [ items: [
{ {
text: '1.6.4', text: '1.6.4',

@ -3,7 +3,7 @@ import {
type DefaultTheme, type DefaultTheme,
type MarkdownLocaleOptions type MarkdownLocaleOptions
} from 'vitepress' } from 'vitepress'
import { version } from 'vitepress/package.json' with { type: 'json' } import pkg from 'vitepress/package.json' with { type: 'json' }
export const markdown: MarkdownLocaleOptions = { export const markdown: MarkdownLocaleOptions = {
container: { container: {
@ -97,7 +97,7 @@ function nav(): DefaultTheme.NavItem[] {
activeMatch: '/reference/' activeMatch: '/reference/'
}, },
{ {
text: version, text: pkg.version,
items: [ items: [
{ {
text: '1.6.4', text: '1.6.4',

@ -3,7 +3,7 @@ import {
type DefaultTheme, type DefaultTheme,
type MarkdownLocaleOptions type MarkdownLocaleOptions
} from 'vitepress' } from 'vitepress'
import { version } from 'vitepress/package.json' with { type: 'json' } import pkg from 'vitepress/package.json' with { type: 'json' }
export const markdown: MarkdownLocaleOptions = { export const markdown: MarkdownLocaleOptions = {
container: { container: {
@ -60,7 +60,7 @@ function nav(): DefaultTheme.NavItem[] {
activeMatch: '/reference/' activeMatch: '/reference/'
}, },
{ {
text: version, text: pkg.version,
items: [ items: [
{ {
text: '1.6.4', text: '1.6.4',

@ -3,7 +3,7 @@ import {
type DefaultTheme, type DefaultTheme,
type MarkdownLocaleOptions type MarkdownLocaleOptions
} from 'vitepress' } from 'vitepress'
import { version } from 'vitepress/package.json' with { type: 'json' } import pkg from 'vitepress/package.json' with { type: 'json' }
export const markdown: MarkdownLocaleOptions = { export const markdown: MarkdownLocaleOptions = {
container: { container: {
@ -89,7 +89,7 @@ function nav(): DefaultTheme.NavItem[] {
activeMatch: '/ko/reference/' activeMatch: '/ko/reference/'
}, },
{ {
text: version, text: pkg.version,
items: [ items: [
{ {
text: '1.6.4', text: '1.6.4',

@ -3,7 +3,7 @@ import {
type DefaultTheme, type DefaultTheme,
type MarkdownLocaleOptions type MarkdownLocaleOptions
} from 'vitepress' } from 'vitepress'
import { version } from 'vitepress/package.json' with { type: 'json' } import pkg from 'vitepress/package.json' with { type: 'json' }
export const markdown: MarkdownLocaleOptions = { export const markdown: MarkdownLocaleOptions = {
container: { container: {
@ -89,7 +89,7 @@ function nav(): DefaultTheme.NavItem[] {
activeMatch: '/pt/reference/' activeMatch: '/pt/reference/'
}, },
{ {
text: version, text: pkg.version,
items: [ items: [
{ {
text: '1.6.4', text: '1.6.4',

@ -3,7 +3,7 @@ import {
type DefaultTheme, type DefaultTheme,
type MarkdownLocaleOptions type MarkdownLocaleOptions
} from 'vitepress' } from 'vitepress'
import { version } from 'vitepress/package.json' with { type: 'json' } import pkg from 'vitepress/package.json' with { type: 'json' }
export const markdown: MarkdownLocaleOptions = { export const markdown: MarkdownLocaleOptions = {
container: { container: {
@ -87,7 +87,7 @@ function nav(): DefaultTheme.NavItem[] {
activeMatch: '/ru/reference/' activeMatch: '/ru/reference/'
}, },
{ {
text: version, text: pkg.version,
items: [ items: [
{ {
text: '1.6.4', text: '1.6.4',

@ -3,7 +3,7 @@ import {
type DefaultTheme, type DefaultTheme,
type MarkdownLocaleOptions type MarkdownLocaleOptions
} from 'vitepress' } from 'vitepress'
import { version } from 'vitepress/package.json' with { type: 'json' } import pkg from 'vitepress/package.json' with { type: 'json' }
export const markdown: MarkdownLocaleOptions = { export const markdown: MarkdownLocaleOptions = {
container: { container: {
@ -89,7 +89,7 @@ function nav(): DefaultTheme.NavItem[] {
activeMatch: '/zh/reference/' activeMatch: '/zh/reference/'
}, },
{ {
text: version, text: pkg.version,
items: [ items: [
{ {
text: '1.6.4', text: '1.6.4',

@ -8,7 +8,7 @@ import * as prompts from '@clack/prompts'
import { spawn } from 'cross-spawn' import { spawn } from 'cross-spawn'
import semver from 'semver' 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 const { inc: _inc, valid } = semver
@ -17,7 +17,7 @@ const versionIncrements = ['patch', 'minor', 'major'] as const
const tags = ['latest', 'next'] as const const tags = ['latest', 'next'] as const
const dir = fileURLToPath(new URL('.', import.meta.url)) 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 run = async (bin: string, args: string[], opts: SpawnOptions = {}) => {
const child = spawn(bin, args, { stdio: 'inherit', ...opts }) const child = spawn(bin, args, { stdio: 'inherit', ...opts })
const [code, signal] = (await once(child, 'close')) as [ const [code, signal] = (await once(child, 'close')) as [
@ -50,7 +50,7 @@ async function main() {
if (release === 3) { if (release === 3) {
const customVersion = await prompts.text({ const customVersion = await prompts.text({
message: 'Input custom version', message: 'Input custom version',
initialValue: currentVersion initialValue: pkg.version
}) })
if (prompts.isCancel(customVersion)) return cancel() if (prompts.isCancel(customVersion)) return cancel()
targetVersion = customVersion targetVersion = customVersion

Loading…
Cancel
Save