@hed-hog/cli 0.0.86 → 0.0.87

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.87",
4
4
  "description": "HedHog CLI tool",
5
5
  "author": "HedHog",
6
6
  "private": false,
@@ -3401,16 +3401,20 @@ temp
3401
3401
  else {
3402
3402
  this.log(chalk.yellow(`Frontend public assets folder not found at ${publicSourcePath}`));
3403
3403
  }
3404
- // Copy dashboard widgets folder if it exists
3404
+ // Copy dashboard widgets for this library based on the filename prefix
3405
3405
  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');
3406
+ const widgetsDestPath = pathModule.join(cwd, 'libraries', name, 'hedhog', 'frontend', 'widgets');
3407
3407
  if (await this.fileSystem.exists(widgetsSourcePath)) {
3408
- this.log(`Found widgets at ${widgetsSourcePath}, copying with .ejs extension...`);
3408
+ this.log(`Found shared widgets at ${widgetsSourcePath}, exporting files with prefix "${name}."...`);
3409
3409
  try {
3410
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}`));
3411
+ const copiedWidgetsCount = await this.fileSystem.copyDirectoryAddingEjsExtension(widgetsSourcePath, widgetsDestPath, name, true);
3412
+ if (copiedWidgetsCount > 0) {
3413
+ this.log(chalk.green(`${copiedWidgetsCount} widget(s) copied successfully to ${widgetsDestPath}`));
3414
+ }
3415
+ else {
3416
+ this.log(chalk.yellow(`No widgets found with prefix "${name}." at ${widgetsSourcePath}`));
3417
+ }
3414
3418
  }
3415
3419
  catch (error) {
3416
3420
  this.log(chalk.red(`Error copying widgets: ${error.message}`));