@naseej/blox 0.1.25 → 0.1.27

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.
Files changed (2) hide show
  1. package/dist/run.js +9 -5
  2. package/package.json +1 -1
package/dist/run.js CHANGED
@@ -31,7 +31,7 @@ var option = (flags, description) => {
31
31
  };
32
32
 
33
33
  // package.json
34
- var version = "0.1.25";
34
+ var version = "0.1.27";
35
35
 
36
36
  // src/commands/add/index.ts
37
37
  var import_fs_extra7 = __toESM(require("fs-extra"));
@@ -425,7 +425,11 @@ function getTemplateInfo(cwd = ".") {
425
425
  return templateInfo;
426
426
  }
427
427
  function getBasedOnInfo(cwd = ".") {
428
- return import_fs_extra5.default.readJSONSync(import_node_path5.default.join(cwd, basedOnFile));
428
+ try {
429
+ return import_fs_extra5.default.readJSONSync(import_node_path5.default.join(cwd, basedOnFile));
430
+ } catch {
431
+ return {};
432
+ }
429
433
  }
430
434
  function saveBasedOnInfo(info, cwd = ".") {
431
435
  debug("Save info");
@@ -612,8 +616,8 @@ async function updateBlock(block, blocks) {
612
616
  updatedBlocks.add(block);
613
617
  });
614
618
  for (const dep of blockInfo?.dependencies || []) {
615
- debug(`${block} has dependency on ${dep}, will be updated`);
616
- await updateBlock(dep, blocks);
619
+ debug(`${block} has dependency on ${dep.name}, will be updated`);
620
+ await updateBlock(dep.name, blocks);
617
621
  }
618
622
  }
619
623
 
@@ -647,7 +651,7 @@ var addBlock = async (block, blocks) => {
647
651
  await updateBlock(block, blocks);
648
652
  }
649
653
  for (const dep of blockDef?.dependencies || []) {
650
- await addBlock(dep, blocks);
654
+ await addBlock(dep.name, blocks);
651
655
  }
652
656
  };
653
657
  var add = command("add").description("Add block to app").alias("a").argument("[block]", "Block to be added").action(async (block) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naseej/blox",
3
- "version": "0.1.25",
3
+ "version": "0.1.27",
4
4
  "description": "blox cli",
5
5
  "bin": {
6
6
  "blox": "./bin/run"