@akanjs/cli 3.0.0-beta.9 → 3.0.1
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-zfab7pkn.js +9 -0
- package/CodeAgentRpcHost-p7h6n2hp.js +7 -0
- package/CodeAgentRpcListener-7p7z5dd7.js +97 -0
- package/CodeTui-0zhnr0pw.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-aja6z9mn.js} +8 -9
- package/akanCode.js +102 -0
- package/application.command-049ehgx3.js +246 -0
- package/{applicationBuildRunner-kxwbssgn.js → applicationBuildRunner-75n5rpwp.js} +121 -77
- package/buildBatch.proc.js +120 -32
- package/cloud.command-gw4kqxt8.js +95 -0
- package/cloud.script-c723cpcb.js +20 -0
- package/code.command-x9t6z5nw.js +154 -0
- package/commandManifest.json +1 -1
- package/consoleToStderr-h5bryj94.js +7 -0
- package/context.command-yfbe1rtd.js +48 -0
- package/context.runner-erfe68j5.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-kq9gp690.js +42 -0
- package/guidelines/agentRule/agentRule.instruction.md +154 -26
- package/guidelines/conventions/conventions.instruction.md +138 -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-2tv3fdx4.js → index-150s07n8.js} +1230 -1459
- package/{index-vyvre9en.js → index-25fvrxmy.js} +6 -2
- package/{index-kcxmv48c.js → index-2ahj896a.js} +45 -79
- package/index-2wc41k5w.js +49 -0
- package/index-3hx1z96c.js +87 -0
- package/{index-q0y2jq9j.js → index-52w0fvh8.js} +21 -4
- package/{index-04bk599g.js → index-5g4rkrvt.js} +10 -17
- package/index-5pvxf7z0.js +53 -0
- package/index-5q14pwzd.js +69 -0
- package/{index-vxtad5bd.js → index-66yspb67.js} +5 -8
- package/index-7md2g9vw.js +6 -0
- package/index-7p4c0yer.js +1058 -0
- package/{index-d43r08tf.js → index-8b639zes.js} +77 -150
- package/{index-ktb5njgy.js → index-8kvy8qb4.js} +49 -99
- package/index-94s080qm.js +266 -0
- package/index-9dp031by.js +12 -0
- package/{index-0g7r8xz3.js → index-a37by9hn.js} +114 -232
- package/{index-k2j1hc4r.js → index-b95yhqjr.js} +12 -12
- package/{index-3d9y066c.js → index-bjwxs904.js} +9 -8
- package/{index-2xp0kfkt.js → index-br8pkrk1.js} +37 -25
- package/index-c14nsvnv.js +700 -0
- package/index-c6eggbee.js +123 -0
- package/index-d2242ksy.js +99 -0
- package/{index-92zztqy1.js → index-dy0jx9ay.js} +2 -17
- package/{index-a64esmtb.js → index-fkvb79qe.js} +523 -1022
- package/index-h54yj9wr.js +1119 -0
- package/{index-by5gpp8x.js → index-hj6w4ka1.js} +2 -1
- package/{index-y6n8nmny.js → index-kn5d4jmg.js} +75 -203
- package/index-m3xsb1ms.js +4300 -0
- package/{index-gyd220p2.js → index-mb59b8x0.js} +554 -577
- package/{index-j9yhg404.js → index-mzjb6zp4.js} +4 -7
- package/index-p6pbz9n5.js +25 -0
- package/{index-sj5vxr8f.js → index-qe71g4ze.js} +983 -898
- package/index-rfcz04w9.js +187 -0
- package/{index-hwkygn9s.js → index-senscydg.js} +331 -36
- package/{index-ffvk10zz.js → index-vs8mefhy.js} +107 -241
- package/index-wa5jbxj1.js +760 -0
- package/index-y5ga5w9t.js +2729 -0
- package/{index-9077wzd2.js → index-y7hx1ygz.js} +43 -26
- package/{index-h7yw2z9n.js → index-zzvvc845.js} +8 -14
- package/index.js +23 -22
- package/{library.command-qzzbj6d8.js → library.command-keqjevpp.js} +4 -5
- package/{localRegistry.command-vyrgg4xw.js → localRegistry.command-pydeq5zf.js} +23 -43
- package/{module.command-rq5hq3ax.js → module.command-dkrnqx3v.js} +8 -12
- package/{package.command-d9hd6v9n.js → package.command-wmc0ys5y.js} +6 -7
- package/package.json +15 -7
- package/{page.command-126d56te.js → page.command-tf3erhrv.js} +4 -5
- package/{primitive.command-taxd1538.js → primitive.command-7hqpegj4.js} +9 -23
- package/prompter-76k56b37.js +8 -0
- package/{quality.command-6gsna0a3.js → quality.command-8122axq3.js} +205 -377
- package/{recipeScanner-fpagtgc1.js → recipeScanner-4b69ybe0.js} +1 -1
- package/{repair.command-tq2dgy72.js → repair.command-mcy12h0n.js} +11 -35
- package/{routeSourceValidator-apyqw7wk.js → routeSourceValidator-7ycnfz0e.js} +0 -6
- package/{scalar.command-3bcmrrkv.js → scalar.command-vvvbzttc.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-pzvqfy5h.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-82zz5xnq.js +129 -0
- package/{typeChecker-3xgrzc2v.js → typeChecker-px49mezc.js} +1 -1
- package/typecheck.proc.js +1 -1
- package/workflow.command-y8x3kgjv.js +79 -0
- package/{workspace.command-06wvstgr.js → workspace.command-jvsb7brc.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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-a37by9hn.js";
|
|
6
6
|
|
|
7
7
|
// pkgs/@akanjs/cli/page/page.runner.ts
|
|
8
8
|
class PageRunner extends runner("page") {
|
|
@@ -10,7 +10,11 @@ class PageRunner extends runner("page") {
|
|
|
10
10
|
await app.applyTemplate({
|
|
11
11
|
basePath: basePath ?? `page/(${app.name})/(public)/${module.name}`,
|
|
12
12
|
template: single ? "crudSinglePage" : "crudPages",
|
|
13
|
-
dict: {
|
|
13
|
+
dict: {
|
|
14
|
+
model: module.name,
|
|
15
|
+
appName: module.sys.name,
|
|
16
|
+
clientPath: `@${module.sys.type}s/${module.sys.name}/client`
|
|
17
|
+
}
|
|
14
18
|
});
|
|
15
19
|
}
|
|
16
20
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./index-
|
|
3
|
+
FileSys2
|
|
4
|
+
} from "./index-52w0fvh8.js";
|
|
5
5
|
|
|
6
6
|
// pkgs/@akanjs/devkit/dependencyScanner.ts
|
|
7
7
|
import { builtinModules } from "module";
|
|
@@ -10,7 +10,10 @@ import ignore from "ignore";
|
|
|
10
10
|
import ts from "typescript";
|
|
11
11
|
var testFileRegex = /\.(?:test|spec)\.[cm]?[tj]sx?$/;
|
|
12
12
|
var skipDirs = ["node_modules", "dist", "build", ".git", ".next", "public", "ios", "android", "__fixtures__"];
|
|
13
|
-
var isSkippedPath = (filePath) =>
|
|
13
|
+
var isSkippedPath = (filePath) => {
|
|
14
|
+
const posixPath = filePath.split(path.sep).join("/");
|
|
15
|
+
return skipDirs.some((dir) => posixPath.includes(`/${dir}/`) || posixPath.startsWith(`${dir}/`));
|
|
16
|
+
};
|
|
14
17
|
var builtinModuleSet = new Set([...builtinModules, ...builtinModules.map((mod) => `node:${mod}`)]);
|
|
15
18
|
var stripShebang = (source) => source.replace(/^#!.*(?:\r?\n|$)/, "");
|
|
16
19
|
|
|
@@ -54,24 +57,21 @@ class TypeScriptDependencyScanner2 {
|
|
|
54
57
|
async getPackageBuildDependencies(projectName) {
|
|
55
58
|
const runtimeDeps = new Set;
|
|
56
59
|
const devDeps = new Set;
|
|
57
|
-
const sourceFiles = await this.#
|
|
58
|
-
|
|
59
|
-
excludeTestFiles: true
|
|
60
|
-
});
|
|
61
|
-
const cssFiles = await this.#findCssFiles(this.#directory);
|
|
60
|
+
const sourceFiles = await this.#findFiles("**/*.{ts,tsx}", { excludeBuildFiles: true, excludeTestFiles: true });
|
|
61
|
+
const cssFiles = await this.#findFiles("**/*.css");
|
|
62
62
|
for (const filePath of sourceFiles) {
|
|
63
|
-
const fileContent = await
|
|
63
|
+
const fileContent = await FileSys2.readText(filePath);
|
|
64
64
|
const { imports, typeImports } = this.#extractImports(fileContent, filePath);
|
|
65
65
|
this.#addNormalizedImports(runtimeDeps, imports, projectName);
|
|
66
66
|
this.#addNormalizedImports(devDeps, typeImports, projectName);
|
|
67
67
|
}
|
|
68
68
|
for (const filePath of cssFiles) {
|
|
69
|
-
const fileContent = await
|
|
69
|
+
const fileContent = await FileSys2.readText(filePath);
|
|
70
70
|
this.#addNormalizedImports(runtimeDeps, this.#extractCssPluginImports(fileContent), projectName);
|
|
71
71
|
}
|
|
72
72
|
const buildFilePath = path.join(this.#directory, "build.ts");
|
|
73
|
-
if (await
|
|
74
|
-
const fileContent = await
|
|
73
|
+
if (await FileSys2.fileExists(buildFilePath)) {
|
|
74
|
+
const fileContent = await FileSys2.readText(buildFilePath);
|
|
75
75
|
const { imports, typeImports } = this.#extractImports(fileContent, buildFilePath);
|
|
76
76
|
this.#addNormalizedImports(devDeps, [...imports, ...typeImports], projectName);
|
|
77
77
|
}
|
|
@@ -95,7 +95,7 @@ class TypeScriptDependencyScanner2 {
|
|
|
95
95
|
if (!await Bun.file(packageJsonPath).exists())
|
|
96
96
|
return false;
|
|
97
97
|
try {
|
|
98
|
-
const packageJson = await
|
|
98
|
+
const packageJson = await FileSys2.readJson(packageJsonPath);
|
|
99
99
|
return packageJson.name === dep && !!packageJson.version;
|
|
100
100
|
} catch {
|
|
101
101
|
return false;
|
|
@@ -106,27 +106,21 @@ class TypeScriptDependencyScanner2 {
|
|
|
106
106
|
return this.#getImportSetsFromDependencies(depSets, fileDependencies);
|
|
107
107
|
}
|
|
108
108
|
#getImportSetsFromDependencies(depSets, fileDependencies) {
|
|
109
|
-
const importedDepSets =
|
|
110
|
-
for (
|
|
111
|
-
|
|
112
|
-
fileDependencies.forEach((imps) => {
|
|
113
|
-
imps.forEach((imp) => {
|
|
109
|
+
const importedDepSets = depSets.map(() => new Set);
|
|
110
|
+
for (const imps of fileDependencies.values())
|
|
111
|
+
for (const imp of imps) {
|
|
114
112
|
if (imp.startsWith("."))
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
113
|
+
continue;
|
|
114
|
+
const parts = imp.split("/");
|
|
115
|
+
for (let length = 1;length <= parts.length; length++) {
|
|
116
|
+
const importName = parts.slice(0, length).join("/");
|
|
117
|
+
const setIndex = depSets.findIndex((depSet) => depSet.has(importName));
|
|
118
|
+
if (setIndex === -1)
|
|
119
|
+
continue;
|
|
120
|
+
importedDepSets[setIndex]?.add(importName);
|
|
121
|
+
break;
|
|
127
122
|
}
|
|
128
|
-
}
|
|
129
|
-
});
|
|
123
|
+
}
|
|
130
124
|
return importedDepSets;
|
|
131
125
|
}
|
|
132
126
|
async getDependencies() {
|
|
@@ -134,43 +128,25 @@ class TypeScriptDependencyScanner2 {
|
|
|
134
128
|
this.#fileRuntimeDependencies.clear();
|
|
135
129
|
this.#fileTypeDependencies.clear();
|
|
136
130
|
this.#visitedFiles.clear();
|
|
137
|
-
const
|
|
138
|
-
for (const file of files)
|
|
131
|
+
for (const file of await this.#findFiles("**/*.{ts,tsx}"))
|
|
139
132
|
await this.#analyzeFile(file, this.#directory);
|
|
140
133
|
return this.#fileDependencies;
|
|
141
134
|
}
|
|
142
|
-
async#
|
|
135
|
+
async#findFiles(pattern, {
|
|
143
136
|
excludeBuildFiles = false,
|
|
144
137
|
excludeTestFiles = false
|
|
145
138
|
} = {}) {
|
|
146
139
|
const files = [];
|
|
147
|
-
const
|
|
148
|
-
for await (const filePath of glob.scan({ cwd: directory, onlyFiles: true })) {
|
|
140
|
+
for await (const filePath of new Bun.Glob(pattern).scan({ cwd: this.#directory, onlyFiles: true })) {
|
|
149
141
|
if (isSkippedPath(filePath))
|
|
150
142
|
continue;
|
|
151
143
|
if (excludeBuildFiles && filePath === "build.ts")
|
|
152
144
|
continue;
|
|
153
145
|
if (excludeTestFiles && testFileRegex.test(filePath))
|
|
154
146
|
continue;
|
|
155
|
-
const fullPath = path.join(directory, filePath);
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
continue;
|
|
159
|
-
files.push(fullPath);
|
|
160
|
-
}
|
|
161
|
-
return files;
|
|
162
|
-
}
|
|
163
|
-
async#findCssFiles(directory) {
|
|
164
|
-
const files = [];
|
|
165
|
-
const glob = new Bun.Glob("**/*.css");
|
|
166
|
-
for await (const filePath of glob.scan({ cwd: directory, onlyFiles: true })) {
|
|
167
|
-
if (isSkippedPath(filePath))
|
|
168
|
-
continue;
|
|
169
|
-
const fullPath = path.join(directory, filePath);
|
|
170
|
-
const relativePath = path.relative(this.#workspaceRoot, fullPath);
|
|
171
|
-
if (this.#ig.ignores(relativePath))
|
|
172
|
-
continue;
|
|
173
|
-
files.push(fullPath);
|
|
147
|
+
const fullPath = path.join(this.#directory, filePath);
|
|
148
|
+
if (!this.#ig.ignores(path.relative(this.#workspaceRoot, fullPath)))
|
|
149
|
+
files.push(fullPath);
|
|
174
150
|
}
|
|
175
151
|
return files;
|
|
176
152
|
}
|
|
@@ -179,7 +155,7 @@ class TypeScriptDependencyScanner2 {
|
|
|
179
155
|
return;
|
|
180
156
|
this.#visitedFiles.add(filePath);
|
|
181
157
|
try {
|
|
182
|
-
const fileContent = await
|
|
158
|
+
const fileContent = await FileSys2.readText(filePath);
|
|
183
159
|
const { imports, typeImports } = this.#extractImports(fileContent, filePath);
|
|
184
160
|
const resolvedImports = await this.#resolveImports(imports, filePath, baseDir);
|
|
185
161
|
const resolvedTypeImports = await this.#resolveImports(typeImports, filePath, baseDir);
|
|
@@ -191,19 +167,17 @@ class TypeScriptDependencyScanner2 {
|
|
|
191
167
|
}
|
|
192
168
|
async#resolveImports(imports, filePath, baseDir) {
|
|
193
169
|
return await Promise.all(imports.map(async (importPath) => {
|
|
194
|
-
if (importPath.startsWith("."))
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
return importPath;
|
|
170
|
+
if (!importPath.startsWith("."))
|
|
171
|
+
return importPath;
|
|
172
|
+
return await this.#ensureExtension(`./${path.join(path.relative(baseDir, filePath), importPath)}`);
|
|
199
173
|
}));
|
|
200
174
|
}
|
|
201
175
|
async#ensureExtension(filePath) {
|
|
202
|
-
if (await
|
|
176
|
+
if (await FileSys2.fileExists(`${filePath}.ts`))
|
|
203
177
|
return `${filePath}.ts`;
|
|
204
|
-
else if (await
|
|
178
|
+
else if (await FileSys2.fileExists(`${filePath}.tsx`))
|
|
205
179
|
return `${filePath}.tsx`;
|
|
206
|
-
else if (await
|
|
180
|
+
else if (await FileSys2.fileExists(filePath))
|
|
207
181
|
return filePath;
|
|
208
182
|
return `${filePath}.ts`;
|
|
209
183
|
}
|
|
@@ -262,22 +236,14 @@ class TypeScriptDependencyScanner2 {
|
|
|
262
236
|
`;
|
|
263
237
|
const projectImports = imports.filter((i) => !i.startsWith("react") && !i.startsWith("@"));
|
|
264
238
|
const externalImports = imports.filter((i) => i.startsWith("react") || i.startsWith("@"));
|
|
265
|
-
if (projectImports.length > 0)
|
|
239
|
+
if (projectImports.length > 0)
|
|
266
240
|
graph += ` Project dependencies:
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
`;
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
if (externalImports.length > 0) {
|
|
241
|
+
${projectImports.map((imp) => ` \u2192 ${imp}
|
|
242
|
+
`).join("")}`;
|
|
243
|
+
if (externalImports.length > 0)
|
|
274
244
|
graph += ` External dependencies:
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
graph += ` \u2192 ${imp}
|
|
278
|
-
`;
|
|
279
|
-
});
|
|
280
|
-
}
|
|
245
|
+
${externalImports.map((imp) => ` \u2192 ${imp}
|
|
246
|
+
`).join("")}`;
|
|
281
247
|
graph += `
|
|
282
248
|
`;
|
|
283
249
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
GlobalConfig,
|
|
4
|
+
CloudApi
|
|
5
|
+
} from "./index-94s080qm.js";
|
|
6
|
+
|
|
7
|
+
// pkgs/@akanjs/cli/tunnel/TunnelShare.ts
|
|
8
|
+
import { TunnelAgent } from "akanjs/server/tunnel";
|
|
9
|
+
|
|
10
|
+
class TunnelShare2 {
|
|
11
|
+
#api;
|
|
12
|
+
#agent;
|
|
13
|
+
grant;
|
|
14
|
+
#closed = false;
|
|
15
|
+
constructor(api, agent, grant) {
|
|
16
|
+
this.#api = api;
|
|
17
|
+
this.#agent = agent;
|
|
18
|
+
this.grant = grant;
|
|
19
|
+
}
|
|
20
|
+
static async open(app, { workspace, host, port, ttlMinutes, onLost }) {
|
|
21
|
+
const api = await CloudApi.fromHost(workspace, host ?? GlobalConfig.akanCloudHost);
|
|
22
|
+
const grant = await api.requestTunnel({ name: app.name, ...ttlMinutes ? { ttlMinutes } : {} });
|
|
23
|
+
const origin = `http://localhost:${port ?? await app.getDevPort()}`;
|
|
24
|
+
const agent = new TunnelAgent({
|
|
25
|
+
gatewayUrl: grant.gatewayUrl,
|
|
26
|
+
token: grant.token,
|
|
27
|
+
hostnames: [grant.hostname],
|
|
28
|
+
origin,
|
|
29
|
+
name: app.name,
|
|
30
|
+
...onLost ? { onLost } : {}
|
|
31
|
+
});
|
|
32
|
+
await agent.start();
|
|
33
|
+
return new TunnelShare2(api, agent, grant);
|
|
34
|
+
}
|
|
35
|
+
get url() {
|
|
36
|
+
return this.grant.url;
|
|
37
|
+
}
|
|
38
|
+
async close() {
|
|
39
|
+
if (this.#closed)
|
|
40
|
+
return;
|
|
41
|
+
this.#closed = true;
|
|
42
|
+
await this.#agent.stop("cli exited");
|
|
43
|
+
try {
|
|
44
|
+
await this.#api.revokeTunnel(this.grant.code);
|
|
45
|
+
} catch {}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { TunnelShare2 };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// pkgs/@akanjs/devkit/cloud/configLock.ts
|
|
3
|
+
import { mkdir, open, readFile, rm, stat } from "fs/promises";
|
|
4
|
+
import path from "path";
|
|
5
|
+
|
|
6
|
+
class ConfigLock {
|
|
7
|
+
static waitTimeoutMs = 30000;
|
|
8
|
+
static #unknownHolderStaleMs = 1e4;
|
|
9
|
+
static #pollMs = 50;
|
|
10
|
+
static async run(lockPath, fn) {
|
|
11
|
+
await mkdir(path.dirname(lockPath), { recursive: true, mode: 448 });
|
|
12
|
+
const deadline = Date.now() + ConfigLock.waitTimeoutMs;
|
|
13
|
+
while (!await ConfigLock.#take(lockPath)) {
|
|
14
|
+
if (Date.now() >= deadline) {
|
|
15
|
+
const holder = (await ConfigLock.#holder(lockPath))?.pid ?? "unknown";
|
|
16
|
+
throw new Error(`${lockPath} is held by process ${holder}; if no akan command is running, delete it and retry.`);
|
|
17
|
+
}
|
|
18
|
+
await ConfigLock.#reclaimIfAbandoned(lockPath);
|
|
19
|
+
await Bun.sleep(ConfigLock.#pollMs);
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
return await fn();
|
|
23
|
+
} finally {
|
|
24
|
+
await rm(lockPath, { force: true });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
static async#take(lockPath) {
|
|
28
|
+
const handle = await open(lockPath, "wx", 384).catch((error) => {
|
|
29
|
+
if (error.code === "EEXIST")
|
|
30
|
+
return null;
|
|
31
|
+
throw error;
|
|
32
|
+
});
|
|
33
|
+
if (!handle)
|
|
34
|
+
return false;
|
|
35
|
+
try {
|
|
36
|
+
await handle.writeFile(JSON.stringify({ pid: process.pid, at: Date.now() }));
|
|
37
|
+
} finally {
|
|
38
|
+
await handle.close();
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
static async#reclaimIfAbandoned(lockPath) {
|
|
43
|
+
if (!await ConfigLock.#abandoned(lockPath))
|
|
44
|
+
return;
|
|
45
|
+
const guard = `${lockPath}.reclaim`;
|
|
46
|
+
if (!await ConfigLock.#take(guard)) {
|
|
47
|
+
if (await ConfigLock.#abandoned(guard))
|
|
48
|
+
await rm(guard, { force: true });
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
if (await ConfigLock.#abandoned(lockPath))
|
|
53
|
+
await rm(lockPath, { force: true });
|
|
54
|
+
} finally {
|
|
55
|
+
await rm(guard, { force: true });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
static async#abandoned(lockPath) {
|
|
59
|
+
const info = await stat(lockPath).catch(() => null);
|
|
60
|
+
if (!info)
|
|
61
|
+
return false;
|
|
62
|
+
const holder = await ConfigLock.#holder(lockPath);
|
|
63
|
+
if (!holder)
|
|
64
|
+
return Date.now() - info.mtimeMs > ConfigLock.#unknownHolderStaleMs;
|
|
65
|
+
return !ConfigLock.#isAlive(holder.pid);
|
|
66
|
+
}
|
|
67
|
+
static async#holder(lockPath) {
|
|
68
|
+
try {
|
|
69
|
+
const parsed = JSON.parse(await readFile(lockPath, "utf8"));
|
|
70
|
+
return typeof parsed.pid === "number" && typeof parsed.at === "number" ? { pid: parsed.pid, at: parsed.at } : null;
|
|
71
|
+
} catch {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
static #isAlive(pid) {
|
|
76
|
+
if (!Number.isInteger(pid) || pid <= 0)
|
|
77
|
+
return false;
|
|
78
|
+
try {
|
|
79
|
+
process.kill(pid, 0);
|
|
80
|
+
return true;
|
|
81
|
+
} catch (error) {
|
|
82
|
+
return error.code === "EPERM";
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export { ConfigLock };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// pkgs/@akanjs/devkit/fileSys.ts
|
|
3
3
|
import { lstat, rename, rm, stat } from "fs/promises";
|
|
4
|
+
import nodePath from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
4
6
|
import { Logger } from "akanjs/common";
|
|
7
|
+
var getDirname2 = (url) => nodePath.dirname(fileURLToPath(url));
|
|
5
8
|
|
|
6
|
-
class
|
|
9
|
+
class FileSys2 {
|
|
7
10
|
static logger = new Logger("FileSys");
|
|
8
11
|
static async fileExists(path) {
|
|
9
12
|
return await Bun.file(path).exists();
|
|
@@ -24,7 +27,7 @@ class FileSys {
|
|
|
24
27
|
try {
|
|
25
28
|
return await Bun.file(path).json();
|
|
26
29
|
} catch (error) {
|
|
27
|
-
|
|
30
|
+
FileSys2.logger.error(`Failed to read JSON file: ${path}`);
|
|
28
31
|
throw error;
|
|
29
32
|
}
|
|
30
33
|
}
|
|
@@ -38,7 +41,7 @@ class FileSys {
|
|
|
38
41
|
const temp = `${filePath}.${process.pid}.${Date.now().toString(36)}.tmp`;
|
|
39
42
|
try {
|
|
40
43
|
await Bun.write(temp, content);
|
|
41
|
-
await
|
|
44
|
+
await FileSys2.replace(temp, filePath);
|
|
42
45
|
} catch (error) {
|
|
43
46
|
await rm(temp, { force: true }).catch(() => {
|
|
44
47
|
return;
|
|
@@ -46,10 +49,24 @@ class FileSys {
|
|
|
46
49
|
throw error;
|
|
47
50
|
}
|
|
48
51
|
}
|
|
52
|
+
static #replaceAttempts = 100;
|
|
53
|
+
static async replace(temp, target) {
|
|
54
|
+
for (let attempt = 1;; attempt++) {
|
|
55
|
+
try {
|
|
56
|
+
return await rename(temp, target);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
const code = error.code;
|
|
59
|
+
const busy = process.platform === "win32" && (code === "EPERM" || code === "EACCES" || code === "EBUSY");
|
|
60
|
+
if (!busy || attempt >= FileSys2.#replaceAttempts)
|
|
61
|
+
throw error;
|
|
62
|
+
await Bun.sleep(Math.min(10 * attempt, 50));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
49
66
|
static async writeJson(path, content) {
|
|
50
67
|
return await Bun.file(path).write(`${JSON.stringify(content, null, 2)}
|
|
51
68
|
`);
|
|
52
69
|
}
|
|
53
70
|
}
|
|
54
71
|
|
|
55
|
-
export {
|
|
72
|
+
export { getDirname2, FileSys2 };
|
|
@@ -5,33 +5,26 @@ import {
|
|
|
5
5
|
writeGeneratedSyncState,
|
|
6
6
|
createRepairReport,
|
|
7
7
|
renderRepairReport
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-mb59b8x0.js";
|
|
9
9
|
import {
|
|
10
10
|
AkanContextAnalyzer
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-8kvy8qb4.js";
|
|
12
12
|
import {
|
|
13
13
|
runner
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-a37by9hn.js";
|
|
15
15
|
|
|
16
16
|
// pkgs/@akanjs/cli/repair/repair.runner.ts
|
|
17
|
-
var
|
|
17
|
+
var spawnShell = async (workspace, command) => await workspace.spawn("bash", ["-lc", command.startsWith("akan ") ? `bun run ${command}` : command], {
|
|
18
|
+
cwd: workspace.workspaceRoot
|
|
19
|
+
});
|
|
18
20
|
var defaultExecutor = (workspace) => async (command) => {
|
|
21
|
+
const base = { command: command.command, reason: command.reason };
|
|
19
22
|
try {
|
|
20
|
-
|
|
21
|
-
cwd: workspace.workspaceRoot
|
|
22
|
-
});
|
|
23
|
-
return {
|
|
24
|
-
command: command.command,
|
|
25
|
-
reason: command.reason,
|
|
26
|
-
status: "passed",
|
|
27
|
-
exitCode: 0,
|
|
28
|
-
stdout
|
|
29
|
-
};
|
|
23
|
+
return { ...base, status: "passed", exitCode: 0, stdout: await spawnShell(workspace, command.command) };
|
|
30
24
|
} catch (error) {
|
|
31
25
|
const commandError = error;
|
|
32
26
|
return {
|
|
33
|
-
|
|
34
|
-
reason: command.reason,
|
|
27
|
+
...base,
|
|
35
28
|
status: "failed",
|
|
36
29
|
exitCode: commandError.code ?? 1,
|
|
37
30
|
stdout: commandError.stdout,
|
|
@@ -158,4 +151,4 @@ class RepairRunner extends runner("repair") {
|
|
|
158
151
|
}
|
|
159
152
|
}
|
|
160
153
|
|
|
161
|
-
export { RepairRunner };
|
|
154
|
+
export { spawnShell, RepairRunner };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
runner,
|
|
4
|
+
script
|
|
5
|
+
} from "./index-a37by9hn.js";
|
|
6
|
+
import {
|
|
7
|
+
generatedFilesForSync,
|
|
8
|
+
createPassedPrimitiveReport,
|
|
9
|
+
scalarChangedFiles
|
|
10
|
+
} from "./index-mb59b8x0.js";
|
|
11
|
+
import {
|
|
12
|
+
pluralizeName
|
|
13
|
+
} from "./index-nz8prx9g.js";
|
|
14
|
+
|
|
15
|
+
// pkgs/@akanjs/cli/scalar/scalar.runner.ts
|
|
16
|
+
class ScalarRunner extends runner("scalar") {
|
|
17
|
+
async applyScalarTemplate(sys, scalarName) {
|
|
18
|
+
await sys.applyTemplate({
|
|
19
|
+
basePath: "./lib/__scalar",
|
|
20
|
+
template: "__scalar",
|
|
21
|
+
dict: { model: scalarName, models: pluralizeName(scalarName), sysName: sys.name },
|
|
22
|
+
overwrite: false
|
|
23
|
+
});
|
|
24
|
+
const read = async (suffix) => {
|
|
25
|
+
const filename = `${scalarName}.${suffix}`;
|
|
26
|
+
return { filename, content: await sys.readFile(`lib/__scalar/${scalarName}/${filename}`) };
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
abstract: await read("abstract.md"),
|
|
30
|
+
constant: await read("constant.ts"),
|
|
31
|
+
dictionary: await read("dictionary.ts"),
|
|
32
|
+
document: await read("document.ts")
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// pkgs/@akanjs/cli/scalar/scalar.script.ts
|
|
38
|
+
class ScalarScript extends script("scalar", [ScalarRunner]) {
|
|
39
|
+
async createScalar(sys, scalarName) {
|
|
40
|
+
const files = await this.scalarRunner.applyScalarTemplate(sys, scalarName);
|
|
41
|
+
return createPassedPrimitiveReport({
|
|
42
|
+
command: "create-scalar",
|
|
43
|
+
changedFiles: scalarChangedFiles(sys, scalarName, files),
|
|
44
|
+
generatedFiles: generatedFilesForSync(sys),
|
|
45
|
+
target: sys.name
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
async removeScalar(sys, scalarName) {
|
|
49
|
+
await sys.removeDir(`lib/__scalar/${scalarName}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { ScalarScript };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
jsonText
|
|
4
|
+
} from "./index-mb59b8x0.js";
|
|
5
|
+
import {
|
|
6
|
+
akanMcpInstallTargets
|
|
7
|
+
} from "./index-8kvy8qb4.js";
|
|
8
|
+
import {
|
|
9
|
+
script
|
|
10
|
+
} from "./index-a37by9hn.js";
|
|
11
|
+
import {
|
|
12
|
+
ContextRunner2
|
|
13
|
+
} from "./index-kn5d4jmg.js";
|
|
14
|
+
|
|
15
|
+
// pkgs/@akanjs/cli/context/context.script.ts
|
|
16
|
+
import { Logger } from "akanjs/common";
|
|
17
|
+
var resolveMcpInstallTargets = (target) => {
|
|
18
|
+
if (!target || target === "all")
|
|
19
|
+
return [...akanMcpInstallTargets];
|
|
20
|
+
if (akanMcpInstallTargets.includes(target))
|
|
21
|
+
return [target];
|
|
22
|
+
throw new Error(`Unknown MCP install target: ${target}. Use cursor, claude, codex, or all.`);
|
|
23
|
+
};
|
|
24
|
+
var mcpTargetLabels = {
|
|
25
|
+
cursor: "Cursor",
|
|
26
|
+
claude: "Claude Code",
|
|
27
|
+
codex: "Codex"
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
class ContextScript extends script("context", [ContextRunner2]) {
|
|
31
|
+
async context(workspace, options = {}) {
|
|
32
|
+
Logger.rawLog(await this.contextRunner.getContext(workspace, options));
|
|
33
|
+
}
|
|
34
|
+
async doctor(workspace, options = {}) {
|
|
35
|
+
Logger.rawLog(await this.contextRunner.doctor(workspace, options));
|
|
36
|
+
}
|
|
37
|
+
async mcpInstall(workspace, target, { force = false, mode = "apply" } = {}) {
|
|
38
|
+
const targets = resolveMcpInstallTargets(target);
|
|
39
|
+
const written = [];
|
|
40
|
+
for (const t of targets) {
|
|
41
|
+
const configPath = await this.contextRunner.installMcp(workspace, t, { force, mode });
|
|
42
|
+
written.push(`${mcpTargetLabels[t]}: ${configPath}`);
|
|
43
|
+
}
|
|
44
|
+
Logger.rawLog(`Akan MCP server installed (${mode} mode):
|
|
45
|
+
${written.map((line) => `- ${line}`).join(`
|
|
46
|
+
`)}`);
|
|
47
|
+
}
|
|
48
|
+
async mcp(workspace, { mode = "apply" } = {}) {
|
|
49
|
+
await this.contextRunner.runMcp(workspace, { mode });
|
|
50
|
+
}
|
|
51
|
+
async mcpCall(workspace, tool, {
|
|
52
|
+
mode = "readonly",
|
|
53
|
+
args = null,
|
|
54
|
+
format = "json"
|
|
55
|
+
} = {}) {
|
|
56
|
+
let parsedArgs = {};
|
|
57
|
+
if (args) {
|
|
58
|
+
const parsed = JSON.parse(args);
|
|
59
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
60
|
+
throw new Error("MCP call args must be a JSON object.");
|
|
61
|
+
}
|
|
62
|
+
parsedArgs = parsed;
|
|
63
|
+
}
|
|
64
|
+
const result = await this.contextRunner.callMcpTool(workspace, tool, parsedArgs, { mode });
|
|
65
|
+
Logger.rawLog(format === "json" ? jsonText(result) : String(result));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { ContextScript };
|
|
@@ -2,23 +2,21 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-a37by9hn.js";
|
|
6
6
|
import {
|
|
7
7
|
LibExecutor
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-150s07n8.js";
|
|
9
9
|
import {
|
|
10
10
|
LibSource,
|
|
11
11
|
formatLibStatuses
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-bjwxs904.js";
|
|
13
13
|
|
|
14
14
|
// pkgs/@akanjs/cli/library/library.script.ts
|
|
15
15
|
import { Logger } from "akanjs/common";
|
|
16
16
|
|
|
17
17
|
// pkgs/@akanjs/devkit/semver.ts
|
|
18
18
|
var stripRangeOperator = (version) => version.replace(/^[\s^~>=<v]+/, "").trim();
|
|
19
|
-
var parseVersion = (version) =>
|
|
20
|
-
return version.replace(/^[^\d]*/, "").split(/[.-]/).map((part) => Number.parseInt(part, 10)).map((part) => Number.isFinite(part) ? part : 0);
|
|
21
|
-
};
|
|
19
|
+
var parseVersion = (version) => version.replace(/^[^\d]*/, "").split(/[.-]/).map((part) => Number.parseInt(part, 10)).map((part) => Number.isFinite(part) ? part : 0);
|
|
22
20
|
var compareNumeric = (a, b) => {
|
|
23
21
|
const left = parseVersion(a);
|
|
24
22
|
const right = parseVersion(b);
|
|
@@ -44,8 +42,7 @@ class LibraryRunner extends runner("library") {
|
|
|
44
42
|
async createLibrary(libName, workspace) {
|
|
45
43
|
await workspace.mkdir(`libs/${libName}`);
|
|
46
44
|
await workspace.applyTemplate({ basePath: `libs/${libName}`, template: "libRoot", dict: { libName } });
|
|
47
|
-
|
|
48
|
-
return lib;
|
|
45
|
+
return LibExecutor.from(workspace, libName);
|
|
49
46
|
}
|
|
50
47
|
async removeLibrary(lib) {
|
|
51
48
|
await lib.workspace.removeDir(`libs/${lib.name}`);
|