Skip to content

Commit ab57216

Browse files
committed
fix: empty template for YunAdBoard parent gap size
1 parent ffe7eba commit ab57216

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<template>
2-
<!-- empty -->
3-
<div />
2+
<!-- eslint-disable-next-line vue/no-lone-template empty -->
3+
<template />
44
</template>

packages/valaxy/node/cli/utils/cli.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ import consola from 'consola'
99
import type { InlineConfig, ViteDevServer } from 'vite'
1010
import { mergeConfig } from 'vite'
1111
import { version } from 'valaxy/package.json'
12+
import ora from 'ora'
13+
import { colors } from 'consola/utils'
1214
import type { ValaxyNode } from '../../types'
1315
import { createServer } from '../../server'
1416
import type { ResolvedValaxyOptions } from '../../options'
1517
import { mergeViteConfigs } from '../../common'
16-
import { vLogger } from '../../logger'
18+
import { vLogger, valaxyPrefix } from '../../logger'
1719

1820
let server: ViteDevServer | undefined
1921

@@ -60,6 +62,7 @@ export function printInfo(options: ResolvedValaxyOptions, port?: number, remote?
6062
// 'extendMd',
6163
// ]
6264

65+
export const serverSpinner = ora(`${valaxyPrefix} creating server ...`)
6366
export async function initServer(valaxyApp: ValaxyNode, viteConfig: InlineConfig) {
6467
if (server) {
6568
vLogger.info('close server...')
@@ -68,6 +71,7 @@ export async function initServer(valaxyApp: ValaxyNode, viteConfig: InlineConfig
6871

6972
const { options } = valaxyApp
7073

74+
serverSpinner.start()
7175
const viteConfigs: InlineConfig = mergeConfig(
7276
await mergeViteConfigs(options, 'serve'),
7377
viteConfig,
@@ -101,8 +105,7 @@ export async function initServer(valaxyApp: ValaxyNode, viteConfig: InlineConfig
101105
},
102106
})
103107
await server.listen()
104-
// consola.success(, 'server ready')
105-
vLogger.ready('server ready')
108+
serverSpinner.succeed(`${valaxyPrefix} ${colors.green('server ready.')}`)
106109
}
107110
catch (e) {
108111
consola.error('failed to start server. error:\n')

packages/valaxy/node/logger/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import type { ValaxyHooks, ValaxyNode } from '../types'
77

88
export const logger = consola.create({})
99

10-
const prefix = `${magenta('valaxy')}:`
10+
export const valaxyPrefix = colors.magenta('[valaxy]')
1111
export const vLogger = {
12-
success: (...args: any) => logger.success(prefix, ...args),
13-
info: (...args: any) => logger.info(prefix, ...args),
14-
ready: (...args: any) => logger.ready(prefix, ...args),
12+
success: (...args: any) => logger.success(valaxyPrefix, ...args),
13+
info: (...args: any) => logger.info(valaxyPrefix, ...args),
14+
ready: (...args: any) => logger.ready(valaxyPrefix, ...args),
1515
}
1616

1717
/**

packages/valaxy/node/server.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@ import process from 'node:process'
22
import type { InlineConfig } from 'vite'
33
import { createServer as createViteServer, mergeConfig as mergeViteConfig } from 'vite'
44

5+
import { colors } from 'consola/utils'
56
import type { ValaxyNode } from './types'
67
import type { ValaxyServerOptions } from './options'
78
import { ViteValaxyPlugins } from './plugins/preset'
9+
import { serverSpinner } from './cli/utils/cli'
10+
import { valaxyPrefix } from './logger'
11+
12+
function getServerInfoText(msg: string) {
13+
return `${valaxyPrefix} ${colors.gray(msg)}`
14+
}
815

916
export async function createServer(
1017
valaxyApp: ValaxyNode,
@@ -16,6 +23,7 @@ export async function createServer(
1623

1724
const { options } = valaxyApp
1825

26+
serverSpinner.text = getServerInfoText('init vite plugins ..')
1927
const plugins = await ViteValaxyPlugins(valaxyApp, serverOptions)
2028
// dynamic import to avoid bundle it in build
2129
const enableDevtools = options.mode === 'dev' && options.config.devtools
@@ -30,12 +38,14 @@ export async function createServer(
3038
)
3139
}
3240

41+
serverSpinner.text = getServerInfoText('merge vite config ...')
3342
const mergedViteConfig = mergeViteConfig(
3443
viteConfig,
3544
{
3645
plugins: vitePlugins,
3746
},
3847
)
48+
serverSpinner.text = getServerInfoText('create vite server ...')
3949
const server = await createViteServer(mergedViteConfig)
4050
return server
4151
}

0 commit comments

Comments
 (0)