xypriss 1.3.0 → 1.3.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.
@@ -1,6 +1,7 @@
1
1
  import { EventEmitter } from 'events';
2
2
  import * as fs from 'fs';
3
3
  import * as path from 'path';
4
+ import { CrossPlatformMemory } from '../cluster/modules/CrossPlatformMemory.js';
4
5
 
5
6
  /**
6
7
  * Server Maintenance Plugin
@@ -23,6 +24,7 @@ class ServerMaintenancePlugin extends EventEmitter {
23
24
  this.errorCount = 0;
24
25
  this.requestCount = 0;
25
26
  this.responseTimes = [];
27
+ this.activeConnections = 0;
26
28
  this.config = {
27
29
  enabled: true,
28
30
  checkInterval: 30000, // 30 seconds
@@ -37,6 +39,8 @@ class ServerMaintenancePlugin extends EventEmitter {
37
39
  onMaintenanceComplete: () => { },
38
40
  ...config,
39
41
  };
42
+ // Initialize cross-platform memory detection
43
+ this.crossPlatformMemory = new CrossPlatformMemory(true);
40
44
  }
41
45
  /**
42
46
  * Initialize the plugin
@@ -48,6 +52,8 @@ class ServerMaintenancePlugin extends EventEmitter {
48
52
  this.logger = logger;
49
53
  // Install monitoring middleware
50
54
  this.installMonitoringMiddleware();
55
+ // Setup connection tracking
56
+ this.setupConnectionTracking();
51
57
  // Start background maintenance
52
58
  this.startBackgroundMaintenance();
53
59
  // Setup error handlers
@@ -78,6 +84,46 @@ class ServerMaintenancePlugin extends EventEmitter {
78
84
  next();
79
85
  });
80
86
  }
87
+ /**
88
+ * Setup connection tracking
89
+ */
90
+ setupConnectionTracking() {
91
+ // Try to get server reference from app
92
+ if (this.app && this.app.server) {
93
+ this.server = this.app.server;
94
+ }
95
+ else if (this.app && this.app.listen) {
96
+ // Hook into the listen method to capture server
97
+ const originalListen = this.app.listen.bind(this.app);
98
+ this.app.listen = (...args) => {
99
+ const server = originalListen(...args);
100
+ this.server = server;
101
+ this.setupServerConnectionTracking(server);
102
+ return server;
103
+ };
104
+ }
105
+ // If we already have a server, set up tracking
106
+ if (this.server) {
107
+ this.setupServerConnectionTracking(this.server);
108
+ }
109
+ }
110
+ /**
111
+ * Setup server connection event tracking
112
+ */
113
+ setupServerConnectionTracking(server) {
114
+ if (!server || !server.on)
115
+ return;
116
+ server.on("connection", () => {
117
+ this.activeConnections++;
118
+ });
119
+ server.on("close", () => {
120
+ this.activeConnections = Math.max(0, this.activeConnections - 1);
121
+ });
122
+ // For HTTP/HTTPS servers, also track when connections end
123
+ server.on("clientError", () => {
124
+ this.activeConnections = Math.max(0, this.activeConnections - 1);
125
+ });
126
+ }
81
127
  /**
82
128
  * Setup error handlers
83
129
  */
