myoperator-ui 0.0.192 → 0.0.194

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 +33 -28
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -13119,44 +13119,49 @@ async function sync(options) {
13119
13119
  process.exit(1);
13120
13120
  }
13121
13121
  }
13122
- if (orphaned.length > 0) {
13122
+ const ignorePath = path6.join(cwd, ".myoperator-ui-ignore");
13123
+ let ignoredPaths = [];
13124
+ if (await fs6.pathExists(ignorePath)) {
13125
+ const raw = await fs6.readFile(ignorePath, "utf-8");
13126
+ ignoredPaths = raw.split("\n").map((l) => l.trim()).filter((l) => l && !l.startsWith("#"));
13127
+ }
13128
+ const visibleOrphans = orphaned.filter((o) => !ignoredPaths.includes(o.displayPath));
13129
+ if (visibleOrphans.length > 0) {
13123
13130
  console.log(chalk5.yellow("\n \u26A0 The following were not found in the current myOperator UI registry."));
13124
13131
  console.log(chalk5.gray(" They may be outdated components or your own custom files \u2014 review before deleting.\n"));
13125
- orphaned.forEach((o) => console.log(chalk5.gray(` ${o.isDir ? "\u{1F4C1}" : "\u{1F4C4}"} ${o.displayPath}`)));
13132
+ visibleOrphans.forEach((o) => console.log(chalk5.gray(` ${o.isDir ? "\u{1F4C1}" : "\u{1F4C4}"} ${o.displayPath}`)));
13126
13133
  console.log("");
13127
13134
  if (options.yes) {
13128
13135
  console.log(chalk5.gray(" Run sync without --yes to interactively choose which to remove.\n"));
13129
13136
  } else {
13130
- const { toDelete } = await prompts3({
13131
- type: "multiselect",
13132
- name: "toDelete",
13133
- message: "Select items to delete (space to select, enter to confirm \u2014 leave all unselected to keep everything)",
13134
- choices: orphaned.map((o) => ({
13135
- title: o.displayPath,
13136
- value: o,
13137
- selected: false
13138
- }))
13139
- });
13140
- const selected = toDelete ?? [];
13141
- if (selected.length > 0) {
13142
- const { confirmed } = await prompts3({
13143
- type: "confirm",
13144
- name: "confirmed",
13145
- message: `Permanently delete ${selected.length} item(s)? This cannot be undone.`,
13146
- initial: false
13137
+ const kept = [];
13138
+ for (const item of visibleOrphans) {
13139
+ const icon = item.isDir ? "\u{1F4C1}" : "\u{1F4C4}";
13140
+ const { action } = await prompts3({
13141
+ type: "select",
13142
+ name: "action",
13143
+ message: `${icon} ${item.displayPath}`,
13144
+ choices: [
13145
+ { title: "Keep \u2014 leave it alone", value: "keep" },
13146
+ { title: "Delete \u2014 permanently remove it", value: "delete" },
13147
+ { title: "Ignore \u2014 keep and never ask again", value: "ignore" }
13148
+ ]
13147
13149
  });
13148
- if (confirmed) {
13149
- for (const item of selected) {
13150
- await fs6.remove(item.fullPath);
13151
- console.log(chalk5.red(` \u2715 Deleted ${item.displayPath}`));
13152
- }
13153
- console.log("");
13150
+ if (action === "delete") {
13151
+ await fs6.remove(item.fullPath);
13152
+ console.log(chalk5.red(` \u2715 Deleted ${item.displayPath}`));
13153
+ } else if (action === "ignore") {
13154
+ kept.push(item);
13155
+ const header = ignoredPaths.length === 0 ? "# myOperator UI \u2014 paths to skip in orphan detection (one per line)\n" : "";
13156
+ await fs6.appendFile(ignorePath, header + item.displayPath + "\n");
13157
+ ignoredPaths.push(item.displayPath);
13158
+ console.log(chalk5.green(` \u2713 ${item.displayPath} added to .myoperator-ui-ignore`));
13154
13159
  } else {
13155
- console.log(chalk5.gray("\n Nothing deleted.\n"));
13160
+ kept.push(item);
13161
+ console.log(chalk5.gray(` \xB7 Kept ${item.displayPath}`));
13156
13162
  }
13157
- } else {
13158
- console.log(chalk5.gray(" No items selected \u2014 all kept.\n"));
13159
13163
  }
13164
+ console.log("");
13160
13165
  }
13161
13166
  }
13162
13167
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-ui",
3
- "version": "0.0.192",
3
+ "version": "0.0.194",
4
4
  "description": "CLI for adding myOperator UI components to your project",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",