@akanjs/cli 3.0.0-beta.3 → 3.0.0-beta.30
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-xnfyyz8h.js +9 -0
- package/CodeAgentRpcHost-p7h6n2hp.js +7 -0
- package/CodeAgentRpcListener-7p7z5dd7.js +97 -0
- package/CodeTui-h66xb1fh.js +1457 -0
- package/README.md +3 -0
- package/TunnelShare-cwh9ezsm.js +9 -0
- package/{agent.command-d2gfxfck.js → agent.command-c4v7kjff.js} +8 -9
- package/akanCode.js +102 -0
- package/application.command-yzsswrz6.js +241 -0
- package/{applicationBuildRunner-kxwbssgn.js → applicationBuildRunner-qkt6spd5.js} +121 -77
- package/buildBatch.proc.js +120 -32
- package/cloud.command-v8h688jc.js +95 -0
- package/cloud.script-yct1sk4k.js +20 -0
- package/code.command-jff3tw7y.js +154 -0
- package/commandManifest.json +1 -1
- package/consoleToStderr-h5bryj94.js +7 -0
- package/context.command-y5sevk3c.js +48 -0
- package/context.runner-90hsmacr.js +21 -0
- package/{dependencyScanner-shs82ynp.js → dependencyScanner-06z2dmrr.js} +2 -2
- package/{devTui-40ggmd99.js → devTui-q7k7bakd.js} +122 -40
- package/fileSys-wzzrntkw.js +9 -0
- package/guideline.command-11cndccb.js +42 -0
- package/guidelines/agentRule/agentRule.instruction.md +209 -33
- package/guidelines/conventions/conventions.instruction.md +143 -41
- package/guidelines/fieldRule/fieldRule.instruction.md +1 -0
- package/guidelines/mcpRule/mcpRule.instruction.md +7 -5
- package/guidelines/queryRule/queryRule.instruction.md +21 -7
- package/guidelines/runtimeRule/runtimeRule.instruction.md +268 -6
- package/guidelines/ssrRule/ssrRule.instruction.md +4 -2
- package/guidelines/transportRule/transportRule.instruction.md +51 -0
- package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +20 -0
- package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +66 -3
- package/incrementalBuilder.proc.js +564 -109
- package/{index-fz5q3gd7.js → index-0ncc0mbk.js} +10 -17
- package/index-167c77aq.js +69 -0
- package/{index-kcxmv48c.js → index-2ahj896a.js} +45 -79
- package/index-2wc41k5w.js +49 -0
- package/{index-j9yhg404.js → index-35mmm9ca.js} +4 -7
- package/{index-a64esmtb.js → index-376gpdds.js} +523 -1022
- package/index-3hx1z96c.js +87 -0
- package/{index-v0qh106m.js → index-3rh7thcx.js} +961 -892
- package/{index-hwkygn9s.js → index-48k96p55.js} +325 -36
- package/{index-q0y2jq9j.js → index-52w0fvh8.js} +21 -4
- package/index-5rp0h6na.js +1119 -0
- package/index-6x9p8dpb.js +4300 -0
- package/index-7md2g9vw.js +6 -0
- package/index-8tv7356t.js +700 -0
- package/index-94s080qm.js +266 -0
- package/index-9dp031by.js +12 -0
- package/{index-ws5e0j51.js → index-a4s954kq.js} +43 -26
- package/{index-3d9y066c.js → index-bjwxs904.js} +9 -8
- package/{index-ne2qy0nk.js → index-bxmejydw.js} +12 -12
- package/index-c6eggbee.js +123 -0
- package/index-d2242ksy.js +99 -0
- package/{index-92zztqy1.js → index-dy0jx9ay.js} +2 -17
- package/{index-259dsnz3.js → index-gxamdf18.js} +5 -8
- package/{index-4edzf1gr.js → index-hf6f4xnb.js} +77 -150
- package/{index-by5gpp8x.js → index-hj6w4ka1.js} +2 -1
- package/{index-gyd220p2.js → index-hmdq5pqm.js} +554 -577
- package/{index-600zhnve.js → index-hqd0h1pb.js} +75 -203
- package/index-kb16nzyt.js +997 -0
- package/index-mk3b9rk1.js +2729 -0
- package/{index-2tv3fdx4.js → index-n3jk2501.js} +1205 -1458
- package/index-p6pbz9n5.js +25 -0
- package/{index-zry5nz81.js → index-qcejqgts.js} +51 -30
- package/{index-7737gxcp.js → index-rtwhw4aq.js} +107 -241
- package/{index-pnqbkf5p.js → index-se643zvp.js} +6 -2
- package/index-tsb0f8ya.js +53 -0
- package/{index-ktb5njgy.js → index-tzc1gtrg.js} +49 -99
- package/index-wa5jbxj1.js +760 -0
- package/index-wfwgcnyc.js +187 -0
- package/{index-mak3cd28.js → index-xb7qhxa8.js} +137 -255
- package/{index-h7yw2z9n.js → index-zzvvc845.js} +8 -14
- package/index.js +23 -22
- package/{library.command-nbsky672.js → library.command-n9kp7yms.js} +4 -5
- package/{localRegistry.command-yeq57wjr.js → localRegistry.command-jx6kxt2x.js} +23 -42
- package/{module.command-29vqzrh8.js → module.command-q2xjf6cx.js} +8 -11
- package/{package.command-axv0abmn.js → package.command-q5a3nsw5.js} +6 -7
- package/package.json +15 -7
- package/{page.command-vs9s3zrh.js → page.command-ppenrxjn.js} +4 -5
- package/{primitive.command-cbxmqbtc.js → primitive.command-dvgg8nem.js} +9 -22
- package/prompter-76k56b37.js +8 -0
- package/{quality.command-gmbs7nws.js → quality.command-pz7kg3pc.js} +205 -377
- package/{recipeScanner-fpagtgc1.js → recipeScanner-4b69ybe0.js} +1 -1
- package/{repair.command-bqsjptsj.js → repair.command-a6py9xvz.js} +11 -35
- package/{routeSourceValidator-apyqw7wk.js → routeSourceValidator-7ycnfz0e.js} +0 -6
- package/{scalar.command-6k1vhe9s.js → scalar.command-7f3xfpen.js} +7 -10
- package/skills/akan-code/SKILL.md +130 -0
- package/skills/akan-debug/SKILL.md +42 -0
- package/skills/akan-deps/SKILL.md +50 -0
- package/skills/akan-err/SKILL.md +39 -0
- package/skills/akan-module/SKILL.md +45 -0
- package/skills/akan-scaffold/SKILL.md +76 -0
- package/skills/akan-scalar/SKILL.md +52 -0
- package/skills/akan-service/SKILL.md +34 -0
- package/skills/akan-store/SKILL.md +67 -0
- package/skills/akan-ui/SKILL.md +63 -0
- package/skills/akan-validate/SKILL.md +44 -0
- package/{subspace.command-fwjfcts7.js → subspace.command-z7nqs508.js} +138 -67
- package/templates/__scalar/__model__/__model__.abstract.md.template +8 -0
- package/templates/appSample/lib/__scalar/workHistory/workHistory.abstract.ts +8 -39
- package/templates/appSample/lib/_noti/noti.abstract.ts +6 -29
- package/templates/appSample/lib/task/task.abstract.ts +12 -32
- package/templates/appSample/lib/task/task.signal.spec.ts +15 -18
- package/templates/appSample/lib/task/task.signal.test.ts +15 -1
- package/templates/appSample/lib/task/task.signal.ts +1 -1
- package/templates/appSample/srvkit/{AuthGuard.ts → guards.ts} +7 -4
- package/templates/appSample/srvkit/{SessionInternalArg.ts → internalArgs.ts} +6 -4
- package/templates/client.ts +7 -30
- package/templates/crudPages/[__model__Id]/edit/page.tsx +2 -1
- package/templates/crudPages/[__model__Id]/page.tsx +2 -1
- package/templates/crudPages/new/page.tsx +2 -1
- package/templates/crudPages/page.tsx +2 -1
- package/templates/crudSinglePage/page.tsx +2 -1
- package/templates/lib/__lib/lib.dictionary.ts +0 -2
- package/templates/lib/__lib/lib.document.ts +0 -2
- package/templates/lib/sig.ts +8 -30
- package/templates/localDev/docker-compose.yaml.template +3 -14
- package/templates/module/__model__.signal.ts +12 -4
- package/templates/pkgRoot/tsconfig.json.template +2 -7
- package/templates/server.ts +1 -3
- package/templates/service/__model__.abstract.md.template +8 -0
- package/templates/workspaceRoot/.gitignore.template +0 -1
- package/templates/workspaceRoot/package.json.template +1 -3
- package/tunnel.command-zy4wbcgt.js +129 -0
- package/{typeChecker-3xgrzc2v.js → typeChecker-px49mezc.js} +1 -1
- package/typecheck.proc.js +1 -1
- package/workflow.command-f142t17s.js +79 -0
- package/{workspace.command-8s050m0h.js → workspace.command-gpk1149x.js} +77 -109
- package/abstractCompactor-mjh5ppsq.js +0 -101
- package/application.command-pj2m7584.js +0 -204
- package/applicationReleasePackager-4yasxwv9.js +0 -244
- package/capacitorApp-36rbr858.js +0 -12
- package/cloud.command-jshwdq22.js +0 -93
- package/context.command-ez8a0zyz.js +0 -80
- package/devTuiView-c08ccbat.js +0 -9
- package/getDirname-dr3jz1xg.js +0 -7
- package/guideline.command-xmqwx8zm.js +0 -359
- package/guidelines/agentRule/agentRule.generate.json +0 -31
- package/guidelines/componentRule/componentRule.generate.json +0 -31
- package/guidelines/conventions/conventions.generate.json +0 -25
- package/guidelines/cssRule/cssRule.generate.json +0 -31
- package/guidelines/docPageRule/docPageRule.generate.json +0 -31
- package/guidelines/docPageRule/docPageRule.instruction.md +0 -25
- package/guidelines/docSyncRule/docSyncRule.generate.json +0 -31
- package/guidelines/docSyncRule/docSyncRule.instruction.md +0 -25
- package/guidelines/enumConstant/enumConstant.generate.json +0 -31
- package/guidelines/enumConstant/enumConstant.instruction.md +0 -28
- package/guidelines/fieldRule/fieldRule.generate.json +0 -31
- package/guidelines/framework/framework.generate.json +0 -32
- package/guidelines/mcpRule/mcpRule.generate.json +0 -35
- package/guidelines/modelConstant/modelConstant.generate.json +0 -32
- package/guidelines/modelDictionary/modelDictionary.generate.json +0 -32
- package/guidelines/modelDocument/modelDocument.generate.json +0 -31
- package/guidelines/modelService/modelService.generate.json +0 -31
- package/guidelines/modelSignal/modelSignal.generate.json +0 -31
- package/guidelines/modelStore/modelStore.generate.json +0 -31
- package/guidelines/modelTemplate/modelTemplate.generate.json +0 -31
- package/guidelines/modelUnit/modelUnit.generate.json +0 -31
- package/guidelines/modelUtil/modelUtil.generate.json +0 -31
- package/guidelines/modelView/modelView.generate.json +0 -31
- package/guidelines/modelZone/modelZone.generate.json +0 -31
- package/guidelines/moduleCodegen/moduleCodegen.generate.json +0 -31
- package/guidelines/moduleCodegen/moduleCodegen.instruction.md +0 -28
- package/guidelines/moduleOverview/moduleOverview.generate.json +0 -31
- package/guidelines/queryRule/queryRule.generate.json +0 -31
- package/guidelines/recipeRule/recipeRule.generate.json +0 -31
- package/guidelines/runtimeRule/runtimeRule.generate.json +0 -25
- package/guidelines/scalarConstant/scalarConstant.generate.json +0 -32
- package/guidelines/scalarDictionary/scalarDictionary.generate.json +0 -32
- package/guidelines/scalarModule/scalarModule.generate.json +0 -31
- package/guidelines/sharedUiUsage/sharedUiUsage.generate.json +0 -31
- package/guidelines/sharedUiUsage/sharedUiUsage.instruction.md +0 -25
- package/guidelines/ssrRule/ssrRule.generate.json +0 -31
- package/guidelines/transportRule/transportRule.generate.json +0 -31
- package/guidelines/utilUiUsage/utilUiUsage.generate.json +0 -31
- package/guidelines/utilUiUsage/utilUiUsage.instruction.md +0 -25
- package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +0 -24
- package/guidelines/workspaceRecipes/workspaceRecipes.generate.json +0 -33
- package/index-2hq52jq3.js +0 -465
- package/index-47pj3aee.js +0 -76
- package/index-6wwzs1bc.js +0 -7
- package/index-8pm30m73.js +0 -841
- package/index-kn1h7p1x.js +0 -560
- package/index-meh558jy.js +0 -65
- package/index-rwg2aa4f.js +0 -229
- package/index-w8kmx1b6.js +0 -2176
- package/index-wt7qrtd4.js +0 -1516
- package/templates/__scalar/__model__/__model__.abstract.md +0 -28
- package/templates/module/__model__.abstract.md +0 -28
- package/templates/service/__model__.abstract.md +0 -28
- package/templates/workspaceRoot/patches/react-dom@19.2.7.patch.template +0 -62
- package/workflow.command-nwpcdc8p.js +0 -107
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
App,
|
|
4
|
-
Apps,
|
|
5
|
-
Sys,
|
|
6
|
-
Exec,
|
|
7
|
-
Workspace,
|
|
8
|
-
command
|
|
9
|
-
} from "./index-mak3cd28.js";
|
|
10
|
-
import"./index-q0y2jq9j.js";
|
|
11
|
-
import"./index-2tv3fdx4.js";
|
|
12
|
-
import"./index-6wwzs1bc.js";
|
|
13
|
-
import {
|
|
14
|
-
ApplicationScript
|
|
15
|
-
} from "./index-v0qh106m.js";
|
|
16
|
-
import"./index-259dsnz3.js";
|
|
17
|
-
import"./index-hwkygn9s.js";
|
|
18
|
-
import {
|
|
19
|
-
AbstractDoc
|
|
20
|
-
} from "./index-meh558jy.js";
|
|
21
|
-
import"./index-j9yhg404.js";
|
|
22
|
-
import {
|
|
23
|
-
getMobileTargetChoices
|
|
24
|
-
} from "./index-47pj3aee.js";
|
|
25
|
-
|
|
26
|
-
// pkgs/@akanjs/cli/application/application.command.ts
|
|
27
|
-
import { select } from "@inquirer/prompts";
|
|
28
|
-
var mobileTargetOption = {
|
|
29
|
-
desc: "mobile target name or all",
|
|
30
|
-
ask: "Select mobile target",
|
|
31
|
-
enum: async ({ app }) => await getMobileTargetChoices(app)
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
class ApplicationCommand extends command("application", [ApplicationScript], ({ public: target }) => ({
|
|
35
|
-
createApplication: target({ desc: "Create a new application in the workspace" }).arg("appName", String, { desc: "name of application" }).option("start", Boolean, { desc: "start application", default: false }).with(Workspace).exec(async function(appName, start, workspace) {
|
|
36
|
-
await this.applicationScript.createApplication(appName.toLowerCase().replace(/ /g, "-"), workspace, { start });
|
|
37
|
-
}),
|
|
38
|
-
removeApplication: target({ desc: "Remove an application from the workspace" }).with(App).exec(async function(app) {
|
|
39
|
-
await this.applicationScript.removeApplication(app);
|
|
40
|
-
}),
|
|
41
|
-
planSlice: target({ desc: "List the exact files an app needs to live in a workspace of its own" }).with(App).option("format", String, { desc: "output format", default: "text", enum: ["text", "json"] }).exec(async function(app, format) {
|
|
42
|
-
await this.applicationScript.planSlice(app, format);
|
|
43
|
-
}),
|
|
44
|
-
sync: target({ desc: "Sync dependencies and configuration for an app or library" }).with(Sys).exec(async function(sys) {
|
|
45
|
-
await this.applicationScript.sync(sys);
|
|
46
|
-
}),
|
|
47
|
-
compact: target({ desc: "Compact the *.abstract.md files of an app or library with the AI editor" }).with(Sys).option("module", String, { desc: "single module to compact", nullable: true }).option("minLines", Number, {
|
|
48
|
-
flag: "n",
|
|
49
|
-
desc: "only compact abstracts longer than this",
|
|
50
|
-
default: AbstractDoc.compactMinLines
|
|
51
|
-
}).option("interactive", Boolean, { desc: "confirm or refine each rewrite", default: false }).exec(async function(sys, module, minLines, interactive) {
|
|
52
|
-
await this.applicationScript.compact(sys, { module, minLines, interactive });
|
|
53
|
-
}),
|
|
54
|
-
script: target({ desc: "Run a custom script in the application" }).with(App).arg("filename", String, { desc: "name of script", nullable: true }).exec(async function(app, filename) {
|
|
55
|
-
await this.applicationScript.script(app, filename);
|
|
56
|
-
}),
|
|
57
|
-
console: target({ desc: "Open an interactive server console for the application" }).with(App).exec(async function(app) {
|
|
58
|
-
await this.applicationScript.console(app);
|
|
59
|
-
}),
|
|
60
|
-
logs: target({ desc: "Tail the running application's logs, filtered (attaches to akan-control.sock)" }).with(App).option("level", String, { desc: "minimum level: trace, verbose, debug, info, warn, error", nullable: true }).option("grep", String, { desc: "substring the message must contain", nullable: true }).option("endpoint", String, {
|
|
61
|
-
desc: "endpoint glob(s), comma-separated: mutation:*, query:userList",
|
|
62
|
-
nullable: true
|
|
63
|
-
}).option("trace", String, { desc: "one request's traceId", nullable: true }).option("child", String, { desc: "replica index(es), comma-separated", nullable: true }).option("role", String, { flag: "R", desc: "process role(s): gateway, all, batch, rsc-worker", nullable: true }).option("origin", String, { desc: "call origin(s): http, websocket, mcp, internal, page", nullable: true }).option("since", String, { desc: "only records newer than this: 5m, 30s, or epoch ms", nullable: true }).option("replay", Number, { flag: "n", desc: "records to replay from the buffer before following", default: 0 }).option("json", Boolean, { desc: "print NDJSON records instead of rendered lines", default: false }).option("follow", Boolean, { desc: "keep streaming; pass --follow false for history only", default: true }).option("runtimeDir", String, {
|
|
64
|
-
flag: "d",
|
|
65
|
-
desc: "runtime dir holding akan-control.sock (default: local/apps/<app>/runtime)",
|
|
66
|
-
nullable: true
|
|
67
|
-
}).exec(async function(app, level, grep, endpoint, trace, child, role, origin, since, replay, json, follow, runtimeDir) {
|
|
68
|
-
await this.applicationScript.logs(app, {
|
|
69
|
-
level,
|
|
70
|
-
grep,
|
|
71
|
-
endpoint,
|
|
72
|
-
trace,
|
|
73
|
-
child,
|
|
74
|
-
role,
|
|
75
|
-
origin,
|
|
76
|
-
since,
|
|
77
|
-
replay,
|
|
78
|
-
json,
|
|
79
|
-
follow,
|
|
80
|
-
runtimeDir
|
|
81
|
-
});
|
|
82
|
-
}),
|
|
83
|
-
build: target({ short: true, desc: "Build the application for production (frontend + backend)" }).with(App).option("write", Boolean, { desc: "write code generation", default: true }).option("fast", Boolean, { desc: "fast build", default: false }).option("quiet", Boolean, { desc: "hide build progress output", default: false }).exec(async function(app, write, fast, quiet) {
|
|
84
|
-
await this.applicationScript.build(app, { write, fast, quiet });
|
|
85
|
-
}),
|
|
86
|
-
typecheck: target({ short: true, desc: "Typecheck the application" }).with(App).option("write", Boolean, { desc: "write code generation", default: true }).option("clean", Boolean, { desc: "clear typecheck cache before running", default: false }).option("incremental", Boolean, { desc: "reuse TypeScript incremental cache", default: true }).exec(async function(app, write, clean, incremental) {
|
|
87
|
-
await this.applicationScript.typecheck(app, { write, clean, incremental });
|
|
88
|
-
}),
|
|
89
|
-
test: target({ desc: "Prepare and test an app, library, or package" }).with(Exec).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(exec, write) {
|
|
90
|
-
await this.applicationScript.test(exec, { write });
|
|
91
|
-
}),
|
|
92
|
-
buildIos: target({ short: true, desc: "Build iOS app with Capacitor" }).with(App).option("target", String, mobileTargetOption).option("env", String, {
|
|
93
|
-
enum: ["local", "debug", "develop", "main"],
|
|
94
|
-
desc: "backend environment",
|
|
95
|
-
default: "debug"
|
|
96
|
-
}).option("write", Boolean, { desc: "write code generation", default: true }).option("regenerate", Boolean, { flag: "g", desc: "delete and regenerate native project", default: false }).exec(async function(app, target, env, write, regenerate) {
|
|
97
|
-
await this.applicationScript.buildIos(app, { target, env, write, regenerate });
|
|
98
|
-
}),
|
|
99
|
-
buildAndroid: target({ short: true, desc: "Build Android app with Capacitor" }).with(App).option("target", String, mobileTargetOption).option("env", String, {
|
|
100
|
-
enum: ["local", "debug", "develop", "main"],
|
|
101
|
-
desc: "backend environment",
|
|
102
|
-
default: "debug"
|
|
103
|
-
}).option("write", Boolean, { desc: "write code generation", default: true }).option("regenerate", Boolean, { flag: "g", desc: "delete and regenerate native project", default: false }).exec(async function(app, target, env, write, regenerate) {
|
|
104
|
-
await this.applicationScript.buildAndroid(app, { target, env, write, regenerate });
|
|
105
|
-
}),
|
|
106
|
-
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, {
|
|
107
|
-
desc: "apps to boot at a time (default: what this machine's memory and cores allow)",
|
|
108
|
-
nullable: true
|
|
109
|
-
}).option("dbup", Boolean, { desc: "start the local database first", default: true }).option("open", Boolean, { desc: "open web browser?", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(apps, plain, kill, concurrency, dbup, open, write) {
|
|
110
|
-
await this.applicationScript.start(apps, { plain, kill, concurrency, dbup, open, write });
|
|
111
|
-
}),
|
|
112
|
-
startIos: target({ short: true, desc: "Start iOS app in simulator or device" }).with(App).option("target", String, mobileTargetOption).option("env", String, {
|
|
113
|
-
enum: ["local", "debug", "develop", "main"],
|
|
114
|
-
desc: "backend environment",
|
|
115
|
-
default: "local"
|
|
116
|
-
}).option("open", Boolean, { desc: "open ios simulator", default: false }).option("release", Boolean, { desc: "release mode", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).option("regenerate", Boolean, { flag: "g", desc: "delete and regenerate native project", default: false }).option("noAllowProvisioningUpdates", Boolean, {
|
|
117
|
-
desc: "disable automatic iOS provisioning updates for physical devices",
|
|
118
|
-
default: false
|
|
119
|
-
}).option("device", String, {
|
|
120
|
-
desc: "run target to select non-interactively: udid, device name, or runtime (e.g. 'iPhone 16' or 'iOS 18')",
|
|
121
|
-
default: ""
|
|
122
|
-
}).exec(async function(app, target, env, open, release, write, regenerate, noAllowProvisioningUpdates, device) {
|
|
123
|
-
await this.applicationScript.startIos(app, {
|
|
124
|
-
target,
|
|
125
|
-
env,
|
|
126
|
-
open,
|
|
127
|
-
operation: release ? "release" : "local",
|
|
128
|
-
write,
|
|
129
|
-
regenerate,
|
|
130
|
-
noAllowProvisioningUpdates,
|
|
131
|
-
device: device || undefined
|
|
132
|
-
});
|
|
133
|
-
}),
|
|
134
|
-
startAndroid: target({ short: true, desc: "Start Android app in emulator or device" }).with(App).option("target", String, mobileTargetOption).option("env", String, {
|
|
135
|
-
enum: ["local", "debug", "develop", "main"],
|
|
136
|
-
desc: "backend environment",
|
|
137
|
-
default: "local"
|
|
138
|
-
}).option("release", Boolean, { desc: "release mode", default: false }).option("open", Boolean, { desc: "open android simulator", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).option("regenerate", Boolean, { flag: "g", desc: "delete and regenerate native project", default: false }).exec(async function(app, target, env, release, open, write, regenerate) {
|
|
139
|
-
await this.applicationScript.startAndroid(app, {
|
|
140
|
-
target,
|
|
141
|
-
env,
|
|
142
|
-
open,
|
|
143
|
-
operation: release ? "release" : "local",
|
|
144
|
-
write,
|
|
145
|
-
regenerate
|
|
146
|
-
});
|
|
147
|
-
}),
|
|
148
|
-
releaseIos: target({ desc: "Build and package iOS app for release (App Store)" }).with(App).option("target", String, mobileTargetOption).option("env", String, {
|
|
149
|
-
enum: ["debug", "develop", "main", "local"],
|
|
150
|
-
desc: "backend environment",
|
|
151
|
-
default: "main"
|
|
152
|
-
}).option("write", Boolean, { desc: "write code generation", default: true }).option("regenerate", Boolean, { flag: "g", desc: "delete and regenerate native project", default: false }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow release with --env local", default: false }).exec(async function(app, target, env, write, regenerate, allowLocalRelease) {
|
|
153
|
-
await this.applicationScript.releaseIos(app, {
|
|
154
|
-
target,
|
|
155
|
-
env,
|
|
156
|
-
write,
|
|
157
|
-
regenerate,
|
|
158
|
-
allowLocalRelease
|
|
159
|
-
});
|
|
160
|
-
}),
|
|
161
|
-
releaseAndroid: target({ desc: "Build and package Android app for release (Play Store)" }).with(App).option("assembleType", String, { enum: ["apk", "aab"], default: "apk" }).option("target", String, mobileTargetOption).option("env", String, {
|
|
162
|
-
enum: ["debug", "develop", "main", "local"],
|
|
163
|
-
desc: "backend environment",
|
|
164
|
-
default: "main"
|
|
165
|
-
}).option("write", Boolean, { desc: "write code generation", default: true }).option("regenerate", Boolean, { flag: "g", desc: "delete and regenerate native project", default: false }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow release with --env local", default: false }).exec(async function(app, assembleType, target, env, write, regenerate, allowLocalRelease) {
|
|
166
|
-
await this.applicationScript.releaseAndroid(app, assembleType, {
|
|
167
|
-
target,
|
|
168
|
-
env,
|
|
169
|
-
write,
|
|
170
|
-
regenerate,
|
|
171
|
-
allowLocalRelease
|
|
172
|
-
});
|
|
173
|
-
}),
|
|
174
|
-
releaseSource: target({ desc: "Release app source code with OTA update support" }).with(App).option("rebuild", Boolean, { desc: "rebuild", default: false }).option("buildNum", Number, { desc: "build number", default: 0 }).option("environment", String, { desc: "environment", default: "debug" }).option("local", Boolean, { desc: "local", default: true }).exec(async function(app, rebuild, buildNum, environment, local) {
|
|
175
|
-
await this.applicationScript.releaseSource(app, { rebuild, buildNum, environment, local });
|
|
176
|
-
}),
|
|
177
|
-
codepush: target({ desc: "Deploy over-the-air (OTA) update for mobile app" }).with(App).exec(async function(app) {
|
|
178
|
-
const os = await select({
|
|
179
|
-
message: "Select os",
|
|
180
|
-
choices: [
|
|
181
|
-
{ value: "ios", name: "ios", description: "ios" },
|
|
182
|
-
{ value: "android", name: "android", description: "android" }
|
|
183
|
-
]
|
|
184
|
-
});
|
|
185
|
-
await this.applicationScript.codepush(app, os);
|
|
186
|
-
}),
|
|
187
|
-
dbup: target({ desc: "Start local database services for a database mode" }).with(Workspace).option("mode", String, {
|
|
188
|
-
desc: "database mode",
|
|
189
|
-
default: "multiple",
|
|
190
|
-
enum: ["single", "multiple", "cluster"]
|
|
191
|
-
}).exec(async function(workspace, mode) {
|
|
192
|
-
await this.applicationScript.dbup(workspace, mode);
|
|
193
|
-
}),
|
|
194
|
-
dbdown: target({ desc: "Stop local database services" }).with(Workspace).exec(async function(workspace) {
|
|
195
|
-
await this.applicationScript.dbdown(workspace);
|
|
196
|
-
}),
|
|
197
|
-
configureApp: target({ desc: "Configure application settings interactively" }).with(App).exec(async function(app) {
|
|
198
|
-
await this.applicationScript.configureApp(app);
|
|
199
|
-
})
|
|
200
|
-
})) {
|
|
201
|
-
}
|
|
202
|
-
export {
|
|
203
|
-
ApplicationCommand
|
|
204
|
-
};
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
FileSys
|
|
4
|
-
} from "./index-q0y2jq9j.js";
|
|
5
|
-
import {
|
|
6
|
-
Spinner
|
|
7
|
-
} from "./index-2tv3fdx4.js";
|
|
8
|
-
|
|
9
|
-
// pkgs/@akanjs/devkit/applicationReleasePackager.ts
|
|
10
|
-
import { cp, mkdir, rm } from "fs/promises";
|
|
11
|
-
import path from "path";
|
|
12
|
-
|
|
13
|
-
// pkgs/@akanjs/devkit/uploadRelease.ts
|
|
14
|
-
import { Logger, RestClient } from "akanjs/common";
|
|
15
|
-
var spinning = (message) => {
|
|
16
|
-
const spinner = new Spinner(message, { prefix: message, enableSpin: true }).start();
|
|
17
|
-
return spinner;
|
|
18
|
-
};
|
|
19
|
-
var uploadRelease = async (appName, {
|
|
20
|
-
workspaceRoot,
|
|
21
|
-
environment,
|
|
22
|
-
buildNum,
|
|
23
|
-
platformVersion,
|
|
24
|
-
os,
|
|
25
|
-
local
|
|
26
|
-
}) => {
|
|
27
|
-
const logger = new Logger("uploadRelease");
|
|
28
|
-
const basePath = local ? "http://localhost:8282/backend" : "https://cloud.akanjs.com/backend";
|
|
29
|
-
const httpClient = new RestClient(basePath);
|
|
30
|
-
const buildPath = `${workspaceRoot}/releases/builds/${appName}-release.tar.gz`;
|
|
31
|
-
const appBuildPath = `${workspaceRoot}/releases/builds/${appName}-appBuild.zip`;
|
|
32
|
-
const sourcePath = `${workspaceRoot}/releases/sources/${appName}-source.tar.gz`;
|
|
33
|
-
const readingFilesSpinner = spinning("Reading files...");
|
|
34
|
-
try {
|
|
35
|
-
const buildFile = Bun.file(buildPath);
|
|
36
|
-
const sourceFile = Bun.file(sourcePath);
|
|
37
|
-
const appBuildFile = Bun.file(appBuildPath);
|
|
38
|
-
const buildStat = { mtime: new Date(buildFile.lastModified), size: buildFile.size };
|
|
39
|
-
const sourceStat = { mtime: new Date(sourceFile.lastModified), size: sourceFile.size };
|
|
40
|
-
const appBuildStat = { mtime: new Date(appBuildFile.lastModified), size: appBuildFile.size };
|
|
41
|
-
readingFilesSpinner.succeed("Reading files... done");
|
|
42
|
-
const preparingFormSpinner = spinning("Preparing form data...");
|
|
43
|
-
const formData = new FormData;
|
|
44
|
-
formData.append("files", buildFile, `${appName}-release.tar.gz`);
|
|
45
|
-
formData.append("files", sourceFile, `${appName}-source.tar.gz`);
|
|
46
|
-
formData.append("files", appBuildFile, `${appName}-appBuild.zip`);
|
|
47
|
-
formData.append("metas", JSON.stringify([
|
|
48
|
-
{ lastModifiedAt: buildStat.mtime, size: buildStat.size },
|
|
49
|
-
{ lastModifiedAt: sourceStat.mtime, size: sourceStat.size },
|
|
50
|
-
{ lastModifiedAt: appBuildStat.mtime, size: appBuildStat.size }
|
|
51
|
-
]));
|
|
52
|
-
formData.append("type", "release");
|
|
53
|
-
preparingFormSpinner.succeed("Preparing form data... done");
|
|
54
|
-
try {
|
|
55
|
-
const uploadingFilesSpinner = spinning("Uploading files to server...");
|
|
56
|
-
const [buildFile, sourceFile, appBuildFile] = await httpClient.post("/file/addFiles", formData);
|
|
57
|
-
uploadingFilesSpinner.succeed("Uploading files to server... done");
|
|
58
|
-
const fetchingAppSpinner = spinning(`Fetching dev app information for ${appName}...`);
|
|
59
|
-
const major = platformVersion ? parseInt(platformVersion.split(".")[0]) : 1;
|
|
60
|
-
const minor = platformVersion ? parseInt(platformVersion.split(".")[1]) : 0;
|
|
61
|
-
const patch = platformVersion ? parseInt(platformVersion.split(".")[2]) : 0;
|
|
62
|
-
const devApp = await httpClient.get(`/devApp/devAppInName/${appName}`);
|
|
63
|
-
fetchingAppSpinner.succeed(`Fetching dev app information for ${appName}... done`);
|
|
64
|
-
const pushingReleaseSpinner = spinning(`Pushing release to ${environment} environment...`);
|
|
65
|
-
const release = await httpClient.post(`/release/pushRelease/${devApp.id}/${environment}/${major}/${minor}/${patch}/${sourceFile.id}/${buildFile.id}/${appBuildFile.id}${os ? `/${os}` : ""}`);
|
|
66
|
-
pushingReleaseSpinner.succeed(`Pushing release to ${environment} environment... done`);
|
|
67
|
-
new Spinner(`Successfully pushed release to ${appName}-${environment} server. `, {
|
|
68
|
-
prefix: `Successfully pushed release to ${appName}-${environment} server. `,
|
|
69
|
-
enableSpin: false
|
|
70
|
-
}).succeed(`Successfully pushed release to ${appName}-${environment} server. `);
|
|
71
|
-
return release;
|
|
72
|
-
} catch (e) {
|
|
73
|
-
const errorMessage = e instanceof Error ? e.message : "Unknown error";
|
|
74
|
-
logger.error(`Upload release failed: ${errorMessage}`);
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
} catch (e) {
|
|
78
|
-
const errorMessage = e instanceof Error ? e.message : "Unknown error";
|
|
79
|
-
readingFilesSpinner.fail(`Reading files failed: ${errorMessage}`);
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
// pkgs/@akanjs/devkit/applicationReleasePackager.ts
|
|
85
|
-
class ApplicationReleasePackager {
|
|
86
|
-
#app;
|
|
87
|
-
#build;
|
|
88
|
-
constructor(app, options) {
|
|
89
|
-
this.#app = app;
|
|
90
|
-
this.#build = options.build;
|
|
91
|
-
}
|
|
92
|
-
async releaseSource({
|
|
93
|
-
rebuild,
|
|
94
|
-
buildNum = 0,
|
|
95
|
-
environment = "debug",
|
|
96
|
-
local = true
|
|
97
|
-
} = {}) {
|
|
98
|
-
const { platformVersion } = await this.#prepareReleaseBuild({ rebuild, buildNum });
|
|
99
|
-
await this.#writeSourceArchive({ readme: this.#confidentialReadme() });
|
|
100
|
-
await uploadRelease(this.#app.name, {
|
|
101
|
-
local,
|
|
102
|
-
buildNum,
|
|
103
|
-
environment,
|
|
104
|
-
platformVersion,
|
|
105
|
-
workspaceRoot: this.#app.workspace.cwdPath
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
async compressProjectFiles({ rebuild, buildNum = 0 } = {}) {
|
|
109
|
-
await this.#prepareReleaseBuild({ rebuild, buildNum });
|
|
110
|
-
await this.#writeSourceArchive({ readme: this.#publicReadme() });
|
|
111
|
-
}
|
|
112
|
-
async#prepareReleaseBuild({ rebuild, buildNum }) {
|
|
113
|
-
const akanConfig = await this.#app.getConfig();
|
|
114
|
-
const platformVersion = akanConfig.mobile.version;
|
|
115
|
-
const buildRoot = `${this.#app.workspace.workspaceRoot}/releases/builds/${this.#app.name}`;
|
|
116
|
-
if (await FileSys.dirExists(buildRoot))
|
|
117
|
-
await rm(buildRoot, { recursive: true, force: true });
|
|
118
|
-
await mkdir(buildRoot, { recursive: true });
|
|
119
|
-
if (rebuild || !await FileSys.dirExists(`${this.#app.dist.cwdPath}/backend`))
|
|
120
|
-
await this.#build();
|
|
121
|
-
const buildVersion = `${platformVersion}-${buildNum}`;
|
|
122
|
-
const buildPath = `${buildRoot}/${buildVersion}`;
|
|
123
|
-
await mkdir(buildPath, { recursive: true });
|
|
124
|
-
await cp(`${this.#app.dist.cwdPath}/backend`, `${buildPath}/backend`, { recursive: true });
|
|
125
|
-
await cp(this.#app.dist.cwdPath, buildRoot, { recursive: true });
|
|
126
|
-
await rm(`${buildRoot}/frontend/.next`, { recursive: true, force: true });
|
|
127
|
-
const releaseRoot = this.#app.workspace.workspaceRoot;
|
|
128
|
-
const releaseArchivePath = path.relative(releaseRoot, `${releaseRoot}/releases/builds/${this.#app.name}-release.tar.gz`).split(path.sep).join("/");
|
|
129
|
-
await this.#app.workspace.spawn("tar", ["-zcf", releaseArchivePath, "-C", buildRoot, "./"], { cwd: releaseRoot });
|
|
130
|
-
await this.#writeCsrZipIfPresent();
|
|
131
|
-
return { platformVersion };
|
|
132
|
-
}
|
|
133
|
-
async#writeCsrZipIfPresent() {
|
|
134
|
-
if (!await FileSys.dirExists(`${this.#app.dist.cwdPath}/csr`))
|
|
135
|
-
return;
|
|
136
|
-
await cp(`${this.#app.dist.cwdPath}/csr`, "./csr", { recursive: true });
|
|
137
|
-
await this.#app.workspace.spawn("zip", [
|
|
138
|
-
"-r",
|
|
139
|
-
`${this.#app.workspace.workspaceRoot}/releases/builds/${this.#app.name}-appBuild.zip`,
|
|
140
|
-
"./csr"
|
|
141
|
-
]);
|
|
142
|
-
await rm("./csr", { recursive: true, force: true });
|
|
143
|
-
}
|
|
144
|
-
async#writeSourceArchive({ readme }) {
|
|
145
|
-
const sourceRoot = `${this.#app.workspace.workspaceRoot}/releases/sources/${this.#app.name}`;
|
|
146
|
-
await this.#resetSourceRoot(sourceRoot);
|
|
147
|
-
await cp(this.#app.dist.cwdPath, `${sourceRoot}/apps/${this.#app.name}`, { recursive: true });
|
|
148
|
-
const libDeps = ["social", "shared", "platform", "util"];
|
|
149
|
-
await Promise.all(libDeps.map((lib) => cp(`${this.#app.workspace.cwdPath}/libs/${lib}`, `${sourceRoot}/libs/${lib}`, { recursive: true })));
|
|
150
|
-
await Promise.all([".next", "ios", "android", "public/libs"].map(async (path2) => {
|
|
151
|
-
const targetPath = `${sourceRoot}/apps/${this.#app.name}/${path2}`;
|
|
152
|
-
if (await FileSys.dirExists(targetPath))
|
|
153
|
-
await rm(targetPath, { recursive: true, force: true });
|
|
154
|
-
}));
|
|
155
|
-
const syncPaths = [".husky", ".gitignore", "package.json"];
|
|
156
|
-
await Promise.all(syncPaths.map((path2) => cp(`${this.#app.workspace.cwdPath}/${path2}`, `${sourceRoot}/${path2}`, { recursive: true })));
|
|
157
|
-
await this.#writeSourceTsconfig(sourceRoot, libDeps);
|
|
158
|
-
await Bun.write(`${sourceRoot}/README.md`, readme);
|
|
159
|
-
const sourceCwd = this.#app.workspace.cwdPath;
|
|
160
|
-
const sourceArchivePath = path.relative(sourceCwd, `${sourceCwd}/releases/sources/${this.#app.name}-source.tar.gz`).split(path.sep).join("/");
|
|
161
|
-
await this.#app.workspace.spawn("tar", ["-zcf", sourceArchivePath, "-C", sourceRoot, "./"], { cwd: sourceCwd });
|
|
162
|
-
}
|
|
163
|
-
async#resetSourceRoot(sourceRoot) {
|
|
164
|
-
if (await FileSys.dirExists(sourceRoot)) {
|
|
165
|
-
const maxRetry = 3;
|
|
166
|
-
for (let i = 0;i < maxRetry; i++) {
|
|
167
|
-
try {
|
|
168
|
-
await rm(sourceRoot, { recursive: true, force: true });
|
|
169
|
-
} catch {}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
await mkdir(sourceRoot, { recursive: true });
|
|
173
|
-
}
|
|
174
|
-
async#writeSourceTsconfig(sourceRoot, libDeps) {
|
|
175
|
-
const tsconfig = await this.#app.workspace.readJson("tsconfig.json");
|
|
176
|
-
const pathEntries = [[`@${this.#app.name}/*`, [`apps/${this.#app.name}/*`]]];
|
|
177
|
-
for (const lib of libDeps) {
|
|
178
|
-
pathEntries.push([`@${lib}`, [`libs/${lib}/index.ts`]], [`@${lib}/*`, [`libs/${lib}/*`]]);
|
|
179
|
-
}
|
|
180
|
-
tsconfig.compilerOptions.paths = Object.fromEntries(pathEntries);
|
|
181
|
-
await Bun.write(`${sourceRoot}/tsconfig.json`, JSON.stringify(tsconfig, null, 2));
|
|
182
|
-
}
|
|
183
|
-
#confidentialReadme() {
|
|
184
|
-
return `# ${this.#app.name}
|
|
185
|
-
\uBCF8 \uD504\uB85C\uC81D\uD2B8\uC758 \uC18C\uC2A4\uCF54\uB4DC \uBC0F \uAD00\uB828\uC790\uB8CC\uB294 \uBAA8\uB450 \uBE44\uBC00\uC815\uBCF4\uB85C \uAD00\uB9AC\uB429\uB2C8\uB2E4.
|
|
186
|
-
|
|
187
|
-
## Get Started
|
|
188
|
-
Run the code below.
|
|
189
|
-
\`\`\`
|
|
190
|
-
bun install -g bun
|
|
191
|
-
bun i
|
|
192
|
-
|
|
193
|
-
cat <<EOF >> .env
|
|
194
|
-
# ENV For Server => debug | debug.local | develop | develop.local | main | main.local
|
|
195
|
-
SERVER_ENV=debug.local
|
|
196
|
-
# Run Mode For Server => federation | batch | all
|
|
197
|
-
SERVER_MODE=federation
|
|
198
|
-
# ENV For Client => debug | debug.local | develop | develop.local | main | main.local
|
|
199
|
-
AKAN_PUBLIC_CLIENT_ENV=debug.local
|
|
200
|
-
ANALYZE=false
|
|
201
|
-
EOF
|
|
202
|
-
|
|
203
|
-
akn start-backend ${this.#app.name}
|
|
204
|
-
# or akn start-frontend ${this.#app.name}, etc
|
|
205
|
-
\`\`\`
|
|
206
|
-
|
|
207
|
-
## Build
|
|
208
|
-
Run the code below.
|
|
209
|
-
\`\`\`
|
|
210
|
-
akn build-backend ${this.#app.name}
|
|
211
|
-
# or akn build-frontend ${this.#app.name}, etc
|
|
212
|
-
\`\`\`
|
|
213
|
-
`;
|
|
214
|
-
}
|
|
215
|
-
#publicReadme() {
|
|
216
|
-
return `# ${this.#app.name}
|
|
217
|
-
## Get Started
|
|
218
|
-
Run the code below.
|
|
219
|
-
\`\`\`
|
|
220
|
-
cat <<EOF >> .env
|
|
221
|
-
# ENV For Server => debug | debug.local | develop | develop.local | main | main.local
|
|
222
|
-
SERVER_ENV=debug.local
|
|
223
|
-
# Run Mode For Server => federation | batch | all
|
|
224
|
-
SERVER_MODE=federation
|
|
225
|
-
# ENV For Client => debug | debug.local | develop | develop.local | main | main.local
|
|
226
|
-
AKAN_PUBLIC_CLIENT_ENV=debug.local
|
|
227
|
-
ANALYZE=false
|
|
228
|
-
EOF
|
|
229
|
-
|
|
230
|
-
akan start ${this.#app.name}
|
|
231
|
-
\`\`\`
|
|
232
|
-
|
|
233
|
-
## Build
|
|
234
|
-
Run the code below.
|
|
235
|
-
\`\`\`
|
|
236
|
-
akan build ${this.#app.name}
|
|
237
|
-
# or akn build-frontend ${this.#app.name}, etc
|
|
238
|
-
\`\`\`
|
|
239
|
-
`;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
export {
|
|
243
|
-
ApplicationReleasePackager
|
|
244
|
-
};
|
package/capacitorApp-36rbr858.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
isPlaceholderAppId2,
|
|
4
|
-
CapacitorApp2
|
|
5
|
-
} from "./index-wt7qrtd4.js";
|
|
6
|
-
import"./index-2tv3fdx4.js";
|
|
7
|
-
import"./index-6wwzs1bc.js";
|
|
8
|
-
import"./index-q0y2jq9j.js";
|
|
9
|
-
export {
|
|
10
|
-
CapacitorApp2 as CapacitorApp,
|
|
11
|
-
isPlaceholderAppId2 as isPlaceholderAppId
|
|
12
|
-
};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import"./index-q0y2jq9j.js";
|
|
3
|
-
import {
|
|
4
|
-
GlobalConfig
|
|
5
|
-
} from "./index-kn1h7p1x.js";
|
|
6
|
-
import {
|
|
7
|
-
Workspace,
|
|
8
|
-
command
|
|
9
|
-
} from "./index-mak3cd28.js";
|
|
10
|
-
import"./index-2tv3fdx4.js";
|
|
11
|
-
import"./index-6wwzs1bc.js";
|
|
12
|
-
import"./index-v0qh106m.js";
|
|
13
|
-
import"./index-259dsnz3.js";
|
|
14
|
-
import"./index-hwkygn9s.js";
|
|
15
|
-
import"./index-kcxmv48c.js";
|
|
16
|
-
import"./index-ws5e0j51.js";
|
|
17
|
-
import"./index-2hq52jq3.js";
|
|
18
|
-
import {
|
|
19
|
-
CloudScript
|
|
20
|
-
} from "./index-zry5nz81.js";
|
|
21
|
-
import"./index-j9yhg404.js";
|
|
22
|
-
|
|
23
|
-
// pkgs/@akanjs/cli/cloud/cloud.command.ts
|
|
24
|
-
var localRegistryUrl = () => process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873";
|
|
25
|
-
var resolveRegistryUrl = (registry) => registry === "local" ? localRegistryUrl() : undefined;
|
|
26
|
-
|
|
27
|
-
class CloudCommand extends command("cloud", [CloudScript], ({ public: target }) => ({
|
|
28
|
-
login: target({ desc: "Login to Akan Cloud services" }).option("host", String, { desc: "host of the cloud", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
|
|
29
|
-
await this.cloudScript.login(workspace, host);
|
|
30
|
-
}),
|
|
31
|
-
logout: target({ desc: "Logout from Akan Cloud services" }).option("host", String, { desc: "host of the cloud", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
|
|
32
|
-
await this.cloudScript.logout(workspace, host);
|
|
33
|
-
}),
|
|
34
|
-
setLlm: target({ desc: "Configure LLM (Large Language Model) API key" }).with(Workspace).exec(async function(workspace) {
|
|
35
|
-
await this.cloudScript.setLlm(workspace);
|
|
36
|
-
}),
|
|
37
|
-
resetLlm: target({ desc: "Reset LLM configuration to default" }).with(Workspace).exec(function(workspace) {
|
|
38
|
-
this.cloudScript.resetLlm(workspace);
|
|
39
|
-
}),
|
|
40
|
-
ask: target({
|
|
41
|
-
devOnly: true,
|
|
42
|
-
desc: "Ask AI assistant a question about your project"
|
|
43
|
-
}).option("question", String, { ask: "question to ask" }).with(Workspace).exec(async function(question, workspace) {
|
|
44
|
-
await this.cloudScript.ask(question, workspace);
|
|
45
|
-
}),
|
|
46
|
-
deployAkan: target({
|
|
47
|
-
devOnly: true,
|
|
48
|
-
desc: "Deploy Akan.js framework to cloud (internal use)"
|
|
49
|
-
}).option("test", Boolean, { desc: "test the deployment", default: true }).option("registry", String, {
|
|
50
|
-
desc: "registry target for publishing Akan packages",
|
|
51
|
-
ask: "Select a registry target",
|
|
52
|
-
enum: [
|
|
53
|
-
{ label: "local", value: "local" },
|
|
54
|
-
{ label: "npm", value: "npm" }
|
|
55
|
-
]
|
|
56
|
-
}).with(Workspace).exec(async function(test, registry, workspace) {
|
|
57
|
-
await this.cloudScript.deployAkan(workspace, {
|
|
58
|
-
test,
|
|
59
|
-
registryUrl: resolveRegistryUrl(registry)
|
|
60
|
-
});
|
|
61
|
-
}),
|
|
62
|
-
update: target({ desc: "Update Akan.js framework to the latest version" }).with(Workspace).option("tag", String, {
|
|
63
|
-
desc: "tag of the update",
|
|
64
|
-
default: "latest",
|
|
65
|
-
enum: ["latest", "dev", "canary", "beta", "rc", "alpha"]
|
|
66
|
-
}).option("registry", String, {
|
|
67
|
-
desc: "registry target for resolving Akan packages",
|
|
68
|
-
ask: "Select a registry target",
|
|
69
|
-
enum: [
|
|
70
|
-
{ label: "npm", value: "npm" },
|
|
71
|
-
{ label: "local", value: "local" }
|
|
72
|
-
],
|
|
73
|
-
default: process.env.USE_AKANJS_PKGS === "true" ? undefined : "npm"
|
|
74
|
-
}).exec(async function(workspace, tag, registry) {
|
|
75
|
-
await this.cloudScript.update(workspace, tag, {
|
|
76
|
-
registryUrl: resolveRegistryUrl(registry)
|
|
77
|
-
});
|
|
78
|
-
}),
|
|
79
|
-
downloadEnv: target({
|
|
80
|
-
desc: "Download environment variables from cloud or SCP server"
|
|
81
|
-
}).option("host", String, { desc: "host of the cloud to target", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
|
|
82
|
-
await this.cloudScript.downloadEnv(workspace, undefined, { host });
|
|
83
|
-
}),
|
|
84
|
-
uploadEnv: target({
|
|
85
|
-
desc: "Upload environment variables to cloud or SCP server"
|
|
86
|
-
}).option("host", String, { desc: "host of the cloud to target", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
|
|
87
|
-
await this.cloudScript.uploadEnv(workspace, { host });
|
|
88
|
-
})
|
|
89
|
-
})) {
|
|
90
|
-
}
|
|
91
|
-
export {
|
|
92
|
-
CloudCommand
|
|
93
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
Workspace,
|
|
4
|
-
command
|
|
5
|
-
} from "./index-mak3cd28.js";
|
|
6
|
-
import"./index-q0y2jq9j.js";
|
|
7
|
-
import"./index-2tv3fdx4.js";
|
|
8
|
-
import"./index-6wwzs1bc.js";
|
|
9
|
-
import"./index-by5gpp8x.js";
|
|
10
|
-
import"./index-gyd220p2.js";
|
|
11
|
-
import"./index-ktb5njgy.js";
|
|
12
|
-
import {
|
|
13
|
-
ContextScript
|
|
14
|
-
} from "./index-600zhnve.js";
|
|
15
|
-
import"./index-wt7qrtd4.js";
|
|
16
|
-
import"./index-h7yw2z9n.js";
|
|
17
|
-
import"./index-fz5q3gd7.js";
|
|
18
|
-
import"./index-7737gxcp.js";
|
|
19
|
-
import"./index-kn1h7p1x.js";
|
|
20
|
-
import"./index-8pm30m73.js";
|
|
21
|
-
import"./index-pnqbkf5p.js";
|
|
22
|
-
import"./index-4edzf1gr.js";
|
|
23
|
-
import"./index-rwg2aa4f.js";
|
|
24
|
-
|
|
25
|
-
// pkgs/@akanjs/cli/context/context.command.ts
|
|
26
|
-
class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
|
|
27
|
-
context: target({ desc: "Print agent-readable Akan workspace context" }).option("format", String, {
|
|
28
|
-
desc: "output format",
|
|
29
|
-
default: "markdown",
|
|
30
|
-
enum: ["markdown", "json"]
|
|
31
|
-
}).option("app", String, { desc: "app name to include", nullable: true }).option("module", String, { desc: "module name to include with abstract content", nullable: true }).with(Workspace).exec(async function(format, app, module, workspace) {
|
|
32
|
-
await this.contextScript.context(workspace, { format, app, module });
|
|
33
|
-
}),
|
|
34
|
-
doctor: target({ desc: "Report Akan workspace convention diagnostics" }).option("format", String, {
|
|
35
|
-
desc: "output format",
|
|
36
|
-
default: "text",
|
|
37
|
-
enum: ["text", "json"]
|
|
38
|
-
}).option("strict", Boolean, { desc: "treat recommended conventions as errors", default: false }).option("ios", Boolean, {
|
|
39
|
-
desc: "report iOS/mobile config diagnostics (placeholder bundle ids, etc.)",
|
|
40
|
-
default: false
|
|
41
|
-
}).with(Workspace).exec(async function(format, strict, ios, workspace) {
|
|
42
|
-
await this.contextScript.doctor(workspace, { format, strict, ios });
|
|
43
|
-
}),
|
|
44
|
-
mcpInstall: target({ desc: "Install the Akan MCP server config for Cursor, Claude Code, and Codex" }).arg("target", String, { desc: "cursor, claude, codex, or all", nullable: true }).option("force", Boolean, { desc: "overwrite an existing Akan MCP server entry", default: false }).option("mode", String, {
|
|
45
|
-
desc: "MCP permission mode",
|
|
46
|
-
default: "apply",
|
|
47
|
-
enum: ["readonly", "plan", "apply"]
|
|
48
|
-
}).with(Workspace).exec(async function(targetName, force, mode, workspace) {
|
|
49
|
-
await this.contextScript.mcpInstall(workspace, targetName, {
|
|
50
|
-
force,
|
|
51
|
-
mode
|
|
52
|
-
});
|
|
53
|
-
}),
|
|
54
|
-
mcp: target({ desc: "Start the Akan MCP server over stdio", stdio: true }).option("mode", String, {
|
|
55
|
-
desc: "MCP permission mode",
|
|
56
|
-
default: "readonly",
|
|
57
|
-
enum: ["readonly", "plan", "apply"]
|
|
58
|
-
}).with(Workspace).exec(async function(mode, workspace) {
|
|
59
|
-
await this.contextScript.mcp(workspace, { mode });
|
|
60
|
-
}),
|
|
61
|
-
mcpCall: target({ desc: "Call one Akan MCP tool for debugging without stdio JSON-RPC" }).arg("tool", String, { desc: "MCP tool name" }).option("mode", String, {
|
|
62
|
-
desc: "MCP permission mode",
|
|
63
|
-
default: "readonly",
|
|
64
|
-
enum: ["readonly", "plan", "apply"]
|
|
65
|
-
}).option("args", String, { desc: "JSON object to pass as MCP tool arguments", nullable: true }).option("format", String, {
|
|
66
|
-
desc: "output format",
|
|
67
|
-
default: "json",
|
|
68
|
-
enum: ["json"]
|
|
69
|
-
}).with(Workspace).exec(async function(tool, mode, args, format, workspace) {
|
|
70
|
-
await this.contextScript.mcpCall(workspace, tool, {
|
|
71
|
-
mode,
|
|
72
|
-
args,
|
|
73
|
-
format
|
|
74
|
-
});
|
|
75
|
-
})
|
|
76
|
-
})) {
|
|
77
|
-
}
|
|
78
|
-
export {
|
|
79
|
-
ContextCommand
|
|
80
|
-
};
|
package/devTuiView-c08ccbat.js
DELETED