@akanjs/cli 2.1.1-rc.2 → 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 +454 -137
- package/index.js +513 -196
- package/package.json +2 -2
- package/templates/module/__Model__.Unit.tsx +5 -2
- package/typecheck.proc.js +19 -0
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,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.1
|
|
38
|
+
"akanjs": "2.1.1",
|
|
39
39
|
"chalk": "^5.6.2",
|
|
40
40
|
"commander": "^14.0.3",
|
|
41
41
|
"daisyui": "^5.5.20",
|
|
@@ -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,6 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __require = import.meta.require;
|
|
3
3
|
|
|
4
|
+
// pkgs/@akanjs/devkit/typecheck/typecheck.proc.ts
|
|
5
|
+
import { Logger } from "akanjs/common";
|
|
6
|
+
|
|
4
7
|
// pkgs/@akanjs/devkit/typeChecker.ts
|
|
5
8
|
import { readFileSync } from "fs";
|
|
6
9
|
import * as path from "path";
|
|
@@ -194,6 +197,22 @@ ${summary.join(", ")} found${output.join(`
|
|
|
194
197
|
|
|
195
198
|
// pkgs/@akanjs/devkit/typecheck/typecheck.proc.ts
|
|
196
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
|
+
}
|
|
197
216
|
const configPath = process.env.AKAN_TYPECHECK_TSCONFIG;
|
|
198
217
|
if (!configPath)
|
|
199
218
|
throw new Error("AKAN_TYPECHECK_TSCONFIG is required");
|