@naseej/blox 1.2.0 → 1.2.1
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 +25 -38
- 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 = "1.2.
|
|
34
|
+
var version = "1.2.1";
|
|
35
35
|
|
|
36
36
|
// src/commands/add/index.ts
|
|
37
37
|
var import_fs_extra8 = __toESM(require("fs-extra"));
|
|
@@ -1048,31 +1048,6 @@ async function updateFromRemote({ name, source = "", ignore: ignore2 = [], dir =
|
|
|
1048
1048
|
}
|
|
1049
1049
|
|
|
1050
1050
|
// src/commands/update/utils.ts
|
|
1051
|
-
async function updateAppBlocks({
|
|
1052
|
-
toAppCommit,
|
|
1053
|
-
usedBlocks,
|
|
1054
|
-
availableBlocks
|
|
1055
|
-
}) {
|
|
1056
|
-
for (const block of usedBlocks) {
|
|
1057
|
-
const blockRegistryData = availableBlocks[block.name];
|
|
1058
|
-
if (!blockRegistryData) return;
|
|
1059
|
-
await git.updateRemote(block.name, blockRegistryData.source);
|
|
1060
|
-
const blockPath = import_node_path10.default.join(blocksDir, block.name);
|
|
1061
|
-
const currentBloxFile = getBloxFile(blockPath);
|
|
1062
|
-
const remoteBloxFile = (await migrateOnRemote(block.name, toAppCommit, blockPath)).output[".blox"];
|
|
1063
|
-
const blockFromCommit = currentBloxFile.checkpoints[block.name]?.commit;
|
|
1064
|
-
const blockToCommit = remoteBloxFile.checkpoints[block.name]?.commit;
|
|
1065
|
-
if (!blockFromCommit || !blockToCommit) continue;
|
|
1066
|
-
if (blockFromCommit === blockToCommit) continue;
|
|
1067
|
-
if (await git.isCommitOlder(blockFromCommit, blockToCommit)) {
|
|
1068
|
-
saveBloxFile(remoteBloxFile, blockPath);
|
|
1069
|
-
} else {
|
|
1070
|
-
logWarningSection(
|
|
1071
|
-
`${block.name} is newer in project than template, make sure no breaking changes`
|
|
1072
|
-
);
|
|
1073
|
-
}
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
1076
1051
|
async function updateApp({
|
|
1077
1052
|
templateDef,
|
|
1078
1053
|
templates,
|
|
@@ -1091,15 +1066,28 @@ async function updateApp({
|
|
|
1091
1066
|
ignore: templateDef.ignore
|
|
1092
1067
|
});
|
|
1093
1068
|
if (!toAppCommit) return;
|
|
1094
|
-
|
|
1069
|
+
for (const block of usedBlocks) {
|
|
1070
|
+
const blockRegistryData = availableBlocks[block.name];
|
|
1071
|
+
if (!blockRegistryData) return;
|
|
1072
|
+
await git.updateRemote(block.name, blockRegistryData.source);
|
|
1073
|
+
const blockPath = import_node_path10.default.join(blocksDir, block.name);
|
|
1074
|
+
const currentBloxFile = getBloxFile(blockPath);
|
|
1075
|
+
const remoteBloxFile = (await migrateOnRemote(block.name, toAppCommit, blockPath)).output[".blox"];
|
|
1076
|
+
const blockFromCommit = currentBloxFile.checkpoints[block.name]?.commit;
|
|
1077
|
+
const blockToCommit = remoteBloxFile.checkpoints[block.name]?.commit;
|
|
1078
|
+
if (!blockFromCommit || !blockToCommit) continue;
|
|
1079
|
+
if (blockFromCommit === blockToCommit) continue;
|
|
1080
|
+
if (await git.isCommitOlder(blockFromCommit, blockToCommit)) {
|
|
1081
|
+
saveBloxFile(remoteBloxFile, blockPath);
|
|
1082
|
+
} else {
|
|
1083
|
+
logWarningSection(
|
|
1084
|
+
`${block.name} is newer in project than template, make sure no breaking changes`
|
|
1085
|
+
);
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1095
1088
|
});
|
|
1096
1089
|
}
|
|
1097
|
-
async function updateAppBases({
|
|
1098
|
-
templateDef,
|
|
1099
|
-
templates,
|
|
1100
|
-
usedBlocks,
|
|
1101
|
-
availableBlocks
|
|
1102
|
-
}) {
|
|
1090
|
+
async function updateAppBases(templateDef, templates) {
|
|
1103
1091
|
for (const base of templateDef.bases || []) {
|
|
1104
1092
|
await runTask(
|
|
1105
1093
|
{ start: `Update App base: ${base.name}`, end: `Updated App base: ${base.name}` },
|
|
@@ -1109,12 +1097,11 @@ async function updateAppBases({
|
|
|
1109
1097
|
error("Selected template not available in registries");
|
|
1110
1098
|
return;
|
|
1111
1099
|
}
|
|
1112
|
-
|
|
1100
|
+
await updateFromRemote({
|
|
1113
1101
|
name: base.name,
|
|
1114
|
-
source: template.source
|
|
1102
|
+
source: template.source,
|
|
1103
|
+
ignore: templateDef.ignore
|
|
1115
1104
|
});
|
|
1116
|
-
if (!toAppCommit) return;
|
|
1117
|
-
await updateAppBlocks({ toAppCommit, usedBlocks, availableBlocks });
|
|
1118
1105
|
}
|
|
1119
1106
|
);
|
|
1120
1107
|
}
|
|
@@ -1156,7 +1143,7 @@ var update2 = command("update").description("Update app/block").alias("u").addOp
|
|
|
1156
1143
|
await updateApp({ templateDef, templates, usedBlocks, availableBlocks });
|
|
1157
1144
|
}
|
|
1158
1145
|
if (["bases", "all"].includes(args.scope)) {
|
|
1159
|
-
await updateAppBases(
|
|
1146
|
+
await updateAppBases(templateDef, templates);
|
|
1160
1147
|
}
|
|
1161
1148
|
if (args.scope === "all") {
|
|
1162
1149
|
for (const block of usedBlocks) {
|