theamify-cli 2.2.1 → 2.2.2
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 +16 -3
- package/package.json +1 -1
- package/src/cli.js +7 -0
- package/src/lib/self.js +6 -3
- package/vendor/theamify +1 -1
package/README.md
CHANGED
|
@@ -28,25 +28,38 @@ theamify doctor # diagnose install, GRUB, tools & dependencies
|
|
|
28
28
|
theamify upgrade # check for & install the latest npm version
|
|
29
29
|
theamify repair # fix a broken install (re-provision the engine)
|
|
30
30
|
theamify uninstall # remove theamify entirely (incl. npm package)
|
|
31
|
+
theamify version # print the version
|
|
32
|
+
theamify help # show all commands
|
|
31
33
|
```
|
|
32
34
|
|
|
35
|
+
> **Command aliases** — `ls` (list), `show` (info), `get`/`fetch`/`download`, `use`/`apply`/`set`, `rm`/`uncache` (remove), `del`/`delete`, `purge-cache` (clean), `browse`/`wizard`/`install` (wizard). \
|
|
36
|
+
> **Version flags** — `-v`, `-V`, `--version` · **Help flags** — `-h`, `--help`
|
|
37
|
+
|
|
33
38
|
> 💡 Upgrading is the same command — `npm install -g theamify-cli@latest`, and your downloaded themes & registry edits are preserved.
|
|
34
39
|
> 🧰 Zero-install run (no permanent install): `npx -y theamify-cli`
|
|
35
40
|
|
|
36
41
|
---
|
|
37
42
|
|
|
38
|
-
## ✨ What's New (
|
|
43
|
+
## ✨ What's New (v2.2.2 — uninstall crash hotfix)
|
|
44
|
+
|
|
45
|
+
| Feature | Details |
|
|
46
|
+
|---|---|
|
|
47
|
+
| 🩹 **`ReferenceError: path is not defined` fixed** | The v2.2.1 uninstall crashed while stripping leftover PATH markers from `~/.bashrc`/`~/.zshrc` — `cleanRcMarkers` used `path`/`os`/`fs` without importing them. Now fixed with proper `node:` imports and guarded by regression tests. |
|
|
48
|
+
| 🔄 **Engine lockstep to v2.2.2** | Bundled engine `VERSION` bumped to match the npm package — no more "update available" nag after a fresh install. |
|
|
49
|
+
|
|
50
|
+
## ✨ What's New (v2.2.1 — release)
|
|
39
51
|
|
|
40
52
|
| Feature | Details |
|
|
41
53
|
|---|---|
|
|
42
54
|
| 🧙 **Interactive wizard** | One command: detect companion tools → pick theme → **preview** → apply |
|
|
43
55
|
| 🧩 **Auto-detected companion tools** | **chafa** (thumbnails) + **grub-customizer** (GUI) are detected first; installed if missing, or **option to update** if present — then it continues on its own |
|
|
44
|
-
| 🖼️ **
|
|
56
|
+
| 🖼️ **Thumbnail by default** | Selecting a cached theme renders its terminal thumbnail **automatically** (no separate “preview” item) |
|
|
45
57
|
| 📦 **npm global install** | Engine provisions itself user-writable (no sudo for downloads) |
|
|
46
58
|
| 🩺 **`theamify doctor`** | Diagnose install, GRUB, active theme, registry, tools & dependencies |
|
|
47
|
-
| 🗑 **
|
|
59
|
+
| 🗑 **Complete uninstall** | Deletes **ALL downloaded themes**, resets GRUB to default, removes the `theamify-cli` npm package **and** strips leftover PATH markers from `~/.bashrc`/`~/.zshrc` — after which `theamify` gives a normal `command not found` |
|
|
48
60
|
| ⌨️ **Ctrl+C / Ctrl+Z safe** | Signal safety net; interactive `sudo` is never frozen |
|
|
49
61
|
| 🔄 **Self-manage (v2.2+)** | `upgrade`, `repair`, auto-update check on every wizard run |
|
|
62
|
+
| 🧹 **Install-flow download-all** | Wizard offers to download every theme up front so each one is instantly previewable/applicable |
|
|
50
63
|
|
|
51
64
|
---
|
|
52
65
|
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -73,6 +73,13 @@ const main = defineCommand({
|
|
|
73
73
|
async run({ args }) {
|
|
74
74
|
const [cmd, ...rest] = args._;
|
|
75
75
|
|
|
76
|
+
// citty parses `-V` as a boolean flag into args.V (never reached via args._);
|
|
77
|
+
// treat it as a version request like the other aliases.
|
|
78
|
+
if (args.V) {
|
|
79
|
+
console.log(`theamify v${pkg.version}`);
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
|
|
76
83
|
// No arguments → the interactive theme browser wizard.
|
|
77
84
|
if (!cmd) return runThemeBrowser();
|
|
78
85
|
|
package/src/lib/self.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { execa } from 'execa';
|
|
2
2
|
import pc from 'picocolors';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
3
6
|
import { createRequire } from 'node:module';
|
|
4
7
|
|
|
5
8
|
const require = createRequire(import.meta.url);
|
|
@@ -34,13 +37,13 @@ export async function getLatestVersion() {
|
|
|
34
37
|
* Remove any leftover `# theamify CLI PATH` + follow-up `export PATH=` line from
|
|
35
38
|
* ~/.bashrc and ~/.zshrc (added by old installs). Called by uninstall so no
|
|
36
39
|
* traces of the tool remain in shell startup files.
|
|
40
|
+
* @param {string} [homeDir] override the home directory (used by tests)
|
|
37
41
|
*/
|
|
38
|
-
export async function cleanRcMarkers() {
|
|
39
|
-
const rcs = ['.bashrc', '.zshrc'].map((f) => path.join(
|
|
42
|
+
export async function cleanRcMarkers(homeDir = os.homedir()) {
|
|
43
|
+
const rcs = ['.bashrc', '.zshrc'].map((f) => path.join(homeDir, f));
|
|
40
44
|
const marker = '# theamify CLI PATH';
|
|
41
45
|
for (const rc of rcs) {
|
|
42
46
|
try {
|
|
43
|
-
const fs = require('node:fs');
|
|
44
47
|
if (!fs.existsSync(rc)) continue;
|
|
45
48
|
const lines = fs.readFileSync(rc, 'utf8').split('\n');
|
|
46
49
|
const out = [];
|
package/vendor/theamify
CHANGED
|
@@ -10,7 +10,7 @@ set -euo pipefail
|
|
|
10
10
|
# -----------------------------------------------------------------------------
|
|
11
11
|
# VERSION & TOOL NAME
|
|
12
12
|
# -----------------------------------------------------------------------------
|
|
13
|
-
readonly VERSION="2.2.
|
|
13
|
+
readonly VERSION="2.2.2"
|
|
14
14
|
readonly TOOL="theamify"
|
|
15
15
|
|
|
16
16
|
# -----------------------------------------------------------------------------
|