@xenon-device-management/xenon 1.1.15 → 1.1.16

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/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenon-device-management/xenon",
3
- "version": "1.1.15",
3
+ "version": "1.1.16",
4
4
  "description": "Xenon - Intelligent Mobile Infrastructure. A self-healing device orchestration platform for Appium.",
5
5
  "main": "./lib/src/index.js",
6
6
  "exports": {
@@ -132,17 +132,27 @@ apiRouter.get('/metrics', (req, res) => __awaiter(void 0, void 0, void 0, functi
132
132
  res.set('Content-Type', 'text/plain');
133
133
  res.send(metrics);
134
134
  }));
135
- const publicPathCandidates = [
136
- path_1.default.resolve(__dirname, '..', 'public'),
137
- path_1.default.resolve(__dirname, '..', '..', 'public'),
138
- path_1.default.resolve(__dirname, '..', '..', '..', 'public'),
139
- ];
140
- const publicPath = publicPathCandidates.find((p) => {
141
- const exists = fs_1.default.existsSync(p) && fs_1.default.existsSync(path_1.default.join(p, 'index.html'));
142
- if (exists)
143
- logger_1.default.debug(`[Xenon] Found public assets at: ${p}`);
144
- return exists;
145
- }) || publicPathCandidates[1];
135
+ const findPublicPath = () => {
136
+ const rootDir = path_1.default.resolve(__dirname, '..', '..');
137
+ const searchPaths = [
138
+ path_1.default.join(rootDir, 'public'), // Production (lib/public)
139
+ path_1.default.join(rootDir, 'src', 'public'), // Development (src/public)
140
+ path_1.default.resolve(__dirname, '../public'), // Alternative structure
141
+ path_1.default.resolve(__dirname, '../../public'),
142
+ path_1.default.resolve(__dirname, '../../../public'),
143
+ ];
144
+ for (const p of searchPaths) {
145
+ if (fs_1.default.existsSync(path_1.default.join(p, 'index.html'))) {
146
+ logger_1.default.info(`[Xenon] Dashboard assets found at: ${p}`);
147
+ return p;
148
+ }
149
+ }
150
+ // Last resort fallback
151
+ const fallback = path_1.default.resolve(__dirname, '../../public');
152
+ logger_1.default.warn(`[Xenon] Could not find dashboard index.html in standard paths. Falling back to: ${fallback}`);
153
+ return fallback;
154
+ };
155
+ const publicPath = findPublicPath();
146
156
  logger_1.default.info(`[Xenon] Public assets path resolved to: ${publicPath}`);
147
157
  staticFilesRouter.use(express_1.default.static(publicPath));
148
158
  router.use('/api', apiRouter);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenon-device-management/xenon",
3
- "version": "1.1.15",
3
+ "version": "1.1.16",
4
4
  "description": "Xenon - Intelligent Mobile Infrastructure. A self-healing device orchestration platform for Appium.",
5
5
  "main": "./lib/src/index.js",
6
6
  "exports": {