milkio 1.0.0-alpha.21 → 1.0.0-alpha.22

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.
@@ -0,0 +1,13 @@
1
+ # 1.0.0-alpha.21 - 某章节名
2
+
3
+ > 一段编纂出来的虚构科幻小说的摘抄片段
4
+
5
+ ## ...更新内容...
6
+
7
+ ...更新内容...
8
+
9
+ ## 升级
10
+
11
+ ```
12
+ bun i milkio@1.0.0-alpha.21
13
+ ```
package/context/index.ts CHANGED
@@ -7,7 +7,7 @@ export interface $context {
7
7
  path: string;
8
8
  logger: Logger;
9
9
  http?: ContextHttp<Record<any, any>>;
10
- step: Steps<{}>["step"];
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"]>>;
13
13
  }
package/execute/index.ts CHANGED
@@ -72,7 +72,7 @@ export const __initExecuter = <MilkioRuntime extends MilkioRuntimeInit<MilkioRun
72
72
  executeId: options.createdExecuteId,
73
73
  getConfig: (namespace: string) => getConfig(generated, env, envMode, namespace),
74
74
  call: (module: any, options: any) => __call(context, module, options),
75
- step: createStep(),
75
+ createStep: createStep,
76
76
  } as unknown as $context;
77
77
  const results: Results<unknown> = { value: undefined };
78
78
 
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.21",
5
+ "version": "1.0.0-alpha.22",
6
6
  "peerDependencies": {
7
7
  "typescript": "^5.4.2"
8
8
  },
package/step/index.ts CHANGED
@@ -11,7 +11,7 @@ type ToEmptyObject<T> = T extends undefined | null | never ? {} : T extends obje
11
11
 
12
12
  export type StepFunction<StageT extends Record<any, any>> = <HandlerT extends (stage: Readonly<StageT>) => Record<any, any> | Promise<Record<any, any>>>(handler: HandlerT) => Steps<Awaited<StageT> & ToEmptyObject<Awaited<ReturnType<HandlerT>>>>;
13
13
 
14
- export const createStep = (): Steps<{}>["step"] => {
14
+ export const createStep = (): Steps<{}> => {
15
15
  const stepController = {
16
16
  $milkioType: "step",
17
17
  _steps: [] as Array<(stage: any) => Promise<any>>,
@@ -32,5 +32,5 @@ export const createStep = (): Steps<{}>["step"] => {
32
32
  return result;
33
33
  },
34
34
  };
35
- return stepController.step as any as Steps<{}>["step"];
35
+ return stepController as any as Steps<{}>;
36
36
  };