@hed-hog/cli 0.0.86 → 0.0.88

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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hed-hog/cli",
3
- "version": "0.0.86",
3
+ "version": "0.0.88",
4
4
  "description": "HedHog CLI tool",
5
5
  "author": "HedHog",
6
6
  "private": false,
@@ -13,6 +13,7 @@ export declare class DeveloperService {
13
13
  private readonly database;
14
14
  private readonly hedHogService;
15
15
  private verbose;
16
+ private readonly processedSharedWidgets;
16
17
  private readonly bootstrapIgnoredEntries;
17
18
  constructor(runner: RunnerService, fileSystem: FileSystemService, database: DatabaseService, hedHogService: HedHogService);
18
19
  log(...args: any[]): void;
@@ -35,6 +35,7 @@ let DeveloperService = class DeveloperService {
35
35
  database;
36
36
  hedHogService;
37
37
  verbose = false;
38
+ processedSharedWidgets = new Set();
38
39
  bootstrapIgnoredEntries = new Set([
39
40
  '.git',
40
41
  'node_modules',
@@ -3401,20 +3402,27 @@ temp
3401
3402
  else {
3402
3403
  this.log(chalk.yellow(`Frontend public assets folder not found at ${publicSourcePath}`));
3403
3404
  }
3404
- // Copy dashboard widgets folder if it exists
3405
+ // Copy shared dashboard widgets back into the correct library by filename prefix
3405
3406
  const widgetsSourcePath = pathModule.join(cwd, 'apps', 'admin', 'src', 'app', '(app)', '(libraries)', 'core', 'dashboard', 'components', 'widgets');
3406
- const widgetsDestPath = pathModule.join(cwd, 'libraries', name, 'hedhog', 'widgets');
3407
+ const librariesRootPath = pathModule.join(cwd, 'libraries');
3407
3408
  if (await this.fileSystem.exists(widgetsSourcePath)) {
3408
- this.log(`Found widgets at ${widgetsSourcePath}, copying with .ejs extension...`);
3409
- try {
3410
- spinner.text = `Copying widgets for ${name}...`;
3411
- await this.fileSystem.createDirectory(widgetsDestPath);
3412
- await this.fileSystem.copyDirectoryAddingEjsExtension(widgetsSourcePath, widgetsDestPath, name);
3413
- this.log(chalk.green(`Widgets copied successfully to ${widgetsDestPath}`));
3414
- }
3415
- catch (error) {
3416
- this.log(chalk.red(`Error copying widgets: ${error.message}`));
3417
- throw error;
3409
+ if (!this.processedSharedWidgets.has(widgetsSourcePath)) {
3410
+ this.processedSharedWidgets.add(widgetsSourcePath);
3411
+ this.log(`Found shared widgets at ${widgetsSourcePath}, exporting files by prefix to each library...`);
3412
+ try {
3413
+ spinner.text = 'Copying shared widgets to libraries...';
3414
+ const copiedWidgetsCount = await this.fileSystem.copyPrefixedFilesToLibrariesWithEjsExtension(widgetsSourcePath, librariesRootPath, ['hedhog', 'frontend', 'widgets']);
3415
+ if (copiedWidgetsCount > 0) {
3416
+ this.log(chalk.green(`${copiedWidgetsCount} widget(s) copied successfully to their library frontend/widgets directories`));
3417
+ }
3418
+ else {
3419
+ this.log(chalk.yellow(`No prefixed widgets found to export from ${widgetsSourcePath}`));
3420
+ }
3421
+ }
3422
+ catch (error) {
3423
+ this.log(chalk.red(`Error copying widgets: ${error.message}`));
3424
+ throw error;
3425
+ }
3418
3426
  }
3419
3427
  }
3420
3428
  else {