myoperator-ui 0.0.192 → 0.0.193

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 +29 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -13119,10 +13119,17 @@ 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"));
@@ -13131,13 +13138,14 @@ async function sync(options) {
13131
13138
  type: "multiselect",
13132
13139
  name: "toDelete",
13133
13140
  message: "Select items to delete (space to select, enter to confirm \u2014 leave all unselected to keep everything)",
13134
- choices: orphaned.map((o) => ({
13141
+ choices: visibleOrphans.map((o) => ({
13135
13142
  title: o.displayPath,
13136
13143
  value: o,
13137
13144
  selected: false
13138
13145
  }))
13139
13146
  });
13140
13147
  const selected = toDelete ?? [];
13148
+ let kept = [];
13141
13149
  if (selected.length > 0) {
13142
13150
  const { confirmed } = await prompts3({
13143
13151
  type: "confirm",
@@ -13151,11 +13159,29 @@ async function sync(options) {
13151
13159
  console.log(chalk5.red(` \u2715 Deleted ${item.displayPath}`));
13152
13160
  }
13153
13161
  console.log("");
13162
+ kept = visibleOrphans.filter((o) => !selected.includes(o));
13154
13163
  } else {
13155
13164
  console.log(chalk5.gray("\n Nothing deleted.\n"));
13165
+ kept = visibleOrphans;
13156
13166
  }
13157
13167
  } else {
13158
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) {
13179
+ 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
+ `));
13184
+ }
13159
13185
  }
13160
13186
  }
13161
13187
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-ui",
3
- "version": "0.0.192",
3
+ "version": "0.0.193",
4
4
  "description": "CLI for adding myOperator UI components to your project",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",