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.
- package/dist/index.js +33 -28
- 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
|
-
|
|
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
|
-
|
|
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
|
|
13131
|
-
|
|
13132
|
-
|
|
13133
|
-
|
|
13134
|
-
|
|
13135
|
-
|
|
13136
|
-
|
|
13137
|
-
|
|
13138
|
-
|
|
13139
|
-
|
|
13140
|
-
|
|
13141
|
-
|
|
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 (
|
|
13149
|
-
|
|
13150
|
-
|
|
13151
|
-
|
|
13152
|
-
|
|
13153
|
-
|
|
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
|
-
|
|
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
|
}
|