@akanjs/devkit 0.9.39 → 0.9.40

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,18 +217,8 @@ 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
- 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
- }
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");
232
222
  for (const command of commands) {
233
223
  const targetMetas = (0, import_targetMeta.getTargetMetas)(command);
234
224
  for (const targetMeta of targetMetas) {
@@ -291,8 +281,7 @@ It may cause unexpected behavior. Run \`akan update\` to update latest akanjs.`
291
281
  import_common.Logger.rawLog();
292
282
  } catch (e) {
293
283
  const errMsg = e instanceof Error ? e.message : typeof e === "string" ? e : JSON.stringify(e);
294
- import_common.Logger.rawLog(`
295
- ${import_chalk.default.red(errMsg)}`);
284
+ import_common.Logger.error(`Command Error: ${import_chalk.default.red(errMsg)}`);
296
285
  throw e;
297
286
  }
298
287
  });
@@ -184,18 +184,8 @@ const runCommands = async (...commands) => {
184
184
  });
185
185
  const __dirname = getDirname(import.meta.url);
186
186
  const hasPackageJson = fs.existsSync(`${__dirname}/../package.json`);
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
- }
187
+ const version = hasPackageJson ? JSON.parse(fs.readFileSync(`${__dirname}/../package.json`, "utf8")).version : "0.0.1";
188
+ program.version(version).description("Akan CLI");
199
189
  for (const command of commands) {
200
190
  const targetMetas = getTargetMetas(command);
201
191
  for (const targetMeta of targetMetas) {
@@ -258,8 +248,7 @@ It may cause unexpected behavior. Run \`akan update\` to update latest akanjs.`
258
248
  Logger.rawLog();
259
249
  } catch (e) {
260
250
  const errMsg = e instanceof Error ? e.message : typeof e === "string" ? e : JSON.stringify(e);
261
- Logger.rawLog(`
262
- ${chalk.red(errMsg)}`);
251
+ Logger.error(`Command Error: ${chalk.red(errMsg)}`);
263
252
  throw e;
264
253
  }
265
254
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/devkit",
3
- "version": "0.9.39",
3
+ "version": "0.9.40",
4
4
  "sourceType": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"