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 { 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',

@ -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',

@ -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',

@ -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',

@ -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',

@ -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',

@ -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',

@ -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',

@ -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

Loading…
Cancel
Save