xypriss 6.2.0 → 6.2.2
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/memory-cli-linux-x64 +0 -0
- package/dist/cjs/src/sys/XyPrissRunner.js +34 -7
- package/dist/cjs/src/sys/XyPrissRunner.js.map +1 -1
- package/dist/esm/src/sys/XyPrissRunner.js +33 -7
- package/dist/esm/src/sys/XyPrissRunner.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/package.json +4 -3
- package/scripts/postinstall-xsys.js +7 -2
- package/scripts/xys.run.js +100 -0
|
Binary file
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
var path = require('node:path');
|
|
4
4
|
var fs = require('node:fs');
|
|
5
5
|
var node_child_process = require('node:child_process');
|
|
6
|
+
var node_url = require('node:url');
|
|
6
7
|
|
|
8
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
7
9
|
/**
|
|
8
10
|
* Custom error class for XyPriss system operations.
|
|
9
11
|
*/
|
|
@@ -24,15 +26,40 @@ class XyPrissError extends Error {
|
|
|
24
26
|
class XyPrissRunner {
|
|
25
27
|
constructor(root) {
|
|
26
28
|
this.root = root;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
this.binaryPath = this.discoverBinary();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Strategic discovery of the xsys binary across different environments.
|
|
33
|
+
*/
|
|
34
|
+
discoverBinary() {
|
|
35
|
+
const binName = process.platform === "win32" ? "xsys.exe" : "xsys";
|
|
36
|
+
// 1. Try discovery relative to this script (supports npm install & local dev)
|
|
37
|
+
try {
|
|
38
|
+
const __filename = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('src/sys/XyPrissRunner.js', document.baseURI).href)));
|
|
39
|
+
const __dirname = path.dirname(__filename);
|
|
40
|
+
const locations = [
|
|
41
|
+
path.resolve(__dirname, "..", "..", "..", "..", "bin", binName), // dist/esm/src/sys/ -> bin/
|
|
42
|
+
path.resolve(__dirname, "..", "..", "bin", binName), // src/sys/ -> bin/
|
|
43
|
+
path.resolve(__dirname, "..", "..", "..", "bin", binName), // dist/cjs/src/sys -> bin/
|
|
44
|
+
];
|
|
45
|
+
for (const loc of locations) {
|
|
46
|
+
if (fs.existsSync(loc))
|
|
47
|
+
return loc;
|
|
34
48
|
}
|
|
35
49
|
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
// Silently fail and fallback
|
|
52
|
+
}
|
|
53
|
+
// 2. Try project root bin (Legacy/Overlay)
|
|
54
|
+
const projectBin = path.resolve(process.cwd(), "bin", binName);
|
|
55
|
+
if (fs.existsSync(projectBin))
|
|
56
|
+
return projectBin;
|
|
57
|
+
// 3. Try development target
|
|
58
|
+
const devPath = path.resolve(process.cwd(), "tools", "xypriss-sys", "target", "release", binName);
|
|
59
|
+
if (fs.existsSync(devPath))
|
|
60
|
+
return devPath;
|
|
61
|
+
// 4. Global fallback
|
|
62
|
+
return binName;
|
|
36
63
|
}
|
|
37
64
|
/**
|
|
38
65
|
* Executes a command synchronously and returns the parsed JSON result.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XyPrissRunner.js","sources":["../../../../src/sys/XyPrissRunner.ts"],"sourcesContent":[null],"names":["execFileSync"],"mappings":"
|
|
1
|
+
{"version":3,"file":"XyPrissRunner.js","sources":["../../../../src/sys/XyPrissRunner.ts"],"sourcesContent":[null],"names":["fileURLToPath","execFileSync"],"mappings":";;;;;;;;AAMA;;AAEG;AACG,MAAO,YAAa,SAAQ,KAAK,CAAA;AACnC,IAAA,WAAA,CACW,MAAc,EACd,MAAc,EACd,OAAe,EACf,GAAS,EAAA;QAEhB,KAAK,CAAC,mBAAmB,MAAM,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,EAAE,CAAC;AACtC,qBAAA,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC;AAC9B,qBAAA,IAAI,EAAE,CAAC;aACf;;AAGD,YAAA,IAAI,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;AACpC,gBAAA,YAAY,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;aAC5C;YAED,MAAM,IAAI,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;SAC/D;KACJ;AACJ;;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import { execFileSync } from 'node:child_process';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Custom error class for XyPriss system operations.
|
|
@@ -22,15 +23,40 @@ class XyPrissError extends Error {
|
|
|
22
23
|
class XyPrissRunner {
|
|
23
24
|
constructor(root) {
|
|
24
25
|
this.root = root;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
this.binaryPath = this.discoverBinary();
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Strategic discovery of the xsys binary across different environments.
|
|
30
|
+
*/
|
|
31
|
+
discoverBinary() {
|
|
32
|
+
const binName = process.platform === "win32" ? "xsys.exe" : "xsys";
|
|
33
|
+
// 1. Try discovery relative to this script (supports npm install & local dev)
|
|
34
|
+
try {
|
|
35
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
36
|
+
const __dirname = path.dirname(__filename);
|
|
37
|
+
const locations = [
|
|
38
|
+
path.resolve(__dirname, "..", "..", "..", "..", "bin", binName), // dist/esm/src/sys/ -> bin/
|
|
39
|
+
path.resolve(__dirname, "..", "..", "bin", binName), // src/sys/ -> bin/
|
|
40
|
+
path.resolve(__dirname, "..", "..", "..", "bin", binName), // dist/cjs/src/sys -> bin/
|
|
41
|
+
];
|
|
42
|
+
for (const loc of locations) {
|
|
43
|
+
if (fs.existsSync(loc))
|
|
44
|
+
return loc;
|
|
32
45
|
}
|
|
33
46
|
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
// Silently fail and fallback
|
|
49
|
+
}
|
|
50
|
+
// 2. Try project root bin (Legacy/Overlay)
|
|
51
|
+
const projectBin = path.resolve(process.cwd(), "bin", binName);
|
|
52
|
+
if (fs.existsSync(projectBin))
|
|
53
|
+
return projectBin;
|
|
54
|
+
// 3. Try development target
|
|
55
|
+
const devPath = path.resolve(process.cwd(), "tools", "xypriss-sys", "target", "release", binName);
|
|
56
|
+
if (fs.existsSync(devPath))
|
|
57
|
+
return devPath;
|
|
58
|
+
// 4. Global fallback
|
|
59
|
+
return binName;
|
|
34
60
|
}
|
|
35
61
|
/**
|
|
36
62
|
* Executes a command synchronously and returns the parsed JSON result.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XyPrissRunner.js","sources":["../../../../src/sys/XyPrissRunner.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"XyPrissRunner.js","sources":["../../../../src/sys/XyPrissRunner.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAMA;;AAEG;AACG,MAAO,YAAa,SAAQ,KAAK,CAAA;AACnC,IAAA,WAAA,CACW,MAAc,EACd,MAAc,EACd,OAAe,EACf,GAAS,EAAA;QAEhB,KAAK,CAAC,mBAAmB,MAAM,CAAA,CAAA,EAAI,MAAM,CAAY,SAAA,EAAA,OAAO,CAAE,CAAA,CAAC,CAAC;QALzD,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;QACd,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;QACd,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;QACf,IAAG,CAAA,GAAA,GAAH,GAAG,CAAM;AAGhB,QAAA,IAAI,CAA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,IAAI,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;SAC/D;KACJ;AACJ;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3748,6 +3748,10 @@ declare class XyPrissRunner {
|
|
|
3748
3748
|
private root;
|
|
3749
3749
|
private binaryPath;
|
|
3750
3750
|
constructor(root: string);
|
|
3751
|
+
/**
|
|
3752
|
+
* Strategic discovery of the xsys binary across different environments.
|
|
3753
|
+
*/
|
|
3754
|
+
private discoverBinary;
|
|
3751
3755
|
/**
|
|
3752
3756
|
* Executes a command synchronously and returns the parsed JSON result.
|
|
3753
3757
|
* Standardizes all responses into a Promise-like data structure.
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xypriss",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.2",
|
|
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": "
|
|
11
|
-
"xypriss-sys": "
|
|
10
|
+
"xsys": "scripts/xys.run.js",
|
|
11
|
+
"xypriss-sys": "scripts/xys.run.js"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"dist/cjs/**/*",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"dist/index.d.ts",
|
|
17
17
|
"README.md",
|
|
18
18
|
"LICENSE",
|
|
19
|
+
"bin/**/*",
|
|
19
20
|
"scripts/**/*",
|
|
20
21
|
"scripts/postinstall.js"
|
|
21
22
|
],
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { execSync } from "child_process";
|
|
2
2
|
import { existsSync, mkdirSync, createWriteStream } from "fs";
|
|
3
|
-
import { join } from "path";
|
|
3
|
+
import { join, dirname } from "path";
|
|
4
4
|
import { platform, arch } from "os";
|
|
5
5
|
import https from "https";
|
|
6
6
|
|
|
7
|
+
import { fileURLToPath } from "url";
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = dirname(__filename);
|
|
11
|
+
|
|
7
12
|
const REPO = "Nehonix-Team/XyPriss";
|
|
8
13
|
const BIN_NAME = "xsys";
|
|
9
14
|
|
|
10
15
|
async function install() {
|
|
11
|
-
const targetDir = join(
|
|
16
|
+
const targetDir = join(__dirname, "..", "bin");
|
|
12
17
|
if (!existsSync(targetDir)) {
|
|
13
18
|
mkdirSync(targetDir, { recursive: true });
|
|
14
19
|
}
|
|
@@ -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
|
+
|