@qelos/plugins-cli 0.0.25 → 0.0.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qelos/plugins-cli",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "description": "CLI to manage QELOS plugins",
5
5
  "main": "cli.mjs",
6
6
  "bin": {
@@ -377,6 +377,43 @@ export function prepareTempDirectories(classifiedFiles, tempDir) {
377
377
  logger.debug(`Failed to process refs for ${path.basename(file)}: ${error.message}`);
378
378
  }
379
379
  }
380
+
381
+ // If this is a plugin, check for micro-frontend HTML files and copy them too
382
+ if (type === 'plugins' && file.endsWith('.plugin.json')) {
383
+ try {
384
+ const content = fs.readFileSync(dest, 'utf-8');
385
+ const plugin = JSON.parse(content);
386
+
387
+ // Check if plugin has micro-frontends
388
+ if (plugin.microFrontends && plugin.microFrontends.length > 0) {
389
+ // Create micro-frontends directory in temp
390
+ const mfTempDir = path.join(tempDir, 'plugins', 'micro-frontends');
391
+ fs.mkdirSync(mfTempDir, { recursive: true });
392
+
393
+ for (const mf of plugin.microFrontends) {
394
+ if (mf.structure && mf.structure.$ref) {
395
+ const refPath = mf.structure.$ref;
396
+
397
+ // Resolve the ref path relative to the original plugin file location
398
+ const originalDir = path.dirname(file);
399
+ const mfSourcePath = path.resolve(originalDir, refPath);
400
+
401
+ if (fs.existsSync(mfSourcePath)) {
402
+ const mfFileName = path.basename(refPath);
403
+ const mfDestPath = path.join(mfTempDir, mfFileName);
404
+
405
+ fs.copyFileSync(mfSourcePath, mfDestPath);
406
+ logger.debug(`Copied micro-frontend ${refPath} from ${mfSourcePath} to ${mfDestPath}`);
407
+ } else {
408
+ logger.debug(`Micro-frontend file not found: ${mfSourcePath}`);
409
+ }
410
+ }
411
+ }
412
+ }
413
+ } catch (error) {
414
+ logger.debug(`Failed to process micro-frontends for ${path.basename(file)}: ${error.message}`);
415
+ }
416
+ }
380
417
  }
381
418
  }
382
419