@akanjs/cli 3.3.0-rc.1 → 3.3.0-rc.3
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-0r05qa30.js +11 -0
- package/{CodeTui-zee8atsr.js → CodeTui-brryts78.js} +4 -4
- package/TunnelShare-dcx5j51j.js +16 -0
- package/{agent.command-x65f2ags.js → agent.command-xn4maemk.js} +20 -22
- package/akanCode.js +5 -5
- package/appExecutor-qt1nm242.js +11 -0
- package/{application.command-azbd1pb2.js → application.command-rv2n5bw8.js} +17 -19
- package/{applicationBuildRunner-trfxv3pd.js → applicationBuildRunner-ggkd5qgy.js} +16 -13
- package/buildBatch.proc.js +19 -18
- package/{cloud.command-gapp4634.js → cloud.command-hgnbps4n.js} +19 -24
- package/cloud.script-rzsnzjsg.js +30 -0
- package/{code.command-5smx61yf.js → code.command-9gfph3t3.js} +13 -13
- package/{context.command-ym5jbkny.js → context.command-dwhz1fwq.js} +20 -22
- package/context.runner-gh9rr71p.js +32 -0
- package/csrArtifactBuilder-zawt8knq.js +9 -0
- package/{index-2ny1e95c.js → dependencyScanner-93g8tk0r.js} +6 -5
- package/{fileSys-q22646yc.js → fileSys-e5mwt73x.js} +1 -1
- package/frameworkGraph-aneq2nwy.js +8 -0
- package/{guideline.command-zwypaqsh.js → guideline.command-v2daz21k.js} +8 -8
- package/guidelines/akanApi/akanApi.instruction.md +7 -2
- package/guidelines/conventions/core.md +6 -11
- package/guidelines/conventions/rules/app.md +1 -2
- package/guidelines/conventions/rules/auth.md +18 -27
- package/guidelines/conventions/rules/config.md +14 -46
- package/guidelines/conventions/rules/page.md +19 -34
- package/guidelines/conventions/rules/server.md +1 -4
- package/guidelines/conventions/rules/ssr.md +3 -4
- package/guidelines/conventions/rules/ts.md +2 -1
- package/guidelines/cssRule/cssRule.instruction.md +1 -0
- package/guidelines/pageRule/pageRule.instruction.md +6 -53
- package/incrementalBuilder.proc.js +24 -18
- package/{index-j6jjmn2r.js → index-0k64a38w.js} +62 -21
- package/{index-78y75t0a.js → index-0vtpxfx6.js} +6 -7
- package/{index-4ss4gkv3.js → index-0vv0a5h8.js} +2 -2
- package/{index-j0wr4e32.js → index-1v5eghaa.js} +9 -9
- package/{index-kfvjzk8r.js → index-2ktpwjgf.js} +3 -3
- package/{index-w1zexzpx.js → index-2t7jnfg5.js} +1 -1
- package/{index-p7beqww9.js → index-3fmzz9sf.js} +18 -18
- package/{index-8jtqfye2.js → index-58ck1gsm.js} +6 -6
- package/{index-0s7w2085.js → index-5cpjkfhk.js} +4 -4
- package/{index-71y6176j.js → index-609zbjve.js} +8 -8
- package/{index-9wh04mqy.js → index-66b1hrxh.js} +2 -2
- package/{index-gt8phqpt.js → index-6yefp97x.js} +4 -4
- package/{index-0dm25wvf.js → index-7ssr7wq4.js} +1 -1
- package/{index-612fdtbk.js → index-8fg1hvj5.js} +1 -1
- package/{index-41a03gkj.js → index-91bcfjej.js} +19 -19
- package/{index-275a4r3n.js → index-999e5kp4.js} +11 -15
- package/{index-s885g0jj.js → index-arcdcexp.js} +3 -3
- package/{index-jek2re5k.js → index-b3kjr19v.js} +4 -4
- package/{index-3txdtztz.js → index-bjg9thz8.js} +1 -1
- package/{index-baccvws5.js → index-bsew0a12.js} +1 -1
- package/{index-zfnz878d.js → index-c67vjafa.js} +1 -1
- package/{index-z92zm3wd.js → index-cfzqdsam.js} +29 -11
- package/{index-dadwp2aw.js → index-dy5reyet.js} +271 -39
- package/{index-67sd09ag.js → index-fqhr7j56.js} +8 -8
- package/{index-zmd9xxgd.js → index-g7hm77j6.js} +3 -3
- package/{index-h901f24n.js → index-ghs8gtvp.js} +5 -5
- package/{index-v7ajmsh3.js → index-h1k3zyyb.js} +1 -1
- package/{index-knpm8sdm.js → index-j3fqs8rc.js} +1 -1
- package/{index-6dzjer7p.js → index-jzwdwse0.js} +6 -6
- package/{index-2jmvfa62.js → index-m4s4tzjr.js} +3 -3
- package/{index-xwwex8rf.js → index-ndfxse05.js} +5 -5
- package/{index-z96ks033.js → index-rd669r6x.js} +153 -45
- package/{index-k6vwww45.js → index-rnhbh45p.js} +7 -7
- package/{index-ybcb9wc8.js → index-rwhdcnr8.js} +9 -9
- package/{index-a860mx0m.js → index-sn5cka91.js} +24 -24
- package/{index-ebn9kgea.js → index-v0gt5ryd.js} +18 -15
- package/{index-2yn3r67f.js → index-vznyyaf8.js} +6 -6
- package/{index-dmcpetwe.js → index-w18qdjyf.js} +98 -23
- package/{index-p5zh7pmc.js → index-xv3pvdw4.js} +1 -1
- package/{index-nc3br31y.js → index-yejf6fth.js} +2 -2
- package/{index-7wf8snar.js → index-zfmc4380.js} +1 -1
- package/{index-j592zfqc.js → index-zx3bv21b.js} +1 -1
- package/{index-by2tvsq6.js → index-zyjztrvc.js} +1 -1
- package/index.js +30 -28
- package/{libExecutor-jc6f8hm6.js → libExecutor-p21kkayq.js} +3 -3
- package/{library.command-nxvesvhb.js → library.command-m4gw18qq.js} +8 -8
- package/{localRegistry.command-xz62e4ng.js → localRegistry.command-3yq90wgp.js} +18 -23
- package/{module.command-aaws9byg.js → module.command-9vfdxapr.js} +10 -10
- package/{package.command-j7hv26p0.js → package.command-rt4y8xaf.js} +9 -12
- package/package.json +3 -2
- package/{page.command-7yffs7n9.js → page.command-4zc20rnv.js} +8 -8
- package/{pipeline.command-7yk0zcng.js → pipeline.command-4ekd9xgb.js} +7 -7
- package/{pkgExecutor-arxmvx4t.js → pkgExecutor-mh903rz9.js} +3 -3
- package/{primitive.command-7a1pt715.js → primitive.command-5g3xe4mf.js} +11 -11
- package/{projectTypecheck-f4qhbecd.js → projectTypecheck-bz6smek9.js} +1 -1
- package/{prompter-qyggfhqd.js → prompter-d33wmdpa.js} +2 -2
- package/{quality.command-c6mvrjh1.js → quality.command-zf8dyc9w.js} +9 -9
- package/{repair.command-093adzt9.js → repair.command-sx0eyq4w.js} +10 -10
- package/{scalar.command-2ex84spb.js → scalar.command-4bvzmbbh.js} +9 -9
- package/skills/akan-page/SKILL.md +18 -13
- package/skills/akan-runtime/SKILL.md +21 -16
- package/skills/akan-service/SKILL.md +2 -2
- package/{subspace.command-4n4n4jpv.js → subspace.command-cxyej1an.js} +11 -13
- package/{tunnel.command-f7ep1qfa.js → tunnel.command-gvnv36yf.js} +10 -12
- package/{verify.command-zrkxnvct.js → verify.command-yj2mngs0.js} +15 -17
- package/{workflow.command-ks16jegk.js → workflow.command-42p9g0w8.js} +15 -15
- package/{workspace.command-ahhfpaag.js → workspace.command-91wx03de.js} +34 -38
- package/CodeAgent-fx6088tv.js +0 -11
- package/TunnelShare-9ry4vh0y.js +0 -18
- package/appExecutor-79azsb2w.js +0 -11
- package/cloud.script-3b401efv.js +0 -35
- package/context.runner-kctbfsde.js +0 -34
- package/dependencyScanner-ge10gb52.js +0 -8
|
@@ -4,22 +4,22 @@ import {
|
|
|
4
4
|
SysExecutor,
|
|
5
5
|
AppInfo,
|
|
6
6
|
WorkspaceExecutor
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-609zbjve.js";
|
|
8
8
|
import {
|
|
9
9
|
FileSys2
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-zyjztrvc.js";
|
|
11
11
|
import {
|
|
12
12
|
CliError
|
|
13
13
|
} from "./index-j4yvgfhr.js";
|
|
14
14
|
import {
|
|
15
15
|
AppExecutor2
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-cfzqdsam.js";
|
|
17
17
|
import {
|
|
18
18
|
LibExecutor2
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-c67vjafa.js";
|
|
20
20
|
import {
|
|
21
21
|
PkgExecutor2
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-2t7jnfg5.js";
|
|
23
23
|
import {
|
|
24
24
|
UNAVAILABLE_REDIS_HOST,
|
|
25
25
|
redisTunnelPolicy,
|
|
@@ -55,27 +55,27 @@ import {
|
|
|
55
55
|
filesChangedSince,
|
|
56
56
|
HmrWatcher,
|
|
57
57
|
WatchRootResolver
|
|
58
|
-
} from "./index-
|
|
58
|
+
} from "./index-w18qdjyf.js";
|
|
59
59
|
import {
|
|
60
60
|
runner,
|
|
61
61
|
assertPromptable
|
|
62
|
-
} from "./index-
|
|
62
|
+
} from "./index-vznyyaf8.js";
|
|
63
63
|
import {
|
|
64
64
|
UpdatePackFolder,
|
|
65
65
|
UpdateUploader,
|
|
66
66
|
NativePublicEnv,
|
|
67
67
|
NativeApp
|
|
68
|
-
} from "./index-
|
|
68
|
+
} from "./index-v0gt5ryd.js";
|
|
69
69
|
import {
|
|
70
70
|
DesktopServerStage
|
|
71
|
-
} from "./index-
|
|
71
|
+
} from "./index-8fg1hvj5.js";
|
|
72
72
|
import {
|
|
73
73
|
resolveMobileTargets,
|
|
74
74
|
resolveAppId
|
|
75
75
|
} from "./index-m9jj544v.js";
|
|
76
76
|
import {
|
|
77
77
|
SlicePlanner
|
|
78
|
-
} from "./index-
|
|
78
|
+
} from "./index-zx3bv21b.js";
|
|
79
79
|
import {
|
|
80
80
|
openBrowser
|
|
81
81
|
} from "./index-9dp031by.js";
|
|
@@ -88,9 +88,11 @@ import {
|
|
|
88
88
|
|
|
89
89
|
// pkgs/@akanjs/cli/application/application.runner.ts
|
|
90
90
|
import { existsSync, realpathSync as realpathSync2 } from "fs";
|
|
91
|
-
import
|
|
91
|
+
import path8 from "path";
|
|
92
92
|
|
|
93
93
|
// pkgs/@akanjs/devkit/akanApp/akanApp.host.ts
|
|
94
|
+
import fs2 from "fs";
|
|
95
|
+
import path5 from "path";
|
|
94
96
|
import { Logger as Logger2 } from "akanjs/common";
|
|
95
97
|
|
|
96
98
|
// pkgs/@akanjs/devkit/tunnel/createTunnel.ts
|
|
@@ -740,6 +742,10 @@ class IncrementalBuilderHost {
|
|
|
740
742
|
return;
|
|
741
743
|
if (!msg || typeof msg !== "object")
|
|
742
744
|
return;
|
|
745
|
+
if (msg.type === "base-built") {
|
|
746
|
+
this.#startOptions.onBaseBuilt?.(msg.phaseMs);
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
743
749
|
if (msg.type === "build-route-res" || msg.type === "build-csr-res" || msg.type === "build-graph-res")
|
|
744
750
|
this.#inFlight.delete(msg.id);
|
|
745
751
|
if (builderMsgTypeSet.has(msg.type))
|
|
@@ -1185,7 +1191,7 @@ class DevBackend {
|
|
|
1185
1191
|
const backend = Bun.spawn(["bun", `apps/${this.#app.name}/main.ts`], {
|
|
1186
1192
|
cwd: this.#app.workspace.workspaceRoot,
|
|
1187
1193
|
stdio: this.#stdio === "pipe" ? ["ignore", "pipe", "pipe"] : ["inherit", "inherit", "inherit"],
|
|
1188
|
-
env: this.#env,
|
|
1194
|
+
env: this.#links.awaitsArtifact() ? { ...this.#env, AKAN_DEV_AWAIT_ARTIFACT: "1" } : this.#env,
|
|
1189
1195
|
ipc: (msg) => {
|
|
1190
1196
|
if (!msg || typeof msg !== "object")
|
|
1191
1197
|
return;
|
|
@@ -1518,7 +1524,7 @@ class DevBuilder {
|
|
|
1518
1524
|
this.#host = builder;
|
|
1519
1525
|
try {
|
|
1520
1526
|
await this.#waitForReady(attempt, { announceBootState });
|
|
1521
|
-
this.#app.verbose(`[cli] base build ready in ${Date.now() - startTime}ms
|
|
1527
|
+
this.#app.verbose(`[cli] base build ready in ${Date.now() - startTime}ms`);
|
|
1522
1528
|
return this.#host;
|
|
1523
1529
|
} catch (err) {
|
|
1524
1530
|
lastError = err;
|
|
@@ -1623,6 +1629,9 @@ class DevBuilder {
|
|
|
1623
1629
|
settle(resolve);
|
|
1624
1630
|
this.#links.onReady();
|
|
1625
1631
|
},
|
|
1632
|
+
onBaseBuilt: (phaseMs) => {
|
|
1633
|
+
this.#links.onBaseBuilt(phaseMs);
|
|
1634
|
+
},
|
|
1626
1635
|
onRestartReady: () => {
|
|
1627
1636
|
this.#links.onRestartReady();
|
|
1628
1637
|
}
|
|
@@ -2104,6 +2113,69 @@ class DevRecycler {
|
|
|
2104
2113
|
}
|
|
2105
2114
|
}
|
|
2106
2115
|
|
|
2116
|
+
// pkgs/@akanjs/devkit/akanApp/devStartTimeline.ts
|
|
2117
|
+
var BASE_BUILD_PARTS = ["runtime", "routes", "styles", "dictionary", "pages"];
|
|
2118
|
+
|
|
2119
|
+
class DevStartTimeline {
|
|
2120
|
+
#logger;
|
|
2121
|
+
#now;
|
|
2122
|
+
#marks = {};
|
|
2123
|
+
#basePhaseMs = {};
|
|
2124
|
+
#reported = true;
|
|
2125
|
+
constructor(logger, now = () => performance.now()) {
|
|
2126
|
+
this.#logger = logger;
|
|
2127
|
+
this.#now = now;
|
|
2128
|
+
}
|
|
2129
|
+
begin() {
|
|
2130
|
+
this.#marks = { started: this.#now() };
|
|
2131
|
+
this.#basePhaseMs = {};
|
|
2132
|
+
this.#reported = false;
|
|
2133
|
+
}
|
|
2134
|
+
baseBuilt(phaseMs) {
|
|
2135
|
+
if (this.#reported || this.#marks.baseBuilt !== undefined)
|
|
2136
|
+
return;
|
|
2137
|
+
this.#basePhaseMs = phaseMs;
|
|
2138
|
+
this.#marks.baseBuilt = this.#now();
|
|
2139
|
+
}
|
|
2140
|
+
mark(mark) {
|
|
2141
|
+
if (this.#reported)
|
|
2142
|
+
return;
|
|
2143
|
+
if (mark === "backendSpawned")
|
|
2144
|
+
this.#marks.backendSpawned = this.#now();
|
|
2145
|
+
else
|
|
2146
|
+
this.#marks[mark] ??= this.#now();
|
|
2147
|
+
this.#report();
|
|
2148
|
+
}
|
|
2149
|
+
#report() {
|
|
2150
|
+
const { started, baseBuilt, builderReady, backendSpawned, backendReady } = this.#marks;
|
|
2151
|
+
if (started === undefined || builderReady === undefined || backendReady === undefined)
|
|
2152
|
+
return;
|
|
2153
|
+
this.#reported = true;
|
|
2154
|
+
const ms = (value) => Math.round(value).toString();
|
|
2155
|
+
const parts = [`prepare ${ms(started)}`, `builder ${ms(builderReady - started)}${this.#builderParts()}`];
|
|
2156
|
+
if (backendSpawned !== undefined) {
|
|
2157
|
+
const afterArtifact = baseBuilt !== undefined && backendSpawned < baseBuilt && baseBuilt <= backendReady ? ` (${ms(backendReady - baseBuilt)} after the artifact)` : "";
|
|
2158
|
+
parts.push(`backend ${ms(backendReady - backendSpawned)}${afterArtifact}`);
|
|
2159
|
+
}
|
|
2160
|
+
if (baseBuilt !== undefined)
|
|
2161
|
+
parts.push(`first artifact at ${ms(baseBuilt)}`);
|
|
2162
|
+
this.#logger.info(`ready in ${ms(Math.max(builderReady, backendReady))}ms (${parts.join(" \xB7 ")})`);
|
|
2163
|
+
}
|
|
2164
|
+
#builderParts() {
|
|
2165
|
+
const { started, baseBuilt, builderReady } = this.#marks;
|
|
2166
|
+
if (started === undefined || baseBuilt === undefined || builderReady === undefined)
|
|
2167
|
+
return "";
|
|
2168
|
+
const total = this.#basePhaseMs.total ?? 0;
|
|
2169
|
+
const base = BASE_BUILD_PARTS.flatMap((part) => {
|
|
2170
|
+
const partMs = this.#basePhaseMs[part];
|
|
2171
|
+
return partMs === undefined ? [] : [`${part} ${Math.round(partMs)}`];
|
|
2172
|
+
});
|
|
2173
|
+
const spawn = Math.max(0, Math.round(baseBuilt - started - total));
|
|
2174
|
+
const watch = Math.max(0, Math.round(builderReady - baseBuilt));
|
|
2175
|
+
return `: spawn ${spawn} + base build ${Math.round(total)} [${base.join(" \xB7 ")}] + watch ${watch}`;
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
|
|
2107
2179
|
// pkgs/@akanjs/devkit/akanApp/akanApp.host.ts
|
|
2108
2180
|
class AkanAppHost {
|
|
2109
2181
|
app;
|
|
@@ -2114,6 +2186,7 @@ class AkanAppHost {
|
|
|
2114
2186
|
#lastDevState = null;
|
|
2115
2187
|
#bootLatch = new DevBootLatch(() => this.#onDevEvent?.({ app: this.app.name, booted: true }));
|
|
2116
2188
|
#stopping = false;
|
|
2189
|
+
#firstArtifact = "settled";
|
|
2117
2190
|
#builderMessageQueue = Promise.resolve();
|
|
2118
2191
|
#backendGraph;
|
|
2119
2192
|
#statuses;
|
|
@@ -2124,6 +2197,7 @@ class AkanAppHost {
|
|
|
2124
2197
|
#builder;
|
|
2125
2198
|
#idle;
|
|
2126
2199
|
#recycler;
|
|
2200
|
+
#timeline;
|
|
2127
2201
|
constructor(app, {
|
|
2128
2202
|
env,
|
|
2129
2203
|
stdio = "inherit",
|
|
@@ -2139,13 +2213,20 @@ class AkanAppHost {
|
|
|
2139
2213
|
const isStopping = () => this.#stopping;
|
|
2140
2214
|
const statuses = new DevBuildStatusBoard(logger);
|
|
2141
2215
|
this.#statuses = statuses;
|
|
2216
|
+
this.#timeline = new DevStartTimeline(logger);
|
|
2142
2217
|
this.#backend = new DevBackend(app, { env, stdio, logger, statuses, graph }, {
|
|
2143
2218
|
isStopping,
|
|
2144
|
-
emit: (state, detail) =>
|
|
2219
|
+
emit: (state, detail) => {
|
|
2220
|
+
if (state === "ready")
|
|
2221
|
+
this.#timeline.mark("backendReady");
|
|
2222
|
+
this.#emitDevEvent(state, detail);
|
|
2223
|
+
},
|
|
2145
2224
|
beforeSpawn: () => {
|
|
2225
|
+
this.#timeline.mark("backendSpawned");
|
|
2146
2226
|
this.#requests.startGeneration();
|
|
2147
2227
|
this.#requests.discard("the backend restarted while the builder was away");
|
|
2148
2228
|
},
|
|
2229
|
+
awaitsArtifact: () => this.#firstArtifact === "pending",
|
|
2149
2230
|
toBuilder: (message) => this.#requests.send(message)
|
|
2150
2231
|
});
|
|
2151
2232
|
this.#gap = new BuilderGap({ graph, backend: this.#backend, logger });
|
|
@@ -2166,7 +2247,17 @@ class AkanAppHost {
|
|
|
2166
2247
|
isStopping,
|
|
2167
2248
|
onMessage: (message) => this.#enqueueBuilderMessage(message),
|
|
2168
2249
|
onAway: () => this.#gap.open("builder replacement"),
|
|
2169
|
-
onReady: () =>
|
|
2250
|
+
onReady: () => {
|
|
2251
|
+
this.#timeline.mark("builderReady");
|
|
2252
|
+
this.#requests.flush();
|
|
2253
|
+
},
|
|
2254
|
+
onBaseBuilt: (phaseMs) => {
|
|
2255
|
+
this.#timeline.baseBuilt(phaseMs);
|
|
2256
|
+
if (this.#firstArtifact === "built")
|
|
2257
|
+
this.#backend.scheduleRestart({ files: [], roles: [] });
|
|
2258
|
+
else if (this.#firstArtifact === "pending")
|
|
2259
|
+
this.#firstArtifact = "built";
|
|
2260
|
+
},
|
|
2170
2261
|
onRestartReady: () => {
|
|
2171
2262
|
this.logger.verbose("[builder-recovery] builder ready after restart; replaying latest state");
|
|
2172
2263
|
this.#backend.replay();
|
|
@@ -2220,13 +2311,30 @@ class AkanAppHost {
|
|
|
2220
2311
|
await this.#backend.stop();
|
|
2221
2312
|
if (this.#builder.current)
|
|
2222
2313
|
this.#builder.stop();
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2314
|
+
this.#timeline.begin();
|
|
2315
|
+
const artifactFile = path5.join(this.app.cwdPath, ".akan/artifact/base-artifact.json");
|
|
2316
|
+
this.#firstArtifact = fs2.existsSync(artifactFile) ? "settled" : "pending";
|
|
2317
|
+
const prepared = Promise.all([this.#prepareDatabase("redis"), this.#backendGraph.refresh()]).then(([redisHost]) => {
|
|
2318
|
+
Object.assign(this.env, { REDIS_HOST: redisHost });
|
|
2319
|
+
if (this.#firstArtifact !== "settled")
|
|
2320
|
+
this.#backend.start();
|
|
2321
|
+
});
|
|
2322
|
+
try {
|
|
2323
|
+
await Promise.all([this.#builder.start(), prepared]);
|
|
2324
|
+
} catch (error) {
|
|
2325
|
+
this.#firstArtifact = "settled";
|
|
2326
|
+
if (!this.#stopping)
|
|
2327
|
+
await this.#backend.stop();
|
|
2328
|
+
throw error;
|
|
2329
|
+
}
|
|
2330
|
+
const artifactMissing = this.#firstArtifact === "pending" && !fs2.existsSync(artifactFile);
|
|
2331
|
+
this.#firstArtifact = "settled";
|
|
2332
|
+
if (artifactMissing && !this.#stopping) {
|
|
2333
|
+
await this.#backend.restarting;
|
|
2334
|
+
await this.#backend.stop();
|
|
2335
|
+
}
|
|
2336
|
+
if (!this.#backend.running)
|
|
2337
|
+
this.#backend.start();
|
|
2230
2338
|
this.#idle.arm();
|
|
2231
2339
|
return this;
|
|
2232
2340
|
}
|
|
@@ -2319,16 +2427,16 @@ class AkanAppHost {
|
|
|
2319
2427
|
}
|
|
2320
2428
|
}
|
|
2321
2429
|
// pkgs/@akanjs/devkit/app/applicationTestPreload.ts
|
|
2322
|
-
import
|
|
2430
|
+
import path6 from "path";
|
|
2323
2431
|
var SIGNAL_TEST_PRELOAD_PATH = "test/signalTest.preload.ts";
|
|
2324
2432
|
async function resolveSignalTestPreloadPath(target) {
|
|
2325
2433
|
const candidates = [];
|
|
2326
|
-
for (const basePath of [target.cwdPath, process.cwd(),
|
|
2434
|
+
for (const basePath of [target.cwdPath, process.cwd(), path6.dirname(Bun.main), import.meta.dir]) {
|
|
2327
2435
|
try {
|
|
2328
|
-
candidates.push(
|
|
2436
|
+
candidates.push(path6.join(path6.dirname(Bun.resolveSync("akanjs/package.json", basePath)), SIGNAL_TEST_PRELOAD_PATH));
|
|
2329
2437
|
} catch {}
|
|
2330
2438
|
}
|
|
2331
|
-
candidates.push(
|
|
2439
|
+
candidates.push(path6.join(target.cwdPath, "../../node_modules/akanjs", SIGNAL_TEST_PRELOAD_PATH), path6.join(target.cwdPath, "../../pkgs/akanjs", SIGNAL_TEST_PRELOAD_PATH), path6.join(process.cwd(), "node_modules/akanjs", SIGNAL_TEST_PRELOAD_PATH), path6.join(process.cwd(), "pkgs/akanjs", SIGNAL_TEST_PRELOAD_PATH), path6.join(path6.dirname(Bun.main), "../../akanjs", SIGNAL_TEST_PRELOAD_PATH), path6.resolve(import.meta.dir, "../../../akanjs", SIGNAL_TEST_PRELOAD_PATH));
|
|
2332
2440
|
const uniqueCandidates = [...new Set(candidates)];
|
|
2333
2441
|
for (const candidate of uniqueCandidates)
|
|
2334
2442
|
if (await Bun.file(candidate).exists())
|
|
@@ -2344,7 +2452,7 @@ import { Logger as Logger4, toError } from "akanjs/common";
|
|
|
2344
2452
|
|
|
2345
2453
|
// pkgs/@akanjs/cli/application/testTarget.ts
|
|
2346
2454
|
import { readdirSync, realpathSync, statSync } from "fs";
|
|
2347
|
-
import
|
|
2455
|
+
import path7 from "path";
|
|
2348
2456
|
import { Logger as Logger3 } from "akanjs/common";
|
|
2349
2457
|
var testFileName = /[._](test|spec)\.[cm]?[jt]sx?$/i;
|
|
2350
2458
|
var hasTestFile = (dir, seen = new Set) => {
|
|
@@ -2353,7 +2461,7 @@ var hasTestFile = (dir, seen = new Set) => {
|
|
|
2353
2461
|
return false;
|
|
2354
2462
|
seen.add(real);
|
|
2355
2463
|
return readdirSync(dir, { withFileTypes: true }).some((entry) => {
|
|
2356
|
-
const entryPath =
|
|
2464
|
+
const entryPath = path7.join(dir, entry.name);
|
|
2357
2465
|
const isDir = entry.isDirectory() || entry.isSymbolicLink() && statSync(entryPath, { throwIfNoEntry: false })?.isDirectory();
|
|
2358
2466
|
if (!isDir)
|
|
2359
2467
|
return testFileName.test(entry.name);
|
|
@@ -2362,7 +2470,7 @@ var hasTestFile = (dir, seen = new Set) => {
|
|
|
2362
2470
|
};
|
|
2363
2471
|
var testTargetOf = (exec) => {
|
|
2364
2472
|
const root = exec instanceof SysExecutor || exec instanceof PkgExecutor2 ? exec.workspace.workspaceRoot : process.cwd();
|
|
2365
|
-
return { root, target:
|
|
2473
|
+
return { root, target: path7.relative(root, exec.cwdPath).split(path7.sep).join("/") };
|
|
2366
2474
|
};
|
|
2367
2475
|
var reportsNoTestFile = (exec) => {
|
|
2368
2476
|
if (hasTestFile(exec.cwdPath))
|
|
@@ -2373,7 +2481,7 @@ var reportsNoTestFile = (exec) => {
|
|
|
2373
2481
|
};
|
|
2374
2482
|
|
|
2375
2483
|
// pkgs/@akanjs/cli/application/application.runner.ts
|
|
2376
|
-
var loadBuildRunner = async () => (await import("./applicationBuildRunner-
|
|
2484
|
+
var loadBuildRunner = async () => (await import("./applicationBuildRunner-ggkd5qgy.js")).ApplicationBuildRunner;
|
|
2377
2485
|
var loadPrompts = async () => await import("@inquirer/prompts");
|
|
2378
2486
|
|
|
2379
2487
|
class ApplicationRunner extends runner("application") {
|
|
@@ -2425,7 +2533,7 @@ class ApplicationRunner extends runner("application") {
|
|
|
2425
2533
|
});
|
|
2426
2534
|
}
|
|
2427
2535
|
static runtimeDirOf(app, override) {
|
|
2428
|
-
return
|
|
2536
|
+
return path8.resolve(override ?? process.env.AKAN_RUNTIME_DIR ?? path8.join(app.workspace.workspaceRoot, "local", "apps", app.name, "runtime"));
|
|
2429
2537
|
}
|
|
2430
2538
|
async runLogs(app, options) {
|
|
2431
2539
|
const { LogControlUnavailableError, LogTailClient } = await import("akanjs/server/logging/logTailClient");
|
|
@@ -2451,7 +2559,7 @@ class ApplicationRunner extends runner("application") {
|
|
|
2451
2559
|
});
|
|
2452
2560
|
} catch (error) {
|
|
2453
2561
|
if (error instanceof LogControlUnavailableError)
|
|
2454
|
-
throw new Error(`${app.name} is not running (no ${
|
|
2562
|
+
throw new Error(`${app.name} is not running (no ${path8.basename(socketPath)} in ${runtimeDir}). Start it with \`akan start ${app.name}\`, or pass --runtime-dir for a built app.`);
|
|
2455
2563
|
throw error;
|
|
2456
2564
|
}
|
|
2457
2565
|
const sinceMs = since ? LogQueryMatcher.parseSince(since) : undefined;
|
|
@@ -2513,7 +2621,7 @@ try {
|
|
|
2513
2621
|
const serverPath = `${app.cwdPath}/server.ts`;
|
|
2514
2622
|
if (!await app.exists("server.ts"))
|
|
2515
2623
|
throw new Error(`Server file not found: apps/${app.name}/server.ts`);
|
|
2516
|
-
const target =
|
|
2624
|
+
const target = path8.resolve(app.workspace.workspaceRoot, dir);
|
|
2517
2625
|
const code = `
|
|
2518
2626
|
const { server } = await import(${JSON.stringify(serverPath)});
|
|
2519
2627
|
const { DatabaseAdaptorRole, DocumentTransfer } = await import("akanjs/service");
|
|
@@ -2574,7 +2682,7 @@ if (loaded) process.exitCode = await loaded.migrations.command(loaded.server, ar
|
|
|
2574
2682
|
await new (await loadBuildRunner())(app).typecheck(options);
|
|
2575
2683
|
}
|
|
2576
2684
|
async typecheckLibrary(lib, options = {}) {
|
|
2577
|
-
const { ProjectTypecheck } = await import("./projectTypecheck-
|
|
2685
|
+
const { ProjectTypecheck } = await import("./projectTypecheck-bz6smek9.js");
|
|
2578
2686
|
const root = lib.workspace.workspaceRoot;
|
|
2579
2687
|
await new ProjectTypecheck(lib.cwdPath, root, { ...process.env, AKAN_WORKSPACE_ROOT: root }).run([
|
|
2580
2688
|
"../../server.ts",
|
|
@@ -2587,14 +2695,14 @@ if (loaded) process.exitCode = await loaded.migrations.command(loaded.server, ar
|
|
|
2587
2695
|
}
|
|
2588
2696
|
resolveTestPaths(exec, files) {
|
|
2589
2697
|
const { root, target } = testTargetOf(exec);
|
|
2590
|
-
const isInside = (relative) => relative !== ".." && !relative.startsWith(`..${
|
|
2698
|
+
const isInside = (relative) => relative !== ".." && !relative.startsWith(`..${path8.sep}`) && !path8.isAbsolute(relative);
|
|
2591
2699
|
return files.map((file) => {
|
|
2592
|
-
const candidates =
|
|
2593
|
-
const existing = candidates.filter((candidate) => existsSync(candidate)).map((candidate) =>
|
|
2700
|
+
const candidates = path8.isAbsolute(file) ? [file] : [path8.resolve(exec.cwdPath, file), path8.resolve(root, file)];
|
|
2701
|
+
const existing = candidates.filter((candidate) => existsSync(candidate)).map((candidate) => path8.relative(exec.cwdPath, candidate));
|
|
2594
2702
|
const found = existing.find(isInside);
|
|
2595
2703
|
if (found === undefined)
|
|
2596
2704
|
throw new Error(existing.length ? `${file} is outside ${target}: akan test ${exec.name} runs its own tests only` : `${file} names no file or folder in ${target}`);
|
|
2597
|
-
return `./${found.split(
|
|
2705
|
+
return `./${found.split(path8.sep).join("/")}`;
|
|
2598
2706
|
});
|
|
2599
2707
|
}
|
|
2600
2708
|
async test(exec, testPaths = [], flags = []) {
|
|
@@ -2607,7 +2715,7 @@ if (loaded) process.exitCode = await loaded.migrations.command(loaded.server, ar
|
|
|
2607
2715
|
AKAN_TEST_TARGET_TYPE: exec.type,
|
|
2608
2716
|
AKAN_TEST_TARGET_NAME: exec.name,
|
|
2609
2717
|
AKAN_TEST_LIBS: exec.getScanInfo({ allowEmpty: true })?.getLibs().join(",") ?? "",
|
|
2610
|
-
AKAN_RUNTIME_DIR:
|
|
2718
|
+
AKAN_RUNTIME_DIR: path8.join(exec.workspace.workspaceRoot, "local", `${exec.type}s`, exec.name, "runtime")
|
|
2611
2719
|
} : {};
|
|
2612
2720
|
const args = ["test", "--isolate", ...flags, ...preloadPath ? ["--preload", preloadPath] : [], ...testPaths];
|
|
2613
2721
|
await exec.spawn("bun", args, {
|
|
@@ -2724,7 +2832,7 @@ if (loaded) process.exitCode = await loaded.migrations.command(loaded.server, ar
|
|
|
2724
2832
|
try {
|
|
2725
2833
|
return realpathSync2.native(root);
|
|
2726
2834
|
} catch {
|
|
2727
|
-
return
|
|
2835
|
+
return path8.resolve(root);
|
|
2728
2836
|
}
|
|
2729
2837
|
};
|
|
2730
2838
|
return canonical(reported) === canonical(own);
|
|
@@ -2748,13 +2856,13 @@ if (loaded) process.exitCode = await loaded.migrations.command(loaded.server, ar
|
|
|
2748
2856
|
if (!mobileTarget || targets.length > 1)
|
|
2749
2857
|
throw new Error("pack-update packs one native target at a time; pass --target <name>.");
|
|
2750
2858
|
const nativeApp = new NativeApp(app, mobileTarget, env);
|
|
2751
|
-
await UpdatePackFolder.clear(
|
|
2859
|
+
await UpdatePackFolder.clear(path8.resolve(out ?? path8.join(nativeApp.updatesDir, platform)));
|
|
2752
2860
|
const pinned = publicEnv ? await NativePublicEnv.load(publicEnv) : against ? await NativePublicEnv.recordedIn(against) : null;
|
|
2753
2861
|
await this.#buildMobileCsr(app, env, undefined, pinned);
|
|
2754
2862
|
const { pack } = await nativeApp.packUpdate(platform, { out });
|
|
2755
2863
|
app.logger.info(`packed ${mobileTarget.name} ${platform} for channel '${pack.channel}' to ${pack.out}: ${pack.files} files, ${(pack.size / 1024).toFixed(0)} KiB, native API ${pack.nativeApi}`);
|
|
2756
2864
|
if (against) {
|
|
2757
|
-
const bundle =
|
|
2865
|
+
const bundle = path8.join(pack.out, UpdatePackFolder.bundleFile);
|
|
2758
2866
|
const compat = await NativeApp.compareBundles(app.cwdPath, against, bundle);
|
|
2759
2867
|
const envProblem = await NativePublicEnv.problemAgainst(against, bundle);
|
|
2760
2868
|
await UpdatePackFolder.writeCompat(pack, {
|
|
@@ -3001,7 +3109,7 @@ ${detail}`
|
|
|
3001
3109
|
}
|
|
3002
3110
|
|
|
3003
3111
|
// pkgs/@akanjs/cli/verify/verifyScope.ts
|
|
3004
|
-
import
|
|
3112
|
+
import path9 from "path";
|
|
3005
3113
|
import ts from "typescript";
|
|
3006
3114
|
|
|
3007
3115
|
class VerifyScope {
|
|
@@ -3045,11 +3153,11 @@ class VerifyScope {
|
|
|
3045
3153
|
}
|
|
3046
3154
|
static async#libImportsIn(workspaceRoot, dir) {
|
|
3047
3155
|
const libs = new Set;
|
|
3048
|
-
const cwd =
|
|
3156
|
+
const cwd = path9.join(workspaceRoot, dir);
|
|
3049
3157
|
for await (const file of new Bun.Glob("**/*.{ts,tsx}").scan({ cwd })) {
|
|
3050
3158
|
if (/(^|[\\/])(node_modules|dist)[\\/]/.test(file))
|
|
3051
3159
|
continue;
|
|
3052
|
-
const text = await Bun.file(
|
|
3160
|
+
const text = await Bun.file(path9.join(cwd, file)).text();
|
|
3053
3161
|
if (!text.includes("@libs/"))
|
|
3054
3162
|
continue;
|
|
3055
3163
|
for (const { fileName } of ts.preProcessFile(text, true, true).importedFiles) {
|
|
@@ -4,27 +4,27 @@ import {
|
|
|
4
4
|
CloudApi,
|
|
5
5
|
CloudUpdates,
|
|
6
6
|
PipelineSecrets
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-arcdcexp.js";
|
|
8
8
|
import {
|
|
9
9
|
PkgExecutor2
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-2t7jnfg5.js";
|
|
11
11
|
import {
|
|
12
12
|
UpdatePackFolder,
|
|
13
13
|
NativePublicEnv,
|
|
14
14
|
NativeApp
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-v0gt5ryd.js";
|
|
16
16
|
import {
|
|
17
17
|
script
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-vznyyaf8.js";
|
|
19
19
|
import {
|
|
20
20
|
ApplicationScript
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-91bcfjej.js";
|
|
22
22
|
import {
|
|
23
23
|
PackageScript
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-999e5kp4.js";
|
|
25
25
|
import {
|
|
26
26
|
CloudRunner
|
|
27
|
-
} from "./index-
|
|
27
|
+
} from "./index-ndfxse05.js";
|
|
28
28
|
|
|
29
29
|
// pkgs/@akanjs/cli/cloud/cloud.script.ts
|
|
30
30
|
import { Logger } from "akanjs/common";
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import {
|
|
3
|
-
ApplicationBuildReporter
|
|
4
|
-
} from "./index-dmcpetwe.js";
|
|
5
2
|
import {
|
|
6
3
|
parseBiomeReport,
|
|
7
4
|
Linter,
|
|
8
5
|
ProjectTypecheck2
|
|
9
|
-
} from "./index-
|
|
6
|
+
} from "./index-609zbjve.js";
|
|
10
7
|
import {
|
|
11
8
|
TypecheckFailure
|
|
12
9
|
} from "./index-j4yvgfhr.js";
|
|
10
|
+
import {
|
|
11
|
+
ApplicationBuildReporter
|
|
12
|
+
} from "./index-w18qdjyf.js";
|
|
13
13
|
import {
|
|
14
14
|
AppExecutor2
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-cfzqdsam.js";
|
|
16
16
|
import {
|
|
17
17
|
LibExecutor2
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-c67vjafa.js";
|
|
19
19
|
import {
|
|
20
20
|
PkgExecutor2
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-2t7jnfg5.js";
|
|
22
22
|
import {
|
|
23
23
|
WorkspaceRunner,
|
|
24
24
|
AkanQualityScanner
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-0vtpxfx6.js";
|
|
26
26
|
import {
|
|
27
27
|
VerifyScope
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-rd669r6x.js";
|
|
29
29
|
|
|
30
30
|
// pkgs/@akanjs/cli/verify/verifyComments.ts
|
|
31
31
|
import { existsSync } from "fs";
|