everything-dev 1.8.6 → 1.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/streaming-view.cjs +21 -18
- package/dist/components/streaming-view.cjs.map +1 -1
- package/dist/components/streaming-view.mjs +21 -18
- package/dist/components/streaming-view.mjs.map +1 -1
- package/dist/contract.d.cts +6 -6
- package/dist/contract.d.mts +6 -6
- package/dist/orchestrator.d.cts +1 -1
- package/dist/orchestrator.d.mts +1 -1
- package/dist/plugin.cjs +30 -20
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +5 -5
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts +5 -5
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +31 -22
- package/dist/plugin.mjs.map +1 -1
- package/dist/service-descriptor.d.cts +2 -2
- package/dist/service-descriptor.d.mts +2 -2
- package/dist/types.d.cts +4 -4
- package/dist/types.d.mts +4 -4
- package/package.json +1 -1
- package/src/components/streaming-view.ts +21 -16
- package/src/plugin.ts +48 -25
- package/dist/_virtual/_rolldown/runtime.mjs +0 -7
|
@@ -62,34 +62,37 @@ function renderStreamingView(initialProcesses, description, env, onExit) {
|
|
|
62
62
|
const sectionedProcesses = getSectionedProcesses(initialProcesses);
|
|
63
63
|
const columnWidths = getColumnWidths(initialProcesses);
|
|
64
64
|
const lastLogBySource = /* @__PURE__ */ new Map();
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
65
|
+
const headerLines = [
|
|
66
|
+
"",
|
|
67
|
+
require_theme.colors.cyan(`${"─".repeat(52)}`),
|
|
68
|
+
` ${require_theme.icons.run} ${require_theme.colors.cyan(description.toUpperCase())}`,
|
|
69
|
+
require_theme.colors.cyan(`${"─".repeat(52)}`),
|
|
70
|
+
""
|
|
71
|
+
];
|
|
72
|
+
if (proxyTarget) headerLines.push(orange(` ${require_theme.icons.arrow} API PROXY → ${proxyTarget}`), "");
|
|
74
73
|
for (const section of sectionedProcesses) {
|
|
75
|
-
|
|
74
|
+
headerLines.push(require_theme.colors.cyan(` ${section.title}`));
|
|
76
75
|
for (const proc of section.processes) {
|
|
77
76
|
const color = getServiceColor(proc.name);
|
|
78
77
|
const sourceLabel = proc.source ? ` (${proc.source})` : "";
|
|
79
|
-
|
|
78
|
+
headerLines.push(`${require_theme.colors.dim(`[${getTimestamp()}]`)} ${color(`[${getDisplayName(proc.name).padEnd(columnWidths.name)}]`)} ${require_theme.icons.pending} waiting${sourceLabel.padEnd(columnWidths.source)}`);
|
|
80
79
|
}
|
|
81
|
-
|
|
80
|
+
headerLines.push("");
|
|
82
81
|
}
|
|
82
|
+
console.log(headerLines.join("\n"));
|
|
83
83
|
const checkAllReady = () => {
|
|
84
84
|
if (allReadyPrinted) return;
|
|
85
85
|
if (Array.from(processes.values()).every((p) => p.status === "ready")) {
|
|
86
86
|
allReadyPrinted = true;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
const readyLines = [
|
|
88
|
+
"",
|
|
89
|
+
require_theme.colors.dim(`${"─".repeat(52)}`),
|
|
90
|
+
require_theme.colors.green(`${require_theme.icons.ok} All ${processes.size} services ready`),
|
|
91
|
+
require_theme.colors.green(`${require_theme.icons.arrow} http://localhost:${hostPort}`),
|
|
92
|
+
require_theme.colors.dim(`${"─".repeat(52)}`),
|
|
93
|
+
""
|
|
94
|
+
];
|
|
95
|
+
console.log(readyLines.join("\n"));
|
|
93
96
|
}
|
|
94
97
|
};
|
|
95
98
|
const updateProcess = (name, status, message) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming-view.cjs","names":["colors","icons","linkify"],"sources":["../../src/components/streaming-view.ts"],"sourcesContent":["import chalk from \"chalk\";\nimport { linkify } from \"../utils/linkify\";\nimport { colors, icons } from \"../utils/theme\";\nimport type { ProcessState, ProcessStatus } from \"./dev-view\";\n\nconst orange = chalk.hex(\"#ffaa00\");\nconst PLUGIN_PREFIX = \"plugin:\";\n\nexport interface StreamingViewHandle {\n updateProcess: (name: string, status: ProcessStatus, message?: string) => void;\n addLog: (source: string, line: string, isError?: boolean) => void;\n unmount: () => Promise<void> | void;\n}\n\nconst getTimestamp = (): string => {\n const now = new Date();\n return `${now.getHours().toString().padStart(2, \"0\")}:${now.getMinutes().toString().padStart(2, \"0\")}:${now.getSeconds().toString().padStart(2, \"0\")}`;\n};\n\nconst write = (text: string) => process.stdout.write(`${text}\\n`);\n\nconst getServiceColor = (name: string): ((s: string) => string) => {\n if (name.startsWith(PLUGIN_PREFIX)) return orange;\n if (name === \"host\") return colors.cyan;\n if (name === \"ui\" || name === \"ui-ssr\") return colors.magenta;\n if (name === \"api\") return colors.blue;\n return colors.white;\n};\n\nconst getDisplayName = (name: string): string => {\n return name.startsWith(PLUGIN_PREFIX)\n ? name.slice(PLUGIN_PREFIX.length).toUpperCase()\n : name.toUpperCase();\n};\n\nconst isPlugin = (name: string): boolean => name.startsWith(PLUGIN_PREFIX);\n\nconst getSectionedProcesses = (processes: ProcessState[]) => {\n const plugins = processes.filter((p) => isPlugin(p.name));\n const services = processes.filter((p) => !isPlugin(p.name));\n const sections: Array<{ key: string; title: string; processes: ProcessState[] }> = [];\n if (plugins.length > 0) sections.push({ key: \"plugins\", title: \"PLUGINS\", processes: plugins });\n if (services.length > 0)\n sections.push({ key: \"services\", title: \"SERVICES\", processes: services });\n return sections;\n};\n\nconst getColumnWidths = (processes: ProcessState[]) => {\n const name = Math.max(6, ...processes.map((p) => getDisplayName(p.name).length));\n const source = Math.max(10, ...processes.map((p) => (p.source ? ` (${p.source})`.length : 0)));\n return { name, source };\n};\n\nconst getStatusIcon = (status: ProcessStatus): string => {\n switch (status) {\n case \"pending\":\n return icons.pending;\n case \"starting\":\n return icons.scan;\n case \"ready\":\n return icons.ok;\n case \"error\":\n return icons.err;\n }\n};\n\nexport function renderStreamingView(\n initialProcesses: ProcessState[],\n description: string,\n env: Record<string, string>,\n onExit?: () => Promise<void> | void,\n): StreamingViewHandle {\n const processes = new Map<string, ProcessState>();\n for (const p of initialProcesses) {\n processes.set(p.name, { ...p });\n }\n\n let allReadyPrinted = false;\n const hostProcess = initialProcesses.find((p) => p.name === \"host\");\n const hostPort = hostProcess?.port || 3000;\n const proxyTarget = env.API_PROXY;\n const sectionedProcesses = getSectionedProcesses(initialProcesses);\n const columnWidths = getColumnWidths(initialProcesses);\n const lastLogBySource = new Map<string, string>();\n\n console.log();\n console.log(colors.cyan(`${\"─\".repeat(52)}`));\n console.log(` ${icons.run} ${colors.cyan(description.toUpperCase())}`);\n console.log(colors.cyan(`${\"─\".repeat(52)}`));\n console.log();\n\n if (proxyTarget) {\n console.log(orange(` ${icons.arrow} API PROXY → ${proxyTarget}`));\n console.log();\n }\n\n for (const section of sectionedProcesses) {\n console.log(colors.cyan(` ${section.title}`));\n for (const proc of section.processes) {\n const color = getServiceColor(proc.name);\n const sourceLabel = proc.source ? ` (${proc.source})` : \"\";\n console.log(\n `${colors.dim(`[${getTimestamp()}]`)} ${color(`[${getDisplayName(proc.name).padEnd(columnWidths.name)}]`)} ${icons.pending} waiting${sourceLabel.padEnd(columnWidths.source)}`,\n );\n }\n console.log();\n }\n\n const checkAllReady = () => {\n if (allReadyPrinted) return;\n const allReady = Array.from(processes.values()).every((p) => p.status === \"ready\");\n if (allReady) {\n allReadyPrinted = true;\n console.log();\n console.log(colors.dim(`${\"─\".repeat(52)}`));\n console.log(colors.green(`${icons.ok} All ${processes.size} services ready`));\n console.log(colors.green(`${icons.arrow} http://localhost:${hostPort}`));\n console.log(colors.dim(`${\"─\".repeat(52)}`));\n console.log();\n }\n };\n\n const updateProcess = (name: string, status: ProcessStatus, message?: string) => {\n const proc = processes.get(name);\n if (!proc) return;\n\n proc.status = status;\n if (message) proc.message = message;\n\n const color = getServiceColor(name);\n const icon = getStatusIcon(status);\n const displayName = getDisplayName(name).padEnd(columnWidths.name);\n const sourceLabel = proc?.source ? ` (${proc.source})` : \"\";\n const isRemote = proc?.source === \"remote\";\n const isHost = name === \"host\";\n const showPort = proc.port > 0 && (isHost || !isRemote) && status === \"ready\";\n const statusText =\n status === \"ready\"\n ? isRemote && !isHost\n ? \"loaded\"\n : \"running\"\n : status === \"starting\"\n ? \"starting\"\n : status === \"error\"\n ? \"failed\"\n : \"waiting\";\n const portStr = showPort ? ` :${proc.port}` : \"\";\n\n write(\n `${colors.dim(`[${getTimestamp()}]`)} ${color(`[${displayName}]`)} ${status === \"ready\" ? colors.green(icon) : status === \"error\" ? colors.error(icon) : icon} ${statusText}${sourceLabel.padEnd(columnWidths.source)}${portStr}`,\n );\n\n checkAllReady();\n };\n\n const addLog = (source: string, line: string, isError = false) => {\n const lastLine = lastLogBySource.get(source);\n const nextLine = `${isError ? \"ERR\" : \"OUT\"}:${line}`;\n if (lastLine === nextLine) return;\n lastLogBySource.set(source, nextLine);\n\n const color = getServiceColor(source);\n const logColor = isError ? colors.error : colors.dim;\n write(\n `${colors.dim(`[${getTimestamp()}]`)} ${color(`[${source.toUpperCase()}]`)} ${colors.dim(\"│\")} ${logColor(linkify(line))}`,\n );\n };\n\n const unmount = () => onExit?.();\n\n return { updateProcess, addLog, unmount };\n}\n"],"mappings":";;;;;;;AAKA,MAAM,SAAS,cAAM,IAAI,UAAU;AACnC,MAAM,gBAAgB;AAQtB,MAAM,qBAA6B;CACjC,MAAM,sBAAM,IAAI,MAAM;AACtB,QAAO,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,YAAY,CAAC,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,YAAY,CAAC,UAAU,CAAC,SAAS,GAAG,IAAI;;AAGtJ,MAAM,SAAS,SAAiB,QAAQ,OAAO,MAAM,GAAG,KAAK,IAAI;AAEjE,MAAM,mBA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,UAAU;EAChE,MAAM,WAAW,gBAAgB,IAAI,OAAO;EAC5C,MAAM,WAAW,GAAG,UAAU,QAAQ,MAAM,GAAG;AAC/C,MAAI,aAAa,SAAU;AAC3B,kBAAgB,IAAI,QAAQ,SAAS;EAErC,MAAM,QAAQ,gBAAgB,OAAO;EACrC,MAAM,WAAW,UAAUA,qBAAO,QAAQA,qBAAO;AACjD,QACE,GAAGA,qBAAO,IAAI,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,MAAM,IAAI,OAAO,aAAa,CAAC,GAAG,CAAC,IAAIA,qBAAO,IAAI,IAAI,CAAC,GAAG,SAASE,wBAAQ,KAAK,CAAC,GAC1H;;CAGH,MAAM,gBAAgB,UAAU;AAEhC,QAAO;EAAE;EAAe;EAAQ;EAAS"}
|
|
1
|
+
{"version":3,"file":"streaming-view.cjs","names":["colors","icons","linkify"],"sources":["../../src/components/streaming-view.ts"],"sourcesContent":["import chalk from \"chalk\";\nimport { linkify } from \"../utils/linkify\";\nimport { colors, icons } from \"../utils/theme\";\nimport type { ProcessState, ProcessStatus } from \"./dev-view\";\n\nconst orange = chalk.hex(\"#ffaa00\");\nconst PLUGIN_PREFIX = \"plugin:\";\n\nexport interface StreamingViewHandle {\n updateProcess: (name: string, status: ProcessStatus, message?: string) => void;\n addLog: (source: string, line: string, isError?: boolean) => void;\n unmount: () => Promise<void> | void;\n}\n\nconst getTimestamp = (): string => {\n const now = new Date();\n return `${now.getHours().toString().padStart(2, \"0\")}:${now.getMinutes().toString().padStart(2, \"0\")}:${now.getSeconds().toString().padStart(2, \"0\")}`;\n};\n\nconst write = (text: string) => process.stdout.write(`${text}\\n`);\n\nconst getServiceColor = (name: string): ((s: string) => string) => {\n if (name.startsWith(PLUGIN_PREFIX)) return orange;\n if (name === \"host\") return colors.cyan;\n if (name === \"ui\" || name === \"ui-ssr\") return colors.magenta;\n if (name === \"api\") return colors.blue;\n return colors.white;\n};\n\nconst getDisplayName = (name: string): string => {\n return name.startsWith(PLUGIN_PREFIX)\n ? name.slice(PLUGIN_PREFIX.length).toUpperCase()\n : name.toUpperCase();\n};\n\nconst isPlugin = (name: string): boolean => name.startsWith(PLUGIN_PREFIX);\n\nconst getSectionedProcesses = (processes: ProcessState[]) => {\n const plugins = processes.filter((p) => isPlugin(p.name));\n const services = processes.filter((p) => !isPlugin(p.name));\n const sections: Array<{ key: string; title: string; processes: ProcessState[] }> = [];\n if (plugins.length > 0) sections.push({ key: \"plugins\", title: \"PLUGINS\", processes: plugins });\n if (services.length > 0)\n sections.push({ key: \"services\", title: \"SERVICES\", processes: services });\n return sections;\n};\n\nconst getColumnWidths = (processes: ProcessState[]) => {\n const name = Math.max(6, ...processes.map((p) => getDisplayName(p.name).length));\n const source = Math.max(10, ...processes.map((p) => (p.source ? ` (${p.source})`.length : 0)));\n return { name, source };\n};\n\nconst getStatusIcon = (status: ProcessStatus): string => {\n switch (status) {\n case \"pending\":\n return icons.pending;\n case \"starting\":\n return icons.scan;\n case \"ready\":\n return icons.ok;\n case \"error\":\n return icons.err;\n }\n};\n\nexport function renderStreamingView(\n initialProcesses: ProcessState[],\n description: string,\n env: Record<string, string>,\n onExit?: () => Promise<void> | void,\n): StreamingViewHandle {\n const processes = new Map<string, ProcessState>();\n for (const p of initialProcesses) {\n processes.set(p.name, { ...p });\n }\n\n let allReadyPrinted = false;\n const hostProcess = initialProcesses.find((p) => p.name === \"host\");\n const hostPort = hostProcess?.port || 3000;\n const proxyTarget = env.API_PROXY;\n const sectionedProcesses = getSectionedProcesses(initialProcesses);\n const columnWidths = getColumnWidths(initialProcesses);\n const lastLogBySource = new Map<string, string>();\n\n const headerLines: string[] = [\n \"\",\n colors.cyan(`${\"─\".repeat(52)}`),\n ` ${icons.run} ${colors.cyan(description.toUpperCase())}`,\n colors.cyan(`${\"─\".repeat(52)}`),\n \"\",\n ];\n\n if (proxyTarget) {\n headerLines.push(orange(` ${icons.arrow} API PROXY → ${proxyTarget}`), \"\");\n }\n\n for (const section of sectionedProcesses) {\n headerLines.push(colors.cyan(` ${section.title}`));\n for (const proc of section.processes) {\n const color = getServiceColor(proc.name);\n const sourceLabel = proc.source ? ` (${proc.source})` : \"\";\n headerLines.push(\n `${colors.dim(`[${getTimestamp()}]`)} ${color(`[${getDisplayName(proc.name).padEnd(columnWidths.name)}]`)} ${icons.pending} waiting${sourceLabel.padEnd(columnWidths.source)}`,\n );\n }\n headerLines.push(\"\");\n }\n console.log(headerLines.join(\"\\n\"));\n\n const checkAllReady = () => {\n if (allReadyPrinted) return;\n const allReady = Array.from(processes.values()).every((p) => p.status === \"ready\");\n if (allReady) {\n allReadyPrinted = true;\n const readyLines = [\n \"\",\n colors.dim(`${\"─\".repeat(52)}`),\n colors.green(`${icons.ok} All ${processes.size} services ready`),\n colors.green(`${icons.arrow} http://localhost:${hostPort}`),\n colors.dim(`${\"─\".repeat(52)}`),\n \"\",\n ];\n console.log(readyLines.join(\"\\n\"));\n }\n };\n\n const updateProcess = (name: string, status: ProcessStatus, message?: string) => {\n const proc = processes.get(name);\n if (!proc) return;\n\n proc.status = status;\n if (message) proc.message = message;\n\n const color = getServiceColor(name);\n const icon = getStatusIcon(status);\n const displayName = getDisplayName(name).padEnd(columnWidths.name);\n const sourceLabel = proc?.source ? ` (${proc.source})` : \"\";\n const isRemote = proc?.source === \"remote\";\n const isHost = name === \"host\";\n const showPort = proc.port > 0 && (isHost || !isRemote) && status === \"ready\";\n const statusText =\n status === \"ready\"\n ? isRemote && !isHost\n ? \"loaded\"\n : \"running\"\n : status === \"starting\"\n ? \"starting\"\n : status === \"error\"\n ? \"failed\"\n : \"waiting\";\n const portStr = showPort ? ` :${proc.port}` : \"\";\n\n write(\n `${colors.dim(`[${getTimestamp()}]`)} ${color(`[${displayName}]`)} ${status === \"ready\" ? colors.green(icon) : status === \"error\" ? colors.error(icon) : icon} ${statusText}${sourceLabel.padEnd(columnWidths.source)}${portStr}`,\n );\n\n checkAllReady();\n };\n\n const addLog = (source: string, line: string, isError = false) => {\n const lastLine = lastLogBySource.get(source);\n const nextLine = `${isError ? \"ERR\" : \"OUT\"}:${line}`;\n if (lastLine === nextLine) return;\n lastLogBySource.set(source, nextLine);\n\n const color = getServiceColor(source);\n const logColor = isError ? colors.error : colors.dim;\n write(\n `${colors.dim(`[${getTimestamp()}]`)} ${color(`[${source.toUpperCase()}]`)} ${colors.dim(\"│\")} ${logColor(linkify(line))}`,\n );\n };\n\n const unmount = () => onExit?.();\n\n return { updateProcess, addLog, unmount };\n}\n"],"mappings":";;;;;;;AAKA,MAAM,SAAS,cAAM,IAAI,UAAU;AACnC,MAAM,gBAAgB;AAQtB,MAAM,qBAA6B;CACjC,MAAM,sBAAM,IAAI,MAAM;AACtB,QAAO,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,YAAY,CAAC,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,YAAY,CAAC,UAAU,CAAC,SAAS,GAAG,IAAI;;AAGtJ,MAAM,SAAS,SAAiB,QAAQ,OAAO,MAAM,GAAG,KAAK,IAAI;AAEjE,MAAM,mBAAmB,SAA0C;AACjE,KAAI,KAAK,WAAW,cAAc,CAAE,QAAO;AAC3C,KAAI,SAAS,OAAQ,QAAOA,qBAAO;AACnC,KAAI,SAAS,QAAQ,SAAS,SAAU,QAAOA,qBAAO;AACtD,KAAI,SAAS,MAAO,QAAOA,qBAAO;AAClC,QAAOA,qBAAO;;AAGhB,MAAM,kBAAkB,SAAyB;AAC/C,QAAO,KAAK,WAAW,cAAc,GACjC,KAAK,MAAM,EAAqB,CAAC,aAAa,GAC9C,KAAK,aAAa;;AAGxB,MAAM,YAAY,SAA0B,KAAK,WAAW,cAAc;AAE1E,MAAM,yBAAyB,cAA8B;CAC3D,MAAM,UAAU,UAAU,QAAQ,MAAM,SAAS,EAAE,KAAK,CAAC;CACzD,MAAM,WAAW,UAAU,QAAQ,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC;CAC3D,MAAM,W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AAe,KAAK,CAAC,OAAO,aAAa,KAAK;EAClE,MAAM,cAAc,MAAM,SAAS,KAAK,KAAK,OAAO,KAAK;EACzD,MAAM,WAAW,MAAM,WAAW;EAClC,MAAM,SAAS,SAAS;EACxB,MAAM,WAAW,KAAK,OAAO,MAAM,UAAU,CAAC,aAAa,WAAW;EACtE,MAAM,aACJ,WAAW,UACP,YAAY,CAAC,SACX,WACA,YACF,WAAW,aACT,aACA,WAAW,UACT,WACA;EACV,MAAM,UAAU,WAAW,KAAK,KAAK,SAAS;AAE9C,QACE,GAAGA,qBAAO,IAAI,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,MAAM,IAAI,YAAY,GAAG,CAAC,IAAI,WAAW,UAAUA,qBAAO,MAAM,KAAK,GAAG,WAAW,UAAUA,qBAAO,MAAM,KAAK,GAAG,KAAK,GAAG,aAAa,YAAY,OAAO,aAAa,OAAO,GAAG,UAC1N;AAED,iBAAe;;CAGjB,MAAM,UAAU,QAAgB,MAAc,UAAU,UAAU;EAChE,MAAM,WAAW,gBAAgB,IAAI,OAAO;EAC5C,MAAM,WAAW,GAAG,UAAU,QAAQ,MAAM,GAAG;AAC/C,MAAI,aAAa,SAAU;AAC3B,kBAAgB,IAAI,QAAQ,SAAS;EAErC,MAAM,QAAQ,gBAAgB,OAAO;EACrC,MAAM,WAAW,UAAUA,qBAAO,QAAQA,qBAAO;AACjD,QACE,GAAGA,qBAAO,IAAI,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,MAAM,IAAI,OAAO,aAAa,CAAC,GAAG,CAAC,IAAIA,qBAAO,IAAI,IAAI,CAAC,GAAG,SAASE,wBAAQ,KAAK,CAAC,GAC1H;;CAGH,MAAM,gBAAgB,UAAU;AAEhC,QAAO;EAAE;EAAe;EAAQ;EAAS"}
|
|
@@ -60,34 +60,37 @@ function renderStreamingView(initialProcesses, description, env, onExit) {
|
|
|
60
60
|
const sectionedProcesses = getSectionedProcesses(initialProcesses);
|
|
61
61
|
const columnWidths = getColumnWidths(initialProcesses);
|
|
62
62
|
const lastLogBySource = /* @__PURE__ */ new Map();
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
63
|
+
const headerLines = [
|
|
64
|
+
"",
|
|
65
|
+
colors.cyan(`${"─".repeat(52)}`),
|
|
66
|
+
` ${icons.run} ${colors.cyan(description.toUpperCase())}`,
|
|
67
|
+
colors.cyan(`${"─".repeat(52)}`),
|
|
68
|
+
""
|
|
69
|
+
];
|
|
70
|
+
if (proxyTarget) headerLines.push(orange(` ${icons.arrow} API PROXY → ${proxyTarget}`), "");
|
|
72
71
|
for (const section of sectionedProcesses) {
|
|
73
|
-
|
|
72
|
+
headerLines.push(colors.cyan(` ${section.title}`));
|
|
74
73
|
for (const proc of section.processes) {
|
|
75
74
|
const color = getServiceColor(proc.name);
|
|
76
75
|
const sourceLabel = proc.source ? ` (${proc.source})` : "";
|
|
77
|
-
|
|
76
|
+
headerLines.push(`${colors.dim(`[${getTimestamp()}]`)} ${color(`[${getDisplayName(proc.name).padEnd(columnWidths.name)}]`)} ${icons.pending} waiting${sourceLabel.padEnd(columnWidths.source)}`);
|
|
78
77
|
}
|
|
79
|
-
|
|
78
|
+
headerLines.push("");
|
|
80
79
|
}
|
|
80
|
+
console.log(headerLines.join("\n"));
|
|
81
81
|
const checkAllReady = () => {
|
|
82
82
|
if (allReadyPrinted) return;
|
|
83
83
|
if (Array.from(processes.values()).every((p) => p.status === "ready")) {
|
|
84
84
|
allReadyPrinted = true;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
const readyLines = [
|
|
86
|
+
"",
|
|
87
|
+
colors.dim(`${"─".repeat(52)}`),
|
|
88
|
+
colors.green(`${icons.ok} All ${processes.size} services ready`),
|
|
89
|
+
colors.green(`${icons.arrow} http://localhost:${hostPort}`),
|
|
90
|
+
colors.dim(`${"─".repeat(52)}`),
|
|
91
|
+
""
|
|
92
|
+
];
|
|
93
|
+
console.log(readyLines.join("\n"));
|
|
91
94
|
}
|
|
92
95
|
};
|
|
93
96
|
const updateProcess = (name, status, message) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming-view.mjs","names":[],"sources":["../../src/components/streaming-view.ts"],"sourcesContent":["import chalk from \"chalk\";\nimport { linkify } from \"../utils/linkify\";\nimport { colors, icons } from \"../utils/theme\";\nimport type { ProcessState, ProcessStatus } from \"./dev-view\";\n\nconst orange = chalk.hex(\"#ffaa00\");\nconst PLUGIN_PREFIX = \"plugin:\";\n\nexport interface StreamingViewHandle {\n updateProcess: (name: string, status: ProcessStatus, message?: string) => void;\n addLog: (source: string, line: string, isError?: boolean) => void;\n unmount: () => Promise<void> | void;\n}\n\nconst getTimestamp = (): string => {\n const now = new Date();\n return `${now.getHours().toString().padStart(2, \"0\")}:${now.getMinutes().toString().padStart(2, \"0\")}:${now.getSeconds().toString().padStart(2, \"0\")}`;\n};\n\nconst write = (text: string) => process.stdout.write(`${text}\\n`);\n\nconst getServiceColor = (name: string): ((s: string) => string) => {\n if (name.startsWith(PLUGIN_PREFIX)) return orange;\n if (name === \"host\") return colors.cyan;\n if (name === \"ui\" || name === \"ui-ssr\") return colors.magenta;\n if (name === \"api\") return colors.blue;\n return colors.white;\n};\n\nconst getDisplayName = (name: string): string => {\n return name.startsWith(PLUGIN_PREFIX)\n ? name.slice(PLUGIN_PREFIX.length).toUpperCase()\n : name.toUpperCase();\n};\n\nconst isPlugin = (name: string): boolean => name.startsWith(PLUGIN_PREFIX);\n\nconst getSectionedProcesses = (processes: ProcessState[]) => {\n const plugins = processes.filter((p) => isPlugin(p.name));\n const services = processes.filter((p) => !isPlugin(p.name));\n const sections: Array<{ key: string; title: string; processes: ProcessState[] }> = [];\n if (plugins.length > 0) sections.push({ key: \"plugins\", title: \"PLUGINS\", processes: plugins });\n if (services.length > 0)\n sections.push({ key: \"services\", title: \"SERVICES\", processes: services });\n return sections;\n};\n\nconst getColumnWidths = (processes: ProcessState[]) => {\n const name = Math.max(6, ...processes.map((p) => getDisplayName(p.name).length));\n const source = Math.max(10, ...processes.map((p) => (p.source ? ` (${p.source})`.length : 0)));\n return { name, source };\n};\n\nconst getStatusIcon = (status: ProcessStatus): string => {\n switch (status) {\n case \"pending\":\n return icons.pending;\n case \"starting\":\n return icons.scan;\n case \"ready\":\n return icons.ok;\n case \"error\":\n return icons.err;\n }\n};\n\nexport function renderStreamingView(\n initialProcesses: ProcessState[],\n description: string,\n env: Record<string, string>,\n onExit?: () => Promise<void> | void,\n): StreamingViewHandle {\n const processes = new Map<string, ProcessState>();\n for (const p of initialProcesses) {\n processes.set(p.name, { ...p });\n }\n\n let allReadyPrinted = false;\n const hostProcess = initialProcesses.find((p) => p.name === \"host\");\n const hostPort = hostProcess?.port || 3000;\n const proxyTarget = env.API_PROXY;\n const sectionedProcesses = getSectionedProcesses(initialProcesses);\n const columnWidths = getColumnWidths(initialProcesses);\n const lastLogBySource = new Map<string, string>();\n\n console.log();\n console.log(colors.cyan(`${\"─\".repeat(52)}`));\n console.log(` ${icons.run} ${colors.cyan(description.toUpperCase())}`);\n console.log(colors.cyan(`${\"─\".repeat(52)}`));\n console.log();\n\n if (proxyTarget) {\n console.log(orange(` ${icons.arrow} API PROXY → ${proxyTarget}`));\n console.log();\n }\n\n for (const section of sectionedProcesses) {\n console.log(colors.cyan(` ${section.title}`));\n for (const proc of section.processes) {\n const color = getServiceColor(proc.name);\n const sourceLabel = proc.source ? ` (${proc.source})` : \"\";\n console.log(\n `${colors.dim(`[${getTimestamp()}]`)} ${color(`[${getDisplayName(proc.name).padEnd(columnWidths.name)}]`)} ${icons.pending} waiting${sourceLabel.padEnd(columnWidths.source)}`,\n );\n }\n console.log();\n }\n\n const checkAllReady = () => {\n if (allReadyPrinted) return;\n const allReady = Array.from(processes.values()).every((p) => p.status === \"ready\");\n if (allReady) {\n allReadyPrinted = true;\n console.log();\n console.log(colors.dim(`${\"─\".repeat(52)}`));\n console.log(colors.green(`${icons.ok} All ${processes.size} services ready`));\n console.log(colors.green(`${icons.arrow} http://localhost:${hostPort}`));\n console.log(colors.dim(`${\"─\".repeat(52)}`));\n console.log();\n }\n };\n\n const updateProcess = (name: string, status: ProcessStatus, message?: string) => {\n const proc = processes.get(name);\n if (!proc) return;\n\n proc.status = status;\n if (message) proc.message = message;\n\n const color = getServiceColor(name);\n const icon = getStatusIcon(status);\n const displayName = getDisplayName(name).padEnd(columnWidths.name);\n const sourceLabel = proc?.source ? ` (${proc.source})` : \"\";\n const isRemote = proc?.source === \"remote\";\n const isHost = name === \"host\";\n const showPort = proc.port > 0 && (isHost || !isRemote) && status === \"ready\";\n const statusText =\n status === \"ready\"\n ? isRemote && !isHost\n ? \"loaded\"\n : \"running\"\n : status === \"starting\"\n ? \"starting\"\n : status === \"error\"\n ? \"failed\"\n : \"waiting\";\n const portStr = showPort ? ` :${proc.port}` : \"\";\n\n write(\n `${colors.dim(`[${getTimestamp()}]`)} ${color(`[${displayName}]`)} ${status === \"ready\" ? colors.green(icon) : status === \"error\" ? colors.error(icon) : icon} ${statusText}${sourceLabel.padEnd(columnWidths.source)}${portStr}`,\n );\n\n checkAllReady();\n };\n\n const addLog = (source: string, line: string, isError = false) => {\n const lastLine = lastLogBySource.get(source);\n const nextLine = `${isError ? \"ERR\" : \"OUT\"}:${line}`;\n if (lastLine === nextLine) return;\n lastLogBySource.set(source, nextLine);\n\n const color = getServiceColor(source);\n const logColor = isError ? colors.error : colors.dim;\n write(\n `${colors.dim(`[${getTimestamp()}]`)} ${color(`[${source.toUpperCase()}]`)} ${colors.dim(\"│\")} ${logColor(linkify(line))}`,\n );\n };\n\n const unmount = () => onExit?.();\n\n return { updateProcess, addLog, unmount };\n}\n"],"mappings":";;;;;AAKA,MAAM,SAAS,MAAM,IAAI,UAAU;AACnC,MAAM,gBAAgB;AAQtB,MAAM,qBAA6B;CACjC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Ac,CAAC,GAAG,CAAC,GAAG,MAAM,IAAI,YAAY,GAAG,CAAC,IAAI,WAAW,UAAU,OAAO,MAAM,KAAK,GAAG,WAAW,UAAU,OAAO,MAAM,KAAK,GAAG,KAAK,GAAG,aAAa,YAAY,OAAO,aAAa,OAAO,GAAG,UAC1N;AAED,iBAAe;;CAGjB,MAAM,UAAU,QAAgB,MAAc,UAAU,UAAU;EAChE,MAAM,WAAW,gBAAgB,IAAI,OAAO;EAC5C,MAAM,WAAW,GAAG,UAAU,QAAQ,MAAM,GAAG;AAC/C,MAAI,aAAa,SAAU;AAC3B,kBAAgB,IAAI,QAAQ,SAAS;EAErC,MAAM,QAAQ,gBAAgB,OAAO;EACrC,MAAM,WAAW,UAAU,OAAO,QAAQ,OAAO;AACjD,QACE,GAAG,OAAO,IAAI,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,MAAM,IAAI,OAAO,aAAa,CAAC,GAAG,CAAC,IAAI,OAAO,IAAI,IAAI,CAAC,GAAG,SAAS,QAAQ,KAAK,CAAC,GAC1H;;CAGH,MAAM,gBAAgB,UAAU;AAEhC,QAAO;EAAE;EAAe;EAAQ;EAAS"}
|
|
1
|
+
{"version":3,"file":"streaming-view.mjs","names":[],"sources":["../../src/components/streaming-view.ts"],"sourcesContent":["import chalk from \"chalk\";\nimport { linkify } from \"../utils/linkify\";\nimport { colors, icons } from \"../utils/theme\";\nimport type { ProcessState, ProcessStatus } from \"./dev-view\";\n\nconst orange = chalk.hex(\"#ffaa00\");\nconst PLUGIN_PREFIX = \"plugin:\";\n\nexport interface StreamingViewHandle {\n updateProcess: (name: string, status: ProcessStatus, message?: string) => void;\n addLog: (source: string, line: string, isError?: boolean) => void;\n unmount: () => Promise<void> | void;\n}\n\nconst getTimestamp = (): string => {\n const now = new Date();\n return `${now.getHours().toString().padStart(2, \"0\")}:${now.getMinutes().toString().padStart(2, \"0\")}:${now.getSeconds().toString().padStart(2, \"0\")}`;\n};\n\nconst write = (text: string) => process.stdout.write(`${text}\\n`);\n\nconst getServiceColor = (name: string): ((s: string) => string) => {\n if (name.startsWith(PLUGIN_PREFIX)) return orange;\n if (name === \"host\") return colors.cyan;\n if (name === \"ui\" || name === \"ui-ssr\") return colors.magenta;\n if (name === \"api\") return colors.blue;\n return colors.white;\n};\n\nconst getDisplayName = (name: string): string => {\n return name.startsWith(PLUGIN_PREFIX)\n ? name.slice(PLUGIN_PREFIX.length).toUpperCase()\n : name.toUpperCase();\n};\n\nconst isPlugin = (name: string): boolean => name.startsWith(PLUGIN_PREFIX);\n\nconst getSectionedProcesses = (processes: ProcessState[]) => {\n const plugins = processes.filter((p) => isPlugin(p.name));\n const services = processes.filter((p) => !isPlugin(p.name));\n const sections: Array<{ key: string; title: string; processes: ProcessState[] }> = [];\n if (plugins.length > 0) sections.push({ key: \"plugins\", title: \"PLUGINS\", processes: plugins });\n if (services.length > 0)\n sections.push({ key: \"services\", title: \"SERVICES\", processes: services });\n return sections;\n};\n\nconst getColumnWidths = (processes: ProcessState[]) => {\n const name = Math.max(6, ...processes.map((p) => getDisplayName(p.name).length));\n const source = Math.max(10, ...processes.map((p) => (p.source ? ` (${p.source})`.length : 0)));\n return { name, source };\n};\n\nconst getStatusIcon = (status: ProcessStatus): string => {\n switch (status) {\n case \"pending\":\n return icons.pending;\n case \"starting\":\n return icons.scan;\n case \"ready\":\n return icons.ok;\n case \"error\":\n return icons.err;\n }\n};\n\nexport function renderStreamingView(\n initialProcesses: ProcessState[],\n description: string,\n env: Record<string, string>,\n onExit?: () => Promise<void> | void,\n): StreamingViewHandle {\n const processes = new Map<string, ProcessState>();\n for (const p of initialProcesses) {\n processes.set(p.name, { ...p });\n }\n\n let allReadyPrinted = false;\n const hostProcess = initialProcesses.find((p) => p.name === \"host\");\n const hostPort = hostProcess?.port || 3000;\n const proxyTarget = env.API_PROXY;\n const sectionedProcesses = getSectionedProcesses(initialProcesses);\n const columnWidths = getColumnWidths(initialProcesses);\n const lastLogBySource = new Map<string, string>();\n\n const headerLines: string[] = [\n \"\",\n colors.cyan(`${\"─\".repeat(52)}`),\n ` ${icons.run} ${colors.cyan(description.toUpperCase())}`,\n colors.cyan(`${\"─\".repeat(52)}`),\n \"\",\n ];\n\n if (proxyTarget) {\n headerLines.push(orange(` ${icons.arrow} API PROXY → ${proxyTarget}`), \"\");\n }\n\n for (const section of sectionedProcesses) {\n headerLines.push(colors.cyan(` ${section.title}`));\n for (const proc of section.processes) {\n const color = getServiceColor(proc.name);\n const sourceLabel = proc.source ? ` (${proc.source})` : \"\";\n headerLines.push(\n `${colors.dim(`[${getTimestamp()}]`)} ${color(`[${getDisplayName(proc.name).padEnd(columnWidths.name)}]`)} ${icons.pending} waiting${sourceLabel.padEnd(columnWidths.source)}`,\n );\n }\n headerLines.push(\"\");\n }\n console.log(headerLines.join(\"\\n\"));\n\n const checkAllReady = () => {\n if (allReadyPrinted) return;\n const allReady = Array.from(processes.values()).every((p) => p.status === \"ready\");\n if (allReady) {\n allReadyPrinted = true;\n const readyLines = [\n \"\",\n colors.dim(`${\"─\".repeat(52)}`),\n colors.green(`${icons.ok} All ${processes.size} services ready`),\n colors.green(`${icons.arrow} http://localhost:${hostPort}`),\n colors.dim(`${\"─\".repeat(52)}`),\n \"\",\n ];\n console.log(readyLines.join(\"\\n\"));\n }\n };\n\n const updateProcess = (name: string, status: ProcessStatus, message?: string) => {\n const proc = processes.get(name);\n if (!proc) return;\n\n proc.status = status;\n if (message) proc.message = message;\n\n const color = getServiceColor(name);\n const icon = getStatusIcon(status);\n const displayName = getDisplayName(name).padEnd(columnWidths.name);\n const sourceLabel = proc?.source ? ` (${proc.source})` : \"\";\n const isRemote = proc?.source === \"remote\";\n const isHost = name === \"host\";\n const showPort = proc.port > 0 && (isHost || !isRemote) && status === \"ready\";\n const statusText =\n status === \"ready\"\n ? isRemote && !isHost\n ? \"loaded\"\n : \"running\"\n : status === \"starting\"\n ? \"starting\"\n : status === \"error\"\n ? \"failed\"\n : \"waiting\";\n const portStr = showPort ? ` :${proc.port}` : \"\";\n\n write(\n `${colors.dim(`[${getTimestamp()}]`)} ${color(`[${displayName}]`)} ${status === \"ready\" ? colors.green(icon) : status === \"error\" ? colors.error(icon) : icon} ${statusText}${sourceLabel.padEnd(columnWidths.source)}${portStr}`,\n );\n\n checkAllReady();\n };\n\n const addLog = (source: string, line: string, isError = false) => {\n const lastLine = lastLogBySource.get(source);\n const nextLine = `${isError ? \"ERR\" : \"OUT\"}:${line}`;\n if (lastLine === nextLine) return;\n lastLogBySource.set(source, nextLine);\n\n const color = getServiceColor(source);\n const logColor = isError ? colors.error : colors.dim;\n write(\n `${colors.dim(`[${getTimestamp()}]`)} ${color(`[${source.toUpperCase()}]`)} ${colors.dim(\"│\")} ${logColor(linkify(line))}`,\n );\n };\n\n const unmount = () => onExit?.();\n\n return { updateProcess, addLog, unmount };\n}\n"],"mappings":";;;;;AAKA,MAAM,SAAS,MAAM,IAAI,UAAU;AACnC,MAAM,gBAAgB;AAQtB,MAAM,qBAA6B;CACjC,MAAM,sBAAM,IAAI,MAAM;AACtB,QAAO,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,YAAY,CAAC,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,YAAY,CAAC,UAAU,CAAC,SAAS,GAAG,IAAI;;AAGtJ,MAAM,SAAS,SAAiB,QAAQ,OAAO,MAAM,GAAG,KAAK,IAAI;AAEjE,MAAM,mBAAmB,SAA0C;AACjE,KAAI,KAAK,WAAW,cAAc,CAAE,QAAO;AAC3C,KAAI,SAAS,OAAQ,QAAO,OAAO;AACnC,KAAI,SAAS,QAAQ,SAAS,SAAU,QAAO,OAAO;AACtD,KAAI,SAAS,MAAO,QAAO,OAAO;AAClC,QAAO,OAAO;;AAGhB,MAAM,kBAAkB,SAAyB;AAC/C,QAAO,KAAK,WAAW,cAAc,GACjC,KAAK,MAAM,EAAqB,CAAC,aAAa,GAC9C,KAAK,aAAa;;AAGxB,MA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;EAAe;EAAQ;EAAS"}
|
package/dist/contract.d.cts
CHANGED
|
@@ -26,8 +26,8 @@ declare const DevOptionsSchema: z.ZodObject<{
|
|
|
26
26
|
}, z.core.$strip>;
|
|
27
27
|
declare const DevResultSchema: z.ZodObject<{
|
|
28
28
|
status: z.ZodEnum<{
|
|
29
|
-
error: "error";
|
|
30
29
|
started: "started";
|
|
30
|
+
error: "error";
|
|
31
31
|
}>;
|
|
32
32
|
description: z.ZodString;
|
|
33
33
|
processes: z.ZodArray<z.ZodString>;
|
|
@@ -200,8 +200,8 @@ declare const PublishOptionsSchema: z.ZodObject<{
|
|
|
200
200
|
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
201
201
|
packages: z.ZodDefault<z.ZodString>;
|
|
202
202
|
network: z.ZodOptional<z.ZodEnum<{
|
|
203
|
-
mainnet: "mainnet";
|
|
204
203
|
testnet: "testnet";
|
|
204
|
+
mainnet: "mainnet";
|
|
205
205
|
}>>;
|
|
206
206
|
privateKey: z.ZodOptional<z.ZodString>;
|
|
207
207
|
}, z.core.$strip>;
|
|
@@ -227,8 +227,8 @@ declare const KeyPublishResultSchema: z.ZodObject<{
|
|
|
227
227
|
}>;
|
|
228
228
|
account: z.ZodString;
|
|
229
229
|
network: z.ZodEnum<{
|
|
230
|
-
mainnet: "mainnet";
|
|
231
230
|
testnet: "testnet";
|
|
231
|
+
mainnet: "mainnet";
|
|
232
232
|
}>;
|
|
233
233
|
contract: z.ZodString;
|
|
234
234
|
allowance: z.ZodString;
|
|
@@ -358,8 +358,8 @@ declare const bosContract: {
|
|
|
358
358
|
interactive: z.ZodOptional<z.ZodBoolean>;
|
|
359
359
|
}, z.core.$strip>, z.ZodObject<{
|
|
360
360
|
status: z.ZodEnum<{
|
|
361
|
-
error: "error";
|
|
362
361
|
started: "started";
|
|
362
|
+
error: "error";
|
|
363
363
|
}>;
|
|
364
364
|
description: z.ZodString;
|
|
365
365
|
processes: z.ZodArray<z.ZodString>;
|
|
@@ -527,8 +527,8 @@ declare const bosContract: {
|
|
|
527
527
|
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
528
528
|
packages: z.ZodDefault<z.ZodString>;
|
|
529
529
|
network: z.ZodOptional<z.ZodEnum<{
|
|
530
|
-
mainnet: "mainnet";
|
|
531
530
|
testnet: "testnet";
|
|
531
|
+
mainnet: "mainnet";
|
|
532
532
|
}>>;
|
|
533
533
|
privateKey: z.ZodOptional<z.ZodString>;
|
|
534
534
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -552,8 +552,8 @@ declare const bosContract: {
|
|
|
552
552
|
}>;
|
|
553
553
|
account: z.ZodString;
|
|
554
554
|
network: z.ZodEnum<{
|
|
555
|
-
mainnet: "mainnet";
|
|
556
555
|
testnet: "testnet";
|
|
556
|
+
mainnet: "mainnet";
|
|
557
557
|
}>;
|
|
558
558
|
contract: z.ZodString;
|
|
559
559
|
allowance: z.ZodString;
|
package/dist/contract.d.mts
CHANGED
|
@@ -26,8 +26,8 @@ declare const DevOptionsSchema: z.ZodObject<{
|
|
|
26
26
|
}, z.core.$strip>;
|
|
27
27
|
declare const DevResultSchema: z.ZodObject<{
|
|
28
28
|
status: z.ZodEnum<{
|
|
29
|
-
error: "error";
|
|
30
29
|
started: "started";
|
|
30
|
+
error: "error";
|
|
31
31
|
}>;
|
|
32
32
|
description: z.ZodString;
|
|
33
33
|
processes: z.ZodArray<z.ZodString>;
|
|
@@ -200,8 +200,8 @@ declare const PublishOptionsSchema: z.ZodObject<{
|
|
|
200
200
|
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
201
201
|
packages: z.ZodDefault<z.ZodString>;
|
|
202
202
|
network: z.ZodOptional<z.ZodEnum<{
|
|
203
|
-
mainnet: "mainnet";
|
|
204
203
|
testnet: "testnet";
|
|
204
|
+
mainnet: "mainnet";
|
|
205
205
|
}>>;
|
|
206
206
|
privateKey: z.ZodOptional<z.ZodString>;
|
|
207
207
|
}, z.core.$strip>;
|
|
@@ -227,8 +227,8 @@ declare const KeyPublishResultSchema: z.ZodObject<{
|
|
|
227
227
|
}>;
|
|
228
228
|
account: z.ZodString;
|
|
229
229
|
network: z.ZodEnum<{
|
|
230
|
-
mainnet: "mainnet";
|
|
231
230
|
testnet: "testnet";
|
|
231
|
+
mainnet: "mainnet";
|
|
232
232
|
}>;
|
|
233
233
|
contract: z.ZodString;
|
|
234
234
|
allowance: z.ZodString;
|
|
@@ -358,8 +358,8 @@ declare const bosContract: {
|
|
|
358
358
|
interactive: z.ZodOptional<z.ZodBoolean>;
|
|
359
359
|
}, z.core.$strip>, z.ZodObject<{
|
|
360
360
|
status: z.ZodEnum<{
|
|
361
|
-
error: "error";
|
|
362
361
|
started: "started";
|
|
362
|
+
error: "error";
|
|
363
363
|
}>;
|
|
364
364
|
description: z.ZodString;
|
|
365
365
|
processes: z.ZodArray<z.ZodString>;
|
|
@@ -527,8 +527,8 @@ declare const bosContract: {
|
|
|
527
527
|
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
528
528
|
packages: z.ZodDefault<z.ZodString>;
|
|
529
529
|
network: z.ZodOptional<z.ZodEnum<{
|
|
530
|
-
mainnet: "mainnet";
|
|
531
530
|
testnet: "testnet";
|
|
531
|
+
mainnet: "mainnet";
|
|
532
532
|
}>>;
|
|
533
533
|
privateKey: z.ZodOptional<z.ZodString>;
|
|
534
534
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -552,8 +552,8 @@ declare const bosContract: {
|
|
|
552
552
|
}>;
|
|
553
553
|
account: z.ZodString;
|
|
554
554
|
network: z.ZodEnum<{
|
|
555
|
-
mainnet: "mainnet";
|
|
556
555
|
testnet: "testnet";
|
|
556
|
+
mainnet: "mainnet";
|
|
557
557
|
}>;
|
|
558
558
|
contract: z.ZodString;
|
|
559
559
|
allowance: z.ZodString;
|
package/dist/orchestrator.d.cts
CHANGED
|
@@ -37,7 +37,7 @@ declare const makeDevProcess: (pkg: string, callbacks: ProcessCallbacks, portOve
|
|
|
37
37
|
kill: Effect.Effect<void, never, never>;
|
|
38
38
|
waitForReady: Effect.Effect<void, Error, never>;
|
|
39
39
|
waitForExit: Effect.Effect<ExitCode, _$_effect_platform_Error0.PlatformError, never>;
|
|
40
|
-
}, string | Error | _$_effect_platform_Error0.PlatformError,
|
|
40
|
+
}, string | Error | _$_effect_platform_Error0.PlatformError, _$effect_Scope0.Scope | ServiceDescriptorMap | DevRuntimeConfig | _$_effect_platform_CommandExecutor0.CommandExecutor>;
|
|
41
41
|
declare function getProcessStates(packages: string[], services: Map<string, ServiceDescriptor>, portOverride?: number): ProcessState[];
|
|
42
42
|
//#endregion
|
|
43
43
|
export { ProcessCallbacks, ProcessHandle, ProcessState, ProcessStatus, getProcessStates, makeDevProcess };
|
package/dist/orchestrator.d.mts
CHANGED
|
@@ -37,7 +37,7 @@ declare const makeDevProcess: (pkg: string, callbacks: ProcessCallbacks, portOve
|
|
|
37
37
|
kill: Effect.Effect<void, never, never>;
|
|
38
38
|
waitForReady: Effect.Effect<void, Error, never>;
|
|
39
39
|
waitForExit: Effect.Effect<ExitCode, _$_effect_platform_Error0.PlatformError, never>;
|
|
40
|
-
}, string | Error | _$_effect_platform_Error0.PlatformError,
|
|
40
|
+
}, string | Error | _$_effect_platform_Error0.PlatformError, _$effect_Scope0.Scope | ServiceDescriptorMap | DevRuntimeConfig | _$_effect_platform_CommandExecutor0.CommandExecutor>;
|
|
41
41
|
declare function getProcessStates(packages: string[], services: Map<string, ServiceDescriptor>, portOverride?: number): ProcessState[];
|
|
42
42
|
//#endregion
|
|
43
43
|
export { ProcessCallbacks, ProcessHandle, ProcessState, ProcessStatus, getProcessStates, makeDevProcess };
|
package/dist/plugin.cjs
CHANGED
|
@@ -11,6 +11,7 @@ const require_prompts = require('./cli/prompts.cjs');
|
|
|
11
11
|
const require_status = require('./cli/status.cjs');
|
|
12
12
|
const require_sync = require('./cli/sync.cjs');
|
|
13
13
|
const require_upgrade = require('./cli/upgrade.cjs');
|
|
14
|
+
const require_theme = require('./utils/theme.cjs');
|
|
14
15
|
const require_integrity = require('./integrity.cjs');
|
|
15
16
|
const require_service_descriptor = require('./service-descriptor.cjs');
|
|
16
17
|
const require_dev_session = require('./dev-session.cjs');
|
|
@@ -69,11 +70,20 @@ function buildConfigResult(bosConfig) {
|
|
|
69
70
|
};
|
|
70
71
|
}
|
|
71
72
|
function resolveWorkspaceTarget(key, bosConfig, runtimeConfig, configDir) {
|
|
72
|
-
if (bosConfig?.app && key in bosConfig.app)
|
|
73
|
-
key
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
if (bosConfig?.app && key in bosConfig.app) {
|
|
74
|
+
const appEntry = bosConfig.app[key];
|
|
75
|
+
const devPath = require_config.resolveLocalDevelopmentPath(appEntry?.development, configDir);
|
|
76
|
+
if (devPath) return {
|
|
77
|
+
key,
|
|
78
|
+
kind: "app",
|
|
79
|
+
path: devPath
|
|
80
|
+
};
|
|
81
|
+
return {
|
|
82
|
+
key,
|
|
83
|
+
kind: "app",
|
|
84
|
+
path: `${configDir}/${key}`
|
|
85
|
+
};
|
|
86
|
+
}
|
|
77
87
|
const pluginPath = (runtimeConfig?.plugins?.[key])?.localPath ?? require_config.resolveLocalDevelopmentPath(bosConfig?.plugins?.[key]?.development, configDir);
|
|
78
88
|
if (pluginPath) return {
|
|
79
89
|
key,
|
|
@@ -597,20 +607,11 @@ var plugin_default = (0, every_plugin.createPlugin)({
|
|
|
597
607
|
plugins: remoteConfig ? await require_config.buildRuntimePluginsForConfig(config, deps.configDir, "production") : deps.runtimeConfig?.plugins
|
|
598
608
|
});
|
|
599
609
|
const productionEnv = {};
|
|
610
|
+
const warnings = [];
|
|
600
611
|
if (!process.env.CORS_ORIGIN && config.domain) {
|
|
601
612
|
const defaultOrigin = `https://${config.domain}`;
|
|
602
613
|
productionEnv.CORS_ORIGIN = defaultOrigin;
|
|
603
|
-
|
|
604
|
-
}
|
|
605
|
-
const missingSharedDeps = [];
|
|
606
|
-
if (config.shared?.plugins) for (const depName of Object.keys(config.shared.plugins)) try {
|
|
607
|
-
require.resolve(depName);
|
|
608
|
-
} catch {
|
|
609
|
-
missingSharedDeps.push(depName);
|
|
610
|
-
}
|
|
611
|
-
if (missingSharedDeps.length > 0) {
|
|
612
|
-
console.error(`[Start] Missing ${missingSharedDeps.length} shared plugin dependency(s): ${missingSharedDeps.join(", ")}`);
|
|
613
|
-
console.error(`[Start] Ensure these packages are installed in node_modules.`);
|
|
614
|
+
warnings.push(`CORS_ORIGIN defaulting to ${defaultOrigin}`);
|
|
614
615
|
}
|
|
615
616
|
const requiredSecrets = /* @__PURE__ */ new Set();
|
|
616
617
|
const missingSecrets = [];
|
|
@@ -621,10 +622,7 @@ var plugin_default = (0, every_plugin.createPlugin)({
|
|
|
621
622
|
const value = process.env[secret];
|
|
622
623
|
if (!value || value.length === 0) missingSecrets.push(secret);
|
|
623
624
|
}
|
|
624
|
-
if (missingSecrets.length > 0) {
|
|
625
|
-
console.warn(`[Start] Missing ${missingSecrets.length} required secret(s): ${missingSecrets.join(", ")}`);
|
|
626
|
-
console.warn(`[Start] Auth endpoints and database connections may fail without these secrets.`);
|
|
627
|
-
}
|
|
625
|
+
if (missingSecrets.length > 0) warnings.push(`Missing ${missingSecrets.length} secret(s): ${missingSecrets.join(", ")}`);
|
|
628
626
|
const services = require_service_descriptor.buildServiceDescriptorMap(runtimeConfig);
|
|
629
627
|
await require_api_contract.syncApiContractBridge({
|
|
630
628
|
configDir: deps.configDir,
|
|
@@ -632,6 +630,18 @@ var plugin_default = (0, every_plugin.createPlugin)({
|
|
|
632
630
|
apiBaseUrl: runtimeConfig.api.url
|
|
633
631
|
});
|
|
634
632
|
const stagingEnvVars = isStaging ? { GATEWAY_DOMAIN: config.staging?.domain ?? config.domain ?? "" } : {};
|
|
633
|
+
const configSource = remoteConfig ? `bos://${input.account}/${input.domain}` : require_config.findConfigPath() ?? "bos.config.json";
|
|
634
|
+
const configSourceHttp = remoteConfig && input.account && input.domain ? require_fastkv.buildRegistryConfigUrl(input.account, input.domain) : void 0;
|
|
635
|
+
const summaryLines = ["", ` ${require_theme.colors.dim("Config Source:")} ${configSource}`];
|
|
636
|
+
if (configSourceHttp) summaryLines.push(` ${require_theme.colors.dim(configSourceHttp)}`);
|
|
637
|
+
summaryLines.push(` ${require_theme.colors.dim("Account:")} ${config.account}`, ` ${require_theme.colors.dim("Domain:")} ${config.domain ?? "not configured"}`, "", ` ${require_theme.colors.dim("Modules:")}`, ` ${require_theme.colors.dim("HOST")} → ${runtimeConfig.host.remoteUrl ?? runtimeConfig.host.url ?? "local"}`, ` ${require_theme.colors.dim("UI")} → ${runtimeConfig.ui.url ?? "local"}`, ` ${require_theme.colors.dim("API")} → ${runtimeConfig.api.url ?? "local"}`);
|
|
638
|
+
if (runtimeConfig.auth) summaryLines.push(` ${require_theme.colors.dim("AUTH")} → ${runtimeConfig.auth.url ?? "local"}`);
|
|
639
|
+
if (warnings.length > 0) {
|
|
640
|
+
summaryLines.push("");
|
|
641
|
+
for (const w of warnings) summaryLines.push(` ${require_theme.colors.yellow(w)}`);
|
|
642
|
+
}
|
|
643
|
+
summaryLines.push("");
|
|
644
|
+
console.log(summaryLines.join("\n"));
|
|
635
645
|
require_dev_session.startApp({
|
|
636
646
|
packages: ["host"],
|
|
637
647
|
env: {
|