@akanjs/cli 3.0.0-beta.9 → 3.0.0
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-2vmp9qe0.js +9 -0
- package/CodeAgentRpcHost-p7h6n2hp.js +7 -0
- package/CodeAgentRpcListener-7p7z5dd7.js +97 -0
- package/CodeTui-5ed6bg2a.js +1457 -0
- package/README.ko.md +83 -28
- package/README.md +70 -27
- package/TunnelShare-cwh9ezsm.js +9 -0
- package/{agent.command-0q17pnrs.js → agent.command-gn73rhe7.js} +8 -9
- package/akanCode.js +102 -0
- package/application.command-e968t0hw.js +246 -0
- package/{applicationBuildRunner-kxwbssgn.js → applicationBuildRunner-64taxseg.js} +121 -77
- package/buildBatch.proc.js +120 -32
- package/cloud.command-0jm301rr.js +95 -0
- package/cloud.script-nemnzjpv.js +20 -0
- package/code.command-18kcm7hq.js +154 -0
- package/commandManifest.json +1 -1
- package/consoleToStderr-h5bryj94.js +7 -0
- package/context.command-trd9bn18.js +48 -0
- package/context.runner-y5hwh673.js +21 -0
- package/{dependencyScanner-shs82ynp.js → dependencyScanner-06z2dmrr.js} +2 -2
- package/{devTui-m1atgkc9.js → devTui-q7k7bakd.js} +122 -40
- package/fileSys-wzzrntkw.js +9 -0
- package/guideline.command-bdmdn2de.js +42 -0
- package/guidelines/agentRule/agentRule.instruction.md +154 -26
- package/guidelines/conventions/conventions.instruction.md +134 -48
- package/guidelines/mcpRule/mcpRule.instruction.md +7 -5
- package/guidelines/queryRule/queryRule.instruction.md +21 -7
- package/guidelines/runtimeRule/runtimeRule.instruction.md +291 -6
- package/guidelines/ssrRule/ssrRule.instruction.md +4 -2
- package/guidelines/transportRule/transportRule.instruction.md +10 -8
- package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +20 -0
- package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +66 -3
- package/incrementalBuilder.proc.js +564 -109
- package/index-0wpybxtr.js +2729 -0
- package/{index-kcxmv48c.js → index-2ahj896a.js} +45 -79
- package/index-2wc41k5w.js +49 -0
- package/index-3hx1z96c.js +87 -0
- package/{index-2tv3fdx4.js → index-3w94e7n3.js} +1228 -1458
- package/{index-hwkygn9s.js → index-48k96p55.js} +325 -36
- package/index-4npz05nm.js +187 -0
- package/{index-q0y2jq9j.js → index-52w0fvh8.js} +21 -4
- package/index-6he6gvfg.js +4300 -0
- package/index-7md2g9vw.js +6 -0
- package/{index-04bk599g.js → index-93j60em0.js} +10 -17
- package/index-94s080qm.js +266 -0
- package/index-9dp031by.js +12 -0
- package/{index-ktb5njgy.js → index-9z771ptz.js} +49 -99
- package/{index-y6n8nmny.js → index-abxpehf8.js} +75 -203
- package/{index-3d9y066c.js → index-bjwxs904.js} +9 -8
- package/{index-9077wzd2.js → index-by9pxkr0.js} +43 -26
- package/index-c6eggbee.js +123 -0
- package/index-d2242ksy.js +99 -0
- package/index-drehwpdt.js +1119 -0
- package/{index-92zztqy1.js → index-dy0jx9ay.js} +2 -17
- package/{index-ffvk10zz.js → index-f3c78nd6.js} +107 -241
- package/index-gbggbqcp.js +1058 -0
- package/{index-by5gpp8x.js → index-hj6w4ka1.js} +2 -1
- package/index-hsmtysz4.js +53 -0
- package/{index-j9yhg404.js → index-jmrn54tt.js} +4 -7
- package/{index-a64esmtb.js → index-kcdj1z5v.js} +523 -1022
- package/{index-d43r08tf.js → index-kqabytj7.js} +77 -150
- package/{index-vyvre9en.js → index-mbxbhay5.js} +6 -2
- package/{index-vxtad5bd.js → index-mgxpx3f2.js} +5 -8
- package/index-p6pbz9n5.js +25 -0
- package/{index-sj5vxr8f.js → index-p993efkq.js} +981 -897
- package/{index-2xp0kfkt.js → index-pmhqttv3.js} +37 -25
- package/index-tqm7jjcn.js +700 -0
- package/{index-0g7r8xz3.js → index-vpj42xwt.js} +114 -232
- package/index-wa5jbxj1.js +760 -0
- package/{index-k2j1hc4r.js → index-wprnsjms.js} +12 -12
- package/{index-gyd220p2.js → index-y3mphr1m.js} +554 -577
- package/index-yg7jhz8x.js +69 -0
- package/{index-h7yw2z9n.js → index-zzvvc845.js} +8 -14
- package/index.js +23 -22
- package/{library.command-qzzbj6d8.js → library.command-9h749a1x.js} +4 -5
- package/{localRegistry.command-vyrgg4xw.js → localRegistry.command-2bqqhxyz.js} +23 -43
- package/{module.command-rq5hq3ax.js → module.command-nv8nzgft.js} +8 -12
- package/{package.command-d9hd6v9n.js → package.command-mq4bggp6.js} +6 -7
- package/package.json +15 -7
- package/{page.command-126d56te.js → page.command-j639n707.js} +4 -5
- package/{primitive.command-taxd1538.js → primitive.command-kz6849th.js} +9 -23
- package/prompter-76k56b37.js +8 -0
- package/{quality.command-6gsna0a3.js → quality.command-4hyabwkb.js} +205 -377
- package/{recipeScanner-fpagtgc1.js → recipeScanner-4b69ybe0.js} +1 -1
- package/{repair.command-tq2dgy72.js → repair.command-a9awpbqr.js} +11 -35
- package/{routeSourceValidator-apyqw7wk.js → routeSourceValidator-7ycnfz0e.js} +0 -6
- package/{scalar.command-3bcmrrkv.js → scalar.command-ma4fpm9m.js} +7 -11
- 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-eddzqpx3.js → subspace.command-3k2pmrs4.js} +53 -62
- package/templates/__scalar/__model__/__model__.abstract.md.template +8 -0
- package/templates/app/page/_index.tsx +257 -258
- package/templates/app/page/_layout.tsx +5 -1
- package/templates/app/page/_overrides.tsx +12 -0
- package/templates/app/page/styles.css.template +316 -14
- package/templates/app/public/apple-touch-icon.png +0 -0
- package/templates/app/public/favicon.ico +0 -0
- package/templates/app/public/jelly/cloud.webp +0 -0
- package/templates/app/public/jelly/comet.webp +0 -0
- package/templates/app/public/jelly/moon.webp +0 -0
- package/templates/app/public/jelly/planet.webp +0 -0
- package/templates/app/public/jelly/rocket.webp +0 -0
- package/templates/app/public/jelly/star.webp +0 -0
- package/templates/app/public/jelly/sugar.webp +0 -0
- package/templates/app/public/logo.png +0 -0
- package/templates/app/ui/Recipe/index.ts +9 -0
- package/templates/app/ui/Recipe/jellyButton.ts +63 -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.Unit.tsx +1 -1
- package/templates/appSample/lib/task/Task.Util.tsx +10 -13
- package/templates/appSample/lib/task/Task.View.tsx +2 -2
- package/templates/appSample/lib/task/Task.Zone.tsx +5 -2
- package/templates/appSample/lib/task/task.abstract.ts +12 -32
- package/templates/appSample/lib/task/task.signal.spec.ts +1 -15
- package/templates/appSample/lib/task/task.signal.test.ts +15 -1
- package/templates/appSample/lib/task/task.signal.ts +10 -8
- package/templates/appSample/page/task/[taskId]/_index.tsx +6 -6
- package/templates/appSample/page/task/[taskId]/edit.tsx +5 -4
- package/templates/appSample/page/task/_index.tsx +4 -3
- package/templates/appSample/page/task/_layout.tsx +1 -1
- package/templates/appSample/page/task/new.tsx +5 -4
- package/templates/appSample/srvkit/{AuthGuard.ts → guards.ts} +7 -4
- package/templates/appSample/srvkit/{SessionInternalArg.ts → internalArgs.ts} +6 -4
- package/templates/appSample/ui/GlobalLoading.tsx +2 -1
- package/templates/appSample/ui/QuantityControl.tsx +3 -3
- 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/AGENTS.md.template +6 -0
- package/templates/workspaceRoot/package.json.template +1 -3
- package/tunnel.command-xwr46b66.js +129 -0
- package/{typeChecker-3xgrzc2v.js → typeChecker-px49mezc.js} +1 -1
- package/typecheck.proc.js +1 -1
- package/workflow.command-t7wqe4h7.js +79 -0
- package/{workspace.command-06wvstgr.js → workspace.command-4derhzrh.js} +79 -109
- package/abstractCompactor-gmkc0z8j.js +0 -102
- package/application.command-18y0s485.js +0 -204
- package/applicationReleasePackager-4yasxwv9.js +0 -244
- package/capacitorApp-36rbr858.js +0 -12
- package/cloud.command-av97ndh6.js +0 -94
- package/cloud.script-cm11xjdz.js +0 -20
- package/context.command-5v37ef3n.js +0 -81
- package/devTuiView-0hc2emhe.js +0 -9
- package/getDirname-dr3jz1xg.js +0 -7
- package/guideline.command-4pz9g1rt.js +0 -360
- 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-47pj3aee.js +0 -76
- package/index-5ystnsd5.js +0 -841
- package/index-6wwzs1bc.js +0 -7
- package/index-a17x49vg.js +0 -229
- package/index-m0xccmmm.js +0 -228
- package/index-meh558jy.js +0 -65
- package/index-rtxxan88.js +0 -471
- package/index-te54x9zm.js +0 -338
- 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-gtdnzvbz.js +0 -108
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import"./index-q0y2jq9j.js";
|
|
3
|
-
import"./index-m0xccmmm.js";
|
|
4
|
-
import {
|
|
5
|
-
AiSession
|
|
6
|
-
} from "./index-te54x9zm.js";
|
|
7
|
-
import {
|
|
8
|
-
AbstractDoc
|
|
9
|
-
} from "./index-meh558jy.js";
|
|
10
|
-
|
|
11
|
-
// pkgs/@akanjs/devkit/abstractCompactor.ts
|
|
12
|
-
import { Logger } from "akanjs/common";
|
|
13
|
-
import chalk from "chalk";
|
|
14
|
-
class AbstractCompactor {
|
|
15
|
-
static #reviewRequest = `Review the compacted file you just wrote against the original.
|
|
16
|
-
- Did you drop an invariant, a security reason, or a workflow step that the source files cannot show by themselves? Restore it.
|
|
17
|
-
- Did you keep anything that only restates code, scaffold wording, or history? Remove it.
|
|
18
|
-
- Is it in the same language as the original, within the line budget, and one short line per bullet?
|
|
19
|
-
Respond with exactly one \`\`\`markdown code block holding the corrected file and nothing else. If nothing needs to change, repeat the file unchanged.`;
|
|
20
|
-
#sys;
|
|
21
|
-
#minLines;
|
|
22
|
-
#interactive;
|
|
23
|
-
constructor(sys, { minLines = AbstractDoc.compactMinLines, interactive = false } = {}) {
|
|
24
|
-
this.#sys = sys;
|
|
25
|
-
this.#minLines = minLines;
|
|
26
|
-
this.#interactive = interactive;
|
|
27
|
-
}
|
|
28
|
-
async compactAll({ module } = {}) {
|
|
29
|
-
const docs = await AbstractDoc.findAll(this.#sys, { module });
|
|
30
|
-
const targets = docs.filter((doc) => doc.lineCount > this.#minLines);
|
|
31
|
-
const reports = [];
|
|
32
|
-
for (const doc of targets)
|
|
33
|
-
reports.push(await this.compact(doc));
|
|
34
|
-
return { scanned: docs.length, reports };
|
|
35
|
-
}
|
|
36
|
-
async compact(doc) {
|
|
37
|
-
const session = new AiSession("compactAbstract", {
|
|
38
|
-
workspace: this.#sys.workspace,
|
|
39
|
-
cacheKey: `${this.#sys.name}-${doc.moduleName}`
|
|
40
|
-
});
|
|
41
|
-
const approve = !this.#interactive;
|
|
42
|
-
const compacted = await session.editMarkdown(this.#request(doc), { approve });
|
|
43
|
-
const reviewed = await session.editMarkdown(AbstractCompactor.#reviewRequest, { approve });
|
|
44
|
-
const next = [reviewed, compacted].map((candidate) => candidate.trim()).find((candidate) => doc.canReplaceWith(candidate));
|
|
45
|
-
const beforeLines = doc.lineCount;
|
|
46
|
-
if (!next) {
|
|
47
|
-
Logger.rawLog(chalk.yellow(`${doc.path}: the editor returned no shorter abstract, keeping the current file`));
|
|
48
|
-
return { path: doc.path, beforeLines, afterLines: beforeLines, status: "failed" };
|
|
49
|
-
}
|
|
50
|
-
if (next === doc.content.trim())
|
|
51
|
-
return { path: doc.path, beforeLines, afterLines: beforeLines, status: "unchanged" };
|
|
52
|
-
const content = `${next}
|
|
53
|
-
`;
|
|
54
|
-
await this.#sys.writeFile(doc.path, content);
|
|
55
|
-
return { path: doc.path, beforeLines, afterLines: AbstractDoc.lineCountOf(content), status: "compacted" };
|
|
56
|
-
}
|
|
57
|
-
#targetShape(kind) {
|
|
58
|
-
if (kind === "other")
|
|
59
|
-
return " - keep the headings that still carry information and drop the rest; do not impose a new structure";
|
|
60
|
-
return [
|
|
61
|
-
" - `# <name> Abstract` title line",
|
|
62
|
-
" - one declarative sentence naming what this module owns",
|
|
63
|
-
" - `## Rules` \u2014 two to five bullets, each an invariant the code cannot show by itself",
|
|
64
|
-
" - optional `## Workflow` \u2014 the lifecycle as an arrow chain (`draft -> signed -> active`) or a few bullets"
|
|
65
|
-
].join(`
|
|
66
|
-
`);
|
|
67
|
-
}
|
|
68
|
-
#request(doc) {
|
|
69
|
-
return `You are compacting an Akan.js abstract file.
|
|
70
|
-
|
|
71
|
-
An abstract is the summary a coding agent reads before changing a module. Repeated edits have made this one
|
|
72
|
-
bloated, and it has to shrink back to what the source files cannot show by themselves.
|
|
73
|
-
|
|
74
|
-
# Target file
|
|
75
|
-
${this.#sys.type}s/${this.#sys.name}/${doc.path} (${doc.kind} module "${doc.moduleName}", ${doc.lineCount} lines)
|
|
76
|
-
|
|
77
|
-
# Source files in the same folder
|
|
78
|
-
${doc.siblingFiles.join(", ") || "none"}
|
|
79
|
-
|
|
80
|
-
# Current content
|
|
81
|
-
\`\`\`markdown
|
|
82
|
-
${doc.content}
|
|
83
|
-
\`\`\`
|
|
84
|
-
|
|
85
|
-
# Rules for the compacted file
|
|
86
|
-
- Write it in the SAME language as the current content. Never translate.
|
|
87
|
-
- Keep every invariant, constraint, security reason, and workflow step that the source files cannot show by
|
|
88
|
-
themselves. Merge duplicates instead of dropping either one.
|
|
89
|
-
- Delete what the code already states: field lists, types, labels, signatures, file lists, and imports.
|
|
90
|
-
- Delete scaffold and placeholder wording, changelog or migration history, TODOs, and any instruction about
|
|
91
|
-
reading or updating this file.
|
|
92
|
-
- Never invent a rule that the current content does not state.
|
|
93
|
-
- Keep every bullet to one short line, and stay under ${AbstractDoc.compactMinLines} lines in total.
|
|
94
|
-
- Shape:
|
|
95
|
-
${this.#targetShape(doc.kind)}
|
|
96
|
-
|
|
97
|
-
Respond with exactly one \`\`\`markdown code block holding the whole new file and nothing else.`;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
export {
|
|
101
|
-
AbstractCompactor
|
|
102
|
-
};
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
App,
|
|
4
|
-
Apps,
|
|
5
|
-
Sys,
|
|
6
|
-
Exec,
|
|
7
|
-
Workspace,
|
|
8
|
-
command
|
|
9
|
-
} from "./index-0g7r8xz3.js";
|
|
10
|
-
import"./index-q0y2jq9j.js";
|
|
11
|
-
import"./index-2tv3fdx4.js";
|
|
12
|
-
import"./index-6wwzs1bc.js";
|
|
13
|
-
import {
|
|
14
|
-
ApplicationScript
|
|
15
|
-
} from "./index-sj5vxr8f.js";
|
|
16
|
-
import"./index-vxtad5bd.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,94 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import"./index-q0y2jq9j.js";
|
|
3
|
-
import {
|
|
4
|
-
GlobalConfig
|
|
5
|
-
} from "./index-m0xccmmm.js";
|
|
6
|
-
import {
|
|
7
|
-
Workspace,
|
|
8
|
-
command
|
|
9
|
-
} from "./index-0g7r8xz3.js";
|
|
10
|
-
import"./index-2tv3fdx4.js";
|
|
11
|
-
import"./index-6wwzs1bc.js";
|
|
12
|
-
import"./index-te54x9zm.js";
|
|
13
|
-
import"./index-sj5vxr8f.js";
|
|
14
|
-
import"./index-vxtad5bd.js";
|
|
15
|
-
import"./index-hwkygn9s.js";
|
|
16
|
-
import"./index-kcxmv48c.js";
|
|
17
|
-
import"./index-9077wzd2.js";
|
|
18
|
-
import"./index-rtxxan88.js";
|
|
19
|
-
import {
|
|
20
|
-
CloudScript2
|
|
21
|
-
} from "./index-2xp0kfkt.js";
|
|
22
|
-
import"./index-j9yhg404.js";
|
|
23
|
-
|
|
24
|
-
// pkgs/@akanjs/cli/cloud/cloud.command.ts
|
|
25
|
-
var localRegistryUrl = () => process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873";
|
|
26
|
-
var resolveRegistryUrl = (registry) => registry === "local" ? localRegistryUrl() : undefined;
|
|
27
|
-
|
|
28
|
-
class CloudCommand extends command("cloud", [CloudScript2], ({ public: target }) => ({
|
|
29
|
-
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) {
|
|
30
|
-
await this.cloudScript.login(workspace, host);
|
|
31
|
-
}),
|
|
32
|
-
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) {
|
|
33
|
-
await this.cloudScript.logout(workspace, host);
|
|
34
|
-
}),
|
|
35
|
-
setLlm: target({ desc: "Configure LLM (Large Language Model) API key" }).with(Workspace).exec(async function(workspace) {
|
|
36
|
-
await this.cloudScript.setLlm(workspace);
|
|
37
|
-
}),
|
|
38
|
-
resetLlm: target({ desc: "Reset LLM configuration to default" }).with(Workspace).exec(function(workspace) {
|
|
39
|
-
this.cloudScript.resetLlm(workspace);
|
|
40
|
-
}),
|
|
41
|
-
ask: target({
|
|
42
|
-
devOnly: true,
|
|
43
|
-
desc: "Ask AI assistant a question about your project"
|
|
44
|
-
}).option("question", String, { ask: "question to ask" }).with(Workspace).exec(async function(question, workspace) {
|
|
45
|
-
await this.cloudScript.ask(question, workspace);
|
|
46
|
-
}),
|
|
47
|
-
deployAkan: target({
|
|
48
|
-
devOnly: true,
|
|
49
|
-
desc: "Deploy Akan.js framework to cloud (internal use)"
|
|
50
|
-
}).option("test", Boolean, { desc: "test the deployment", default: true }).option("registry", String, {
|
|
51
|
-
desc: "registry target for publishing Akan packages",
|
|
52
|
-
ask: "Select a registry target",
|
|
53
|
-
enum: [
|
|
54
|
-
{ label: "local", value: "local" },
|
|
55
|
-
{ label: "npm", value: "npm" }
|
|
56
|
-
]
|
|
57
|
-
}).with(Workspace).exec(async function(test, registry, workspace) {
|
|
58
|
-
await this.cloudScript.deployAkan(workspace, {
|
|
59
|
-
test,
|
|
60
|
-
registryUrl: resolveRegistryUrl(registry)
|
|
61
|
-
});
|
|
62
|
-
}),
|
|
63
|
-
update: target({ desc: "Update Akan.js framework to the latest version" }).with(Workspace).option("tag", String, {
|
|
64
|
-
desc: "tag of the update",
|
|
65
|
-
default: "latest",
|
|
66
|
-
enum: ["latest", "dev", "canary", "beta", "rc", "alpha"]
|
|
67
|
-
}).option("registry", String, {
|
|
68
|
-
desc: "registry target for resolving Akan packages",
|
|
69
|
-
ask: "Select a registry target",
|
|
70
|
-
enum: [
|
|
71
|
-
{ label: "npm", value: "npm" },
|
|
72
|
-
{ label: "local", value: "local" }
|
|
73
|
-
],
|
|
74
|
-
default: process.env.USE_AKANJS_PKGS === "true" ? undefined : "npm"
|
|
75
|
-
}).exec(async function(workspace, tag, registry) {
|
|
76
|
-
await this.cloudScript.update(workspace, tag, {
|
|
77
|
-
registryUrl: resolveRegistryUrl(registry)
|
|
78
|
-
});
|
|
79
|
-
}),
|
|
80
|
-
downloadEnv: target({
|
|
81
|
-
desc: "Download environment variables from cloud or SCP server"
|
|
82
|
-
}).option("host", String, { desc: "host of the cloud to target", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
|
|
83
|
-
await this.cloudScript.downloadEnv(workspace, undefined, { host });
|
|
84
|
-
}),
|
|
85
|
-
uploadEnv: target({
|
|
86
|
-
desc: "Upload environment variables to cloud or SCP server"
|
|
87
|
-
}).option("host", String, { desc: "host of the cloud to target", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
|
|
88
|
-
await this.cloudScript.uploadEnv(workspace, { host });
|
|
89
|
-
})
|
|
90
|
-
})) {
|
|
91
|
-
}
|
|
92
|
-
export {
|
|
93
|
-
CloudCommand
|
|
94
|
-
};
|