@naseej/blox 0.1.23 → 0.1.25

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 +10 -8
  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.23";
34
+ var version = "0.1.25";
35
35
 
36
36
  // src/commands/add/index.ts
37
37
  var import_fs_extra7 = __toESM(require("fs-extra"));
@@ -171,7 +171,7 @@ var updateRemote = async (name, source, shellOptions = {}) => {
171
171
  });
172
172
  await $("git", ["fetch", name], { ...defaultShellOptions, ...shellOptions });
173
173
  };
174
- var readFileFromRemote = async (remote, file) => {
174
+ var readJsonFromRemote = async (remote, file) => {
175
175
  try {
176
176
  let content = "";
177
177
  await $("git", ["show", `${remote}/main:${file}`], {
@@ -262,7 +262,7 @@ var git = {
262
262
  getChangesLog,
263
263
  applyPatch,
264
264
  updateRemote,
265
- readFileFromRemote,
265
+ readJsonFromRemote,
266
266
  isCommitOlder
267
267
  };
268
268
 
@@ -489,7 +489,7 @@ var textList = async (opts) => {
489
489
  async function updateFromRemote(name, source = "", ignore = [], destPath = ".") {
490
490
  debug("Updating from remote");
491
491
  const basedOnInfo = getBasedOnInfo(destPath);
492
- const remoteBloxFile = await git.readFileFromRemote(name, ".blox");
492
+ const remoteBloxFile = await git.readJsonFromRemote(name, ".blox");
493
493
  for (const [baseName, baseInfo] of Object.entries(remoteBloxFile.bases || {})) {
494
494
  const baseFrom = basedOnInfo.bases?.[baseName]?.commit;
495
495
  const updateBase = () => {
@@ -506,7 +506,9 @@ async function updateFromRemote(name, source = "", ignore = [], destPath = ".")
506
506
  if (await git.isCommitOlder(baseFrom, baseTo)) {
507
507
  updateBase();
508
508
  } else {
509
- debug(`Skip base info update, ${baseName} is newer in project than template`);
509
+ logWarningSection(
510
+ `${baseName} is newer in project than template, make sure no breaking changes`
511
+ );
510
512
  }
511
513
  }
512
514
  const fromBasedCommit = basedOnInfo.bases?.[name]?.commit;
@@ -545,7 +547,7 @@ async function updateFromRemote(name, source = "", ignore = [], destPath = ".")
545
547
  if (changes.trim() !== "") {
546
548
  logWarningSection(
547
549
  "These is the changes from last update, make sure to review for breaking changes",
548
- changes
550
+ changes.replace(/BREAKING CHANGE/gi, fmt.red("BREAKING CHANGE"))
549
551
  );
550
552
  }
551
553
  await deletePatchFile();
@@ -637,9 +639,9 @@ var addBlock = async (block, blocks) => {
637
639
  await git.unInit(blockPath);
638
640
  await replacePlaceholders(blockPath, {});
639
641
  saveBasedOnInfo({ commit }, blockPath);
640
- await runInitScript(blockPath);
641
642
  }
642
643
  );
644
+ await runTask("Run init script", async () => runInitScript(blockPath));
643
645
  } else {
644
646
  debug(`${block} already exists, will be updated`);
645
647
  await updateBlock(block, blocks);
@@ -731,8 +733,8 @@ var init2 = command("init").description("Init new app").alias("i").option("-n, -
731
733
  await replacePlaceholders(name, { app: { name } });
732
734
  updateBasedOnInfo({ commit }, name);
733
735
  await git.init(name);
734
- await runInitScript(name);
735
736
  task.stop(`App initialized in ${name}`);
737
+ await runTask("Run init script", async () => runInitScript(name || ""));
736
738
  } catch (e) {
737
739
  error(e);
738
740
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naseej/blox",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
4
4
  "description": "blox cli",
5
5
  "bin": {
6
6
  "blox": "./bin/run"