myoperator-ui 0.0.193 → 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 +24 -45
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -13134,55 +13134,34 @@ async function sync(options) {
13134
13134
  if (options.yes) {
13135
13135
  console.log(chalk5.gray(" Run sync without --yes to interactively choose which to remove.\n"));
13136
13136
  } else {
13137
- const { toDelete } = await prompts3({
13138
- type: "multiselect",
13139
- name: "toDelete",
13140
- message: "Select items to delete (space to select, enter to confirm \u2014 leave all unselected to keep everything)",
13141
- choices: visibleOrphans.map((o) => ({
13142
- title: o.displayPath,
13143
- value: o,
13144
- selected: false
13145
- }))
13146
- });
13147
- const selected = toDelete ?? [];
13148
- let kept = [];
13149
- if (selected.length > 0) {
13150
- const { confirmed } = await prompts3({
13151
- type: "confirm",
13152
- name: "confirmed",
13153
- message: `Permanently delete ${selected.length} item(s)? This cannot be undone.`,
13154
- 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
+ ]
13155
13149
  });
13156
- if (confirmed) {
13157
- for (const item of selected) {
13158
- await fs6.remove(item.fullPath);
13159
- console.log(chalk5.red(` \u2715 Deleted ${item.displayPath}`));
13160
- }
13161
- console.log("");
13162
- kept = visibleOrphans.filter((o) => !selected.includes(o));
13163
- } else {
13164
- console.log(chalk5.gray("\n Nothing deleted.\n"));
13165
- kept = visibleOrphans;
13166
- }
13167
- } else {
13168
- console.log(chalk5.gray(" No items selected \u2014 all kept.\n"));
13169
- kept = visibleOrphans;
13170
- }
13171
- if (kept.length > 0) {
13172
- const { addToIgnore } = await prompts3({
13173
- type: "confirm",
13174
- name: "addToIgnore",
13175
- message: `Add ${kept.length} kept item(s) to .myoperator-ui-ignore to skip future warnings?`,
13176
- initial: true
13177
- });
13178
- if (addToIgnore) {
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);
13179
13155
  const header = ignoredPaths.length === 0 ? "# myOperator UI \u2014 paths to skip in orphan detection (one per line)\n" : "";
13180
- const lines = kept.map((o) => o.displayPath).join("\n");
13181
- await fs6.appendFile(ignorePath, header + lines + "\n");
13182
- console.log(chalk5.green(` \u2713 Added to .myoperator-ui-ignore \u2014 won't prompt again.
13183
- `));
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`));
13159
+ } else {
13160
+ kept.push(item);
13161
+ console.log(chalk5.gray(` \xB7 Kept ${item.displayPath}`));
13184
13162
  }
13185
13163
  }
13164
+ console.log("");
13186
13165
  }
13187
13166
  }
13188
13167
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-ui",
3
- "version": "0.0.193",
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",