@alessandroraffa/tangyr 1.0.4 → 2.0.0

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/README.md CHANGED
@@ -342,9 +342,9 @@ In `tangyr-kit.yaml`, `discipline` is optional: declare it to opt into the corpu
342
342
 
343
343
  ## Conflict policy
344
344
 
345
- Before writing, each destination is classified and resolved according to `onConflict` in `tangyr.config.yaml`: `ask` (default; prompts, and resolves to backup-and-replace in a non-interactive run), `skip`, `backup`, or `overwrite`.
345
+ Before writing, each destination is classified and resolved according to `onConflict` in `tangyr.config.yaml`: `ask` (default; prompts, and resolves to **skip** when there is no one to ask), `skip`, `backup`, or `overwrite`.
346
346
 
347
- `--yes` supplies the confirmation a non-interactive run needs; it does **not** override the posture. Under `--yes`, `skip` leaves conflicting destinations unchanged and says which, `overwrite` replaces without a backup, and `backup` copies the existing file — or the existing directory, recursively — into `.tangyr/backups/<timestamp>/` and records it in the manifest so `uninstall` can put it back. A symlink is replaced without a backup: what it points at is untouched.
347
+ `--yes` supplies the confirmation a non-interactive run needs; it does **not** override the posture. Under `--yes`, `skip` leaves conflicting destinations unchanged and says which, `overwrite` replaces without a backup, `ask` leaves the destination alone and names the postures that replace, and `backup` copies the existing file — or the existing directory, recursively — into `.tangyr/backups/<timestamp>/` and records it in the manifest so `uninstall` can put it back. A symlink is backed up as a symlink and restored as one: its target is untouched either way, but the link itself is the operator's artifact — often the one committed with the project — so replacing it without a record left nothing to put back.
348
348
 
349
349
  One decision is taken per destination, not per target, so a file several targets write — `AGENTS.md` is claimed by four — is backed up once.
350
350
 
package/dist/index.js CHANGED
@@ -22304,13 +22304,11 @@ async function runUninstallCommand(options, logger) {
22304
22304
  }
22305
22305
  }
22306
22306
  if (fullUninstall) {
22307
- const newestFirst = [...manifest.backups].reverse();
22308
22307
  const restored = /* @__PURE__ */ new Set();
22309
- for (const backup of newestFirst) {
22308
+ const kept = [];
22309
+ for (const backup of manifest.backups) {
22310
22310
  if (restored.has(backup.originalPath)) {
22311
- logger.verbose(
22312
- ` superseded by a newer backup, not restored: ${backup.backupLocation}`
22313
- );
22311
+ kept.push(backup);
22314
22312
  continue;
22315
22313
  }
22316
22314
  restored.add(backup.originalPath);
@@ -22322,6 +22320,19 @@ async function runUninstallCommand(options, logger) {
22322
22320
  );
22323
22321
  }
22324
22322
  }
22323
+ if (kept.length > 0) {
22324
+ logger.warn(
22325
+ `
22326
+ ${String(kept.length)} later backup(s) were NOT restored: the earliest copy of each location is the one that comes back, because it is the content from before the first install.`
22327
+ );
22328
+ for (const backup of kept) {
22329
+ logger.warn(` ${backup.originalPath}`);
22330
+ logger.warn(` later copy left at: ${backup.backupLocation}`);
22331
+ }
22332
+ logger.warn(
22333
+ " The manifest is removed below, so nothing will reference these copies afterwards. Move what you need out of the backups directory now."
22334
+ );
22335
+ }
22325
22336
  const manifestPath = path24.join(scopePath, "manifest.json");
22326
22337
  if (fs27.existsSync(manifestPath)) {
22327
22338
  fs27.unlinkSync(manifestPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alessandroraffa/tangyr",
3
- "version": "1.0.4",
3
+ "version": "2.0.0",
4
4
  "description": "CLI for the Tangyr discipline — install and manage operating kits for AI coding tools",
5
5
  "license": "MIT",
6
6
  "engines": {