@akanjs/cli 0.9.37 → 0.9.39
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/cjs/index.js
CHANGED
|
@@ -2918,8 +2918,18 @@ var runCommands = async (...commands) => {
|
|
|
2918
2918
|
});
|
|
2919
2919
|
const __dirname = getDirname(import_meta3.url);
|
|
2920
2920
|
const hasPackageJson = import_fs7.default.existsSync(`${__dirname}/../package.json`);
|
|
2921
|
-
|
|
2922
|
-
import_commander.program.version(
|
|
2921
|
+
process.env.AKAN_VERSION = hasPackageJson ? JSON.parse(import_fs7.default.readFileSync(`${__dirname}/../package.json`, "utf8")).version : "0.0.1";
|
|
2922
|
+
import_commander.program.version(process.env.AKAN_VERSION).description("Akan CLI");
|
|
2923
|
+
const akanBasePackageJson = import_fs7.default.existsSync("./node_modules/@akanjs/base/package.json") ? JSON.parse(import_fs7.default.readFileSync("./node_modules/@akanjs/base/package.json", "utf8")) : null;
|
|
2924
|
+
if (akanBasePackageJson && akanBasePackageJson.version !== process.env.AKAN_VERSION) {
|
|
2925
|
+
Logger.rawLog(
|
|
2926
|
+
import_chalk4.default.yellow(
|
|
2927
|
+
`
|
|
2928
|
+
Akan CLI version is mismatch with installed package. ${process.env.AKAN_VERSION} (global) vs ${akanBasePackageJson.version} (base)
|
|
2929
|
+
It may cause unexpected behavior. Run \`akan update\` to update latest akanjs.`
|
|
2930
|
+
)
|
|
2931
|
+
);
|
|
2932
|
+
}
|
|
2923
2933
|
for (const command of commands) {
|
|
2924
2934
|
const targetMetas = getTargetMetas(command);
|
|
2925
2935
|
for (const targetMeta of targetMetas) {
|
|
@@ -2982,7 +2992,8 @@ var runCommands = async (...commands) => {
|
|
|
2982
2992
|
Logger.rawLog();
|
|
2983
2993
|
} catch (e) {
|
|
2984
2994
|
const errMsg = e instanceof Error ? e.message : typeof e === "string" ? e : JSON.stringify(e);
|
|
2985
|
-
Logger.
|
|
2995
|
+
Logger.rawLog(`
|
|
2996
|
+
${import_chalk4.default.red(errMsg)}`);
|
|
2986
2997
|
throw e;
|
|
2987
2998
|
}
|
|
2988
2999
|
});
|
|
@@ -3325,7 +3336,7 @@ var Builder = class {
|
|
|
3325
3336
|
const pkgPackageJson = {
|
|
3326
3337
|
...this.#pkgJson,
|
|
3327
3338
|
main: "./index.js",
|
|
3328
|
-
engines: { node: ">=
|
|
3339
|
+
engines: { node: ">=20" },
|
|
3329
3340
|
dependencies,
|
|
3330
3341
|
exports: {
|
|
3331
3342
|
...this.#pkgJson.exports ?? {},
|
|
@@ -3940,7 +3951,7 @@ var ApplicationRunner = class {
|
|
|
3940
3951
|
await app.exec("rm -rf .next");
|
|
3941
3952
|
app.writeFile("next.config.ts", defaultNextConfigFile);
|
|
3942
3953
|
} else if (target === "csr")
|
|
3943
|
-
await app.workspace.exec(
|
|
3954
|
+
await app.workspace.exec(`rm -rf ${app.workspace.workspaceRoot}/node_modules/.vite/${app.name}`);
|
|
3944
3955
|
else if (target === "backend")
|
|
3945
3956
|
await app.cp("assets", import_path4.default.join(app.dist.cwdPath, "backend", "assets"));
|
|
3946
3957
|
return { env: this.#getEnv(app, target, { AKAN_COMMAND_TYPE: type }) };
|
|
@@ -3967,7 +3978,7 @@ var ApplicationRunner = class {
|
|
|
3967
3978
|
version: "1.0.0",
|
|
3968
3979
|
// type: "module",
|
|
3969
3980
|
main: "./main.js",
|
|
3970
|
-
engines: { node: ">=
|
|
3981
|
+
engines: { node: ">=20" },
|
|
3971
3982
|
dependencies
|
|
3972
3983
|
};
|
|
3973
3984
|
app.dist.writeJson("backend/package.json", appPackageJson);
|
|
@@ -4017,7 +4028,7 @@ var ApplicationRunner = class {
|
|
|
4017
4028
|
name: `${app.name}/frontend`,
|
|
4018
4029
|
description: `${app.name} frontend`,
|
|
4019
4030
|
version: "1.0.0",
|
|
4020
|
-
engines: { node: ">=
|
|
4031
|
+
engines: { node: ">=20" },
|
|
4021
4032
|
dependencies,
|
|
4022
4033
|
scripts: { start: "next start" }
|
|
4023
4034
|
};
|
|
@@ -4066,6 +4077,7 @@ var ApplicationRunner = class {
|
|
|
4066
4077
|
},
|
|
4067
4078
|
css: { postcss: `${app.cwdPath}/postcss.config.js` },
|
|
4068
4079
|
publicDir: `${app.cwdPath}/public`,
|
|
4080
|
+
cacheDir: `${app.workspace.workspaceRoot}/node_modules/.vite/${app.name}`,
|
|
4069
4081
|
plugins: [
|
|
4070
4082
|
(0, import_plugin_react.default)(),
|
|
4071
4083
|
(0, import_vite_tsconfig_paths.default)(),
|
|
@@ -4222,6 +4234,11 @@ var ApplicationRunner = class {
|
|
|
4222
4234
|
]);
|
|
4223
4235
|
}
|
|
4224
4236
|
async dbup(workspace) {
|
|
4237
|
+
try {
|
|
4238
|
+
await workspace.exec(`docker ps`);
|
|
4239
|
+
} catch (e) {
|
|
4240
|
+
throw new Error(`Docker daemon is not running. Please install docker or start docker daemon and try again.`);
|
|
4241
|
+
}
|
|
4225
4242
|
await workspace.applyTemplate({
|
|
4226
4243
|
basePath: "local",
|
|
4227
4244
|
template: "localDev",
|
package/esm/index.js
CHANGED
|
@@ -2895,8 +2895,18 @@ var runCommands = async (...commands) => {
|
|
|
2895
2895
|
});
|
|
2896
2896
|
const __dirname = getDirname(import.meta.url);
|
|
2897
2897
|
const hasPackageJson = fs11.existsSync(`${__dirname}/../package.json`);
|
|
2898
|
-
|
|
2899
|
-
program.version(
|
|
2898
|
+
process.env.AKAN_VERSION = hasPackageJson ? JSON.parse(fs11.readFileSync(`${__dirname}/../package.json`, "utf8")).version : "0.0.1";
|
|
2899
|
+
program.version(process.env.AKAN_VERSION).description("Akan CLI");
|
|
2900
|
+
const akanBasePackageJson = fs11.existsSync("./node_modules/@akanjs/base/package.json") ? JSON.parse(fs11.readFileSync("./node_modules/@akanjs/base/package.json", "utf8")) : null;
|
|
2901
|
+
if (akanBasePackageJson && akanBasePackageJson.version !== process.env.AKAN_VERSION) {
|
|
2902
|
+
Logger.rawLog(
|
|
2903
|
+
chalk4.yellow(
|
|
2904
|
+
`
|
|
2905
|
+
Akan CLI version is mismatch with installed package. ${process.env.AKAN_VERSION} (global) vs ${akanBasePackageJson.version} (base)
|
|
2906
|
+
It may cause unexpected behavior. Run \`akan update\` to update latest akanjs.`
|
|
2907
|
+
)
|
|
2908
|
+
);
|
|
2909
|
+
}
|
|
2900
2910
|
for (const command of commands) {
|
|
2901
2911
|
const targetMetas = getTargetMetas(command);
|
|
2902
2912
|
for (const targetMeta of targetMetas) {
|
|
@@ -2959,7 +2969,8 @@ var runCommands = async (...commands) => {
|
|
|
2959
2969
|
Logger.rawLog();
|
|
2960
2970
|
} catch (e) {
|
|
2961
2971
|
const errMsg = e instanceof Error ? e.message : typeof e === "string" ? e : JSON.stringify(e);
|
|
2962
|
-
Logger.
|
|
2972
|
+
Logger.rawLog(`
|
|
2973
|
+
${chalk4.red(errMsg)}`);
|
|
2963
2974
|
throw e;
|
|
2964
2975
|
}
|
|
2965
2976
|
});
|
|
@@ -3307,7 +3318,7 @@ var Builder = class {
|
|
|
3307
3318
|
const pkgPackageJson = {
|
|
3308
3319
|
...this.#pkgJson,
|
|
3309
3320
|
main: "./index.js",
|
|
3310
|
-
engines: { node: ">=
|
|
3321
|
+
engines: { node: ">=20" },
|
|
3311
3322
|
dependencies,
|
|
3312
3323
|
exports: {
|
|
3313
3324
|
...this.#pkgJson.exports ?? {},
|
|
@@ -3921,7 +3932,7 @@ var ApplicationRunner = class {
|
|
|
3921
3932
|
await app.exec("rm -rf .next");
|
|
3922
3933
|
app.writeFile("next.config.ts", defaultNextConfigFile);
|
|
3923
3934
|
} else if (target === "csr")
|
|
3924
|
-
await app.workspace.exec(
|
|
3935
|
+
await app.workspace.exec(`rm -rf ${app.workspace.workspaceRoot}/node_modules/.vite/${app.name}`);
|
|
3925
3936
|
else if (target === "backend")
|
|
3926
3937
|
await app.cp("assets", path7.join(app.dist.cwdPath, "backend", "assets"));
|
|
3927
3938
|
return { env: this.#getEnv(app, target, { AKAN_COMMAND_TYPE: type }) };
|
|
@@ -3948,7 +3959,7 @@ var ApplicationRunner = class {
|
|
|
3948
3959
|
version: "1.0.0",
|
|
3949
3960
|
// type: "module",
|
|
3950
3961
|
main: "./main.js",
|
|
3951
|
-
engines: { node: ">=
|
|
3962
|
+
engines: { node: ">=20" },
|
|
3952
3963
|
dependencies
|
|
3953
3964
|
};
|
|
3954
3965
|
app.dist.writeJson("backend/package.json", appPackageJson);
|
|
@@ -3998,7 +4009,7 @@ var ApplicationRunner = class {
|
|
|
3998
4009
|
name: `${app.name}/frontend`,
|
|
3999
4010
|
description: `${app.name} frontend`,
|
|
4000
4011
|
version: "1.0.0",
|
|
4001
|
-
engines: { node: ">=
|
|
4012
|
+
engines: { node: ">=20" },
|
|
4002
4013
|
dependencies,
|
|
4003
4014
|
scripts: { start: "next start" }
|
|
4004
4015
|
};
|
|
@@ -4047,6 +4058,7 @@ var ApplicationRunner = class {
|
|
|
4047
4058
|
},
|
|
4048
4059
|
css: { postcss: `${app.cwdPath}/postcss.config.js` },
|
|
4049
4060
|
publicDir: `${app.cwdPath}/public`,
|
|
4061
|
+
cacheDir: `${app.workspace.workspaceRoot}/node_modules/.vite/${app.name}`,
|
|
4050
4062
|
plugins: [
|
|
4051
4063
|
react(),
|
|
4052
4064
|
tsconfigPaths(),
|
|
@@ -4203,6 +4215,11 @@ var ApplicationRunner = class {
|
|
|
4203
4215
|
]);
|
|
4204
4216
|
}
|
|
4205
4217
|
async dbup(workspace) {
|
|
4218
|
+
try {
|
|
4219
|
+
await workspace.exec(`docker ps`);
|
|
4220
|
+
} catch (e) {
|
|
4221
|
+
throw new Error(`Docker daemon is not running. Please install docker or start docker daemon and try again.`);
|
|
4222
|
+
}
|
|
4206
4223
|
await workspace.applyTemplate({
|
|
4207
4224
|
basePath: "local",
|
|
4208
4225
|
template: "localDev",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"type": "module",
|
|
3
3
|
"sourceType": "module",
|
|
4
4
|
"name": "@akanjs/cli",
|
|
5
|
-
"version": "0.9.
|
|
5
|
+
"version": "0.9.39",
|
|
6
6
|
"bin": {
|
|
7
7
|
"akan": "esm/index.js"
|
|
8
8
|
},
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"main": "./index.js",
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": ">=
|
|
19
|
+
"node": ">=20"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@inquirer/prompts": "^7.2.1",
|