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

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.6",
3
+ "version": "2.3.5-rc.7",
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.6",
38
+ "akanjs": "2.3.5-rc.7",
39
39
  "chalk": "^5.6.2",
40
40
  "commander": "^14.0.3",
41
41
  "daisyui": "^5.5.20",
@@ -13,16 +13,9 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { [
13
13
  const libs = scanInfo.getLibs();
14
14
 
15
15
  const signalNames = [...(libs.length === 0 ? ["base"] : libs), ...databaseModules, ...serviceModules];
16
- const importedFetchParts = (libs.length === 0 ? ["base"] : libs).map((signal) => `SafeFetchPart<typeof ${signal}>`);
17
- const databaseFetchTypes = databaseModules.map((module) => `${capitalize(module)}Fetch`);
18
- const serviceFetchTypes = serviceModules.map((module) => `${capitalize(module)}Fetch`);
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
- );
23
16
 
24
17
  return `
25
- import { FetchClient, type GetFetchTypeFromEndpoint, type GetFetchTypeFromSlice, type SafeFetchPart } from "akanjs/fetch";
18
+ import { FetchClient, type FetchClientType } from "akanjs/fetch";
26
19
  import { SignalRegistry, serverSignal${libs.length === 0 ? ", fetch as base" : ""} } from "akanjs/signal";
27
20
  ${libs.map((lib) => `import { fetch as ${lib} } from "@libs/${lib}/server";`).join("\n")}
28
21
 
@@ -63,22 +56,8 @@ ${databaseModules.map((module) => `export const ${module} = SignalRegistry.regis
63
56
  ${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")}
64
57
 
65
58
  export const fetchSignals = [${signalNames.join(", ")}] as const;
66
- ${databaseModules
67
- .map(
68
- (module) =>
69
- `type ${capitalize(module)}Fetch = GetFetchTypeFromEndpoint<typeof ${module}Sig.${capitalize(module)}Endpoint, typeof ${module}Sig.${capitalize(module)}Slice> & GetFetchTypeFromSlice<typeof ${module}Sig.${capitalize(module)}Slice>;`,
70
- )
71
- .join("\n")}
72
- ${serviceModules
73
- .map(
74
- (module) =>
75
- `type ${capitalize(module)}Fetch = GetFetchTypeFromEndpoint<typeof ${module}Sig.${capitalize(module)}Endpoint>;`,
76
- )
77
- .join("\n")}
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.
81
- export const fetch: Fetch = (FetchClient.from as (...signals: unknown[]) => unknown)(...fetchSignals) as Fetch;
59
+ export type Fetch = FetchClientType<typeof fetchSignals>;
60
+ export const fetch: Fetch = FetchClient.from(...fetchSignals);
82
61
 
83
62
  export const getSerializedSignal = () => fetch.serializedSignal
84
63
  `;
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "Akan.js",
3
+ "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
4
+ "features": {
5
+ "ghcr.io/devcontainers-extra/features/bun:1": {}
6
+ },
7
+ "onCreateCommand": "bun add -g @akanjs/cli@latest",
8
+ "postCreateCommand": "bun install",
9
+ "forwardPorts": [8282, 8283, 8284, 8285, 8286, 8287, 8288, 8289, 8290],
10
+ "portsAttributes": {
11
+ "8282": { "label": "Akan dev server#1", "onAutoForward": "openPreview" },
12
+ "8283": { "label": "Akan dev server#2", "onAutoForward": "openPreview" },
13
+ "8284": { "label": "Akan dev server#3", "onAutoForward": "openPreview" },
14
+ "8285": { "label": "Akan dev server#4", "onAutoForward": "openPreview" },
15
+ "8286": { "label": "Akan dev server#5", "onAutoForward": "openPreview" },
16
+ "8287": { "label": "Akan dev server#6", "onAutoForward": "openPreview" },
17
+ "8288": { "label": "Akan dev server#7", "onAutoForward": "openPreview" },
18
+ "8289": { "label": "Akan dev server#8", "onAutoForward": "openPreview" },
19
+ "8290": { "label": "Akan dev server#9", "onAutoForward": "openPreview" }
20
+ },
21
+ "customizations": {
22
+ "extensions": ["oven.bun-vscode", "biomejs.biome"],
23
+ "settings": {
24
+ "typescript.tsdk": "node_modules/typescript/lib",
25
+ "editor.defaultFormatter": "biomejs.biome",
26
+ "editor.formatOnSave": true,
27
+ "editor.codeActionsOnSave": {
28
+ "source.fixAll.biome": "explicit"
29
+ },
30
+ "[typescript]": {
31
+ "editor.defaultFormatter": "biomejs.biome"
32
+ },
33
+ "[typescriptreact]": {
34
+ "editor.defaultFormatter": "biomejs.biome"
35
+ },
36
+ "[javascript]": {
37
+ "editor.defaultFormatter": "biomejs.biome"
38
+ },
39
+ "[javascriptreact]": {
40
+ "editor.defaultFormatter": "biomejs.biome"
41
+ },
42
+ "[json]": {
43
+ "editor.defaultFormatter": "biomejs.biome"
44
+ }
45
+ }
46
+ }
47
+ }