@akanjs/cli 3.2.0-rc.14 → 3.2.0-rc.15
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 -2
- package/CodeAgent-18qg03re.js +11 -0
- package/{CodeTui-h7mksphk.js → CodeTui-zkm51zf3.js} +4 -4
- package/TunnelShare-6t4rwyc0.js +19 -0
- package/{agent.command-hrc2dfas.js → agent.command-5k2zegmj.js} +25 -25
- package/akanCode.js +6 -6
- package/appExecutor-1bgs9a69.js +11 -0
- package/{application.command-b2194cpv.js → application.command-ge27047n.js} +20 -20
- package/{applicationBuildRunner-gg03kydg.js → applicationBuildRunner-7skfg8zn.js} +14 -14
- package/buildBatch.proc.js +11 -11
- package/{cloud.command-d8ps1564.js → cloud.command-d18qj1v2.js} +25 -25
- package/cloud.script-0hbhm3mw.js +35 -0
- package/{code.command-6h6jr0s7.js → code.command-tz4x5zm6.js} +13 -13
- package/{context.command-t8akxhny.js → context.command-x1smtm5q.js} +25 -25
- package/context.runner-vb7jc0k8.js +34 -0
- package/{dependencyScanner-78sq8m4q.js → dependencyScanner-ge10gb52.js} +2 -2
- package/{devTui-h77zrjv5.js → devTui-rf374y2w.js} +1 -1
- package/{fileSys-zpvt5gtf.js → fileSys-q22646yc.js} +1 -1
- package/{guideline.command-f41b5nv5.js → guideline.command-rdcwxf8g.js} +8 -8
- package/guidelines/conventions/rules/app.md +1 -1
- package/incrementalBuilder.proc.js +12 -12
- package/{index-e599a0e4.js → index-0c8zj1da.js} +1 -1
- package/{index-w15mg3km.js → index-0dm25wvf.js} +1 -1
- package/{index-hj6w4ka1.js → index-1p81ecbz.js} +1 -1
- package/{index-66jt3m30.js → index-1ts8vfsk.js} +5 -5
- package/{index-qd7xn2bk.js → index-2ny1e95c.js} +2 -2
- package/{index-3fn13v8p.js → index-3641r8q0.js} +6 -6
- package/{index-hbc0t3ng.js → index-39byv35b.js} +2 -2
- package/{index-j2me5hm4.js → index-669sg3yp.js} +3 -3
- package/{index-bb7cm060.js → index-6p02be7n.js} +22 -22
- package/{index-j6eeh5d7.js → index-89x8tp7z.js} +4 -4
- package/{index-r0a604h4.js → index-99kjwyma.js} +1 -1
- package/{index-71z3pdsn.js → index-9mx3b3zh.js} +4 -4
- package/{index-c0rnjeqn.js → index-b2sptt87.js} +7 -7
- package/{index-yf9wc28h.js → index-bejy9zyc.js} +1 -1
- package/{index-2z8mxgs7.js → index-bjnebzzc.js} +4 -4
- package/{index-hpe12v1h.js → index-bxqbt5p3.js} +2 -2
- package/{index-bns3wcpc.js → index-by2tvsq6.js} +1 -1
- package/{index-1b1p83vq.js → index-bzdq8wfw.js} +5 -5
- package/{index-nx4q5rey.js → index-d2r762fk.js} +4 -4
- package/{index-3fpv5v0t.js → index-dp7sht3v.js} +17 -17
- package/{index-rx8r0cbe.js → index-dqsc1b5t.js} +1 -1
- package/{index-x2bj2vyz.js → index-dtpeyts6.js} +1 -1
- package/{index-8bkbexcy.js → index-e82xwj3x.js} +1 -1
- package/{index-hg8s6nae.js → index-emf3wzvh.js} +7 -7
- package/{index-5np8zpep.js → index-er2ja34m.js} +13 -13
- package/{index-j33b0n38.js → index-f482h2hj.js} +20 -2
- package/{index-9yfssbgg.js → index-fcrr79gh.js} +75 -41
- package/{index-ny2k80mv.js → index-ffa52fwf.js} +1 -1
- package/{index-crtscw7c.js → index-g56xae1n.js} +183 -182
- package/{index-asfx2dhe.js → index-g7e58wz2.js} +6 -6
- package/{index-3fbmyb2r.js → index-gh4brxzn.js} +2 -2
- package/{index-xb1yh9km.js → index-h7yd92c8.js} +2 -2
- package/{index-k081wv4r.js → index-j2eqe3jk.js} +19 -19
- package/{index-9w51aevd.js → index-jfkh776h.js} +1 -1
- package/{index-1jzdengt.js → index-n8mxyy3f.js} +1 -1
- package/{index-3gmskeq2.js → index-neassptx.js} +10 -10
- package/{index-35j83zkd.js → index-p5zh7pmc.js} +2 -2
- package/{index-37k5vshx.js → index-q4e18ne4.js} +4 -4
- package/{index-g2ebpf0y.js → index-q57rsax4.js} +3 -3
- package/{index-b4qq3rq0.js → index-rwgqba9p.js} +1 -1
- package/{index-grt0e6kk.js → index-s75h0455.js} +1 -1
- package/{index-xgqz3kak.js → index-sp331bww.js} +2 -2
- package/{index-h7hehkw6.js → index-t0g6jgrc.js} +1 -1
- package/{index-6dwk5aej.js → index-t329y8am.js} +12 -12
- package/{index-8rmg8c0y.js → index-t8tysbxv.js} +7 -7
- package/{index-b3h37zk3.js → index-trp7jdr1.js} +4 -4
- package/{index-c4k6e098.js → index-ttfz2sc7.js} +104 -55
- package/{index-xjj0h74q.js → index-vm6pr11y.js} +3 -3
- package/{index-vb8gd135.js → index-xywq95wk.js} +6 -6
- package/{index-vy50ec2q.js → index-yr5jv8yd.js} +3 -3
- package/{index-f5j09jnj.js → index-z7t6neq1.js} +9 -9
- package/{index-ygdbn9jn.js → index-zyb0ebm4.js} +1 -1
- package/index.js +28 -28
- package/{libExecutor-ex8jqksz.js → libExecutor-hxe5eqfh.js} +3 -3
- package/{library.command-a9p5yg4k.js → library.command-83shs8fw.js} +8 -8
- package/{localRegistry.command-zz64k5vy.js → localRegistry.command-sz713jg3.js} +24 -24
- package/{module.command-1ht6dmxg.js → module.command-jhhm0nmw.js} +10 -10
- package/{package.command-eabq20aq.js → package.command-42syy96v.js} +11 -11
- package/package.json +2 -2
- package/{page.command-xhmzmvjn.js → page.command-jkv29zzs.js} +8 -8
- package/{pipeline.command-wsbg3fpr.js → pipeline.command-6sg9g4hq.js} +9 -9
- package/{pkgExecutor-d16x1xcb.js → pkgExecutor-6p82w5y1.js} +3 -3
- package/{primitive.command-yyxtfhvq.js → primitive.command-tt6aq7m9.js} +11 -11
- package/{projectTypecheck-wcrt7sae.js → projectTypecheck-wfrz0cxr.js} +1 -1
- package/{prompter-qrwx1p17.js → prompter-w58rvzb9.js} +2 -2
- package/{quality.command-n7hmt628.js → quality.command-tqar7ss5.js} +12 -12
- package/{recipeScanner-4b69ybe0.js → recipeScanner-rrx69awy.js} +1 -1
- package/{repair.command-pczdq4mv.js → repair.command-qkcn329t.js} +11 -11
- package/{routeSourceValidator-4h947v7c.js → routeSourceValidator-8aph1dsr.js} +1 -1
- package/{scalar.command-cw3d32sv.js → scalar.command-6nvq11ag.js} +9 -9
- package/skills/akan-debug/SKILL.md +8 -5
- package/{subspace.command-d8t8geyv.js → subspace.command-dvwds4cv.js} +20 -20
- package/{tunnel.command-mhm64m9n.js → tunnel.command-h8r69a7v.js} +12 -12
- package/{typeChecker-s640r6c0.js → typeChecker-bfrd1n9n.js} +1 -1
- package/typecheck.proc.js +1 -1
- package/{verify.command-j4he0fbx.js → verify.command-ynec8kt2.js} +20 -20
- package/{workflow.command-k064waza.js → workflow.command-f70fx73a.js} +16 -16
- package/{workspace.command-pkpawft5.js → workspace.command-vagjy1q9.js} +43 -43
- package/CodeAgent-yd1f54yf.js +0 -11
- package/TunnelShare-hrjed2jf.js +0 -19
- package/appExecutor-0ssszyhf.js +0 -11
- package/cloud.script-7j7w4m0w.js +0 -35
- package/context.runner-eawk1n8e.js +0 -34
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getDirname2,
|
|
4
4
|
FileSys2
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-by2tvsq6.js";
|
|
6
6
|
import {
|
|
7
7
|
CliError,
|
|
8
8
|
TypecheckFailure
|
|
@@ -91,7 +91,7 @@ import { existsSync as existsSync3, readFileSync as readFileSync2 } from "fs";
|
|
|
91
91
|
import { stat as stat3 } from "fs/promises";
|
|
92
92
|
import path11 from "path";
|
|
93
93
|
|
|
94
|
-
// pkgs/@akanjs/devkit/repoIdentity.ts
|
|
94
|
+
// pkgs/@akanjs/devkit/workspace/repoIdentity.ts
|
|
95
95
|
import { execFileSync } from "child_process";
|
|
96
96
|
import path2 from "path";
|
|
97
97
|
var resolved = new Map;
|
|
@@ -116,11 +116,11 @@ var resolveRepoName = (workspaceRoot) => {
|
|
|
116
116
|
return repoName;
|
|
117
117
|
};
|
|
118
118
|
|
|
119
|
-
// pkgs/@akanjs/devkit/scanInfo.ts
|
|
119
|
+
// pkgs/@akanjs/devkit/workspace/scanInfo.ts
|
|
120
120
|
import { createHash } from "crypto";
|
|
121
121
|
import path3 from "path";
|
|
122
122
|
|
|
123
|
-
// pkgs/@akanjs/devkit/workspaceLayout.ts
|
|
123
|
+
// pkgs/@akanjs/devkit/workspace/workspaceLayout.ts
|
|
124
124
|
var appRootAllowedFiles = new Set([
|
|
125
125
|
"AGENTS.md",
|
|
126
126
|
"CLAUDE.md",
|
|
@@ -216,8 +216,8 @@ var retiredAppRootEntries = new Set([
|
|
|
216
216
|
var rootEntryHintOf = (type, name) => type === "app" && retiredAppRootEntries.has(name) ? "a Capacitor-era entry; the native runtime generates its projects under dist/native/<app>/<target>, so delete it" : null;
|
|
217
217
|
var isScannedRootEntry = (type, name) => !name.startsWith(".") || rootAllowedDirs[type].has(name);
|
|
218
218
|
|
|
219
|
-
// pkgs/@akanjs/devkit/scanInfo.ts
|
|
220
|
-
var loadLibExecutor = () => import("./libExecutor-
|
|
219
|
+
// pkgs/@akanjs/devkit/workspace/scanInfo.ts
|
|
220
|
+
var loadLibExecutor = () => import("./libExecutor-hxe5eqfh.js");
|
|
221
221
|
var serviceFileTypes = [
|
|
222
222
|
"dictionary",
|
|
223
223
|
"service",
|
|
@@ -243,7 +243,7 @@ var moduleUiFileTypes = {
|
|
|
243
243
|
service: new Set(["Util", "Zone"]),
|
|
244
244
|
scalar: new Set(["Template", "Unit"])
|
|
245
245
|
};
|
|
246
|
-
var createDependencyScanner = async (exec) => (await import("./dependencyScanner-
|
|
246
|
+
var createDependencyScanner = async (exec) => (await import("./dependencyScanner-ge10gb52.js")).TypeScriptDependencyScanner.from(exec);
|
|
247
247
|
var getScanPath = (exec, relativePath) => path3.posix.join(`${exec.type}s`, exec.name, relativePath.split(path3.sep).join("/"));
|
|
248
248
|
var getModuleNameFromPath = (kind, modulePath) => {
|
|
249
249
|
const dirname = path3.basename(modulePath);
|
|
@@ -624,9 +624,9 @@ class WorkspaceInfo {
|
|
|
624
624
|
return existingWorkspaceInfo;
|
|
625
625
|
const [appNames, libNames, pkgNames] = await Promise.all([exec.getApps(), exec.getLibs(), exec.getPkgs()]);
|
|
626
626
|
const [appModule, libModule, pkgModule] = await Promise.all([
|
|
627
|
-
import("./appExecutor-
|
|
627
|
+
import("./appExecutor-1bgs9a69.js"),
|
|
628
628
|
loadLibExecutor(),
|
|
629
|
-
import("./pkgExecutor-
|
|
629
|
+
import("./pkgExecutor-6p82w5y1.js")
|
|
630
630
|
]);
|
|
631
631
|
const [appInfos, libInfos, pkgInfos] = await Promise.all([
|
|
632
632
|
Promise.all(appNames.map(async (appName) => await appModule.AppExecutor.from(exec, appName).scan())),
|
|
@@ -651,85 +651,10 @@ import { capitalize, Logger, toError } from "akanjs/common";
|
|
|
651
651
|
var {$ } = globalThis.Bun;
|
|
652
652
|
import chalk2 from "chalk";
|
|
653
653
|
|
|
654
|
-
// pkgs/@akanjs/devkit/
|
|
655
|
-
import path4 from "path";
|
|
656
|
-
|
|
657
|
-
class JsonFormatter {
|
|
658
|
-
static lineWidth = 120;
|
|
659
|
-
static stringify(value, filePath) {
|
|
660
|
-
const json = JSON.stringify(value, null, 2);
|
|
661
|
-
if (path4.basename(filePath) === "package.json")
|
|
662
|
-
return `${json}
|
|
663
|
-
`;
|
|
664
|
-
return `${JsonFormatter.#print(JSON.parse(json), 0, { column: 0, trailing: 0 })}
|
|
665
|
-
`;
|
|
666
|
-
}
|
|
667
|
-
static #print(value, depth, placement) {
|
|
668
|
-
if (Array.isArray(value))
|
|
669
|
-
return JsonFormatter.#printArray(value, depth, placement);
|
|
670
|
-
if (value === null || typeof value !== "object")
|
|
671
|
-
return JSON.stringify(value);
|
|
672
|
-
const entries = Object.entries(value);
|
|
673
|
-
if (!entries.length)
|
|
674
|
-
return "{}";
|
|
675
|
-
const indent = " ".repeat(depth + 1);
|
|
676
|
-
const members = entries.map(([key, member], idx) => {
|
|
677
|
-
const prefix = `${indent}${JSON.stringify(key)}: `;
|
|
678
|
-
const trailing = idx < entries.length - 1 ? 1 : 0;
|
|
679
|
-
return `${prefix}${JsonFormatter.#print(member, depth + 1, { column: Bun.stringWidth(prefix), trailing })}`;
|
|
680
|
-
});
|
|
681
|
-
return `{
|
|
682
|
-
${members.join(`,
|
|
683
|
-
`)}
|
|
684
|
-
${" ".repeat(depth)}}`;
|
|
685
|
-
}
|
|
686
|
-
static #printArray(items, depth, { column, trailing }) {
|
|
687
|
-
if (!items.length)
|
|
688
|
-
return "[]";
|
|
689
|
-
const flat = JsonFormatter.#flat(items);
|
|
690
|
-
if (flat !== null && column + Bun.stringWidth(flat) + trailing <= JsonFormatter.lineWidth)
|
|
691
|
-
return flat;
|
|
692
|
-
const indent = " ".repeat(depth + 1);
|
|
693
|
-
const isLast = (idx) => idx === items.length - 1;
|
|
694
|
-
const body = items.every((item) => typeof item === "number") ? JsonFormatter.#fill(items.map((item, idx) => `${JSON.stringify(item)}${isLast(idx) ? "" : ","}`), indent) : items.map((item, idx) => {
|
|
695
|
-
const placement = { column: indent.length, trailing: isLast(idx) ? 0 : 1 };
|
|
696
|
-
return `${indent}${JsonFormatter.#print(item, depth + 1, placement)}`;
|
|
697
|
-
}).join(`,
|
|
698
|
-
`);
|
|
699
|
-
return `[
|
|
700
|
-
${body}
|
|
701
|
-
${" ".repeat(depth)}]`;
|
|
702
|
-
}
|
|
703
|
-
static #fill(tokens, indent) {
|
|
704
|
-
const lines = [];
|
|
705
|
-
let line = "";
|
|
706
|
-
for (const token of tokens) {
|
|
707
|
-
if (line && Bun.stringWidth(line) + 1 + Bun.stringWidth(token) <= JsonFormatter.lineWidth) {
|
|
708
|
-
line = `${line} ${token}`;
|
|
709
|
-
continue;
|
|
710
|
-
}
|
|
711
|
-
if (line)
|
|
712
|
-
lines.push(line);
|
|
713
|
-
line = `${indent}${token}`;
|
|
714
|
-
}
|
|
715
|
-
return [...lines, line].join(`
|
|
716
|
-
`);
|
|
717
|
-
}
|
|
718
|
-
static #flat(value) {
|
|
719
|
-
if (Array.isArray(value)) {
|
|
720
|
-
const items = value.map((item) => JsonFormatter.#flat(item));
|
|
721
|
-
return items.includes(null) ? null : `[${items.join(", ")}]`;
|
|
722
|
-
}
|
|
723
|
-
if (value === null || typeof value !== "object")
|
|
724
|
-
return JSON.stringify(value);
|
|
725
|
-
return Object.keys(value).length ? null : "{}";
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
// pkgs/@akanjs/devkit/linter.ts
|
|
654
|
+
// pkgs/@akanjs/devkit/lint/linter.ts
|
|
730
655
|
import { spawn } from "child_process";
|
|
731
656
|
import { existsSync, readFileSync } from "fs";
|
|
732
|
-
import
|
|
657
|
+
import path4 from "path";
|
|
733
658
|
import chalk from "chalk";
|
|
734
659
|
var parseBiomeReport = (output) => {
|
|
735
660
|
for (let start = output.indexOf("{");start !== -1; start = output.indexOf("{", start + 1)) {
|
|
@@ -790,7 +715,7 @@ var emptyResult = (filePath) => ({
|
|
|
790
715
|
|
|
791
716
|
class Linter {
|
|
792
717
|
static biomeCommand(root) {
|
|
793
|
-
const wrapper =
|
|
718
|
+
const wrapper = path4.join(root, "node_modules", "@biomejs", "biome", "bin", "biome");
|
|
794
719
|
return existsSync(wrapper) ? [process.execPath, wrapper] : ["biome"];
|
|
795
720
|
}
|
|
796
721
|
lintRoot;
|
|
@@ -798,12 +723,12 @@ class Linter {
|
|
|
798
723
|
#biomeCommand;
|
|
799
724
|
constructor(cwdPath) {
|
|
800
725
|
this.lintRoot = this.#findBiomeRootPath(cwdPath);
|
|
801
|
-
this.configPath = Linter.#configPathIn(this.lintRoot) ??
|
|
726
|
+
this.configPath = Linter.#configPathIn(this.lintRoot) ?? path4.join(this.lintRoot, "biome.json");
|
|
802
727
|
this.#biomeCommand = Linter.biomeCommand(this.lintRoot);
|
|
803
728
|
}
|
|
804
729
|
static #configPathIn(dir) {
|
|
805
730
|
for (const fileName of BIOME_CONFIG_FILES) {
|
|
806
|
-
const configPath =
|
|
731
|
+
const configPath = path4.join(dir, fileName);
|
|
807
732
|
if (existsSync(configPath))
|
|
808
733
|
return configPath;
|
|
809
734
|
}
|
|
@@ -812,19 +737,19 @@ class Linter {
|
|
|
812
737
|
#findBiomeRootPath(dir) {
|
|
813
738
|
if (Linter.#configPathIn(dir))
|
|
814
739
|
return dir;
|
|
815
|
-
const parentDir =
|
|
740
|
+
const parentDir = path4.dirname(dir);
|
|
816
741
|
if (parentDir === dir)
|
|
817
742
|
throw new Error(`biome.json not found from ${dir}`);
|
|
818
743
|
return this.#findBiomeRootPath(parentDir);
|
|
819
744
|
}
|
|
820
745
|
#toBiomePath(filePath) {
|
|
821
|
-
const relativePath =
|
|
822
|
-
if (!relativePath.startsWith("..") && !
|
|
746
|
+
const relativePath = path4.relative(this.lintRoot, filePath);
|
|
747
|
+
if (!relativePath.startsWith("..") && !path4.isAbsolute(relativePath))
|
|
823
748
|
return relativePath;
|
|
824
749
|
return filePath;
|
|
825
750
|
}
|
|
826
751
|
#resolveFilePath(filePath) {
|
|
827
|
-
return
|
|
752
|
+
return path4.isAbsolute(filePath) ? filePath : path4.join(this.lintRoot, filePath);
|
|
828
753
|
}
|
|
829
754
|
async#runBiome(args, input) {
|
|
830
755
|
return await new Promise((resolve, reject) => {
|
|
@@ -850,7 +775,7 @@ class Linter {
|
|
|
850
775
|
const diagnosticPath = diagnostic.location?.path;
|
|
851
776
|
if (!diagnosticPath)
|
|
852
777
|
return fallbackFilePath;
|
|
853
|
-
return
|
|
778
|
+
return path4.isAbsolute(diagnosticPath) ? diagnosticPath : path4.join(this.lintRoot, diagnosticPath);
|
|
854
779
|
}
|
|
855
780
|
#createLintMessage(diagnostic) {
|
|
856
781
|
const start = diagnostic.location?.start;
|
|
@@ -1077,73 +1002,9 @@ ${errorText}, ${warningText} found`];
|
|
|
1077
1002
|
}
|
|
1078
1003
|
}
|
|
1079
1004
|
|
|
1080
|
-
// pkgs/@akanjs/devkit/spinner.ts
|
|
1081
|
-
import ora from "ora";
|
|
1082
|
-
|
|
1083
|
-
class Spinner {
|
|
1084
|
-
static padding = 12;
|
|
1085
|
-
static oraOptions = { discardStdin: false };
|
|
1086
|
-
static canAnimate(stream = process.stderr) {
|
|
1087
|
-
return !stream.isTTY || stream.columns > 0;
|
|
1088
|
-
}
|
|
1089
|
-
spinner;
|
|
1090
|
-
stopWatch = null;
|
|
1091
|
-
startAt = new Date;
|
|
1092
|
-
prefix;
|
|
1093
|
-
message;
|
|
1094
|
-
enableSpin;
|
|
1095
|
-
constructor(message, { prefix = "", indent = 0, enableSpin = true } = {}) {
|
|
1096
|
-
Spinner.padding = Math.max(Spinner.padding, prefix.length);
|
|
1097
|
-
this.prefix = prefix;
|
|
1098
|
-
this.message = message;
|
|
1099
|
-
this.spinner = ora({ ...Spinner.oraOptions, text: message });
|
|
1100
|
-
this.spinner.prefixText = prefix.padStart(Spinner.padding, " ");
|
|
1101
|
-
this.spinner.indent = indent;
|
|
1102
|
-
this.enableSpin = enableSpin && Spinner.canAnimate();
|
|
1103
|
-
}
|
|
1104
|
-
start() {
|
|
1105
|
-
this.startAt = new Date;
|
|
1106
|
-
if (this.enableSpin) {
|
|
1107
|
-
this.spinner.start();
|
|
1108
|
-
this.stopWatch = setInterval(() => {
|
|
1109
|
-
this.spinner.prefixText = this.prefix.padStart(Spinner.padding, " ");
|
|
1110
|
-
this.spinner.text = `${this.message} (${this.#getElapsedTimeStr({ floor: true })})`;
|
|
1111
|
-
}, 1000);
|
|
1112
|
-
} else
|
|
1113
|
-
this.spinner.info();
|
|
1114
|
-
return this;
|
|
1115
|
-
}
|
|
1116
|
-
succeed(message) {
|
|
1117
|
-
this.spinner.succeed(`${message} (${this.#getElapsedTimeStr()})`);
|
|
1118
|
-
this.#reset();
|
|
1119
|
-
}
|
|
1120
|
-
fail(message) {
|
|
1121
|
-
this.spinner.fail(`${message} (${this.#getElapsedTimeStr()})`);
|
|
1122
|
-
this.#reset();
|
|
1123
|
-
}
|
|
1124
|
-
isSpinning() {
|
|
1125
|
-
return this.spinner.isSpinning;
|
|
1126
|
-
}
|
|
1127
|
-
#reset() {
|
|
1128
|
-
if (this.stopWatch)
|
|
1129
|
-
clearInterval(this.stopWatch);
|
|
1130
|
-
this.stopWatch = null;
|
|
1131
|
-
}
|
|
1132
|
-
#getElapsedTimeStr({ floor = false } = {}) {
|
|
1133
|
-
const ms = Date.now() - this.startAt.getTime();
|
|
1134
|
-
if (ms < 1000)
|
|
1135
|
-
return `${ms}ms`;
|
|
1136
|
-
const s = Math.floor(ms / 1000);
|
|
1137
|
-
if (s < 60)
|
|
1138
|
-
return `${floor ? Math.floor(ms / 1000) : Math.floor(ms / 100) / 10}s`;
|
|
1139
|
-
const m = Math.floor(s / 60);
|
|
1140
|
-
return `${m}m ${s % 60}s`;
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
|
|
1144
1005
|
// pkgs/@akanjs/devkit/typecheck/projectTypecheck.ts
|
|
1145
1006
|
import { mkdir, rm } from "fs/promises";
|
|
1146
|
-
import
|
|
1007
|
+
import path5 from "path";
|
|
1147
1008
|
class ProjectTypecheck2 {
|
|
1148
1009
|
projectDir;
|
|
1149
1010
|
workspaceRoot;
|
|
@@ -1156,7 +1017,7 @@ class ProjectTypecheck2 {
|
|
|
1156
1017
|
this.env = env;
|
|
1157
1018
|
}
|
|
1158
1019
|
get typecheckDir() {
|
|
1159
|
-
return
|
|
1020
|
+
return path5.join(this.projectDir, ".akan", "typecheck");
|
|
1160
1021
|
}
|
|
1161
1022
|
async run(entries, { clean = false, incremental = true, tests = false, report = "pretty" } = {}) {
|
|
1162
1023
|
const name = tests ? "tsconfig.tests" : "tsconfig";
|
|
@@ -1168,11 +1029,11 @@ class ProjectTypecheck2 {
|
|
|
1168
1029
|
...tests ? { exclude: ProjectTypecheck2.#excludes.map((glob) => `../../${glob}`) } : {},
|
|
1169
1030
|
references: []
|
|
1170
1031
|
};
|
|
1171
|
-
const tsconfigPath =
|
|
1032
|
+
const tsconfigPath = path5.join(this.typecheckDir, `${name}.json`);
|
|
1172
1033
|
await Bun.write(tsconfigPath, `${JSON.stringify(tsconfig, null, 2)}
|
|
1173
1034
|
`);
|
|
1174
1035
|
if (clean)
|
|
1175
|
-
await rm(
|
|
1036
|
+
await rm(path5.join(this.typecheckDir, `${name}.tsbuildinfo`), { force: true });
|
|
1176
1037
|
await this.check(tsconfigPath, report);
|
|
1177
1038
|
return tsconfigPath;
|
|
1178
1039
|
}
|
|
@@ -1213,11 +1074,11 @@ class ProjectTypecheck2 {
|
|
|
1213
1074
|
}
|
|
1214
1075
|
static async workerEntry(workspaceRoot) {
|
|
1215
1076
|
const candidates = [
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1077
|
+
path5.join(workspaceRoot, "pkgs/@akanjs/devkit/typecheck/typecheck.proc.ts"),
|
|
1078
|
+
path5.join(workspaceRoot, "node_modules/@akanjs/devkit/typecheck/typecheck.proc.ts"),
|
|
1079
|
+
path5.join(import.meta.dir, "typecheck.proc.js"),
|
|
1080
|
+
path5.join(import.meta.dir, "typecheck.proc.ts"),
|
|
1081
|
+
path5.join(import.meta.dir, "..", "typecheck.proc.js")
|
|
1221
1082
|
];
|
|
1222
1083
|
for (const candidate of candidates)
|
|
1223
1084
|
if (await Bun.file(candidate).exists())
|
|
@@ -1226,6 +1087,145 @@ class ProjectTypecheck2 {
|
|
|
1226
1087
|
}
|
|
1227
1088
|
}
|
|
1228
1089
|
|
|
1090
|
+
// pkgs/@akanjs/devkit/util/jsonFormatter.ts
|
|
1091
|
+
import path6 from "path";
|
|
1092
|
+
|
|
1093
|
+
class JsonFormatter {
|
|
1094
|
+
static lineWidth = 120;
|
|
1095
|
+
static stringify(value, filePath) {
|
|
1096
|
+
const json = JSON.stringify(value, null, 2);
|
|
1097
|
+
if (path6.basename(filePath) === "package.json")
|
|
1098
|
+
return `${json}
|
|
1099
|
+
`;
|
|
1100
|
+
return `${JsonFormatter.#print(JSON.parse(json), 0, { column: 0, trailing: 0 })}
|
|
1101
|
+
`;
|
|
1102
|
+
}
|
|
1103
|
+
static #print(value, depth, placement) {
|
|
1104
|
+
if (Array.isArray(value))
|
|
1105
|
+
return JsonFormatter.#printArray(value, depth, placement);
|
|
1106
|
+
if (value === null || typeof value !== "object")
|
|
1107
|
+
return JSON.stringify(value);
|
|
1108
|
+
const entries = Object.entries(value);
|
|
1109
|
+
if (!entries.length)
|
|
1110
|
+
return "{}";
|
|
1111
|
+
const indent = " ".repeat(depth + 1);
|
|
1112
|
+
const members = entries.map(([key, member], idx) => {
|
|
1113
|
+
const prefix = `${indent}${JSON.stringify(key)}: `;
|
|
1114
|
+
const trailing = idx < entries.length - 1 ? 1 : 0;
|
|
1115
|
+
return `${prefix}${JsonFormatter.#print(member, depth + 1, { column: Bun.stringWidth(prefix), trailing })}`;
|
|
1116
|
+
});
|
|
1117
|
+
return `{
|
|
1118
|
+
${members.join(`,
|
|
1119
|
+
`)}
|
|
1120
|
+
${" ".repeat(depth)}}`;
|
|
1121
|
+
}
|
|
1122
|
+
static #printArray(items, depth, { column, trailing }) {
|
|
1123
|
+
if (!items.length)
|
|
1124
|
+
return "[]";
|
|
1125
|
+
const flat = JsonFormatter.#flat(items);
|
|
1126
|
+
if (flat !== null && column + Bun.stringWidth(flat) + trailing <= JsonFormatter.lineWidth)
|
|
1127
|
+
return flat;
|
|
1128
|
+
const indent = " ".repeat(depth + 1);
|
|
1129
|
+
const isLast = (idx) => idx === items.length - 1;
|
|
1130
|
+
const body = items.every((item) => typeof item === "number") ? JsonFormatter.#fill(items.map((item, idx) => `${JSON.stringify(item)}${isLast(idx) ? "" : ","}`), indent) : items.map((item, idx) => {
|
|
1131
|
+
const placement = { column: indent.length, trailing: isLast(idx) ? 0 : 1 };
|
|
1132
|
+
return `${indent}${JsonFormatter.#print(item, depth + 1, placement)}`;
|
|
1133
|
+
}).join(`,
|
|
1134
|
+
`);
|
|
1135
|
+
return `[
|
|
1136
|
+
${body}
|
|
1137
|
+
${" ".repeat(depth)}]`;
|
|
1138
|
+
}
|
|
1139
|
+
static #fill(tokens, indent) {
|
|
1140
|
+
const lines = [];
|
|
1141
|
+
let line = "";
|
|
1142
|
+
for (const token of tokens) {
|
|
1143
|
+
if (line && Bun.stringWidth(line) + 1 + Bun.stringWidth(token) <= JsonFormatter.lineWidth) {
|
|
1144
|
+
line = `${line} ${token}`;
|
|
1145
|
+
continue;
|
|
1146
|
+
}
|
|
1147
|
+
if (line)
|
|
1148
|
+
lines.push(line);
|
|
1149
|
+
line = `${indent}${token}`;
|
|
1150
|
+
}
|
|
1151
|
+
return [...lines, line].join(`
|
|
1152
|
+
`);
|
|
1153
|
+
}
|
|
1154
|
+
static #flat(value) {
|
|
1155
|
+
if (Array.isArray(value)) {
|
|
1156
|
+
const items = value.map((item) => JsonFormatter.#flat(item));
|
|
1157
|
+
return items.includes(null) ? null : `[${items.join(", ")}]`;
|
|
1158
|
+
}
|
|
1159
|
+
if (value === null || typeof value !== "object")
|
|
1160
|
+
return JSON.stringify(value);
|
|
1161
|
+
return Object.keys(value).length ? null : "{}";
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
// pkgs/@akanjs/devkit/util/spinner.ts
|
|
1166
|
+
import ora from "ora";
|
|
1167
|
+
|
|
1168
|
+
class Spinner {
|
|
1169
|
+
static padding = 12;
|
|
1170
|
+
static oraOptions = { discardStdin: false };
|
|
1171
|
+
static canAnimate(stream = process.stderr) {
|
|
1172
|
+
return !stream.isTTY || stream.columns > 0;
|
|
1173
|
+
}
|
|
1174
|
+
spinner;
|
|
1175
|
+
stopWatch = null;
|
|
1176
|
+
startAt = new Date;
|
|
1177
|
+
prefix;
|
|
1178
|
+
message;
|
|
1179
|
+
enableSpin;
|
|
1180
|
+
constructor(message, { prefix = "", indent = 0, enableSpin = true } = {}) {
|
|
1181
|
+
Spinner.padding = Math.max(Spinner.padding, prefix.length);
|
|
1182
|
+
this.prefix = prefix;
|
|
1183
|
+
this.message = message;
|
|
1184
|
+
this.spinner = ora({ ...Spinner.oraOptions, text: message });
|
|
1185
|
+
this.spinner.prefixText = prefix.padStart(Spinner.padding, " ");
|
|
1186
|
+
this.spinner.indent = indent;
|
|
1187
|
+
this.enableSpin = enableSpin && Spinner.canAnimate();
|
|
1188
|
+
}
|
|
1189
|
+
start() {
|
|
1190
|
+
this.startAt = new Date;
|
|
1191
|
+
if (this.enableSpin) {
|
|
1192
|
+
this.spinner.start();
|
|
1193
|
+
this.stopWatch = setInterval(() => {
|
|
1194
|
+
this.spinner.prefixText = this.prefix.padStart(Spinner.padding, " ");
|
|
1195
|
+
this.spinner.text = `${this.message} (${this.#getElapsedTimeStr({ floor: true })})`;
|
|
1196
|
+
}, 1000);
|
|
1197
|
+
} else
|
|
1198
|
+
this.spinner.info();
|
|
1199
|
+
return this;
|
|
1200
|
+
}
|
|
1201
|
+
succeed(message) {
|
|
1202
|
+
this.spinner.succeed(`${message} (${this.#getElapsedTimeStr()})`);
|
|
1203
|
+
this.#reset();
|
|
1204
|
+
}
|
|
1205
|
+
fail(message) {
|
|
1206
|
+
this.spinner.fail(`${message} (${this.#getElapsedTimeStr()})`);
|
|
1207
|
+
this.#reset();
|
|
1208
|
+
}
|
|
1209
|
+
isSpinning() {
|
|
1210
|
+
return this.spinner.isSpinning;
|
|
1211
|
+
}
|
|
1212
|
+
#reset() {
|
|
1213
|
+
if (this.stopWatch)
|
|
1214
|
+
clearInterval(this.stopWatch);
|
|
1215
|
+
this.stopWatch = null;
|
|
1216
|
+
}
|
|
1217
|
+
#getElapsedTimeStr({ floor = false } = {}) {
|
|
1218
|
+
const ms = Date.now() - this.startAt.getTime();
|
|
1219
|
+
if (ms < 1000)
|
|
1220
|
+
return `${ms}ms`;
|
|
1221
|
+
const s = Math.floor(ms / 1000);
|
|
1222
|
+
if (s < 60)
|
|
1223
|
+
return `${floor ? Math.floor(ms / 1000) : Math.floor(ms / 100) / 10}s`;
|
|
1224
|
+
const m = Math.floor(s / 60);
|
|
1225
|
+
return `${m}m ${s % 60}s`;
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
1229
|
// pkgs/@akanjs/devkit/executors/commandExecutionError.ts
|
|
1230
1230
|
var plainCommandArgPattern = process.platform === "win32" ? /^[\w@%+=:,./\\-]+$/ : /^[\w@%+=:,./-]+$/;
|
|
1231
1231
|
var formatCommandArg = (value) => plainCommandArgPattern.test(value) ? value : JSON.stringify(value);
|
|
@@ -1644,7 +1644,7 @@ class Executor {
|
|
|
1644
1644
|
}
|
|
1645
1645
|
}
|
|
1646
1646
|
async getTypeChecker() {
|
|
1647
|
-
const { TypeChecker } = await import("./typeChecker-
|
|
1647
|
+
const { TypeChecker } = await import("./typeChecker-bfrd1n9n.js");
|
|
1648
1648
|
this.typeChecker ??= new TypeChecker(this);
|
|
1649
1649
|
return this.typeChecker;
|
|
1650
1650
|
}
|
|
@@ -1704,9 +1704,9 @@ import { existsSync as existsSync2 } from "fs";
|
|
|
1704
1704
|
import path10 from "path";
|
|
1705
1705
|
import { capitalize as capitalize2, getPageSourceFileViolation } from "akanjs/common";
|
|
1706
1706
|
|
|
1707
|
-
// pkgs/@akanjs/devkit/agentsIndex.ts
|
|
1707
|
+
// pkgs/@akanjs/devkit/guideline/agentsIndex.ts
|
|
1708
1708
|
var recipeScannerLoad = null;
|
|
1709
|
-
var loadRecipeScanner = () => recipeScannerLoad ??= import("./recipeScanner-
|
|
1709
|
+
var loadRecipeScanner = () => recipeScannerLoad ??= import("./recipeScanner-rrx69awy.js");
|
|
1710
1710
|
var AGENT_BLOCK_START = "<!-- akan:agent:start -->";
|
|
1711
1711
|
var AGENT_BLOCK_END = "<!-- akan:agent:end -->";
|
|
1712
1712
|
var AGENT_VERSION_PREFIX = "<!-- akan:agent:version ";
|
|
@@ -1716,13 +1716,14 @@ ${block}`;
|
|
|
1716
1716
|
var extractBlockVersion = (content) => content.match(/<!-- akan:agent:version ([^\s]+) -->/)?.[1] ?? null;
|
|
1717
1717
|
var readDevkitVersion = async () => {
|
|
1718
1718
|
const { readFile } = await import("fs/promises");
|
|
1719
|
-
const { getDirname } = await import("./fileSys-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1719
|
+
const { getDirname } = await import("./fileSys-q22646yc.js");
|
|
1720
|
+
const dirname = getDirname(import.meta.url);
|
|
1721
|
+
for (const candidate of [`${dirname}/package.json`, `${dirname}/../package.json`]) {
|
|
1722
|
+
try {
|
|
1723
|
+
return JSON.parse(await readFile(candidate, "utf-8")).version ?? null;
|
|
1724
|
+
} catch {}
|
|
1725
1725
|
}
|
|
1726
|
+
return null;
|
|
1726
1727
|
};
|
|
1727
1728
|
var upsertAgentBlock = (existing, block) => {
|
|
1728
1729
|
const managed = `${AGENT_BLOCK_START}
|
|
@@ -1842,7 +1843,7 @@ var renderScopeClaudeMd = (scope) => `# ${scope.name} \u2014 Claude Code Guide
|
|
|
1842
1843
|
${CLAUDE_COMMENT_RULE}
|
|
1843
1844
|
`;
|
|
1844
1845
|
|
|
1845
|
-
// pkgs/@akanjs/devkit/codegenLock.ts
|
|
1846
|
+
// pkgs/@akanjs/devkit/workspace/codegenLock.ts
|
|
1846
1847
|
import { mkdir as mkdir3, open, readFile, rm as rm3, stat as stat2 } from "fs/promises";
|
|
1847
1848
|
import path8 from "path";
|
|
1848
1849
|
import { Logger as Logger2 } from "akanjs/common";
|
|
@@ -1957,7 +1958,7 @@ class CodegenLock {
|
|
|
1957
1958
|
}
|
|
1958
1959
|
}
|
|
1959
1960
|
|
|
1960
|
-
// pkgs/@akanjs/devkit/envSeed.ts
|
|
1961
|
+
// pkgs/@akanjs/devkit/workspace/envSeed.ts
|
|
1961
1962
|
import path9 from "path";
|
|
1962
1963
|
class EnvSeed {
|
|
1963
1964
|
static #server = `import type { ModulesOptions } from "../lib/option";
|
|
@@ -2012,7 +2013,7 @@ export const env: AppClientEnv = {};
|
|
|
2012
2013
|
}
|
|
2013
2014
|
}
|
|
2014
2015
|
|
|
2015
|
-
// pkgs/@akanjs/devkit/libSource.ts
|
|
2016
|
+
// pkgs/@akanjs/devkit/workspace/libSource.ts
|
|
2016
2017
|
class LibSource {
|
|
2017
2018
|
static manifestKey = "akan";
|
|
2018
2019
|
static unhashedDirs = ["env"];
|
|
@@ -2087,7 +2088,7 @@ function formatLibStatuses(statuses) {
|
|
|
2087
2088
|
`);
|
|
2088
2089
|
}
|
|
2089
2090
|
|
|
2090
|
-
// pkgs/@akanjs/devkit/manifestDependencies.ts
|
|
2091
|
+
// pkgs/@akanjs/devkit/workspace/manifestDependencies.ts
|
|
2091
2092
|
class ManifestDependencies {
|
|
2092
2093
|
#root;
|
|
2093
2094
|
#runtime;
|
|
@@ -3383,7 +3384,7 @@ CMD [${command.map((c) => `"${c}"`).join(",")}]`;
|
|
|
3383
3384
|
return new AkanAppConfig(app, libs, rootPackageJson, config, baseDevEnv, plugins ?? [], libContributions);
|
|
3384
3385
|
}
|
|
3385
3386
|
static async#collectLibContributions(app, libs, bustImportCache) {
|
|
3386
|
-
const { LibExecutor } = await import("./libExecutor-
|
|
3387
|
+
const { LibExecutor } = await import("./libExecutor-hxe5eqfh.js");
|
|
3387
3388
|
const libConfigs = await Promise.all(libs.map(async (libName) => AkanLibConfig.from(LibExecutor.from(app, libName), { bustImportCache }).catch((error) => {
|
|
3388
3389
|
if (error instanceof LibConfigRefusal)
|
|
3389
3390
|
throw error;
|
|
@@ -3603,4 +3604,4 @@ class AkanWorkspaceConfig {
|
|
|
3603
3604
|
return `${url.origin}${url.pathname.replace(/\/+$/, "")}`;
|
|
3604
3605
|
}
|
|
3605
3606
|
}
|
|
3606
|
-
export { binPlatforms, rootAllowedFiles, rootAllowedDirs, isAllowedLibFacetRootFile, libFacetRootHintOf, barrelFacetDirs, facetIndexShadowOf, rootEntryHintOf, isScannedRootEntry,
|
|
3607
|
+
export { binPlatforms, rootAllowedFiles, rootAllowedDirs, isAllowedLibFacetRootFile, libFacetRootHintOf, barrelFacetDirs, facetIndexShadowOf, rootEntryHintOf, isScannedRootEntry, parseBiomeReport, Linter, ProjectTypecheck2, JsonFormatter, Spinner, CommandExecutionError, execEmoji, Executor, AGENT_BLOCK_START, AGENT_BLOCK_END, stampBlockVersion, extractBlockVersion, readDevkitVersion, upsertAgentBlock, extractAgentBlock, renderRecipeEntries, collectScopeRecipeSources, renderScopeAgentBlock, CLAUDE_COMMENT_RULE, CodegenLock, LibSource, formatLibStatuses, SysExecutor, AppInfo, PkgInfo, parseEnvFile, WorkspaceExecutor, ServerEnvProfile, AkanAppConfig, AkanLibConfig, increaseBuildNum, decreaseBuildNum, AkanWorkspaceConfig };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
script
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-neassptx.js";
|
|
5
5
|
import {
|
|
6
6
|
AppExecutor2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-trp7jdr1.js";
|
|
8
8
|
import {
|
|
9
9
|
LibExecutor2
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-n8mxyy3f.js";
|
|
11
11
|
import {
|
|
12
12
|
InteractionScaffold,
|
|
13
13
|
workflowStatus,
|
|
@@ -46,16 +46,16 @@ import {
|
|
|
46
46
|
withFieldTypeImport,
|
|
47
47
|
KeyRename,
|
|
48
48
|
MutationScaffold
|
|
49
|
-
} from "./index-
|
|
49
|
+
} from "./index-669sg3yp.js";
|
|
50
50
|
import {
|
|
51
51
|
ModuleScript
|
|
52
|
-
} from "./index-
|
|
52
|
+
} from "./index-bjnebzzc.js";
|
|
53
53
|
import {
|
|
54
54
|
plainNameProblem
|
|
55
55
|
} from "./index-va90m8nd.js";
|
|
56
56
|
import {
|
|
57
57
|
ModuleExecutor
|
|
58
|
-
} from "./index-
|
|
58
|
+
} from "./index-dqsc1b5t.js";
|
|
59
59
|
|
|
60
60
|
// pkgs/@akanjs/cli/primitive/primitive.script.ts
|
|
61
61
|
import { capitalize, lowerlize } from "akanjs/common";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AppInfo
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-g56xae1n.js";
|
|
5
5
|
|
|
6
|
-
// pkgs/@akanjs/devkit/slicePlanner.ts
|
|
6
|
+
// pkgs/@akanjs/devkit/workspace/slicePlanner.ts
|
|
7
7
|
class SlicePlanner {
|
|
8
8
|
static memberDirs = ["apps", "libs", "pkgs"];
|
|
9
9
|
static toolchainDependencies = [
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
AsyncDefaultExportDetector,
|
|
4
4
|
StoreBootstrap,
|
|
5
5
|
resolveSsrPageEntriesForApp
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-trp7jdr1.js";
|
|
7
7
|
import {
|
|
8
8
|
FileSys2
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-by2tvsq6.js";
|
|
10
10
|
|
|
11
11
|
// pkgs/@akanjs/devkit/transforms/barrelAnalyzer.ts
|
|
12
12
|
import fs from "fs";
|