@akanjs/cli 2.1.0-rc.0 → 2.1.0-rc.2
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/incrementalBuilder.proc.js +9615 -0
- package/index.js +172 -36
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1959,6 +1959,45 @@ var staticTemplateFileExtensions = new Set([
|
|
|
1959
1959
|
".woff2",
|
|
1960
1960
|
".xml"
|
|
1961
1961
|
]);
|
|
1962
|
+
var formatCommandArg = (value) => /^[\w@%+=:,./-]+$/.test(value) ? value : JSON.stringify(value);
|
|
1963
|
+
var formatCommandForDisplay = (command, args = []) => [command, ...args].map(formatCommandArg).join(" ");
|
|
1964
|
+
|
|
1965
|
+
class CommandExecutionError extends Error {
|
|
1966
|
+
command;
|
|
1967
|
+
args;
|
|
1968
|
+
cwd;
|
|
1969
|
+
code;
|
|
1970
|
+
signal;
|
|
1971
|
+
stdout;
|
|
1972
|
+
stderr;
|
|
1973
|
+
constructor({
|
|
1974
|
+
command,
|
|
1975
|
+
args = [],
|
|
1976
|
+
cwd,
|
|
1977
|
+
code,
|
|
1978
|
+
signal,
|
|
1979
|
+
stdout = "",
|
|
1980
|
+
stderr = "",
|
|
1981
|
+
cause
|
|
1982
|
+
}) {
|
|
1983
|
+
const displayCommand = formatCommandForDisplay(command, args);
|
|
1984
|
+
const status = signal ? `signal: ${signal}` : `exit code: ${code ?? "unknown"}`;
|
|
1985
|
+
const output = (stderr || stdout).trim();
|
|
1986
|
+
super([`Command failed: ${displayCommand}`, `cwd: ${cwd}`, status, output ? `
|
|
1987
|
+
${output}` : ""].join(`
|
|
1988
|
+
`), {
|
|
1989
|
+
cause
|
|
1990
|
+
});
|
|
1991
|
+
this.name = "CommandExecutionError";
|
|
1992
|
+
this.command = command;
|
|
1993
|
+
this.args = args;
|
|
1994
|
+
this.cwd = cwd;
|
|
1995
|
+
this.code = code;
|
|
1996
|
+
this.signal = signal;
|
|
1997
|
+
this.stdout = stdout;
|
|
1998
|
+
this.stderr = stderr;
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
1962
2001
|
var execEmoji = {
|
|
1963
2002
|
workspace: "\uD83C\uDFE0",
|
|
1964
2003
|
app: "\uD83D\uDE80",
|
|
@@ -2089,23 +2128,32 @@ class Executor {
|
|
|
2089
2128
|
Logger4.raw(chalk4.red(data.toString()));
|
|
2090
2129
|
}
|
|
2091
2130
|
exec(command, options = {}) {
|
|
2131
|
+
const cwd = options.cwd?.toString() ?? this.cwdPath;
|
|
2092
2132
|
const proc = exec(command, { cwd: this.cwdPath, ...options });
|
|
2133
|
+
let stdout = "";
|
|
2134
|
+
let stderr = "";
|
|
2093
2135
|
proc.stdout?.on("data", (data) => {
|
|
2136
|
+
stdout += data.toString();
|
|
2094
2137
|
this.#stdout(data);
|
|
2095
2138
|
});
|
|
2096
2139
|
proc.stderr?.on("data", (data) => {
|
|
2140
|
+
stderr += data.toString();
|
|
2097
2141
|
this.#stdout(data);
|
|
2098
2142
|
});
|
|
2099
2143
|
return new Promise((resolve, reject) => {
|
|
2144
|
+
proc.on("error", (error) => {
|
|
2145
|
+
reject(new CommandExecutionError({ command, cwd, code: null, signal: null, stdout, stderr, cause: error }));
|
|
2146
|
+
});
|
|
2100
2147
|
proc.on("exit", (code, signal) => {
|
|
2101
2148
|
if (!!code || signal)
|
|
2102
|
-
reject({ code, signal });
|
|
2149
|
+
reject(new CommandExecutionError({ command, cwd, code, signal, stdout, stderr }));
|
|
2103
2150
|
else
|
|
2104
2151
|
resolve({ code, signal });
|
|
2105
2152
|
});
|
|
2106
2153
|
});
|
|
2107
2154
|
}
|
|
2108
2155
|
spawn(command, args = [], options = {}) {
|
|
2156
|
+
const cwd = options.cwd?.toString() ?? this.cwdPath;
|
|
2109
2157
|
const proc = spawn(command, args, {
|
|
2110
2158
|
cwd: this.cwdPath,
|
|
2111
2159
|
...options
|
|
@@ -2123,9 +2171,12 @@ class Executor {
|
|
|
2123
2171
|
this.#stdout(data);
|
|
2124
2172
|
});
|
|
2125
2173
|
return new Promise((resolve, reject) => {
|
|
2174
|
+
proc.on("error", (error) => {
|
|
2175
|
+
reject(new CommandExecutionError({ command, args, cwd, code: null, signal: null, stdout, stderr, cause: error }));
|
|
2176
|
+
});
|
|
2126
2177
|
proc.on("close", (code, signal) => {
|
|
2127
2178
|
if (code !== 0 || signal)
|
|
2128
|
-
reject(
|
|
2179
|
+
reject(new CommandExecutionError({ command, args, cwd, code, signal, stdout, stderr }));
|
|
2129
2180
|
else
|
|
2130
2181
|
resolve(stdout);
|
|
2131
2182
|
});
|
|
@@ -2139,20 +2190,37 @@ class Executor {
|
|
|
2139
2190
|
return proc;
|
|
2140
2191
|
}
|
|
2141
2192
|
fork(modulePath, args = [], options = {}) {
|
|
2193
|
+
const cwd = options.cwd?.toString() ?? this.cwdPath;
|
|
2142
2194
|
const proc = fork(modulePath, args, {
|
|
2143
2195
|
cwd: this.cwdPath,
|
|
2144
2196
|
...options
|
|
2145
2197
|
});
|
|
2198
|
+
let stdout = "";
|
|
2199
|
+
let stderr = "";
|
|
2146
2200
|
proc.stdout?.on("data", (data) => {
|
|
2201
|
+
stdout += data.toString();
|
|
2147
2202
|
this.#stdout(data);
|
|
2148
2203
|
});
|
|
2149
2204
|
proc.stderr?.on("data", (data) => {
|
|
2205
|
+
stderr += data.toString();
|
|
2150
2206
|
this.#stderr(data);
|
|
2151
2207
|
});
|
|
2152
2208
|
return new Promise((resolve, reject) => {
|
|
2209
|
+
proc.on("error", (error) => {
|
|
2210
|
+
reject(new CommandExecutionError({
|
|
2211
|
+
command: modulePath,
|
|
2212
|
+
args,
|
|
2213
|
+
cwd,
|
|
2214
|
+
code: null,
|
|
2215
|
+
signal: null,
|
|
2216
|
+
stdout,
|
|
2217
|
+
stderr,
|
|
2218
|
+
cause: error
|
|
2219
|
+
}));
|
|
2220
|
+
});
|
|
2153
2221
|
proc.on("exit", (code, signal) => {
|
|
2154
2222
|
if (!!code || signal)
|
|
2155
|
-
reject({ code, signal });
|
|
2223
|
+
reject(new CommandExecutionError({ command: modulePath, args, cwd, code, signal, stdout, stderr }));
|
|
2156
2224
|
else
|
|
2157
2225
|
resolve({ code, signal });
|
|
2158
2226
|
});
|
|
@@ -3374,6 +3442,7 @@ class IncrementalBuilderHost {
|
|
|
3374
3442
|
const candidates = [
|
|
3375
3443
|
path8.join(app.workspace.workspaceRoot, "pkgs/@akanjs/devkit/incrementalBuilder/incrementalBuilder.proc.ts"),
|
|
3376
3444
|
path8.join(app.workspace.workspaceRoot, "node_modules/@akanjs/devkit/incrementalBuilder/incrementalBuilder.proc.ts"),
|
|
3445
|
+
path8.join(import.meta.dir, "incrementalBuilder.proc.js"),
|
|
3377
3446
|
path8.join(import.meta.dir, "incrementalBuilder.proc.ts")
|
|
3378
3447
|
];
|
|
3379
3448
|
for (const c of candidates)
|
|
@@ -8247,6 +8316,7 @@ var Pkg = createInternalArgToken("Pkg");
|
|
|
8247
8316
|
var Module = createInternalArgToken("Module");
|
|
8248
8317
|
var Workspace = createInternalArgToken("Workspace");
|
|
8249
8318
|
// pkgs/@akanjs/devkit/commandDecorators/command.ts
|
|
8319
|
+
import path35 from "path";
|
|
8250
8320
|
import { confirm, input as input2, select as select2 } from "@inquirer/prompts";
|
|
8251
8321
|
import { Logger as Logger11 } from "akanjs/common";
|
|
8252
8322
|
import chalk6 from "chalk";
|
|
@@ -8505,6 +8575,37 @@ var formatCommandHelp = (command, key) => {
|
|
|
8505
8575
|
|
|
8506
8576
|
// pkgs/@akanjs/devkit/commandDecorators/command.ts
|
|
8507
8577
|
var camelToKebabCase2 = (str) => str.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
8578
|
+
var loggedCliErrorObjects = new WeakSet;
|
|
8579
|
+
var loggedCliErrorMessages = new Set;
|
|
8580
|
+
var formatCliError = (error) => {
|
|
8581
|
+
if (error instanceof Error)
|
|
8582
|
+
return error.message || error.name;
|
|
8583
|
+
if (typeof error === "string")
|
|
8584
|
+
return error.trim() || "Unknown error";
|
|
8585
|
+
if (error === null || error === undefined)
|
|
8586
|
+
return "Unknown error";
|
|
8587
|
+
try {
|
|
8588
|
+
const json = JSON.stringify(error);
|
|
8589
|
+
if (json)
|
|
8590
|
+
return json;
|
|
8591
|
+
} catch {
|
|
8592
|
+
return String(error);
|
|
8593
|
+
}
|
|
8594
|
+
return String(error) || "Unknown error";
|
|
8595
|
+
};
|
|
8596
|
+
var printCliError = (error) => {
|
|
8597
|
+
if (typeof error === "object" && error !== null) {
|
|
8598
|
+
if (loggedCliErrorObjects.has(error))
|
|
8599
|
+
return;
|
|
8600
|
+
loggedCliErrorObjects.add(error);
|
|
8601
|
+
}
|
|
8602
|
+
const message = formatCliError(error);
|
|
8603
|
+
if (loggedCliErrorMessages.has(message))
|
|
8604
|
+
return;
|
|
8605
|
+
loggedCliErrorMessages.add(message);
|
|
8606
|
+
Logger11.rawLog(`
|
|
8607
|
+
${chalk6.red(message)}`);
|
|
8608
|
+
};
|
|
8508
8609
|
var handleOption = (programCommand, argMeta) => {
|
|
8509
8610
|
const {
|
|
8510
8611
|
type,
|
|
@@ -8711,11 +8812,22 @@ var getInternalArgumentValue = async (argMeta, value, workspace) => {
|
|
|
8711
8812
|
};
|
|
8712
8813
|
var runCommands = async (...commands) => {
|
|
8713
8814
|
process.on("unhandledRejection", (error) => {
|
|
8815
|
+
printCliError(error);
|
|
8714
8816
|
process.exit(1);
|
|
8715
8817
|
});
|
|
8716
8818
|
const __dirname2 = getDirname(import.meta.url);
|
|
8717
|
-
const
|
|
8718
|
-
|
|
8819
|
+
const packageJsonCandidates = [`${path35.dirname(Bun.main)}/package.json`, `${__dirname2}/../package.json`];
|
|
8820
|
+
let cliPackageJson = null;
|
|
8821
|
+
for (const packageJsonPath of packageJsonCandidates) {
|
|
8822
|
+
if (!await FileSys.fileExists(packageJsonPath))
|
|
8823
|
+
continue;
|
|
8824
|
+
const packageJson = await FileSys.readJson(packageJsonPath);
|
|
8825
|
+
if (packageJson.name === "@akanjs/cli" || packageJson.name === "@akanjs/devkit") {
|
|
8826
|
+
cliPackageJson = packageJson;
|
|
8827
|
+
break;
|
|
8828
|
+
}
|
|
8829
|
+
}
|
|
8830
|
+
process.env.AKAN_VERSION = cliPackageJson?.version ?? "0.0.1";
|
|
8719
8831
|
const hasHelpFlag = process.argv.includes("--help") || process.argv.includes("-h");
|
|
8720
8832
|
const hasCommand = process.argv.length > 2 && !process.argv[2]?.startsWith("-");
|
|
8721
8833
|
if (hasHelpFlag || !hasCommand) {
|
|
@@ -8791,9 +8903,7 @@ It may cause unexpected behavior. Run \`akan update\` to update latest akanjs.`)
|
|
|
8791
8903
|
await targetMeta.handler.call(cmd, ...commandArgs);
|
|
8792
8904
|
Logger11.rawLog();
|
|
8793
8905
|
} catch (e) {
|
|
8794
|
-
|
|
8795
|
-
Logger11.rawLog(`
|
|
8796
|
-
${chalk6.red(errMsg)}`);
|
|
8906
|
+
printCliError(e);
|
|
8797
8907
|
throw e;
|
|
8798
8908
|
}
|
|
8799
8909
|
});
|
|
@@ -8982,8 +9092,8 @@ var scanModuleSpecifiers = (source, filePath, includeExports) => {
|
|
|
8982
9092
|
return importSpecifiers;
|
|
8983
9093
|
};
|
|
8984
9094
|
var parseTsConfig = (tsConfigPath = "./tsconfig.json") => {
|
|
8985
|
-
const configFile = ts6.readConfigFile(tsConfigPath, (
|
|
8986
|
-
return ts6.sys.readFile(
|
|
9095
|
+
const configFile = ts6.readConfigFile(tsConfigPath, (path36) => {
|
|
9096
|
+
return ts6.sys.readFile(path36);
|
|
8987
9097
|
});
|
|
8988
9098
|
return ts6.parseJsonConfigFileContent(configFile.config, ts6.sys, realpathSync(tsConfigPath).replace(/[^/\\]+$/, ""));
|
|
8989
9099
|
};
|
|
@@ -9328,7 +9438,7 @@ class LibraryScript extends script("library", [LibraryRunner]) {
|
|
|
9328
9438
|
}
|
|
9329
9439
|
|
|
9330
9440
|
// pkgs/@akanjs/cli/application/application.runner.ts
|
|
9331
|
-
import
|
|
9441
|
+
import path36 from "path";
|
|
9332
9442
|
import { confirm as confirm2, input as input4, select as select5 } from "@inquirer/prompts";
|
|
9333
9443
|
import { StringOutputParser } from "@langchain/core/output_parsers";
|
|
9334
9444
|
import { PromptTemplate as PromptTemplate2 } from "@langchain/core/prompts";
|
|
@@ -9394,7 +9504,7 @@ class ApplicationRunner extends runner("application") {
|
|
|
9394
9504
|
}
|
|
9395
9505
|
async test(exec2) {
|
|
9396
9506
|
const isSignalTarget = exec2 instanceof AppExecutor || exec2 instanceof LibExecutor;
|
|
9397
|
-
const preloadPath =
|
|
9507
|
+
const preloadPath = path36.join(exec2.cwdPath, "../../pkgs/akanjs/test/signalTest.preload.ts");
|
|
9398
9508
|
const env = isSignalTarget ? {
|
|
9399
9509
|
AKAN_TEST_SIGNAL: "1",
|
|
9400
9510
|
AKAN_TEST_TARGET_TYPE: exec2.type,
|
|
@@ -9571,8 +9681,15 @@ class ApplicationRunner extends runner("application") {
|
|
|
9571
9681
|
cwd: `${workspace.workspaceRoot}/local`
|
|
9572
9682
|
});
|
|
9573
9683
|
return wasAlreadyUp;
|
|
9574
|
-
} catch {
|
|
9575
|
-
|
|
9684
|
+
} catch (error) {
|
|
9685
|
+
const detail = error instanceof Error ? error.message : typeof error === "string" ? error : JSON.stringify(error) || "Unknown error";
|
|
9686
|
+
throw new Error([
|
|
9687
|
+
"Docker daemon may not be running. Please install Docker or start the Docker daemon and try again.",
|
|
9688
|
+
`Original error:
|
|
9689
|
+
${detail}`
|
|
9690
|
+
].join(`
|
|
9691
|
+
|
|
9692
|
+
`));
|
|
9576
9693
|
}
|
|
9577
9694
|
}
|
|
9578
9695
|
async dbdown(workspace) {
|
|
@@ -9950,18 +10067,35 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
|
|
|
9950
10067
|
import { Logger as Logger16 } from "akanjs/common";
|
|
9951
10068
|
|
|
9952
10069
|
// pkgs/@akanjs/cli/package/package.runner.ts
|
|
9953
|
-
import
|
|
10070
|
+
import path37 from "path";
|
|
9954
10071
|
import { Logger as Logger14 } from "akanjs/common";
|
|
9955
10072
|
var {$: $2 } = globalThis.Bun;
|
|
9956
10073
|
|
|
9957
10074
|
class PackageRunner extends runner("package") {
|
|
9958
10075
|
async version(workspace, { log = true } = {}) {
|
|
9959
|
-
const pkgJson =
|
|
9960
|
-
const version = pkgJson.version;
|
|
10076
|
+
const pkgJson = process.env.USE_AKANJS_PKGS === "true" ? await FileSys.readJson(`${workspace?.workspaceRoot ?? process.cwd()}/pkgs/akanjs/package.json`) : await this.#getInstalledPackageJson();
|
|
10077
|
+
const version = pkgJson.name === "akanjs" ? pkgJson.version : pkgJson.dependencies?.akanjs ?? pkgJson.version;
|
|
9961
10078
|
if (log)
|
|
9962
|
-
Logger14.rawLog(
|
|
10079
|
+
Logger14.rawLog(`akanjs@${version}`);
|
|
9963
10080
|
return version;
|
|
9964
10081
|
}
|
|
10082
|
+
async#getInstalledPackageJson() {
|
|
10083
|
+
const packageJsonCandidates = [
|
|
10084
|
+
`${path37.dirname(Bun.main)}/package.json`,
|
|
10085
|
+
`${process.cwd()}/node_modules/akanjs/package.json`
|
|
10086
|
+
];
|
|
10087
|
+
try {
|
|
10088
|
+
packageJsonCandidates.unshift(Bun.resolveSync("akanjs/package.json", path37.dirname(Bun.main)));
|
|
10089
|
+
} catch {}
|
|
10090
|
+
for (const packageJsonPath of packageJsonCandidates) {
|
|
10091
|
+
if (!await Bun.file(packageJsonPath).exists())
|
|
10092
|
+
continue;
|
|
10093
|
+
const packageJson = await FileSys.readJson(packageJsonPath);
|
|
10094
|
+
if (packageJson.name === "akanjs" || packageJson.name === "@akanjs/cli")
|
|
10095
|
+
return packageJson;
|
|
10096
|
+
}
|
|
10097
|
+
throw new Error(`[package] failed to locate akanjs package.json from ${path37.dirname(Bun.main)}`);
|
|
10098
|
+
}
|
|
9965
10099
|
async createPackage(workspace, pkgName) {
|
|
9966
10100
|
await workspace.applyTemplate({ basePath: `pkgs/${pkgName}`, template: "pkgRoot", dict: { pkgName } });
|
|
9967
10101
|
await workspace.setPkgTsPaths(pkgName);
|
|
@@ -10308,14 +10442,14 @@ class GuidelinePrompt extends Prompter {
|
|
|
10308
10442
|
async#getScanFilePaths(matchPattern, { avoidDirs = ["node_modules", ".next"], filterText } = {}) {
|
|
10309
10443
|
const glob = new Bun.Glob(matchPattern);
|
|
10310
10444
|
const paths = [];
|
|
10311
|
-
for await (const
|
|
10312
|
-
if (avoidDirs.some((dir) =>
|
|
10445
|
+
for await (const path38 of glob.scan({ cwd: this.workspace.workspaceRoot, absolute: true })) {
|
|
10446
|
+
if (avoidDirs.some((dir) => path38.includes(dir)))
|
|
10313
10447
|
continue;
|
|
10314
|
-
const fileContent = await FileSys.readText(
|
|
10448
|
+
const fileContent = await FileSys.readText(path38);
|
|
10315
10449
|
const textFilter = filterText ? new RegExp(filterText) : null;
|
|
10316
10450
|
if (filterText && !textFilter?.test(fileContent))
|
|
10317
10451
|
continue;
|
|
10318
|
-
paths.push(
|
|
10452
|
+
paths.push(path38);
|
|
10319
10453
|
}
|
|
10320
10454
|
return paths;
|
|
10321
10455
|
}
|
|
@@ -11405,11 +11539,11 @@ class ScalarCommand extends command("scalar", [ScalarScript], ({ public: target
|
|
|
11405
11539
|
}
|
|
11406
11540
|
|
|
11407
11541
|
// pkgs/@akanjs/cli/workspace/workspace.script.ts
|
|
11408
|
-
import
|
|
11542
|
+
import path39 from "path";
|
|
11409
11543
|
import { Logger as Logger17 } from "akanjs/common";
|
|
11410
11544
|
|
|
11411
11545
|
// pkgs/@akanjs/cli/workspace/workspace.runner.ts
|
|
11412
|
-
import
|
|
11546
|
+
import path38 from "path";
|
|
11413
11547
|
var defaultWorkspacePeerDependencies = new Set([
|
|
11414
11548
|
"react",
|
|
11415
11549
|
"react-dom",
|
|
@@ -11423,7 +11557,7 @@ var defaultWorkspacePeerDependencies = new Set([
|
|
|
11423
11557
|
class WorkspaceRunner extends runner("workspace") {
|
|
11424
11558
|
async createWorkspace(repoName, appName, { dirname: dirname3 = ".", init = true, akanVersion }) {
|
|
11425
11559
|
const cwdPath = process.cwd();
|
|
11426
|
-
const workspaceRoot =
|
|
11560
|
+
const workspaceRoot = path38.join(cwdPath, dirname3, repoName);
|
|
11427
11561
|
const workspace = WorkspaceExecutor.fromRoot({ workspaceRoot, repoName });
|
|
11428
11562
|
const templateSpinner = workspace.spinning(`Creating workspace template files in ${dirname3}/${repoName}...`);
|
|
11429
11563
|
const latestTypesBunVersion = await getLatestPackageVersion("@types/bun");
|
|
@@ -11437,16 +11571,18 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
11437
11571
|
workspace.getPackageJson(),
|
|
11438
11572
|
this.#getAkanPeerDependencies()
|
|
11439
11573
|
]);
|
|
11574
|
+
const { typescript, ...dependencies } = peerDependencies;
|
|
11440
11575
|
const packageJson = {
|
|
11441
11576
|
...rootPackageJson,
|
|
11442
11577
|
dependencies: {
|
|
11443
11578
|
...rootPackageJson.dependencies,
|
|
11444
|
-
...
|
|
11579
|
+
...dependencies,
|
|
11445
11580
|
akanjs: akanVersion
|
|
11446
11581
|
},
|
|
11447
11582
|
devDependencies: {
|
|
11448
11583
|
...rootPackageJson.devDependencies,
|
|
11449
|
-
"@types/bun": latestTypesBunVersion
|
|
11584
|
+
"@types/bun": latestTypesBunVersion,
|
|
11585
|
+
...typescript ? { typescript } : {}
|
|
11450
11586
|
}
|
|
11451
11587
|
};
|
|
11452
11588
|
await workspace.setPackageJson(packageJson);
|
|
@@ -11468,9 +11604,9 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
11468
11604
|
}
|
|
11469
11605
|
async#getCliPackageJson() {
|
|
11470
11606
|
const packageJsonCandidates = [
|
|
11471
|
-
|
|
11472
|
-
|
|
11473
|
-
|
|
11607
|
+
path38.join(import.meta.dir, "../package.json"),
|
|
11608
|
+
path38.join(import.meta.dir, "package.json"),
|
|
11609
|
+
path38.join(path38.dirname(Bun.main), "package.json")
|
|
11474
11610
|
];
|
|
11475
11611
|
try {
|
|
11476
11612
|
packageJsonCandidates.unshift(Bun.resolveSync("@akanjs/cli/package.json", import.meta.dir));
|
|
@@ -11486,9 +11622,9 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
11486
11622
|
}
|
|
11487
11623
|
async#getAkanPackageJson() {
|
|
11488
11624
|
const packageJsonCandidates = [
|
|
11489
|
-
|
|
11490
|
-
|
|
11491
|
-
|
|
11625
|
+
path38.join(import.meta.dir, "../../../akanjs/package.json"),
|
|
11626
|
+
path38.join(process.cwd(), "pkgs/akanjs/package.json"),
|
|
11627
|
+
path38.join(path38.dirname(Bun.main), "node_modules/akanjs/package.json")
|
|
11492
11628
|
];
|
|
11493
11629
|
try {
|
|
11494
11630
|
packageJsonCandidates.unshift(Bun.resolveSync("akanjs/package.json", import.meta.dir));
|
|
@@ -11502,13 +11638,13 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
11502
11638
|
}
|
|
11503
11639
|
let current = import.meta.dir;
|
|
11504
11640
|
for (let depth = 0;depth < 6; depth++) {
|
|
11505
|
-
const packageJsonPath =
|
|
11641
|
+
const packageJsonPath = path38.join(current, "package.json");
|
|
11506
11642
|
if (await Bun.file(packageJsonPath).exists()) {
|
|
11507
11643
|
const packageJson = await FileSys.readJson(packageJsonPath);
|
|
11508
11644
|
if (packageJson.name === "akanjs")
|
|
11509
11645
|
return packageJson;
|
|
11510
11646
|
}
|
|
11511
|
-
const parent =
|
|
11647
|
+
const parent = path38.dirname(current);
|
|
11512
11648
|
if (parent === current)
|
|
11513
11649
|
break;
|
|
11514
11650
|
current = parent;
|
|
@@ -11551,7 +11687,7 @@ class WorkspaceScript extends script("workspace", [
|
|
|
11551
11687
|
} catch (_) {
|
|
11552
11688
|
gitSpinner.fail("Git repository initialization failed. It's not fatal, you can commit manually");
|
|
11553
11689
|
}
|
|
11554
|
-
const workspacePath =
|
|
11690
|
+
const workspacePath = path39.join(dirname3, repoName);
|
|
11555
11691
|
Logger17.rawLog(`
|
|
11556
11692
|
\uD83C\uDF89 Welcome aboard! Workspace created in ${dirname3}/${repoName}`);
|
|
11557
11693
|
Logger17.rawLog(`\uD83D\uDE80 Run \`cd ${workspacePath} && akan start ${appName}\` to start the development server.`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "2.1.0-rc.
|
|
3
|
+
"version": "2.1.0-rc.2",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@langchain/deepseek": "^1.0.26",
|
|
35
35
|
"@langchain/openai": "^1.4.6",
|
|
36
36
|
"@trapezedev/project": "^7.1.4",
|
|
37
|
-
"akanjs": "2.1.0-rc.
|
|
37
|
+
"akanjs": "2.1.0-rc.1",
|
|
38
38
|
"chalk": "^5.6.2",
|
|
39
39
|
"commander": "^14.0.3",
|
|
40
40
|
"fontaine": "^0.8.0",
|