@seyuna/cli 0.0.2-dev.6 → 0.0.2-dev.8

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/bin/seyuna ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from "child_process";
3
+ import path from "path";
4
+ import { fileURLToPath } from "url";
5
+ import process from "process";
6
+
7
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
8
+ const platform = process.platform;
9
+ let target;
10
+ if (platform === "win32") {
11
+ target = "seyuna-windows.exe";
12
+ } else if (platform === "darwin") {
13
+ target = "seyuna-macos";
14
+ } else if (platform === "linux") {
15
+ target = "seyuna-linux";
16
+ } else {
17
+ console.error(`Unsupported platform: ${platform}`);
18
+ process.exit(1);
19
+ }
20
+ const binPath = path.join(__dirname, target);
21
+
22
+ const child = spawn(binPath, process.argv.slice(2), {
23
+ stdio: "inherit",
24
+ });
25
+
26
+ child.on("exit", code => process.exit(code));
package/bin/seyuna-linux CHANGED
Binary file
Binary file
Binary file
package/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seyuna/cli",
3
- "version": "0.0.2-dev.6",
3
+ "version": "0.0.2-dev.8",
4
4
  "description": "Seyuna CLI",
5
5
  "bin": {
6
6
  "seyuna": "./deno-wrapper.ts"
package/node-install.js CHANGED
@@ -1,4 +1,4 @@
1
- import { mkdir, chmod, readFile } from "fs/promises";
1
+ import { mkdir, chmod } from "fs/promises";
2
2
  import { createWriteStream } from "fs";
3
3
  import { Readable } from "stream";
4
4
  import path from "path";
@@ -6,7 +6,7 @@ import { fileURLToPath } from "url";
6
6
  import process from "process";
7
7
 
8
8
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
- const version = "0.0.2-dev.6";
9
+ const version = "0.0.2-dev.8";
10
10
 
11
11
  async function downloadFile(url, dest) {
12
12
  const res = await fetch(url);
@@ -28,33 +28,28 @@ async function downloadFile(url, dest) {
28
28
  }
29
29
 
30
30
  async function main() {
31
-
32
- const platform = process.platform;
33
- let target;
34
- if (platform === "win32") {
35
- target = "seyuna-windows.exe";
36
- } else if (platform === "darwin") {
37
- target = "seyuna-macos";
38
- } else if (platform === "linux") {
39
- target = "seyuna-linux";
40
- } else {
41
- console.error(`Unsupported platform: ${platform}`);
42
- process.exit(1);
43
- }
44
-
45
- const releaseUrl = `https://github.com/seyuna-corp/seyuna-cli/releases/download/v${version}/${target}`;
46
- const dest = path.join(__dirname, "bin", target);
47
-
48
- try {
49
- await downloadFile(releaseUrl, dest);
50
- if (platform !== "win32") {
51
- await chmod(dest, 0o755);
31
+ const binaries = [
32
+ { name: "seyuna-linux", chmod: 0o755 },
33
+ { name: "seyuna-macos", chmod: 0o755 },
34
+ { name: "seyuna-windows.exe", chmod: null }
35
+ ];
36
+
37
+ for (const bin of binaries) {
38
+ const releaseUrl = `https://github.com/seyuna-corp/seyuna-cli/releases/download/v${version}/${bin.name}`;
39
+ const dest = path.join(__dirname, "bin", bin.name);
40
+ try {
41
+ console.log(`Downloading ${bin.name} from ${releaseUrl}...`);
42
+ await downloadFile(releaseUrl, dest);
43
+ if (bin.chmod) {
44
+ await chmod(dest, bin.chmod);
45
+ }
46
+ console.log(`Downloaded and prepared ${bin.name}`);
47
+ } catch (err) {
48
+ console.error(`Failed to download ${bin.name}:`, err);
49
+ process.exit(1);
52
50
  }
53
- console.log(`seyuna CLI v${version} installed to ${dest}`);
54
- } catch (err) {
55
- console.error(err);
56
- process.exit(1);
57
51
  }
52
+ console.log("All binaries downloaded and ready.");
58
53
  }
59
54
 
60
- main();
55
+ main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seyuna/cli",
3
- "version": "0.0.2-dev.6",
3
+ "version": "0.0.2-dev.8",
4
4
  "bin": {
5
5
  "seyuna": "./bin/seyuna"
6
6
  },
package/deno-wrapper.ts DELETED
@@ -1,45 +0,0 @@
1
- import { fromFileUrl, dirname, join } from "jsr:@std/path@^0.224.0";
2
-
3
- // Get the directory where this script is located
4
- const scriptDir = dirname(fromFileUrl(import.meta.url));
5
-
6
- // Use scriptDir instead of cwd
7
- function getWritableDir(): string {
8
- return join(scriptDir, ".seyuna");
9
- }
10
-
11
- const platform = Deno.build.os;
12
- const binaryName = platform === "windows"
13
- ? "seyuna-windows.exe"
14
- : platform === "darwin"
15
- ? "seyuna-macos"
16
- : "seyuna-linux";
17
-
18
- const version = "0.0.2-dev.6";
19
- const url = `https://github.com/seyuna-corp/seyuna-cli/releases/download/v${version}/${binaryName}`;
20
-
21
- const binDir = getWritableDir();
22
- await Deno.mkdir(binDir, { recursive: true });
23
- const binaryPath = join(binDir, binaryName);
24
-
25
- // Download if missing
26
- try {
27
- await Deno.stat(binaryPath);
28
- } catch {
29
- console.log(`Downloading ${binaryName} from ${url}`);
30
- const res = await fetch(url);
31
- if (!res.ok) throw new Error(`Download failed: ${res.status}`);
32
- const file = await Deno.open(binaryPath, { create: true, write: true });
33
- await res.body?.pipeTo(file.writable);
34
- await Deno.chmod(binaryPath, 0o755); // Required for UNIX
35
- }
36
-
37
- // Execute
38
- const command = new Deno.Command(binaryPath, {
39
- args: Deno.args,
40
- stdin: "inherit",
41
- stdout: "inherit",
42
- stderr: "inherit",
43
- });
44
- const { code } = await command.output();
45
- Deno.exit(code);