@hed-hog/cli 0.0.81 → 0.0.85
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 +1 -1
- package/dist/src/modules/developer/developer.service.js +61 -11
- package/dist/src/modules/developer/developer.service.js.map +1 -1
- package/dist/src/modules/hedhog/hedhog.service.js +18 -0
- package/dist/src/modules/hedhog/hedhog.service.js.map +1 -1
- package/dist/src/templates/deployment/workflow.deploy.yml.ejs +2 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/package.json
CHANGED
|
@@ -2655,24 +2655,36 @@ 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 (
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
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
|
-
|
|
2664
|
-
.
|
|
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
|
+
}
|
|
2683
|
+
const frontendWidgetsPath = pathModule.join(cwd, 'apps', 'admin', 'src', 'app', '(app)', '(libraries)', 'core', 'dashboard', 'components', 'widgets');
|
|
2684
|
+
if ((0, fs_1.existsSync)(frontendWidgetsPath)) {
|
|
2685
|
+
await this.fileSystem.remove(frontendWidgetsPath);
|
|
2686
|
+
this.log(chalk.blue(`Removed directory: ${frontendWidgetsPath}`));
|
|
2687
|
+
}
|
|
2676
2688
|
spinner.succeed('Frontend files reset completed.');
|
|
2677
2689
|
}
|
|
2678
2690
|
async resetDevelopmentEnvironment(cwd, verbose = false) {
|
|
@@ -3370,6 +3382,44 @@ temp
|
|
|
3370
3382
|
else {
|
|
3371
3383
|
this.log(chalk.yellow(`Frontend app folder not found at ${appSourcePath}`));
|
|
3372
3384
|
}
|
|
3385
|
+
// Copy namespaced public assets folder if it exists
|
|
3386
|
+
const publicSourcePath = pathModule.join(cwd, 'apps', 'admin', 'public', 'libraries', name);
|
|
3387
|
+
const publicDestPath = pathModule.join(cwd, 'libraries', name, 'hedhog', 'frontend', 'public');
|
|
3388
|
+
if (await this.fileSystem.exists(publicSourcePath)) {
|
|
3389
|
+
this.log(`Found frontend public assets at ${publicSourcePath}, copying...`);
|
|
3390
|
+
try {
|
|
3391
|
+
spinner.text = `Copying frontend public assets for ${name}...`;
|
|
3392
|
+
await this.fileSystem.createDirectory(publicDestPath);
|
|
3393
|
+
await this.fileSystem.copyDirectory(publicSourcePath, publicDestPath);
|
|
3394
|
+
this.log(chalk.green(`Frontend public assets copied successfully to ${publicDestPath}`));
|
|
3395
|
+
}
|
|
3396
|
+
catch (error) {
|
|
3397
|
+
this.log(chalk.red(`Error copying frontend public assets: ${error.message}`));
|
|
3398
|
+
throw error;
|
|
3399
|
+
}
|
|
3400
|
+
}
|
|
3401
|
+
else {
|
|
3402
|
+
this.log(chalk.yellow(`Frontend public assets folder not found at ${publicSourcePath}`));
|
|
3403
|
+
}
|
|
3404
|
+
// Copy dashboard widgets folder if it exists
|
|
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');
|
|
3407
|
+
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);
|
|
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;
|
|
3418
|
+
}
|
|
3419
|
+
}
|
|
3420
|
+
else {
|
|
3421
|
+
this.log(chalk.yellow(`Widgets folder not found at ${widgetsSourcePath}`));
|
|
3422
|
+
}
|
|
3373
3423
|
this.log(chalk.green(`Assets copied successfully for library ${name}`));
|
|
3374
3424
|
}
|
|
3375
3425
|
};
|