@akanjs/cli 2.3.5-rc.5 → 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.5",
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.5",
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,13 +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
16
 
21
17
  return `
22
- import { FetchClient, type GetFetchTypeFromEndpoint, type GetFetchTypeFromSlice } from "akanjs/fetch";
18
+ import { FetchClient, type FetchClientType } from "akanjs/fetch";
23
19
  import { SignalRegistry, serverSignal${libs.length === 0 ? ", fetch as base" : ""} } from "akanjs/signal";
24
20
  ${libs.map((lib) => `import { fetch as ${lib} } from "@libs/${lib}/server";`).join("\n")}
25
21
 
@@ -60,19 +56,8 @@ ${databaseModules.map((module) => `export const ${module} = SignalRegistry.regis
60
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")}
61
57
 
62
58
  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
- ${databaseModules
66
- .map(
67
- (module) =>
68
- `type ${capitalize(module)}Fetch = GetFetchTypeFromEndpoint<typeof ${module}Sig.${capitalize(module)}Endpoint, typeof ${module}Sig.${capitalize(module)}Slice> & GetFetchTypeFromSlice<typeof ${module}Sig.${capitalize(module)}Slice>;`,
69
- )
70
- .join("\n")}
71
- ${serviceModules
72
- .map((module) => `type ${capitalize(module)}Fetch = GetFetchTypeFromEndpoint<typeof ${module}Sig.${capitalize(module)}Endpoint>;`)
73
- .join("\n")}
74
- export type Fetch = ${fetchTypeParts.length ? fetchTypeParts.join(" &\n ") : "unknown"};
75
- 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);
76
61
 
77
62
  export const getSerializedSignal = () => fetch.serializedSignal
78
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
+ }