@akanjs/cli 3.0.0-beta.26 → 3.0.0-beta.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.build-stamp +1 -1
- package/{CodeAgent-p65jja35.js → CodeAgent-7acv4ah8.js} +2 -2
- package/{CodeTui-5xr8kxx4.js → CodeTui-9tkh34mj.js} +1 -1
- package/{agent.command-rp505zxa.js → agent.command-q9bmqrag.js} +5 -5
- package/akanCode.js +2 -2
- package/{application.command-afajz1m5.js → application.command-xpnkyx4z.js} +70 -8
- package/{applicationBuildRunner-412y0345.js → applicationBuildRunner-w4917tje.js} +67 -22
- package/buildBatch.proc.js +3 -3
- package/{cloud.command-yz0h8a2e.js → cloud.command-7yd624qd.js} +9 -9
- package/cloud.script-25vzkz7b.js +20 -0
- package/{code.command-jhrjttm1.js → code.command-fpx4gzmy.js} +6 -6
- package/commandManifest.json +1 -1
- package/{context.command-xncdvv7n.js → context.command-snn1k5q3.js} +13 -13
- package/context.runner-nzaf8c98.js +21 -0
- package/{guideline.command-d5qmxx29.js → guideline.command-ene55fkr.js} +2 -2
- package/guidelines/conventions/conventions.instruction.md +27 -7
- package/guidelines/runtimeRule/runtimeRule.instruction.md +107 -1
- package/incrementalBuilder.proc.js +2 -2
- package/{index-cfj73ck1.js → index-0ej0sr6m.js} +225 -47
- package/{index-hzy4pe24.js → index-0pqzrbpr.js} +2 -2
- package/{index-6dt6zft6.js → index-20r2g1t3.js} +4 -4
- package/{index-xfgdmm5d.js → index-2ctqegdm.js} +2 -2
- package/{index-d65fzxvd.js → index-2s2e5qnd.js} +1 -1
- package/{index-t02g6dpn.js → index-2z30v4k5.js} +3 -3
- package/{index-tpdn30ya.js → index-52n8xr63.js} +1 -1
- package/{index-mq74nzf8.js → index-9j0kykc6.js} +5 -5
- package/{index-58cyna2s.js → index-b68zfsvz.js} +1 -1
- package/{index-qm4fppfk.js → index-ewbek95g.js} +3 -3
- package/{index-wvebzf0y.js → index-fy42hyb9.js} +7 -3
- package/{index-zazvn45w.js → index-genegfnt.js} +4 -4
- package/{index-da72pfdv.js → index-h9ed99ax.js} +7 -7
- package/{index-per2kqy9.js → index-k7809wmg.js} +2 -2
- package/{index-50rq2qms.js → index-n9704w6y.js} +4 -4
- package/{index-860zjnr1.js → index-nbg9bfnr.js} +1 -1
- package/{index-5mm3g24t.js → index-qtz88kh0.js} +2 -2
- package/{index-0n9q1f23.js → index-r8gp8zk3.js} +231 -98
- package/{index-ggfhz9ab.js → index-rbeahw6j.js} +3 -3
- package/{index-56xwsgyn.js → index-rrt9pnb4.js} +2 -2
- package/{index-v4hnkqz9.js → index-ss828r32.js} +1 -1
- package/index-tfe3711h.js +947 -0
- package/{index-cd9qt2t6.js → index-ttn00pr3.js} +223 -33
- package/{index-7yxndzea.js → index-vt64c067.js} +11 -9
- package/index.js +21 -21
- package/{library.command-sv6g1h2g.js → library.command-tz7vnwea.js} +3 -3
- package/{localRegistry.command-fm41vdtw.js → localRegistry.command-f39yk7be.js} +8 -8
- package/{module.command-ccdeder9.js → module.command-qhc9ns0s.js} +5 -5
- package/{package.command-xmw605b1.js → package.command-z3epnvas.js} +3 -3
- package/package.json +2 -2
- package/{page.command-ky7vafsn.js → page.command-exd2vakz.js} +3 -3
- package/{primitive.command-bh6j8nfs.js → primitive.command-0w6cha4j.js} +6 -6
- package/{quality.command-rqqrpe98.js → quality.command-je4kc9yv.js} +2 -2
- package/{repair.command-n9nsm9qe.js → repair.command-knvwfgtg.js} +5 -5
- package/{scalar.command-t09gmck8.js → scalar.command-60nxfchc.js} +4 -4
- package/{subspace.command-y1p56wyv.js → subspace.command-0e53tvxk.js} +4 -4
- package/templates/server.ts +1 -1
- package/{tunnel.command-4g95vhsn.js → tunnel.command-7m2kxtat.js} +2 -2
- package/{workflow.command-b91ph8sx.js → workflow.command-j5tk13ds.js} +10 -10
- package/{workspace.command-d8he10tv.js → workspace.command-wypqk2zb.js} +20 -20
- package/cloud.script-zez2b8am.js +0 -20
- package/context.runner-pjy89k2s.js +0 -21
- package/index-ys6f0bvh.js +0 -471
package/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4303a4be1f9e80c8d096d61ecbdfc40f9354ddce71c2526133f623a2c8793dec
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Workspace,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-b68zfsvz.js";
|
|
6
6
|
import"./index-52w0fvh8.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-r8gp8zk3.js";
|
|
8
8
|
import"./index-hj6w4ka1.js";
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
import"./index-2s2e5qnd.js";
|
|
10
|
+
import"./index-0pqzrbpr.js";
|
|
11
11
|
import"./index-zzvvc845.js";
|
|
12
12
|
import {
|
|
13
13
|
AgentScript
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-rbeahw6j.js";
|
|
15
15
|
|
|
16
16
|
// pkgs/@akanjs/cli/agent/agent.command.ts
|
|
17
17
|
class AgentCommand extends command("agent", [AgentScript], ({ public: target }) => ({
|
package/akanCode.js
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
CodeMailbox2,
|
|
29
29
|
CodeSessionFork2,
|
|
30
30
|
CodeAgent2
|
|
31
|
-
} from "./index-
|
|
31
|
+
} from "./index-ewbek95g.js";
|
|
32
32
|
import {
|
|
33
33
|
akanCodeDefaultModel2,
|
|
34
34
|
akanCodeModel2,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
import {
|
|
40
40
|
SubagentPool2,
|
|
41
41
|
akanCodePaths2
|
|
42
|
-
} from "./index-
|
|
42
|
+
} from "./index-52n8xr63.js";
|
|
43
43
|
import"./index-7md2g9vw.js";
|
|
44
44
|
import {
|
|
45
45
|
CodeAgentRpcHost2
|
|
@@ -6,19 +6,19 @@ import {
|
|
|
6
6
|
Exec,
|
|
7
7
|
Workspace,
|
|
8
8
|
command
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-b68zfsvz.js";
|
|
10
10
|
import"./index-52w0fvh8.js";
|
|
11
|
-
import"./index-
|
|
11
|
+
import"./index-r8gp8zk3.js";
|
|
12
12
|
import {
|
|
13
13
|
getMobileTargetChoices
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-tfe3711h.js";
|
|
15
15
|
import"./index-48k96p55.js";
|
|
16
|
-
import"./index-
|
|
16
|
+
import"./index-qtz88kh0.js";
|
|
17
17
|
import {
|
|
18
18
|
ApplicationScript
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-0ej0sr6m.js";
|
|
20
20
|
import"./index-7md2g9vw.js";
|
|
21
|
-
import"./index-
|
|
21
|
+
import"./index-nbg9bfnr.js";
|
|
22
22
|
|
|
23
23
|
// pkgs/@akanjs/cli/application/application.command.ts
|
|
24
24
|
var mobileTargetOption = {
|
|
@@ -33,7 +33,11 @@ var deviceOption = {
|
|
|
33
33
|
var teamOption = { flag: "T", desc: "Apple team id the signing is narrowed to", default: "" };
|
|
34
34
|
var devEnvs = ["local", "debug", "develop", "main"];
|
|
35
35
|
var buildEnvOption = { enum: devEnvs, desc: "backend environment", default: "debug" };
|
|
36
|
-
var startEnvOption = {
|
|
36
|
+
var startEnvOption = {
|
|
37
|
+
enum: devEnvs,
|
|
38
|
+
desc: "backend environment of a --release build; a dev build follows `akan start`, which keeps its own",
|
|
39
|
+
default: "local"
|
|
40
|
+
};
|
|
37
41
|
var releaseEnvOption = {
|
|
38
42
|
enum: ["debug", "develop", "main", "local"],
|
|
39
43
|
desc: "backend environment",
|
|
@@ -104,6 +108,18 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
|
|
|
104
108
|
buildAndroid: target({ short: true, desc: "Build the Android app (apk) on the native runtime" }).with(App).option("target", String, mobileTargetOption).option("env", String, buildEnvOption).option("debug", Boolean, { desc: "debug build instead of release", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, debug, write) {
|
|
105
109
|
await this.applicationScript.buildAndroid(app, { target, env, profile: debug ? "debug" : "release", write });
|
|
106
110
|
}),
|
|
111
|
+
buildDesktop: target({ short: true, desc: "Build the desktop app for this computer (macOS, Windows or Linux)" }).with(App).option("target", String, mobileTargetOption).option("env", String, buildEnvOption).option("debug", Boolean, { desc: "debug build instead of release", default: false }).option("installer", Boolean, {
|
|
112
|
+
desc: "Windows: also an NSIS setup program (per user, /S for a silent install)",
|
|
113
|
+
default: false
|
|
114
|
+
}).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, debug, installer, write) {
|
|
115
|
+
await this.applicationScript.buildDesktop(app, {
|
|
116
|
+
target,
|
|
117
|
+
env,
|
|
118
|
+
profile: debug ? "debug" : "release",
|
|
119
|
+
installer,
|
|
120
|
+
write
|
|
121
|
+
});
|
|
122
|
+
}),
|
|
107
123
|
start: target({ short: true, desc: "Start development server(s) (frontend SSR + backend)" }).with(Apps).option("plain", Boolean, { desc: "print prefixed lines instead of the full-screen view", default: false }).option("kill", Boolean, { flag: "k", desc: "free the dev ports first, whoever is holding them", default: false }).option("concurrency", Number, {
|
|
108
124
|
desc: "apps to boot at a time (default: what this machine's memory and cores allow)",
|
|
109
125
|
nullable: true
|
|
@@ -136,7 +152,12 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
|
|
|
136
152
|
short: true,
|
|
137
153
|
desc: "Run the desktop app on this computer (macOS, Windows or Linux), following `akan start`"
|
|
138
154
|
}).with(App).option("target", String, mobileTargetOption).option("env", String, startEnvOption).option("release", Boolean, { desc: "run a release build of its own bundle instead", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, release, write) {
|
|
139
|
-
await this.applicationScript.startDesktop(app, {
|
|
155
|
+
await this.applicationScript.startDesktop(app, {
|
|
156
|
+
target,
|
|
157
|
+
env,
|
|
158
|
+
operation: release ? "release" : "local",
|
|
159
|
+
write
|
|
160
|
+
});
|
|
140
161
|
}),
|
|
141
162
|
releaseIos: target({ desc: "Build and sign the iOS app for the App Store (.ipa)" }).with(App).option("target", String, mobileTargetOption).option("env", String, releaseEnvOption).option("team", String, teamOption).option("adHoc", Boolean, { desc: "sign with an ad-hoc profile instead of app-store", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow release with --env local", default: false }).exec(async function(app, target, env, team, adHoc, write, allowLocalRelease) {
|
|
142
163
|
await this.applicationScript.releaseIos(app, {
|
|
@@ -156,6 +177,47 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
|
|
|
156
177
|
allowLocalRelease
|
|
157
178
|
});
|
|
158
179
|
}),
|
|
180
|
+
packUpdate: target({
|
|
181
|
+
desc: "Pack an unsigned over-the-air update of the mobile web bundle, for the signer to publish"
|
|
182
|
+
}).with(App).option("platform", String, { enum: ["ios", "android"], desc: "the app it updates" }).option("target", String, mobileTargetOption).option("env", String, releaseEnvOption).option("out", String, {
|
|
183
|
+
desc: "output folder (default: .akan/mobile/<target>/updates/<platform>)",
|
|
184
|
+
nullable: true
|
|
185
|
+
}).option("against", String, {
|
|
186
|
+
desc: "bundle.json of the store build it must run in; fails when it needs a new one",
|
|
187
|
+
nullable: true
|
|
188
|
+
}).option("write", Boolean, { desc: "write code generation", default: true }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow packing with --env local", default: false }).exec(async function(app, platform, target, env, out, against, write, allowLocalRelease) {
|
|
189
|
+
await this.applicationScript.packUpdate(app, platform, {
|
|
190
|
+
target,
|
|
191
|
+
env,
|
|
192
|
+
out: out ?? undefined,
|
|
193
|
+
against: against ?? undefined,
|
|
194
|
+
write,
|
|
195
|
+
allowLocalRelease
|
|
196
|
+
});
|
|
197
|
+
}),
|
|
198
|
+
updateKeygen: target({ desc: "Make (once) the key an app's update releases are signed with; print its public key" }).with(App).option("platform", String, {
|
|
199
|
+
enum: ["desktop", "android", "ios"],
|
|
200
|
+
default: "desktop",
|
|
201
|
+
desc: "the platform whose app id the key signs for (an appId may differ per platform)"
|
|
202
|
+
}).option("target", String, mobileTargetOption).exec(async function(app, platform, target) {
|
|
203
|
+
await this.applicationScript.updateKeygen(app, platform, { target });
|
|
204
|
+
}),
|
|
205
|
+
publishUpdate: target({ desc: "Build and sign an update release installed apps take (desktop, android or ios)" }).with(App).option("platform", String, {
|
|
206
|
+
enum: ["desktop", "android", "ios"],
|
|
207
|
+
default: "desktop",
|
|
208
|
+
desc: "desktop is this computer's OS and CPU; android and ios publish the web bundle"
|
|
209
|
+
}).option("target", String, mobileTargetOption).option("env", String, releaseEnvOption).option("channel", String, {
|
|
210
|
+
desc: "the manifest to publish to (default: the target's updates.channel, else --env)",
|
|
211
|
+
nullable: true
|
|
212
|
+
}).option("write", Boolean, { desc: "write code generation", default: true }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow release with --env local", default: false }).exec(async function(app, platform, target, env, channel, write, allowLocalRelease) {
|
|
213
|
+
await this.applicationScript.publishUpdate(app, platform, {
|
|
214
|
+
target,
|
|
215
|
+
env,
|
|
216
|
+
...channel ? { channel } : {},
|
|
217
|
+
write,
|
|
218
|
+
allowLocalRelease
|
|
219
|
+
});
|
|
220
|
+
}),
|
|
159
221
|
dbup: target({ desc: "Start local database services for a database mode" }).with(Workspace).option("mode", String, {
|
|
160
222
|
desc: "database mode; left out, every mode the workspace's apps declare",
|
|
161
223
|
enum: ["single", "multiple", "cluster"],
|
|
@@ -1,21 +1,55 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
Spinner
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-r8gp8zk3.js";
|
|
5
|
+
import"./index-ttn00pr3.js";
|
|
6
6
|
import {
|
|
7
7
|
AllRoutesBuilder,
|
|
8
8
|
CsrArtifactBuilder,
|
|
9
9
|
FontPruner,
|
|
10
10
|
precompressArtifacts,
|
|
11
11
|
SsrBaseArtifactBuilder
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-fy42hyb9.js";
|
|
13
13
|
import"./index-52w0fvh8.js";
|
|
14
14
|
import"./index-n68jx79w.js";
|
|
15
15
|
|
|
16
16
|
// pkgs/@akanjs/devkit/applicationBuildRunner.ts
|
|
17
17
|
import { mkdir, rm } from "fs/promises";
|
|
18
|
+
import path2 from "path";
|
|
19
|
+
|
|
20
|
+
// pkgs/@akanjs/devkit/transforms/serverEnvPlugin.ts
|
|
21
|
+
import { existsSync, realpathSync } from "fs";
|
|
18
22
|
import path from "path";
|
|
23
|
+
var escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
24
|
+
var createServerEnvPlugin = ({ envDir, environment, environments }) => {
|
|
25
|
+
const others = [...new Set(environments)].filter((name) => name !== environment);
|
|
26
|
+
const dirs = new Set([path.resolve(envDir), existsSync(envDir) ? realpathSync.native(envDir) : envDir]);
|
|
27
|
+
const names = others.map(escapeRegExp).join("|");
|
|
28
|
+
const filter = new RegExp(`^(?:${[...dirs].map(escapeRegExp).join("|")})[\\\\/]env\\.server\\.(?:${names})\\.ts$`);
|
|
29
|
+
return {
|
|
30
|
+
name: "akan-server-env",
|
|
31
|
+
setup(build) {
|
|
32
|
+
if (!others.length)
|
|
33
|
+
return;
|
|
34
|
+
build.onLoad({ filter }, async (args) => {
|
|
35
|
+
const name = path.basename(args.path, ".ts").slice("env.server.".length);
|
|
36
|
+
const { exports } = new Bun.Transpiler({ loader: "ts" }).scan(await Bun.file(args.path).text());
|
|
37
|
+
const message = `env/env.server.${name}.ts is not in this build: \`akan build\` bundles the server env of AKAN_PUBLIC_ENV=${environment} alone, the environment its image runs. Build with AKAN_PUBLIC_ENV=${name} to run ${name}.`;
|
|
38
|
+
return {
|
|
39
|
+
loader: "js",
|
|
40
|
+
contents: [
|
|
41
|
+
`const refuse = () => { throw new Error(${JSON.stringify(message)}); };`,
|
|
42
|
+
"const unbuilt = new Proxy({}, { get: refuse, has: refuse, ownKeys: refuse, getOwnPropertyDescriptor: refuse });",
|
|
43
|
+
`export { ${exports.map((exported) => `unbuilt as ${JSON.stringify(exported)}`).join(", ")} };`
|
|
44
|
+
].join(`
|
|
45
|
+
`)
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// pkgs/@akanjs/devkit/applicationBuildRunner.ts
|
|
19
53
|
var BUILD_PHASE_EMOJIS = {
|
|
20
54
|
prepare: "\uD83E\uDDF9",
|
|
21
55
|
typecheck: "\uD83D\uDD0E",
|
|
@@ -50,13 +84,15 @@ class ApplicationBuildRunner {
|
|
|
50
84
|
#app;
|
|
51
85
|
#fast;
|
|
52
86
|
#reporter;
|
|
87
|
+
#environment;
|
|
53
88
|
#spinner;
|
|
54
89
|
#startedAt = Date.now();
|
|
55
90
|
#phases = [];
|
|
56
|
-
constructor(app, { fast = false, reporter } = {}) {
|
|
91
|
+
constructor(app, { fast = false, reporter, environment } = {}) {
|
|
57
92
|
this.#app = app;
|
|
58
93
|
this.#fast = fast;
|
|
59
94
|
this.#reporter = reporter;
|
|
95
|
+
this.#environment = environment;
|
|
60
96
|
}
|
|
61
97
|
async build({ spinner = false } = {}) {
|
|
62
98
|
this.#spinner = spinner;
|
|
@@ -69,12 +105,12 @@ class ApplicationBuildRunner {
|
|
|
69
105
|
await this.#runPhase("csr", "Building CSR assets", async () => web.csr ? await new CsrArtifactBuilder(this.#app, "build").build() : null, (result) => result?.outputDir ?? (web.csr ? "skipped" : "disabled by akan.config.ts web.csr"));
|
|
70
106
|
await this.#runPhase("assets", "Trimming unread static assets", async () => assets.pruneFonts ? await new FontPruner(this.#app, assets).prune() : null, (result) => result ? `${result.removed.length} font file(s) dropped, ${ApplicationBuildRunner.formatBytes(result.freedBytes)} freed; ${result.kept.length} kept` : "disabled by akan.config.ts assets.pruneFonts");
|
|
71
107
|
await this.#runPhase("compress", "Compressing static assets", () => precompressArtifacts(this.#app), (result) => result.files > 0 ? `${result.files} files, ${ApplicationBuildRunner.formatBytes(result.inputBytes)} -> gzip ${ApplicationBuildRunner.formatBytes(result.outputBytes)} / br ${ApplicationBuildRunner.formatBytes(result.brotliBytes)}` : "no files");
|
|
72
|
-
await this.#runPhase("metadata", "Writing production metadata", () => this
|
|
108
|
+
await this.#runPhase("metadata", "Writing production metadata", () => this.buildAppMeta());
|
|
73
109
|
return {
|
|
74
110
|
phases: this.#phases,
|
|
75
111
|
durationMs: Date.now() - this.#startedAt,
|
|
76
112
|
outputDir: this.#app.dist.cwdPath,
|
|
77
|
-
artifactDir:
|
|
113
|
+
artifactDir: path2.join(this.#app.dist.cwdPath, ".akan/artifact")
|
|
78
114
|
};
|
|
79
115
|
}
|
|
80
116
|
async typecheck(options = {}) {
|
|
@@ -82,7 +118,7 @@ class ApplicationBuildRunner {
|
|
|
82
118
|
await this.#app.getPageKeys({ refresh: true });
|
|
83
119
|
const { typecheckDir, tsconfigPath } = await this.#writeTypecheckTsconfig(incremental);
|
|
84
120
|
if (clean)
|
|
85
|
-
await rm(
|
|
121
|
+
await rm(path2.join(typecheckDir, "tsconfig.tsbuildinfo"), { force: true });
|
|
86
122
|
await this.#checkProjectInChildProcess(tsconfigPath);
|
|
87
123
|
}
|
|
88
124
|
async#runPhase(id, label, task, summarize) {
|
|
@@ -102,11 +138,12 @@ class ApplicationBuildRunner {
|
|
|
102
138
|
throw error;
|
|
103
139
|
}
|
|
104
140
|
}
|
|
105
|
-
async
|
|
141
|
+
async buildAppMeta() {
|
|
106
142
|
const akanConfig = await this.#app.getConfig();
|
|
143
|
+
const dockerfile = akanConfig.dockerfileFor(this.#environment ?? akanConfig.baseDevEnv.env);
|
|
107
144
|
await Promise.all([
|
|
108
145
|
this.#app.dist.writeJson("package.json", akanConfig.getProductionPackageJson()),
|
|
109
|
-
this.#app.dist.writeFile(`${this.#app.dist.cwdPath}/Dockerfile`,
|
|
146
|
+
this.#app.dist.writeFile(`${this.#app.dist.cwdPath}/Dockerfile`, dockerfile),
|
|
110
147
|
this.#app.dist.writeJson("akan.build.json", {
|
|
111
148
|
buildId: await this.#resolveBuildId(),
|
|
112
149
|
akanVersion: akanConfig.akanVersion,
|
|
@@ -130,7 +167,7 @@ class ApplicationBuildRunner {
|
|
|
130
167
|
return `${sha.stdout.toString().trim()}${suffix}`;
|
|
131
168
|
}
|
|
132
169
|
async#buildBackend() {
|
|
133
|
-
const { externalLibs, web } = await this.#app.getConfig();
|
|
170
|
+
const { externalLibs, web, baseDevEnv, branches } = await this.#app.getConfig();
|
|
134
171
|
const backendEntryPoints = [`${this.#app.cwdPath}/main.ts`, `${this.#app.cwdPath}/server.ts`];
|
|
135
172
|
for (const entrypoint of backendEntryPoints) {
|
|
136
173
|
if (!await Bun.file(entrypoint).exists())
|
|
@@ -143,7 +180,15 @@ class ApplicationBuildRunner {
|
|
|
143
180
|
naming: { entry: "[name].[ext]", chunk: "chunk-[hash].[ext]" },
|
|
144
181
|
define: { "process.env.NODE_ENV": JSON.stringify("production") }
|
|
145
182
|
};
|
|
146
|
-
const
|
|
183
|
+
const serverEnvPlugin = createServerEnvPlugin({
|
|
184
|
+
envDir: path2.join(this.#app.cwdPath, "env"),
|
|
185
|
+
environment: this.#environment ?? baseDevEnv.env,
|
|
186
|
+
environments: ["local", "testing", ...branches]
|
|
187
|
+
});
|
|
188
|
+
const backendConfig = {
|
|
189
|
+
...sharedConfig,
|
|
190
|
+
plugins: [this.#createExternalSpecifiersPlugin(externalLibs), serverEnvPlugin]
|
|
191
|
+
};
|
|
147
192
|
const [mainResult, serverResult] = [
|
|
148
193
|
await this.#buildOrThrow("backend", { ...backendConfig, entrypoints: [backendEntryPoints[0]] }),
|
|
149
194
|
await this.#buildOrThrow("backend", { ...backendConfig, entrypoints: [backendEntryPoints[1]], splitting: true })
|
|
@@ -166,7 +211,7 @@ class ApplicationBuildRunner {
|
|
|
166
211
|
};
|
|
167
212
|
}
|
|
168
213
|
async#writeConsoleShim() {
|
|
169
|
-
await Bun.write(
|
|
214
|
+
await Bun.write(path2.join(this.#app.dist.cwdPath, "console.js"), `process.env.AKAN_COMMAND_TYPE = "console";
|
|
170
215
|
const { cnst, db, dict, option, server, sig, srv } = await import("./server.js");
|
|
171
216
|
const { assertAkanConsoleAllowed, startAkanConsole } = await import("./console-runtime.js");
|
|
172
217
|
|
|
@@ -190,14 +235,14 @@ void run().catch((error) => {
|
|
|
190
235
|
try {
|
|
191
236
|
return Bun.resolveSync("akanjs/server/rsc-worker", import.meta.dir);
|
|
192
237
|
} catch {
|
|
193
|
-
return
|
|
238
|
+
return path2.join(this.#app.workspace.workspaceRoot, "pkgs/akanjs/server/rscWorker.tsx");
|
|
194
239
|
}
|
|
195
240
|
}
|
|
196
241
|
#resolveConsoleRuntimeBuildEntry() {
|
|
197
242
|
try {
|
|
198
|
-
return
|
|
243
|
+
return path2.join(path2.dirname(Bun.resolveSync("akanjs/server", import.meta.dir)), "console.ts");
|
|
199
244
|
} catch {
|
|
200
|
-
return
|
|
245
|
+
return path2.join(this.#app.workspace.workspaceRoot, "pkgs/akanjs/server/console.ts");
|
|
201
246
|
}
|
|
202
247
|
}
|
|
203
248
|
async#buildSsr() {
|
|
@@ -211,10 +256,10 @@ void run().catch((error) => {
|
|
|
211
256
|
return { base, allRoutes };
|
|
212
257
|
}
|
|
213
258
|
async#writeTypecheckTsconfig(incremental) {
|
|
214
|
-
const typecheckDir =
|
|
259
|
+
const typecheckDir = path2.join(this.#app.cwdPath, ".akan", "typecheck");
|
|
215
260
|
await mkdir(typecheckDir, { recursive: true });
|
|
216
261
|
const libPageIncludes = (await this.#app.getPageRoots()).filter((root) => root.keyPrefix).flatMap((root) => {
|
|
217
|
-
const rel =
|
|
262
|
+
const rel = path2.relative(typecheckDir, root.realDir).split(path2.sep).join("/");
|
|
218
263
|
return [`${rel}/**/*.ts`, `${rel}/**/*.tsx`];
|
|
219
264
|
});
|
|
220
265
|
const tsconfig = {
|
|
@@ -235,7 +280,7 @@ void run().catch((error) => {
|
|
|
235
280
|
],
|
|
236
281
|
references: []
|
|
237
282
|
};
|
|
238
|
-
const tsconfigPath =
|
|
283
|
+
const tsconfigPath = path2.join(typecheckDir, "tsconfig.json");
|
|
239
284
|
await Bun.write(tsconfigPath, `${JSON.stringify(tsconfig, null, 2)}
|
|
240
285
|
`);
|
|
241
286
|
return { typecheckDir, tsconfigPath };
|
|
@@ -261,10 +306,10 @@ void run().catch((error) => {
|
|
|
261
306
|
}
|
|
262
307
|
async#resolveTypecheckWorkerEntry() {
|
|
263
308
|
const candidates = [
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
309
|
+
path2.join(this.#app.workspace.workspaceRoot, "pkgs/@akanjs/devkit/typecheck/typecheck.proc.ts"),
|
|
310
|
+
path2.join(this.#app.workspace.workspaceRoot, "node_modules/@akanjs/devkit/typecheck/typecheck.proc.ts"),
|
|
311
|
+
path2.join(import.meta.dir, "typecheck.proc.js"),
|
|
312
|
+
path2.join(import.meta.dir, "typecheck.proc.ts")
|
|
268
313
|
];
|
|
269
314
|
for (const candidate of candidates)
|
|
270
315
|
if (await Bun.file(candidate).exists())
|
package/buildBatch.proc.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
resolveSsrPageEntriesForApp,
|
|
7
7
|
WorkspaceExecutor,
|
|
8
8
|
AppExecutor
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-r8gp8zk3.js";
|
|
10
10
|
import {
|
|
11
11
|
computeRouteSeedIndex,
|
|
12
12
|
saveRouteSeedIndex,
|
|
@@ -14,14 +14,14 @@ import {
|
|
|
14
14
|
PagesBundleBuilder,
|
|
15
15
|
CsrDevBundler,
|
|
16
16
|
SsrDevBundler
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-ttn00pr3.js";
|
|
18
18
|
import"./index-52w0fvh8.js";
|
|
19
19
|
import {
|
|
20
20
|
CsrArtifactBuilder,
|
|
21
21
|
CssCompiler,
|
|
22
22
|
FontOptimizer,
|
|
23
23
|
SsrBaseArtifactBuilder
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-fy42hyb9.js";
|
|
25
25
|
import"./index-n68jx79w.js";
|
|
26
26
|
|
|
27
27
|
// pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
|
|
@@ -6,22 +6,22 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
Workspace,
|
|
8
8
|
command
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-b68zfsvz.js";
|
|
10
|
+
import"./index-r8gp8zk3.js";
|
|
11
11
|
import {
|
|
12
12
|
PlatformTestRun
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-rrt9pnb4.js";
|
|
14
14
|
import"./index-48k96p55.js";
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
15
|
+
import"./index-qtz88kh0.js";
|
|
16
|
+
import"./index-0ej0sr6m.js";
|
|
17
|
+
import"./index-tfe3711h.js";
|
|
18
18
|
import"./index-7md2g9vw.js";
|
|
19
19
|
import"./index-2ahj896a.js";
|
|
20
|
-
import"./index-
|
|
20
|
+
import"./index-k7809wmg.js";
|
|
21
21
|
import {
|
|
22
22
|
CloudScript2
|
|
23
|
-
} from "./index-
|
|
24
|
-
import"./index-
|
|
23
|
+
} from "./index-9j0kykc6.js";
|
|
24
|
+
import"./index-nbg9bfnr.js";
|
|
25
25
|
|
|
26
26
|
// pkgs/@akanjs/cli/cloud/cloud.command.ts
|
|
27
27
|
var localRegistryUrl = () => process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
CloudScript2
|
|
4
|
+
} from "./index-9j0kykc6.js";
|
|
5
|
+
import"./index-rrt9pnb4.js";
|
|
6
|
+
import"./index-k7809wmg.js";
|
|
7
|
+
import"./index-0ej0sr6m.js";
|
|
8
|
+
import"./index-nbg9bfnr.js";
|
|
9
|
+
import"./index-qtz88kh0.js";
|
|
10
|
+
import"./index-tfe3711h.js";
|
|
11
|
+
import"./index-94s080qm.js";
|
|
12
|
+
import"./index-b68zfsvz.js";
|
|
13
|
+
import"./index-7md2g9vw.js";
|
|
14
|
+
import"./index-48k96p55.js";
|
|
15
|
+
import"./index-r8gp8zk3.js";
|
|
16
|
+
import"./index-2ahj896a.js";
|
|
17
|
+
import"./index-52w0fvh8.js";
|
|
18
|
+
export {
|
|
19
|
+
CloudScript2 as CloudScript
|
|
20
|
+
};
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
runner,
|
|
5
5
|
script,
|
|
6
6
|
command
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-b68zfsvz.js";
|
|
8
8
|
import"./index-52w0fvh8.js";
|
|
9
|
-
import"./index-
|
|
9
|
+
import"./index-r8gp8zk3.js";
|
|
10
10
|
import {
|
|
11
11
|
akanCodeDefaultModel2,
|
|
12
12
|
CodeAgentStreamPrinter2
|
|
@@ -19,7 +19,7 @@ class CodeRunner extends runner("code") {
|
|
|
19
19
|
async serve(options, listen) {
|
|
20
20
|
await import("./consoleToStderr-h5bryj94.js");
|
|
21
21
|
const [{ CodeAgent }, { CodeAgentRpcHost }, { CodeAgentRpcListener }] = await Promise.all([
|
|
22
|
-
import("./CodeAgent-
|
|
22
|
+
import("./CodeAgent-7acv4ah8.js"),
|
|
23
23
|
import("./CodeAgentRpcHost-p7h6n2hp.js"),
|
|
24
24
|
import("./CodeAgentRpcListener-7p7z5dd7.js")
|
|
25
25
|
]);
|
|
@@ -34,8 +34,8 @@ class CodeRunner extends runner("code") {
|
|
|
34
34
|
}
|
|
35
35
|
async tui(options, seed) {
|
|
36
36
|
const [{ CodeAgent }, { CodeTui }] = await Promise.all([
|
|
37
|
-
import("./CodeAgent-
|
|
38
|
-
import("./CodeTui-
|
|
37
|
+
import("./CodeAgent-7acv4ah8.js"),
|
|
38
|
+
import("./CodeTui-9tkh34mj.js")
|
|
39
39
|
]);
|
|
40
40
|
const agentOptions = await CodeRunner.#agentOptions(options, false);
|
|
41
41
|
let resume = options.resume;
|
|
@@ -60,7 +60,7 @@ class CodeRunner extends runner("code") {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
async run(prompt, options) {
|
|
63
|
-
const { CodeAgent } = await import("./CodeAgent-
|
|
63
|
+
const { CodeAgent } = await import("./CodeAgent-7acv4ah8.js");
|
|
64
64
|
const agent = await CodeAgent.create(await CodeRunner.#agentOptions(options, false));
|
|
65
65
|
const printer = new CodeAgentStreamPrinter2({ json: options.json, thinking: options.thinking });
|
|
66
66
|
agent.on((event) => printer.print(event));
|
package/commandManifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","code":"code","create-application":"application","remove-application":"application","plan-slice":"application","sync":"application","script":"application","console":"application","logs":"application","build":"application","b":"application","typecheck":"application","t":"application","test":"application","build-ios":"application","bi":"application","build-android":"application","ba":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","start-desktop":"application","sd":"application","release-ios":"application","release-android":"application","dbup":"application","db-export":"application","db-import":"application","dbdown":"application","create-library":"library","remove-library":"library","sync-library":"library","library-status":"library","install-library":"library","start-registry":"localRegistry","reset-registry":"localRegistry","smoke-registry":"localRegistry","version":"package","create-package":"package","remove-package":"package","sync-package":"package","build-package":"package","verify-dist-package":"package","verify-akan-publish-packages":"package","create-module":"module","remove-module":"module","create-service":"module","create-view":"module","create-unit":"module","create-template":"module","create-crud-page":"page","context":"context","doctor":"context","mcp-install":"context","mcp":"context","mcp-call":"context","login":"cloud","logout":"cloud","deploy-akan":"cloud","test-platforms":"cloud","update":"cloud","download-env":"cloud","upload-env":"cloud","subspace":"subspace","guideline":"guideline","create-scalar":"scalar","remove-scalar":"scalar","create-ui":"primitive","add-field":"primitive","add-enum-field":"primitive","quality":"quality","repair":"repair","workflow":"workflow","tunnel":"tunnel"}}
|
|
1
|
+
{"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","code":"code","create-application":"application","remove-application":"application","plan-slice":"application","sync":"application","script":"application","console":"application","logs":"application","build":"application","b":"application","typecheck":"application","t":"application","test":"application","build-ios":"application","bi":"application","build-android":"application","ba":"application","build-desktop":"application","bd":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","start-desktop":"application","sd":"application","release-ios":"application","release-android":"application","pack-update":"application","update-keygen":"application","publish-update":"application","dbup":"application","db-export":"application","db-import":"application","dbdown":"application","create-library":"library","remove-library":"library","sync-library":"library","library-status":"library","install-library":"library","start-registry":"localRegistry","reset-registry":"localRegistry","smoke-registry":"localRegistry","version":"package","create-package":"package","remove-package":"package","sync-package":"package","build-package":"package","verify-dist-package":"package","verify-akan-publish-packages":"package","create-module":"module","remove-module":"module","create-service":"module","create-view":"module","create-unit":"module","create-template":"module","create-crud-page":"page","context":"context","doctor":"context","mcp-install":"context","mcp":"context","mcp-call":"context","login":"cloud","logout":"cloud","deploy-akan":"cloud","test-platforms":"cloud","update":"cloud","download-env":"cloud","upload-env":"cloud","subspace":"subspace","guideline":"guideline","create-scalar":"scalar","remove-scalar":"scalar","create-ui":"primitive","add-field":"primitive","add-enum-field":"primitive","quality":"quality","repair":"repair","workflow":"workflow","tunnel":"tunnel"}}
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Workspace,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-b68zfsvz.js";
|
|
6
6
|
import"./index-52w0fvh8.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-r8gp8zk3.js";
|
|
8
8
|
import"./index-hj6w4ka1.js";
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
9
|
+
import"./index-2s2e5qnd.js";
|
|
10
|
+
import"./index-0pqzrbpr.js";
|
|
11
|
+
import"./index-vt64c067.js";
|
|
12
|
+
import"./index-tfe3711h.js";
|
|
13
13
|
import"./index-zzvvc845.js";
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
14
|
+
import"./index-2z30v4k5.js";
|
|
15
|
+
import"./index-ss828r32.js";
|
|
16
|
+
import"./index-genegfnt.js";
|
|
17
|
+
import"./index-20r2g1t3.js";
|
|
18
|
+
import"./index-2ctqegdm.js";
|
|
19
|
+
import"./index-h9ed99ax.js";
|
|
20
20
|
import {
|
|
21
21
|
ContextScript
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-n9704w6y.js";
|
|
23
23
|
|
|
24
24
|
// pkgs/@akanjs/cli/context/context.command.ts
|
|
25
25
|
class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
ContextRunner2
|
|
4
|
+
} from "./index-vt64c067.js";
|
|
5
|
+
import"./index-h9ed99ax.js";
|
|
6
|
+
import"./index-2ctqegdm.js";
|
|
7
|
+
import"./index-20r2g1t3.js";
|
|
8
|
+
import"./index-2z30v4k5.js";
|
|
9
|
+
import"./index-genegfnt.js";
|
|
10
|
+
import"./index-ss828r32.js";
|
|
11
|
+
import"./index-tfe3711h.js";
|
|
12
|
+
import"./index-0pqzrbpr.js";
|
|
13
|
+
import"./index-2s2e5qnd.js";
|
|
14
|
+
import"./index-zzvvc845.js";
|
|
15
|
+
import"./index-b68zfsvz.js";
|
|
16
|
+
import"./index-r8gp8zk3.js";
|
|
17
|
+
import"./index-hj6w4ka1.js";
|
|
18
|
+
import"./index-52w0fvh8.js";
|
|
19
|
+
export {
|
|
20
|
+
ContextRunner2 as ContextRunner
|
|
21
|
+
};
|