milkio 1.0.0-alpha.3 → 1.0.0-alpha.4

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/execute/index.ts CHANGED
@@ -53,7 +53,7 @@ export const __initExecuter = <MilkioRuntime extends MilkioRuntimeInit<MilkioRun
53
53
  }
54
54
  if (typeof params !== "object" || Array.isArray(params)) throw reject("PARAMS_TYPE_NOT_SUPPORTED", { expected: "json" });
55
55
  if ("$milkioGenerateParams" in params && params.$milkioGenerateParams === "enable") {
56
- if (!runtime.cookbook) throw reject("NOT_DEVELOP_MODE", "This feature must be in cookbook to use.");
56
+ if (!runtime.develop) throw reject("NOT_DEVELOP_MODE", "This feature must be in cookbook to use.");
57
57
  delete params.$milkioGenerateParams;
58
58
  let paramsRand = routeSchema.randomParams();
59
59
  if (paramsRand === undefined || paramsRand === null) paramsRand = {};
@@ -69,7 +69,7 @@ export const __initExecuter = <MilkioRuntime extends MilkioRuntimeInit<MilkioRun
69
69
  } as unknown as $context;
70
70
  const results: Results<unknown> = { value: undefined };
71
71
 
72
- if (runtime.cookbook) {
72
+ if (runtime.develop) {
73
73
  options.createdLogger.request(`headers - ${TSON.stringify(headers.toJSON())}`, `\nparams - ${TSON.stringify(params)}`);
74
74
  }
75
75
 
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.3",
5
+ "version": "1.0.0-alpha.4",
6
6
  "peerDependencies": {
7
7
  "typescript": "^5.4.2"
8
8
  },
@@ -8,7 +8,7 @@ type CookbookEvent = {
8
8
 
9
9
  export const sendCookbookEvent = async (runtime: MilkioRuntimeInit<MilkioInit>, event: CookbookEvent) => {
10
10
  try {
11
- const response = await fetch(`http://localhost:${runtime.cookbook?.cookbookPort}/$action`, {
11
+ const response = await fetch(`http://localhost:${runtime.cookbook.cookbookPort}/$action`, {
12
12
  method: "POST",
13
13
  headers: {
14
14
  "Content-Type": "application/json",
package/world/index.ts CHANGED
@@ -3,7 +3,8 @@ import { defineDefaultExecuteIdGenerator } from "../execute/execute-id-generator
3
3
 
4
4
  export type MilkioInit = {
5
5
  port: number;
6
- cookbook?: {
6
+ develop: boolean;
7
+ cookbook: {
7
8
  cookbookPort: number;
8
9
  };
9
10
  cors?: {