@naseej/blox 0.1.6 → 0.1.7
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 +28 -6
- package/package.json +1 -1
package/dist/run.js
CHANGED
|
@@ -48,6 +48,10 @@ var import_prompts = require("@clack/prompts");
|
|
|
48
48
|
var isDebugMode = () => !!import_extra_typings2.program.opts()?.debug;
|
|
49
49
|
var isMinimalMode = () => !!import_extra_typings2.program.opts()?.minimal;
|
|
50
50
|
|
|
51
|
+
// src/shared/terminal/index.ts
|
|
52
|
+
var import_ansis = __toESM(require("ansis"));
|
|
53
|
+
var fmt = import_ansis.default;
|
|
54
|
+
|
|
51
55
|
// src/shared/logger.ts
|
|
52
56
|
var import_prompts2 = require("@clack/prompts");
|
|
53
57
|
var debug = (message) => {
|
|
@@ -60,6 +64,13 @@ var debug = (message) => {
|
|
|
60
64
|
console.log(JSON.stringify(message));
|
|
61
65
|
}
|
|
62
66
|
};
|
|
67
|
+
var logWarningSection = (title, content) => {
|
|
68
|
+
const line = fmt.yellow("=".repeat(82));
|
|
69
|
+
console.log("\n" + line);
|
|
70
|
+
console.log(fmt.bold(fmt.yellow("\u25B2 " + title)));
|
|
71
|
+
content && console.log(content);
|
|
72
|
+
console.log(line + "\n");
|
|
73
|
+
};
|
|
63
74
|
|
|
64
75
|
// src/services/shell.ts
|
|
65
76
|
var $ = async (bin, options = [], { cwd, onStdout } = {}) => {
|
|
@@ -145,6 +156,15 @@ var getLatestCommit = async (rev, cwd = ".") => {
|
|
|
145
156
|
var createPatch = async (fromCommit, toCommit, outputPath) => {
|
|
146
157
|
return $("git", ["diff", fromCommit, toCommit, ">", outputPath]);
|
|
147
158
|
};
|
|
159
|
+
var getChangesLog = async (fromCommit, toCommit) => {
|
|
160
|
+
let changes = "";
|
|
161
|
+
await $("git", ["log", `${fromCommit}..${toCommit}`, '--pretty=format:"%s"'], {
|
|
162
|
+
onStdout: (text2) => {
|
|
163
|
+
changes = text2;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
return changes;
|
|
167
|
+
};
|
|
148
168
|
var applyPatch = (patch, cwd = ".") => {
|
|
149
169
|
const args = ["apply", "-3"];
|
|
150
170
|
if (cwd != ".") {
|
|
@@ -173,6 +193,7 @@ var git = {
|
|
|
173
193
|
getLatestCommitFromRemote,
|
|
174
194
|
getLatestCommitFromPath,
|
|
175
195
|
createPatch,
|
|
196
|
+
getChangesLog,
|
|
176
197
|
applyPatch,
|
|
177
198
|
updateRemote
|
|
178
199
|
};
|
|
@@ -382,12 +403,6 @@ function getUsedBlocks() {
|
|
|
382
403
|
|
|
383
404
|
// src/shared/prompts/index.ts
|
|
384
405
|
var import_prompts4 = require("@clack/prompts");
|
|
385
|
-
|
|
386
|
-
// src/shared/terminal/index.ts
|
|
387
|
-
var import_ansis = __toESM(require("ansis"));
|
|
388
|
-
var fmt = import_ansis.default;
|
|
389
|
-
|
|
390
|
-
// src/shared/prompts/index.ts
|
|
391
406
|
var checkIfCanceled = (value) => {
|
|
392
407
|
if ((0, import_prompts4.isCancel)(value)) {
|
|
393
408
|
(0, import_prompts4.cancel)();
|
|
@@ -541,6 +556,13 @@ async function updateFromRemote(name, source = "", destPath = ".") {
|
|
|
541
556
|
debug({ fromCommit, toCommit });
|
|
542
557
|
const patchFilePath = import_node_path5.default.join(destPath, "diff.patch");
|
|
543
558
|
await git.createPatch(fromCommit, toCommit, patchFilePath);
|
|
559
|
+
const changes = await git.getChangesLog(fromCommit, toCommit);
|
|
560
|
+
if (changes.trim() !== "") {
|
|
561
|
+
logWarningSection(
|
|
562
|
+
"These is the changes from last update, make sure to review for breaking changes",
|
|
563
|
+
changes
|
|
564
|
+
);
|
|
565
|
+
}
|
|
544
566
|
try {
|
|
545
567
|
await git.applyPatch(patchFilePath, destPath);
|
|
546
568
|
} catch {
|