@akanjs/cli 3.2.0-rc.3 → 3.2.0-rc.31
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/.build-stamp +2 -1
- package/CodeAgent-c17abdbf.js +11 -0
- package/{CodeTui-wv9yf7eq.js → CodeTui-jed1nj82.js} +822 -666
- package/README.ko.md +26 -1
- package/README.md +26 -1
- package/TunnelShare-mbfcaqg0.js +18 -0
- package/agent.command-9whnc6vb.js +56 -0
- package/akanCode.js +12 -12
- package/appExecutor-020cyesq.js +11 -0
- package/{application.command-6515t682.js → application.command-4eqvyxkw.js} +77 -36
- package/{applicationBuildRunner-bqbyeg84.js → applicationBuildRunner-frtcrqfd.js} +18 -13
- package/buildBatch.proc.js +26 -11
- package/{cloud.command-32esk0v1.js → cloud.command-hbvmeezn.js} +31 -28
- package/cloud.script-9kmbr3d6.js +35 -0
- package/{code.command-xk7rwq2x.js → code.command-0ayrenk4.js} +14 -9
- package/{context.command-jwenkkf0.js → context.command-php852kf.js} +28 -23
- package/context.runner-nngmn7c0.js +34 -0
- package/{dependencyScanner-78sq8m4q.js → dependencyScanner-ge10gb52.js} +2 -2
- package/{devTui-cd03z4mx.js → devTui-rf374y2w.js} +1 -1
- package/{fileSys-zpvt5gtf.js → fileSys-q22646yc.js} +1 -1
- package/{guideline.command-w6yqpdec.js → guideline.command-w1grfwh7.js} +9 -4
- package/guidelines/agentRule/agentRule.instruction.md +29 -12
- package/guidelines/akanApi/akanApi.instruction.md +6 -4
- package/guidelines/conventions/core.md +23 -5
- package/guidelines/conventions/rules/app.md +4 -1
- package/guidelines/conventions/rules/page.md +5 -0
- package/guidelines/conventions/rules/ts.md +3 -3
- package/guidelines/errorCodes/errorCodes.instruction.md +164 -0
- package/guidelines/fieldRule/fieldRule.instruction.md +2 -1
- package/guidelines/mcpRule/mcpRule.instruction.md +171 -2
- package/guidelines/pageRule/pageRule.instruction.md +15 -1
- package/guidelines/runtimeRule/runtimeRule.instruction.md +12 -6
- package/guidelines/transportRule/transportRule.instruction.md +8 -1
- package/incrementalBuilder.proc.js +574 -410
- package/{index-w15mg3km.js → index-0dm25wvf.js} +1 -1
- package/{index-xrmrvafh.js → index-0gaj78wn.js} +808 -694
- package/{index-j1hjb477.js → index-11d7nh8a.js} +1 -1
- package/{index-hj6w4ka1.js → index-1p81ecbz.js} +1 -1
- package/{index-ygrdw6jw.js → index-1pjwsh2g.js} +65 -8
- package/{index-43acpsc7.js → index-28nk8w3j.js} +12 -12
- package/{index-qd7xn2bk.js → index-2ny1e95c.js} +2 -2
- package/{index-8gm4yag8.js → index-42jhx2ya.js} +6 -6
- package/{index-2rqyrvcy.js → index-4st0hq72.js} +62 -33
- package/{index-bak9f2br.js → index-5d57kx0s.js} +15 -11
- package/{index-bdmgqzb5.js → index-6469101k.js} +58 -29
- package/{index-7kmbqp0b.js → index-6pxmcaq8.js} +1 -1
- package/{index-54s6knqe.js → index-6zb17wcm.js} +12 -10
- package/{index-0ba8nj4d.js → index-7bs463x7.js} +50 -38
- package/{index-y725zb1a.js → index-7v7tvgt7.js} +196 -168
- package/{index-r0a604h4.js → index-99kjwyma.js} +1 -1
- package/{index-2mrn1mrg.js → index-9f3reh2y.js} +1 -1
- package/{index-386canwe.js → index-9rv2zt48.js} +186 -121
- package/{index-20wvskt8.js → index-9wab2ngg.js} +1 -1
- package/{index-2eym1yjb.js → index-9wjrwjgz.js} +288 -209
- package/{index-kcpk2d20.js → index-at6haq2x.js} +1474 -1139
- package/{index-6h775rv3.js → index-ba2xd32s.js} +53 -12
- package/{index-yf9wc28h.js → index-bejy9zyc.js} +1 -1
- package/{index-ngpt3zz3.js → index-bj8s07s7.js} +525 -440
- package/{index-bns3wcpc.js → index-by2tvsq6.js} +1 -1
- package/{index-vbhx60x5.js → index-cb91b6d8.js} +2140 -2165
- package/index-dss3ds74.js +127 -0
- package/{index-e22zedc2.js → index-f16kr6vj.js} +3 -3
- package/{index-ny2k80mv.js → index-ffa52fwf.js} +1 -1
- package/{index-djc5nxpy.js → index-fp5xf6ef.js} +6 -6
- package/{index-qrk06tfp.js → index-g45y5f3e.js} +2 -2
- package/{index-8jpc5fqv.js → index-g7jgd4xs.js} +2 -2
- package/index-j4yvgfhr.js +70 -0
- package/{index-ytpmk3pb.js → index-jgj31xvw.js} +18 -11
- package/{index-j6eeh5d7.js → index-knpm8sdm.js} +5 -5
- package/{index-s34v3y28.js → index-m3t28rt3.js} +11 -11
- package/{index-dpgywgeq.js → index-m5gg0wzv.js} +27 -16
- package/index-na8r4a27.js +30 -0
- package/{index-h0p6n4k1.js → index-nm7nt9vm.js} +3 -3
- package/{index-j4hkbzj6.js → index-p06kfhdf.js} +6 -6
- package/{index-35j83zkd.js → index-p5zh7pmc.js} +2 -2
- package/{index-cmg5ngqa.js → index-p7beqww9.js} +2 -2
- package/{index-zhkcab5a.js → index-prgvqqxe.js} +580 -364
- package/{index-wfmpxke3.js → index-qssq2d41.js} +2775 -3677
- package/{index-sc0g6zbm.js → index-rwgqba9p.js} +24 -11
- package/{index-zcdmnfrf.js → index-s3m89wt2.js} +9 -9
- package/{index-v50xjbbe.js → index-t4d0ckde.js} +1 -1
- package/{index-9p260r4e.js → index-trffs83s.js} +538 -250
- package/{index-ddk49ypz.js → index-v929w7j7.js} +133 -49
- package/index-va90m8nd.js +25 -0
- package/index-vjbne22r.js +80 -0
- package/{index-h7hehkw6.js → index-xczjdng6.js} +3 -1
- package/{index-39jz41jb.js → index-xs9a3ddt.js} +3 -3
- package/{index-84c2pgak.js → index-yvzm8mby.js} +94 -82
- package/{index-wr9magsr.js → index-yxkjsyx8.js} +3 -3
- package/index-ze48c0vd.js +788 -0
- package/{index-ygdbn9jn.js → index-zyb0ebm4.js} +1 -1
- package/index.js +29 -24
- package/libExecutor-tq994592.js +10 -0
- package/{library.command-qs8beggh.js → library.command-x219mhcx.js} +9 -4
- package/{localRegistry.command-hz4ged9n.js → localRegistry.command-zvdcejhn.js} +30 -24
- package/{module.command-z9js77m2.js → module.command-k6cwcm7g.js} +17 -8
- package/{package.command-zqenq8c0.js → package.command-vw7x09f8.js} +13 -8
- package/package.json +2 -2
- package/{page.command-t0nx1jat.js → page.command-gf06paq2.js} +9 -4
- package/{pipeline.command-2yjeas7m.js → pipeline.command-y07dgj9b.js} +14 -8
- package/pkgExecutor-stde3yc3.js +10 -0
- package/{primitive.command-v5kypwy4.js → primitive.command-edydvh07.js} +13 -8
- package/{projectTypecheck-s9hhe5sa.js → projectTypecheck-mk8wefvd.js} +2 -1
- package/{prompter-qrwx1p17.js → prompter-qyggfhqd.js} +2 -2
- package/{quality.command-q55j2htd.js → quality.command-mdb45vyr.js} +23 -16
- package/{recipeScanner-4b69ybe0.js → recipeScanner-rrx69awy.js} +1 -1
- package/{repair.command-7ssbbdq2.js → repair.command-kvtaeecy.js} +13 -8
- package/{routeSourceValidator-4h947v7c.js → routeSourceValidator-8n6j1vn7.js} +4 -2
- package/{scalar.command-p5jb7z57.js → scalar.command-sjt9p5e1.js} +11 -6
- package/skills/akan-debug/SKILL.md +10 -3
- package/skills/akan-err/SKILL.md +7 -0
- package/skills/akan-mcp/SKILL.md +17 -2
- package/skills/akan-scaffold/SKILL.md +2 -2
- package/skills/akan-transport/SKILL.md +2 -0
- package/skills/akan-validate/SKILL.md +1 -0
- package/{subspace.command-7wxy6ptj.js → subspace.command-mkkqync4.js} +29 -23
- package/templates/app/page/_layout.tsx +13 -0
- package/templates/app/page/styles.css.template +40 -0
- package/templates/appSample/page/_index.tsx +9 -9
- package/templates/appSample/page/_layout.tsx +1 -0
- package/templates/appSample/page/styles.css.template +40 -5
- package/templates/appSample/ui/Recipe/jellyButton.ts +1 -1
- package/templates/biomeForm.ts +1 -1
- package/templates/env/_env.server.type.ts +1 -1
- package/templates/facetIndex/index.ts +2 -37
- package/templates/lib/sig.ts +0 -4
- package/templates/lib/useClient.ts +1 -1
- package/templates/workspaceRoot/AGENTS.md.template +2 -1
- package/{tunnel.command-22g11n0x.js → tunnel.command-tr5b3030.js} +17 -12
- package/{typeChecker-s640r6c0.js → typeChecker-bfrd1n9n.js} +1 -1
- package/typecheck.proc.js +6 -3
- package/{verify.command-m0wnndd7.js → verify.command-0p9h8tpp.js} +26 -20
- package/{workflow.command-jx8dqs9n.js → workflow.command-9mfcwqzj.js} +37 -19
- package/{workspace.command-ca9kfyt3.js → workspace.command-5hjtmcfs.js} +61 -54
- package/CodeAgent-e9c712an.js +0 -11
- package/TunnelShare-zkfkrw8w.js +0 -14
- package/agent.command-9erafkcb.js +0 -51
- package/cloud.script-arsagnq6.js +0 -30
- package/context.runner-mqpp67br.js +0 -29
- package/index-x3x31df8.js +0 -14
- /package/templates/{appSample → app}/public/fonts/Pretendard-Bold.woff2 +0 -0
- /package/templates/{appSample → app}/public/fonts/Pretendard-Medium.woff2 +0 -0
- /package/templates/{appSample → app}/public/fonts/Pretendard-Regular.woff2 +0 -0
- /package/templates/{appSample → app}/public/fonts/Pretendard-SemiBold.woff2 +0 -0
|
@@ -2,21 +2,23 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-9rv2zt48.js";
|
|
6
6
|
import {
|
|
7
|
-
LibSource,
|
|
8
|
-
formatLibStatuses,
|
|
9
7
|
CommandExecutionError,
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
LibSource,
|
|
9
|
+
formatLibStatuses
|
|
10
|
+
} from "./index-qssq2d41.js";
|
|
11
|
+
import {
|
|
12
|
+
LibExecutor2
|
|
13
|
+
} from "./index-na8r4a27.js";
|
|
12
14
|
import {
|
|
13
15
|
assertPlainName
|
|
14
|
-
} from "./index-
|
|
16
|
+
} from "./index-va90m8nd.js";
|
|
15
17
|
|
|
16
18
|
// pkgs/@akanjs/cli/library/library.script.ts
|
|
17
19
|
import { Logger } from "akanjs/common";
|
|
18
20
|
|
|
19
|
-
// pkgs/@akanjs/devkit/semver.ts
|
|
21
|
+
// pkgs/@akanjs/devkit/util/semver.ts
|
|
20
22
|
var stripRangeOperator = (version) => version.replace(/^[\s^~>=<v]+/, "").trim();
|
|
21
23
|
var parseVersion = (version) => version.replace(/^[^\d]*/, "").split(/[.-]/).map((part) => Number.parseInt(part, 10)).map((part) => Number.isFinite(part) ? part : 0);
|
|
22
24
|
var compareNumeric = (a, b) => {
|
|
@@ -46,7 +48,7 @@ class LibraryRunner extends runner("library") {
|
|
|
46
48
|
async createLibrary(libName, workspace) {
|
|
47
49
|
await workspace.mkdir(`libs/${libName}`);
|
|
48
50
|
await workspace.applyTemplate({ basePath: `libs/${libName}`, template: "libRoot", dict: { libName } });
|
|
49
|
-
return
|
|
51
|
+
return LibExecutor2.from(workspace, libName);
|
|
50
52
|
}
|
|
51
53
|
async removeLibrary(lib) {
|
|
52
54
|
await lib.workspace.removeDir(`libs/${lib.name}`);
|
|
@@ -102,7 +104,7 @@ class LibraryRunner extends runner("library") {
|
|
|
102
104
|
const testingEnv = `libs/${libName}/env/env.server.testing.ts`;
|
|
103
105
|
if (!await workspace.exists(testingEnv))
|
|
104
106
|
await workspace.cp(`libs/${libName}/env/env.server.example.ts`, testingEnv);
|
|
105
|
-
const lib =
|
|
107
|
+
const lib = LibExecutor2.from(workspace, libName);
|
|
106
108
|
const stamp = await new LibSource(lib).write(source);
|
|
107
109
|
if (await workspace.hasChanges())
|
|
108
110
|
await workspace.commit(`Install ${libName} library from ${stamp.origin}`);
|
|
@@ -110,7 +112,7 @@ class LibraryRunner extends runner("library") {
|
|
|
110
112
|
}
|
|
111
113
|
async libraryStatuses(workspace) {
|
|
112
114
|
const libNames = await workspace.getLibs();
|
|
113
|
-
return await Promise.all(libNames.map((libName) => new LibSource(
|
|
115
|
+
return await Promise.all(libNames.map((libName) => new LibSource(LibExecutor2.from(workspace, libName)).status()));
|
|
114
116
|
}
|
|
115
117
|
async mergeLibraryDependencies(lib) {
|
|
116
118
|
const [libPackageJson, rootPackageJson] = await Promise.all([lib.getPackageJson(), lib.workspace.getPackageJson()]);
|
|
@@ -1,54 +1,61 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
script
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-9rv2zt48.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
AppExecutor2
|
|
7
|
+
} from "./index-ze48c0vd.js";
|
|
8
|
+
import {
|
|
9
|
+
LibExecutor2
|
|
10
|
+
} from "./index-na8r4a27.js";
|
|
10
11
|
import {
|
|
11
12
|
InteractionScaffold,
|
|
12
13
|
workflowStatus,
|
|
13
14
|
compactDiagnostics,
|
|
14
15
|
generatedFilePathsForTarget,
|
|
15
|
-
|
|
16
|
-
moduleComponentName,
|
|
17
|
-
moduleSourcePaths,
|
|
18
|
-
generatedFilesForSync,
|
|
19
|
-
validationCommandsForTarget,
|
|
20
|
-
nextActionsForTarget,
|
|
21
|
-
createPrimitiveWriteReport,
|
|
22
|
-
normalizeFieldType,
|
|
16
|
+
hasSourceParseErrors,
|
|
23
17
|
ensureNamedImport,
|
|
24
18
|
ensureBaseImport,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
fieldExpression,
|
|
19
|
+
ensureEnumImport,
|
|
20
|
+
ensureConstantTypeImport,
|
|
28
21
|
viaBuilderParameterName,
|
|
29
22
|
insertIntoObject,
|
|
30
23
|
insertLightProjectionField,
|
|
31
|
-
insertTemplateField,
|
|
32
|
-
ensureEnumImport,
|
|
33
24
|
insertEnumClass,
|
|
34
|
-
insertDictionaryModelField,
|
|
35
25
|
hasConstantInputField,
|
|
26
|
+
insertDictionaryModelField,
|
|
36
27
|
hasDictionaryModelField,
|
|
37
|
-
ensureConstantTypeImport,
|
|
38
28
|
insertDictionaryEnum,
|
|
29
|
+
normalizeFieldType,
|
|
30
|
+
coerceFieldDefault,
|
|
31
|
+
fieldExpression,
|
|
39
32
|
parseValues,
|
|
40
|
-
|
|
33
|
+
moduleComponentName,
|
|
34
|
+
moduleSourcePaths,
|
|
35
|
+
addFieldUiPolicyForType,
|
|
36
|
+
withFieldTypeImport,
|
|
37
|
+
KeyRename,
|
|
41
38
|
hasClassMethod,
|
|
42
39
|
insertClassMethod,
|
|
43
40
|
hasSignalFactoryEntry,
|
|
44
41
|
insertSignalFactoryEntry,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
MutationScaffold,
|
|
43
|
+
sourceFile,
|
|
44
|
+
generatedFilesForSync,
|
|
45
|
+
validationCommandsForTarget,
|
|
46
|
+
nextActionsForTarget,
|
|
47
|
+
createPrimitiveWriteReport,
|
|
48
|
+
insertTemplateField
|
|
49
|
+
} from "./index-0gaj78wn.js";
|
|
49
50
|
import {
|
|
50
51
|
ModuleScript
|
|
51
|
-
} from "./index-
|
|
52
|
+
} from "./index-m3t28rt3.js";
|
|
53
|
+
import {
|
|
54
|
+
plainNameProblem
|
|
55
|
+
} from "./index-va90m8nd.js";
|
|
56
|
+
import {
|
|
57
|
+
ModuleExecutor
|
|
58
|
+
} from "./index-vjbne22r.js";
|
|
52
59
|
|
|
53
60
|
// pkgs/@akanjs/cli/primitive/primitive.script.ts
|
|
54
61
|
import { capitalize, lowerlize } from "akanjs/common";
|
|
@@ -58,18 +65,16 @@ class PrimitiveScript extends script("primitive", [ModuleScript]) {
|
|
|
58
65
|
return null;
|
|
59
66
|
const [apps, libs] = await workspace.getSyss();
|
|
60
67
|
if (apps.includes(target))
|
|
61
|
-
return
|
|
68
|
+
return AppExecutor2.from(workspace, target);
|
|
62
69
|
if (libs.includes(target))
|
|
63
|
-
return
|
|
70
|
+
return LibExecutor2.from(workspace, target);
|
|
64
71
|
return null;
|
|
65
72
|
}
|
|
66
73
|
async createUi(workspace, input) {
|
|
67
74
|
const sys = await this.resolveSys(workspace, input.app);
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
!input.module && PrimitiveScript.#inputMissing("module")
|
|
72
|
-
]));
|
|
75
|
+
const moduleProblem = PrimitiveScript.#moduleProblem(input.module);
|
|
76
|
+
if (!sys || !input.module || moduleProblem)
|
|
77
|
+
return PrimitiveScript.#refuse("create-ui", compactDiagnostics([!sys && PrimitiveScript.#targetMissing(), moduleProblem]));
|
|
73
78
|
const mod = ModuleExecutor.from(sys, input.module);
|
|
74
79
|
if (input.surface === "view")
|
|
75
80
|
return await this.moduleScript.createView(mod);
|
|
@@ -91,7 +96,7 @@ class PrimitiveScript extends script("primitive", [ModuleScript]) {
|
|
|
91
96
|
const normalizedType = input.type ? normalizeFieldType(input.type) : null;
|
|
92
97
|
const diagnostics = compactDiagnostics([
|
|
93
98
|
!sys && PrimitiveScript.#targetMissing(),
|
|
94
|
-
|
|
99
|
+
PrimitiveScript.#moduleProblem(input.module),
|
|
95
100
|
!input.field && PrimitiveScript.#inputMissing("field"),
|
|
96
101
|
!input.type && PrimitiveScript.#inputMissing("type"),
|
|
97
102
|
enumValues?.length === 0 && PrimitiveScript.#inputMissing("values", "Enum values are required."),
|
|
@@ -157,7 +162,7 @@ class PrimitiveScript extends script("primitive", [ModuleScript]) {
|
|
|
157
162
|
const defaultCoercion = coerceFieldDefault(input.type, input.defaultValue);
|
|
158
163
|
if (defaultCoercion.diagnostic)
|
|
159
164
|
diagnostics.push(defaultCoercion.diagnostic);
|
|
160
|
-
constantContent =
|
|
165
|
+
constantContent = await withFieldTypeImport(sys, input.module, input.type, constantContent, diagnostics);
|
|
161
166
|
if (input.type === "Date" && defaultCoercion.expression)
|
|
162
167
|
constantContent = ensureBaseImport(constantContent, "dayjs");
|
|
163
168
|
}
|
|
@@ -451,13 +456,14 @@ class PrimitiveScript extends script("primitive", [ModuleScript]) {
|
|
|
451
456
|
});
|
|
452
457
|
}
|
|
453
458
|
static #report(command, sys, changedFiles, diagnostics) {
|
|
459
|
+
const failed = workflowStatus(diagnostics) === "failed";
|
|
454
460
|
return createPrimitiveWriteReport({
|
|
455
461
|
command,
|
|
456
462
|
changedFiles,
|
|
457
|
-
generatedFiles: generatedFilesForSync(sys),
|
|
458
|
-
validationCommands: validationCommandsForTarget(sys.name),
|
|
463
|
+
generatedFiles: failed ? [] : generatedFilesForSync(sys),
|
|
464
|
+
validationCommands: failed ? [] : validationCommandsForTarget(sys.name),
|
|
459
465
|
diagnostics,
|
|
460
|
-
nextActions: nextActionsForTarget(sys.name)
|
|
466
|
+
nextActions: failed ? [] : nextActionsForTarget(sys.name)
|
|
461
467
|
});
|
|
462
468
|
}
|
|
463
469
|
static #targetMissing() {
|
|
@@ -466,6 +472,12 @@ class PrimitiveScript extends script("primitive", [ModuleScript]) {
|
|
|
466
472
|
static #inputMissing(input, message = `${capitalize(input)} is required.`) {
|
|
467
473
|
return { severity: "error", code: "primitive-input-missing", message, input };
|
|
468
474
|
}
|
|
475
|
+
static #moduleProblem(module) {
|
|
476
|
+
if (!module)
|
|
477
|
+
return PrimitiveScript.#inputMissing("module");
|
|
478
|
+
const message = plainNameProblem("module", module);
|
|
479
|
+
return message ? { severity: "error", code: "primitive-input-invalid", message, input: "module" } : null;
|
|
480
|
+
}
|
|
469
481
|
static #sourceMissing(kind, path) {
|
|
470
482
|
return {
|
|
471
483
|
severity: "error",
|