@degausai/wonda 0.0.1

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 +45 -0
  2. package/package.json +25 -0
package/install.js ADDED
@@ -0,0 +1,45 @@
1
+ const { mkdirSync, copyFileSync, chmodSync } = require("fs");
2
+ const { join } = require("path");
3
+
4
+ const PLATFORMS = {
5
+ "darwin-arm64": "@degausai/wonda-darwin-arm64",
6
+ "darwin-x64": "@degausai/wonda-darwin-x64",
7
+ "linux-x64": "@degausai/wonda-linux-x64",
8
+ "linux-arm64": "@degausai/wonda-linux-arm64",
9
+ "win32-x64": "@degausai/wonda-win32-x64",
10
+ "win32-arm64": "@degausai/wonda-win32-arm64",
11
+ };
12
+
13
+ const platformKey = `${process.platform}-${process.arch}`;
14
+ const pkg = PLATFORMS[platformKey];
15
+
16
+ if (!pkg) {
17
+ console.error(
18
+ `Unsupported platform: ${process.platform}-${process.arch}. ` +
19
+ `Supported: ${Object.keys(PLATFORMS).join(", ")}`
20
+ );
21
+ process.exit(1);
22
+ }
23
+
24
+ let binPath;
25
+ try {
26
+ binPath = require.resolve(
27
+ `${pkg}/${process.platform === "win32" ? "wonda.exe" : "wonda"}`
28
+ );
29
+ } catch {
30
+ console.error(
31
+ `Could not find the binary for ${platformKey}. ` +
32
+ `The optional dependency ${pkg} may not have been installed.`
33
+ );
34
+ process.exit(1);
35
+ }
36
+
37
+ const destDir = join(__dirname, "bin");
38
+ const destPath = join(
39
+ destDir,
40
+ process.platform === "win32" ? "wonda.exe" : "wonda"
41
+ );
42
+
43
+ mkdirSync(destDir, { recursive: true });
44
+ copyFileSync(binPath, destPath);
45
+ chmodSync(destPath, 0o755);
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@degausai/wonda",
3
+ "version": "0.0.1",
4
+ "description": "AI-powered content generation CLI",
5
+ "homepage": "https://wonda.sh",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/degausai/wonda"
9
+ },
10
+ "license": "Proprietary",
11
+ "bin": {
12
+ "wonda": "bin/wonda"
13
+ },
14
+ "scripts": {
15
+ "postinstall": "node install.js"
16
+ },
17
+ "optionalDependencies": {
18
+ "@degausai/wonda-darwin-arm64": "0.0.1",
19
+ "@degausai/wonda-darwin-x64": "0.0.1",
20
+ "@degausai/wonda-linux-x64": "0.0.1",
21
+ "@degausai/wonda-linux-arm64": "0.0.1",
22
+ "@degausai/wonda-win32-x64": "0.0.1",
23
+ "@degausai/wonda-win32-arm64": "0.0.1"
24
+ }
25
+ }