@seyuna/cli 0.0.2-dev.1 → 0.0.2-dev.10

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/node-install.js CHANGED
@@ -6,6 +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.10";
9
10
 
10
11
  async function downloadFile(url, dest) {
11
12
  const res = await fetch(url);
@@ -26,14 +27,7 @@ async function downloadFile(url, dest) {
26
27
  });
27
28
  }
28
29
 
29
- async function getVersion() {
30
- const pkgPath = path.join(__dirname, "package.json");
31
- const pkgJson = await readFile(pkgPath, "utf8");
32
- return JSON.parse(pkgJson).version;
33
- }
34
-
35
30
  async function main() {
36
- const version = await getVersion();
37
31
 
38
32
  const platform = process.platform;
39
33
  let target;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@seyuna/cli",
3
- "version": "0.0.2-dev.1",
3
+ "version": "0.0.2-dev.10",
4
4
  "bin": {
5
5
  "seyuna": "./bin/seyuna"
6
6
  },
7
7
  "scripts": {
8
- "prepare": "node node-install.js"
8
+ "postinstall": "node node-install.js"
9
9
  },
10
10
  "description": "Seyuna CLI",
11
11
  "author": "Seyuna",
package/bin/seyuna DELETED
Binary file
package/deno-wrapper.ts DELETED
@@ -1,79 +0,0 @@
1
- #!/usr/bin/env -S deno run --allow-run --allow-read --allow-write --allow-net
2
-
3
- import { join, dirname } from "jsr:@std/path@^0.224.0";
4
- import { ensureDir, existsSync } from "jsr:@std/fs@^0.224.0";
5
-
6
- // Get version from deno.json
7
- async function getVersion(): Promise<string> {
8
- const text = await Deno.readTextFile("deno.json");
9
- const config = JSON.parse(text);
10
- return config.version;
11
- }
12
-
13
- // Download a file from a URL to a destination path
14
- async function downloadFile(url: string, dest: string): Promise<void> {
15
- const res = await fetch(url);
16
- if (!res.ok || !res.body) {
17
- throw new Error(`Failed to download ${url}: ${res.status} ${res.statusText}`);
18
- }
19
-
20
- await ensureDir(dirname(dest));
21
- const file = await Deno.open(dest, { create: true, write: true, truncate: true });
22
- await res.body.pipeTo(file.writable);
23
- }
24
-
25
- // Main execution
26
- async function main() {
27
- const platform = Deno.build.os; // "windows", "linux", or "darwin"
28
- const binName = platform === "windows" ? "seyuna.exe" : "seyuna";
29
- const binPath = join(Deno.cwd(), "bin", binName);
30
-
31
- if (!existsSync(binPath)) {
32
- console.log("seyuna binary not found, downloading...");
33
-
34
- const version = await getVersion();
35
-
36
- let target: string;
37
- switch (platform) {
38
- case "windows":
39
- target = "seyuna-windows.exe";
40
- break;
41
- case "darwin":
42
- target = "seyuna-macos";
43
- break;
44
- case "linux":
45
- target = "seyuna-linux";
46
- break;
47
- default:
48
- console.error(`Unsupported platform: ${platform}`);
49
- Deno.exit(1);
50
- }
51
-
52
- const releaseUrl = `https://github.com/seyuna-corp/seyuna-cli/releases/download/v${version}/${target}`;
53
-
54
- try {
55
- await downloadFile(releaseUrl, binPath);
56
- if (platform !== "windows") {
57
- await Deno.chmod(binPath, 0o755);
58
- }
59
- console.log(`seyuna CLI v${version} installed to ${binPath}`);
60
- } catch (err) {
61
- console.error("Installation failed:", err);
62
- Deno.exit(1);
63
- }
64
- }
65
-
66
- // Forward all arguments to the actual binary
67
- const process = Deno.run({
68
- cmd: [binPath, ...Deno.args],
69
- stdin: "inherit",
70
- stdout: "inherit",
71
- stderr: "inherit",
72
- });
73
-
74
- const status = await process.status();
75
- process.close();
76
- Deno.exit(status.code);
77
- }
78
-
79
- await main();
package/deno.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "name": "@seyuna/cli",
3
- "version": "0.0.2-dev.1",
4
- "description": "Seyuna CLI",
5
- "bin": {
6
- "seyuna": "./deno-wrapper.ts"
7
- },
8
- "exports": "./deno-wrapper.ts",
9
- "license": "MIT",
10
- "tasks": {
11
- "install": "deno run --allow-write --allow-net deno-install.ts"
12
- }
13
- }