opencode-nim-rotator 0.0.2 → 0.0.4
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 +17 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -10
- package/dist/index.js.map +1 -1
- package/dist/storage.d.ts +21 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +272 -16
- package/dist/storage.js.map +1 -1
- package/dist/themes.d.ts.map +1 -1
- package/dist/themes.js +8 -14
- package/dist/themes.js.map +1 -1
- package/dist/tui/actions.d.ts +2 -0
- package/dist/tui/actions.d.ts.map +1 -1
- package/dist/tui/actions.js +48 -2
- package/dist/tui/actions.js.map +1 -1
- package/dist/tui/app.d.ts.map +1 -1
- package/dist/tui/app.js +21 -2
- package/dist/tui/app.js.map +1 -1
- package/dist/tui/screens.d.ts +3 -0
- package/dist/tui/screens.d.ts.map +1 -1
- package/dist/tui/screens.js +121 -3
- package/dist/tui/screens.js.map +1 -1
- package/dist/tui/state.d.ts +3 -0
- package/dist/tui/state.d.ts.map +1 -1
- package/dist/tui/state.js +2 -0
- package/dist/tui/state.js.map +1 -1
- package/dist/tui/types.d.ts +1 -1
- package/dist/tui/types.d.ts.map +1 -1
- package/dist/tui/ui.js +1 -1
- package/dist/tui/ui.js.map +1 -1
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/scripts/postinstall.js +1 -1
- package/scripts/uninstall.js +39 -5
package/scripts/uninstall.js
CHANGED
|
@@ -8,6 +8,7 @@ import { readFile, writeFile, unlink } from "fs/promises";
|
|
|
8
8
|
const CONFIG_DIR = join(homedir(), ".config", "opencode");
|
|
9
9
|
const CONFIG_PATH = join(CONFIG_DIR, "opencode.json");
|
|
10
10
|
const KEYSTORE_PATH = join(CONFIG_DIR, "nim-rotator-keys.json");
|
|
11
|
+
const THEME_PATH = join(CONFIG_DIR, "nim-rotator-theme.json");
|
|
11
12
|
|
|
12
13
|
async function uninstall() {
|
|
13
14
|
console.log(
|
|
@@ -57,16 +58,49 @@ async function uninstall() {
|
|
|
57
58
|
|
|
58
59
|
// Remove key store file
|
|
59
60
|
if (existsSync(KEYSTORE_PATH)) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
console.warn("
|
|
61
|
+
if (!process.stdin.isTTY) {
|
|
62
|
+
console.warn(
|
|
63
|
+
"Key store file exists but cannot confirm deletion in non-interactive mode.",
|
|
64
|
+
);
|
|
65
|
+
console.warn("Manually remove: " + KEYSTORE_PATH);
|
|
66
|
+
} else {
|
|
67
|
+
const readline = await import("readline");
|
|
68
|
+
const rl = readline.createInterface({
|
|
69
|
+
input: process.stdin,
|
|
70
|
+
output: process.stdout,
|
|
71
|
+
});
|
|
72
|
+
const answer = await new Promise(function (resolve) {
|
|
73
|
+
rl.question(
|
|
74
|
+
"Delete all stored API keys? This cannot be undone. [y/N] ",
|
|
75
|
+
resolve,
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
rl.close();
|
|
79
|
+
if (answer !== "y" && answer !== "Y") {
|
|
80
|
+
console.log("Key store preserved at: " + KEYSTORE_PATH);
|
|
81
|
+
} else {
|
|
82
|
+
try {
|
|
83
|
+
await unlink(KEYSTORE_PATH);
|
|
84
|
+
console.log("Removed key store file");
|
|
85
|
+
} catch (err) {
|
|
86
|
+
console.warn("Could not remove key store file:", err);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
65
89
|
}
|
|
66
90
|
} else {
|
|
67
91
|
console.log("Key store file not found - skipping");
|
|
68
92
|
}
|
|
69
93
|
|
|
94
|
+
// Remove theme override file
|
|
95
|
+
if (existsSync(THEME_PATH)) {
|
|
96
|
+
try {
|
|
97
|
+
await unlink(THEME_PATH);
|
|
98
|
+
console.log("Removed theme preference file");
|
|
99
|
+
} catch (err) {
|
|
100
|
+
console.warn("Could not remove theme preference file:", err);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
70
104
|
console.log(
|
|
71
105
|
"\nUninstall complete." +
|
|
72
106
|
(configModified ? " Restart opencode to apply changes." : ""),
|