@akanjs/cli 3.0.0-alpha.76 → 3.0.0-alpha.77
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/{agent.command-j4744bct.js → agent.command-q2rgd8jz.js} +5 -5
- package/{application.command-1sq0zwqx.js → application.command-tfrqva07.js} +7 -4
- package/buildBatch.proc.js +1 -1
- package/{capacitorApp-nqnvsbv2.js → capacitorApp-szqr3cxr.js} +2 -2
- package/{cloud.command-ajkhg234.js → cloud.command-pjtg4azj.js} +7 -7
- package/commandManifest.json +1 -1
- package/{context.command-jxga9cc9.js → context.command-zx88k7e0.js} +12 -12
- package/{guideline.command-2fts4m5x.js → guideline.command-85x1tvjb.js} +2 -2
- package/incrementalBuilder.proc.js +1 -1
- package/{index-2j5xrm1c.js → index-0cdwa7qj.js} +2 -2
- package/{index-6wsjpt7b.js → index-1szrbtj9.js} +1 -1
- package/{index-yzsp0jgb.js → index-4930mtpt.js} +117 -4
- package/{index-aevn8b0n.js → index-6w77v5df.js} +1 -1
- package/{index-peg7zphh.js → index-7x5ks4ph.js} +4 -4
- package/{index-5yxz0zzc.js → index-dfn0kqj7.js} +3 -3
- package/{index-qgzzz44h.js → index-e00k7eme.js} +5 -5
- package/{index-120pzxb2.js → index-egng0kc4.js} +3 -3
- package/{index-qhy7zdmz.js → index-ffrhjdwd.js} +2 -2
- package/{index-85rdqkfx.js → index-hffr3myr.js} +3 -3
- package/{index-0zabybjx.js → index-kpxg3p1v.js} +10 -10
- package/{index-j8rp2kdv.js → index-qwfwk8be.js} +3 -3
- package/{index-aczwndks.js → index-w0g7hcr7.js} +2 -2
- package/{index-v6p94mz1.js → index-ws5zt62x.js} +4 -4
- package/index-ym4xqjhy.js +217 -0
- package/{index-mk1x6sad.js → index-yz8988we.js} +1 -1
- package/{index-mpka7dq4.js → index-zec5gcx0.js} +1 -1
- package/{index-004ah39s.js → index-zkrzv21w.js} +11 -1
- package/index.js +18 -18
- package/{library.command-tfkfhbcb.js → library.command-sjnqhzn2.js} +6 -3
- package/{localRegistry.command-rhn2mh9j.js → localRegistry.command-02dy0h6v.js} +6 -6
- package/{module.command-29xg1kzr.js → module.command-8vfy9pgk.js} +5 -5
- package/{package.command-j6yn5c7h.js → package.command-af8sxhff.js} +3 -3
- package/package.json +2 -2
- package/{page.command-vgxetvga.js → page.command-gr6rbz17.js} +3 -3
- package/{primitive.command-k85cvm2z.js → primitive.command-63b8ytkf.js} +6 -6
- package/{quality.command-9dsv2jw7.js → quality.command-9xhaxzm1.js} +2 -2
- package/{repair.command-mzdh4yby.js → repair.command-a2z4d5a0.js} +5 -5
- package/{scalar.command-0cgq46dj.js → scalar.command-8ampjwsr.js} +4 -4
- package/templates/workspaceRoot/.gitignore.template +0 -1
- package/{workflow.command-2yxpvpg3.js → workflow.command-jkfmkbzh.js} +9 -9
- package/{workspace.command-42yrde58.js → workspace.command-pg2qfpn7.js} +18 -18
- package/index-3qa4f4j7.js +0 -122
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ContextScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
8
|
-
import"./index-
|
|
9
|
-
import"./index-
|
|
4
|
+
} from "./index-kpxg3p1v.js";
|
|
5
|
+
import"./index-qwfwk8be.js";
|
|
6
|
+
import"./index-egng0kc4.js";
|
|
7
|
+
import"./index-0cdwa7qj.js";
|
|
8
|
+
import"./index-7x5ks4ph.js";
|
|
9
|
+
import"./index-ws5zt62x.js";
|
|
10
10
|
import"./index-ss469dec.js";
|
|
11
|
-
import"./index-
|
|
11
|
+
import"./index-yz8988we.js";
|
|
12
12
|
import {
|
|
13
13
|
CloudScript
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-e00k7eme.js";
|
|
15
15
|
import {
|
|
16
16
|
getLatestPackageVersion,
|
|
17
17
|
getNpmRegistryUrl
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-hffr3myr.js";
|
|
19
19
|
import {
|
|
20
20
|
PackageScript
|
|
21
|
-
} from "./index-
|
|
22
|
-
import"./index-
|
|
21
|
+
} from "./index-ffrhjdwd.js";
|
|
22
|
+
import"./index-zec5gcx0.js";
|
|
23
23
|
import {
|
|
24
24
|
GlobalConfig
|
|
25
25
|
} from "./index-safgeq9a.js";
|
|
26
26
|
import {
|
|
27
27
|
AgentScript
|
|
28
|
-
} from "./index-
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
28
|
+
} from "./index-dfn0kqj7.js";
|
|
29
|
+
import"./index-w0g7hcr7.js";
|
|
30
|
+
import"./index-6w77v5df.js";
|
|
31
31
|
import"./index-k7731a4v.js";
|
|
32
32
|
import {
|
|
33
33
|
ApplicationScript
|
|
34
|
-
} from "./index-
|
|
34
|
+
} from "./index-4930mtpt.js";
|
|
35
35
|
import {
|
|
36
36
|
LibraryScript
|
|
37
|
-
} from "./index-
|
|
37
|
+
} from "./index-ym4xqjhy.js";
|
|
38
38
|
import"./index-76rn3g2c.js";
|
|
39
39
|
import {
|
|
40
40
|
Exec,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
command,
|
|
43
43
|
runner,
|
|
44
44
|
script
|
|
45
|
-
} from "./index-
|
|
45
|
+
} from "./index-1szrbtj9.js";
|
|
46
46
|
import"./index-ynf37b66.js";
|
|
47
47
|
import {
|
|
48
48
|
ThemeValidator,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
collectScopeRecipeSources,
|
|
60
60
|
extractAgentBlock,
|
|
61
61
|
renderScopeAgentBlock
|
|
62
|
-
} from "./index-
|
|
62
|
+
} from "./index-zkrzv21w.js";
|
|
63
63
|
import"./index-dp66vwr6.js";
|
|
64
64
|
import"./index-mxvakhsm.js";
|
|
65
65
|
import {
|
package/index-3qa4f4j7.js
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
runner,
|
|
4
|
-
script
|
|
5
|
-
} from "./index-6wsjpt7b.js";
|
|
6
|
-
import {
|
|
7
|
-
LibExecutor
|
|
8
|
-
} from "./index-004ah39s.js";
|
|
9
|
-
|
|
10
|
-
// pkgs/@akanjs/cli/semver.ts
|
|
11
|
-
var stripRangeOperator = (version) => version.replace(/^[\s^~>=<v]+/, "").trim();
|
|
12
|
-
var parseVersion = (version) => {
|
|
13
|
-
return version.replace(/^[^\d]*/, "").split(/[.-]/).map((part) => Number.parseInt(part, 10)).map((part) => Number.isFinite(part) ? part : 0);
|
|
14
|
-
};
|
|
15
|
-
var compareNumeric = (a, b) => {
|
|
16
|
-
const left = parseVersion(a);
|
|
17
|
-
const right = parseVersion(b);
|
|
18
|
-
const length = Math.max(left.length, right.length);
|
|
19
|
-
for (let i = 0;i < length; i++) {
|
|
20
|
-
const diff = (left[i] ?? 0) - (right[i] ?? 0);
|
|
21
|
-
if (diff !== 0)
|
|
22
|
-
return diff > 0 ? 1 : -1;
|
|
23
|
-
}
|
|
24
|
-
return 0;
|
|
25
|
-
};
|
|
26
|
-
var compareSemver = (a, b) => {
|
|
27
|
-
try {
|
|
28
|
-
return Bun.semver.order(stripRangeOperator(a), stripRangeOperator(b));
|
|
29
|
-
} catch {
|
|
30
|
-
return compareNumeric(a, b);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
// pkgs/@akanjs/cli/library/library.runner.ts
|
|
35
|
-
class LibraryRunner extends runner("library") {
|
|
36
|
-
async createLibrary(libName, workspace) {
|
|
37
|
-
await workspace.mkdir(`libs/${libName}`);
|
|
38
|
-
await workspace.applyTemplate({ basePath: `libs/${libName}`, template: "libRoot", dict: { libName } });
|
|
39
|
-
const lib = LibExecutor.from(workspace, libName);
|
|
40
|
-
return lib;
|
|
41
|
-
}
|
|
42
|
-
async removeLibrary(lib) {
|
|
43
|
-
await lib.workspace.removeDir(`libs/${lib.name}`);
|
|
44
|
-
}
|
|
45
|
-
async#copyInstalledLibrary(workspace, libName) {
|
|
46
|
-
const installedPackageJson = `node_modules/akanjs/libs/${libName}/package.json`;
|
|
47
|
-
if (!await workspace.exists(installedPackageJson))
|
|
48
|
-
return false;
|
|
49
|
-
await workspace.cp(`node_modules/akanjs/libs/${libName}`, `libs/${libName}`);
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
async#copyLibraryFromRepository(workspace, libName) {
|
|
53
|
-
await workspace.mkdir("node_modules/.akan");
|
|
54
|
-
if (await workspace.exists("node_modules/.akan/akanjs"))
|
|
55
|
-
await workspace.removeDir("node_modules/.akan/akanjs");
|
|
56
|
-
await workspace.exec(`cd node_modules/.akan && git clone https://github.com/akan-team/akanjs.git`);
|
|
57
|
-
await workspace.cp(`node_modules/.akan/akanjs/libs/${libName}`, `libs/${libName}`);
|
|
58
|
-
}
|
|
59
|
-
async installLibrary(workspace, libName) {
|
|
60
|
-
const copiedFromInstalledPackage = await this.#copyInstalledLibrary(workspace, libName);
|
|
61
|
-
if (!copiedFromInstalledPackage)
|
|
62
|
-
await this.#copyLibraryFromRepository(workspace, libName);
|
|
63
|
-
await workspace.cp(`libs/${libName}/env/env.server.example.ts`, `libs/${libName}/env/env.server.testing.ts`);
|
|
64
|
-
await workspace.commit(`Add ${libName} library`);
|
|
65
|
-
return LibExecutor.from(workspace, libName);
|
|
66
|
-
}
|
|
67
|
-
async mergeLibraryDependencies(lib) {
|
|
68
|
-
const libPackageJson = await lib.getPackageJson();
|
|
69
|
-
const rootPackageJson = await lib.workspace.getPackageJson();
|
|
70
|
-
const dependencies = {};
|
|
71
|
-
const devDependencies = {};
|
|
72
|
-
const libDependencies = { ...libPackageJson.dependencies, ...libPackageJson.devDependencies };
|
|
73
|
-
const rootDependencies = { ...rootPackageJson.dependencies, ...rootPackageJson.devDependencies };
|
|
74
|
-
const allDependencies = Object.fromEntries(Object.keys({ ...libDependencies, ...rootDependencies }).map((dep) => {
|
|
75
|
-
const libVersion = libDependencies[dep] ?? "0.0.0";
|
|
76
|
-
const rootVersion = rootDependencies[dep] ?? "0.0.0";
|
|
77
|
-
const newerVersion = compareSemver(rootVersion, libVersion) > 0 ? rootVersion : libVersion;
|
|
78
|
-
return [dep, newerVersion];
|
|
79
|
-
}));
|
|
80
|
-
Object.keys(allDependencies).sort().forEach((dep) => {
|
|
81
|
-
if (libPackageJson.dependencies?.[dep] || rootPackageJson.dependencies?.[dep])
|
|
82
|
-
dependencies[dep] = allDependencies[dep];
|
|
83
|
-
else
|
|
84
|
-
devDependencies[dep] = allDependencies[dep];
|
|
85
|
-
});
|
|
86
|
-
const newRootPackageJson = { ...rootPackageJson, dependencies, devDependencies };
|
|
87
|
-
await lib.workspace.setPackageJson(newRootPackageJson);
|
|
88
|
-
await lib.workspace.spawn("bun", ["install"]);
|
|
89
|
-
await lib.workspace.commit(`Merge ${lib.name} library dependencies`);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// pkgs/@akanjs/cli/library/library.script.ts
|
|
94
|
-
class LibraryScript extends script("library", [LibraryRunner]) {
|
|
95
|
-
async syncLibrary(lib) {
|
|
96
|
-
const syncSpinner = lib.spinning("Syncing library...");
|
|
97
|
-
const scanInfo = await lib.scan();
|
|
98
|
-
syncSpinner.succeed(`Library ${lib.name} (libs/${lib.name}) is synced`);
|
|
99
|
-
return scanInfo;
|
|
100
|
-
}
|
|
101
|
-
async createLibrary(libName, workspace) {
|
|
102
|
-
const spinner = workspace.spinning(`Creating ${libName} library`);
|
|
103
|
-
const lib = await this.libraryRunner.createLibrary(libName, workspace);
|
|
104
|
-
spinner.succeed(`${libName} library (libs/${libName}) is created`);
|
|
105
|
-
await this.syncLibrary(lib);
|
|
106
|
-
}
|
|
107
|
-
async removeLibrary(lib) {
|
|
108
|
-
const spinner = lib.spinning("Removing library...");
|
|
109
|
-
await this.libraryRunner.removeLibrary(lib);
|
|
110
|
-
spinner.succeed(`Library ${lib.name} (libs/${lib.name}) is removed`);
|
|
111
|
-
}
|
|
112
|
-
async installLibrary(workspace, libName) {
|
|
113
|
-
const installSpinner = workspace.spinning(`Installing ${libName} library`);
|
|
114
|
-
const lib = await this.libraryRunner.installLibrary(workspace, libName);
|
|
115
|
-
installSpinner.succeed(`${libName} library (libs/${libName}) is installed`);
|
|
116
|
-
const mergeSpinner = lib.spinning("Merging library dependencies...");
|
|
117
|
-
await this.libraryRunner.mergeLibraryDependencies(lib);
|
|
118
|
-
mergeSpinner.succeed(`${libName} library (libs/${libName}) dependencies merged to root package.json`);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export { LibraryScript };
|