@multiplatform.one/cli 7.83.1 → 7.83.2

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/lib/source.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "cliVersion": "7.83.1",
2
+ "cliVersion": "7.83.2",
3
3
  "url": "https://git.corp.bitspur.com/multiplatform.one/mpo.git",
4
- "sha": "4c91a7b4455637ff2edcb486b29113c3c138da34"
4
+ "sha": "bf061cbcac12c410c291014121881b36430f20b3"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/cli",
3
- "version": "7.83.1",
3
+ "version": "7.83.2",
4
4
  "description": "multiplatform.one cli — mpo init clones and prunes the monorepo, mpo update merges it back",
5
5
  "keywords": [
6
6
  "create-multiplatform-app",
@@ -57,7 +57,7 @@
57
57
  "access": "public"
58
58
  },
59
59
  "dependencies": {
60
- "@multiplatform.one/utils": "^7.83.1",
60
+ "@multiplatform.one/utils": "^7.83.2",
61
61
  "commander": "^15.0.0",
62
62
  "dotenv": "^17.4.2",
63
63
  "inquirer": "^14.2.3",
@@ -747,6 +747,7 @@ done
747
747
  [ -n "$PROJECT_NAME" ] || PROJECT_NAME="$(basename "$(cd "$TARGET" 2>/dev/null && pwd || printf '%s' "$TARGET")")"
748
748
  node - "$TREE/package.json" "$PROJECT_NAME" "$APPS_CSV" "$REMOVED_CSV" "$(printf '%s' "$REMOVED" | tr ' ' ',')" <<'NODE'
749
749
  const fs = require("node:fs");
750
+ const path = require("node:path");
750
751
  const [file, projectName, appsCsv, removedCsv, prunedCsv] = process.argv.slice(2);
751
752
  const apps = appsCsv ? appsCsv.split(",") : [];
752
753
  const removed = removedCsv ? removedCsv.split(",") : [];
@@ -778,11 +779,30 @@ const cleanSegment = (segment) =>
778
779
  );
779
780
  // Each product app carries apps/one's design baseline; a pruned tree's
780
781
  // baseline is gone, and a lint naming a missing baseline fails.
782
+ // A kept baseline can still record only pruned trees (packages' public and
783
+ // apps ratchets): the lint stats each path and dies on the first missing one.
784
+ const root = path.dirname(file);
785
+ const scansKeptTree = (baselineFile) => {
786
+ const full = path.join(root, baselineFile);
787
+ if (!fs.existsSync(full)) return true;
788
+ const baseline = JSON.parse(fs.readFileSync(full, "utf8"));
789
+ if (!Array.isArray(baseline.paths)) return true;
790
+ const kept = baseline.paths.filter((entry) => fs.existsSync(path.resolve(path.dirname(full), entry)));
791
+ if (!kept.length) {
792
+ fs.rmSync(full);
793
+ return false;
794
+ }
795
+ if (kept.length < baseline.paths.length) {
796
+ baseline.paths = kept;
797
+ fs.writeFileSync(full, `${JSON.stringify(baseline, null, 2)}\n`);
798
+ }
799
+ return true;
800
+ };
781
801
  const designBaselines = (value) =>
782
802
  value.replace(/\s--baseline\s+(\S+)/g, (whole, file) => {
783
803
  if (file.startsWith("apps/one/"))
784
804
  return apps.map((app) => ` --baseline apps/${app}/${file.slice("apps/one/".length)}`).join("");
785
- return namesPruned(file) ? "" : whole;
805
+ return namesPruned(file) || !scansKeptTree(file) ? "" : whole;
786
806
  });
787
807
  const scripts = {};
788
808
  for (const [name, script] of Object.entries(pkg.scripts ?? {})) {