@akanjs/cli 3.2.0-rc.2 → 3.2.0-rc.4
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-6cpjtj25.js → CodeAgent-4a2skdph.js} +3 -3
- package/{CodeTui-zyc7zaq6.js → CodeTui-enrzsnzc.js} +1 -1
- package/{TunnelShare-zkfkrw8w.js → TunnelShare-xs5rrpf1.js} +5 -5
- package/{agent.command-kf1g3nh4.js → agent.command-y22t9x1e.js} +12 -12
- package/akanCode.js +3 -3
- package/{application.command-vb278qnq.js → application.command-yhj5arwc.js} +10 -10
- package/{applicationBuildRunner-bqbyeg84.js → applicationBuildRunner-6w1fd61b.js} +5 -5
- package/buildBatch.proc.js +4 -4
- package/{cloud.command-ca777ee2.js → cloud.command-bqfh4cnx.js} +15 -15
- package/cloud.script-8jvfw1sh.js +30 -0
- package/{code.command-j08txqcd.js → code.command-y94hwxsn.js} +5 -5
- package/{context.command-2fa6egp9.js → context.command-xz65fhrn.js} +17 -17
- package/context.runner-dpt5wjb7.js +29 -0
- package/{devTui-w38ch13a.js → devTui-h77zrjv5.js} +1 -1
- package/{guideline.command-w6yqpdec.js → guideline.command-sn843nw6.js} +1 -1
- package/guidelines/conventions/rules/page.md +4 -0
- package/guidelines/pageRule/pageRule.instruction.md +5 -0
- package/guidelines/runtimeRule/runtimeRule.instruction.md +5 -1
- package/guidelines/transportRule/transportRule.instruction.md +5 -0
- package/incrementalBuilder.proc.js +5 -5
- package/{index-xq97me1h.js → index-02b8qvww.js} +7 -7
- package/{index-j1hjb477.js → index-2rcptfyp.js} +1 -1
- package/{index-ebwkh7bt.js → index-39jz41jb.js} +23 -5
- package/{index-84c2pgak.js → index-3rff2c48.js} +1 -0
- package/{index-dk4g0x0d.js → index-3wen6ddy.js} +1 -1
- package/{index-c5ymqb05.js → index-49y45vbj.js} +9 -9
- package/{index-cbcwxp5v.js → index-4mgabs8t.js} +7 -5
- package/{index-0fj9ra3q.js → index-50mg8bsm.js} +4 -4
- package/{index-20wvskt8.js → index-5hhe0rdd.js} +1 -1
- package/{index-kcpk2d20.js → index-5qq6qky3.js} +8 -8
- package/{index-vbhx60x5.js → index-5w8amdr7.js} +1 -1
- package/{index-bdmgqzb5.js → index-8vxdsqra.js} +35 -22
- package/{index-m5sg5spm.js → index-9p260r4e.js} +114 -24
- package/{index-8nbx607g.js → index-ah09graf.js} +56 -25
- package/{index-23860fej.js → index-b4qq3rq0.js} +23 -8
- package/{index-mvwvxgtd.js → index-b9q5aw30.js} +12 -12
- package/{index-1cb9apzn.js → index-cmg5ngqa.js} +1 -1
- package/{index-0mqga3h9.js → index-fqx74yxn.js} +11 -8
- package/{index-djc5nxpy.js → index-g43360sn.js} +2 -2
- package/{index-65b6ms4c.js → index-gsty3pkx.js} +6 -2
- package/{index-386canwe.js → index-hkq0q73d.js} +44 -25
- package/{index-htxck0pn.js → index-jgj6ajnk.js} +8 -3
- package/{index-466z5931.js → index-jqsj5wjb.js} +2 -2
- package/{index-xa0289eg.js → index-jrdp7c4h.js} +6 -1
- package/{index-wr9magsr.js → index-jxaq2evq.js} +1 -1
- package/{index-pq5rjkch.js → index-kgxhwgdk.js} +7 -2
- package/{index-6h775rv3.js → index-kjmrkc45.js} +4 -4
- package/{index-abfbf01s.js → index-kr8dvqnr.js} +1 -1
- package/{index-j7p0jgaq.js → index-qrp98bmp.js} +4 -4
- package/{index-qgazn58x.js → index-sjj3ywn5.js} +16 -9
- package/index-va90m8nd.js +25 -0
- package/{index-e22zedc2.js → index-vftjqv28.js} +2 -2
- package/{index-2gees180.js → index-w15hnxmb.js} +5 -5
- package/{index-annxfpgz.js → index-w88xghey.js} +6 -6
- package/{index-7kmbqp0b.js → index-z9b72teg.js} +1 -1
- package/index.js +22 -22
- package/{library.command-8d03a0pq.js → library.command-6eafevmj.js} +2 -2
- package/{localRegistry.command-vyv5k6t0.js → localRegistry.command-9tef2qsj.js} +14 -14
- package/{module.command-vy3kg965.js → module.command-pn1k7dfk.js} +10 -6
- package/{package.command-qjh13rs9.js → package.command-kbg9z7re.js} +4 -4
- package/package.json +2 -2
- package/{page.command-t0nx1jat.js → page.command-st0y2xg8.js} +2 -2
- package/{pipeline.command-2yjeas7m.js → pipeline.command-76m32y7z.js} +1 -1
- package/{primitive.command-8vm49279.js → primitive.command-ax6wg70s.js} +6 -6
- package/{quality.command-v76fev72.js → quality.command-0gzskga8.js} +3 -3
- package/{repair.command-fp4m3w03.js → repair.command-g5kc3x89.js} +5 -5
- package/{scalar.command-hxe6try8.js → scalar.command-ck8621dy.js} +4 -4
- package/skills/akan-debug/SKILL.md +6 -2
- package/skills/akan-transport/SKILL.md +2 -0
- package/{subspace.command-q42n1844.js → subspace.command-vh6dye0v.js} +6 -6
- package/{tunnel.command-22g11n0x.js → tunnel.command-4mezrypt.js} +6 -6
- package/{verify.command-rx43bha1.js → verify.command-f2n4bwp7.js} +9 -9
- package/{workflow.command-yg0d8mmq.js → workflow.command-bx9xwgs5.js} +10 -10
- package/{workspace.command-fcfztvn5.js → workspace.command-04qgwsst.js} +33 -29
- package/cloud.script-agpxzq6j.js +0 -30
- package/context.runner-ftv8373t.js +0 -29
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
ExitCodeError,
|
|
8
8
|
markCliErrorPrinted,
|
|
9
9
|
assertPromptable
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-hkq0q73d.js";
|
|
11
11
|
import {
|
|
12
12
|
SysExecutor,
|
|
13
13
|
AppExecutor,
|
|
@@ -16,22 +16,25 @@ import {
|
|
|
16
16
|
} from "./index-wfmpxke3.js";
|
|
17
17
|
import {
|
|
18
18
|
DesktopServerStage
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-5hhe0rdd.js";
|
|
20
20
|
import {
|
|
21
21
|
LibraryScript
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-jrdp7c4h.js";
|
|
23
23
|
import {
|
|
24
24
|
ApplicationRunner,
|
|
25
25
|
VerifyScope
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-5qq6qky3.js";
|
|
27
27
|
import {
|
|
28
28
|
PreviewChrome2,
|
|
29
29
|
PreviewView2,
|
|
30
30
|
stripAnsi
|
|
31
|
-
} from "./index-
|
|
31
|
+
} from "./index-b4qq3rq0.js";
|
|
32
32
|
import {
|
|
33
33
|
formatSlicePlan
|
|
34
34
|
} from "./index-8jpc5fqv.js";
|
|
35
|
+
import {
|
|
36
|
+
assertPlainName
|
|
37
|
+
} from "./index-va90m8nd.js";
|
|
35
38
|
import {
|
|
36
39
|
openBrowser
|
|
37
40
|
} from "./index-9dp031by.js";
|
|
@@ -630,15 +633,10 @@ class AppPreview {
|
|
|
630
633
|
const unavailable = PreviewView2.unavailableReason(engine);
|
|
631
634
|
if (unavailable)
|
|
632
635
|
throw new Error(unavailable);
|
|
633
|
-
const { i18n, api } = await app.getConfig();
|
|
634
636
|
const changed = options.changed ? await AppPreview.#changedPages(app) : { paths: [], skipped: [] };
|
|
635
637
|
if (options.changed && !changed.paths.length && !options.paths?.length)
|
|
636
638
|
throw new Error(`No page to open: ${changed.skipped.join("; ")}. Pass a concrete path, e.g. \`akan preview ${app.name} /memo/1\`.`);
|
|
637
|
-
const paths = AppPreview.
|
|
638
|
-
csr: !!options.csr,
|
|
639
|
-
apiPrefix: api.prefix,
|
|
640
|
-
publicDir: path2.join(app.cwdPath, "public")
|
|
641
|
-
});
|
|
639
|
+
const paths = await AppPreview.pathsOf(app, options.paths ?? [], !!options.csr, changed.paths);
|
|
642
640
|
const port = await app.getDevPort();
|
|
643
641
|
const origin = `http://localhost:${port}`;
|
|
644
642
|
const root = app.workspace.workspaceRoot;
|
|
@@ -690,12 +688,23 @@ class AppPreview {
|
|
|
690
688
|
started?.proc.unref();
|
|
691
689
|
}
|
|
692
690
|
}
|
|
693
|
-
static
|
|
691
|
+
static async pathsOf(app, paths, csr, pages = []) {
|
|
692
|
+
const { i18n, api } = await app.getConfig();
|
|
693
|
+
return AppPreview.pagePaths(paths, i18n, {
|
|
694
|
+
csr,
|
|
695
|
+
apiPrefix: api.prefix,
|
|
696
|
+
publicDir: path2.join(app.cwdPath, "public"),
|
|
697
|
+
pages
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
static pagePaths(paths, i18n, {
|
|
701
|
+
csr,
|
|
702
|
+
apiPrefix = "/api",
|
|
703
|
+
publicDir = null,
|
|
704
|
+
pages = []
|
|
705
|
+
}) {
|
|
694
706
|
const keepsUnprefixed = i18n.localePrefix === "as-needed" && !csr;
|
|
695
|
-
const
|
|
696
|
-
const url = new URL(/^https?:\/\//.test(raw) ? raw : `http://localhost${raw.startsWith("/") ? "" : "/"}${raw}`);
|
|
697
|
-
if (!AppPreview.#isPagePath(url.pathname, i18n, { apiPrefix, publicDir }))
|
|
698
|
-
return `${url.pathname}${url.search}`;
|
|
707
|
+
const asPage = (url) => {
|
|
699
708
|
const [first] = url.pathname.split("/").filter(Boolean);
|
|
700
709
|
if (!keepsUnprefixed && (!first || !i18n.locales.includes(first)))
|
|
701
710
|
url.pathname = `/${i18n.defaultLocale}${url.pathname === "/" ? "/" : url.pathname}`;
|
|
@@ -704,11 +713,26 @@ class AppPreview {
|
|
|
704
713
|
url.searchParams.set("akanMobileTarget", AppPreview.csrTarget);
|
|
705
714
|
}
|
|
706
715
|
return `${url.pathname}${url.search}`;
|
|
716
|
+
};
|
|
717
|
+
const urlOf = (raw) => new URL(`http://localhost${raw.startsWith("/") ? "" : "/"}${raw}`);
|
|
718
|
+
const typed = (paths.length || pages.length ? paths : ["/"]).map((raw) => {
|
|
719
|
+
if (/^https?:\/\//.test(raw)) {
|
|
720
|
+
const url = new URL(raw);
|
|
721
|
+
return `${url.pathname}${url.search}`;
|
|
722
|
+
}
|
|
723
|
+
const url = urlOf(raw);
|
|
724
|
+
return AppPreview.#isPagePath(url.pathname, i18n, { apiPrefix, publicDir }) ? asPage(url) : `${url.pathname}${url.search}`;
|
|
707
725
|
});
|
|
708
|
-
return [...new Set(pages)];
|
|
709
|
-
}
|
|
710
|
-
static #serverFiles = new Set([
|
|
711
|
-
|
|
726
|
+
return [...new Set([...typed, ...pages.map((page) => asPage(urlOf(page)))])];
|
|
727
|
+
}
|
|
728
|
+
static #serverFiles = new Set([
|
|
729
|
+
"/favicon.ico",
|
|
730
|
+
"/robots.txt",
|
|
731
|
+
"/sitemap.xml",
|
|
732
|
+
"/manifest.webmanifest",
|
|
733
|
+
"/openapi.json",
|
|
734
|
+
"/mcp"
|
|
735
|
+
]);
|
|
712
736
|
static #isPagePath(pathname, i18n, { apiPrefix, publicDir }) {
|
|
713
737
|
const segments = pathname.split("/").filter(Boolean);
|
|
714
738
|
const [first] = segments;
|
|
@@ -719,7 +743,7 @@ class AppPreview {
|
|
|
719
743
|
return false;
|
|
720
744
|
if (AppPreview.#serverFiles.has(pathname))
|
|
721
745
|
return false;
|
|
722
|
-
if (segments.length === 2 &&
|
|
746
|
+
if (segments.length === 2 && segments[1] === "manifest.webmanifest")
|
|
723
747
|
return false;
|
|
724
748
|
return !(publicDir && AppPreview.#isPublicFile(publicDir, pathname));
|
|
725
749
|
}
|
|
@@ -774,8 +798,14 @@ class AppPreview {
|
|
|
774
798
|
}
|
|
775
799
|
static screenshotName(pagePath) {
|
|
776
800
|
const url = new URL(pagePath, "http://localhost");
|
|
777
|
-
const
|
|
778
|
-
|
|
801
|
+
const slugOf = (text) => text.replace(/[^\w-]/g, "_");
|
|
802
|
+
const hashOf = (text) => Bun.hash(text).toString(36).slice(0, 6);
|
|
803
|
+
const pathSlug = slugOf(url.pathname.split("/").filter(Boolean).join("-")) || "index";
|
|
804
|
+
const page = pathSlug.length > 80 ? `${pathSlug.slice(0, 80)}-${hashOf(url.pathname)}` : pathSlug;
|
|
805
|
+
const params = [...url.searchParams].filter(([key]) => key !== "csr" && key !== "akanMobileTarget");
|
|
806
|
+
const readable = slugOf(params.map(([key, value]) => `${key}-${value}`).join("-")).slice(0, 40);
|
|
807
|
+
const query = params.length ? `.${readable}-${hashOf(new URLSearchParams(params).toString())}` : "";
|
|
808
|
+
return `${page}${query}${url.searchParams.get("csr") === "true" ? ".csr" : ""}.png`;
|
|
779
809
|
}
|
|
780
810
|
static attribute(page, records) {
|
|
781
811
|
const pathname = new URL(page.finalUrl).pathname;
|
|
@@ -1258,6 +1288,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
|
|
|
1258
1288
|
}
|
|
1259
1289
|
}
|
|
1260
1290
|
async createApplication(appName, workspace, { start = false, libs = [] } = {}) {
|
|
1291
|
+
assertPlainName("app", appName);
|
|
1261
1292
|
const spinner = workspace.spinning("Creating application...");
|
|
1262
1293
|
const app = await this.applicationRunner.createApplication(appName, workspace, libs);
|
|
1263
1294
|
spinner.succeed(`Application created in apps/${app.name}`);
|
|
@@ -1483,7 +1514,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
|
|
|
1483
1514
|
throw new Error("No app selected to start");
|
|
1484
1515
|
const startedDatabase = dbup ? await this.#prepareSharedDatabase(apps) : false;
|
|
1485
1516
|
const supervisor = new DevSupervisor({ apps, mode, concurrency, open, write, shares });
|
|
1486
|
-
const view = mode === "tui" ? new (await import("./devTui-
|
|
1517
|
+
const view = mode === "tui" ? new (await import("./devTui-h77zrjv5.js")).DevTui(supervisor) : new DevStreamView(apps.map((app) => app.name));
|
|
1487
1518
|
await supervisor.run(view);
|
|
1488
1519
|
if (startedDatabase)
|
|
1489
1520
|
await this.#stopDatabase(workspace);
|
|
@@ -1647,7 +1678,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
|
|
|
1647
1678
|
await Promise.all(shares.map(async (share) => await share.close()));
|
|
1648
1679
|
}, "Abandoning the tunnel release; the shares expire on their own.");
|
|
1649
1680
|
await Promise.all(apps.map(async (app) => {
|
|
1650
|
-
const { TunnelShare } = await import("./TunnelShare-
|
|
1681
|
+
const { TunnelShare } = await import("./TunnelShare-xs5rrpf1.js");
|
|
1651
1682
|
const share = await TunnelShare.open(app, { workspace: app.workspace });
|
|
1652
1683
|
shares.push(share);
|
|
1653
1684
|
urls.set(app.name, share.url);
|
|
@@ -102,15 +102,8 @@ class PreviewView2 {
|
|
|
102
102
|
settleMs = 0
|
|
103
103
|
} = {}) {
|
|
104
104
|
const logs = [];
|
|
105
|
-
const view = PreviewView2.#open({ width, height, engine, onConsole: (line) => logs.push(line) });
|
|
105
|
+
const view = await PreviewView2.#start(() => PreviewView2.#open({ width, height, engine, onConsole: (line) => logs.push(line) }), engine, { startTimeoutMs, timeoutMs });
|
|
106
106
|
try {
|
|
107
|
-
const startMs = PreviewView2.#stalled.has(engine) ? Math.min(startTimeoutMs, timeoutMs) : startTimeoutMs;
|
|
108
|
-
const stalled = new Error(`Timed out starting the ${engine} browser after ${startMs / 1000} s.`);
|
|
109
|
-
await PreviewView2.#within(view.navigate("about:blank"), Date.now() + startMs, stalled).then(() => PreviewView2.#stalled.delete(engine), (error) => {
|
|
110
|
-
if (error === stalled)
|
|
111
|
-
PreviewView2.#stalled.add(engine);
|
|
112
|
-
throw error;
|
|
113
|
-
});
|
|
114
107
|
const deadline = Date.now() + timeoutMs;
|
|
115
108
|
const within = (work, what) => PreviewView2.#within(work, deadline, new Error(`Timed out ${what} ${url}; the dev server may be rebuilding or stuck.`));
|
|
116
109
|
let page = await PreviewView2.#load(view, url, settleMs, within);
|
|
@@ -136,6 +129,28 @@ class PreviewView2 {
|
|
|
136
129
|
await view.close();
|
|
137
130
|
}
|
|
138
131
|
}
|
|
132
|
+
static async#start(open, engine, { startTimeoutMs, timeoutMs }) {
|
|
133
|
+
for (let attempt = 1;; attempt++) {
|
|
134
|
+
const startMs = PreviewView2.#stalled.has(engine) ? Math.min(startTimeoutMs, timeoutMs) : startTimeoutMs;
|
|
135
|
+
const stalled = new Error(`Timed out starting the ${engine} browser after ${startMs / 1000} s.`);
|
|
136
|
+
let view;
|
|
137
|
+
try {
|
|
138
|
+
view = open();
|
|
139
|
+
await PreviewView2.#within(view.navigate("about:blank"), Date.now() + startMs, stalled);
|
|
140
|
+
PreviewView2.#stalled.delete(engine);
|
|
141
|
+
return view;
|
|
142
|
+
} catch (error) {
|
|
143
|
+
await view?.close();
|
|
144
|
+
if (error === stalled)
|
|
145
|
+
PreviewView2.#stalled.add(engine);
|
|
146
|
+
else
|
|
147
|
+
PreviewView2.#stalled.delete(engine);
|
|
148
|
+
if (error === stalled || attempt > 1)
|
|
149
|
+
throw error;
|
|
150
|
+
await Bun.sleep(100);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
139
154
|
static async#load(view, url, settleMs, within) {
|
|
140
155
|
await within(view.navigate(url), "loading");
|
|
141
156
|
if (settleMs > 0)
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
AppExecutor
|
|
4
|
+
} from "./index-wfmpxke3.js";
|
|
2
5
|
import {
|
|
3
6
|
buildResourceList,
|
|
4
7
|
codexMcpConfigPath,
|
|
@@ -8,26 +11,23 @@ import {
|
|
|
8
11
|
upsertCodexMcpServerBlock,
|
|
9
12
|
renderDoctorText,
|
|
10
13
|
AkanContextAnalyzer
|
|
11
|
-
} from "./index-
|
|
12
|
-
import {
|
|
13
|
-
AppExecutor
|
|
14
|
-
} from "./index-wfmpxke3.js";
|
|
14
|
+
} from "./index-fqx74yxn.js";
|
|
15
15
|
import {
|
|
16
16
|
jsonText,
|
|
17
17
|
workflowStatus,
|
|
18
18
|
createWorkflowBaselineSummary,
|
|
19
19
|
buildAkanModuleContextIndex,
|
|
20
20
|
toolingRolloutGate
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-02b8qvww.js";
|
|
22
22
|
import {
|
|
23
23
|
runner
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-hkq0q73d.js";
|
|
25
25
|
import {
|
|
26
26
|
NativeApp
|
|
27
|
-
} from "./index-
|
|
27
|
+
} from "./index-g43360sn.js";
|
|
28
28
|
import {
|
|
29
29
|
isPlaceholderAppId
|
|
30
|
-
} from "./index-
|
|
30
|
+
} from "./index-5hhe0rdd.js";
|
|
31
31
|
import {
|
|
32
32
|
getMobileTargets,
|
|
33
33
|
appIdsOf
|
|
@@ -37,13 +37,13 @@ import {
|
|
|
37
37
|
} from "./index-j6eeh5d7.js";
|
|
38
38
|
import {
|
|
39
39
|
WorkspaceGraph
|
|
40
|
-
} from "./index-
|
|
40
|
+
} from "./index-39jz41jb.js";
|
|
41
41
|
import {
|
|
42
42
|
RepairRunner
|
|
43
|
-
} from "./index-
|
|
43
|
+
} from "./index-4mgabs8t.js";
|
|
44
44
|
import {
|
|
45
45
|
WorkflowRunner
|
|
46
|
-
} from "./index-
|
|
46
|
+
} from "./index-49y45vbj.js";
|
|
47
47
|
|
|
48
48
|
// pkgs/@akanjs/devkit/akanMcpContract.ts
|
|
49
49
|
import { lstatSync, realpathSync } from "fs";
|
|
@@ -300,7 +300,7 @@ var readonlyMcpTools = [
|
|
|
300
300
|
},
|
|
301
301
|
{
|
|
302
302
|
name: "get_graph",
|
|
303
|
-
description: "Read-only Akan Graph from source, no dev server needed: models with their fields and relations, slices and endpoints with the guards they name (each guard keyed by the app or lib that declares it, with its scope and the comment that says what it checks), the service methods and queries each calls, the store actions that fetch them, and the components and routes that use them. A module's jobs (internal: interval, cron, timeout, initialize, destroy, process) read their schedule and server or operation modes and call service methods like endpoints do; each adaptor a service plugs (an adapt() class, or an akanjs role) is a node, a method that calls it links to it,
|
|
303
|
+
description: "Read-only Akan Graph from source, no dev server needed: models with their fields and relations, slices and endpoints with the guards they name (each guard keyed by the app or lib that declares it, with its scope and the comment that says what it checks), the service methods and queries each calls, the store actions that fetch them, and the components and routes that use them. A module's jobs (internal: interval, cron, timeout, initialize, destroy, process) read their schedule and server or operation modes and call service methods like endpoints do; each adaptor a service plugs (an adapt() class, or an akanjs role) is a node, a method that calls it links to it (an app service holds the fields its module's lib services plug, unless it declares the field itself), an adaptor links to the adaptors it plugs itself, a class from a package outside the workspace is adaptor:<package>:<Name>, and a role an app binds with applyAdaptor(Role, Impl) links to that implementation (binds, labelled with the app; a scope keeps its app's bindings). Each page/ file is a route (its URL pattern after the locale) or a layout, layouts wrap what they contain, and a route or layout that runs .guard() reads `guard` and links each function its guard calls; a layout's guard gates every route it wraps. A graph too large to answer unscoped drops first the routes and layouts that neither changed nor use a change; app or module brings them back. Every node and edge carries its source location. Pass app and/or module to scope a large workspace. Pass since (a git revision such as main, or HEAD for uncommitted work) for the Change Map instead: what changed since HEAD forked from it, working tree included, with each node, field and edge marked added, removed or changed, the unchanged neighbours they call or are called by, and the changed files no node covers, each marked the same way.",
|
|
304
304
|
inputSchema: { type: "object", properties: { app: stringProperty, module: stringProperty, since: stringProperty } }
|
|
305
305
|
},
|
|
306
306
|
{
|
|
@@ -23,26 +23,31 @@ import {
|
|
|
23
23
|
workflowPathsForPlan,
|
|
24
24
|
workflowRunArtifactPath,
|
|
25
25
|
workflowSyncDir
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-02b8qvww.js";
|
|
27
27
|
|
|
28
28
|
// pkgs/@akanjs/devkit/akanContext.ts
|
|
29
29
|
import { readdir } from "fs/promises";
|
|
30
30
|
import path from "path";
|
|
31
31
|
import { capitalize, isRecord, parseRouteModuleKey } from "akanjs/common";
|
|
32
32
|
|
|
33
|
-
// pkgs/@akanjs/devkit/
|
|
33
|
+
// pkgs/@akanjs/devkit/moduleFieldNames.ts
|
|
34
34
|
import ts from "typescript";
|
|
35
35
|
var isFieldCall = (node) => ts.isCallExpression(node) && (ts.isIdentifier(node.expression) ? node.expression.text === "field" : ts.isPropertyAccessExpression(node.expression) && isFieldCall(node.expression.expression));
|
|
36
|
-
var
|
|
36
|
+
var propertyNames = (content, declares) => {
|
|
37
37
|
const names = [];
|
|
38
38
|
const visit = (node) => {
|
|
39
|
-
if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name) &&
|
|
39
|
+
if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name) && declares(node.initializer))
|
|
40
40
|
names.push(node.name.text);
|
|
41
41
|
ts.forEachChild(node, visit);
|
|
42
42
|
};
|
|
43
|
-
visit(ts.createSourceFile("
|
|
43
|
+
visit(ts.createSourceFile("module.ts", content, ts.ScriptTarget.Latest));
|
|
44
44
|
return names;
|
|
45
45
|
};
|
|
46
|
+
var constantFieldNames = (content) => propertyNames(content, isFieldCall);
|
|
47
|
+
var unlabeledFieldNames = (constantContent, dictionaryContent) => {
|
|
48
|
+
const labels = new Set(propertyNames(dictionaryContent, () => true));
|
|
49
|
+
return constantFieldNames(constantContent).filter((name) => !labels.has(name));
|
|
50
|
+
};
|
|
46
51
|
|
|
47
52
|
// pkgs/@akanjs/devkit/akanContext.ts
|
|
48
53
|
var guidelineResourceUri = (name) => `akan://guidelines/${name}`;
|
|
@@ -546,9 +551,7 @@ class AkanContextAnalyzer {
|
|
|
546
551
|
safeReadText(dictionaryPath)
|
|
547
552
|
]);
|
|
548
553
|
if (constantContent && dictionaryContent) {
|
|
549
|
-
for (const fieldName of
|
|
550
|
-
if (new RegExp(`\\b${fieldName}\\s*:`).test(dictionaryContent))
|
|
551
|
-
continue;
|
|
554
|
+
for (const fieldName of unlabeledFieldNames(constantContent, dictionaryContent)) {
|
|
552
555
|
report({
|
|
553
556
|
severity: "warning",
|
|
554
557
|
code: "dictionary-label-missing",
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
} from "./index-m9jj544v.js";
|
|
13
13
|
import {
|
|
14
14
|
CsrArtifactBuilder
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-jxaq2evq.js";
|
|
16
16
|
import {
|
|
17
17
|
ExitCodeError
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-hkq0q73d.js";
|
|
19
19
|
|
|
20
20
|
// pkgs/@akanjs/devkit/mobile/desktopBin.ts
|
|
21
21
|
import { chmod, mkdir, rename, rm, writeFile } from "fs/promises";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-hkq0q73d.js";
|
|
6
6
|
import {
|
|
7
7
|
FileSys2
|
|
8
8
|
} from "./index-bns3wcpc.js";
|
|
@@ -14,10 +14,13 @@ import {
|
|
|
14
14
|
} from "./index-qd7xn2bk.js";
|
|
15
15
|
import {
|
|
16
16
|
FrameworkGraph
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-cmg5ngqa.js";
|
|
18
18
|
import {
|
|
19
19
|
MaintainabilityBaseline
|
|
20
20
|
} from "./index-ygrdw6jw.js";
|
|
21
|
+
import {
|
|
22
|
+
assertPackageName
|
|
23
|
+
} from "./index-va90m8nd.js";
|
|
21
24
|
|
|
22
25
|
// pkgs/@akanjs/cli/package/package.runner.ts
|
|
23
26
|
import path2 from "path";
|
|
@@ -404,6 +407,7 @@ class PackageScript extends script("package", [PackageRunner]) {
|
|
|
404
407
|
return await this.packageRunner.version(workspace, { log });
|
|
405
408
|
}
|
|
406
409
|
async createPackage(workspace, pkgName) {
|
|
410
|
+
assertPackageName(pkgName);
|
|
407
411
|
const spinner = workspace.spinning(`Creating package in pkgs/${pkgName}...`);
|
|
408
412
|
await this.packageRunner.createPackage(workspace, pkgName);
|
|
409
413
|
spinner.succeed(`Package in pkgs/${pkgName} is created`);
|
|
@@ -58,6 +58,7 @@ var SysOrOnlyApp = createInternalArgToken("Sys", { onlyApp: true });
|
|
|
58
58
|
var Exec = createInternalArgToken("Exec");
|
|
59
59
|
var Pkg = createInternalArgToken("Pkg");
|
|
60
60
|
var Module = createInternalArgToken("Module");
|
|
61
|
+
var ModuleOrService = createInternalArgToken("Module", { services: true });
|
|
61
62
|
var Workspace = createInternalArgToken("Workspace");
|
|
62
63
|
// pkgs/@akanjs/devkit/commandDecorators/command.ts
|
|
63
64
|
import path3 from "path";
|
|
@@ -594,6 +595,14 @@ var getInternalArgumentValue = async (argMeta, value, workspace, rerun, { destru
|
|
|
594
595
|
throw refusalOf(problemOf(kind), "this command deletes files and never picks its target", refusal);
|
|
595
596
|
assertPromptable(problemOf(kind), refusal);
|
|
596
597
|
};
|
|
598
|
+
const takeOnly = (kind, names, take) => {
|
|
599
|
+
const [only] = names;
|
|
600
|
+
if (value || destructive || process.stdin.isTTY || names.length !== 1 || !only)
|
|
601
|
+
return null;
|
|
602
|
+
const how = rerun ? `: ${rerun(only)}` : "";
|
|
603
|
+
Logger.rawLog(`No ${kind} named, so this runs on '${only}', the only one in this workspace${how}`, undefined, "error");
|
|
604
|
+
return take(only);
|
|
605
|
+
};
|
|
597
606
|
if (sysType === "sys" || sysType === "exec") {
|
|
598
607
|
const pkgChoices = sysType === "exec" ? pkgNames : [];
|
|
599
608
|
const execOf = (name) => {
|
|
@@ -612,12 +621,9 @@ var getInternalArgumentValue = async (argMeta, value, workspace, rerun, { destru
|
|
|
612
621
|
return AppExecutor.from(workspace, appNames[0]);
|
|
613
622
|
const [kind, placeholder] = sysType === "exec" ? ["app, lib or pkg", "<app-lib-or-pkg>"] : ["app or lib", "<app-or-lib>"];
|
|
614
623
|
const choices = [...appNames, ...libNames, ...pkgChoices];
|
|
615
|
-
const only = choices
|
|
616
|
-
if (
|
|
617
|
-
const how = rerun ? `: ${rerun(only.name)}` : "";
|
|
618
|
-
Logger.rawLog(`No ${kind} named, so this runs on '${only.name}', the only one in this workspace${how}`, undefined, "error");
|
|
624
|
+
const only = takeOnly(kind, choices, execOf);
|
|
625
|
+
if (only)
|
|
619
626
|
return only;
|
|
620
|
-
}
|
|
621
627
|
assertAskable(kind, choices, placeholder);
|
|
622
628
|
const name = await select({
|
|
623
629
|
message: sysType === "exec" ? `Select the App or Lib or Pkg name` : `Select the App or Lib name`,
|
|
@@ -638,6 +644,9 @@ var getInternalArgumentValue = async (argMeta, value, workspace, rerun, { destru
|
|
|
638
644
|
} else if (sysType === "lib") {
|
|
639
645
|
if (value && libNames.includes(value))
|
|
640
646
|
return LibExecutor.from(workspace, value);
|
|
647
|
+
const only = takeOnly("lib", libNames, (name) => LibExecutor.from(workspace, name));
|
|
648
|
+
if (only)
|
|
649
|
+
return only;
|
|
641
650
|
assertAskable("lib", libNames, "<lib>");
|
|
642
651
|
const libName = await select({ message: `Select the ${sysType} name`, choices: libNames });
|
|
643
652
|
return LibExecutor.from(workspace, libName);
|
|
@@ -645,34 +654,44 @@ var getInternalArgumentValue = async (argMeta, value, workspace, rerun, { destru
|
|
|
645
654
|
const pkgs = await workspace.getPkgs();
|
|
646
655
|
if (value && pkgs.includes(value))
|
|
647
656
|
return PkgExecutor.from(workspace, value);
|
|
657
|
+
const only = takeOnly("pkg", pkgs, (name) => PkgExecutor.from(workspace, name));
|
|
658
|
+
if (only)
|
|
659
|
+
return only;
|
|
648
660
|
assertAskable("pkg", pkgs, "<pkg>");
|
|
649
661
|
const pkgName = await select({ message: `Select the ${sysType} name`, choices: pkgs });
|
|
650
662
|
return PkgExecutor.from(workspace, pkgName);
|
|
651
663
|
} else if (sysType === "module") {
|
|
664
|
+
const systems = [
|
|
665
|
+
...appNames.map((name) => AppExecutor.from(workspace, name)),
|
|
666
|
+
...libNames.map((name) => LibExecutor.from(workspace, name))
|
|
667
|
+
];
|
|
668
|
+
const modulesOf = async (sys) => [
|
|
669
|
+
...await sys.getModules(),
|
|
670
|
+
...argMeta.option?.services ? await sys.getServiceModules() : []
|
|
671
|
+
];
|
|
672
|
+
const listModules = async () => (await Promise.all(systems.map(async (sys) => (await modulesOf(sys)).map((m) => `${sys.name}:${m}`)))).flat();
|
|
652
673
|
if (value) {
|
|
653
674
|
const [sysName, moduleName] = value.split(":");
|
|
654
675
|
if (!sysName || !moduleName)
|
|
655
676
|
throw new Error(`Invalid module name: ${value}`);
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
const modules = await app.getModules();
|
|
659
|
-
if (modules.includes(moduleName))
|
|
660
|
-
return ModuleExecutor.from(app, moduleName);
|
|
661
|
-
else
|
|
662
|
-
throw new Error(`Invalid module name: ${moduleName}`);
|
|
663
|
-
} else if (libNames.includes(sysName)) {
|
|
664
|
-
const lib = LibExecutor.from(workspace, sysName);
|
|
665
|
-
const modules = await lib.getModules();
|
|
666
|
-
if (modules.includes(moduleName))
|
|
667
|
-
return ModuleExecutor.from(lib, moduleName);
|
|
668
|
-
} else
|
|
677
|
+
const sys = systems.find((each) => each.name === sysName);
|
|
678
|
+
if (!sys)
|
|
669
679
|
throw new Error(`Invalid system name: ${sysName}`);
|
|
680
|
+
if ((await modulesOf(sys)).includes(moduleName))
|
|
681
|
+
return ModuleExecutor.from(sys, moduleName);
|
|
682
|
+
throw refusalOf(problemOf("module"), `${sysName} has no such module`, {
|
|
683
|
+
choices: await listModules(),
|
|
684
|
+
...rerunRemedyOf(rerun, "<sys:module>")
|
|
685
|
+
});
|
|
670
686
|
}
|
|
671
|
-
const
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
687
|
+
const choices = process.stdin.isTTY && !destructive ? [] : await listModules();
|
|
688
|
+
const only = takeOnly("module", choices, (label) => {
|
|
689
|
+
const [sysName, moduleName = ""] = label.split(":");
|
|
690
|
+
const sys = systems.find((each) => each.name === sysName);
|
|
691
|
+
return sys ? ModuleExecutor.from(sys, moduleName) : null;
|
|
692
|
+
});
|
|
693
|
+
if (only)
|
|
694
|
+
return only;
|
|
676
695
|
assertAskable("module", choices, "<sys:module>");
|
|
677
696
|
const { type, name } = await select({
|
|
678
697
|
message: `select the App or Lib name`,
|
|
@@ -682,7 +701,7 @@ var getInternalArgumentValue = async (argMeta, value, workspace, rerun, { destru
|
|
|
682
701
|
]
|
|
683
702
|
});
|
|
684
703
|
const executor = type === "app" ? AppExecutor.from(workspace, name) : LibExecutor.from(workspace, name);
|
|
685
|
-
const modules = await executor
|
|
704
|
+
const modules = await modulesOf(executor);
|
|
686
705
|
const moduleName = await select({
|
|
687
706
|
message: `Select the module name`,
|
|
688
707
|
choices: modules.map((name) => ({ name: `${executor.name}:${name}`, value: name }))
|
|
@@ -895,4 +914,4 @@ function command(refName, depsOrBuilder, builder) {
|
|
|
895
914
|
}
|
|
896
915
|
return CommandBase;
|
|
897
916
|
}
|
|
898
|
-
export { camelToKebabCase, getTargetMetas, getTargetCommandNames, App, Apps, Lib, Sys, SysOrOnlyApp, Exec, Pkg, Module, Workspace, CommandContainer, runner, script, ExitCodeError, markCliErrorPrinted, assertPromptable, runCommands, command };
|
|
917
|
+
export { camelToKebabCase, getTargetMetas, getTargetCommandNames, App, Apps, Lib, Sys, SysOrOnlyApp, Exec, Pkg, Module, ModuleOrService, Workspace, CommandContainer, runner, script, ExitCodeError, markCliErrorPrinted, assertPromptable, runCommands, command };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-hkq0q73d.js";
|
|
6
6
|
import {
|
|
7
7
|
ModuleExecutor
|
|
8
8
|
} from "./index-wfmpxke3.js";
|
|
@@ -13,13 +13,16 @@ import {
|
|
|
13
13
|
createPassedPrimitiveReport,
|
|
14
14
|
bilingualLabelForField,
|
|
15
15
|
bilingualDescriptionForField
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-02b8qvww.js";
|
|
17
17
|
import {
|
|
18
18
|
PageScript
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-z9b72teg.js";
|
|
20
20
|
import {
|
|
21
21
|
pluralizeName
|
|
22
22
|
} from "./index-nz8prx9g.js";
|
|
23
|
+
import {
|
|
24
|
+
assertPlainName
|
|
25
|
+
} from "./index-va90m8nd.js";
|
|
23
26
|
|
|
24
27
|
// pkgs/@akanjs/cli/module/module.script.ts
|
|
25
28
|
import { capitalize as capitalize2 } from "akanjs/common";
|
|
@@ -137,6 +140,7 @@ var moduleChangedFiles = (sys, moduleName, files) => Object.values(files).map((f
|
|
|
137
140
|
|
|
138
141
|
class ModuleScript extends script("module", [ModuleRunner, PageScript]) {
|
|
139
142
|
async createModuleTemplate(sys, name, { page = false } = {}) {
|
|
143
|
+
assertPlainName("module", name);
|
|
140
144
|
const mod = ModuleExecutor.from(sys, name);
|
|
141
145
|
const files = await this.moduleRunner.createModuleTemplate(mod);
|
|
142
146
|
if (page && sys.type === "app")
|
|
@@ -153,6 +157,7 @@ class ModuleScript extends script("module", [ModuleRunner, PageScript]) {
|
|
|
153
157
|
await this.moduleRunner.removeModule(mod);
|
|
154
158
|
}
|
|
155
159
|
async createService(sys, name) {
|
|
160
|
+
assertPlainName("service", name);
|
|
156
161
|
const service = ModuleExecutor.from(sys, `_${name}`);
|
|
157
162
|
const files = await this.moduleRunner.createService(service);
|
|
158
163
|
await sys.scan();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
camelToKebabCase,
|
|
4
4
|
runner
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-hkq0q73d.js";
|
|
6
6
|
import {
|
|
7
7
|
FileSys2
|
|
8
8
|
} from "./index-bns3wcpc.js";
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
import {
|
|
37
37
|
createFactReader,
|
|
38
38
|
createAst
|
|
39
|
-
} from "./index-
|
|
39
|
+
} from "./index-9p260r4e.js";
|
|
40
40
|
import {
|
|
41
41
|
collectRecipeSources2,
|
|
42
42
|
scanRecipes2
|
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-hkq0q73d.js";
|
|
6
6
|
import {
|
|
7
7
|
LibSource,
|
|
8
8
|
formatLibStatuses,
|
|
9
9
|
CommandExecutionError,
|
|
10
10
|
LibExecutor
|
|
11
11
|
} from "./index-wfmpxke3.js";
|
|
12
|
+
import {
|
|
13
|
+
assertPlainName
|
|
14
|
+
} from "./index-va90m8nd.js";
|
|
12
15
|
|
|
13
16
|
// pkgs/@akanjs/cli/library/library.script.ts
|
|
14
17
|
import { Logger } from "akanjs/common";
|
|
@@ -148,6 +151,7 @@ class LibraryScript extends script("library", [LibraryRunner]) {
|
|
|
148
151
|
return scanInfo;
|
|
149
152
|
}
|
|
150
153
|
async createLibrary(libName, workspace) {
|
|
154
|
+
assertPlainName("lib", libName);
|
|
151
155
|
const spinner = workspace.spinning(`Creating ${libName} library`);
|
|
152
156
|
const lib = await this.libraryRunner.createLibrary(libName, workspace);
|
|
153
157
|
spinner.succeed(`${libName} library (libs/${libName}) is created`);
|
|
@@ -166,6 +170,7 @@ class LibraryScript extends script("library", [LibraryRunner]) {
|
|
|
166
170
|
Logger.rawLog(format === "json" ? JSON.stringify(statuses, null, 2) : formatLibStatuses(statuses));
|
|
167
171
|
}
|
|
168
172
|
async installLibrary(workspace, libName) {
|
|
173
|
+
assertPlainName("lib", libName);
|
|
169
174
|
const installSpinner = workspace.spinning(`Installing ${libName} library`);
|
|
170
175
|
const lib = await this.libraryRunner.installLibrary(workspace, libName);
|
|
171
176
|
installSpinner.succeed(`${libName} library (libs/${libName}) is installed`);
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
CsrEntryFiles,
|
|
11
11
|
PagesEntrySourceGenerator,
|
|
12
12
|
PagesBundleBuilder
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-3rff2c48.js";
|
|
14
14
|
|
|
15
15
|
// pkgs/@akanjs/devkit/frontendBuild/csrArtifactBuilder.ts
|
|
16
16
|
import { mkdir as mkdir2, rm as rm2, unlink as unlink2 } from "fs/promises";
|
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-hkq0q73d.js";
|
|
6
6
|
import {
|
|
7
7
|
generatedFilesForSync,
|
|
8
8
|
createPassedPrimitiveReport,
|
|
9
9
|
scalarChangedFiles
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-02b8qvww.js";
|
|
11
11
|
import {
|
|
12
12
|
pluralizeName
|
|
13
13
|
} from "./index-nz8prx9g.js";
|
|
14
|
+
import {
|
|
15
|
+
assertPlainName
|
|
16
|
+
} from "./index-va90m8nd.js";
|
|
14
17
|
|
|
15
18
|
// pkgs/@akanjs/cli/scalar/scalar.runner.ts
|
|
16
19
|
class ScalarRunner extends runner("scalar") {
|
|
@@ -37,6 +40,7 @@ class ScalarRunner extends runner("scalar") {
|
|
|
37
40
|
// pkgs/@akanjs/cli/scalar/scalar.script.ts
|
|
38
41
|
class ScalarScript extends script("scalar", [ScalarRunner]) {
|
|
39
42
|
async createScalar(sys, scalarName) {
|
|
43
|
+
assertPlainName("scalar", scalarName);
|
|
40
44
|
const files = await this.scalarRunner.applyScalarTemplate(sys, scalarName);
|
|
41
45
|
return createPassedPrimitiveReport({
|
|
42
46
|
command: "create-scalar",
|
|
@@ -46,6 +50,7 @@ class ScalarScript extends script("scalar", [ScalarRunner]) {
|
|
|
46
50
|
});
|
|
47
51
|
}
|
|
48
52
|
async removeScalar(sys, scalarName) {
|
|
53
|
+
assertPlainName("scalar", scalarName);
|
|
49
54
|
await sys.removeDir(`lib/__scalar/${scalarName}`);
|
|
50
55
|
}
|
|
51
56
|
}
|