fix: resolve vpr ready failures
- Fix unhandled promise in coding-agent example (void operator) - Fix unhandled promise in cli/dev.ts (void operator) - Fix ChildProcess.on() type error in cli/process-manager.ts (@types/node v25 removed .on() from ChildProcess type) - Change example build scripts from "vite build" to "vp build" (vite resolves to vite-plus-core which has no CLI bin) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vue-tui dev",
|
||||
"build": "vite build",
|
||||
"preview": "vite build && node dist/game.mjs"
|
||||
"build": "vp build",
|
||||
"preview": "vp build && node dist/game.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue-tui/cli": "workspace:*",
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vue-tui dev",
|
||||
"build": "vite build",
|
||||
"preview": "vite build && node dist/game.mjs"
|
||||
"build": "vp build",
|
||||
"preview": "vp build && node dist/game.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue-tui/cli": "workspace:*",
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vue-tui dev",
|
||||
"build": "vite build",
|
||||
"preview": "vite build && node dist/agent.mjs"
|
||||
"build": "vp build",
|
||||
"preview": "vp build && node dist/agent.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue-tui/cli": "workspace:*",
|
||||
|
||||
@@ -113,7 +113,7 @@ export default defineComponent(() => {
|
||||
if (state.value !== "idle") return;
|
||||
|
||||
if (key.return) {
|
||||
submit();
|
||||
void submit();
|
||||
} else if (key.backspace || key.delete) {
|
||||
inputText.value = inputText.value.slice(0, -1);
|
||||
} else if (input && !key.ctrl && !key.meta) {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "vite build",
|
||||
"preview": "vite build && node dist/game.mjs"
|
||||
"build": "vp build",
|
||||
"preview": "vp build && node dist/game.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue-tui/runtime": "workspace:*",
|
||||
|
||||
@@ -68,7 +68,7 @@ export async function dev(entry?: string) {
|
||||
if (!acceptReloads) return;
|
||||
const newPath = await extractBundle(clientEnv.memoryFiles, outDir);
|
||||
pm.setBundlePath(newPath);
|
||||
pm.restart();
|
||||
void pm.restart();
|
||||
});
|
||||
|
||||
// Re-spawn after crash on next successful bundle update
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { spawn, type ChildProcess } from "node:child_process";
|
||||
import type { EventEmitter } from "node:events";
|
||||
import type { Logger } from "./logger.ts";
|
||||
|
||||
export interface ProcessManagerOptions {
|
||||
@@ -33,7 +34,7 @@ export function createProcessManager(options: ProcessManagerOptions) {
|
||||
function doSpawn() {
|
||||
process.stdout.write("\x1b[2J\x1b[H");
|
||||
options.logger.mode = "silent";
|
||||
child = spawn("node", ["--import", loaderBootstrap, currentBundlePath], {
|
||||
const proc = spawn("node", ["--import", loaderBootstrap, currentBundlePath], {
|
||||
stdio: "inherit",
|
||||
env: {
|
||||
...process.env,
|
||||
@@ -41,8 +42,9 @@ export function createProcessManager(options: ProcessManagerOptions) {
|
||||
VUE_TUI_HMR_PORT: String(options.hmrPort),
|
||||
},
|
||||
});
|
||||
child = proc;
|
||||
|
||||
child.on("exit", (code) => {
|
||||
(proc as unknown as EventEmitter).on("exit", (code: number | null) => {
|
||||
options.logger.mode = "stdout";
|
||||
child = null;
|
||||
options.onExit?.(code);
|
||||
@@ -54,7 +56,7 @@ export function createProcessManager(options: ProcessManagerOptions) {
|
||||
const timer = setTimeout(() => {
|
||||
resolve();
|
||||
}, timeout);
|
||||
proc.on("exit", () => {
|
||||
(proc as unknown as EventEmitter).on("exit", () => {
|
||||
clearTimeout(timer);
|
||||
resolve();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user