@akanjs/devkit 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.
@@ -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
  });
@@ -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.38",
3
+ "version": "0.9.39",
4
4
  "sourceType": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"