@akanjs/cli 3.0.0-alpha.9 → 3.0.0-alpha.90
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/README.ko.md +1 -1
- package/README.md +1 -1
- package/{abstractCompactor-e5yq60qz.js → abstractCompactor-cefxzggj.js} +3 -5
- package/{agent.command-f0gqkfgz.js → agent.command-r93wmq7m.js} +11 -13
- package/{application.command-x903m2qq.js → application.command-5nqfqgdn.js} +62 -38
- package/{applicationBuildRunner-ha3y8ew8.js → applicationBuildRunner-b21m07fs.js} +23 -20
- package/{applicationReleasePackager-gg8ccbeh.js → applicationReleasePackager-3wh58n2m.js} +8 -9
- package/buildBatch.proc.js +12 -14
- package/capacitorApp-gzcx6txb.js +12 -0
- package/{cloud.command-zs6kyf83.js → cloud.command-g0pk0k60.js} +15 -18
- package/commandManifest.json +1 -1
- package/{context.command-fmepgjzg.js → context.command-qd8kqrnh.js} +19 -23
- package/dependencyScanner-shs82ynp.js +8 -0
- package/devTui-2xf0meaq.js +552 -0
- package/devTuiView-7jy8f30g.js +9 -0
- package/getDirname-dr3jz1xg.js +7 -0
- package/{guideline.command-n6sw0a0c.js → guideline.command-f38x8jhw.js} +16 -18
- package/guidelines/agentRule/agentRule.generate.json +31 -0
- package/guidelines/agentRule/agentRule.instruction.md +533 -0
- package/guidelines/conventions/conventions.instruction.md +406 -197
- package/guidelines/cssRule/cssRule.instruction.md +7 -0
- package/guidelines/framework/framework.generate.json +3 -2
- package/guidelines/framework/framework.instruction.md +1 -9
- package/guidelines/mcpRule/mcpRule.generate.json +25 -0
- package/guidelines/mcpRule/mcpRule.instruction.md +217 -0
- package/guidelines/modelStore/modelStore.instruction.md +12 -0
- package/guidelines/modelTemplate/modelTemplate.instruction.md +5 -0
- package/guidelines/queryRule/queryRule.generate.json +31 -0
- package/guidelines/queryRule/queryRule.instruction.md +143 -0
- package/guidelines/runtimeRule/runtimeRule.generate.json +25 -0
- package/guidelines/runtimeRule/runtimeRule.instruction.md +213 -0
- package/guidelines/ssrRule/ssrRule.instruction.md +49 -5
- package/guidelines/transportRule/transportRule.generate.json +31 -0
- package/guidelines/transportRule/transportRule.instruction.md +60 -0
- package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +51 -760
- package/guidelines/workspaceRecipes/workspaceRecipes.generate.json +33 -0
- package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +402 -0
- package/incrementalBuilder.proc.js +26 -25
- package/{index-774gcx29.js → index-0emb9eat.js} +41 -34
- package/index-3d9y066c.js +76 -0
- package/{index-3vta1tqa.js → index-3vvbv974.js} +32 -32
- package/{index-76rn3g2c.js → index-47pj3aee.js} +4 -4
- package/{index-y4vkyhvv.js → index-5xdqxbn9.js} +14 -14
- package/{index-1577bej2.js → index-6wwzs1bc.js} +2 -2
- package/{index-wnp7hwq7.js → index-92zztqy1.js} +7 -7
- package/{index-jhpa13zj.js → index-9bwhxrqf.js} +57 -57
- package/{index-bjpxzr6s.js → index-9wtbw98m.js} +6 -3
- package/{index-fgc8r6dj.js → index-a5vmm6x4.js} +3 -1
- package/{index-xys926f2.js → index-by5gpp8x.js} +4 -4
- package/{index-kdh76j26.js → index-cezy7yb3.js} +100 -32
- package/{index-62955kn5.js → index-d61rcfa2.js} +758 -127
- package/{index-82jrh4hj.js → index-deekbtkj.js} +13 -13
- package/{index-rxkpk7n4.js → index-e82dyeqy.js} +4 -4
- package/{index-qzdjd4ct.js → index-h759vjfa.js} +18 -18
- package/{index-j37qq1f2.js → index-h7yw2z9n.js} +7 -7
- package/{index-qb61h0k7.js → index-jydtyzva.js} +1098 -1360
- package/{index-46tjzh6s.js → index-kcxmv48c.js} +29 -29
- package/{index-4m0bphac.js → index-kfnr6c19.js} +31 -30
- package/{index-xmmzf150.js → index-mpmyqm1y.js} +1 -1
- package/{index-xjd3rqzj.js → index-n68jx79w.js} +6 -15
- package/{index-0cj2zxbm.js → index-n85fer99.js} +12 -11
- package/{index-779ske1y.js → index-pgsswppj.js} +27 -27
- package/index-pvb4vdwr.js +159 -0
- package/{index-67546d0j.js → index-q0y2jq9j.js} +14 -2
- package/{index-z8ptfkzv.js → index-q8sn827n.js} +969 -240
- package/{index-5sn5w2mt.js → index-r50qen0z.js} +94 -61
- package/{index-eyyf2149.js → index-rntcdss1.js} +36 -37
- package/{index-gcv8ncfh.js → index-sjak5v5b.js} +16 -12
- package/{index-j9cxndc0.js → index-w8kmx1b6.js} +20 -11
- package/{index-jf2ya7r2.js → index-y74k5anj.js} +8 -8
- package/{index-d43t8af2.js → index-zkvpaggp.js} +58 -25
- package/index.js +22 -25
- package/{library.command-cv9gdbmg.js → library.command-em103wtn.js} +11 -10
- package/{localRegistry.command-d8fg36zc.js → localRegistry.command-gz8apn4y.js} +20 -23
- package/{module.command-qyr1s9cn.js → module.command-451pztkc.js} +13 -16
- package/{package.command-wsjx0k47.js → package.command-rfhyf38t.js} +8 -10
- package/package.json +5 -7
- package/{page.command-rdzg65rm.js → page.command-kt19da5g.js} +7 -9
- package/{primitive.command-89g38b53.js → primitive.command-pgy69ere.js} +13 -16
- package/{quality.command-0cs2z92d.js → quality.command-gpe2vqb5.js} +226 -105
- package/recipeScanner-fpagtgc1.js +11 -0
- package/{repair.command-6fphxfwj.js → repair.command-2sbrz187.js} +12 -14
- package/{routeSourceValidator-e4jmbfcx.js → routeSourceValidator-ze6x894c.js} +0 -2
- package/{scalar.command-xfer69s6.js → scalar.command-jcf4e5sv.js} +11 -14
- package/subspace.command-kqzqtk0p.js +755 -0
- package/templates/app/env/env.client.debug.ts.template +1 -5
- package/templates/app/env/env.client.develop.ts.template +1 -5
- package/templates/app/env/env.client.local.ts.template +1 -5
- package/templates/app/env/env.client.main.ts.template +1 -5
- package/templates/app/env/env.client.testing.ts.template +1 -5
- package/templates/app/env/env.client.type.ts +2 -6
- package/templates/app/env/env.server.debug.ts.template +1 -5
- package/templates/app/env/env.server.develop.ts.template +1 -5
- package/templates/app/env/env.server.local.ts.template +1 -5
- package/templates/app/env/env.server.main.ts.template +1 -5
- package/templates/app/main.ts +3 -1
- package/templates/appSample/lib/task/task.signal.ts +11 -6
- package/templates/appSample/srvkit/AuthGuard.ts +9 -5
- package/templates/appSample/srvkit/SessionInternalArg.ts +4 -3
- package/templates/crudPages/[__model__Id]/edit/page.tsx +5 -5
- package/templates/crudPages/[__model__Id]/page.tsx +10 -13
- package/templates/crudPages/new/page.tsx +5 -5
- package/templates/crudPages/page.tsx +9 -9
- package/templates/crudSinglePage/page.tsx +11 -7
- package/templates/env/_env.server.type.ts +7 -5
- package/templates/lib/db.ts +1 -1
- package/templates/lib/dict.ts +1 -1
- package/templates/lib/sig.ts +1 -1
- package/templates/lib/srv.ts +6 -2
- package/templates/module/__model__.dictionary.ts +4 -1
- package/templates/module/__model__.signal.ts +2 -3
- package/templates/module/__model__.store.ts +1 -2
- package/templates/workspaceRoot/.gitignore.template +0 -1
- package/templates/workspaceRoot/.husky/pre-commit.template +16 -0
- package/templates/workspaceRoot/.vscode/settings.json.template +1 -1
- package/templates/workspaceRoot/AGENTS.md.template +4 -0
- package/templates/workspaceRoot/CLAUDE.md.template +19 -0
- package/templates/workspaceRoot/biome.json.template +2 -1
- package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +10 -14
- package/templates/workspaceRoot/docs/GENERATED.md.template +12 -10
- package/templates/workspaceRoot/package.json.template +2 -4
- package/typeChecker-3xgrzc2v.js +7 -0
- package/typecheck.proc.js +4 -5
- package/{workflow.command-2ygfqt4f.js → workflow.command-m4z25a2p.js} +22 -25
- package/{workspace.command-88m0zs64.js → workspace.command-dqgj9zbk.js} +96 -81
- package/capacitorApp-9xswcgx7.js +0 -61
- package/dependencyScanner-f6grrep3.js +0 -9
- package/getDirname-m9s0cmhq.js +0 -8
- package/index-mxvakhsm.js +0 -66
- package/index-r24hmh0q.js +0 -4
- package/recipeScanner-tghkzrrt.js +0 -12
- package/typeChecker-kravn7ns.js +0 -8
- /package/{index-0wae5ebk.js → index-meh558jy.js} +0 -0
- /package/{index-ss469dec.js → index-nz8prx9g.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
FileSys
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-q0y2jq9j.js";
|
|
5
5
|
|
|
6
6
|
// pkgs/@akanjs/devkit/dependencyScanner.ts
|
|
7
7
|
import { builtinModules } from "module";
|
|
@@ -9,39 +9,41 @@ import * as path from "path";
|
|
|
9
9
|
import ignore from "ignore";
|
|
10
10
|
import ts from "typescript";
|
|
11
11
|
var testFileRegex = /\.(?:test|spec)\.[cm]?[tj]sx?$/;
|
|
12
|
+
var skipDirs = ["node_modules", "dist", "build", ".git", ".next", "public", "ios", "android", "__fixtures__"];
|
|
13
|
+
var isSkippedPath = (filePath) => skipDirs.some((dir) => filePath.includes(`/${dir}/`) || filePath.startsWith(`${dir}/`));
|
|
12
14
|
var builtinModuleSet = new Set([...builtinModules, ...builtinModules.map((mod) => `node:${mod}`)]);
|
|
13
15
|
var stripShebang = (source) => source.replace(/^#!.*(?:\r?\n|$)/, "");
|
|
14
16
|
|
|
15
|
-
class
|
|
17
|
+
class TypeScriptDependencyScanner2 {
|
|
16
18
|
#fileDependencies = new Map;
|
|
17
19
|
#fileRuntimeDependencies = new Map;
|
|
18
20
|
#fileTypeDependencies = new Map;
|
|
19
21
|
#visitedFiles = new Set;
|
|
20
22
|
#tsTranspiler = new Bun.Transpiler({ loader: "ts" });
|
|
21
23
|
#tsxTranspiler = new Bun.Transpiler({ loader: "tsx" });
|
|
22
|
-
directory;
|
|
23
|
-
rootPackageJson;
|
|
24
|
-
ig;
|
|
25
|
-
workspaceRoot;
|
|
24
|
+
#directory;
|
|
25
|
+
#rootPackageJson;
|
|
26
|
+
#ig;
|
|
27
|
+
#workspaceRoot;
|
|
26
28
|
constructor(directory, {
|
|
27
29
|
workspaceRoot,
|
|
28
30
|
rootPackageJson,
|
|
29
31
|
gitignorePatterns = []
|
|
30
32
|
}) {
|
|
31
|
-
this
|
|
32
|
-
this
|
|
33
|
-
this
|
|
34
|
-
this
|
|
33
|
+
this.#directory = directory;
|
|
34
|
+
this.#rootPackageJson = rootPackageJson;
|
|
35
|
+
this.#ig = ignore().add(gitignorePatterns);
|
|
36
|
+
this.#workspaceRoot = workspaceRoot;
|
|
35
37
|
}
|
|
36
38
|
async getMonorepoDependencies(projectName, { pkgs = [], libs = [] } = {}) {
|
|
37
|
-
const npmSet = new Set(Object.keys({ ...this
|
|
39
|
+
const npmSet = new Set(Object.keys({ ...this.#rootPackageJson.dependencies, ...this.#rootPackageJson.devDependencies }));
|
|
38
40
|
const pkgPathSet = new Set(pkgs);
|
|
39
41
|
const libPathSet = new Set(libs.map((lib) => `@libs/${lib}`));
|
|
40
42
|
await this.getDependencies();
|
|
41
43
|
const [npmDepSet, pkgPathDepSet, libPathDepSet] = this.#getImportSetsFromDependencies([npmSet, pkgPathSet, libPathSet], this.#fileRuntimeDependencies);
|
|
42
44
|
const [npmDevDepSet] = this.#getImportSetsFromDependencies([npmSet], this.#fileTypeDependencies);
|
|
43
45
|
const pkgDeps = [...pkgPathDepSet];
|
|
44
|
-
const libDeps = [...libPathDepSet].map((
|
|
46
|
+
const libDeps = [...libPathDepSet].map((path) => path.replace("@libs/", "")).filter((libName) => libName !== projectName);
|
|
45
47
|
return {
|
|
46
48
|
pkgDeps,
|
|
47
49
|
libDeps,
|
|
@@ -52,11 +54,11 @@ class TypeScriptDependencyScanner {
|
|
|
52
54
|
async getPackageBuildDependencies(projectName) {
|
|
53
55
|
const runtimeDeps = new Set;
|
|
54
56
|
const devDeps = new Set;
|
|
55
|
-
const sourceFiles = await this.#findTypeScriptFiles(this
|
|
57
|
+
const sourceFiles = await this.#findTypeScriptFiles(this.#directory, {
|
|
56
58
|
excludeBuildFiles: true,
|
|
57
59
|
excludeTestFiles: true
|
|
58
60
|
});
|
|
59
|
-
const cssFiles = await this.#findCssFiles(this
|
|
61
|
+
const cssFiles = await this.#findCssFiles(this.#directory);
|
|
60
62
|
for (const filePath of sourceFiles) {
|
|
61
63
|
const fileContent = await FileSys.readText(filePath);
|
|
62
64
|
const { imports, typeImports } = this.#extractImports(fileContent, filePath);
|
|
@@ -67,7 +69,7 @@ class TypeScriptDependencyScanner {
|
|
|
67
69
|
const fileContent = await FileSys.readText(filePath);
|
|
68
70
|
this.#addNormalizedImports(runtimeDeps, this.#extractCssPluginImports(fileContent), projectName);
|
|
69
71
|
}
|
|
70
|
-
const buildFilePath = path.join(this
|
|
72
|
+
const buildFilePath = path.join(this.#directory, "build.ts");
|
|
71
73
|
if (await FileSys.fileExists(buildFilePath)) {
|
|
72
74
|
const fileContent = await FileSys.readText(buildFilePath);
|
|
73
75
|
const { imports, typeImports } = this.#extractImports(fileContent, buildFilePath);
|
|
@@ -75,7 +77,7 @@ class TypeScriptDependencyScanner {
|
|
|
75
77
|
}
|
|
76
78
|
for (const dep of runtimeDeps)
|
|
77
79
|
devDeps.delete(dep);
|
|
78
|
-
const rootDeps = { ...this
|
|
80
|
+
const rootDeps = { ...this.#rootPackageJson.dependencies, ...this.#rootPackageJson.devDependencies };
|
|
79
81
|
const missingDeps = [];
|
|
80
82
|
for (const dep of [...runtimeDeps, ...devDeps]) {
|
|
81
83
|
if (rootDeps[dep] || await this.#hasWorkspacePackage(dep))
|
|
@@ -89,7 +91,7 @@ class TypeScriptDependencyScanner {
|
|
|
89
91
|
};
|
|
90
92
|
}
|
|
91
93
|
async#hasWorkspacePackage(dep) {
|
|
92
|
-
const packageJsonPath = path.join(this
|
|
94
|
+
const packageJsonPath = path.join(this.#workspaceRoot, "pkgs", dep, "package.json");
|
|
93
95
|
if (!await Bun.file(packageJsonPath).exists())
|
|
94
96
|
return false;
|
|
95
97
|
try {
|
|
@@ -132,9 +134,9 @@ class TypeScriptDependencyScanner {
|
|
|
132
134
|
this.#fileRuntimeDependencies.clear();
|
|
133
135
|
this.#fileTypeDependencies.clear();
|
|
134
136
|
this.#visitedFiles.clear();
|
|
135
|
-
const files = await this.#findTypeScriptFiles(this
|
|
137
|
+
const files = await this.#findTypeScriptFiles(this.#directory);
|
|
136
138
|
for (const file of files)
|
|
137
|
-
await this.#analyzeFile(file, this
|
|
139
|
+
await this.#analyzeFile(file, this.#directory);
|
|
138
140
|
return this.#fileDependencies;
|
|
139
141
|
}
|
|
140
142
|
async#findTypeScriptFiles(directory, {
|
|
@@ -142,18 +144,17 @@ class TypeScriptDependencyScanner {
|
|
|
142
144
|
excludeTestFiles = false
|
|
143
145
|
} = {}) {
|
|
144
146
|
const files = [];
|
|
145
|
-
const skipDirs = ["node_modules", "dist", "build", ".git", ".next", "public", "ios", "android"];
|
|
146
147
|
const glob = new Bun.Glob("**/*.{ts,tsx}");
|
|
147
148
|
for await (const filePath of glob.scan({ cwd: directory, onlyFiles: true })) {
|
|
148
|
-
if (
|
|
149
|
+
if (isSkippedPath(filePath))
|
|
149
150
|
continue;
|
|
150
151
|
if (excludeBuildFiles && filePath === "build.ts")
|
|
151
152
|
continue;
|
|
152
153
|
if (excludeTestFiles && testFileRegex.test(filePath))
|
|
153
154
|
continue;
|
|
154
155
|
const fullPath = path.join(directory, filePath);
|
|
155
|
-
const relativePath = path.relative(this
|
|
156
|
-
if (this
|
|
156
|
+
const relativePath = path.relative(this.#workspaceRoot, fullPath);
|
|
157
|
+
if (this.#ig.ignores(relativePath))
|
|
157
158
|
continue;
|
|
158
159
|
files.push(fullPath);
|
|
159
160
|
}
|
|
@@ -161,14 +162,13 @@ class TypeScriptDependencyScanner {
|
|
|
161
162
|
}
|
|
162
163
|
async#findCssFiles(directory) {
|
|
163
164
|
const files = [];
|
|
164
|
-
const skipDirs = ["node_modules", "dist", "build", ".git", ".next", "public", "ios", "android"];
|
|
165
165
|
const glob = new Bun.Glob("**/*.css");
|
|
166
166
|
for await (const filePath of glob.scan({ cwd: directory, onlyFiles: true })) {
|
|
167
|
-
if (
|
|
167
|
+
if (isSkippedPath(filePath))
|
|
168
168
|
continue;
|
|
169
169
|
const fullPath = path.join(directory, filePath);
|
|
170
|
-
const relativePath = path.relative(this
|
|
171
|
-
if (this
|
|
170
|
+
const relativePath = path.relative(this.#workspaceRoot, fullPath);
|
|
171
|
+
if (this.#ig.ignores(relativePath))
|
|
172
172
|
continue;
|
|
173
173
|
files.push(fullPath);
|
|
174
174
|
}
|
|
@@ -289,7 +289,7 @@ class TypeScriptDependencyScanner {
|
|
|
289
289
|
exec.workspace.getPackageJson(),
|
|
290
290
|
exec.workspace.getGitignorePatterns()
|
|
291
291
|
]);
|
|
292
|
-
return new
|
|
292
|
+
return new TypeScriptDependencyScanner2(exec.cwdPath, {
|
|
293
293
|
workspaceRoot: exec.workspace.cwdPath,
|
|
294
294
|
tsconfig,
|
|
295
295
|
rootPackageJson,
|
|
@@ -298,4 +298,4 @@ class TypeScriptDependencyScanner {
|
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
-
export {
|
|
301
|
+
export { TypeScriptDependencyScanner2 };
|
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
CloudApi,
|
|
3
|
+
getDefaultHostConfig,
|
|
5
4
|
GlobalConfig,
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
CloudApi,
|
|
6
|
+
AiSession
|
|
7
|
+
} from "./index-n85fer99.js";
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
WorkspaceExecutor,
|
|
10
|
+
AppExecutor
|
|
11
|
+
} from "./index-q8sn827n.js";
|
|
11
12
|
import {
|
|
12
13
|
runner
|
|
13
|
-
} from "./index-
|
|
14
|
+
} from "./index-cezy7yb3.js";
|
|
14
15
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from "./index-z8ptfkzv.js";
|
|
18
|
-
|
|
19
|
-
// pkgs/@akanjs/cli/cloud/cloud.runner.ts
|
|
20
|
-
import path from "path";
|
|
21
|
-
import { confirm, input, select } from "@inquirer/prompts";
|
|
22
|
-
import { Logger, sleep } from "akanjs/common";
|
|
23
|
-
import chalk from "chalk";
|
|
24
|
-
import * as QRcode from "qrcode";
|
|
16
|
+
openBrowser
|
|
17
|
+
} from "./index-d61rcfa2.js";
|
|
25
18
|
|
|
26
19
|
// pkgs/@akanjs/cli/npmRegistry.ts
|
|
27
20
|
var defaultNpmRegistry = "https://registry.npmjs.org";
|
|
@@ -40,6 +33,11 @@ async function getLatestPackageVersion(packageName, tag = "latest", registryUrl)
|
|
|
40
33
|
}
|
|
41
34
|
|
|
42
35
|
// pkgs/@akanjs/cli/cloud/cloud.runner.ts
|
|
36
|
+
import path from "path";
|
|
37
|
+
import { confirm, input, select } from "@inquirer/prompts";
|
|
38
|
+
import { Logger, sleep } from "akanjs/common";
|
|
39
|
+
import chalk from "chalk";
|
|
40
|
+
import * as QRcode from "qrcode";
|
|
43
41
|
var addRemoteEnvServerValue = "__addRemoteEnvServer";
|
|
44
42
|
var removeRemoteEnvServerValue = "__removeRemoteEnvServer";
|
|
45
43
|
|
|
@@ -100,8 +98,8 @@ class CloudRunner extends runner("cloud") {
|
|
|
100
98
|
const selectedName = await select({
|
|
101
99
|
message: "Select the remote env server",
|
|
102
100
|
choices: [
|
|
103
|
-
...serverEntries.map(([name,
|
|
104
|
-
name: `${name} (${
|
|
101
|
+
...serverEntries.map(([name, config]) => ({
|
|
102
|
+
name: `${name} (${config.username ? `${config.username}@` : ""}${config.host}${config.port ? `:${config.port}` : ""})`,
|
|
105
103
|
value: name
|
|
106
104
|
})),
|
|
107
105
|
{ name: "Add new remote server", value: addRemoteEnvServerValue },
|
|
@@ -205,12 +203,12 @@ ${chalk.green("\u27A4")} Authentication Required`));
|
|
|
205
203
|
const MAX_RETRY = 300;
|
|
206
204
|
for (let i = 0;i < MAX_RETRY; i++) {
|
|
207
205
|
const accessToken = await cloudApi.getRemoteAuthToken(remoteId);
|
|
208
|
-
const
|
|
209
|
-
if (accessToken &&
|
|
210
|
-
await GlobalConfig.setHostConfig({ host: config.host, auth: { accessToken, self
|
|
206
|
+
const self = await cloudApi.getRemoteSelf();
|
|
207
|
+
if (accessToken && self) {
|
|
208
|
+
await GlobalConfig.setHostConfig({ host: config.host, auth: { accessToken, self } });
|
|
211
209
|
Logger.rawLog(chalk.green(`\r\u2713 Authentication successful!`));
|
|
212
210
|
Logger.rawLog(chalk.green.bold(`
|
|
213
|
-
\u2728 Welcome aboard, ${
|
|
211
|
+
\u2728 Welcome aboard, ${self.nickname ?? "anonymous"}!`));
|
|
214
212
|
Logger.rawLog(chalk.dim(`You're now ready to use Akan CLI!
|
|
215
213
|
`));
|
|
216
214
|
return true;
|
|
@@ -255,12 +253,12 @@ ${chalk.green("\u27A4")} Authentication Required`));
|
|
|
255
253
|
const isOfficialRelease = !devPatchVersion;
|
|
256
254
|
const targetVersionPrefix = isOfficialRelease ? `${majorVersion}.${minorVersion}` : `${majorVersion}.${minorVersion}.${patchVersion}`;
|
|
257
255
|
const tag = distTag ?? (isOfficialRelease ? "latest" : patchVersion.split("-").at(1) ?? "dev");
|
|
258
|
-
const getNextVersion = async (prefix,
|
|
256
|
+
const getNextVersion = async (prefix, tag) => {
|
|
259
257
|
try {
|
|
260
|
-
const
|
|
261
|
-
const latestPatch =
|
|
262
|
-
const
|
|
263
|
-
return { nextVersion
|
|
258
|
+
const latestPublishedVersion = await getLatestPackageVersion("akanjs", tag, registry);
|
|
259
|
+
const latestPatch = latestPublishedVersion.startsWith(prefix) ? parseInt(latestPublishedVersion.split(".").at(-1) ?? "-1") : -1;
|
|
260
|
+
const nextVersion = `${prefix}.${latestPatch + 1}`;
|
|
261
|
+
return { nextVersion, latestPublishedVersion };
|
|
264
262
|
} catch {
|
|
265
263
|
return { nextVersion: `${prefix}.0`, latestPublishedVersion: null };
|
|
266
264
|
}
|
|
@@ -285,7 +283,10 @@ ${chalk.green("\u27A4")} Authentication Required`));
|
|
|
285
283
|
return;
|
|
286
284
|
}
|
|
287
285
|
}
|
|
288
|
-
|
|
286
|
+
Logger.info("Logging in to npm...");
|
|
287
|
+
await workspace.spawn("npm", ["login"], { stdio: "inherit" });
|
|
288
|
+
Logger.info("Logged in to npm");
|
|
289
|
+
for (const library of akanPkgs) {
|
|
289
290
|
Logger.info(`Publishing ${library}@${nextVersion} to ${registry ?? "npm"}...`);
|
|
290
291
|
await workspace.spawn("npm", ["publish", "--tag", tag, ...this.#getRegistryArgs(registry), ...this.#getLocalRegistryAuthArgs(registry)], {
|
|
291
292
|
cwd: path.join(workspace.workspaceRoot, "dist/pkgs", library),
|
|
@@ -293,7 +294,7 @@ ${chalk.green("\u27A4")} Authentication Required`));
|
|
|
293
294
|
stdio: "inherit"
|
|
294
295
|
});
|
|
295
296
|
Logger.info(`${library}@${nextVersion} is published to ${registry ?? "npm"}`);
|
|
296
|
-
}
|
|
297
|
+
}
|
|
297
298
|
Logger.info(`All libraries are published to ${registry ?? "npm"}`);
|
|
298
299
|
}
|
|
299
300
|
async update(workspace, tag = "latest", { registryUrl } = {}) {
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// pkgs/@akanjs/devkit/frontendBuild/styleContract.ts
|
|
3
|
-
var countBlocking = (
|
|
4
|
-
var formatStyleContract = (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
lines.push(` ${s.snippet}`);
|
|
9
|
-
lines.push(` \u2192 ${s.suggestion}`);
|
|
10
|
-
}
|
|
11
|
-
for (const t of v.theme) {
|
|
12
|
-
lines.push(` [error] contrast ${t.scope} ${t.pair} = ${t.ratio}:1 (min ${t.threshold}:1)`);
|
|
13
|
-
lines.push(` \u2192 ${t.suggestion}`);
|
|
14
|
-
}
|
|
15
|
-
return lines.join(`
|
|
3
|
+
var countBlocking = (violations) => violations.theme.length;
|
|
4
|
+
var formatStyleContract = (violations) => violations.theme.flatMap((theme) => [
|
|
5
|
+
` [error] contrast ${theme.scope} ${theme.pair} = ${theme.ratio}:1 (min ${theme.threshold}:1)`,
|
|
6
|
+
` \u2192 ${theme.suggestion}`
|
|
7
|
+
]).join(`
|
|
16
8
|
`);
|
|
17
|
-
};
|
|
18
9
|
|
|
19
10
|
// pkgs/@akanjs/devkit/frontendBuild/themeValidator.ts
|
|
20
11
|
var PAIRS = [
|
|
@@ -66,7 +57,7 @@ class ThemeValidator {
|
|
|
66
57
|
foreground: front,
|
|
67
58
|
ratio: Math.round(ratio * 100) / 100,
|
|
68
59
|
threshold,
|
|
69
|
-
suggestion:
|
|
60
|
+
suggestion: `In ${scope}, --${base} (${bg}) against --${fg} (${front}) is ${ratio.toFixed(2)}:1, under the ${threshold}:1 minimum. Lighten or darken one of them until it clears.`
|
|
70
61
|
});
|
|
71
62
|
}
|
|
72
63
|
return violations;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import {
|
|
3
|
-
Spinner
|
|
4
|
-
} from "./index-mxvakhsm.js";
|
|
5
2
|
import {
|
|
6
3
|
FileSys
|
|
7
|
-
} from "./index-
|
|
4
|
+
} from "./index-q0y2jq9j.js";
|
|
5
|
+
import {
|
|
6
|
+
Spinner
|
|
7
|
+
} from "./index-q8sn827n.js";
|
|
8
8
|
|
|
9
9
|
// pkgs/@akanjs/devkit/cloud/globalConfig.ts
|
|
10
|
-
import { mkdir } from "fs/promises";
|
|
10
|
+
import { chmod, mkdir } from "fs/promises";
|
|
11
11
|
import dayjs from "dayjs";
|
|
12
12
|
|
|
13
13
|
// pkgs/@akanjs/devkit/cloud/constants.ts
|
|
@@ -34,8 +34,9 @@ class GlobalConfig {
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
static async#setAkanGlobalConfig(akanConfig) {
|
|
37
|
-
await mkdir(basePath, { recursive: true });
|
|
37
|
+
await mkdir(basePath, { recursive: true, mode: 448 });
|
|
38
38
|
await Bun.write(configPath, JSON.stringify(akanConfig, null, 2));
|
|
39
|
+
await chmod(configPath, 384);
|
|
39
40
|
}
|
|
40
41
|
static async getHostConfig(host = GlobalConfig.akanCloudHost) {
|
|
41
42
|
const akanConfig = await GlobalConfig.#getAkanGlobalConfig();
|
|
@@ -240,7 +241,7 @@ import { ChatOpenAI } from "@langchain/openai";
|
|
|
240
241
|
import { Logger } from "akanjs/common";
|
|
241
242
|
import chalk from "chalk";
|
|
242
243
|
var MAX_ASK_TRY = 300;
|
|
243
|
-
var deepSeekLlmModels = ["deepseek-
|
|
244
|
+
var deepSeekLlmModels = ["deepseek-v4-flash", "deepseek-v4-pro"];
|
|
244
245
|
var openAiLlmModels = ["gpt-5.5"];
|
|
245
246
|
var supportedLlmModels = [...deepSeekLlmModels, ...openAiLlmModels];
|
|
246
247
|
var isOpenAiLlmModel = (model) => openAiLlmModels.includes(model);
|
|
@@ -275,10 +276,10 @@ class AiSession {
|
|
|
275
276
|
static #chat = null;
|
|
276
277
|
static async init({ temperature = 0, useExisting = true } = {}) {
|
|
277
278
|
if (useExisting) {
|
|
278
|
-
const
|
|
279
|
-
if (
|
|
280
|
-
AiSession.#setChatModel(
|
|
281
|
-
Logger.rawLog(chalk.dim(`\uD83E\uDD16akan editor uses existing LLM config (${
|
|
279
|
+
const llmConfig = await AiSession.getLlmConfig();
|
|
280
|
+
if (llmConfig) {
|
|
281
|
+
AiSession.#setChatModel(llmConfig.model, llmConfig.apiKey);
|
|
282
|
+
Logger.rawLog(chalk.dim(`\uD83E\uDD16akan editor uses existing LLM config (${llmConfig.model})`));
|
|
282
283
|
return AiSession;
|
|
283
284
|
}
|
|
284
285
|
} else
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
CommandExecutionError
|
|
4
|
+
} from "./index-q8sn827n.js";
|
|
2
5
|
import {
|
|
3
6
|
resolveMobilePath,
|
|
4
7
|
targetHtmlFilename
|
|
5
|
-
} from "./index-
|
|
6
|
-
import {
|
|
7
|
-
CommandExecutionError
|
|
8
|
-
} from "./index-z8ptfkzv.js";
|
|
8
|
+
} from "./index-47pj3aee.js";
|
|
9
9
|
|
|
10
10
|
// pkgs/@akanjs/devkit/capacitorApp.ts
|
|
11
11
|
import { cp, mkdir, readFile, rm, writeFile } from "fs/promises";
|
|
@@ -17,22 +17,22 @@ import { capitalize } from "akanjs/common";
|
|
|
17
17
|
|
|
18
18
|
// pkgs/@akanjs/devkit/fileEditor.ts
|
|
19
19
|
class FileEditor {
|
|
20
|
-
filePath;
|
|
21
|
-
content;
|
|
20
|
+
#filePath;
|
|
21
|
+
#content;
|
|
22
22
|
constructor(filePath, content) {
|
|
23
|
-
this
|
|
24
|
-
this
|
|
23
|
+
this.#filePath = filePath;
|
|
24
|
+
this.#content = content;
|
|
25
25
|
}
|
|
26
26
|
static async create(filePath) {
|
|
27
27
|
try {
|
|
28
28
|
const content = await Bun.file(filePath).text();
|
|
29
29
|
return new FileEditor(filePath, content);
|
|
30
|
-
} catch (
|
|
30
|
+
} catch (_error) {
|
|
31
31
|
throw new Error(`Failed to read file: ${filePath}`);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
find(pattern) {
|
|
35
|
-
const lines = this
|
|
35
|
+
const lines = this.#content.split(`
|
|
36
36
|
`);
|
|
37
37
|
const regex = typeof pattern === "string" ? new RegExp(pattern) : pattern;
|
|
38
38
|
for (let i = 0;i < lines.length; i++) {
|
|
@@ -45,7 +45,7 @@ class FileEditor {
|
|
|
45
45
|
return -1;
|
|
46
46
|
}
|
|
47
47
|
findAll(pattern) {
|
|
48
|
-
const lines = this
|
|
48
|
+
const lines = this.#content.split(`
|
|
49
49
|
`);
|
|
50
50
|
const regex = typeof pattern === "string" ? new RegExp(pattern) : pattern;
|
|
51
51
|
const matches = [];
|
|
@@ -63,10 +63,10 @@ class FileEditor {
|
|
|
63
63
|
if (lineIndex === -1) {
|
|
64
64
|
throw new Error(`Pattern not found: ${pattern}`);
|
|
65
65
|
}
|
|
66
|
-
const lines = this
|
|
66
|
+
const lines = this.#content.split(`
|
|
67
67
|
`);
|
|
68
68
|
lines.splice(lineIndex + 1, 0, data);
|
|
69
|
-
this
|
|
69
|
+
this.#content = lines.join(`
|
|
70
70
|
`);
|
|
71
71
|
return this;
|
|
72
72
|
}
|
|
@@ -75,40 +75,40 @@ class FileEditor {
|
|
|
75
75
|
if (lineIndex === -1) {
|
|
76
76
|
throw new Error(`Pattern not found: ${pattern}`);
|
|
77
77
|
}
|
|
78
|
-
const lines = this
|
|
78
|
+
const lines = this.#content.split(`
|
|
79
79
|
`);
|
|
80
80
|
lines.splice(lineIndex, 0, data);
|
|
81
|
-
this
|
|
81
|
+
this.#content = lines.join(`
|
|
82
82
|
`);
|
|
83
83
|
return this;
|
|
84
84
|
}
|
|
85
85
|
replace(pattern, replacement) {
|
|
86
86
|
const regex = typeof pattern === "string" ? new RegExp(pattern, "g") : pattern;
|
|
87
|
-
this
|
|
87
|
+
this.#content = this.#content.replace(regex, replacement);
|
|
88
88
|
return this;
|
|
89
89
|
}
|
|
90
90
|
append(data) {
|
|
91
|
-
this
|
|
91
|
+
this.#content += `
|
|
92
92
|
${data}`;
|
|
93
93
|
return this;
|
|
94
94
|
}
|
|
95
95
|
prepend(data) {
|
|
96
|
-
this
|
|
97
|
-
${this
|
|
96
|
+
this.#content = `${data}
|
|
97
|
+
${this.#content}`;
|
|
98
98
|
return this;
|
|
99
99
|
}
|
|
100
100
|
async save() {
|
|
101
101
|
try {
|
|
102
|
-
await Bun.write(this
|
|
103
|
-
} catch (
|
|
104
|
-
throw new Error(`Failed to save file: ${this
|
|
102
|
+
await Bun.write(this.#filePath, this.#content);
|
|
103
|
+
} catch (_error) {
|
|
104
|
+
throw new Error(`Failed to save file: ${this.#filePath}`);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
getContent() {
|
|
108
|
-
return this
|
|
108
|
+
return this.#content;
|
|
109
109
|
}
|
|
110
110
|
setContent(content) {
|
|
111
|
-
this
|
|
111
|
+
this.#content = content;
|
|
112
112
|
return this;
|
|
113
113
|
}
|
|
114
114
|
}
|
|
@@ -474,7 +474,7 @@ var PLACEHOLDER_APP_IDS = [
|
|
|
474
474
|
"com.example.myapp"
|
|
475
475
|
];
|
|
476
476
|
var placeholderAppIdSegment = /^(example|examples|myorg|myapp|mycompany|myorganization|changeme|todo|sample|test)$/;
|
|
477
|
-
var
|
|
477
|
+
var isPlaceholderAppId2 = (appId) => {
|
|
478
478
|
const normalized = appId?.trim().toLowerCase() ?? "";
|
|
479
479
|
if (!normalized)
|
|
480
480
|
return true;
|
|
@@ -641,7 +641,7 @@ function materializeCapacitorConfig(target, { operation, localServerUrl, localIp
|
|
|
641
641
|
return config;
|
|
642
642
|
}
|
|
643
643
|
|
|
644
|
-
class
|
|
644
|
+
class CapacitorApp2 {
|
|
645
645
|
app;
|
|
646
646
|
target;
|
|
647
647
|
project;
|
|
@@ -1513,4 +1513,4 @@ ${filter}$1`);
|
|
|
1513
1513
|
}
|
|
1514
1514
|
}
|
|
1515
1515
|
|
|
1516
|
-
export {
|
|
1516
|
+
export { isPlaceholderAppId2, CapacitorApp2 };
|