@akanjs/cli 0.0.64 → 0.0.66
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/index.js +108 -35
- package/package.json +2 -1
- package/pkgs/@akanjs/cli/src/library/library.runner.d.ts +3 -2
- package/pkgs/@akanjs/cli/src/library/library.script.d.ts +1 -1
- package/pkgs/@akanjs/cli/src/package/package.command.d.ts +1 -0
- package/pkgs/@akanjs/cli/src/package/package.runner.d.ts +1 -0
- package/pkgs/@akanjs/cli/src/package/package.script.d.ts +1 -0
package/index.js
CHANGED
|
@@ -1375,6 +1375,25 @@ var SysExecutor = class extends Executor {
|
|
|
1375
1375
|
if (this.type === "lib")
|
|
1376
1376
|
await this.applyTemplate({ basePath: ".", template: "index.ts", scanResult });
|
|
1377
1377
|
this.writeJson(`akan.${this.type}.json`, scanResult);
|
|
1378
|
+
if (this.type === "app")
|
|
1379
|
+
return scanResult;
|
|
1380
|
+
const libPackageJson = this.readJson("package.json");
|
|
1381
|
+
const libPkgJsonWithDeps = {
|
|
1382
|
+
...libPackageJson,
|
|
1383
|
+
dependencies: {
|
|
1384
|
+
...libPackageJson.dependencies,
|
|
1385
|
+
...Object.fromEntries(
|
|
1386
|
+
scanResult.dependencies.filter((dep) => rootPackageJson.dependencies?.[dep]).sort().map((dep) => [dep, rootPackageJson.dependencies?.[dep]])
|
|
1387
|
+
)
|
|
1388
|
+
},
|
|
1389
|
+
devDependencies: {
|
|
1390
|
+
...libPackageJson.devDependencies,
|
|
1391
|
+
...Object.fromEntries(
|
|
1392
|
+
scanResult.dependencies.filter((dep) => rootPackageJson.devDependencies?.[dep]).sort().map((dep) => [dep, rootPackageJson.devDependencies?.[dep]])
|
|
1393
|
+
)
|
|
1394
|
+
}
|
|
1395
|
+
};
|
|
1396
|
+
this.writeJson("package.json", libPkgJsonWithDeps);
|
|
1378
1397
|
return scanResult;
|
|
1379
1398
|
}
|
|
1380
1399
|
getLocalFile(filePath) {
|
|
@@ -1837,6 +1856,7 @@ var Target = {
|
|
|
1837
1856
|
// pkgs/@akanjs/devkit/src/commandDecorators/command.ts
|
|
1838
1857
|
var import_prompts3 = require("@inquirer/prompts");
|
|
1839
1858
|
var import_commander = require("commander");
|
|
1859
|
+
var import_fs10 = __toESM(require("fs"), 1);
|
|
1840
1860
|
var camelToKebabCase = (str) => str.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1841
1861
|
var handleOption = (programCommand, argMeta) => {
|
|
1842
1862
|
const {
|
|
@@ -1926,7 +1946,9 @@ var getArgumentValue = async (argMeta, value, workspace) => {
|
|
|
1926
1946
|
throw new Error(`Invalid system type: ${argMeta.type}`);
|
|
1927
1947
|
};
|
|
1928
1948
|
var runCommands = async (...commands) => {
|
|
1929
|
-
|
|
1949
|
+
const hasPackageJson = import_fs10.default.existsSync("package.json");
|
|
1950
|
+
const version = hasPackageJson ? JSON.parse(import_fs10.default.readFileSync("package.json", "utf8")).version : "0.0.1";
|
|
1951
|
+
import_commander.program.version(version).description("Akan CLI");
|
|
1930
1952
|
for (const command of commands) {
|
|
1931
1953
|
const targetMetas = getTargetMetas(command);
|
|
1932
1954
|
for (const targetMeta of targetMetas) {
|
|
@@ -2039,6 +2061,7 @@ var AiSession = class _AiSession {
|
|
|
2039
2061
|
};
|
|
2040
2062
|
|
|
2041
2063
|
// pkgs/@akanjs/cli/src/library/library.runner.ts
|
|
2064
|
+
var import_compare_versions = require("compare-versions");
|
|
2042
2065
|
var LibraryRunner = class {
|
|
2043
2066
|
async scanSync(lib) {
|
|
2044
2067
|
const akanConfig = await lib.getConfig();
|
|
@@ -2051,13 +2074,43 @@ var LibraryRunner = class {
|
|
|
2051
2074
|
await workspace.cp(`libs/${libName}/env/env.server.example.ts`, `libs/${libName}/env/env.server.testing.ts`);
|
|
2052
2075
|
workspace.setTsPaths("lib", libName);
|
|
2053
2076
|
await workspace.commit(`Add ${libName} library`);
|
|
2077
|
+
return LibExecutor.from(workspace, libName);
|
|
2078
|
+
}
|
|
2079
|
+
async mergeLibraryDependencies(lib) {
|
|
2080
|
+
const libPackageJson = lib.readJson("package.json");
|
|
2081
|
+
const rootPackageJson = lib.workspace.readJson("package.json");
|
|
2082
|
+
const dependencies = {};
|
|
2083
|
+
const devDependencies = {};
|
|
2084
|
+
const libDependencies = { ...libPackageJson.dependencies, ...libPackageJson.devDependencies };
|
|
2085
|
+
const rootDependencies = { ...rootPackageJson.dependencies, ...rootPackageJson.devDependencies };
|
|
2086
|
+
const allDependencies = Object.fromEntries(
|
|
2087
|
+
Object.keys({ ...libDependencies, ...rootDependencies }).map((dep) => {
|
|
2088
|
+
const libVersion = libDependencies[dep] ?? "0.0.0";
|
|
2089
|
+
const rootVersion = rootDependencies[dep] ?? "0.0.0";
|
|
2090
|
+
const newerVersion = (0, import_compare_versions.compareVersions)(rootVersion, libVersion) > 0 ? rootVersion : libVersion;
|
|
2091
|
+
return [dep, newerVersion];
|
|
2092
|
+
})
|
|
2093
|
+
);
|
|
2094
|
+
Object.keys(allDependencies).sort().forEach((dep) => {
|
|
2095
|
+
if (!!rootDependencies[dep] || !!libDependencies[dep])
|
|
2096
|
+
dependencies[dep] = allDependencies[dep];
|
|
2097
|
+
else
|
|
2098
|
+
devDependencies[dep] = allDependencies[dep];
|
|
2099
|
+
});
|
|
2100
|
+
const newRootPackageJson = { ...rootPackageJson, dependencies, devDependencies };
|
|
2101
|
+
lib.workspace.writeJson("package.json", newRootPackageJson);
|
|
2102
|
+
await lib.workspace.spawn("pnpm", ["install"]);
|
|
2054
2103
|
}
|
|
2055
2104
|
async pushLibrary(lib, branch) {
|
|
2056
|
-
await lib.workspace.exec(
|
|
2105
|
+
await lib.workspace.exec(
|
|
2106
|
+
`git subtree push --prefix=libs/${lib.name} git@github.com:akan-team/${lib.name}.git ${branch}`
|
|
2107
|
+
);
|
|
2057
2108
|
lib.logger.log(`${lib.name} library pushed to ${branch} branch`);
|
|
2058
2109
|
}
|
|
2059
2110
|
async pullLibrary(lib, branch) {
|
|
2060
|
-
await lib.workspace.exec(
|
|
2111
|
+
await lib.workspace.exec(
|
|
2112
|
+
`git subtree pull --prefix=libs/${lib.name} git@github.com:akan-team/${lib.name}.git ${branch}`
|
|
2113
|
+
);
|
|
2061
2114
|
lib.logger.log(`${lib.name} library pulled from ${branch} branch`);
|
|
2062
2115
|
}
|
|
2063
2116
|
};
|
|
@@ -2065,26 +2118,30 @@ var LibraryRunner = class {
|
|
|
2065
2118
|
// pkgs/@akanjs/cli/src/library/library.script.ts
|
|
2066
2119
|
var LibraryScript = class {
|
|
2067
2120
|
#runner = new LibraryRunner();
|
|
2068
|
-
async scanLibrary(lib) {
|
|
2121
|
+
async scanLibrary(lib, verbose = false) {
|
|
2069
2122
|
const scanResult = await this.#runner.scanSync(lib);
|
|
2070
|
-
|
|
2123
|
+
if (verbose)
|
|
2124
|
+
lib.logger.rawLog(JSON.stringify(scanResult, null, 2));
|
|
2125
|
+
return scanResult;
|
|
2071
2126
|
}
|
|
2072
2127
|
async syncLibrary(lib, { recursive = true } = {}) {
|
|
2073
|
-
const scanResult = await this
|
|
2074
|
-
if (recursive)
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2128
|
+
const scanResult = await this.scanLibrary(lib);
|
|
2129
|
+
if (!recursive)
|
|
2130
|
+
return;
|
|
2131
|
+
for (const libName of scanResult.akanConfig.libs)
|
|
2132
|
+
await this.syncLibrary(LibExecutor.from(lib.workspace, libName), { recursive: false });
|
|
2078
2133
|
}
|
|
2079
2134
|
async installLibrary(workspace, libName) {
|
|
2080
|
-
await this.#runner.installLibrary(workspace, libName);
|
|
2135
|
+
const lib = await this.#runner.installLibrary(workspace, libName);
|
|
2081
2136
|
workspace.log(`${libName} library installed`);
|
|
2137
|
+
await this.#runner.mergeLibraryDependencies(lib);
|
|
2082
2138
|
}
|
|
2083
2139
|
async pushLibrary(lib, branch) {
|
|
2084
2140
|
await this.#runner.pushLibrary(lib, branch);
|
|
2085
2141
|
}
|
|
2086
2142
|
async pullLibrary(lib, branch) {
|
|
2087
2143
|
await this.#runner.pullLibrary(lib, branch);
|
|
2144
|
+
await this.#runner.mergeLibraryDependencies(lib);
|
|
2088
2145
|
}
|
|
2089
2146
|
};
|
|
2090
2147
|
|
|
@@ -2097,7 +2154,7 @@ var import_openai3 = require("@langchain/openai");
|
|
|
2097
2154
|
var import_plugin_react = __toESM(require("@vitejs/plugin-react"));
|
|
2098
2155
|
var import_dotenv = __toESM(require("dotenv"));
|
|
2099
2156
|
var esbuild = __toESM(require("esbuild"));
|
|
2100
|
-
var
|
|
2157
|
+
var import_fs11 = __toESM(require("fs"));
|
|
2101
2158
|
var import_promises2 = __toESM(require("fs/promises"));
|
|
2102
2159
|
var import_js_yaml2 = __toESM(require("js-yaml"));
|
|
2103
2160
|
var import_ora2 = __toESM(require("ora"));
|
|
@@ -3266,7 +3323,7 @@ var ApplicationRunner = class {
|
|
|
3266
3323
|
app.log(`CSR server is running on http://localhost:4201`);
|
|
3267
3324
|
}
|
|
3268
3325
|
async #prepareIos(app) {
|
|
3269
|
-
const isAdded =
|
|
3326
|
+
const isAdded = import_fs11.default.existsSync(`${app.cwdPath}/ios/App/Podfile`);
|
|
3270
3327
|
if (!isAdded) {
|
|
3271
3328
|
await app.spawn("npx", ["cap", "add", "ios"]);
|
|
3272
3329
|
await app.spawn("npx", ["@capacitor/assets", "generate"]);
|
|
@@ -3301,7 +3358,7 @@ var ApplicationRunner = class {
|
|
|
3301
3358
|
await capacitorApp.releaseIos();
|
|
3302
3359
|
}
|
|
3303
3360
|
async #prepareAndroid(app) {
|
|
3304
|
-
const isAdded =
|
|
3361
|
+
const isAdded = import_fs11.default.existsSync(`${app.cwdPath}/android/app/build.gradle`);
|
|
3305
3362
|
if (!isAdded) {
|
|
3306
3363
|
await app.spawn("npx", ["cap", "add", "android"]);
|
|
3307
3364
|
await app.spawn("npx", ["@capacitor/assets", "generate"]);
|
|
@@ -3384,14 +3441,14 @@ var ApplicationRunner = class {
|
|
|
3384
3441
|
const buildRoot = `${app.workspace.workspaceRoot}/releases/builds/${app.name}`;
|
|
3385
3442
|
const appVersionInfo = import_js_yaml2.default.load(app.readFile("config.yaml"));
|
|
3386
3443
|
const platformVersion = appVersionInfo.platforms.android.versionName;
|
|
3387
|
-
if (
|
|
3444
|
+
if (import_fs11.default.existsSync(buildRoot))
|
|
3388
3445
|
await import_promises2.default.rm(buildRoot, { recursive: true, force: true });
|
|
3389
3446
|
await import_promises2.default.mkdir(buildRoot, { recursive: true });
|
|
3390
|
-
if (rebuild || !
|
|
3447
|
+
if (rebuild || !import_fs11.default.existsSync(`${distApp.cwdPath}/backend`))
|
|
3391
3448
|
await this.buildBackend(app, distApp);
|
|
3392
|
-
if (rebuild || !
|
|
3449
|
+
if (rebuild || !import_fs11.default.existsSync(`${distApp.cwdPath}/frontend`))
|
|
3393
3450
|
await this.buildFrontend(app, distApp);
|
|
3394
|
-
if (rebuild || !
|
|
3451
|
+
if (rebuild || !import_fs11.default.existsSync(`${distApp.cwdPath}/csr`))
|
|
3395
3452
|
await this.buildCsr(app, distApp);
|
|
3396
3453
|
const buildVersion = `${platformVersion}-${buildNum}`;
|
|
3397
3454
|
const buildPath = `${buildRoot}/${buildVersion}`;
|
|
@@ -3406,7 +3463,7 @@ var ApplicationRunner = class {
|
|
|
3406
3463
|
buildRoot,
|
|
3407
3464
|
"./"
|
|
3408
3465
|
]);
|
|
3409
|
-
if (
|
|
3466
|
+
if (import_fs11.default.existsSync(`${distApp.cwdPath}/csr`)) {
|
|
3410
3467
|
await import_promises2.default.cp(`${distApp.cwdPath}/csr`, "./csr", { recursive: true });
|
|
3411
3468
|
await app.workspace.spawn("zip", [
|
|
3412
3469
|
"-r",
|
|
@@ -3416,7 +3473,7 @@ var ApplicationRunner = class {
|
|
|
3416
3473
|
await import_promises2.default.rm("./csr", { recursive: true, force: true });
|
|
3417
3474
|
}
|
|
3418
3475
|
const sourceRoot = `${app.workspace.workspaceRoot}/releases/sources/${app.name}`;
|
|
3419
|
-
if (
|
|
3476
|
+
if (import_fs11.default.existsSync(sourceRoot)) {
|
|
3420
3477
|
const MAX_RETRY = 3;
|
|
3421
3478
|
for (let i = 0; i < MAX_RETRY; i++) {
|
|
3422
3479
|
try {
|
|
@@ -3436,7 +3493,7 @@ var ApplicationRunner = class {
|
|
|
3436
3493
|
await Promise.all(
|
|
3437
3494
|
[".next", "ios", "android", "public/libs"].map(async (path7) => {
|
|
3438
3495
|
const targetPath = `${sourceRoot}/apps/${app.name}/${path7}`;
|
|
3439
|
-
if (
|
|
3496
|
+
if (import_fs11.default.existsSync(targetPath))
|
|
3440
3497
|
await import_promises2.default.rm(targetPath, { recursive: true, force: true });
|
|
3441
3498
|
})
|
|
3442
3499
|
);
|
|
@@ -3464,8 +3521,8 @@ var ApplicationRunner = class {
|
|
|
3464
3521
|
[]
|
|
3465
3522
|
)
|
|
3466
3523
|
]);
|
|
3467
|
-
|
|
3468
|
-
|
|
3524
|
+
import_fs11.default.writeFileSync(`${sourceRoot}/tsconfig.json`, JSON.stringify(tsconfig, null, 2));
|
|
3525
|
+
import_fs11.default.writeFileSync(
|
|
3469
3526
|
`${sourceRoot}/README.md`,
|
|
3470
3527
|
`# ${app.name}
|
|
3471
3528
|
\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.
|
|
@@ -3858,8 +3915,14 @@ ApplicationCommand = __decorateClass([
|
|
|
3858
3915
|
// pkgs/@akanjs/cli/src/package/package.runner.ts
|
|
3859
3916
|
var esbuild2 = __toESM(require("esbuild"));
|
|
3860
3917
|
var import_esbuild_plugin_d = require("esbuild-plugin-d.ts");
|
|
3918
|
+
var import_fs12 = __toESM(require("fs"));
|
|
3861
3919
|
var import_promises3 = __toESM(require("fs/promises"));
|
|
3862
3920
|
var PackageRunner = class {
|
|
3921
|
+
async version(workspace) {
|
|
3922
|
+
const pkgJson = JSON.parse(await import_promises3.default.readFile("package.json", "utf-8"));
|
|
3923
|
+
const version = pkgJson.version;
|
|
3924
|
+
Logger.rawLog(`${pkgJson.name}@${version}`);
|
|
3925
|
+
}
|
|
3863
3926
|
async createPackage(workspace, pkgName) {
|
|
3864
3927
|
await workspace.applyTemplate({
|
|
3865
3928
|
basePath: `pkgs/${pkgName}`,
|
|
@@ -3874,8 +3937,8 @@ var PackageRunner = class {
|
|
|
3874
3937
|
async buildPackage(pkg, distPkg) {
|
|
3875
3938
|
const rootPackageJson = pkg.workspace.readJson("package.json");
|
|
3876
3939
|
const pkgJson = pkg.readJson("package.json");
|
|
3877
|
-
|
|
3878
|
-
|
|
3940
|
+
if (import_fs12.default.existsSync(distPkg.cwdPath))
|
|
3941
|
+
await pkg.workspace.exec(`rm -rf ${distPkg.cwdPath}`);
|
|
3879
3942
|
let buildResult;
|
|
3880
3943
|
if (pkg.name === "@akanjs/config") {
|
|
3881
3944
|
buildResult = await esbuild2.build({
|
|
@@ -3974,6 +4037,9 @@ var PackageRunner = class {
|
|
|
3974
4037
|
// pkgs/@akanjs/cli/src/package/package.script.ts
|
|
3975
4038
|
var PackageScript = class {
|
|
3976
4039
|
#runner = new PackageRunner();
|
|
4040
|
+
async version(workspace) {
|
|
4041
|
+
await this.#runner.version(workspace);
|
|
4042
|
+
}
|
|
3977
4043
|
async createPackage(workspace, pkgName) {
|
|
3978
4044
|
await this.#runner.createPackage(workspace, pkgName);
|
|
3979
4045
|
}
|
|
@@ -4162,7 +4228,7 @@ var LibraryCommand = class {
|
|
|
4162
4228
|
async removeLibrary(lib, workspace) {
|
|
4163
4229
|
}
|
|
4164
4230
|
async scanLibrary(lib) {
|
|
4165
|
-
await this.libraryScript.scanLibrary(lib);
|
|
4231
|
+
await this.libraryScript.scanLibrary(lib, true);
|
|
4166
4232
|
}
|
|
4167
4233
|
async buildLibrary(lib) {
|
|
4168
4234
|
}
|
|
@@ -4218,14 +4284,14 @@ var import_output_parsers2 = require("@langchain/core/output_parsers");
|
|
|
4218
4284
|
var import_prompts8 = require("@langchain/core/prompts");
|
|
4219
4285
|
var import_runnables3 = require("@langchain/core/runnables");
|
|
4220
4286
|
var import_openai4 = require("@langchain/openai");
|
|
4221
|
-
var
|
|
4287
|
+
var import_fs13 = __toESM(require("fs"));
|
|
4222
4288
|
var ModuleRunner = class {
|
|
4223
4289
|
async createModule(workspace, moduleName) {
|
|
4224
4290
|
const openAIApiKey = process.env.OPENAI_API_KEY;
|
|
4225
4291
|
if (!openAIApiKey)
|
|
4226
4292
|
throw new Error("OPENAI_API_KEY is not set");
|
|
4227
4293
|
const chatModel = new import_openai4.ChatOpenAI({ modelName: "gpt-4o", openAIApiKey });
|
|
4228
|
-
const projectConfig = JSON.parse(
|
|
4294
|
+
const projectConfig = JSON.parse(import_fs13.default.readFileSync(`rootPath/projectConfig.json`, "utf-8"));
|
|
4229
4295
|
const mainPrompt = import_prompts8.PromptTemplate.fromTemplate(requestModule());
|
|
4230
4296
|
const chain = import_runnables3.RunnableSequence.from([mainPrompt, chatModel, new import_output_parsers2.StringOutputParser()]);
|
|
4231
4297
|
const resultOne = await chain.invoke({
|
|
@@ -4279,7 +4345,7 @@ ${paths ? new Array(paths.size).fill(0).map((_, index) => {
|
|
|
4279
4345
|
if (!filePath)
|
|
4280
4346
|
throw new Error("filePath is undefined");
|
|
4281
4347
|
return `${key}
|
|
4282
|
-
\`\`\`${
|
|
4348
|
+
\`\`\`${import_fs13.default.readFileSync(filePath, "utf8")}\`\`\`\`
|
|
4283
4349
|
|
|
4284
4350
|
`;
|
|
4285
4351
|
}) : ""}
|
|
@@ -4294,11 +4360,11 @@ css\uB77C\uC774\uBE0C\uB7EC\uB9AC\uB294 DaisyUI\uB97C \uAE30\uBC18\uC73C\uB85C \
|
|
|
4294
4360
|
${names.Model}.Unit.Card\uC758 \uB9AC\uC561\uD2B8 \uCEF4\uD3EC\uB10C\uD2B8\uB97C \uB514\uC790\uC778\uD574\uC11C \uC791\uC131\uD574\uC918.
|
|
4295
4361
|
`;
|
|
4296
4362
|
try {
|
|
4297
|
-
|
|
4363
|
+
import_fs13.default.writeFileSync("./local/prompt.txt", prompt);
|
|
4298
4364
|
const { content } = await streamAi(prompt, (chunk) => {
|
|
4299
4365
|
process.stdout.write(chunk);
|
|
4300
4366
|
});
|
|
4301
|
-
|
|
4367
|
+
import_fs13.default.writeFileSync("./local/result.txt", content);
|
|
4302
4368
|
} catch (error) {
|
|
4303
4369
|
}
|
|
4304
4370
|
}
|
|
@@ -4325,7 +4391,7 @@ ${names.Model}.Unit.Card\uC758 \uB9AC\uC561\uD2B8 \uCEF4\uD3EC\uB10C\uD2B8\uB97C
|
|
|
4325
4391
|
if (!filePath)
|
|
4326
4392
|
throw new Error("filePath is undefined");
|
|
4327
4393
|
return `${key}
|
|
4328
|
-
\`\`\`${
|
|
4394
|
+
\`\`\`${import_fs13.default.readFileSync(filePath, "utf8")}\`\`\`\`
|
|
4329
4395
|
|
|
4330
4396
|
`;
|
|
4331
4397
|
}) : ""}
|
|
@@ -4340,11 +4406,11 @@ ${names.Model}.Unit.Card\uC758 \uB9AC\uC561\uD2B8 \uCEF4\uD3EC\uB10C\uD2B8\uB97C
|
|
|
4340
4406
|
${names.Model}.View.General \uB9AC\uC561\uD2B8 \uCEF4\uD3EC\uB10C\uD2B8\uB97C \uB514\uC790\uC778\uD574\uC11C \uC791\uC131\uD574\uC918.
|
|
4341
4407
|
`;
|
|
4342
4408
|
try {
|
|
4343
|
-
|
|
4409
|
+
import_fs13.default.writeFileSync("./local/prompt.txt", prompt);
|
|
4344
4410
|
const { content } = await streamAi(prompt, (chunk) => {
|
|
4345
4411
|
process.stdout.write(chunk);
|
|
4346
4412
|
});
|
|
4347
|
-
|
|
4413
|
+
import_fs13.default.writeFileSync("./local/result.txt", content);
|
|
4348
4414
|
} catch (error) {
|
|
4349
4415
|
}
|
|
4350
4416
|
}
|
|
@@ -4459,6 +4525,9 @@ ModuleCommand = __decorateClass([
|
|
|
4459
4525
|
// pkgs/@akanjs/cli/src/package/package.command.ts
|
|
4460
4526
|
var PackageCommand = class {
|
|
4461
4527
|
packageScript = new PackageScript();
|
|
4528
|
+
async version(workspace) {
|
|
4529
|
+
await this.packageScript.version(workspace);
|
|
4530
|
+
}
|
|
4462
4531
|
async createPackage(name, workspace) {
|
|
4463
4532
|
await this.packageScript.createPackage(workspace, name);
|
|
4464
4533
|
}
|
|
@@ -4471,6 +4540,10 @@ var PackageCommand = class {
|
|
|
4471
4540
|
await this.packageScript.buildPackage(pkg);
|
|
4472
4541
|
}
|
|
4473
4542
|
};
|
|
4543
|
+
__decorateClass([
|
|
4544
|
+
Target.Public(),
|
|
4545
|
+
__decorateParam(0, Workspace())
|
|
4546
|
+
], PackageCommand.prototype, "version", 1);
|
|
4474
4547
|
__decorateClass([
|
|
4475
4548
|
Target.Public(),
|
|
4476
4549
|
__decorateParam(0, Option("name", { desc: "name of package" })),
|
|
@@ -4659,7 +4732,7 @@ WorkspaceCommand = __decorateClass([
|
|
|
4659
4732
|
], WorkspaceCommand);
|
|
4660
4733
|
|
|
4661
4734
|
// pkgs/@akanjs/cli/index.ts
|
|
4662
|
-
require("dotenv").config();
|
|
4735
|
+
require("dotenv").config({ path: `${process.cwd()}/.env` });
|
|
4663
4736
|
void runCommands(
|
|
4664
4737
|
WorkspaceCommand,
|
|
4665
4738
|
ApplicationCommand,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "commonjs",
|
|
3
3
|
"name": "@akanjs/cli",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.66",
|
|
5
5
|
"bin": {
|
|
6
6
|
"akan": "index.js"
|
|
7
7
|
},
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"axios": "^1.7.9",
|
|
29
29
|
"chalk": "^5.4.1",
|
|
30
30
|
"commander": "^13.1.0",
|
|
31
|
+
"compare-versions": "^6.1.1",
|
|
31
32
|
"dayjs": "^1.11.13",
|
|
32
33
|
"dotenv": "^16.4.7",
|
|
33
34
|
"esbuild": "^0.19.2",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Lib, Workspace } from "@akanjs/devkit";
|
|
1
|
+
import { Lib, LibExecutor, Workspace } from "@akanjs/devkit";
|
|
2
2
|
export declare class LibraryRunner {
|
|
3
3
|
scanSync(lib: Lib): Promise<import("@akanjs/config").AppScanResult | import("@akanjs/config").LibScanResult>;
|
|
4
|
-
installLibrary(workspace: Workspace, libName: string): Promise<
|
|
4
|
+
installLibrary(workspace: Workspace, libName: string): Promise<LibExecutor>;
|
|
5
|
+
mergeLibraryDependencies(lib: Lib): Promise<void>;
|
|
5
6
|
pushLibrary(lib: Lib, branch: string): Promise<void>;
|
|
6
7
|
pullLibrary(lib: Lib, branch: string): Promise<void>;
|
|
7
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Lib, Workspace } from "@akanjs/devkit";
|
|
2
2
|
export declare class LibraryScript {
|
|
3
3
|
#private;
|
|
4
|
-
scanLibrary(lib: Lib): Promise<
|
|
4
|
+
scanLibrary(lib: Lib, verbose?: boolean): Promise<import("@akanjs/config").AppScanResult | import("@akanjs/config").LibScanResult>;
|
|
5
5
|
syncLibrary(lib: Lib, { recursive }?: {
|
|
6
6
|
recursive?: boolean;
|
|
7
7
|
}): Promise<void>;
|
|
@@ -2,6 +2,7 @@ import { Pkg, Workspace } from "@akanjs/devkit";
|
|
|
2
2
|
import { PackageScript } from "./package.script";
|
|
3
3
|
export declare class PackageCommand {
|
|
4
4
|
packageScript: PackageScript;
|
|
5
|
+
version(workspace: Workspace): Promise<void>;
|
|
5
6
|
createPackage(name: string, workspace: Workspace): Promise<void>;
|
|
6
7
|
removePackage(name: string, workspace: Workspace): Promise<void>;
|
|
7
8
|
scanPackage(pkg: Pkg): Promise<void>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type DistPkgExecutor, type Pkg, type Workspace } from "@akanjs/devkit";
|
|
2
2
|
export declare class PackageRunner {
|
|
3
|
+
version(workspace: Workspace): Promise<void>;
|
|
3
4
|
createPackage(workspace: Workspace, pkgName: string): Promise<void>;
|
|
4
5
|
scanSync(pkg: Pkg): Promise<import("@akanjs/config").PkgScanResult>;
|
|
5
6
|
buildPackage(pkg: Pkg, distPkg: DistPkgExecutor): Promise<void>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DistPkgExecutor, type Pkg, type Workspace } from "@akanjs/devkit";
|
|
2
2
|
export declare class PackageScript {
|
|
3
3
|
#private;
|
|
4
|
+
version(workspace: Workspace): Promise<void>;
|
|
4
5
|
createPackage(workspace: Workspace, pkgName: string): Promise<void>;
|
|
5
6
|
scanPackage(pkg: Pkg): Promise<void>;
|
|
6
7
|
buildPackage(pkg: Pkg, distPkg?: DistPkgExecutor): Promise<void>;
|