@akanjs/cli 2.3.5-rc.5 → 2.3.5-rc.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/cli",
3
- "version": "2.3.5-rc.5",
3
+ "version": "2.3.5-rc.6",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -35,7 +35,7 @@
35
35
  "@langchain/openai": "^1.4.6",
36
36
  "@tailwindcss/node": "^4.3.0",
37
37
  "@trapezedev/project": "^7.1.4",
38
- "akanjs": "2.3.5-rc.5",
38
+ "akanjs": "2.3.5-rc.6",
39
39
  "chalk": "^5.6.2",
40
40
  "commander": "^14.0.3",
41
41
  "daisyui": "^5.5.20",
@@ -17,9 +17,12 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { [
17
17
  const databaseFetchTypes = databaseModules.map((module) => `${capitalize(module)}Fetch`);
18
18
  const serviceFetchTypes = serviceModules.map((module) => `${capitalize(module)}Fetch`);
19
19
  const fetchTypeParts = [...importedFetchParts, ...databaseFetchTypes, ...serviceFetchTypes];
20
+ const fetchTypeGroups = Array.from({ length: Math.ceil(fetchTypeParts.length / 4) }, (_, idx) =>
21
+ fetchTypeParts.slice(idx * 4, idx * 4 + 4),
22
+ );
20
23
 
21
24
  return `
22
- import { FetchClient, type GetFetchTypeFromEndpoint, type GetFetchTypeFromSlice } from "akanjs/fetch";
25
+ import { FetchClient, type GetFetchTypeFromEndpoint, type GetFetchTypeFromSlice, type SafeFetchPart } from "akanjs/fetch";
23
26
  import { SignalRegistry, serverSignal${libs.length === 0 ? ", fetch as base" : ""} } from "akanjs/signal";
24
27
  ${libs.map((lib) => `import { fetch as ${lib} } from "@libs/${lib}/server";`).join("\n")}
25
28
 
@@ -60,8 +63,6 @@ ${databaseModules.map((module) => `export const ${module} = SignalRegistry.regis
60
63
  ${serviceModules.map((module) => `export const ${module} = SignalRegistry.registerService("${module}" as const, ${module}Sig.${capitalize(module)}Internal, ${module}Sig.${capitalize(module)}Endpoint, ${capitalize(module)});`).join("\n")}
61
64
 
62
65
  export const fetchSignals = [${signalNames.join(", ")}] as const;
63
- type IsAny<Type> = 0 extends 1 & Type ? true : false;
64
- type SafeFetchPart<Type> = IsAny<Type> extends true ? unknown : Type;
65
66
  ${databaseModules
66
67
  .map(
67
68
  (module) =>
@@ -69,9 +70,14 @@ ${databaseModules
69
70
  )
70
71
  .join("\n")}
71
72
  ${serviceModules
72
- .map((module) => `type ${capitalize(module)}Fetch = GetFetchTypeFromEndpoint<typeof ${module}Sig.${capitalize(module)}Endpoint>;`)
73
+ .map(
74
+ (module) =>
75
+ `type ${capitalize(module)}Fetch = GetFetchTypeFromEndpoint<typeof ${module}Sig.${capitalize(module)}Endpoint>;`,
76
+ )
73
77
  .join("\n")}
74
- export type Fetch = ${fetchTypeParts.length ? fetchTypeParts.join(" &\n ") : "unknown"};
78
+ ${fetchTypeGroups.map((group, idx) => `type FetchGroup${idx} = ${group.join(" & ")};`).join("\n")}
79
+ export type Fetch = ${fetchTypeGroups.length ? fetchTypeGroups.map((_, idx) => `FetchGroup${idx}`).join(" &\n ") : "unknown"};
80
+ // Avoid re-instantiating the full signal tuple here; Fetch type above is the public contract.
75
81
  export const fetch: Fetch = (FetchClient.from as (...signals: unknown[]) => unknown)(...fetchSignals) as Fetch;
76
82
 
77
83
  export const getSerializedSignal = () => fetch.serializedSignal