@akanjs/cli 3.0.0-alpha.1 → 3.0.0-alpha.11
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 +1 -1
- package/{agent.command-yv00p0s0.js → agent.command-a3n15c6t.js} +7 -6
- package/{application.command-0qsczf4k.js → application.command-rdm3et0g.js} +5 -4
- package/{applicationBuildRunner-ct2pxyvw.js → applicationBuildRunner-6m8n71w4.js} +3 -3
- package/buildBatch.proc.js +4 -3
- package/{capacitorApp-4r9sm3qg.js → capacitorApp-mr81qdxq.js} +5 -2
- package/{cloud.command-dxfv18sa.js → cloud.command-56aeekqn.js} +8 -7
- package/{context.command-8d9e3k6b.js → context.command-ysxawe7h.js} +14 -13
- package/getDirname-m9s0cmhq.js +8 -0
- package/{guideline.command-3jbkxzh6.js → guideline.command-yqf9a372.js} +5 -4
- package/guidelines/conventions/conventions.generate.json +25 -0
- package/guidelines/conventions/conventions.instruction.md +825 -0
- package/guidelines/cssRule/cssRule.instruction.md +7 -0
- package/guidelines/framework/framework.instruction.md +1 -0
- package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +24 -0
- package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +974 -0
- package/incrementalBuilder.proc.js +3 -2
- package/index-1577bej2.js +7 -0
- package/{index-1pvex4az.js → index-3789fdpg.js} +13 -13
- package/{index-ec09pws3.js → index-4mgkgba3.js} +3 -3
- package/{index-bbkek1bp.js → index-65aeh789.js} +1 -1
- package/{index-7c6k4yvg.js → index-8pd02prk.js} +2 -2
- package/{index-t3723f99.js → index-9va8zayb.js} +86 -17
- package/{index-nm6wghb6.js → index-a5cs7d8r.js} +5 -5
- package/{index-e16gnn26.js → index-bzznxgcx.js} +7 -7
- package/{index-pyt2b4nw.js → index-cav1azma.js} +103 -22
- package/{index-2q1f5j9k.js → index-cv9cxs5k.js} +3 -3
- package/{index-a00jg8x8.js → index-e4b2ae6b.js} +49 -32
- package/{index-8hsbnyes.js → index-etwh7sd3.js} +4 -2
- package/{index-k95xkh4p.js → index-h5whaj26.js} +2 -2
- package/{index-tdbas9r0.js → index-j37qq1f2.js} +1 -1
- package/{index-rh16j3c7.js → index-j9cxndc0.js} +3 -2
- package/{index-rzwcpcc3.js → index-kcsa1zff.js} +1 -1
- package/{index-bekddz9q.js → index-m90fn8xe.js} +4 -4
- package/{index-yzmhasdb.js → index-mewacxye.js} +7 -7
- package/{index-zasydjxd.js → index-nwqqssnb.js} +8 -10
- package/{index-mr5s7mqd.js → index-yzmqvg23.js} +3 -3
- package/{index-hgna5rjy.js → index-yzsxc30b.js} +94 -47
- package/{index-ej426mcr.js → index-z1s5f4e0.js} +34 -6
- package/index.js +19 -18
- package/{library.command-ebdj1vnm.js → library.command-x6t29a30.js} +4 -3
- package/{localRegistry.command-gb178ne8.js → localRegistry.command-649g1n7b.js} +7 -6
- package/{module.command-9c1bnsx4.js → module.command-8w8ys5t3.js} +7 -6
- package/{package.command-t93p4jkj.js → package.command-zgy7f3fz.js} +4 -3
- package/package.json +2 -2
- package/{page.command-k3k0meh2.js → page.command-yjmnkyk2.js} +4 -3
- package/{primitive.command-de6nktdt.js → primitive.command-gfqaagsg.js} +8 -7
- package/{quality.command-z5kth2wa.js → quality.command-ec8r1dn3.js} +369 -128
- package/{repair.command-ehf2g112.js → repair.command-p9ey6mkm.js} +6 -5
- package/{routeSourceValidator-cncd92fv.js → routeSourceValidator-e4jmbfcx.js} +2 -38
- package/{scalar.command-7a2jtv33.js → scalar.command-9dhmqhtm.js} +6 -5
- package/templates/app/page/styles.css.template +3 -3
- package/templates/appSample/srvkit/AuthGuard.ts +9 -5
- package/templates/appSample/srvkit/SessionInternalArg.ts +4 -3
- package/templates/crudPages/[__model__Id]/edit/page.tsx +1 -1
- package/templates/crudPages/new/page.tsx +1 -1
- package/templates/crudSinglePage/page.tsx +1 -1
- package/templates/lib/db.ts +3 -1
- package/templates/lib/useClient.ts +9 -3
- package/templates/module/__Model__.Util.tsx +1 -1
- package/templates/module/__Model__.Zone.tsx +3 -5
- package/templates/workspaceRoot/AGENTS.md.template +0 -948
- package/templates/workspaceRoot/biome.json.template +4 -198
- package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +4 -1
- package/{workflow.command-e0tt0vk2.js → workflow.command-ycwc6zr6.js} +13 -12
- package/{workspace.command-fpda0evj.js → workspace.command-xhyhajxa.js} +67 -48
- package/templates/libRoot/base/baseLogic.ts +0 -14
- package/templates/libRoot/base/index.ts +0 -8
- package/templates/workspaceRoot/.cursor/rules/akan-page-routing.mdc.template +0 -43
- package/templates/workspaceRoot/.cursor/rules/akan-sync-conventions.mdc.template +0 -33
- package/templates/workspaceRoot/.cursor/rules/application-test-commands.mdc.template +0 -16
- package/templates/workspaceRoot/.cursor/rules/change-scope.mdc.template +0 -12
- package/templates/workspaceRoot/.cursor/rules/client-server-boundaries.mdc.template +0 -18
- package/templates/workspaceRoot/.cursor/rules/coding-comments.mdc.template +0 -25
- package/templates/workspaceRoot/.cursor/rules/coding-style.mdc.template +0 -44
- package/templates/workspaceRoot/.cursor/rules/domain-module-conventions.mdc.template +0 -17
- package/templates/workspaceRoot/.cursor/rules/format-lint.mdc.template +0 -12
- package/templates/workspaceRoot/.cursor/rules/lint-enforced-rules.mdc.template +0 -18
- package/templates/workspaceRoot/.cursor/rules/module-file-playbook.mdc.template +0 -61
- package/templates/workspaceRoot/.cursor/rules/naming-conventions.mdc.template +0 -15
- package/templates/workspaceRoot/.cursor/rules/react-component-style.mdc.template +0 -21
- package/templates/workspaceRoot/.cursor/rules/repo-overview.mdc.template +0 -17
- package/templates/workspaceRoot/.cursor/rules/scalar-modeling.mdc.template +0 -58
- package/templates/workspaceRoot/.cursor/rules/secrets-and-env.mdc.template +0 -13
- package/templates/workspaceRoot/.cursor/rules/service-signal-conventions.mdc.template +0 -83
- package/templates/workspaceRoot/.cursor/rules/srvkit-adapters-and-guards.mdc.template +0 -50
- package/templates/workspaceRoot/.cursor/rules/ssr-first.mdc.template +0 -59
- package/templates/workspaceRoot/.cursor/rules/typescript-imports.mdc.template +0 -16
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Spinner
|
|
4
4
|
} from "./index-mxvakhsm.js";
|
|
5
|
+
import {
|
|
6
|
+
getDirname
|
|
7
|
+
} from "./index-1577bej2.js";
|
|
5
8
|
import {
|
|
6
9
|
FileSys
|
|
7
10
|
} from "./index-67546d0j.js";
|
|
@@ -44,6 +47,21 @@ var recipeScannerLoad = null;
|
|
|
44
47
|
var loadRecipeScanner = () => recipeScannerLoad ??= import("./recipeScanner-tghkzrrt.js");
|
|
45
48
|
var AGENT_BLOCK_START = "<!-- akan:agent:start -->";
|
|
46
49
|
var AGENT_BLOCK_END = "<!-- akan:agent:end -->";
|
|
50
|
+
var AGENT_VERSION_PREFIX = "<!-- akan:agent:version ";
|
|
51
|
+
var stampBlockVersion = (block, version) => `${AGENT_VERSION_PREFIX}${version} -->
|
|
52
|
+
|
|
53
|
+
${block}`;
|
|
54
|
+
var extractBlockVersion = (content) => content.match(/<!-- akan:agent:version ([^\s]+) -->/)?.[1] ?? null;
|
|
55
|
+
var readDevkitVersion = async () => {
|
|
56
|
+
const { readFile } = await import("fs/promises");
|
|
57
|
+
const { getDirname: getDirname2 } = await import("./getDirname-m9s0cmhq.js");
|
|
58
|
+
try {
|
|
59
|
+
const raw = await readFile(`${getDirname2(import.meta.url)}/package.json`, "utf-8");
|
|
60
|
+
return JSON.parse(raw).version ?? null;
|
|
61
|
+
} catch {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
47
65
|
var upsertAgentBlock = (existing, block) => {
|
|
48
66
|
const managed = `${AGENT_BLOCK_START}
|
|
49
67
|
${block}
|
|
@@ -627,42 +645,47 @@ var decreaseBuildNum = async (app) => {
|
|
|
627
645
|
const akanConfigContent = akanConfig.replace(`buildNum: ${appConfig.mobile.buildNum}`, `buildNum: ${appConfig.mobile.buildNum - 1}`);
|
|
628
646
|
fs.writeFileSync(akanConfigPath, akanConfigContent);
|
|
629
647
|
};
|
|
630
|
-
// pkgs/@akanjs/devkit/getDirname.ts
|
|
631
|
-
import path2 from "path";
|
|
632
|
-
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
633
|
-
var getDirname = (url) => path2.dirname(fileURLToPath2(url));
|
|
634
|
-
|
|
635
648
|
// pkgs/@akanjs/devkit/linter.ts
|
|
636
649
|
import { spawn } from "child_process";
|
|
637
650
|
import { existsSync, readFileSync } from "fs";
|
|
638
|
-
import
|
|
651
|
+
import path2 from "path";
|
|
639
652
|
import chalk from "chalk";
|
|
653
|
+
var BIOME_CONFIG_FILES = ["biome.json", "biome.jsonc"];
|
|
640
654
|
|
|
641
655
|
class Linter {
|
|
642
656
|
lintRoot;
|
|
657
|
+
configPath;
|
|
643
658
|
#biomeBin;
|
|
644
659
|
constructor(cwdPath) {
|
|
645
660
|
this.lintRoot = this.#findBiomeRootPath(cwdPath);
|
|
646
|
-
|
|
661
|
+
this.configPath = Linter.#configPathIn(this.lintRoot) ?? path2.join(this.lintRoot, "biome.json");
|
|
662
|
+
const localBiomeBin = path2.join(this.lintRoot, "node_modules/.bin/biome");
|
|
647
663
|
this.#biomeBin = existsSync(localBiomeBin) ? localBiomeBin : "biome";
|
|
648
664
|
}
|
|
665
|
+
static #configPathIn(dir) {
|
|
666
|
+
for (const fileName of BIOME_CONFIG_FILES) {
|
|
667
|
+
const configPath = path2.join(dir, fileName);
|
|
668
|
+
if (existsSync(configPath))
|
|
669
|
+
return configPath;
|
|
670
|
+
}
|
|
671
|
+
return null;
|
|
672
|
+
}
|
|
649
673
|
#findBiomeRootPath(dir) {
|
|
650
|
-
|
|
651
|
-
if (existsSync(configPath))
|
|
674
|
+
if (Linter.#configPathIn(dir))
|
|
652
675
|
return dir;
|
|
653
|
-
const parentDir =
|
|
676
|
+
const parentDir = path2.dirname(dir);
|
|
654
677
|
if (parentDir === dir)
|
|
655
678
|
throw new Error(`biome.json not found from ${dir}`);
|
|
656
679
|
return this.#findBiomeRootPath(parentDir);
|
|
657
680
|
}
|
|
658
681
|
#toBiomePath(filePath) {
|
|
659
|
-
const relativePath =
|
|
660
|
-
if (!relativePath.startsWith("..") && !
|
|
682
|
+
const relativePath = path2.relative(this.lintRoot, filePath);
|
|
683
|
+
if (!relativePath.startsWith("..") && !path2.isAbsolute(relativePath))
|
|
661
684
|
return relativePath;
|
|
662
685
|
return filePath;
|
|
663
686
|
}
|
|
664
687
|
#resolveFilePath(filePath) {
|
|
665
|
-
return
|
|
688
|
+
return path2.isAbsolute(filePath) ? filePath : path2.join(this.lintRoot, filePath);
|
|
666
689
|
}
|
|
667
690
|
async#runBiome(args, input) {
|
|
668
691
|
return await new Promise((resolve, reject) => {
|
|
@@ -694,7 +717,7 @@ class Linter {
|
|
|
694
717
|
const diagnosticPath = diagnostic.location?.path;
|
|
695
718
|
if (!diagnosticPath)
|
|
696
719
|
return fallbackFilePath;
|
|
697
|
-
return
|
|
720
|
+
return path2.isAbsolute(diagnosticPath) ? diagnosticPath : path2.join(this.lintRoot, diagnosticPath);
|
|
698
721
|
}
|
|
699
722
|
#createLintMessage(diagnostic) {
|
|
700
723
|
const start = diagnostic.location?.start;
|
|
@@ -759,7 +782,7 @@ class Linter {
|
|
|
759
782
|
"--max-diagnostics=none",
|
|
760
783
|
"--no-errors-on-unmatched",
|
|
761
784
|
"--config-path",
|
|
762
|
-
|
|
785
|
+
this.configPath,
|
|
763
786
|
this.#toBiomePath(filePath)
|
|
764
787
|
]);
|
|
765
788
|
const report = this.#parseBiomeReport(stdout || stderr);
|
|
@@ -880,14 +903,7 @@ ${errorText}, ${warningText} found`];
|
|
|
880
903
|
if (!dryRun)
|
|
881
904
|
return await this.#checkFile(resolvedFilePath, { write: true });
|
|
882
905
|
const source = readFileSync(resolvedFilePath, "utf8");
|
|
883
|
-
const { stdout } = await this.#runBiome([
|
|
884
|
-
"check",
|
|
885
|
-
"--write",
|
|
886
|
-
"--config-path",
|
|
887
|
-
path3.join(this.lintRoot, "biome.json"),
|
|
888
|
-
"--stdin-file-path",
|
|
889
|
-
this.#toBiomePath(resolvedFilePath)
|
|
890
|
-
], source);
|
|
906
|
+
const { stdout } = await this.#runBiome(["check", "--write", "--config-path", this.configPath, "--stdin-file-path", this.#toBiomePath(resolvedFilePath)], source);
|
|
891
907
|
const lintResult = await this.lintFile(resolvedFilePath);
|
|
892
908
|
return { ...lintResult, fixed: stdout !== source, output: stdout };
|
|
893
909
|
}
|
|
@@ -895,7 +911,7 @@ ${errorText}, ${warningText} found`];
|
|
|
895
911
|
const resolvedFilePath = this.#resolveFilePath(filePath);
|
|
896
912
|
if (!existsSync(resolvedFilePath))
|
|
897
913
|
throw new Error(`File not found: ${filePath}`);
|
|
898
|
-
return JSON.parse(readFileSync(
|
|
914
|
+
return JSON.parse(readFileSync(this.configPath, "utf8"));
|
|
899
915
|
}
|
|
900
916
|
async getProblematicRules(filePath) {
|
|
901
917
|
const { results } = await this.lintFile(filePath);
|
|
@@ -910,22 +926,36 @@ ${errorText}, ${warningText} found`];
|
|
|
910
926
|
}
|
|
911
927
|
}
|
|
912
928
|
|
|
929
|
+
// pkgs/@akanjs/devkit/repoIdentity.ts
|
|
930
|
+
import { execFileSync } from "child_process";
|
|
931
|
+
import path3 from "path";
|
|
932
|
+
var resolved = new Map;
|
|
933
|
+
var readRemoteName = (workspaceRoot) => {
|
|
934
|
+
try {
|
|
935
|
+
const url = execFileSync("git", ["config", "--get", "remote.origin.url"], {
|
|
936
|
+
cwd: workspaceRoot,
|
|
937
|
+
encoding: "utf-8",
|
|
938
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
939
|
+
}).trim();
|
|
940
|
+
return url.replace(/\.git$/, "").split(/[/:]/).pop() || null;
|
|
941
|
+
} catch {
|
|
942
|
+
return null;
|
|
943
|
+
}
|
|
944
|
+
};
|
|
945
|
+
var resolveRepoName = (workspaceRoot) => {
|
|
946
|
+
const cached = resolved.get(workspaceRoot);
|
|
947
|
+
if (cached)
|
|
948
|
+
return cached;
|
|
949
|
+
const repoName = readRemoteName(workspaceRoot) ?? path3.basename(workspaceRoot);
|
|
950
|
+
resolved.set(workspaceRoot, repoName);
|
|
951
|
+
return repoName;
|
|
952
|
+
};
|
|
953
|
+
|
|
913
954
|
// pkgs/@akanjs/devkit/scanInfo.ts
|
|
914
955
|
import { rm } from "fs/promises";
|
|
915
956
|
import path4 from "path";
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
"dictionary",
|
|
919
|
-
"document",
|
|
920
|
-
"service",
|
|
921
|
-
"signal",
|
|
922
|
-
"store",
|
|
923
|
-
"template",
|
|
924
|
-
"unit",
|
|
925
|
-
"util",
|
|
926
|
-
"view",
|
|
927
|
-
"zone"
|
|
928
|
-
];
|
|
957
|
+
|
|
958
|
+
// pkgs/@akanjs/devkit/workspaceLayout.ts
|
|
929
959
|
var appRootAllowedFiles = new Set([
|
|
930
960
|
"AGENTS.md",
|
|
931
961
|
"CLAUDE.md",
|
|
@@ -939,25 +969,25 @@ var appRootAllowedFiles = new Set([
|
|
|
939
969
|
"tsconfig.json",
|
|
940
970
|
"tsconfig.tsbuildinfo"
|
|
941
971
|
]);
|
|
942
|
-
var generatedRootCapacitorConfigFiles = ["capacitor.config.js", "capacitor.config.json"];
|
|
943
972
|
var appRootAllowedDirs = new Set([
|
|
944
973
|
".akan",
|
|
945
974
|
"android",
|
|
975
|
+
"common",
|
|
946
976
|
"env",
|
|
947
977
|
"ios",
|
|
948
978
|
"lib",
|
|
949
979
|
"mobile",
|
|
950
980
|
"page",
|
|
981
|
+
"plugin",
|
|
951
982
|
"private",
|
|
952
983
|
"public",
|
|
953
984
|
"script",
|
|
954
|
-
"
|
|
985
|
+
"secrets",
|
|
955
986
|
"srvkit",
|
|
956
|
-
"
|
|
957
|
-
"
|
|
958
|
-
"secrets"
|
|
987
|
+
"ui",
|
|
988
|
+
"webkit"
|
|
959
989
|
]);
|
|
960
|
-
var
|
|
990
|
+
var libFacetRootAllowedFiles = new Set([
|
|
961
991
|
"cnst.ts",
|
|
962
992
|
"db.ts",
|
|
963
993
|
"dict.ts",
|
|
@@ -968,6 +998,23 @@ var libRootAllowedFiles = new Set([
|
|
|
968
998
|
"useClient.ts",
|
|
969
999
|
"useServer.ts"
|
|
970
1000
|
]);
|
|
1001
|
+
var isScannedAppRootEntry = (name) => !name.startsWith(".") || appRootAllowedDirs.has(name);
|
|
1002
|
+
|
|
1003
|
+
// pkgs/@akanjs/devkit/scanInfo.ts
|
|
1004
|
+
var databaseFileTypes = [
|
|
1005
|
+
"constant",
|
|
1006
|
+
"dictionary",
|
|
1007
|
+
"document",
|
|
1008
|
+
"service",
|
|
1009
|
+
"signal",
|
|
1010
|
+
"store",
|
|
1011
|
+
"template",
|
|
1012
|
+
"unit",
|
|
1013
|
+
"util",
|
|
1014
|
+
"view",
|
|
1015
|
+
"zone"
|
|
1016
|
+
];
|
|
1017
|
+
var generatedRootCapacitorConfigFiles = ["capacitor.config.js", "capacitor.config.json"];
|
|
971
1018
|
var internalLibDirs = new Set(["__lib", "__scalar"]);
|
|
972
1019
|
var moduleNonUiFileTypes = {
|
|
973
1020
|
database: new Set(["constant", "dictionary", "document", "service", "signal", "store"]),
|
|
@@ -983,7 +1030,7 @@ var testFilePattern = /\.(test|spec)\.(ts|tsx)$/;
|
|
|
983
1030
|
var rootSignalTestFilePattern = /^[A-Za-z][A-Za-z0-9_-]*\.signal\.(test|spec)\.(ts|tsx)$/;
|
|
984
1031
|
var createDependencyScanner = async (exec) => (await import("./dependencyScanner-f6grrep3.js")).TypeScriptDependencyScanner.from(exec);
|
|
985
1032
|
var isAllowedTestFile = (filename) => testFilePattern.test(filename);
|
|
986
|
-
var isAllowedLibRootFile = (filename) =>
|
|
1033
|
+
var isAllowedLibRootFile = (filename) => libFacetRootAllowedFiles.has(filename) || rootSignalTestFilePattern.test(filename);
|
|
987
1034
|
var getScanPath = (exec, relativePath) => path4.posix.join(`${exec.type}s`, exec.name, relativePath.split(path4.sep).join("/"));
|
|
988
1035
|
async function clearGeneratedRootCapacitorConfigs(exec) {
|
|
989
1036
|
if (exec.type !== "app")
|
|
@@ -2103,7 +2150,7 @@ class WorkspaceExecutor extends Executor {
|
|
|
2103
2150
|
static #execs = new Map;
|
|
2104
2151
|
static fromRoot({
|
|
2105
2152
|
workspaceRoot = process.cwd(),
|
|
2106
|
-
repoName =
|
|
2153
|
+
repoName = resolveRepoName(workspaceRoot)
|
|
2107
2154
|
} = {}) {
|
|
2108
2155
|
return WorkspaceExecutor.#execs.get(repoName) ?? new WorkspaceExecutor({ workspaceRoot, repoName });
|
|
2109
2156
|
}
|
|
@@ -2479,7 +2526,7 @@ class SysExecutor extends Executor {
|
|
|
2479
2526
|
class AppExecutor extends SysExecutor {
|
|
2480
2527
|
static #routeSourceValidator = null;
|
|
2481
2528
|
static async#getRouteSourceValidator() {
|
|
2482
|
-
AppExecutor.#routeSourceValidator ??= (await import("./routeSourceValidator-
|
|
2529
|
+
AppExecutor.#routeSourceValidator ??= (await import("./routeSourceValidator-e4jmbfcx.js")).RouteSourceValidator;
|
|
2483
2530
|
return AppExecutor.#routeSourceValidator;
|
|
2484
2531
|
}
|
|
2485
2532
|
dist;
|
|
@@ -3003,4 +3050,4 @@ class ModuleExecutor extends Executor {
|
|
|
3003
3050
|
}
|
|
3004
3051
|
}
|
|
3005
3052
|
|
|
3006
|
-
export { AGENT_BLOCK_START, AGENT_BLOCK_END, upsertAgentBlock, extractAgentBlock, renderRecipeEntries, collectScopeRecipeSources, renderScopeAgentBlock,
|
|
3053
|
+
export { AGENT_BLOCK_START, AGENT_BLOCK_END, stampBlockVersion, extractBlockVersion, readDevkitVersion, upsertAgentBlock, extractAgentBlock, renderRecipeEntries, collectScopeRecipeSources, renderScopeAgentBlock, appRootAllowedFiles, appRootAllowedDirs, libFacetRootAllowedFiles, isScannedAppRootEntry, CommandExecutionError, Executor, WorkspaceExecutor, SysExecutor, AppExecutor, LibExecutor, PkgExecutor, ModuleExecutor };
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AkanContextAnalyzer
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-e4b2ae6b.js";
|
|
5
5
|
import {
|
|
6
6
|
Prompter
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-j37qq1f2.js";
|
|
8
8
|
import {
|
|
9
9
|
runner,
|
|
10
10
|
script
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-etwh7sd3.js";
|
|
12
12
|
import {
|
|
13
13
|
AGENT_BLOCK_END,
|
|
14
14
|
AGENT_BLOCK_START,
|
|
15
15
|
AppExecutor,
|
|
16
16
|
LibExecutor,
|
|
17
|
+
readDevkitVersion,
|
|
17
18
|
renderRecipeEntries,
|
|
19
|
+
stampBlockVersion,
|
|
18
20
|
upsertAgentBlock
|
|
19
|
-
} from "./index-
|
|
21
|
+
} from "./index-yzsxc30b.js";
|
|
20
22
|
import {
|
|
21
23
|
collectRecipeSources,
|
|
22
24
|
scanRecipes
|
|
@@ -103,19 +105,33 @@ ${scopeIndexPointer}
|
|
|
103
105
|
|
|
104
106
|
`;
|
|
105
107
|
};
|
|
108
|
+
var renderGuides = async (context) => {
|
|
109
|
+
const conventions = (await Prompter.getInstruction("conventions")).trim();
|
|
110
|
+
if (context.pkgs.some((pkg) => pkg.name === "akanjs"))
|
|
111
|
+
return conventions;
|
|
112
|
+
const onboarding = (await Prompter.getInstruction("workspaceOnboarding")).trim();
|
|
113
|
+
const appName = context.apps[0]?.name ?? "app";
|
|
114
|
+
return `${conventions}
|
|
115
|
+
|
|
116
|
+
${onboarding.replaceAll("<%= appName %>", appName)}`;
|
|
117
|
+
};
|
|
106
118
|
var renderManagedBlock = async (workspace) => {
|
|
107
119
|
const context = await AkanContextAnalyzer.analyze(workspace);
|
|
108
120
|
const frameworkGuide = await Prompter.getInstruction("framework");
|
|
109
121
|
const appNames = context.apps.map((app) => app.name);
|
|
110
122
|
const sampleCleanup = await renderSampleCleanup(workspace, appNames);
|
|
111
123
|
const recipeIndex = await renderRecipeIndex(workspace);
|
|
112
|
-
|
|
124
|
+
const guides = await renderGuides(context);
|
|
125
|
+
const version = await readDevkitVersion();
|
|
126
|
+
const block = `## Workspace
|
|
113
127
|
|
|
114
128
|
- Repo: ${context.repoName}
|
|
115
129
|
- Apps: ${context.apps.map((app) => app.name).join(", ") || "none"}
|
|
116
130
|
- Libraries: ${context.libs.map((lib) => lib.name).join(", ") || "none"}
|
|
117
131
|
- Packages: ${context.pkgs.map((pkg) => pkg.name).join(", ") || "none"}
|
|
118
132
|
|
|
133
|
+
${guides}
|
|
134
|
+
|
|
119
135
|
${sampleCleanup}## Akan Module Abstracts
|
|
120
136
|
|
|
121
137
|
- Before changing a domain, service, or scalar module, read its \`*.abstract.md\` file first.
|
|
@@ -148,7 +164,19 @@ ${context.validationCommands.map((command) => `- \`${command}\``).join(`
|
|
|
148
164
|
|
|
149
165
|
## Framework Guide
|
|
150
166
|
|
|
151
|
-
${frameworkGuide.trim()}
|
|
167
|
+
${frameworkGuide.trim()}
|
|
168
|
+
|
|
169
|
+
## Before You Finish
|
|
170
|
+
|
|
171
|
+
1. \`bun run akan lint <appName>\` \u2014 Tailwind class order, \`Err\`, \`console\`, \`#private\` scope, unused imports.
|
|
172
|
+
2. \`bun run akan typecheck <appName>\` \u2014 server/client boundary violations.
|
|
173
|
+
3. \`bun run akan sync <appName>\` if you added, renamed, or deleted any file.
|
|
174
|
+
4. Did you write or change a \`.tsx\` file? \`bun run akan quality ssr\` \u2014 did the server share hold, and did you add
|
|
175
|
+
a \`"use client"\` you cannot justify?
|
|
176
|
+
5. Re-read the file you wrote against its section above.
|
|
177
|
+
6. Did you add a comment? Delete it unless it documents an external constraint or a security decision.
|
|
178
|
+
7. Did behavior or an invariant change? Update the module's \`*.abstract.md\`.`;
|
|
179
|
+
return version ? stampBlockVersion(block, version) : block;
|
|
152
180
|
};
|
|
153
181
|
var renderAgentsMd = async (workspace, existing) => {
|
|
154
182
|
const block = await renderManagedBlock(workspace);
|
package/index.js
CHANGED
|
@@ -4,9 +4,10 @@ import {
|
|
|
4
4
|
getTargetCommandNames,
|
|
5
5
|
getTargetMetas,
|
|
6
6
|
runCommands
|
|
7
|
-
} from "./index-
|
|
8
|
-
import"./index-
|
|
7
|
+
} from "./index-etwh7sd3.js";
|
|
8
|
+
import"./index-yzsxc30b.js";
|
|
9
9
|
import"./index-mxvakhsm.js";
|
|
10
|
+
import"./index-1577bej2.js";
|
|
10
11
|
import"./index-67546d0j.js";
|
|
11
12
|
import {
|
|
12
13
|
__require
|
|
@@ -17,22 +18,22 @@ import path from "path";
|
|
|
17
18
|
|
|
18
19
|
// pkgs/@akanjs/cli/commandModules.ts
|
|
19
20
|
var commandModules = {
|
|
20
|
-
workspace: async () => (await import("./workspace.command-
|
|
21
|
-
agent: async () => (await import("./agent.command-
|
|
22
|
-
application: async () => (await import("./application.command-
|
|
23
|
-
library: async () => (await import("./library.command-
|
|
24
|
-
localRegistry: async () => (await import("./localRegistry.command-
|
|
25
|
-
package: async () => (await import("./package.command-
|
|
26
|
-
module: async () => (await import("./module.command-
|
|
27
|
-
page: async () => (await import("./page.command-
|
|
28
|
-
context: async () => (await import("./context.command-
|
|
29
|
-
cloud: async () => (await import("./cloud.command-
|
|
30
|
-
guideline: async () => (await import("./guideline.command-
|
|
31
|
-
scalar: async () => (await import("./scalar.command-
|
|
32
|
-
primitive: async () => (await import("./primitive.command-
|
|
33
|
-
quality: async () => (await import("./quality.command-
|
|
34
|
-
repair: async () => (await import("./repair.command-
|
|
35
|
-
workflow: async () => (await import("./workflow.command-
|
|
21
|
+
workspace: async () => (await import("./workspace.command-xhyhajxa.js")).WorkspaceCommand,
|
|
22
|
+
agent: async () => (await import("./agent.command-a3n15c6t.js")).AgentCommand,
|
|
23
|
+
application: async () => (await import("./application.command-rdm3et0g.js")).ApplicationCommand,
|
|
24
|
+
library: async () => (await import("./library.command-x6t29a30.js")).LibraryCommand,
|
|
25
|
+
localRegistry: async () => (await import("./localRegistry.command-649g1n7b.js")).LocalRegistryCommand,
|
|
26
|
+
package: async () => (await import("./package.command-zgy7f3fz.js")).PackageCommand,
|
|
27
|
+
module: async () => (await import("./module.command-8w8ys5t3.js")).ModuleCommand,
|
|
28
|
+
page: async () => (await import("./page.command-yjmnkyk2.js")).PageCommand,
|
|
29
|
+
context: async () => (await import("./context.command-ysxawe7h.js")).ContextCommand,
|
|
30
|
+
cloud: async () => (await import("./cloud.command-56aeekqn.js")).CloudCommand,
|
|
31
|
+
guideline: async () => (await import("./guideline.command-yqf9a372.js")).GuidelineCommand,
|
|
32
|
+
scalar: async () => (await import("./scalar.command-9dhmqhtm.js")).ScalarCommand,
|
|
33
|
+
primitive: async () => (await import("./primitive.command-gfqaagsg.js")).PrimitiveCommand,
|
|
34
|
+
quality: async () => (await import("./quality.command-ec8r1dn3.js")).QualityCommand,
|
|
35
|
+
repair: async () => (await import("./repair.command-p9ey6mkm.js")).RepairCommand,
|
|
36
|
+
workflow: async () => (await import("./workflow.command-ycwc6zr6.js")).WorkflowCommand
|
|
36
37
|
};
|
|
37
38
|
var commandModuleIds = Object.keys(commandModules);
|
|
38
39
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
LibraryScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-8pd02prk.js";
|
|
5
5
|
import {
|
|
6
6
|
Lib,
|
|
7
7
|
Workspace,
|
|
8
8
|
command
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-etwh7sd3.js";
|
|
10
|
+
import"./index-yzsxc30b.js";
|
|
11
11
|
import"./index-mxvakhsm.js";
|
|
12
|
+
import"./index-1577bej2.js";
|
|
12
13
|
import"./index-67546d0j.js";
|
|
13
14
|
import"./index-r24hmh0q.js";
|
|
14
15
|
|
|
@@ -2,28 +2,29 @@
|
|
|
2
2
|
import {
|
|
3
3
|
CloudRunner,
|
|
4
4
|
getNpmRegistryUrl
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-nwqqssnb.js";
|
|
6
6
|
import {
|
|
7
7
|
PackageScript
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-h5whaj26.js";
|
|
9
9
|
import"./index-0cj2zxbm.js";
|
|
10
10
|
import {
|
|
11
11
|
ApplicationScript
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-bzznxgcx.js";
|
|
13
|
+
import"./index-8pd02prk.js";
|
|
13
14
|
import"./index-76rn3g2c.js";
|
|
14
|
-
import"./index-7c6k4yvg.js";
|
|
15
15
|
import {
|
|
16
16
|
Workspace,
|
|
17
17
|
command,
|
|
18
18
|
runner,
|
|
19
19
|
script
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-etwh7sd3.js";
|
|
21
21
|
import"./index-fgc8r6dj.js";
|
|
22
22
|
import"./index-bjpxzr6s.js";
|
|
23
23
|
import {
|
|
24
24
|
PkgExecutor
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-yzsxc30b.js";
|
|
26
26
|
import"./index-mxvakhsm.js";
|
|
27
|
+
import"./index-1577bej2.js";
|
|
27
28
|
import"./index-46tjzh6s.js";
|
|
28
29
|
import"./index-67546d0j.js";
|
|
29
30
|
import"./index-r24hmh0q.js";
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ModuleScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-bbkek1bp.js";
|
|
4
|
+
} from "./index-mewacxye.js";
|
|
6
5
|
import"./index-ss469dec.js";
|
|
6
|
+
import"./index-65aeh789.js";
|
|
7
7
|
import"./index-0cj2zxbm.js";
|
|
8
8
|
import {
|
|
9
9
|
renderPrimitiveReport
|
|
10
|
-
} from "./index-
|
|
11
|
-
import"./index-
|
|
10
|
+
} from "./index-kcsa1zff.js";
|
|
11
|
+
import"./index-j37qq1f2.js";
|
|
12
12
|
import {
|
|
13
13
|
Module,
|
|
14
14
|
Sys,
|
|
15
15
|
command
|
|
16
|
-
} from "./index-
|
|
17
|
-
import"./index-
|
|
16
|
+
} from "./index-etwh7sd3.js";
|
|
17
|
+
import"./index-yzsxc30b.js";
|
|
18
18
|
import"./index-mxvakhsm.js";
|
|
19
|
+
import"./index-1577bej2.js";
|
|
19
20
|
import"./index-67546d0j.js";
|
|
20
21
|
import"./index-r24hmh0q.js";
|
|
21
22
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
PackageScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-h5whaj26.js";
|
|
5
5
|
import {
|
|
6
6
|
Pkg,
|
|
7
7
|
Workspace,
|
|
8
8
|
command
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-etwh7sd3.js";
|
|
10
|
+
import"./index-yzsxc30b.js";
|
|
11
11
|
import"./index-mxvakhsm.js";
|
|
12
|
+
import"./index-1577bej2.js";
|
|
12
13
|
import"./index-46tjzh6s.js";
|
|
13
14
|
import"./index-67546d0j.js";
|
|
14
15
|
import"./index-r24hmh0q.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.11",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@langchain/openai": "^1.4.6",
|
|
35
35
|
"@tailwindcss/node": "^4.3.0",
|
|
36
36
|
"@trapezedev/project": "^7.1.4",
|
|
37
|
-
"akanjs": "3.0.0-alpha.
|
|
37
|
+
"akanjs": "3.0.0-alpha.11",
|
|
38
38
|
"chalk": "^5.6.2",
|
|
39
39
|
"commander": "^14.0.3",
|
|
40
40
|
"dayjs": "^1.11.20",
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
PageScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-65aeh789.js";
|
|
5
5
|
import {
|
|
6
6
|
App,
|
|
7
7
|
Module,
|
|
8
8
|
command
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-etwh7sd3.js";
|
|
10
|
+
import"./index-yzsxc30b.js";
|
|
11
11
|
import"./index-mxvakhsm.js";
|
|
12
|
+
import"./index-1577bej2.js";
|
|
12
13
|
import"./index-67546d0j.js";
|
|
13
14
|
import"./index-r24hmh0q.js";
|
|
14
15
|
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
PrimitiveScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-bbkek1bp.js";
|
|
4
|
+
} from "./index-m90fn8xe.js";
|
|
5
|
+
import"./index-mewacxye.js";
|
|
7
6
|
import"./index-ss469dec.js";
|
|
7
|
+
import"./index-65aeh789.js";
|
|
8
8
|
import"./index-0cj2zxbm.js";
|
|
9
9
|
import {
|
|
10
10
|
renderPrimitiveReport
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
11
|
+
} from "./index-kcsa1zff.js";
|
|
12
|
+
import"./index-j37qq1f2.js";
|
|
13
13
|
import {
|
|
14
14
|
Workspace,
|
|
15
15
|
command
|
|
16
|
-
} from "./index-
|
|
17
|
-
import"./index-
|
|
16
|
+
} from "./index-etwh7sd3.js";
|
|
17
|
+
import"./index-yzsxc30b.js";
|
|
18
18
|
import"./index-mxvakhsm.js";
|
|
19
|
+
import"./index-1577bej2.js";
|
|
19
20
|
import"./index-67546d0j.js";
|
|
20
21
|
import"./index-r24hmh0q.js";
|
|
21
22
|
|