@akanjs/cli 2.1.1-rc.1 → 2.1.1
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/guidelines/modelConstant/modelConstant.generate.json +1 -0
- package/guidelines/modelDictionary/modelDictionary.generate.json +1 -0
- package/guidelines/scalarConstant/scalarConstant.generate.json +1 -0
- package/guidelines/scalarDictionary/scalarDictionary.generate.json +1 -0
- package/incrementalBuilder.proc.js +795 -590
- package/index.js +1086 -682
- package/package.json +3 -2
- package/templates/module/__Model__.Unit.tsx +5 -2
- package/typecheck.proc.js +19 -31
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "2.1.1
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -35,10 +35,11 @@
|
|
|
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.1
|
|
38
|
+
"akanjs": "2.1.1",
|
|
39
39
|
"chalk": "^5.6.2",
|
|
40
40
|
"commander": "^14.0.3",
|
|
41
41
|
"daisyui": "^5.5.20",
|
|
42
|
+
"dayjs": "^1.11.20",
|
|
42
43
|
"fontaine": "^0.8.0",
|
|
43
44
|
"fonteditor-core": "^2.6.3",
|
|
44
45
|
"ignore": "^7.0.5",
|
|
@@ -5,11 +5,14 @@ interface Dict {
|
|
|
5
5
|
model: string;
|
|
6
6
|
sysName: string;
|
|
7
7
|
}
|
|
8
|
-
export default function getContent(
|
|
8
|
+
export default function getContent(
|
|
9
|
+
scanInfo: AppInfo | LibInfo | null,
|
|
10
|
+
dict: Dict,
|
|
11
|
+
) {
|
|
9
12
|
return {
|
|
10
13
|
filename: `${dict.Model}.Unit.tsx`,
|
|
11
14
|
content: `
|
|
12
|
-
import { ModelProps } from "akanjs/client";
|
|
15
|
+
import type { ModelProps } from "akanjs/client";
|
|
13
16
|
import { cnst, usePage } from "@${scanInfo?.type ?? "apps"}/${dict.sysName}/client";
|
|
14
17
|
import { Link } from "akanjs/ui";
|
|
15
18
|
|
package/typecheck.proc.js
CHANGED
|
@@ -1,37 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
function __accessProp(key) {
|
|
8
|
-
return this[key];
|
|
9
|
-
}
|
|
10
|
-
var __toESMCache_node;
|
|
11
|
-
var __toESMCache_esm;
|
|
12
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
-
var canCache = mod != null && typeof mod === "object";
|
|
14
|
-
if (canCache) {
|
|
15
|
-
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
-
var cached = cache.get(mod);
|
|
17
|
-
if (cached)
|
|
18
|
-
return cached;
|
|
19
|
-
}
|
|
20
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
for (let key of __getOwnPropNames(mod))
|
|
23
|
-
if (!__hasOwnProp.call(to, key))
|
|
24
|
-
__defProp(to, key, {
|
|
25
|
-
get: __accessProp.bind(mod, key),
|
|
26
|
-
enumerable: true
|
|
27
|
-
});
|
|
28
|
-
if (canCache)
|
|
29
|
-
cache.set(mod, to);
|
|
30
|
-
return to;
|
|
31
|
-
};
|
|
32
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
33
2
|
var __require = import.meta.require;
|
|
34
3
|
|
|
4
|
+
// pkgs/@akanjs/devkit/typecheck/typecheck.proc.ts
|
|
5
|
+
import { Logger } from "akanjs/common";
|
|
6
|
+
|
|
35
7
|
// pkgs/@akanjs/devkit/typeChecker.ts
|
|
36
8
|
import { readFileSync } from "fs";
|
|
37
9
|
import * as path from "path";
|
|
@@ -225,6 +197,22 @@ ${summary.join(", ")} found${output.join(`
|
|
|
225
197
|
|
|
226
198
|
// pkgs/@akanjs/devkit/typecheck/typecheck.proc.ts
|
|
227
199
|
try {
|
|
200
|
+
const filePath = process.env.AKAN_TYPECHECK_FILE;
|
|
201
|
+
if (filePath) {
|
|
202
|
+
const cwdPath = process.env.AKAN_TYPECHECK_CWD;
|
|
203
|
+
if (!cwdPath)
|
|
204
|
+
throw new Error("AKAN_TYPECHECK_CWD is required");
|
|
205
|
+
const typeChecker = new TypeChecker({ cwdPath });
|
|
206
|
+
const { fileDiagnostics, fileErrors, fileWarnings } = typeChecker.check(filePath);
|
|
207
|
+
const message = typeChecker.formatDiagnostics(fileDiagnostics);
|
|
208
|
+
Logger.rawLog(JSON.stringify({
|
|
209
|
+
fileDiagnosticsCount: fileDiagnostics.length,
|
|
210
|
+
fileErrorsCount: fileErrors.length,
|
|
211
|
+
fileWarningsCount: fileWarnings.length,
|
|
212
|
+
message
|
|
213
|
+
}));
|
|
214
|
+
process.exit(0);
|
|
215
|
+
}
|
|
228
216
|
const configPath = process.env.AKAN_TYPECHECK_TSCONFIG;
|
|
229
217
|
if (!configPath)
|
|
230
218
|
throw new Error("AKAN_TYPECHECK_TSCONFIG is required");
|