@naseej/blox 0.1.28 → 0.1.29
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 +11 -7
- 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.29";
|
|
35
35
|
|
|
36
36
|
// src/commands/add/index.ts
|
|
37
37
|
var import_fs_extra7 = __toESM(require("fs-extra"));
|
|
@@ -52,6 +52,7 @@ var import_node_path4 = __toESM(require("path"));
|
|
|
52
52
|
var import_dayjs = __toESM(require("dayjs"));
|
|
53
53
|
var import_fs_extra4 = __toESM(require("fs-extra"));
|
|
54
54
|
var import_klaw = __toESM(require("klaw"));
|
|
55
|
+
var import_merge = __toESM(require("lodash/merge"));
|
|
55
56
|
var import_ms = __toESM(require("ms"));
|
|
56
57
|
|
|
57
58
|
// src/config/runtime.ts
|
|
@@ -366,10 +367,13 @@ var getAvailableTemplates = async () => {
|
|
|
366
367
|
if (file.path.endsWith(".json")) {
|
|
367
368
|
const data = import_fs_extra4.default.readJSONSync(file.path);
|
|
368
369
|
Object.keys(data.templates || {}).forEach((templ) => {
|
|
369
|
-
templates[templ]
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
370
|
+
const source = data.templates[templ]?.source || `${data.baseUrl}/template-${templ}`;
|
|
371
|
+
const template = { ...data.templates[templ], source };
|
|
372
|
+
if (templates[templ]?.source === source) {
|
|
373
|
+
templates[templ] = (0, import_merge.default)(templates[templ], template);
|
|
374
|
+
} else {
|
|
375
|
+
templates[templ] = template;
|
|
376
|
+
}
|
|
373
377
|
Object.keys(templates[templ].blocks || {}).forEach((blockName) => {
|
|
374
378
|
const block = templates[templ]?.blocks?.[blockName];
|
|
375
379
|
if (block && !block.source) {
|
|
@@ -455,7 +459,7 @@ function getUsedBlocks() {
|
|
|
455
459
|
// src/services/updater.ts
|
|
456
460
|
var import_node_path6 = __toESM(require("path"));
|
|
457
461
|
var import_fs_extra6 = __toESM(require("fs-extra"));
|
|
458
|
-
var
|
|
462
|
+
var import_merge2 = __toESM(require("lodash/merge"));
|
|
459
463
|
|
|
460
464
|
// src/shared/prompts/index.ts
|
|
461
465
|
var import_prompts4 = require("@clack/prompts");
|
|
@@ -500,7 +504,7 @@ async function updateFromRemote(name, source = "", ignore = [], destPath = ".")
|
|
|
500
504
|
if (!basedOnInfo.bases) {
|
|
501
505
|
basedOnInfo.bases = {};
|
|
502
506
|
}
|
|
503
|
-
basedOnInfo.bases = (0,
|
|
507
|
+
basedOnInfo.bases = (0, import_merge2.default)(basedOnInfo.bases, { [baseName]: baseInfo });
|
|
504
508
|
};
|
|
505
509
|
if (!baseFrom) {
|
|
506
510
|
updateBase();
|