@hed-hog/cli 0.0.80 → 0.0.84

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.80",
3
+ "version": "0.0.84",
4
4
  "description": "HedHog CLI tool",
5
5
  "author": "HedHog",
6
6
  "private": false,
@@ -2655,24 +2655,31 @@ temp
2655
2655
  spinner.start('Resetting frontend files...');
2656
2656
  const frontendMessagesPath = pathModule.join(cwd, 'apps', 'admin', 'messages');
2657
2657
  // Scan directories from frontendPath
2658
- if (!(0, fs_1.existsSync)(frontendMessagesPath)) {
2659
- this.log(chalk.yellow(`Frontend path does not exist: ${frontendMessagesPath}`));
2660
- spinner.succeed('No frontend files to reset.');
2661
- return;
2658
+ if ((0, fs_1.existsSync)(frontendMessagesPath)) {
2659
+ const scanDirs = (0, fs_1.readdirSync)(frontendMessagesPath, {
2660
+ withFileTypes: true,
2661
+ })
2662
+ .filter((entry) => entry.isDirectory())
2663
+ .map((entry) => pathModule.join(frontendMessagesPath, entry.name));
2664
+ this.log(`Found ${scanDirs.length} directories in ${frontendMessagesPath}`);
2665
+ for (const dir of scanDirs) {
2666
+ await this.fileSystem.remove(dir);
2667
+ this.log(chalk.blue(`Removed directory: ${dir}`));
2668
+ }
2662
2669
  }
2663
- const scanDirs = (0, fs_1.readdirSync)(frontendMessagesPath, { withFileTypes: true })
2664
- .filter((entry) => entry.isDirectory())
2665
- .map((entry) => pathModule.join(frontendMessagesPath, entry.name));
2666
- this.log(`Found ${scanDirs.length} directories in ${frontendMessagesPath}`);
2667
- for (const dir of scanDirs) {
2668
- await this.fileSystem.remove(dir);
2669
- this.log(chalk.blue(`Removed directory: ${dir}`));
2670
+ else {
2671
+ this.log(chalk.yellow(`Frontend path does not exist: ${frontendMessagesPath}`));
2670
2672
  }
2671
2673
  const frontendPath = pathModule.join(cwd, 'apps', 'admin', 'src', 'app', '(app)', '(libraries)');
2672
2674
  if ((0, fs_1.existsSync)(frontendPath)) {
2673
2675
  await this.fileSystem.remove(frontendPath);
2674
2676
  this.log(chalk.blue(`Removed directory: ${frontendPath}`));
2675
2677
  }
2678
+ const frontendPublicLibrariesPath = pathModule.join(cwd, 'apps', 'admin', 'public', 'libraries');
2679
+ if ((0, fs_1.existsSync)(frontendPublicLibrariesPath)) {
2680
+ await this.fileSystem.remove(frontendPublicLibrariesPath);
2681
+ this.log(chalk.blue(`Removed directory: ${frontendPublicLibrariesPath}`));
2682
+ }
2676
2683
  spinner.succeed('Frontend files reset completed.');
2677
2684
  }
2678
2685
  async resetDevelopmentEnvironment(cwd, verbose = false) {
@@ -3370,6 +3377,25 @@ temp
3370
3377
  else {
3371
3378
  this.log(chalk.yellow(`Frontend app folder not found at ${appSourcePath}`));
3372
3379
  }
3380
+ // Copy namespaced public assets folder if it exists
3381
+ const publicSourcePath = pathModule.join(cwd, 'apps', 'admin', 'public', 'libraries', name);
3382
+ const publicDestPath = pathModule.join(cwd, 'libraries', name, 'hedhog', 'frontend', 'public');
3383
+ if (await this.fileSystem.exists(publicSourcePath)) {
3384
+ this.log(`Found frontend public assets at ${publicSourcePath}, copying...`);
3385
+ try {
3386
+ spinner.text = `Copying frontend public assets for ${name}...`;
3387
+ await this.fileSystem.createDirectory(publicDestPath);
3388
+ await this.fileSystem.copyDirectory(publicSourcePath, publicDestPath);
3389
+ this.log(chalk.green(`Frontend public assets copied successfully to ${publicDestPath}`));
3390
+ }
3391
+ catch (error) {
3392
+ this.log(chalk.red(`Error copying frontend public assets: ${error.message}`));
3393
+ throw error;
3394
+ }
3395
+ }
3396
+ else {
3397
+ this.log(chalk.yellow(`Frontend public assets folder not found at ${publicSourcePath}`));
3398
+ }
3373
3399
  this.log(chalk.green(`Assets copied successfully for library ${name}`));
3374
3400
  }
3375
3401
  };