xypriss 2.2.0 → 2.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.
Files changed (36) hide show
  1. package/dist/cjs/src/plugins/modules/network/builtin/CompressionPlugin.js +2 -110
  2. package/dist/cjs/src/plugins/modules/network/builtin/CompressionPlugin.js.map +1 -1
  3. package/dist/cjs/src/plugins/modules/network/builtin/ConnectionPlugin.js.map +1 -1
  4. package/dist/cjs/src/plugins/modules/network/core/NetworkPlugin.js.map +1 -1
  5. package/dist/cjs/src/plugins/modules/network/types/NetworkTypes.js.map +1 -1
  6. package/dist/cjs/src/server/FastServer.js +10 -10
  7. package/dist/cjs/src/server/FastServer.js.map +1 -1
  8. package/dist/cjs/src/server/components/fastapi/RouteManager.js.map +1 -1
  9. package/dist/cjs/src/server/components/fastapi/smart-routes.js.map +1 -1
  10. package/dist/cjs/src/server/core/HttpServer.js +13 -0
  11. package/dist/cjs/src/server/core/HttpServer.js.map +1 -1
  12. package/dist/cjs/src/server/core/XyprissApp.js.map +1 -1
  13. package/dist/cjs/src/server/handlers/NotFoundHandler.js.map +1 -1
  14. package/dist/cjs/src/server/optimization/RequestPreCompiler.js +1 -0
  15. package/dist/cjs/src/server/optimization/RequestPreCompiler.js.map +1 -1
  16. package/dist/cjs/src/server/utils/ConfigLoader.js +245 -148
  17. package/dist/cjs/src/server/utils/ConfigLoader.js.map +1 -1
  18. package/dist/esm/src/plugins/modules/network/builtin/CompressionPlugin.js +2 -110
  19. package/dist/esm/src/plugins/modules/network/builtin/CompressionPlugin.js.map +1 -1
  20. package/dist/esm/src/plugins/modules/network/builtin/ConnectionPlugin.js.map +1 -1
  21. package/dist/esm/src/plugins/modules/network/core/NetworkPlugin.js.map +1 -1
  22. package/dist/esm/src/plugins/modules/network/types/NetworkTypes.js.map +1 -1
  23. package/dist/esm/src/server/FastServer.js +10 -10
  24. package/dist/esm/src/server/FastServer.js.map +1 -1
  25. package/dist/esm/src/server/components/fastapi/RouteManager.js.map +1 -1
  26. package/dist/esm/src/server/components/fastapi/smart-routes.js.map +1 -1
  27. package/dist/esm/src/server/core/HttpServer.js +13 -0
  28. package/dist/esm/src/server/core/HttpServer.js.map +1 -1
  29. package/dist/esm/src/server/core/XyprissApp.js.map +1 -1
  30. package/dist/esm/src/server/handlers/NotFoundHandler.js.map +1 -1
  31. package/dist/esm/src/server/optimization/RequestPreCompiler.js +1 -0
  32. package/dist/esm/src/server/optimization/RequestPreCompiler.js.map +1 -1
  33. package/dist/esm/src/server/utils/ConfigLoader.js +227 -151
  34. package/dist/esm/src/server/utils/ConfigLoader.js.map +1 -1
  35. package/dist/index.d.ts +68 -44
  36. package/package.json +1 -2
@@ -1,207 +1,283 @@
1
- import { existsSync, readFileSync } from 'fs';
2
- import { join } from 'path';
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
3
 
4
4
  /**
5
- * Configuration Loader for XyPrissJS
6
- * Loads configuration from various sources with priority order
5
+ * XyPriss Configuration Loader
6
+ *
7
+ * Automatically loads configuration from external files (TypeScript or JSON)
8
+ * Supports xypriss.config.ts, xypriss.config.js, and xypriss.config.json files
9
+ *
10
+ * @fileoverview Configuration loader for external config files
11
+ * @version 1.0.0
12
+ * @author XyPriss Team
13
+ * @since 2025-01-01
14
+ */
15
+ /**
16
+ * Configuration file names to search for (in order of preference)
17
+ */
18
+ const CONFIG_FILES = [
19
+ "xypriss.config.ts",
20
+ "xypriss.config.js",
21
+ "xypriss.config.json",
22
+ "xypriss.config.cjs",
23
+ "xypriss.config.mjs",
24
+ ];
25
+ /**
26
+ * Configuration loader class
27
+ * Handles loading and validation of external configuration files
7
28
  */
