@zeltjs/adapter-node 0.9.1-canary.2 → 0.9.1-canary.3

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/index.cjs CHANGED
@@ -45,13 +45,16 @@ var ProcessEnvAdaptor = class extends _zeltjs_core.EnvAdaptor {
45
45
  ProcessEnvAdaptor = _ts_decorate([_zeltjs_core.Config], ProcessEnvAdaptor);
46
46
  //#endregion
47
47
  //#region src/on-node.ts
48
- const createListenForHttp = (appFetch, appShutdown) => {
48
+ const closeServer = (server) => new Promise((resolve, reject) => {
49
+ server.close((err) => err ? reject(err) : resolve());
50
+ });
51
+ const createListenForHttp = (appFetch, registerShutdown) => {
49
52
  return async (portOrOptions) => {
50
53
  const listenOptions = typeof portOrOptions === "number" ? { port: portOrOptions } : portOrOptions ?? {};
51
54
  const port = listenOptions.port ?? 3e3;
52
55
  const hostname = listenOptions.hostname ?? "0.0.0.0";
53
56
  let server;
54
- const address = await new Promise((resolve) => {
57
+ const serverReady = new Promise((resolve) => {
55
58
  server = (0, _hono_node_server.serve)({
56
59
  fetch: appFetch,
57
60
  port,
@@ -61,31 +64,29 @@ const createListenForHttp = (appFetch, appShutdown) => {
61
64
  address: info.address
62
65
  }));
63
66
  });
64
- const shutdown = async () => {
65
- await new Promise((resolve, reject) => {
66
- server.close((err) => err ? reject(err) : resolve());
67
- });
68
- await appShutdown();
69
- };
67
+ const shutdown = registerShutdown(() => closeServer(server));
70
68
  return {
71
- address,
69
+ address: await serverReady,
72
70
  shutdown
73
71
  };
74
72
  };
75
73
  };
76
74
  const getArgs = () => globalThis.process.argv.slice(2);
77
75
  const createNodeApp = (readyApp, shutdown, args) => {
78
- const base = {
76
+ const nodeApp = {
79
77
  ...readyApp,
80
78
  args,
81
79
  shutdown
82
80
  };
83
- const httpCaps = readyApp.getFeatureCapabilities(_zeltjs_core.HttpFeature);
84
- if (!httpCaps) return base;
85
- return {
86
- ...base,
87
- listen: createListenForHttp(httpCaps.fetch, shutdown)
88
- };
81
+ for (const entry of readyApp.getFeatureEntries(_zeltjs_core.HttpFeature)) Object.defineProperty(nodeApp, entry.key, {
82
+ value: {
83
+ ...entry.capabilities,
84
+ listen: createListenForHttp(entry.capabilities.fetch, (callback) => entry.feature.registerShutdown(callback))
85
+ },
86
+ configurable: true,
87
+ enumerable: true
88
+ });
89
+ return nodeApp;
89
90
  };
90
91
  /** @throws {ZeltLifecycleStateError} */ async function onNode(app, options = {}) {
91
92
  const readyApp = await app.createRuntime({
@@ -93,7 +94,6 @@ const createNodeApp = (readyApp, shutdown, args) => {
93
94
  warmup: options.warmup ?? true
94
95
  });
95
96
  const cliConfig = await readyApp.get(NodeCliConfig);
96
- const runtimeShutdown = readyApp.shutdown;
97
97
  let shuttingDown = false;
98
98
  const detachSignals = () => {
99
99
  cliConfig.offSignal("SIGINT", gracefulShutdown);
@@ -103,7 +103,7 @@ const createNodeApp = (readyApp, shutdown, args) => {
103
103
  if (shuttingDown) return;
104
104
  shuttingDown = true;
105
105
  try {
106
- await runtimeShutdown();
106
+ await readyApp.shutdown();
107
107
  } finally {
108
108
  detachSignals();
109
109
  }
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ServerType, createAdaptorServer } from "@hono/node-server";
2
- import { CliConfig, ConfiguredFeature, EnvAdaptor, FeatureApp, HttpFeature, RuntimeApp, Signal, SignalHandler } from "@zeltjs/core";
2
+ import { CliConfig, ConfiguredFeature, EnvAdaptor, FeatureApp, FeatureReadyCapabilities, HttpFeature, RuntimeApp, Signal, SignalHandler } from "@zeltjs/core";
3
3
 
4
4
  //#region src/node-cli.config.d.ts
5
5
  declare class NodeCliConfig extends CliConfig {
@@ -33,9 +33,9 @@ type EnvironmentNodeAppPart = {
33
33
  type HttpNodeAppPart = {
34
34
  readonly listen: (portOrOptions?: number | ListenOptions) => Promise<ServerHandle>;
35
35
  };
36
- type HasFeatureClass<F extends readonly ConfiguredFeature[], TFeature extends ConfiguredFeature> = Extract<F[number], TFeature> extends never ? false : true;
37
- type WithFeatureClass<F extends readonly ConfiguredFeature[], TFeature extends ConfiguredFeature, TPart extends object> = HasFeatureClass<F, TFeature> extends true ? TPart : unknown;
38
- type NodeAppForFeatures<F extends readonly ConfiguredFeature[]> = RuntimeApp<F> & EnvironmentNodeAppPart & (number extends F['length'] ? Partial<HttpNodeAppPart> : WithFeatureClass<F, HttpFeature, HttpNodeAppPart>);
36
+ type NodeFeatureCapabilities<TFeature extends ConfiguredFeature> = FeatureReadyCapabilities<TFeature> & (TFeature extends HttpFeature<string> ? HttpNodeAppPart : unknown);
37
+ type NodeNamespacedCapabilities<F extends readonly ConfiguredFeature[]> = { readonly [TFeature in F[number] as TFeature['key']]: NodeFeatureCapabilities<TFeature> };
38
+ type NodeAppForFeatures<F extends readonly ConfiguredFeature[]> = RuntimeApp<F> & EnvironmentNodeAppPart & NodeNamespacedCapabilities<F>;
39
39
  declare function onNode<const F extends readonly ConfiguredFeature[]>(app: FeatureApp<F>, options?: NodeAppOptions): Promise<NodeAppForFeatures<F>>;
40
40
  //#endregion
41
41
  //#region src/process-env.adaptor.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/node-cli.config.ts","../src/on-node.ts","../src/process-env.adaptor.ts","../src/serve.lib.ts"],"mappings":";;;;cAIa,aAAA,SAAsB,SAAA;EACxB,GAAA,CAAA;EAIA,IAAA,CAAA;EAIA,IAAA,CAAK,IAAA;EAIL,WAAA,CAAY,IAAA;EAIZ,QAAA,CAAS,MAAA,EAAQ,MAAA,EAAQ,OAAA,EAAS,aAAA;EAIlC,SAAA,CAAU,MAAA,EAAQ,MAAA,EAAQ,OAAA,EAAS,aAAA;AAAA;;;KCjBzC,aAAA;EAAA,SACM,IAAA;EAAA,SACA,QAAA;AAAA;AAAA,KAGC,YAAA;EAAA,SACD,OAAA;IAAW,IAAA;IAAc,OAAA;EAAA;EAAA,SACzB,QAAA,QAAgB,OAAA;AAAA;AAAA,K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;AAAA,cAa1B,QAAA,GACX,GAAA,EAAK,OAAA,EACL,iBAAA,GAAoB,YAAA,KAAiB,IAAA,EAAM,WAAA,YAC3C,aAAA,IAAiB,IAAA,EAAM,WAAA,cACtB,UAAA"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ServerType, createAdaptorServer } from "@hono/node-server";
2
- import { CliConfig, ConfiguredFeature, EnvAdaptor, FeatureApp, HttpFeature, RuntimeApp, Signal, SignalHandler } from "@zeltjs/core";
2
+ import { CliConfig, ConfiguredFeature, EnvAdaptor, FeatureApp, FeatureReadyCapabilities, HttpFeature, RuntimeApp, Signal, SignalHandler } from "@zeltjs/core";
3
3
 
4
4
  //#region src/node-cli.config.d.ts
5
5
  declare class NodeCliConfig extends CliConfig {
@@ -33,9 +33,9 @@ type EnvironmentNodeAppPart = {
33
33
  type HttpNodeAppPart = {
34
34
  readonly listen: (portOrOptions?: number | ListenOptions) => Promise<ServerHandle>;
35
35
  };
36
- type HasFeatureClass<F extends readonly ConfiguredFeature[], TFeature extends ConfiguredFeature> = Extract<F[number], TFeature> extends never ? false : true;
37
- type WithFeatureClass<F extends readonly ConfiguredFeature[], TFeature extends ConfiguredFeature, TPart extends object> = HasFeatureClass<F, TFeature> extends true ? TPart : unknown;
38
- type NodeAppForFeatures<F extends readonly ConfiguredFeature[]> = RuntimeApp<F> & EnvironmentNodeAppPart & (number extends F['length'] ? Partial<HttpNodeAppPart> : WithFeatureClass<F, HttpFeature, HttpNodeAppPart>);
36
+ type NodeFeatureCapabilities<TFeature1 extends ConfiguredFeature> = FeatureReadyCapabilities<TFeature1> & (TFeature1 extends HttpFeature<string> ? HttpNodeAppPart : unknown);
37
+ type NodeNamespacedCapabilities<F extends readonly ConfiguredFeature[]> = { readonly [TFeature in F[number] as TFeature['key']]: NodeFeatureCapabilities<TFeature> };
38
+ type NodeAppForFeatures<F extends readonly ConfiguredFeature[]> = RuntimeApp<F> & EnvironmentNodeAppPart & NodeNamespacedCapabilities<F>;
39
39
  declare function onNode<const F extends readonly ConfiguredFeature[]>(app: FeatureApp<F>, options?: NodeAppOptions): Promise<NodeAppForFeatures<F>>;
40
40
  //#endregion
41
41
  //#region src/process-env.adaptor.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/node-cli.config.ts","../src/on-node.ts","../src/process-env.adaptor.ts","../src/serve.lib.ts"],"mappings":";;;;cAIa,aAAA,SAAsB,SAAA;EACxB,GAAA,CAAA;EAIA,IAAA,CAAA;EAIA,IAAA,CAAK,IAAA;EAIL,WAAA,CAAY,IAAA;EAIZ,QAAA,CAAS,MAAA,EAAQ,MAAA,EAAQ,OAAA,EAAS,aAAA;EAIlC,SAAA,CAAU,MAAA,EAAQ,MAAA,EAAQ,OAAA,EAAS,aAAA;AAAA;;;KCjBzC,aAAA;EAAA,SACM,IAAA;EAAA,SACA,QAAA;AAAA;AAAA,KAGC,YAAA;EAAA,SACD,OAAA;IAAW,IAAA;IAAc,OAAA;EAAA;EAAA,SACzB,QAAA,QAAgB,OAAA;AAAA;AAAA,KAGf,cAAA;EAAA,SACD,MAAA;AAAA;AAAA,KAKN,sBAAA;EAAA,SACM,IAAA;EAAA,SACA,QAAA,QAAgB,OAAA;AAAA;AAAA,KAGtB,eAAA;EAAA,SACM,MAAA,GAAS,aAAA,YAAyB,aAAA,KAAkB,OAAA,CAAQ,YAAA;AAAA;AAAA,KAMlE,eAAA,oBAAmC,iBAAA,qBAAsC,iBAAA,IAC5E,OAAA,CAAQ,CAAA,UAAW,QAAA;AAAA,KAEhB,gBAAA,oBACgB,iBAAA,qBACF,iBAAA,0BAEf,eAAA,CAAgB,CAAA,EAAG,QAAA,iBAAyB,KAAA;AAAA,KAE3C,kBAAA,oBAAsC,iBAAA,MAAuB,UAAA,CAAW,CAAA,IAC3E,sBAAA,mBACgB,CAAA,aACZ,OAAA,CAAQ,eAAA,IACR,gBAAA,CAAiB,CAAA,EAAG,WAAA,EAAa,eAAA;AAAA,i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;AAAA,KAGlE,uBAAA,mBAAyC,iBAAA,IAC5C,wBAAA,CAAyB,SAAA,KACtB,SAAA,SAAiB,WAAA,WAAsB,eAAA;AAAA,KAEvC,0BAAA,oBAA8C,iBAAA,8BAC3B,CAAA,YAAa,QAAA,UAAkB,uBAAA,CAAwB,QAAA;AAAA,KAK1E,kBAAA,oBAAsC,iBAAA,MAAuB,UAAA,CAAW,CAAA,IAC3E,sBAAA,GACA,0BAAA,CAA2B,CAAA;AAAA,iBA+Db,MAAA,0BAAgC,iBAAA,GAAA,CAC9C,GAAA,EAAK,UAAA,CAAW,CAAA,GAChB,OAAA,GAAU,cAAA,GACT,OAAA,CAAQ,kBAAA,CAAmB,CAAA;;;cCjHjB,iBAAA,SAA0B,UAAA;EAC5B,GAAA,CAAI,GAAA;AAAA;;;KCDH,YAAA;EACV,IAAA;EACA,QAAA;AAAA;AAAA,KAGU,WAAA;EACV,IAAA;EACA,OAAA;AAAA;AAAA,KAGG,OAAA;EACH,KAAA,GAAQ,OAAA,EAAS,OAAA,KAAY,OAAA,CAAQ,QAAA;AAAA;AAAA,cAa1B,QAAA,GACX,GAAA,EAAK,OAAA,EACL,iBAAA,GAAoB,YAAA,KAAiB,IAAA,EAAM,WAAA,YAC3C,aAAA,IAAiB,IAAA,EAAM,WAAA,cACtB,UAAA"}
package/dist/index.js CHANGED
@@ -44,13 +44,16 @@ var ProcessEnvAdaptor = class extends EnvAdaptor {
44
44
  ProcessEnvAdaptor = _ts_decorate([Config], ProcessEnvAdaptor);
45
45
  //#endregion
46
46
  //#region src/on-node.ts
47
- const createListenForHttp = (appFetch, appShutdown) => {
47
+ const closeServer = (server) => new Promise((resolve, reject) => {
48
+ server.close((err) => err ? reject(err) : resolve());
49
+ });
50
+ const createListenForHttp = (appFetch, registerShutdown) => {
48
51
  return async (portOrOptions) => {
49
52
  const listenOptions = typeof portOrOptions === "number" ? { port: portOrOptions } : portOrOptions ?? {};
50
53
  const port = listenOptions.port ?? 3e3;
51
54
  const hostname = listenOptions.hostname ?? "0.0.0.0";
52
55
  let server;
53
- const address = await new Promise((resolve) => {
56
+ const serverReady = new Promise((resolve) => {
54
57
  server = serve({
55
58
  fetch: appFetch,
56
59
  port,
@@ -60,31 +63,29 @@ const createListenForHttp = (appFetch, appShutdown) => {
60
63
  address: info.address
61
64
  }));
62
65
  });
63
- const shutdown = async () => {
64
- await new Promise((resolve, reject) => {
65
- server.close((err) => err ? reject(err) : resolve());
66
- });
67
- await appShutdown();
68
- };
66
+ const shutdown = registerShutdown(() => closeServer(server));
69
67
  return {
70
- address,
68
+ address: await serverReady,
71
69
  shutdown
72
70
  };
73
71
  };
74
72
  };
75
73
  const getArgs = () => globalThis.process.argv.slice(2);
76
74
  const createNodeApp = (readyApp, shutdown, args) => {
77
- const base = {
75
+ const nodeApp = {
78
76
  ...readyApp,
79
77
  args,
80
78
  shutdown
81
79
  };
82
- const httpCaps = readyApp.getFeatureCapabilities(HttpFeature);
83
- if (!httpCaps) return base;
84
- return {
85
- ...base,
86
- listen: createListenForHttp(httpCaps.fetch, shutdown)
87
- };
80
+ for (const entry of readyApp.getFeatureEntries(HttpFeature)) Object.defineProperty(nodeApp, entry.key, {
81
+ value: {
82
+ ...entry.capabilities,
83
+ listen: createListenForHttp(entry.capabilities.fetch, (callback) => entry.feature.registerShutdown(callback))
84
+ },
85
+ configurable: true,
86
+ enumerable: true
87
+ });
88
+ return nodeApp;
88
89
  };
89
90
  /** @throws {ZeltLifecycleStateError} */ async function onNode(app, options = {}) {
90
91
  const readyApp = await app.createRuntime({
@@ -92,7 +93,6 @@ const createNodeApp = (readyApp, shutdown, args) => {
92
93
  warmup: options.warmup ?? true
93
94
  });
94
95
  const cliConfig = await readyApp.get(NodeCliConfig);
95
- const runtimeShutdown = readyApp.shutdown;
96
96
  let shuttingDown = false;
97
97
  const detachSignals = () => {
98
98
  cliConfig.offSignal("SIGINT", gracefulShutdown);
@@ -102,7 +102,7 @@ const createNodeApp = (readyApp, shutdown, args) => {
102
102
  if (shuttingDown) return;
103
103
  shuttingDown = true;
104
104
  try {
105
- await runtimeShutdown();
105
+ await readyApp.shutdown();
106
106
  } finally {
107
107
  detachSignals();
108
108
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["CliConfig","Config","NodeCliConfig","cwd","process","argv","exit","code","setExitCode","exitCode","onSignal","signal","handler","on","offSignal","off","Config","EnvAdaptor","ProcessEnvAdaptor","get","key","process","env","serve","HttpFeature","NodeCliConfig","ProcessEnvAdaptor","createListenForHttp","appFetch","appShutdown","portOrOptions","listenOptions","port","hostname","server","serverReady","Promise","resolve","fetch","info","address","shutdown","reject","close","err","getArgs","globalThis","process","argv","slice","createNodeApp","readyApp","args","base","httpCaps","getFeatureCapabilities","listen","onNode","app","options","createRuntime","fallbackConfigs","warmup","cliConfig","get","runtimeShutdown","shuttingDown","detachSignals","offSignal","gracefulShutdown","catch","onSignal","serve","buildServeOptions","optionsOrCallback","extractCallback","maybeCallback","serveApp","app","options","callback","fetch","port","hostname"],"sources":["../src/node-cli.config.ts","../src/process-env.adaptor.ts","../src/on-node.ts","../src/serve.lib.ts"],"sourcesContent":["import type { Signal, SignalHandler } from '@zeltjs/core';\nimport { CliConfig, Config } from '@zeltjs/core';\n\n@Config\nexport class NodeCliConfig extends CliConfig {\n override cwd(): string {\n return process.cwd();\n }\n\n override argv(): readonly string[] {\n return process.argv;\n }\n\n override exit(code: number): never {\n process.exit(code);\n }\n\n override setExitCode(code: number): void {\n process.exitCode = code;\n }\n\n override onSignal(signal: Signal, handler: SignalHandler): void {\n process.on(signal, handler);\n }\n\n override offSignal(signal: Signal, handler: SignalHandler): void {\n process.off(signal, handler);\n }\n}\n","import { Config, EnvAdaptor } from '@zeltjs/core';\n\n@Config\nexport class ProcessEnvAdaptor extends EnvAdaptor {\n override get(key: string): string | undefined {\n return process.env[key];\n }\n}\n","import type { ServerType } from '@hono/node-server';\nimport { serve } from '@hono/node-server';\nimport type { ConfiguredFeature, FeatureApp, RuntimeApp } from '@zeltjs/core';\nimport { HttpFeature } from '@zeltjs/core';\n\nimport { NodeCliConfig } from './node-cli.config';\nimport { ProcessEnvAdaptor } from './process-env.adaptor';\n\ntype ListenOptions = {\n readonly port?: number;\n readonly hostname?: string;\n};\n\nexport type ServerHandle = {\n readonly address: { port: number; address: string };\n readonly shutdown: () => Promise<void>;\n};\n\nexport type NodeAppOptions = {\n readonly warmup?: boolean;\n};\n\nexport type { ExecResult } from '@zeltjs/core';\n\ntype EnvironmentNodeAppPart = {\n readonly args: readonly string[];\n readonly shutdown: () => Promise<void>;\n};\n\ntype HttpNodeAppPart = {\n readonly listen: (portOrOptions?: number | ListenOptions) => Promise<ServerHandle>;\n};\n\nexport type NodeApp = (RuntimeApp<readonly ConfiguredFeature[]> & EnvironmentNodeAppPart) &\n Partial<HttpNodeAppPart>;\n\ntype HasFeatureClass<F extends readonly ConfiguredFeature[], TFeature extends ConfiguredFeature> =\n Extract<F[number], TFeature> extends never ? false : true;\n\ntype WithFeatureClass<\n F extends readonly ConfiguredFeature[],\n TFeature extends ConfiguredFeature,\n TPart extends object,\n> = HasFeatureClass<F, TFeature> extends true ? TPart : unknown;\n\ntype NodeAppForFeatures<F extends readonly ConfiguredFeature[]> = RuntimeApp<F> &\n EnvironmentNodeAppPart &\n (number extends F['length']\n ? Partial<HttpNodeAppPart>\n : WithFeatureClass<F, HttpFeature, HttpNodeAppPart>);\n\nconst createListenForHttp = (\n appFetch: (request: Request) => Promise<Response>,\n appShutdown: () => Promise<void>,\n): ((portOrOptions?: number | ListenOptions) => Promise<ServerHandle>) => {\n return async (portOrOptions?: number | ListenOptions): Promise<ServerHandle> => {\n const listenOptions: ListenOptions =\n typeof portOrOptions === 'number' ? { port: portOrOptions } : (portOrOptions ?? {});\n\n const port = listenOptions.port ?? 3000;\n const hostname = listenOptions.hostname ?? '0.0.0.0';\n\n let server!: ServerType;\n const serverReady = new Promise<{ port: number; address: string }>((resolve) => {\n server = serve({ fetch: appFetch, port, hostname }, (info) =>\n resolve({ port: info.port, address: info.address }),\n );\n });\n\n const address = await serverReady;\n\n const shutdown = async (): Promise<void> => {\n await new Promise<void>((resolve, reject) => {\n server.close((err) => (err ? reject(err) : resolve()));\n });\n await appShutdown();\n };\n\n return { address, shutdown };\n };\n};\n\nconst getArgs = (): readonly string[] => globalThis.process.argv.slice(2);\n\nconst createNodeApp = (\n readyApp: RuntimeApp<readonly ConfiguredFeature[]>,\n shutdown: () => Promise<void>,\n args: readonly string[],\n): NodeApp => {\n const base: RuntimeApp<readonly ConfiguredFeature[]> & EnvironmentNodeAppPart = {\n ...readyApp,\n args,\n shutdown,\n };\n\n const httpCaps = readyApp.getFeatureCapabilities(HttpFeature);\n if (!httpCaps) return base;\n return {\n ...base,\n listen: createListenForHttp(httpCaps.fetch, shutdown),\n };\n};\n\nexport function onNode<const F extends readonly ConfiguredFeature[]>(\n app: FeatureApp<F>,\n options?: NodeAppOptions,\n): Promise<NodeAppForFeatures<F>>;\n\n/** @throws {ZeltLifecycleStateError} */\nexport async function onNode<const F extends readonly ConfiguredFeature[]>(\n app: FeatureApp<F>,\n options: NodeAppOptions = {},\n): Promise<NodeApp> {\n const readyApp = await app.createRuntime({\n fallbackConfigs: [NodeCliConfig, ProcessEnvAdaptor],\n warmup: options.warmup ?? true,\n });\n\n const cliConfig = await readyApp.get(NodeCliConfig);\n const runtimeShutdown = readyApp.shutdown;\n\n let shuttingDown = false;\n const detachSignals = (): void => {\n cliConfig.offSignal('SIGINT', gracefulShutdown);\n cliConfig.offSignal('SIGTERM', gracefulShutdown);\n };\n\n const shutdown = async (): Promise<void> => {\n if (shuttingDown) return;\n shuttingDown = true;\n try {\n await runtimeShutdown();\n } finally {\n detachSignals();\n }\n };\n\n const gracefulShutdown = (): void => {\n void shutdown().catch(() => {});\n };\n\n cliConfig.onSignal('SIGINT', gracefulShutdown);\n cliConfig.onSignal('SIGTERM', gracefulShutdown);\n\n const args = getArgs();\n\n return createNodeApp(readyApp, shutdown, args);\n}\n","import type { ServerType } from '@hono/node-server';\nimport { serve } from '@hono/node-server';\n\nexport type ServeOptions = {\n port?: number;\n hostname?: string;\n};\n\nexport type AddressInfo = {\n port: number;\n address: string;\n};\n\ntype AppLike = {\n fetch: (request: Request) => Promise<Response>;\n};\n\nconst buildServeOptions = (\n optionsOrCallback: ServeOptions | ((info: AddressInfo) => void) | undefined,\n): ServeOptions => (typeof optionsOrCallback === 'function' ? {} : (optionsOrCallback ?? {}));\n\nconst extractCallback = (\n optionsOrCallback: ServeOptions | ((info: AddressInfo) => void) | undefined,\n maybeCallback: ((info: AddressInfo) => void) | undefined,\n): ((info: AddressInfo) => void) | undefined =>\n typeof optionsOrCallback === 'function' ? optionsOrCallback : maybeCallback;\n\nexport const serveApp = (\n app: AppLike,\n optionsOrCallback?: ServeOptions | ((info: AddressInfo) => void),\n maybeCallback?: (info: AddressInfo) => void,\n): ServerType => {\n const options = buildServeOptions(optionsOrCallback);\n const callback = extractCallback(optionsOrCallback, maybeCallback);\n\n return serve(\n {\n fetch: app.fetch,\n port: options.port ?? 3000,\n hostname: options.hostname ?? '0.0.0.0',\n },\n callback,\n );\n};\n"],"mappings":";;;;;;;;;AAIA,IAAaE,gBAAb,cAAmCF,UAAAA;CACxBG,MAAc;AACrB,SAAOC,QAAQD,KAAG;;CAGXE,OAA0B;AACjC,SAAOD,QAAQC;;CAGRC,KAAKC,MAAqB;AACjCH,UAAQE,KAAKC,KAAAA;;CAGNC,YAAYD,MAAoB;AACvCH,UAAQK,WAAWF;;CAGZG,SAASC,QAAgBC,SAA8B;AAC9DR,UAAQS,GAAGF,QAAQC,QAAAA;;CAGZE,UAAUH,QAAgBC,SAA8B;AAC/DR,UAAQW,IAAIJ,QAAQC,QAAAA;;;;;;;;;;;;ACvBxB,IAAaM,oBAAb,cAAuCD,WAAAA;CAC5BE,IAAIC,KAAiC;AAC5C,SAAOC,QAAQC,IAAIF;;;;;;AC8CvB,MAAMO,uBACJC,UACAC,gBAAAA;AAEA,QAAO,O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U,WAAWC,iBAAAA;;CAGjC,MAAM5B,WAAW,YAAA;AACf,MAAIyB,aAAc;AAClBA,iBAAe;AACf,MAAI;AACF,SAAMD,iBAAAA;YACE;AACRE,kBAAAA;;;CAIJ,MAAME,yBAAmB;AAClB5B,YAAAA,CAAW6B,YAAM,GAAO;;AAG/BP,WAAUQ,SAAS,UAAUF,iBAAAA;AAC7BN,WAAUQ,SAAS,WAAWF,iBAAAA;AAI9B,QAAOnB,cAAcC,UAAUV,UAFlBI,SAE4BO,CAAAA;;;;ACjI3C,MAAMqB,qBACJC,sBACkB,OAAOA,sBAAsB,aAAa,EAAC,GAAKA,qBAAqB,EAAC;AAE1F,MAAMC,mBACJD,mBACAE,kBAEA,OAAOF,sBAAsB,aAAaA,oBAAoBE;AAEhE,MAAaC,YACXC,KACAJ,mBACAE,kBAAAA;CAEA,MAAMG,UAAUN,kBAAkBC,kBAAAA;CAClC,MAAMM,WAAWL,gBAAgBD,mBAAmBE,cAAAA;AAEpD,QAAOJ,MACL;EACES,OAAOH,IAAIG;EACXC,MAAMH,QAAQG,QAAQ;EACtBC,UAAUJ,QAAQI,YAAY;EAChC,EACAH,SAAAA"}
1
+ {"version":3,"file":"index.js","names":["CliConfig","Config","NodeCliConfig","cwd","process","argv","exit","code","setExitCode","exitCode","onSignal","signal","handler","on","offSignal","off","Config","EnvAdaptor","ProcessEnvAdaptor","get","key","process","env","serve","HttpFeature","NodeCliConfig","ProcessEnvAdaptor","closeServer","server","Promise","resolve","reject","close","err","createListenForHttp","appFetch","registerShutdown","portOrOptions","listenOptions","port","hostname","serverReady","fetch","info","address","shutdown","getArgs","globalThis","process","argv","slice","createNodeApp","readyApp","args","base","nodeApp","entry","getFeatureEntries","Object","defineProperty","key","value","capabilities","listen","callback","feature","configurable","enumerable","onNode","app","options","createRuntime","fallbackConfigs","warmup","cliConfig","get","shuttingDown","detachSignals","offSignal","gracefulShutdown","catch","onSignal","serve","buildServeOptions","optionsOrCallback","extractCallback","maybeCallback","serveApp","app","options","callback","fetch","port","hostname"],"sources":["../src/node-cli.config.ts","../src/process-env.adaptor.ts","../src/on-node.ts","../src/serve.lib.ts"],"sourcesContent":["import type { Signal, SignalHandler } from '@zeltjs/core';\nimport { CliConfig, Config } from '@zeltjs/core';\n\n@Config\nexport class NodeCliConfig extends CliConfig {\n override cwd(): string {\n return process.cwd();\n }\n\n override argv(): readonly string[] {\n return process.argv;\n }\n\n override exit(code: number): never {\n process.exit(code);\n }\n\n override setExitCode(code: number): void {\n process.exitCode = code;\n }\n\n override onSignal(signal: Signal, handler: SignalHandler): void {\n process.on(signal, handler);\n }\n\n override offSignal(signal: Signal, handler: SignalHandler): void {\n process.off(signal, handler);\n }\n}\n","import { Config, EnvAdaptor } from '@zeltjs/core';\n\n@Config\nexport class ProcessEnvAdaptor extends EnvAdaptor {\n override get(key: string): string | undefined {\n return process.env[key];\n }\n}\n","import type { ServerType } from '@hono/node-server';\nimport { serve } from '@hono/node-server';\nimport type {\n ConfiguredFeature,\n FeatureApp,\n FeatureReadyCapabilities,\n RuntimeApp,\n} from '@zeltjs/core';\nimport { HttpFeature } from '@zeltjs/core';\n\nimport { NodeCliConfig } from './node-cli.config';\nimport { ProcessEnvAdaptor } from './process-env.adaptor';\n\ntype ListenOptions = {\n readonly port?: number;\n readonly hostname?: string;\n};\n\nexport type ServerHandle = {\n readonly address: { port: number; address: string };\n readonly shutdown: () => Promise<void>;\n};\n\nexport type NodeAppOptions = {\n readonly warmup?: boolean;\n};\n\nexport type { ExecResult } from '@zeltjs/core';\n\ntype EnvironmentNodeAppPart = {\n readonly args: readonly string[];\n readonly shutdown: () => Promise<void>;\n};\n\ntype HttpNodeAppPart = {\n readonly listen: (portOrOptions?: number | ListenOptions) => Promise<ServerHandle>;\n};\n\ntype NodeFeatureCapabilities<TFeature extends ConfiguredFeature> =\n FeatureReadyCapabilities<TFeature> &\n (TFeature extends HttpFeature<string> ? HttpNodeAppPart : unknown);\n\ntype NodeNamespacedCapabilities<F extends readonly ConfiguredFeature[]> = {\n readonly [TFeature in F[number] as TFeature['key']]: NodeFeatureCapabilities<TFeature>;\n};\n\nexport type NodeApp = RuntimeApp<readonly ConfiguredFeature[]> & EnvironmentNodeAppPart;\n\ntype NodeAppForFeatures<F extends readonly ConfiguredFeature[]> = RuntimeApp<F> &\n EnvironmentNodeAppPart &\n NodeNamespacedCapabilities<F>;\n\nconst closeServer = (server: ServerType): Promise<void> =>\n new Promise<void>((resolve, reject) => {\n server.close((err) => (err ? reject(err) : resolve()));\n });\n\nconst createListenForHttp = (\n appFetch: (request: Request) => Promise<Response>,\n registerShutdown: (callback: () => Promise<void>) => () => Promise<void>,\n): ((portOrOptions?: number | ListenOptions) => Promise<ServerHandle>) => {\n return async (portOrOptions?: number | ListenOptions): Promise<ServerHandle> => {\n const listenOptions: ListenOptions =\n typeof portOrOptions === 'number' ? { port: portOrOptions } : (portOrOptions ?? {});\n\n const port = listenOptions.port ?? 3000;\n const hostname = listenOptions.hostname ?? '0.0.0.0';\n\n let server!: ServerType;\n const serverReady = new Promise<{ port: number; address: string }>((resolve) => {\n server = serve({ fetch: appFetch, port, hostname }, (info) =>\n resolve({ port: info.port, address: info.address }),\n );\n });\n const shutdown = registerShutdown(() => closeServer(server));\n\n const address = await serverReady;\n\n return { address, shutdown };\n };\n};\n\nconst getArgs = (): readonly string[] => globalThis.process.argv.slice(2);\n\nconst createNodeApp = (\n readyApp: RuntimeApp<readonly ConfiguredFeature[]>,\n shutdown: () => Promise<void>,\n args: readonly string[],\n): NodeApp => {\n const base: RuntimeApp<readonly ConfiguredFeature[]> & EnvironmentNodeAppPart = {\n ...readyApp,\n args,\n shutdown,\n };\n\n const nodeApp: NodeApp = { ...base };\n\n for (const entry of readyApp.getFeatureEntries(HttpFeature)) {\n Object.defineProperty(nodeApp, entry.key, {\n value: {\n ...entry.capabilities,\n listen: createListenForHttp(entry.capabilities.fetch, (callback) =>\n entry.feature.registerShutdown(callback),\n ),\n },\n configurable: true,\n enumerable: true,\n });\n }\n\n return nodeApp;\n};\n\nexport function onNode<const F extends readonly ConfiguredFeature[]>(\n app: FeatureApp<F>,\n options?: NodeAppOptions,\n): Promise<NodeAppForFeatures<F>>;\n\n/** @throws {ZeltLifecycleStateError} */\nexport async function onNode<const F extends readonly ConfiguredFeature[]>(\n app: FeatureApp<F>,\n options: NodeAppOptions = {},\n): Promise<NodeApp> {\n const readyApp = await app.createRuntime({\n fallbackConfigs: [NodeCliConfig, ProcessEnvAdaptor],\n warmup: options.warmup ?? true,\n });\n\n const cliConfig = await readyApp.get(NodeCliConfig);\n\n let shuttingDown = false;\n const detachSignals = (): void => {\n cliConfig.offSignal('SIGINT', gracefulShutdown);\n cliConfig.offSignal('SIGTERM', gracefulShutdown);\n };\n\n const shutdown = async (): Promise<void> => {\n if (shuttingDown) return;\n shuttingDown = true;\n try {\n await readyApp.shutdown();\n } finally {\n detachSignals();\n }\n };\n\n const gracefulShutdown = (): void => {\n void shutdown().catch(() => {});\n };\n\n cliConfig.onSignal('SIGINT', gracefulShutdown);\n cliConfig.onSignal('SIGTERM', gracefulShutdown);\n\n const args = getArgs();\n\n return createNodeApp(readyApp, shutdown, args);\n}\n","import type { ServerType } from '@hono/node-server';\nimport { serve } from '@hono/node-server';\n\nexport type ServeOptions = {\n port?: number;\n hostname?: string;\n};\n\nexport type AddressInfo = {\n port: number;\n address: string;\n};\n\ntype AppLike = {\n fetch: (request: Request) => Promise<Response>;\n};\n\nconst buildServeOptions = (\n optionsOrCallback: ServeOptions | ((info: AddressInfo) => void) | undefined,\n): ServeOptions => (typeof optionsOrCallback === 'function' ? {} : (optionsOrCallback ?? {}));\n\nconst extractCallback = (\n optionsOrCallback: ServeOptions | ((info: AddressInfo) => void) | undefined,\n maybeCallback: ((info: AddressInfo) => void) | undefined,\n): ((info: AddressInfo) => void) | undefined =>\n typeof optionsOrCallback === 'function' ? optionsOrCallback : maybeCallback;\n\nexport const serveApp = (\n app: AppLike,\n optionsOrCallback?: ServeOptions | ((info: AddressInfo) => void),\n maybeCallback?: (info: AddressInfo) => void,\n): ServerType => {\n const options = buildServeOptions(optionsOrCallback);\n const callback = extractCallback(optionsOrCallback, maybeCallback);\n\n return serve(\n {\n fetch: app.fetch,\n port: options.port ?? 3000,\n hostname: options.hostname ?? '0.0.0.0',\n },\n callback,\n );\n};\n"],"mappings":";;;;;;;;;AAIA,IAAaE,gBAAb,cAAmCF,UAAAA;CACxBG,MAAc;AACrB,SAAOC,QAAQD,KAAG;;CAGXE,OAA0B;AACjC,SAAOD,QAAQC;;CAGRC,KAAKC,MAAqB;AACjCH,UAAQE,KAAKC,KAAAA;;CAGNC,YAAYD,MAAoB;AACvCH,UAAQK,WAAWF;;CAGZG,SAASC,QAAgBC,SAA8B;AAC9DR,UAAQS,GAAGF,QAAQC,QAAAA;;CAGZE,UAAUH,QAAgBC,SAA8B;AAC/DR,UAAQW,IAAIJ,QAAQC,QAAAA;;;;;;;;;;;;ACvBxB,IAAaM,oBAAb,cAAuCD,WAAAA;CAC5BE,IAAIC,KAAiC;AAC5C,SAAOC,QAAQC,IAAIF;;;;;;AC+CvB,MAAMO,eAAeC,WACnB,IAAIC,SAAeC,SAASC,WAAAA;AAC1BH,QAAOI,OAAOC,QAASA,MAAMF,OAAOE,IAAAA,GAAOH,SAAAA,CAAAA;EAC7C;AAEF,MAAMI,uBACJC,UACAC,qBAAAA;AAEA,QAAO,OAAOC,kBAAAA;EACZ,MAAMC,gBACJ,OAAOD,kBAAkB,WAAW,EAAEE,MAAMF,eAAc,GAAKA,iBAAiB,EAAC;EAEnF,MAAME,OAAOD,cAAcC,QAAQ;EACnC,MAAMC,WAAWF,cAAcE,YAAY;EAE3C,IAAIZ;EACJ,MAAMa,cAAc,IAAIZ,SAA4CC,YAAAA;AAClEF,YAASL,MAAM;IAAEmB,OAAOP;IAAUI;IAAMC;IAAS,GAAIG,SACnDb,QAAQ;IAAES,MAAMI,KAAKJ;IAAMK,SAASD,KAAKC;IAAQ,CAAA,CAAA;IAErD;EACA,MAAMC,WAA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,GAAKA,qBAAqB,EAAC;AAE1F,MAAMC,mBACJD,mBACAE,kBAEA,OAAOF,sBAAsB,aAAaA,oBAAoBE;AAEhE,MAAaC,YACXC,KACAJ,mBACAE,kBAAAA;CAEA,MAAMG,UAAUN,kBAAkBC,kBAAAA;CAClC,MAAMM,WAAWL,gBAAgBD,mBAAmBE,cAAAA;AAEpD,QAAOJ,MACL;EACES,OAAOH,IAAIG;EACXC,MAAMH,QAAQG,QAAQ;EACtBC,UAAUJ,QAAQI,YAAY;EAChC,EACAH,SAAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeltjs/adapter-node",
3
- "version": "0.9.1-canary.2",
3
+ "version": "0.9.1-canary.3",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -30,11 +30,11 @@
30
30
  "@hono/node-server": "2.0.1"
31
31
  },
32
32
  "peerDependencies": {
33
- "@zeltjs/core": "0.9.1-canary.2"
33
+ "@zeltjs/core": "0.9.1-canary.3"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "22.19.17",
37
- "@zeltjs/core": "0.9.1-canary.2"
37
+ "@zeltjs/core": "0.9.1-canary.3"
38
38
  },
39
39
  "volta": {
40
40
  "extends": "../../package.json"