@@ -111,15 +157,20 @@ class ServerMaintenancePlugin extends EventEmitter {
111
157
  * Start background maintenance checks
112
158
  */
113
159
  startBackgroundMaintenance() {
114
- this.maintenanceTimer = setInterval(() => {
115
- this.performMaintenanceCheck();
160
+ this.maintenanceTimer = setInterval(async () => {
161
+ try {
162
+ await this.performMaintenanceCheck();
163
+ }
164
+ catch (error) {
165
+ this.logger.error("plugins", "Maintenance check failed:", error);
166
+ }
116
167
  }, this.config.checkInterval);
117
168
  }
118
169
  /**
119
170
  * Perform comprehensive maintenance check
120
171
  */
121
- performMaintenanceCheck() {
122
- const metrics = this.collectHealthMetrics();
172
+ async performMaintenanceCheck() {
173
+ const metrics = await this.collectHealthMetrics();
123
174
  this.healthHistory.push(metrics);
124
175
  // Keep only last 100 health records
125
176
  if (this.healthHistory.length > 100) {
@@ -137,12 +188,26 @@ class ServerMaintenancePlugin extends EventEmitter {
137
188
  this.emit("health_check", metrics);
138
189
  }
139
190
  /**
140
- * Collect current health metrics
191
+ * Collect current health metrics using CrossPlatformMemory CLI
141
192
  */
142
- collectHealthMetrics() {
143
- const memUsage = process.memoryUsage();
144
- const totalMemory = memUsage.heapTotal + memUsage.external;
145
- const usedMemory = memUsage.heapUsed;
193
+ async collectHealthMetrics() {
194
+ // Get system memory info using CrossPlatformMemory CLI
195
+ let memoryInfo;
196
+ try {
197
+ memoryInfo = await this.crossPlatformMemory.getMemoryInfo();
198
+ }
199
+ catch (error) {
200
+ // Fallback to process memory if CLI fails
201
+ const memUsage = process.memoryUsage();
202
+ memoryInfo = {
203
+ totalMemory: memUsage.heapTotal + memUsage.external,
204
+ usedMemory: memUsage.heapUsed,
205
+ availableMemory: memUsage.heapTotal - memUsage.heapUsed,
206
+ usagePercentage: (memUsage.heapUsed /
207
+ (memUsage.heapTotal + memUsage.external)) *
208
+ 100,
209
+ };
210
+ }
146
211
  const avgResponseTime = this.responseTimes.length > 0
147
212
  ? this.responseTimes.reduce((a, b) => a + b, 0) /
148
213
  this.responseTimes.length
@@ -155,9 +220,9 @@ class ServerMaintenancePlugin extends EventEmitter {
155
220
  : 0;
156
221
  return {
157
222
  memoryUsage: {
158
- used: usedMemory,
159
- total: totalMemory,
160
- percentage: (usedMemory / totalMemory) * 100,
223
+ used: memoryInfo.usedMemory,
224
+ total: memoryInfo.totalMemory,
225
+ percentage: memoryInfo.usagePercentage,
161
226
  trend: this.calculateMemoryTrend(),
162
227
  },
163
228
  cpuUsage: process.cpuUsage().user / 1000000, // Convert to seconds
@@ -167,7 +232,7 @@ class ServerMaintenancePlugin extends EventEmitter {
167
232
  p95: p95ResponseTime,
168
233
  trend: this.calculateResponseTimeTrend(),
169
234
  },
170
- activeConnections: 0, // Would need server reference to get actual count
235
+ activeConnections: this.activeConnections, // Real active connections count
171
236
  uptime: Date.now() - this.startTime,
172
237
  };
173
238
  }
@@ -1 +1 @@
1
- {"version":3,"file":"server-maintenance-plugin.js","sources":["../../../../src/plugins/server-maintenance-plugin.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;AAWG;AAWG,MAAO,uBAAwB,SAAQ,YAAY,CAAA;AAYrD,IAAA,WAAA,CAAY,SAA4B,EAAE,EAAA;AACtC,QAAA,KAAK,EAAE,CAAC;QAXJ,IAAM,CAAA,MAAA,GAAuB,EAAE,CAAC;QAChC,IAAa,CAAA,aAAA,GAAoB,EAAE,CA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C,MAAM,CAAC,UAAU,CAAC,EAAE;YACzB,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC;AACxC,YAAA,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;SACxD;KACJ;AAED;;AAEG;IACI,qBAAqB,GAAA;QACxB,IAAI,CAAC,uBAAuB,EAAE,CAAC;KAClC;AAED;;AAEG;IACI,OAAO,GAAA;AACV,QAAA,IAAI,IAAI,CAAC,gBAAgB,EAAE;AACvB,YAAA,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;SACxC;AACD,QAAA,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;AACjB,QAAA,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAC7B;AACJ;;;;"}
1
+ {"version":3,"file":"server-maintenance-plugin.js","sources":["../../../../src/plugins/server-maintenance-plugin.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;AAWG;AAYG,MAAO,uBAAwB,SAAQ,YAAY,CAAA;AAerD,IAAA,WAAA,CAAY,SAA4B,EAAE,EAAA;AACtC,QAAA,KAAK,EAAE,CAAC;QAdJ,IAAM,CAAA,MAAA,GAAuB,EAAE,CAAC;QAChC,IAAa,CAAA,aAAA,GAAoB,EAAE,CAAC;AAIpC,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,IAAU,CAAA,UAAA,GAAG,CAAC,CAAC;QACf,IAAY,CAAA,YAAA,GAAG,CAAC,CAAC;QACjB,IAAa,CAAA,aAAA,GAAa,EAAE,CAAC;QAE7B,IAAiB,CAAA,iBAAA,GAAG,CAAC,CAAC;QAM1B,IAAI,CAAC,MAAM,GAAG;AACV,YAAA,OAAO,EAAE,IAAI;YACb,aAAa,EAAE,KAAK;YACpB,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_LEVELS: readonly ["silent", "error", "warn", "info", "debug", "verbose"];
1194
1194
  type LogLevel = (typeof LOG_LEVELS)[number];
1195
- declare const LOG_COMPONENTS: readonly ["middleware", "server", "cache", "cluster", "performance", "fileWatcher", "plugins", "security", "monitoring", "routes", "userApp", "typescript", "console", "other", "router", "acpes", "ipc"];
1195
+ declare const LOG_COMPONENTS: readonly ["middleware", "server", "cache", "cluster", "performance", "fileWatcher", "plugins", "security", "monitoring", "routes", "userApp", "typescript", "console", "other", "router", "acpes", "ipc", "memory"];
1196
1196
  type LogComponent = (typeof LOG_COMPONENTS)[number];
1197
1197
  declare const LOG_TYPES: readonly ["startup", "warnings", "errors", "performance", "debug", "hotReload", "portSwitching"];
1198
1198
  type LogType = (typeof LOG_TYPES)[number];
@@ -5744,6 +5744,9 @@ declare class ServerMaintenancePlugin extends EventEmitter {
5744
5744
  private errorCount;
5745
5745
  private requestCount;
5746
5746
  private responseTimes;
5747
+ private crossPlatformMemory;
5748
+ private activeConnections;
5749
+ private server;
5747
5750
  constructor(config?: MaintenanceConfig);
5748
5751
  /**
5749
5752
  * Initialize the plugin
@@ -5753,6 +5756,14 @@ declare class ServerMaintenancePlugin extends EventEmitter {
5753
5756
  * Install middleware to monitor requests
5754
5757
  */
5755
5758
  private installMonitoringMiddleware;
5759
+ /**
5760
+ * Setup connection tracking
5761
+ */
5762
+ private setupConnectionTracking;
5763
+ /**
5764
+ * Setup server connection event tracking
5765
+ */
5766
+ private setupServerConnectionTracking;
5756
5767
  /**
5757
5768
  * Setup error handlers
5758
5769
  */
@@ -5766,7 +5777,7 @@ declare class ServerMaintenancePlugin extends EventEmitter {
5766
5777
  */
5767
5778
  private performMaintenanceCheck;
5768
5779
  /**
5769
- * Collect current health metrics
5780
+ * Collect current health metrics using CrossPlatformMemory CLI
5770
5781
  */
5771
5782
  private collectHealthMetrics;
5772
5783
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xypriss",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "XyPriss is a Node.js framework that extends Express.js with additional performance, security, and scalability features. Built with TypeScript, it maintains full Express.js compatibility while adding enterprise-level capabilities for production applications.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -12,9 +12,13 @@
12
12
  "dist/esm/**/*",
13
13
  "dist/index.d.ts",
14
14
  "README.md",
15
- "LICENSE"
15
+ "LICENSE",
16
+ "scripts/**/*",
17
+ "scripts/postinstall.js"
16
18
  ],
17
19
  "scripts": {
20
+ "postinstall": "node scripts/postinstall.js",
21
+ "install-memory-cli": "node scripts/install-memory-cli.js",
18
22
  "build": "NODE_OPTIONS='--max-old-space-size=4096' npx rollup -c rollup.config.js",
19
23
  "build:memory": "NODE_OPTIONS='--max-old-space-size=6144' npx rollup -c rollup.config.js",
20
24
  "test": "jest",
@@ -254,3 +258,4 @@
254
258
  "xypriss-security": "^1.0.9"
255
259
  }
256
260
  }
261
+
@@ -0,0 +1,282 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * XyPriss Memory CLI Installer
5
+ * Downloads platform-specific memory CLI binary during npm install
6
+ */
7
+
8
+ const https = require("https");
9
+ const fs = require("fs");
10
+ const path = require("path");
11
+ const { execSync } = require("child_process");
12
+
13
+ const CDN_BASE_URL = "https://sdk.nehonix.space/dl/mds/xypriss/bin";
14
+ const BIN_DIR = path.join(__dirname, "..", "bin");
15
+ const TIMEOUT = 30000; // 30 seconds
16
+
17
+ /**
18
+ * Get platform-specific binary information
19
+ */
20
+ function getPlatformBinary() {
21
+ const platform = process.platform;
22
+ const arch = process.arch;
23
+
24
+ let binaryName;
25
+ let downloadName;
26
+
27
+ if (platform === "win32") {
28
+ binaryName =
29
+ arch === "arm64"
30
+ ? "memory-cli-windows-arm64.exe"
31
+ : "memory-cli-windows-x64.exe";
32
+ downloadName = binaryName;
33
+ } else if (platform === "darwin") {
34
+ binaryName =
35
+ arch === "arm64"
36
+ ? "memory-cli-darwin-arm64"
37
+ : "memory-cli-darwin-x64";
38
+ downloadName = binaryName;
39
+ } else if (platform === "linux") {
40
+ binaryName = "memory-cli-linux-x64";
41
+ downloadName = binaryName;
42
+ } else {
43
+ console.warn(
44
+ `⚠️ Unsupported platform: ${platform}-${arch}. Memory CLI will use fallback mode.`
45
+ );
46
+ return null;
47
+ }
48
+
49
+ return {
50
+ binaryName,
51
+ downloadName,
52
+ url: `${CDN_BASE_URL}/${downloadName}`,
53
+ localPath: path.join(BIN_DIR, binaryName),
54
+ genericPath: path.join(
55
+ BIN_DIR,
56
+ "memory-cli" + (platform === "win32" ? ".exe" : "")
57
+ ),
58
+ };
59
+ }
60
+
61
+ /**
62
+ * Download file from URL
63
+ */
64
+ function downloadFile(url, destination) {
65
+ return new Promise((resolve, reject) => {
66
+ console.log(`📥 Downloading ${url}...`);
67
+
68
+ const file = fs.createWriteStream(destination);
69
+ const request = https.get(url, { timeout: TIMEOUT }, (response) => {
70
+ if (response.statusCode === 200) {
71
+ response.pipe(file);
72
+
73
+ file.on("finish", () => {
74
+ file.close();
75
+ console.log(`✅ Downloaded to ${destination}`);
76
+ resolve();
77
+ });
78
+ } else if (
79
+ response.statusCode === 302 ||
80
+ response.statusCode === 301
81
+ ) {
82
+ // Handle redirects
83
+ file.close();
84
+ fs.unlinkSync(destination);
85
+ downloadFile(response.headers.location, destination)
86
+ .then(resolve)
87
+ .catch(reject);
88
+ } else {
89
+ file.close();
90
+ fs.unlinkSync(destination);
91
+ reject(
92
+ new Error(
93
+ `HTTP ${response.statusCode}: ${response.statusMessage}`
94
+ )
95
+ );
96
+ }
97
+ });
98
+
99
+ request.on("error", (error) => {
100
+ file.close();
101
+ if (fs.existsSync(destination)) {
102
+ fs.unlinkSync(destination);
103
+ }
104
+ reject(error);
105
+ });
106
+
107
+ request.on("timeout", () => {
108
+ request.destroy();
109
+ file.close();
110
+ if (fs.existsSync(destination)) {
111
+ fs.unlinkSync(destination);
112
+ }
113
+ reject(new Error("Download timeout"));
114
+ });
115
+ });
116
+ }
117
+
118
+ /**
119
+ * Make file executable (Unix-like systems)
120
+ */
121
+ function makeExecutable(filePath) {
122
+ if (process.platform !== "win32") {
123
+ try {
124
+ execSync(`chmod +x "${filePath}"`);
125
+ console.log(`🔧 Made ${filePath} executable`);
126
+ } catch (error) {
127
+ console.warn(
128
+ `⚠️ Failed to make ${filePath} executable:`,
129
+ error.message
130
+ );
131
+ }
132
+ }
133
+ }
134
+
135
+ /**
136
+ * Verify downloaded binary works
137
+ */
138
+ function verifyBinary(filePath) {
139
+ return new Promise((resolve) => {
140
+ try {
141
+ const { spawn } = require("child_process");
142
+ const child = spawn(filePath, ["--help"], {
143
+ stdio: "pipe",
144
+ timeout: 5000,
145
+ });
146
+
147
+ let output = "";
148
+ child.stdout.on("data", (data) => {
149
+ output += data.toString();
150
+ });
151
+
152
+ child.on("close", (code) => {
153
+ if (code === 0 && output.includes("XyPriss Memory Info CLI")) {
154
+ console.log(`✅ Binary verification successful`);
155
+ resolve(true);
156
+ } else {
157
+ console.warn(
158
+ `⚠️ Binary verification failed (exit code: ${code})`
159
+ );
160
+ resolve(false);
161
+ }
162
+ });
163
+
164
+ child.on("error", () => {
165
+ resolve(false);
166
+ });
167
+ } catch (error) {
168
+ resolve(false);
169
+ }
170
+ });
171
+ }
172
+
173
+ /**
174
+ * Main installation function
175
+ */
176
+ async function installMemoryCLI() {
177
+ console.log("🚀 Installing XyPriss Memory CLI...");
178
+
179
+ // Create bin directory if it doesn't exist
180
+ if (!fs.existsSync(BIN_DIR)) {
181
+ fs.mkdirSync(BIN_DIR, { recursive: true });
182
+ console.log(`📁 Created bin directory: ${BIN_DIR}`);
183
+ }
184
+
185
+ const binaryInfo = getPlatformBinary();
186
+ if (!binaryInfo) {
187
+ console.log(
188
+ "⚠️ No binary available for this platform. Using fallback mode."
189
+ );
190
+ return;
191
+ }
192
+
193
+ try {
194
+ // Download the binary
195
+ await downloadFile(binaryInfo.url, binaryInfo.localPath);
196
+
197
+ // Make it executable
198
+ makeExecutable(binaryInfo.localPath);
199
+
200
+ // Create a generic symlink/copy for easier access
201
+ if (!fs.existsSync(binaryInfo.genericPath)) {
202
+ if (process.platform === "win32") {
203
+ // On Windows, copy the file
204
+ fs.copyFileSync(binaryInfo.localPath, binaryInfo.genericPath);
205
+ } else {
206
+ // On Unix-like systems, create a symlink
207
+ fs.symlinkSync(
208
+ path.basename(binaryInfo.localPath),
209
+ binaryInfo.genericPath
210
+ );
211
+ }
212
+ console.log(
213
+ `🔗 Created generic binary link: ${binaryInfo.genericPath}`
214
+ );
215
+ }
216
+
217
+ // Verify the binary works
218
+ const isValid = await verifyBinary(binaryInfo.localPath);
219
+ if (!isValid) {
220
+ console.warn(
221
+ "⚠️ Binary verification failed. Memory CLI will use fallback mode."
222
+ );
223
+ return;
224
+ }
225
+
226
+ console.log("🎉 XyPriss Memory CLI installed successfully!");
227
+ console.log(`📍 Binary location: ${binaryInfo.localPath}`);
228
+ } catch (error) {
229
+ console.error("❌ Failed to install Memory CLI:", error.message);
230
+ console.log("📝 Memory CLI will use fallback mode (Node.js os module)");
231
+
232
+ // Clean up partial downloads
233
+ if (fs.existsSync(binaryInfo.localPath)) {
234
+ try {
235
+ fs.unlinkSync(binaryInfo.localPath);
236
+ } catch (cleanupError) {
237
+ // Ignore cleanup errors
238
+ }
239
+ }
240
+ }
241
+ }
242
+
243
+ /**
244
+ * Check if we should skip installation
245
+ */
246
+ function shouldSkipInstall() {
247
+ // Skip if CI environment variable is set to avoid network calls in CI
248
+ if (
249
+ process.env.CI === "true" ||
250
+ process.env.SKIP_BINARY_DOWNLOAD === "true"
251
+ ) {
252
+ console.log("⏭️ Skipping binary download (CI environment detected)");
253
+ return true;
254
+ }
255
+
256
+ // Skip if binary already exists and is valid
257
+ const binaryInfo = getPlatformBinary();
258
+ if (binaryInfo && fs.existsSync(binaryInfo.localPath)) {
259
+ console.log("✅ Memory CLI binary already exists");
260
+ return true;
261
+ }
262
+
263
+ return false;
264
+ }
265
+
266
+ // Run installation if this script is executed directly
267
+ if (require.main === module) {
268
+ if (!shouldSkipInstall()) {
269
+ installMemoryCLI().catch((error) => {
270
+ console.error("💥 Installation failed:", error);
271
+ process.exit(0); // Don't fail npm install if binary download fails
272
+ });
273
+ }
274
+ }
275
+
276
+ module.exports = {
277
+ installMemoryCLI,
278
+ getPlatformBinary,
279
+ downloadFile,
280
+ verifyBinary,
281
+ };
282
+
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * XyPriss Post-Install Script
5
+ * Runs after npm install to set up platform-specific binaries
6
+ */
7
+
8
+ const { installMemoryCLI } = require('./install-memory-cli');
9
+
10
+ async function postInstall() {
11
+ console.log('🔧 Running XyPriss post-install setup...');
12
+
13
+ try {
14
+ await installMemoryCLI();
15
+ console.log('✅ XyPriss setup complete!');
16
+ } catch (error) {
17
+ console.warn('⚠️ Post-install setup encountered issues:', error.message);
18
+ console.log('📝 XyPriss will continue to work with fallback mode.');
19
+ }
20
+ }
21
+
22
+ // Only run if this is the main module (not being required)
23
+ if (require.main === module) {
24
+ postInstall().catch((error) => {
25
+ console.error('💥 Post-install failed:', error);
26
+ // Don't exit with error code to avoid breaking npm install
27
+ process.exit(0);
28
+ });
29
+ }
30
+
31
+ module.exports = { postInstall };