@akanjs/devkit 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.
@@ -92,7 +92,7 @@ class Builder {
92
92
  const pkgPackageJson = {
93
93
  ...this.#pkgJson,
94
94
  main: "./index.js",
95
- engines: { node: ">=22" },
95
+ engines: { node: ">=20" },
96
96
  dependencies,
97
97
  exports: {
98
98
  ...this.#pkgJson.exports ?? {},
@@ -217,8 +217,18 @@ const runCommands = async (...commands) => {
217
217
  });
218
218
  const __dirname = (0, import__.getDirname)(import_meta.url);
219
219
  const hasPackageJson = import_fs.default.existsSync(`${__dirname}/../package.json`);
220
- const version = hasPackageJson ? JSON.parse(import_fs.default.readFileSync(`${__dirname}/../package.json`, "utf8")).version : "0.0.1";
221
- import_commander.program.version(version).description("Akan CLI");
220
+ process.env.AKAN_VERSION = hasPackageJson ? JSON.parse(import_fs.default.readFileSync(`${__dirname}/../package.json`, "utf8")).version : "0.0.1";
221
+ import_commander.program.version(process.env.AKAN_VERSION).description("Akan CLI");
222
+ const akanBasePackageJson = import_fs.default.existsSync("./node_modules/@akanjs/base/package.json") ? JSON.parse(import_fs.default.readFileSync("./node_modules/@akanjs/base/package.json", "utf8")) : null;
223
+ if (akanBasePackageJson && akanBasePackageJson.version !== process.env.AKAN_VERSION) {
224
+ import_common.Logger.rawLog(
225
+ import_chalk.default.yellow(
226
+ `
227
+ Akan CLI version is mismatch with installed package. ${process.env.AKAN_VERSION} (global) vs ${akanBasePackageJson.version} (base)
228
+ It may cause unexpected behavior. Run \`akan update\` to update latest akanjs.`
229
+ )
230
+ );
231
+ }
222
232
  for (const command of commands) {
223
233
  const targetMetas = (0, import_targetMeta.getTargetMetas)(command);
224
234
  for (const targetMeta of targetMetas) {
@@ -281,7 +291,8 @@ const runCommands = async (...commands) => {
281
291
  import_common.Logger.rawLog();
282
292
  } catch (e) {
283
293
  const errMsg = e instanceof Error ? e.message : typeof e === "string" ? e : JSON.stringify(e);
284
- import_common.Logger.error(`Command Error: ${import_chalk.default.red(errMsg)}`);
294
+ import_common.Logger.rawLog(`
295
+ ${import_chalk.default.red(errMsg)}`);
285
296
  throw e;
286
297
  }
287
298
  });
@@ -60,7 +60,7 @@ class Builder {
60
60
  const pkgPackageJson = {
61
61
  ...this.#pkgJson,
62
62
  main: "./index.js",
63
- engines: { node: ">=22" },
63
+ engines: { node: ">=20" },
64
64
  dependencies,
65
65
  exports: {
66
66
  ...this.#pkgJson.exports ?? {},
@@ -184,8 +184,18 @@ const runCommands = async (...commands) => {
184
184
  });
185
185
  const __dirname = getDirname(import.meta.url);
186
186
  const hasPackageJson = fs.existsSync(`${__dirname}/../package.json`);
187
- const version = hasPackageJson ? JSON.parse(fs.readFileSync(`${__dirname}/../package.json`, "utf8")).version : "0.0.1";
188
- program.version(version).description("Akan CLI");
187
+ process.env.AKAN_VERSION = hasPackageJson ? JSON.parse(fs.readFileSync(`${__dirname}/../package.json`, "utf8")).version : "0.0.1";
188
+ program.version(process.env.AKAN_VERSION).description("Akan CLI");
189
+ const akanBasePackageJson = fs.existsSync("./node_modules/@akanjs/base/package.json") ? JSON.parse(fs.readFileSync("./node_modules/@akanjs/base/package.json", "utf8")) : null;
190
+ if (akanBasePackageJson && akanBasePackageJson.version !== process.env.AKAN_VERSION) {
191
+ Logger.rawLog(
192
+ chalk.yellow(
193
+ `
194
+ Akan CLI version is mismatch with installed package. ${process.env.AKAN_VERSION} (global) vs ${akanBasePackageJson.version} (base)
195
+ It may cause unexpected behavior. Run \`akan update\` to update latest akanjs.`
196
+ )
197
+ );
198
+ }
189
199
  for (const command of commands) {
190
200
  const targetMetas = getTargetMetas(command);
191
201
  for (const targetMeta of targetMetas) {
@@ -248,7 +258,8 @@ const runCommands = async (...commands) => {
248
258
  Logger.rawLog();
249
259
  } catch (e) {
250
260
  const errMsg = e instanceof Error ? e.message : typeof e === "string" ? e : JSON.stringify(e);
251
- Logger.error(`Command Error: ${chalk.red(errMsg)}`);
261
+ Logger.rawLog(`
262
+ ${chalk.red(errMsg)}`);
252
263
  throw e;
253
264
  }
254
265
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/devkit",
3
- "version": "0.9.37",
3
+ "version": "0.9.39",
4
4
  "sourceType": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "main": "./index.js",
14
14
  "engines": {
15
- "node": ">=22"
15
+ "node": ">=20"
16
16
  },
17
17
  "dependencies": {
18
18
  "@inquirer/prompts": "^7.2.1",
@@ -104,7 +104,7 @@ export declare class WorkspaceExecutor extends Executor {
104
104
  getBaseDevEnv(): {
105
105
  repoName: string;
106
106
  serveDomain: string;
107
- env: "debug" | "testing" | "local" | "develop" | "main";
107
+ env: "testing" | "local" | "debug" | "develop" | "main";
108
108
  portOffset: number;
109
109
  name?: string | undefined;
110
110
  };
@@ -218,7 +218,7 @@ export declare class AppExecutor extends SysExecutor {
218
218
  emoji: string;
219
219
  constructor({ workspace, name }: AppExecutorOptions);
220
220
  static from(executor: SysExecutor | WorkspaceExecutor, name: string): AppExecutor;
221
- getEnv(): "debug" | "testing" | "local" | "develop" | "main";
221
+ getEnv(): "testing" | "local" | "debug" | "develop" | "main";
222
222
  getConfig(command?: string): Promise<AppConfigResult>;
223
223
  syncAssets(libDeps: string[]): Promise<void>;
224
224
  }