feat(ai): improve chart runtime UX

This commit is contained in:
CEQ151 authored and digua committed 2026-06-05 11:12:42 +08:00
1 parent 782f67ba63
commit 15470444e5
40 files changed
+1547 -144

No files matched your search

+49
View File
@@ -0,0 +1,49 @@
#!/usr/bin/env node
/**
* Cross-platform API server dev launcher.
*/
import { spawnSync } from 'node:child_process'
const pnpm = 'pnpm'
const extraArgs = process.argv.slice(2)
function run(command, args, options = {}) {
const result = spawnSync(command, args, {
stdio: 'inherit',
shell: false,
...options,
})
if (result.error) {
console.error(result.error.message)
process.exit(1)
}
if (result.status !== 0) {
process.exit(result.status ?? 1)
}
}
function runPnpm(args, options = {}) {
if (process.env.npm_execpath) {
run(process.execPath, [process.env.npm_execpath, ...args], options)
return
}
run(pnpm, args, { shell: process.platform === 'win32', ...options })
}
runPnpm(['run', 'ensure:server-native'])
runPnpm([
'exec',
'tsx',
'watch',
'--include',
'packages/core/src/**',
'--include',
'packages/node-runtime/src/**',
'apps/cli/src/cli.ts',
'start',
'--headless',
'--no-open',
...extraArgs,
])
+44
View File
@@ -0,0 +1,44 @@
#!/usr/bin/env node
/**
* Cross-platform Web dev launcher.
*
* Windows shells do not support inline env syntax such as
* `CHATLAB_AUTO_SERVE=1 vite ...`, so set the env in Node before spawning Vite.
*/
import { spawnSync } from 'node:child_process'
const pnpm = 'pnpm'
const extraArgs = process.argv.slice(2)
function run(command, args, options = {}) {
const result = spawnSync(command, args, {
stdio: 'inherit',
shell: false,
...options,
})
if (result.error) {
console.error(result.error.message)
process.exit(1)
}
if (result.status !== 0) {
process.exit(result.status ?? 1)
}
}
function runPnpm(args, options = {}) {
if (process.env.npm_execpath) {
run(process.execPath, [process.env.npm_execpath, ...args], options)
return
}
run(pnpm, args, { shell: process.platform === 'win32', ...options })
}
runPnpm(['run', 'ensure:server-native'])
runPnpm(['exec', 'vite', '--config', 'vite.web.config.mts', ...extraArgs], {
env: {
...process.env,
CHATLAB_AUTO_SERVE: '1',
},
})