xypriss 6.2.0 → 6.2.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.
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "xypriss",
3
- "version": "6.2.0",
3
+ "version": "6.2.1",
4
4
  "description": "XyPriss is a lightweight, TypeScript-first, open-source Node.js web framework crafted for developers seeking a familiar Express-like API without Express dependencies. It features built-in security middleware, a robust routing system, and performance optimizations to build scalable, secure web applications effortlessly. Join our community and contribute on GitHub!",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "type": "module",
9
9
  "bin": {
10
- "xsys": "bin/xsys",
11
- "xypriss-sys": "bin/xsys"
10
+ "xsys": "scripts/xys.run.js",
11
+ "xypriss-sys": "scripts/xys.run.js"
12
12
  },
13
13
  "files": [
14
14
  "dist/cjs/**/*",
@@ -0,0 +1,100 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Nehonix XyPriss System CLI Tool - High-performance system & FS management
5
+ *
6
+ * This is the main bridge for the xsys command.
7
+ * It manages the execution of the proprietary Rust-based xsys binary.
8
+ *
9
+ * © 2026 Nehonix Team. All rights reserved.
10
+ */
11
+
12
+ import { spawn } from "node:child_process";
13
+ import path from "node:path";
14
+ import fs from "node:fs";
15
+ import os from "node:os";
16
+ import { fileURLToPath } from "node:url";
17
+
18
+ // Support ESM __dirname
19
+ const __filename = fileURLToPath(import.meta.url);
20
+ const __dirname = path.dirname(__filename);
21
+
22
+ /**
23
+ * Get the path to the xsys binary
24
+ */
25
+ function getBinaryPath() {
26
+ const isWin = os.platform() === "win32";
27
+ const binName = isWin ? "xsys.exe" : "xsys";
28
+
29
+ // Strategic locations for the binary
30
+ const locations = [
31
+ path.join(__dirname, "..", "bin", binName), // Production (npm install)
32
+ path.join(process.cwd(), "bin", binName), // Local development
33
+ path.join(
34
+ __dirname,
35
+ "..",
36
+ "tools",
37
+ "xypriss-sys",
38
+ "target",
39
+ "release",
40
+ binName
41
+ ), // Dev target
42
+ ];
43
+
44
+ for (const loc of locations) {
45
+ if (fs.existsSync(loc)) {
46
+ return loc;
47
+ }
48
+ }
49
+
50
+ return null;
51
+ }
52
+
53
+ /**
54
+ * Execute the binary with the provided arguments
55
+ */
56
+ function main() {
57
+ const binaryPath = getBinaryPath();
58
+ const args = process.argv.slice(2);
59
+
60
+ if (!binaryPath) {
61
+ console.error(
62
+ "\x1b[31m[ERROR] XyPriss System Binary (xsys) not found.\x1b[0m"
63
+ );
64
+ console.error(
65
+ "Please ensure the binary is installed by running: \x1b[36mnpm install xypriss\x1b[0m"
66
+ );
67
+ process.exit(1);
68
+ }
69
+
70
+ // Spawn the binary process
71
+ const child = spawn(binaryPath, args, {
72
+ stdio: "inherit",
73
+ env: {
74
+ ...process.env,
75
+ XYPRISS_BINARY_PATH: binaryPath,
76
+ XYPRISS_EXEC_CONTEXT: "npm-bin",
77
+ },
78
+ });
79
+
80
+ // Mirror exit signals and codes
81
+ child.on("exit", (code, signal) => {
82
+ if (signal) {
83
+ process.kill(process.pid, signal);
84
+ } else {
85
+ process.exit(code ?? 0);
86
+ }
87
+ });
88
+
89
+ child.on("error", (err) => {
90
+ console.error(
91
+ "\x1b[31m[CRITICAL] Failed to initiate xsys execution:\x1b[0m",
92
+ err.message
93
+ );
94
+ process.exit(1);
95
+ });
96
+ }
97
+
98
+ // Execution entry point
99
+ main();
100
+
package/bin/xsys DELETED
Binary file