milkio 1.0.0-alpha.22 → 1.0.0-alpha.24

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/command/index.ts CHANGED
@@ -15,7 +15,7 @@ export type Command<CommandInitT extends CommandInit> = {
15
15
  handler: CommandInitT["handler"];
16
16
  };
17
17
 
18
- export const __initCommander = <MilkioRuntime extends MilkioRuntimeInit<MilkioInit> = MilkioRuntimeInit<MilkioInit>>(generated: GeneratedInit, runtime: MilkioRuntime) => {
18
+ export const __initCommander = (generated: GeneratedInit, runtime: any) => {
19
19
  const commander = async (argv: Array<string>, options?: { onNotFound?: () => any }) => {
20
20
  const params = {
21
21
  path: "index",
package/context/index.ts CHANGED
@@ -6,7 +6,7 @@ export interface $context {
6
6
  environment: string;
7
7
  path: string;
8
8
  logger: Logger;
9
- http?: ContextHttp<Record<any, any>>;
9
+ http: ContextHttp<Record<any, any>>;
10
10
  createStep: () => Steps<{}>;
11
11
  getConfig: <Namespace extends keyof $types["generated"]["configSchema"]>(namespace: Namespace) => Promise<Readonly<Awaited<ReturnType<$types["generated"]["configSchema"][Namespace][0]>>>>;
12
12
  call: <Module extends Promise<{ default: Action<any> }>>(module: Module, params: Parameters<Awaited<Module>["default"]["handler"]>[1]) => Promise<ReturnType<Awaited<Module>["default"]["handler"]>>;
package/execute/index.ts CHANGED
@@ -3,7 +3,7 @@ import { TSON } from "@southern-aurora/tson";
3
3
  import { reject, type $context, type $meta, type Logger, type MilkioRuntimeInit, type Results, type GeneratedInit, type MilkioInit, createStep, getConfig } from "..";
4
4
  import { headersToJSON } from "../utils/headers-to-json";
5
5
 
6
- export const __initExecuter = <MilkioRuntime extends MilkioRuntimeInit<MilkioRuntimeInit<MilkioInit>> = MilkioRuntimeInit<MilkioInit>>(generated: GeneratedInit, runtime: MilkioRuntime) => {
6
+ export const __initExecuter = (generated: GeneratedInit, runtime: any) => {
7
7
  const __execute = async (
8
8
  env: Record<any, any> | undefined,
9
9
  envMode: string | undefined,
package/listener/index.ts CHANGED
@@ -14,7 +14,7 @@ export type MilkioHttpResponse = Mixin<
14
14
  }
15
15
  >;
16
16
 
17
- export const __initListener = <MilkioRuntime extends MilkioRuntimeInit<MilkioRuntimeInit<MilkioInit>> = MilkioRuntimeInit<MilkioInit>>(generated: GeneratedInit, runtime: MilkioRuntime, executer: ReturnType<typeof __initExecuter>) => {
17
+ export const __initListener = (generated: GeneratedInit, runtime: any, executer: ReturnType<typeof __initExecuter>) => {
18
18
  const port = runtime.port;
19
19
  const fetch = async (options: {
20
20
  request: MilkioHttpRequest;
@@ -108,7 +108,7 @@ export const __initListener = <MilkioRuntime extends MilkioRuntimeInit<MilkioRun
108
108
  paramsType: "string",
109
109
  });
110
110
 
111
- if (executed.results.value !== undefined) response.body = TSON.stringify({ success: true, data: executed.results.value, executeId } satisfies MilkioResponseSuccess<any>);
111
+ if (response.body === "" && executed.results.value !== undefined) response.body = TSON.stringify({ success: true, data: executed.results.value, executeId } satisfies MilkioResponseSuccess<any>);
112
112
 
113
113
  await runtime.emit("milkio:httpResponse", { executeId, logger, path: http.path.string as string, http, context: executed.context });
114
114
 
package/logger/index.ts CHANGED
@@ -52,7 +52,7 @@ export const createLogger = <MilkioRuntime extends MilkioRuntimeInit<MilkioRunti
52
52
  if (!inserting(log)) return log;
53
53
 
54
54
  logger._.logs.push([...log]);
55
- if (runtime.cookbook) {
55
+ if (runtime.develop) {
56
56
  void sendCookbookEvent(runtime, {
57
57
  type: "milkio@logger",
58
58
  log: log,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "milkio",
3
3
  "type": "module",
4
4
  "module": "index.ts",
5
- "version": "1.0.0-alpha.22",
5
+ "version": "1.0.0-alpha.24",
6
6
  "peerDependencies": {
7
7
  "typescript": "^5.4.2"
8
8
  },
package/world/index.ts CHANGED
@@ -81,7 +81,7 @@ export type MilkioWorld<MilkioOptions extends MilkioInit = MilkioInit> = {
81
81
  emit: Awaited<ReturnType<typeof __initEventManager>>["emit"];
82
82
  ping: (options?: { timeout?: number }) => Promise<Ping>;
83
83
  // commander
84
- commander: Awaited<ReturnType<typeof __initCommander<MilkioRuntimeInit<MilkioOptions>>>>;
84
+ commander: Awaited<ReturnType<typeof __initCommander>>;
85
85
  // listener
86
- listener: Awaited<ReturnType<typeof __initListener<MilkioRuntimeInit<MilkioOptions>>>>;
86
+ listener: Awaited<ReturnType<typeof __initListener>>;
87
87
  };