@akanjs/cli 2.1.1 → 2.1.2-rc.0
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/incrementalBuilder.proc.js +120 -124
- package/index.js +228 -187
- package/package.json +2 -2
- package/templates/lib/dict.ts +5 -2
- package/templates/lib/useClient.ts +6 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2-rc.0",
|
|
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.1.
|
|
38
|
+
"akanjs": "2.1.2-rc.0",
|
|
39
39
|
"chalk": "^5.6.2",
|
|
40
40
|
"commander": "^14.0.3",
|
|
41
41
|
"daisyui": "^5.5.20",
|
package/templates/lib/dict.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { AppInfo, LibInfo } from "akanjs";
|
|
2
2
|
|
|
3
3
|
const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
4
|
-
export default function getContent(
|
|
4
|
+
export default function getContent(
|
|
5
|
+
scanInfo: AppInfo | LibInfo | null,
|
|
6
|
+
dict: { [key: string]: string } = {},
|
|
7
|
+
) {
|
|
5
8
|
if (!scanInfo) return null;
|
|
6
9
|
const databaseModules = scanInfo.getDatabaseModules();
|
|
7
10
|
const scalarModules = scanInfo.getScalarModules();
|
|
@@ -44,6 +47,6 @@ export const dictionary = makeDictionary(${libs.length ? libs.join(", ") : "base
|
|
|
44
47
|
].join(",\n ")}
|
|
45
48
|
});
|
|
46
49
|
|
|
47
|
-
export const { Err, translate, msg, getAllDictionary, __Dict_Key__, __Error_Key__ } = makeTrans(dictionary);
|
|
50
|
+
export const { Err, translate, msg, getDictionary, getAllDictionary, __Dict_Key__, __Error_Key__ } = makeTrans(dictionary);
|
|
48
51
|
`;
|
|
49
52
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { AppInfo, LibInfo } from "akanjs";
|
|
2
2
|
|
|
3
|
-
export default function getContent(
|
|
3
|
+
export default function getContent(
|
|
4
|
+
scanInfo: AppInfo | LibInfo | null,
|
|
5
|
+
dict: { [key: string]: string } = {},
|
|
6
|
+
) {
|
|
4
7
|
return `
|
|
5
8
|
import { makePageProto, registerClientRuntime } from "akanjs/client";
|
|
6
9
|
import { FetchClient } from "akanjs/fetch";
|
|
@@ -10,7 +13,8 @@ import type * as dict from "./dict";
|
|
|
10
13
|
import { getSerializedSignal } from "./sig" with { type: "macro" };
|
|
11
14
|
import type * as signal from "./sig";
|
|
12
15
|
|
|
13
|
-
const
|
|
16
|
+
const dictionary = process.env.AKAN_PUBLIC_RENDER_ENV === "csr" ? getAllDictionary() : {};
|
|
17
|
+
const pageProto = makePageProto<typeof dict>(dictionary);
|
|
14
18
|
const fetchProto = FetchClient.build<typeof signal>(cnst, getSerializedSignal(), { Err: pageProto.Err });
|
|
15
19
|
export const runtime = registerClientRuntime({ ...pageProto, ...fetchProto }, { scope: ${JSON.stringify(scanInfo?.type ?? "lib")} });
|
|
16
20
|
|