@omercnet/paseo-omp 2.0.0-next.245.1 → 2.0.0-next.248.1
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/package.json +1 -1
- package/server/hub.ts +18 -9
- package/server/package-version.ts +1 -1
package/package.json
CHANGED
package/server/hub.ts
CHANGED
|
@@ -8,6 +8,13 @@ import type { HubProcess, listHubProcesses, tailHubLog } from "../shared/hub";
|
|
|
8
8
|
const MAX_LOG_BYTES = 64 * 1024;
|
|
9
9
|
|
|
10
10
|
const ScopeFileSchema = z.object({ projectDir: z.string() });
|
|
11
|
+
// omp 18.8 moved the spec from meta.json to a sibling spec.json; older releases embed it in meta.json.
|
|
12
|
+
const SpecSchema = z.object({
|
|
13
|
+
application: z.string(),
|
|
14
|
+
args: z.array(z.string()).optional(),
|
|
15
|
+
cwd: z.string().optional(),
|
|
16
|
+
});
|
|
17
|
+
|
|
11
18
|
const MetaFileSchema = z.object({
|
|
12
19
|
daemon: z.object({
|
|
13
20
|
state: z.string(),
|
|
@@ -21,11 +28,7 @@ const MetaFileSchema = z.object({
|
|
|
21
28
|
exitedAt: z.number().optional(),
|
|
22
29
|
exitCode: z.number().optional(),
|
|
23
30
|
}),
|
|
24
|
-
spec:
|
|
25
|
-
application: z.string(),
|
|
26
|
-
args: z.array(z.string()).optional(),
|
|
27
|
-
cwd: z.string().optional(),
|
|
28
|
-
}),
|
|
31
|
+
spec: SpecSchema.optional(),
|
|
29
32
|
});
|
|
30
33
|
|
|
31
34
|
/**
|
|
@@ -71,10 +74,12 @@ async function findProjectDaemonRoots(root: string, cwd: string): Promise<string
|
|
|
71
74
|
return matches;
|
|
72
75
|
}
|
|
73
76
|
|
|
74
|
-
function toHubProcess(name: string, value: unknown): HubProcess | undefined {
|
|
77
|
+
function toHubProcess(name: string, value: unknown, specFile: unknown): HubProcess | undefined {
|
|
75
78
|
const parsed = MetaFileSchema.safeParse(value);
|
|
76
79
|
if (!parsed.success) return undefined;
|
|
77
|
-
const { daemon
|
|
80
|
+
const { daemon } = parsed.data;
|
|
81
|
+
const spec = parsed.data.spec ?? SpecSchema.safeParse(specFile).data;
|
|
82
|
+
if (!spec) return undefined;
|
|
78
83
|
return {
|
|
79
84
|
name,
|
|
80
85
|
application: spec.application,
|
|
@@ -101,8 +106,12 @@ export async function listHubProcessesFrom(root: string, cwd: string): Promise<H
|
|
|
101
106
|
const names = await listDirNames(join(projectRoot, "daemons"));
|
|
102
107
|
await Promise.all(
|
|
103
108
|
names.map(async (name) => {
|
|
104
|
-
const
|
|
105
|
-
const
|
|
109
|
+
const dir = join(projectRoot, "daemons", name);
|
|
110
|
+
const [meta, spec] = await Promise.all([
|
|
111
|
+
readJsonFile(join(dir, "meta.json")),
|
|
112
|
+
readJsonFile(join(dir, "spec.json")),
|
|
113
|
+
]);
|
|
114
|
+
const process = toHubProcess(name, meta, spec);
|
|
106
115
|
if (process) processes.push(process);
|
|
107
116
|
}),
|
|
108
117
|
);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Release Please keeps this bundle-safe constant aligned with package.json. */
|
|
2
|
-
export const PASEO_OMP_PACKAGE_VERSION = "2.0.0-next.
|
|
2
|
+
export const PASEO_OMP_PACKAGE_VERSION = "2.0.0-next.248.1"; // x-release-please-version
|