8
29
  class ConfigLoader {
9
30
  /**
10
- * Load configuration from file system
31
+ * Load configuration from external files (synchronous - JSON only)
32
+ *
33
+ * Searches for JSON configuration files in the current working directory
34
+ * and loads the first one found. This is a synchronous version for use in constructors.
35
+ *
36
+ * @param cwd - Current working directory (defaults to process.cwd())
37
+ * @returns Loaded configuration or null if no config found
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * const configLoader = new ConfigLoader();
42
+ * const config = configLoader.loadConfigSync();
43
+ * if (config) {
44
+ * console.log("Loaded config from:", config._source);
45
+ * }
46
+ * ```
11
47
  */
12
- static loadConfig(options = {}) {
13
- const { configFile, searchPaths = ConfigLoader.DEFAULT_SEARCH_PATHS, allowedExtensions = [".js", ".ts", ".json", ".mjs"], } = options;
14
- if (configFile &&
15
- !allowedExtensions.some((ext) => configFile.endsWith(ext))) {
16
- console.warn(`Config file ${configFile} has unsupported extension. Allowed extensions: ${allowedExtensions.join(", ")}`);
17
- return null;
18
- }
19
- // If specific config file is provided, try to load it
20
- if (configFile) {
21
- const config = ConfigLoader.loadConfigFile(configFile);
22
- if (config) {
23
- console.log(`✔Loaded configuration from: ${configFile}`);
24
- return config;
48
+ loadConfigSync(cwd = process.cwd()) {
49
+ // Only load JSON files synchronously for constructor use
50
+ const jsonConfigPath = path.resolve(cwd, "xypriss.config.json");
51
+ if (fs.existsSync(jsonConfigPath)) {
52
+ try {
53
+ const config = this.loadJsonConfig(jsonConfigPath);
54
+ if (config && typeof config === "object") {
55
+ // Add source information for debugging
56
+ config._source = jsonConfigPath;
57
+ return config;
58
+ }
59
+ }
60
+ catch (error) {
61
+ // Silently fail in constructor - config loading errors should not break initialization
62
+ console.warn(`Warning: Failed to load JSON config from ${jsonConfigPath}:`, error);
25
63
  }
26
64
  }
27
- // Search for config files in search paths
28
- for (const searchPath of searchPaths) {
29
- for (const configFileName of ConfigLoader.DEFAULT_CONFIG_FILES) {
30
- const configPath = join(searchPath, configFileName);
31
- if (existsSync(configPath)) {
32
- const config = ConfigLoader.loadConfigFile(configPath);
33
- if (config) {
34
- console.log(`✔Loaded configuration from: ${configPath}`);
65
+ return null;
66
+ }
67
+ /**
68
+ * Load configuration from external files (asynchronous)
69
+ *
70
+ * Searches for configuration files in the current working directory
71
+ * and loads the first one found. Supports TypeScript, JavaScript, and JSON files.
72
+ *
73
+ * @param cwd - Current working directory (defaults to process.cwd())
74
+ * @returns Promise resolving to loaded configuration or null if no config found
75
+ *
76
+ * @example
77
+ * ```typescript
78
+ * const configLoader = new ConfigLoader();
79
+ * const config = await configLoader.loadConfig();
80
+ * if (config) {
81
+ * console.log("Loaded config from:", config._source);
82
+ * }
83
+ * ```
84
+ */
85
+ async loadConfig(cwd = process.cwd()) {
86
+ for (const configFile of CONFIG_FILES) {
87
+ const configPath = path.resolve(cwd, configFile);
88
+ if (fs.existsSync(configPath)) {
89
+ try {
90
+ const config = await this.loadConfigFile(configPath);
91
+ if (config && typeof config === "object") {
92
+ // Add source information for debugging
93
+ config._source = configPath;
35
94
  return config;
36
95
  }
37
96
  }
97
+ catch (error) {
98
+ console.warn(`Warning: Failed to load config from ${configPath}:`, error);
99
+ // Continue to next file instead of failing
100
+ }
38
101
  }
39
102
  }
40
- return null;
103
+ return null; // No configuration file found
41
104
  }
42
105
  /**
43
106
  * Load configuration from a specific file
107
+ *
108
+ * @param configPath - Absolute path to the configuration file
109
+ * @returns Promise resolving to the loaded configuration
110
+ * @private
44
111
  */
45
- static loadConfigFile(filePath) {
46
- try {
47
- if (!existsSync(filePath)) {
48
- return null;
49
- }
50
- const ext = filePath.split(".").pop()?.toLowerCase();
51
- switch (ext) {
52
- case "json":
53
- return ConfigLoader.loadJsonConfig(filePath);
54
- case "js":
55
- case "mjs":
56
- return ConfigLoader.loadJsConfig(filePath);
57
- case "ts":
58
- return ConfigLoader.loadTsConfig(filePath);
59
- default:
60
- // Try to parse as JSON for .XyPrissrc files
61
- return ConfigLoader.loadJsonConfig(filePath);
62
- }
63
- }
64
- catch (error) {
65
- console.warn(` Failed to load config from ${filePath}: ${error.message}`);
66
- return null;
112
+ async loadConfigFile(configPath) {
113
+ const ext = path.extname(configPath).toLowerCase();
114
+ switch (ext) {
115
+ case ".json":
116
+ return this.loadJsonConfig(configPath);
117
+ case ".js":
118
+ case ".cjs":
119
+ return this.loadJsConfig(configPath);
120
+ case ".mjs":
121
+ return this.loadMjsConfig(configPath);
122
+ case ".ts":
123
+ return this.loadTsConfig(configPath);
124
+ default:
125
+ throw new Error(`Unsupported config file extension: ${ext}`);
67
126
  }
68
127
  }
69
128
  /**
70
- * Load JSON configuration
129
+ * Load JSON configuration file
130
+ *
131
+ * @param configPath - Path to JSON config file
132
+ * @returns Parsed JSON configuration
133
+ * @private
134
+ */
135
+ loadJsonConfig(configPath) {
136
+ const content = fs.readFileSync(configPath, "utf-8");
137
+ return JSON.parse(content);
138
+ }
139
+ /**
140
+ * Load JavaScript configuration file
141
+ *
142
+ * @param configPath - Path to JS config file
143
+ * @returns Configuration object exported by the JS file
144
+ * @private
71
145
  */
72
- static loadJsonConfig(filePath) {
146
+ async loadJsConfig(configPath) {
147
+ // For CommonJS and ESM files, we need dynamic import which works for both
73
148
  try {
74
- const content = readFileSync(filePath, "utf8");
75
- return JSON.parse(content);
149
+ // Use dynamic import which works for both CommonJS and ESM
150
+ const config = await import(configPath);
151
+ // Handle both default export and named exports
152
+ return config.default || config;
76
153
  }
77
154
  catch (error) {
78
- console.warn(` Failed to parse JSON config ${filePath}: ${error.message}`);
79
- return null;
155
+ // Fallback to require for CommonJS in environments where dynamic import fails
156
+ try {
157
+ // Clear require cache to allow reloading
158
+ delete require.cache[require.resolve(configPath)];
159
+ const config = require(configPath);
160
+ // Handle both default export and module.exports
161
+ return config.default || config;
162
+ }
163
+ catch (fallbackError) {
164
+ throw new Error(`Failed to load JS config: ${error}. Fallback also failed: ${fallbackError}`);
165
+ }
80
166
  }
81
167
  }
82
168
  /**
83
- * Load JavaScript configuration
169
+ * Load ES Module configuration file
170
+ *
171
+ * @param configPath - Path to MJS config file
172
+ * @returns Configuration object exported by the MJS file
173
+ * @private
84
174
  */
85
- static loadJsConfig(filePath) {
175
+ async loadMjsConfig(configPath) {
176
+ // For ES modules, we need dynamic import
86
177
  try {
87
- // Clear require cache to allow hot reloading
88
- delete require.cache[require.resolve(filePath)];
89
- const config = require(filePath);
90
- // Handle both default export and named export
178
+ const config = await import(configPath);
91
179
  return config.default || config;
92
180
  }
93
181
  catch (error) {
94
- console.warn(` Failed to load JS config ${filePath}: ${error.message}`);
95
- return null;
182
+ throw new Error(`Failed to load MJS config: ${error}`);
96
183
  }
97
184
  }
98
185
  /**
99
- * Load TypeScript configuration (requires ts-node or similar)
186
+ * Load TypeScript configuration file
187
+ *
188
+ * @param configPath - Path to TS config file
189
+ * @returns Configuration object exported by the TS file
190
+ * @private
100
191
  */
101
- static loadTsConfig(filePath) {
192
+ async loadTsConfig(configPath) {
102
193
  try {
103
- // Try to register TypeScript if not already registered
104
- try {
105
- require("ts-node/register");
194
+ // First, try to load as JavaScript (if user compiled it)
195
+ const jsPath = configPath.replace(/\.ts$/, ".js");
196
+ if (fs.existsSync(jsPath)) {
197
+ return this.loadJsConfig(jsPath);
106
198
  }
107
- catch {
108
- // ts-node not available, try tsx
109
- try {
110
- require("tsx/cjs");
111
- }
112
- catch {
113
- console.warn(` TypeScript config found but no TypeScript loader available. Install ts-node or tsx.`);
114
- return null;
115
- }
116
- }
117
- // Clear require cache
118
- delete require.cache[require.resolve(filePath)];
119
- const config = require(filePath);
120
- // Handle both default export and named export
199
+ // Try dynamic import directly (works if ts-node or similar is available)
200
+ const config = await import(configPath);
121
201
  return config.default || config;
122
202
  }
123
203
  catch (error) {
124
- console.warn(` Failed to load TS config ${filePath}: ${error.message}`);
125
- return null;
126
- }
127
- }
128
- /**
129
- * Merge configurations with priority order
130
- */
131
- static mergeConfigs(baseConfig, ...configs) {
132
- let merged = { ...baseConfig };
133
- for (const config of configs) {
134
- if (config) {
135
- merged = ConfigLoader.deepMerge(merged, config);
204
+ // If direct import fails, try to compile with ts-node if available
205
+ try {
206
+ // Check if ts-node is available
207
+ require.resolve("ts-node");
208
+ // Register ts-node for TypeScript compilation
209
+ require("ts-node/register");
210
+ // Clear require cache and load the TypeScript file
211
+ delete require.cache[require.resolve(configPath)];
212
+ const config = require(configPath);
213
+ return config.default || config;
214
+ }
215
+ catch (tsNodeError) {
216
+ // If ts-node is not available or fails, provide helpful error message
217
+ throw new Error(`Failed to load TS config from ${configPath}. ` +
218
+ `Please ensure ts-node is installed (npm install ts-node) or compile to JS first. ` +
219
+ `Original error: ${error.message}`);
136
220
  }
137
221
  }
138
- return merged;
139
222
  }
140
223
  /**
141
- * Deep merge two configuration objects
224
+ * Validate configuration object
225
+ *
226
+ * Performs basic validation on the loaded configuration
227
+ *
228
+ * @param config - Configuration object to validate
229
+ * @returns True if configuration is valid
230
+ *
231
+ * @example
232
+ * ```typescript
233
+ * const loader = new ConfigLoader();
234
+ * const config = await loader.loadConfig();
235
+ * if (config && loader.validateConfig(config)) {
236
+ * console.log("Config is valid");
237
+ * }
238
+ * ```
142
239
  */
143
- static deepMerge(target, source) {
144
- const result = { ...target };
145
- for (const key in source) {
146
- if (source.hasOwnProperty(key)) {
147
- if (typeof source[key] === "object" &&
148
- source[key] !== null &&
149
- !Array.isArray(source[key]) &&
150
- typeof target[key] === "object" &&
151
- target[key] !== null &&
152
- !Array.isArray(target[key])) {
153
- result[key] = ConfigLoader.deepMerge(target[key], source[key]);
154
- }
155
- else {
156
- result[key] = source[key];
157
- }
158
- }
240
+ validateConfig(config) {
241
+ // Basic validation - check if it's an object
242
+ if (!config || typeof config !== "object") {
243
+ return false;
159
244
  }
160
- return result;
245
+ // Check for required structure (at least one valid property)
246
+ const validKeys = [
247
+ "env", "server", "security", "performance", "monitoring",
248
+ "cache", "cluster", "plugins", "requestManagement", "fileUpload"
249
+ ];
250
+ return validKeys.some(key => key in config);
161
251
  }
162
252
  /**
163
- * Validate configuration
253
+ * Get list of available configuration files in a directory
254
+ *
255
+ * @param cwd - Directory to search (defaults to process.cwd())
256
+ * @returns Array of available configuration file names
257
+ *
258
+ * @example
259
+ * ```typescript
260
+ * const loader = new ConfigLoader();
261
+ * const files = loader.getAvailableConfigFiles();
262
+ * console.log("Available config files:", files);
263
+ * ```
164
264
  */
165
- static validateConfig(config) {
166
- const errors = [];
167
- // Validate file watcher configuration
168
- if (config.fileWatcher) {
169
- const fw = config.fileWatcher;
170
- if (fw.typescript?.runner &&
171
- typeof fw.typescript.runner !== "string") {
172
- errors.push("fileWatcher.typescript.runner must be a string");
173
- }
174
- if (fw.typescript?.runnerArgs &&
175
- !Array.isArray(fw.typescript.runnerArgs)) {
176
- errors.push("fileWatcher.typescript.runnerArgs must be an array");
177
- }
178
- if (fw.extensions && !Array.isArray(fw.extensions)) {
179
- errors.push("fileWatcher.extensions must be an array");
180
- }
181
- if (fw.watchPaths && !Array.isArray(fw.watchPaths)) {
182
- errors.push("fileWatcher.watchPaths must be an array");
265
+ getAvailableConfigFiles(cwd = process.cwd()) {
266
+ const available = [];
267
+ for (const configFile of CONFIG_FILES) {
268
+ const configPath = path.resolve(cwd, configFile);
269
+ if (fs.existsSync(configPath)) {
270
+ available.push(configFile);
183
271
  }
184
272
  }
185
- return {
186
- valid: errors.length === 0,
187
- errors,
188
- };
273
+ return available;
189
274
  }
190
275
  }
191
- ConfigLoader.DEFAULT_CONFIG_FILES = [
192
- "XyPriss.config.js",
193
- "XyPriss.config.ts",
194
- "XyPriss.config.json",
195
- "XyPriss.config.mjs",
196
- ".XyPrissrc",
197
- ".XyPrissrc.json",
198
- ".XyPrissrc.js",
199
- ];
200
- ConfigLoader.DEFAULT_SEARCH_PATHS = [
201
- process.cwd(),
202
- join(process.cwd(), "config"),
203
- join(process.cwd(), ".config"),
204
- ];
276
+ /**
277
+ * Default configuration loader instance
278
+ * Can be used directly without creating a new instance
279
+ */
280
+ const configLoader = new ConfigLoader();
205
281
 
206
- export { ConfigLoader };
282
+ export { ConfigLoader, configLoader };
207
283
  //# sourceMappingURL=ConfigLoader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigLoader.js","sources":["../../../../../src/server/utils/ConfigLoader.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAAA;;;AAGG;MAYU,YAAY,CAAA;AAiBrB;;AAEG;AACI,IAAA,OAAO,UAAU,CACpB,OAAA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