@naseej/blox 0.1.27 → 0.1.28
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/dist/run.js +13 -15
- 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.
|
|
34
|
+
var version = "0.1.28";
|
|
35
35
|
|
|
36
36
|
// src/commands/add/index.ts
|
|
37
37
|
var import_fs_extra7 = __toESM(require("fs-extra"));
|
|
@@ -395,11 +395,6 @@ var getAvailableBlocks = async (templateInfo) => {
|
|
|
395
395
|
return blocks;
|
|
396
396
|
};
|
|
397
397
|
|
|
398
|
-
// src/services/updater.ts
|
|
399
|
-
var import_node_path6 = __toESM(require("path"));
|
|
400
|
-
var import_fs_extra6 = __toESM(require("fs-extra"));
|
|
401
|
-
var import_merge = __toESM(require("lodash/merge"));
|
|
402
|
-
|
|
403
398
|
// src/services/template.ts
|
|
404
399
|
var import_node_path5 = __toESM(require("path"));
|
|
405
400
|
var import_ejs = __toESM(require("ejs"));
|
|
@@ -457,6 +452,11 @@ function getUsedBlocks() {
|
|
|
457
452
|
return blocks;
|
|
458
453
|
}
|
|
459
454
|
|
|
455
|
+
// src/services/updater.ts
|
|
456
|
+
var import_node_path6 = __toESM(require("path"));
|
|
457
|
+
var import_fs_extra6 = __toESM(require("fs-extra"));
|
|
458
|
+
var import_merge = __toESM(require("lodash/merge"));
|
|
459
|
+
|
|
460
460
|
// src/shared/prompts/index.ts
|
|
461
461
|
var import_prompts4 = require("@clack/prompts");
|
|
462
462
|
var checkIfCanceled = (value) => {
|
|
@@ -601,20 +601,17 @@ async function updateBlock(block, blocks) {
|
|
|
601
601
|
debug(`${block} already updated`);
|
|
602
602
|
return;
|
|
603
603
|
}
|
|
604
|
-
const
|
|
604
|
+
const blockDef = blocks[block];
|
|
605
|
+
const blockPath = import_node_path7.default.join(blocksDir, block);
|
|
605
606
|
await runTask({ start: `Update block: ${block}`, end: `Updated block: ${block}` }, async () => {
|
|
606
|
-
if (!
|
|
607
|
+
if (!blockDef) {
|
|
607
608
|
error("Selected block not available, try to sync registries", false);
|
|
608
609
|
return;
|
|
609
610
|
}
|
|
610
|
-
await updateFromRemote(
|
|
611
|
-
block,
|
|
612
|
-
blockInfo.source,
|
|
613
|
-
blockInfo.ignore,
|
|
614
|
-
import_node_path7.default.join(blocksDir, block)
|
|
615
|
-
);
|
|
611
|
+
await updateFromRemote(block, blockDef.source, blockDef.ignore, blockPath);
|
|
616
612
|
updatedBlocks.add(block);
|
|
617
613
|
});
|
|
614
|
+
const blockInfo = getTemplateInfo(blockPath);
|
|
618
615
|
for (const dep of blockInfo?.dependencies || []) {
|
|
619
616
|
debug(`${block} has dependency on ${dep.name}, will be updated`);
|
|
620
617
|
await updateBlock(dep.name, blocks);
|
|
@@ -650,7 +647,8 @@ var addBlock = async (block, blocks) => {
|
|
|
650
647
|
debug(`${block} already exists, will be updated`);
|
|
651
648
|
await updateBlock(block, blocks);
|
|
652
649
|
}
|
|
653
|
-
|
|
650
|
+
const blockInfo = getTemplateInfo(blockPath);
|
|
651
|
+
for (const dep of blockInfo?.dependencies || []) {
|
|
654
652
|
await addBlock(dep.name, blocks);
|
|
655
653
|
}
|
|
656
654
|
};
|