@degausai/wonda 1.7.1 → 1.9.0

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/install.js +52 -1
  2. package/package.json +7 -7
package/install.js CHANGED
@@ -1,5 +1,13 @@
1
- const { mkdirSync, copyFileSync, chmodSync } = require("fs");
1
+ const {
2
+ mkdirSync,
3
+ copyFileSync,
4
+ chmodSync,
5
+ existsSync,
6
+ unlinkSync,
7
+ } = require("fs");
2
8
  const { join } = require("path");
9
+ const { execSync } = require("child_process");
10
+ const { homedir } = require("os");
3
11
 
4
12
  const PLATFORMS = {
5
13
  "darwin-arm64": "@degausai/wonda-darwin-arm64",
@@ -43,3 +51,46 @@ const destPath = join(
43
51
  mkdirSync(destDir, { recursive: true });
44
52
  copyFileSync(binPath, destPath);
45
53
  chmodSync(destPath, 0o755);
54
+
55
+ // ---------------------------------------------------------------------------
56
+ // Detect and clean up existing installs from other methods
57
+ // ---------------------------------------------------------------------------
58
+
59
+ const WONDA_BIN_DIR = join(homedir(), ".wonda", "bin");
60
+ const CURL_BINARY = join(WONDA_BIN_DIR, "wonda");
61
+
62
+ // 1. Detect curl/shell installer (~/.wonda/bin/wonda)
63
+ if (existsSync(CURL_BINARY)) {
64
+ try {
65
+ unlinkSync(CURL_BINARY);
66
+ console.log(
67
+ `\n⚠ Removed previous shell-installed wonda at ${CURL_BINARY}`,
68
+ );
69
+ } catch {
70
+ console.warn(
71
+ `\n⚠ Found a previous shell-installed wonda at ${CURL_BINARY}\n` +
72
+ ` Could not remove it automatically. Please delete it manually:\n` +
73
+ ` rm ${CURL_BINARY}`,
74
+ );
75
+ }
76
+
77
+ console.warn(
78
+ ` Your shell config may still have a PATH entry for ~/.wonda/bin.\n` +
79
+ ` Remove the "# wonda" block from your shell config to avoid conflicts:\n` +
80
+ ` grep -n "wonda" ~/.zshrc ~/.bashrc ~/.bash_profile 2>/dev/null`,
81
+ );
82
+ }
83
+
84
+ // 2. Detect Homebrew install
85
+ if (process.platform !== "win32") {
86
+ try {
87
+ execSync("brew list wonda 2>/dev/null", { stdio: "pipe" });
88
+ console.warn(
89
+ `\n⚠ wonda is also installed via Homebrew.\n` +
90
+ ` The npm version may conflict. To remove the Homebrew version:\n` +
91
+ ` brew uninstall wonda`,
92
+ );
93
+ } catch {
94
+ // Not installed via brew — nothing to do
95
+ }
96
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@degausai/wonda",
3
- "version": "1.7.1",
3
+ "version": "1.9.0",
4
4
  "description": "AI-powered content generation CLI",
5
5
  "homepage": "https://wonda.sh",
6
6
  "repository": {
@@ -15,11 +15,11 @@
15
15
  "postinstall": "node install.js"
16
16
  },
17
17
  "optionalDependencies": {
18
- "@degausai/wonda-darwin-arm64": "1.7.1",
19
- "@degausai/wonda-darwin-x64": "1.7.1",
20
- "@degausai/wonda-linux-x64": "1.7.1",
21
- "@degausai/wonda-linux-arm64": "1.7.1",
22
- "@degausai/wonda-win32-x64": "1.7.1",
23
- "@degausai/wonda-win32-arm64": "1.7.1"
18
+ "@degausai/wonda-darwin-arm64": "1.9.0",
19
+ "@degausai/wonda-darwin-x64": "1.9.0",
20
+ "@degausai/wonda-linux-x64": "1.9.0",
21
+ "@degausai/wonda-linux-arm64": "1.9.0",
22
+ "@degausai/wonda-win32-x64": "1.9.0",
23
+ "@degausai/wonda-win32-arm64": "1.9.0"
24
24
  }
25
25
  }