Skip to content

Commit 710c05e

Browse files
committed
fix pm2 passthrough types
1 parent b682e10 commit 710c05e

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

.changeset/unlucky-seas-switch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@bluecadet/launchpad-monitor": patch
3+
---
4+
5+
fix monitor pm2 passthrough types

packages/monitor/src/monitor-config.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type pm2 from "pm2";
21
import { z } from "zod";
3-
import { type MonitorPlugin, monitorPluginSchema } from "./core/monitor-plugin-driver.js";
2+
import { monitorPluginSchema } from "./core/monitor-plugin-driver.js";
3+
import type { StartOptions } from "pm2";
44

55
const windowsApiConfigSchema = z.object({
66
/**
@@ -101,14 +101,16 @@ export type AppLogConfig = z.infer<typeof appLogConfigSchema>;
101101
const appConfigSchema = z.object({
102102
/** pm2 configuration for this app. see https://pm2.keymetrics.io/docs/usage/application-declaration/#attributes-available */
103103
pm2: z
104-
.object({
105-
out_file: z.string().optional().describe("The file to write stdout to."),
106-
error_file: z.string().optional().describe("The file to write stderr to."),
107-
})
108-
.passthrough()
104+
.custom<StartOptions>()
105+
.and(
106+
z.object({
107+
out_file: z.string().optional().describe("The file to write stdout to."),
108+
error_file: z.string().optional().describe("The file to write stderr to."),
109+
}),
110+
)
109111
.describe(
110112
"pm2 configuration for this app. see https://pm2.keymetrics.io/docs/usage/application-declaration/#attributes-available",
111-
) as z.ZodType<pm2.StartOptions & { out_file?: string; error_file?: string }>,
113+
),
112114
/** Optional settings for moving this app's main windows to the foreground, minimize or hide them. */
113115
windows: windowConfigSchema
114116
.describe(

0 commit comments

Comments
 (0)