@gachlab/devup 0.10.0 → 0.10.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.
@@ -28,6 +28,10 @@ export interface ProxyInfo {
28
28
  tls: boolean;
29
29
  routes: Record<string, string>;
30
30
  }
31
+ export interface ProjectInfo {
32
+ project: string;
33
+ profiles: Record<string, string[]>;
34
+ }
31
35
  export interface RpcContext {
32
36
  /** State of every service (read-only snapshot). */
33
37
  states(): Map<string, ProcessState>;
@@ -46,6 +50,8 @@ export interface RpcContext {
46
50
  getStats(): Promise<StatsResult>;
47
51
  /** Active proxy configuration, or null when no proxy is running. */
48
52
  getProxyInfo(): ProxyInfo | null;
53
+ /** Project metadata: name and profiles defined in config. */
54
+ getInfo(): ProjectInfo;
49
55
  }
50
56
  export interface SocketServerHandle {
51
57
  server: Server;
@@ -1 +1 @@
1
- {"version":3,"file":"socket-server.d.ts","sourceRoot":"","sources":["../../src/control-plane/socket-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAe,MAAM,UAAU,CAAC;AAMlE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;;;;;;oBAQoB;AAEpB,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC3C,MAAM,EAAE;QACN,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,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AAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5D;2CACuC;IACvC,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAC3F,2EAA2E;IAC3E,WAAW,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAC/E,iDAAiD;IACjD,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IACjC,oEAAoE;IACpE,YAAY,IAAI,SAAS,GAAG,IAAI,CAAC;IACjC,6DAA6D;IAC7D,OAAO,IAAI,WAAW,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAG7D;AAED,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,UAAU,EACf,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;CAAO,GAC1D,OAAO,CAAC,kBAAkB,CAAC,CA+C7B"}
package/dist/index.js CHANGED
@@ -831,6 +831,7 @@ function serializeState(name, st) {
831
831
  health: st.health,
832
832
  port: st.svc.port,
833
833
  type: st.svc.type,
834
+ phase: st.svc.phase,
834
835
  errors: st.errors,
835
836
  restarts: st.restarts,
836
837
  pid: st.pid,
@@ -851,6 +852,8 @@ async function dispatch(method, params, ctx) {
851
852
  }
852
853
  case "stats":
853
854
  return await ctx.getStats();
855
+ case "info":
856
+ return ctx.getInfo();
854
857
  case "restart": {
855
858
  const svc = stringOrThrow(params["svc"] ?? params["service"], "svc");
856
859
  await ctx.restart(svc);
@@ -2027,6 +2030,9 @@ async function daemonBody(opts) {
2027
2030
  tls: proxyOpts.tls,
2028
2031
  routes: proxyOpts.routes
2029
2032
  };
2033
+ },
2034
+ getInfo() {
2035
+ return { project: projectName, profiles: config.profiles ?? {} };
2030
2036
  }
2031
2037
  }, { onLog: (msg) => writeDevupLog(msg) });
2032
2038
  healthTimer = setInterval(() => {
@@ -3147,7 +3153,7 @@ import { useEffect as useEffect5, useRef as useRef3 } from "react";
3147
3153
  import { createInterface as createInterface5 } from "readline";
3148
3154
  import { createReadStream as createReadStream3, existsSync as existsSync15 } from "fs";
3149
3155
  import { totalmem as totalmem2, freemem as freemem2, cpus as cpus2 } from "os";
3150
- function useControlPlane(manager, projectName, logSink, pushLog, logBus, stateBus, platform, proxy) {
3156
+ function useControlPlane(manager, projectName, logSink, pushLog, logBus, stateBus, platform, proxy, profiles) {
3151
3157
  const handleRef = useRef3(null);
3152
3158
  const prevCpuMap = useRef3(/* @__PURE__ */ new Map());
3153
3159
  useEffect5(() => {
@@ -3222,6 +3228,9 @@ function useControlPlane(manager, projectName, logSink, pushLog, logBus, stateBu
3222
3228
  tls: proxy.opts.tls,
3223
3229
  routes: proxy.opts.routes
3224
3230
  };
3231
+ },
3232
+ getInfo() {
3233
+ return { project: projectName, profiles };
3225
3234
  }
3226
3235
  }, { onLog: (msg) => pushLog("devup", msg, 12) });
3227
3236
  handleRef.current = handle;
@@ -3233,7 +3242,7 @@ function useControlPlane(manager, projectName, logSink, pushLog, logBus, stateBu
3233
3242
  void handle?.close();
3234
3243
  handleRef.current = null;
3235
3244
  };
3236
- }, [manager, projectName, logSink, pushLog, logBus, stateBus, platform, proxy]);
3245
+ }, [manager, projectName, logSink, pushLog, logBus, stateBus, platform, proxy, profiles]);
3237
3246
  return handleRef;
3238
3247
  }
3239
3248
 
@@ -3842,7 +3851,7 @@ function App({ config, services, cliArgs, platform, env, baseCwd, proxyProvider,
3842
3851
  }
3843
3852
  });
3844
3853
  const proxyCtx = proxyProvider && proxyOpts ? { provider: proxyProvider, opts: proxyOpts } : null;
3845
- const socketServer = useControlPlane(pm.manager, config.name, logSink, pm.pushLog, pm.logBus, pm.stateBus, platform, proxyCtx);
3854
+ const socketServer = useControlPlane(pm.manager, config.name, logSink, pm.pushLog, pm.logBus, pm.stateBus, platform, proxyCtx, config.profiles ?? {});
3846
3855
  const shutdown = useCallback3(async () => {
3847
3856
  lazyProxies.current.forEach((p) => p.destroy());
3848
3857
  await socketServer.current?.close();