@alessandroraffa/tangyr 3.0.1 → 3.0.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.
Files changed (2) hide show
  1. package/dist/index.js +66 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -16114,6 +16114,12 @@ function addManagedLink(manifest, link) {
16114
16114
  manifest.managedLinks.push(link);
16115
16115
  }
16116
16116
  }
16117
+ function parkConflictingPath(destination, scopePath) {
16118
+ const backupPath = resolveBackupPath(destination, scopePath);
16119
+ fs6.mkdirSync(path6.dirname(backupPath), { recursive: true });
16120
+ fs6.renameSync(destination, backupPath);
16121
+ return backupPath;
16122
+ }
16117
16123
 
16118
16124
  // src/core/exit.ts
16119
16125
  var EXIT_FAILURE = 1;
@@ -26858,7 +26864,16 @@ function handleConflict(destination, config, options, logger, manifest, scopePat
26858
26864
  writeManifest(scopePath, manifest);
26859
26865
  fs37.rmSync(destination, { recursive: true, force: true });
26860
26866
  } else {
26861
- fs37.renameSync(destination, `${destination}.bak.${Date.now()}`);
26867
+ const parked = parkConflictingPath(
26868
+ destination,
26869
+ resolveScopePath(
26870
+ options.scope ?? "global",
26871
+ options.scope === "project" ? options.projectRoot : void 0
26872
+ )
26873
+ );
26874
+ logger.warn(
26875
+ `${destination}: moved to ${parked} (unrecorded: this run has no manifest to note it in, so uninstall will not restore it)`
26876
+ );
26862
26877
  }
26863
26878
  return true;
26864
26879
  }
@@ -28760,7 +28775,16 @@ function handleConflict2(destination, config, options, logger, manifest, scopePa
28760
28775
  writeManifest(scopePath, manifest);
28761
28776
  fs39.rmSync(destination, { recursive: true, force: true });
28762
28777
  } else {
28763
- fs39.renameSync(destination, `${destination}.bak.${Date.now()}`);
28778
+ const parked = parkConflictingPath(
28779
+ destination,
28780
+ resolveScopePath(
28781
+ options.scope ?? "global",
28782
+ options.scope === "project" ? options.projectRoot : void 0
28783
+ )
28784
+ );
28785
+ logger.warn(
28786
+ `${destination}: moved to ${parked} (unrecorded: this run has no manifest to note it in, so uninstall will not restore it)`
28787
+ );
28764
28788
  }
28765
28789
  return true;
28766
28790
  }
@@ -29353,7 +29377,16 @@ function handleConflict3(destination, config, options, logger, manifest, scopePa
29353
29377
  writeManifest(scopePath, manifest);
29354
29378
  fs40.rmSync(destination, { recursive: true, force: true });
29355
29379
  } else {
29356
- fs40.renameSync(destination, `${destination}.bak.${Date.now()}`);
29380
+ const parked = parkConflictingPath(
29381
+ destination,
29382
+ resolveScopePath(
29383
+ options.scope ?? "global",
29384
+ options.scope === "project" ? options.projectRoot : void 0
29385
+ )
29386
+ );
29387
+ logger.warn(
29388
+ `${destination}: moved to ${parked} (unrecorded: this run has no manifest to note it in, so uninstall will not restore it)`
29389
+ );
29357
29390
  }
29358
29391
  return true;
29359
29392
  }
@@ -29985,7 +30018,16 @@ function handleConflict4(destination, config, options, logger, manifest, scopePa
29985
30018
  writeManifest(scopePath, manifest);
29986
30019
  fs41.rmSync(destination, { recursive: true, force: true });
29987
30020
  } else {
29988
- fs41.renameSync(destination, `${destination}.bak.${Date.now()}`);
30021
+ const parked = parkConflictingPath(
30022
+ destination,
30023
+ resolveScopePath(
30024
+ options.scope ?? "global",
30025
+ options.scope === "project" ? options.projectRoot : void 0
30026
+ )
30027
+ );
30028
+ logger.warn(
30029
+ `${destination}: moved to ${parked} (unrecorded: this run has no manifest to note it in, so uninstall will not restore it)`
30030
+ );
29989
30031
  }
29990
30032
  return true;
29991
30033
  }
@@ -30466,7 +30508,16 @@ function handleConflict5(destination, config, options, logger, manifest, scopePa
30466
30508
  writeManifest(scopePath, manifest);
30467
30509
  fs42.rmSync(destination, { recursive: true, force: true });
30468
30510
  } else {
30469
- fs42.renameSync(destination, `${destination}.bak.${Date.now()}`);
30511
+ const parked = parkConflictingPath(
30512
+ destination,
30513
+ resolveScopePath(
30514
+ options.scope ?? "global",
30515
+ options.scope === "project" ? options.projectRoot : void 0
30516
+ )
30517
+ );
30518
+ logger.warn(
30519
+ `${destination}: moved to ${parked} (unrecorded: this run has no manifest to note it in, so uninstall will not restore it)`
30520
+ );
30470
30521
  }
30471
30522
  return true;
30472
30523
  }
@@ -30965,7 +31016,16 @@ function handleConflict6(destination, config, options, logger, manifest, scopePa
30965
31016
  writeManifest(scopePath, manifest);
30966
31017
  fs43.rmSync(destination, { recursive: true, force: true });
30967
31018
  } else {
30968
- fs43.renameSync(destination, `${destination}.bak.${Date.now()}`);
31019
+ const parked = parkConflictingPath(
31020
+ destination,
31021
+ resolveScopePath(
31022
+ options.scope ?? "global",
31023
+ options.scope === "project" ? options.projectRoot : void 0
31024
+ )
31025
+ );
31026
+ logger.warn(
31027
+ `${destination}: moved to ${parked} (unrecorded: this run has no manifest to note it in, so uninstall will not restore it)`
31028
+ );
30969
31029
  }
30970
31030
  return true;
30971
31031
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alessandroraffa/tangyr",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "CLI for the Tangyr discipline — install and manage operating kits for AI coding tools",
5
5
  "license": "MIT",
6
6
  "engines": {