xypriss 5.5.0 → 5.6.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.
|
@@ -33,7 +33,8 @@ var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
|
|
|
33
33
|
*/
|
|
34
34
|
class ConfigLoader {
|
|
35
35
|
constructor() {
|
|
36
|
-
this.
|
|
36
|
+
this.isConfigApplied = false;
|
|
37
|
+
this.executedMetas = new Set();
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
39
40
|
* Find the project root by searching for package.json or node_modules
|
|
@@ -52,35 +53,67 @@ class ConfigLoader {
|
|
|
52
53
|
return startDir;
|
|
53
54
|
}
|
|
54
55
|
/**
|
|
55
|
-
* Load xypriss.config.json and apply
|
|
56
|
+
* Load all xypriss.config.json files found in the project and apply configurations
|
|
56
57
|
*/
|
|
57
58
|
loadAndApplySysConfig() {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
59
|
+
if (this.isConfigApplied)
|
|
60
|
+
return;
|
|
61
|
+
this.isConfigApplied = true;
|
|
62
|
+
let currentDir = process.cwd();
|
|
63
|
+
const filesystemRoot = path__namespace.parse(currentDir).root;
|
|
64
|
+
const configFiles = [];
|
|
65
|
+
let highestRoot = currentDir;
|
|
66
|
+
// 1. Search upwards to find ALL configs and the highest project root
|
|
67
|
+
while (currentDir !== filesystemRoot) {
|
|
68
|
+
const potentialConfig = path__namespace.join(currentDir, "xypriss.config.json");
|
|
69
|
+
if (fs__namespace.existsSync(potentialConfig)) {
|
|
70
|
+
configFiles.push(potentialConfig);
|
|
71
|
+
highestRoot = currentDir;
|
|
72
|
+
}
|
|
73
|
+
if (fs__namespace.existsSync(path__namespace.join(currentDir, "package.json"))) {
|
|
74
|
+
highestRoot = currentDir;
|
|
75
|
+
}
|
|
76
|
+
currentDir = path__namespace.dirname(currentDir);
|
|
77
|
+
}
|
|
78
|
+
const root = highestRoot;
|
|
79
|
+
// 2. Scan for other configs recursively (downwards search from root)
|
|
80
|
+
// This avoids hardcoding directory names like "plugins", "mods", etc.
|
|
81
|
+
this.discoverConfigs(root, configFiles);
|
|
82
|
+
// 3. Process each found configuration
|
|
83
|
+
for (const configPath of configFiles) {
|
|
84
|
+
this.applyConfigFromFile(configPath, root);
|
|
85
|
+
}
|
|
86
|
+
// 4. Final meta search from root if not already handled
|
|
87
|
+
this.executeMetaConfig(root);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Apply configuration from a specific file
|
|
91
|
+
*/
|
|
92
|
+
applyConfigFromFile(configPath, projectRoot) {
|
|
93
|
+
const configDir = path__namespace.dirname(configPath);
|
|
94
|
+
try {
|
|
95
|
+
if (!fs__namespace.existsSync(configPath))
|
|
96
|
+
return;
|
|
97
|
+
const content = fs__namespace.readFileSync(configPath, "utf-8");
|
|
98
|
+
const config = JSON.parse(content);
|
|
99
|
+
if (!config)
|
|
100
|
+
return;
|
|
101
|
+
Logger.logger.debug("server", `Loading configuration: ${path__namespace.relative(projectRoot, configPath)}`);
|
|
102
|
+
// Apply __sys__ config if present
|
|
103
|
+
if (config.__sys__) {
|
|
104
|
+
const sys = globalThis.__sys__;
|
|
105
|
+
if (sys) {
|
|
106
|
+
sys.$update(config.__sys__);
|
|
78
107
|
}
|
|
79
108
|
}
|
|
80
|
-
|
|
81
|
-
|
|
109
|
+
// Process $internal configuration
|
|
110
|
+
if (config.$internal) {
|
|
111
|
+
this.processInternalConfig(config.$internal, projectRoot, configDir);
|
|
82
112
|
}
|
|
83
113
|
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
Logger.logger.warn("server", `Failed to load or parse config at ${configPath}: ${error.message}`);
|
|
116
|
+
}
|
|
84
117
|
}
|
|
85
118
|
/**
|
|
86
119
|
* Processes the `$internal` configuration block within `xypriss.config.json`.
|
|
@@ -90,10 +123,11 @@ class ConfigLoader {
|
|
|
90
123
|
* logic. This facilitates workspace isolation for plugins and internal tools.
|
|
91
124
|
*
|
|
92
125
|
* @param {any} internalConfig - The internal configuration object from the config file.
|
|
93
|
-
* @param {string}
|
|
126
|
+
* @param {string} projectRoot - The project root directory used for path resolution.
|
|
127
|
+
* @param {string} configDir - The directory where the configuration file is located.
|
|
94
128
|
* @private
|
|
95
129
|
*/
|
|
96
|
-
processInternalConfig(internalConfig,
|
|
130
|
+
processInternalConfig(internalConfig, projectRoot, configDir) {
|
|
97
131
|
const sys = globalThis.__sys__;
|
|
98
132
|
if (!sys)
|
|
99
133
|
return;
|
|
@@ -101,39 +135,79 @@ class ConfigLoader {
|
|
|
101
135
|
const config = internalConfig[sysName];
|
|
102
136
|
// 1. Setup specialized FileSystem if __xfs__ is present
|
|
103
137
|
if (config.__xfs__ && config.__xfs__.path) {
|
|
104
|
-
const
|
|
105
|
-
const resolvedFsPath =
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
138
|
+
const rawPath = config.__xfs__.path;
|
|
139
|
+
const resolvedFsPath = this.resolvePath(rawPath, projectRoot, configDir);
|
|
140
|
+
if (resolvedFsPath) {
|
|
141
|
+
// Runtime validation: Ensure the path exists
|
|
142
|
+
if (fs__namespace.existsSync(resolvedFsPath)) {
|
|
143
|
+
const specializedFS = new FileSystem.XyPrissFS({
|
|
144
|
+
__root__: resolvedFsPath,
|
|
145
|
+
});
|
|
146
|
+
sys.$add(sysName, specializedFS);
|
|
147
|
+
// Add alias for $plug / $plg
|
|
148
|
+
if (sysName === "$plug")
|
|
149
|
+
sys.$add("$plg", specializedFS);
|
|
150
|
+
if (sysName === "$plg")
|
|
151
|
+
sys.$add("$plug", specializedFS);
|
|
152
|
+
Logger.logger.debug("server", `Specialized filesystem mapped: ${sysName} -> ${resolvedFsPath}`);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
Logger.logger.error("server", `System Workspace Error: Path for ${sysName} not found: ${resolvedFsPath} (from: ${rawPath})`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
Logger.logger.error("server", `Unresolvable __xfs__ path for ${sysName}: ${rawPath}`);
|
|
160
|
+
}
|
|
116
161
|
}
|
|
117
162
|
// 2. Execute additional meta logic if __meta__ is present
|
|
118
163
|
if (config.__meta__ && config.__meta__.path) {
|
|
119
|
-
const
|
|
120
|
-
const resolvedMetaPath =
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (fs__namespace.
|
|
124
|
-
|
|
164
|
+
const rawPath = config.__meta__.path;
|
|
165
|
+
const resolvedMetaPath = this.resolvePath(rawPath, projectRoot, configDir);
|
|
166
|
+
if (resolvedMetaPath) {
|
|
167
|
+
// If it's a directory, search for meta files inside it
|
|
168
|
+
if (fs__namespace.existsSync(resolvedMetaPath)) {
|
|
169
|
+
if (fs__namespace.statSync(resolvedMetaPath).isDirectory()) {
|
|
170
|
+
this.executeMetaConfig(resolvedMetaPath);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
// If it's a file, execute it directly
|
|
174
|
+
this.runMetaFile(resolvedMetaPath);
|
|
175
|
+
}
|
|
125
176
|
}
|
|
126
177
|
else {
|
|
127
|
-
|
|
128
|
-
this.runMetaFile(resolvedMetaPath);
|
|
178
|
+
Logger.logger.error("server", `System Workspace Error: Meta path not found: ${resolvedMetaPath} (from: ${rawPath})`);
|
|
129
179
|
}
|
|
130
180
|
}
|
|
131
181
|
else {
|
|
132
|
-
Logger.logger.
|
|
182
|
+
Logger.logger.error("server", `Unresolvable __meta__ path for ${sysName}: ${rawPath}`);
|
|
133
183
|
}
|
|
134
184
|
}
|
|
135
185
|
}
|
|
136
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Resolves a path string into an absolute path.
|
|
189
|
+
* Supports #$ (project root) and relative paths (local configuration).
|
|
190
|
+
*/
|
|
191
|
+
resolvePath(rawPath, projectRoot, configDir) {
|
|
192
|
+
try {
|
|
193
|
+
// Clean up the raw path (spaces around slashes, etc.)
|
|
194
|
+
let cleanedPath = rawPath.replace(/\s*\/\s*/g, "/").trim();
|
|
195
|
+
// Case 1: Project Root Resolution (#$ or $#)
|
|
196
|
+
const rootPlaceholder = /\s*(?:#\s*\$|\$\s*#)\s*/;
|
|
197
|
+
if (rootPlaceholder.test(cleanedPath)) {
|
|
198
|
+
return path__namespace.resolve(projectRoot, cleanedPath.replace(rootPlaceholder, "").replace(/^\//, ""));
|
|
199
|
+
}
|
|
200
|
+
// Case 2: Local path resolution (absolute or relative)
|
|
201
|
+
if (path__namespace.isAbsolute(cleanedPath)) {
|
|
202
|
+
return cleanedPath;
|
|
203
|
+
}
|
|
204
|
+
// Resolve relative to the configuration file directory
|
|
205
|
+
return path__namespace.resolve(configDir, cleanedPath);
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
137
211
|
/**
|
|
138
212
|
* Executes a specific XyPriss meta configuration file.
|
|
139
213
|
*
|
|
@@ -144,6 +218,10 @@ class ConfigLoader {
|
|
|
144
218
|
* @private
|
|
145
219
|
*/
|
|
146
220
|
runMetaFile(metaPath) {
|
|
221
|
+
const absolutePath = path__namespace.resolve(metaPath);
|
|
222
|
+
if (this.executedMetas.has(absolutePath))
|
|
223
|
+
return;
|
|
224
|
+
this.executedMetas.add(absolutePath);
|
|
147
225
|
try {
|
|
148
226
|
import(`file://${metaPath}`)
|
|
149
227
|
.then((module) => {
|
|
@@ -191,6 +269,51 @@ class ConfigLoader {
|
|
|
191
269
|
}
|
|
192
270
|
}
|
|
193
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* Recursively discovers all xypriss.config.json files starting from a directory.
|
|
274
|
+
* Skips common non-project directories (node_modules, dist, etc.) for efficiency.
|
|
275
|
+
*
|
|
276
|
+
* @param dir - The directory to start the search from.
|
|
277
|
+
* @param results - Array to accumulate found configuration paths.
|
|
278
|
+
* @param depth - Current recursion depth (limit to prevent excessive scanning).
|
|
279
|
+
* @private
|
|
280
|
+
*/
|
|
281
|
+
discoverConfigs(dir, results, depth = 0) {
|
|
282
|
+
if (depth > 5)
|
|
283
|
+
return; // Limit depth for performance
|
|
284
|
+
try {
|
|
285
|
+
const items = fs__namespace.readdirSync(dir, { withFileTypes: true });
|
|
286
|
+
for (const item of items) {
|
|
287
|
+
const fullPath = path__namespace.join(dir, item.name);
|
|
288
|
+
if (item.isDirectory()) {
|
|
289
|
+
// Skip common ignore patterns
|
|
290
|
+
const ignorePatterns = [
|
|
291
|
+
"node_modules",
|
|
292
|
+
"dist",
|
|
293
|
+
".git",
|
|
294
|
+
"target",
|
|
295
|
+
"out",
|
|
296
|
+
".private",
|
|
297
|
+
".meta",
|
|
298
|
+
"temp",
|
|
299
|
+
"tmp",
|
|
300
|
+
".xypriss",
|
|
301
|
+
];
|
|
302
|
+
if (ignorePatterns.includes(item.name))
|
|
303
|
+
continue;
|
|
304
|
+
this.discoverConfigs(fullPath, results, depth + 1);
|
|
305
|
+
}
|
|
306
|
+
else if (item.name === "xypriss.config.json") {
|
|
307
|
+
if (!results.includes(fullPath)) {
|
|
308
|
+
results.push(fullPath);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
catch (error) {
|
|
314
|
+
// Log error only in debug if needed, otherwise skip inaccessible dirs
|
|
315
|
+
}
|
|
316
|
+
}
|
|
194
317
|
}
|
|
195
318
|
const configLoader = new ConfigLoader();
|
|
196
319
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigLoader.js","sources":["../../../../../src/server/utils/ConfigLoader.ts"],"sourcesContent":[null],"names":["path","fs","logger","XyPrissFS"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;;;;;AAKG;MACU,YAAY,CAAA;AAAzB,IAAA,WAAA,GAAA;QACY,
|
|
1
|
+
{"version":3,"file":"ConfigLoader.js","sources":["../../../../../src/server/utils/ConfigLoader.ts"],"sourcesContent":[null],"names":["path","fs","logger","XyPrissFS"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;;;;;AAKG;MACU,YAAY,CAAA;AAAzB,IAAA,WAAA,GAAA;QACY,IAAe,CAAA,eAAA,GAAG,KAAK,CAAC;AACxB,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,GAAG,EAAU,CAAC;KAuW7C;AArWG;;;AAGG;AACK,IAAA,eAAe,CAAC,QAAgB,EAAA;QACpC,IAAI,UAAU,GAAGA,eAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACxC,MAAM,IAAI,GAAGA,eAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC;AAEzC,QAAA,OAAO,UAAU,KAAK,IAAI,EAAE;AACxB,YAAA,IACIC,aAAE,CAAC,UAAU,CAACD,eAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;AACpD,gBAAAC,aAAE,CAAC,UAAU,CAACD,eAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,EACtD;AACE,gBAAA,OAAO,UAAU,CAAC;aACrB;AACD,YAAA,UAAU,GAAGA,eAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;SACzC;AACD,QAAA,OAAO,QAAQ,CAAC;KACnB;AAED;;AAEG;IACI,qBAAqB,GAAA;QACxB,IAAI,IAAI,CAAC,eAAe;YAAE,OAAO;AACjC,QAAA,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;AAC5B,QAAA,IAAI,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC/B,MAAM,cAAc,GAAG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AAEtB,QAAA,IAAI;AACA,YAAA,MAAM,KAAK,GAAGA,aAAE,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;AAE3D,YAAA,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;AACtB,gBAAA,MAAM,QAAQ,GAAGD,eAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;AAE3C,gBAAA,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;;AAEpB,oBAAA,MAAM,cAAc,GAAG;wBACnB,cAAc;wBACd,MAAM;wBACN,MAAM;wBACN,QAAQ;wBACR,KAAK;wBACL,UAAU;wBACV,OAAO;wBACP,MAAM;wBACN,KAAK;wBACL,UAAU;qBACb,CAAC;AACF,oBAAA,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;wBAAE,SAAS;oBAEjD,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;iBACtD;AAAM,qBAAA,IAAI,IAAI,CAAC,IAAI,KAAK,qBAAqB,EAAE;oBAC5C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;AAC7B,wBAAA,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;qBAC1B;iBACJ;aACJ;SACJ;QAAC,OAAO,KAAK,EAAE;;SAEf;KACJ;AACJ,CAAA;AAEY,MAAA,YAAY,GAAG,IAAI,YAAY;;;;;"}
|
|
@@ -11,7 +11,8 @@ import { XyPrissFS } from '../../sys/FileSystem.js';
|
|
|
11
11
|
*/
|
|
12
12
|
class ConfigLoader {
|
|
13
13
|
constructor() {
|
|
14
|
-
this.
|
|
14
|
+
this.isConfigApplied = false;
|
|
15
|
+
this.executedMetas = new Set();
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
18
|
* Find the project root by searching for package.json or node_modules
|
|
@@ -30,35 +31,67 @@ class ConfigLoader {
|
|
|
30
31
|
return startDir;
|
|
31
32
|
}
|
|
32
33
|
/**
|
|
33
|
-
* Load xypriss.config.json and apply
|
|
34
|
+
* Load all xypriss.config.json files found in the project and apply configurations
|
|
34
35
|
*/
|
|
35
36
|
loadAndApplySysConfig() {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
37
|
+
if (this.isConfigApplied)
|
|
38
|
+
return;
|
|
39
|
+
this.isConfigApplied = true;
|
|
40
|
+
let currentDir = process.cwd();
|
|
41
|
+
const filesystemRoot = path.parse(currentDir).root;
|
|
42
|
+
const configFiles = [];
|
|
43
|
+
let highestRoot = currentDir;
|
|
44
|
+
// 1. Search upwards to find ALL configs and the highest project root
|
|
45
|
+
while (currentDir !== filesystemRoot) {
|
|
46
|
+
const potentialConfig = path.join(currentDir, "xypriss.config.json");
|
|
47
|
+
if (fs.existsSync(potentialConfig)) {
|
|
48
|
+
configFiles.push(potentialConfig);
|
|
49
|
+
highestRoot = currentDir;
|
|
50
|
+
}
|
|
51
|
+
if (fs.existsSync(path.join(currentDir, "package.json"))) {
|
|
52
|
+
highestRoot = currentDir;
|
|
53
|
+
}
|
|
54
|
+
currentDir = path.dirname(currentDir);
|
|
55
|
+
}
|
|
56
|
+
const root = highestRoot;
|
|
57
|
+
// 2. Scan for other configs recursively (downwards search from root)
|
|
58
|
+
// This avoids hardcoding directory names like "plugins", "mods", etc.
|
|
59
|
+
this.discoverConfigs(root, configFiles);
|
|
60
|
+
// 3. Process each found configuration
|
|
61
|
+
for (const configPath of configFiles) {
|
|
62
|
+
this.applyConfigFromFile(configPath, root);
|
|
63
|
+
}
|
|
64
|
+
// 4. Final meta search from root if not already handled
|
|
65
|
+
this.executeMetaConfig(root);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Apply configuration from a specific file
|
|
69
|
+
*/
|
|
70
|
+
applyConfigFromFile(configPath, projectRoot) {
|
|
71
|
+
const configDir = path.dirname(configPath);
|
|
72
|
+
try {
|
|
73
|
+
if (!fs.existsSync(configPath))
|
|
74
|
+
return;
|
|
75
|
+
const content = fs.readFileSync(configPath, "utf-8");
|
|
76
|
+
const config = JSON.parse(content);
|
|
77
|
+
if (!config)
|
|
78
|
+
return;
|
|
79
|
+
logger.debug("server", `Loading configuration: ${path.relative(projectRoot, configPath)}`);
|
|
80
|
+
// Apply __sys__ config if present
|
|
81
|
+
if (config.__sys__) {
|
|
82
|
+
const sys = globalThis.__sys__;
|
|
83
|
+
if (sys) {
|
|
84
|
+
sys.$update(config.__sys__);
|
|
56
85
|
}
|
|
57
86
|
}
|
|
58
|
-
|
|
59
|
-
|
|
87
|
+
// Process $internal configuration
|
|
88
|
+
if (config.$internal) {
|
|
89
|
+
this.processInternalConfig(config.$internal, projectRoot, configDir);
|
|
60
90
|
}
|
|
61
91
|
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
logger.warn("server", `Failed to load or parse config at ${configPath}: ${error.message}`);
|
|
94
|
+
}
|
|
62
95
|
}
|
|
63
96
|
/**
|
|
64
97
|
* Processes the `$internal` configuration block within `xypriss.config.json`.
|
|
@@ -68,10 +101,11 @@ class ConfigLoader {
|
|
|
68
101
|
* logic. This facilitates workspace isolation for plugins and internal tools.
|
|
69
102
|
*
|
|
70
103
|
* @param {any} internalConfig - The internal configuration object from the config file.
|
|
71
|
-
* @param {string}
|
|
104
|
+
* @param {string} projectRoot - The project root directory used for path resolution.
|
|
105
|
+
* @param {string} configDir - The directory where the configuration file is located.
|
|
72
106
|
* @private
|
|
73
107
|
*/
|
|
74
|
-
processInternalConfig(internalConfig,
|
|
108
|
+
processInternalConfig(internalConfig, projectRoot, configDir) {
|
|
75
109
|
const sys = globalThis.__sys__;
|
|
76
110
|
if (!sys)
|
|
77
111
|
return;
|
|
@@ -79,39 +113,79 @@ class ConfigLoader {
|
|
|
79
113
|
const config = internalConfig[sysName];
|
|
80
114
|
// 1. Setup specialized FileSystem if __xfs__ is present
|
|
81
115
|
if (config.__xfs__ && config.__xfs__.path) {
|
|
82
|
-
const
|
|
83
|
-
const resolvedFsPath =
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
116
|
+
const rawPath = config.__xfs__.path;
|
|
117
|
+
const resolvedFsPath = this.resolvePath(rawPath, projectRoot, configDir);
|
|
118
|
+
if (resolvedFsPath) {
|
|
119
|
+
// Runtime validation: Ensure the path exists
|
|
120
|
+
if (fs.existsSync(resolvedFsPath)) {
|
|
121
|
+
const specializedFS = new XyPrissFS({
|
|
122
|
+
__root__: resolvedFsPath,
|
|
123
|
+
});
|
|
124
|
+
sys.$add(sysName, specializedFS);
|
|
125
|
+
// Add alias for $plug / $plg
|
|
126
|
+
if (sysName === "$plug")
|
|
127
|
+
sys.$add("$plg", specializedFS);
|
|
128
|
+
if (sysName === "$plg")
|
|
129
|
+
sys.$add("$plug", specializedFS);
|
|
130
|
+
logger.debug("server", `Specialized filesystem mapped: ${sysName} -> ${resolvedFsPath}`);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
logger.error("server", `System Workspace Error: Path for ${sysName} not found: ${resolvedFsPath} (from: ${rawPath})`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
logger.error("server", `Unresolvable __xfs__ path for ${sysName}: ${rawPath}`);
|
|
138
|
+
}
|
|
94
139
|
}
|
|
95
140
|
// 2. Execute additional meta logic if __meta__ is present
|
|
96
141
|
if (config.__meta__ && config.__meta__.path) {
|
|
97
|
-
const
|
|
98
|
-
const resolvedMetaPath =
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if (fs.
|
|
102
|
-
|
|
142
|
+
const rawPath = config.__meta__.path;
|
|
143
|
+
const resolvedMetaPath = this.resolvePath(rawPath, projectRoot, configDir);
|
|
144
|
+
if (resolvedMetaPath) {
|
|
145
|
+
// If it's a directory, search for meta files inside it
|
|
146
|
+
if (fs.existsSync(resolvedMetaPath)) {
|
|
147
|
+
if (fs.statSync(resolvedMetaPath).isDirectory()) {
|
|
148
|
+
this.executeMetaConfig(resolvedMetaPath);
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
// If it's a file, execute it directly
|
|
152
|
+
this.runMetaFile(resolvedMetaPath);
|
|
153
|
+
}
|
|
103
154
|
}
|
|
104
155
|
else {
|
|
105
|
-
|
|
106
|
-
this.runMetaFile(resolvedMetaPath);
|
|
156
|
+
logger.error("server", `System Workspace Error: Meta path not found: ${resolvedMetaPath} (from: ${rawPath})`);
|
|
107
157
|
}
|
|
108
158
|
}
|
|
109
159
|
else {
|
|
110
|
-
logger.
|
|
160
|
+
logger.error("server", `Unresolvable __meta__ path for ${sysName}: ${rawPath}`);
|
|
111
161
|
}
|
|
112
162
|
}
|
|
113
163
|
}
|
|
114
164
|
}
|
|
165
|
+
/**
|
|
166
|
+
* Resolves a path string into an absolute path.
|
|
167
|
+
* Supports #$ (project root) and relative paths (local configuration).
|
|
168
|
+
*/
|
|
169
|
+
resolvePath(rawPath, projectRoot, configDir) {
|
|
170
|
+
try {
|
|
171
|
+
// Clean up the raw path (spaces around slashes, etc.)
|
|
172
|
+
let cleanedPath = rawPath.replace(/\s*\/\s*/g, "/").trim();
|
|
173
|
+
// Case 1: Project Root Resolution (#$ or $#)
|
|
174
|
+
const rootPlaceholder = /\s*(?:#\s*\$|\$\s*#)\s*/;
|
|
175
|
+
if (rootPlaceholder.test(cleanedPath)) {
|
|
176
|
+
return path.resolve(projectRoot, cleanedPath.replace(rootPlaceholder, "").replace(/^\//, ""));
|
|
177
|
+
}
|
|
178
|
+
// Case 2: Local path resolution (absolute or relative)
|
|
179
|
+
if (path.isAbsolute(cleanedPath)) {
|
|
180
|
+
return cleanedPath;
|
|
181
|
+
}
|
|
182
|
+
// Resolve relative to the configuration file directory
|
|
183
|
+
return path.resolve(configDir, cleanedPath);
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
115
189
|
/**
|
|
116
190
|
* Executes a specific XyPriss meta configuration file.
|
|
117
191
|
*
|
|
@@ -122,6 +196,10 @@ class ConfigLoader {
|
|
|
122
196
|
* @private
|
|
123
197
|
*/
|
|
124
198
|
runMetaFile(metaPath) {
|
|
199
|
+
const absolutePath = path.resolve(metaPath);
|
|
200
|
+
if (this.executedMetas.has(absolutePath))
|
|
201
|
+
return;
|
|
202
|
+
this.executedMetas.add(absolutePath);
|
|
125
203
|
try {
|
|
126
204
|
import(`file://${metaPath}`)
|
|
127
205
|
.then((module) => {
|
|
@@ -169,6 +247,51 @@ class ConfigLoader {
|
|
|
169
247
|
}
|
|
170
248
|
}
|
|
171
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* Recursively discovers all xypriss.config.json files starting from a directory.
|
|
252
|
+
* Skips common non-project directories (node_modules, dist, etc.) for efficiency.
|
|
253
|
+
*
|
|
254
|
+
* @param dir - The directory to start the search from.
|
|
255
|
+
* @param results - Array to accumulate found configuration paths.
|
|
256
|
+
* @param depth - Current recursion depth (limit to prevent excessive scanning).
|
|
257
|
+
* @private
|
|
258
|
+
*/
|
|
259
|
+
discoverConfigs(dir, results, depth = 0) {
|
|
260
|
+
if (depth > 5)
|
|
261
|
+
return; // Limit depth for performance
|
|
262
|
+
try {
|
|
263
|
+
const items = fs.readdirSync(dir, { withFileTypes: true });
|
|
264
|
+
for (const item of items) {
|
|
265
|
+
const fullPath = path.join(dir, item.name);
|
|
266
|
+
if (item.isDirectory()) {
|
|
267
|
+
// Skip common ignore patterns
|
|
268
|
+
const ignorePatterns = [
|
|
269
|
+
"node_modules",
|
|
270
|
+
"dist",
|
|
271
|
+
".git",
|
|
272
|
+
"target",
|
|
273
|
+
"out",
|
|
274
|
+
".private",
|
|
275
|
+
".meta",
|
|
276
|
+
"temp",
|
|
277
|
+
"tmp",
|
|
278
|
+
".xypriss",
|
|
279
|
+
];
|
|
280
|
+
if (ignorePatterns.includes(item.name))
|
|
281
|
+
continue;
|
|
282
|
+
this.discoverConfigs(fullPath, results, depth + 1);
|
|
283
|
+
}
|
|
284
|
+
else if (item.name === "xypriss.config.json") {
|
|
285
|
+
if (!results.includes(fullPath)) {
|
|
286
|
+
results.push(fullPath);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
catch (error) {
|
|
292
|
+
// Log error only in debug if needed, otherwise skip inaccessible dirs
|
|
293
|
+
}
|
|
294
|
+
}
|
|
172
295
|
}
|
|
173
296
|
const configLoader = new ConfigLoader();
|
|
174
297
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigLoader.js","sources":["../../../../../src/server/utils/ConfigLoader.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAKA;;;;;AAKG;MACU,YAAY,CAAA;AAAzB,IAAA,WAAA,GAAA;QACY,
|
|
1
|
+
{"version":3,"file":"ConfigLoader.js","sources":["../../../../../src/server/utils/ConfigLoader.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAKA;;;;;AAKG;MACU,YAAY,CAAA;AAAzB,IAAA,WAAA,GAAA;QACY,IAAe,CAAA,eAAA,GAAG,KAAK,CAAC;AACxB,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,GAAG,EAAU,CAAC;KAuW7C;AArWG;;;AAGG;AACK,IAAA,eAAe,CAAC,QAAgB,EAAA;QACpC,IAAI,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACxC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK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,CAAC;iBACtD;AAAM,qBAAA,IAAI,IAAI,CAAC,IAAI,KAAK,qBAAqB,EAAE;oBAC5C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;AAC7B,wBAAA,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;qBAC1B;iBACJ;aACJ;SACJ;QAAC,OAAO,KAAK,EAAE;;SAEf;KACJ;AACJ,CAAA;AAEY,MAAA,YAAY,GAAG,IAAI,YAAY;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xypriss",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.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",
|
|
@@ -271,3 +271,4 @@
|
|
|
271
271
|
"xypriss-security": "^1.1.15"
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
+
|