@akanjs/cli 0.9.38 → 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
|
});
|
|
@@ -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 }) };
|
|
@@ -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
|
});
|
|
@@ -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 }) };
|
|
@@ -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",
|