@devstroupe/devkit-cli 1.1.12 → 1.1.13

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.
Files changed (2) hide show
  1. package/dist/index.js +26 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -557,12 +557,38 @@ function initUi(frontendRoot, config) {
557
557
  fs.writeFileSync(path.join(profileDir, 'profile.component.ts'), prf.ts, 'utf-8');
558
558
  fs.writeFileSync(path.join(profileDir, 'profile.component.html'), prf.html, 'utf-8');
559
559
  fs.writeFileSync(path.join(profileDir, 'profile.component.css'), prf.css, 'utf-8');
560
+ // 20. Escrever devkit.css contendo o tema de cores dinâmico
561
+ const themeCss = (0, ui_templates_1.devkitThemeCssTemplate)({
562
+ preset: config.designSystem?.spartanStyle,
563
+ theme: config.designSystem?.spartanTheme === 'custom' ? 'custom' : config.designSystem?.spartanTheme,
564
+ primaryColor: config.designSystem?.primaryColor,
565
+ secondaryColor: config.designSystem?.secondaryColor,
566
+ fontFamily: config.designSystem?.fontFamily
567
+ });
568
+ fs.writeFileSync(path.join(targetDir, 'devkit.css'), themeCss, 'utf-8');
569
+ console.log(`[UI] Tema de cores gerado com sucesso em: ${path.join(targetDir, 'devkit.css')}`);
570
+ // 21. Garantir import do devkit.css no styles.css/styles.scss
571
+ ensureDevkitCssImport(frontendRoot);
560
572
  console.log(`[UI] Componentes DevKit, layout, Playground, ThemeService, ProfileService e ProfileComponent gerados com Spartan style="${spartanStyle}".`);
561
573
  // Configurar tsconfig.json
562
574
  ensureTsconfigPaths(frontendRoot);
563
575
  // Atualizar roteamento para suportar MainLayoutComponent
564
576
  updateAppRoutes(frontendRoot, config);
565
577
  }
578
+ function ensureDevkitCssImport(frontendRoot) {
579
+ const stylesPath = [
580
+ path.join(frontendRoot, 'src', 'styles.css'),
581
+ path.join(frontendRoot, 'src', 'styles.scss')
582
+ ].find((candidate) => fs.existsSync(candidate));
583
+ if (!stylesPath)
584
+ return;
585
+ let content = fs.readFileSync(stylesPath, 'utf-8');
586
+ if (!content.includes('devkit.css')) {
587
+ content += '\n@import "./app/shared/components/devkit/devkit.css";\n';
588
+ fs.writeFileSync(stylesPath, content, 'utf-8');
589
+ console.log('[UI] @import do devkit.css adicionado ao arquivo de estilos principal.');
590
+ }
591
+ }
566
592
  function getEntityRoutePath(entityName, config) {
567
593
  const navigation = config.layout?.navigation;
568
594
  if (!Array.isArray(navigation)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devstroupe/devkit-cli",
3
- "version": "1.1.12",
3
+ "version": "1.1.13",
4
4
  "description": "DevsTroupe Development Kit CLI — scaffold NestJS+Angular projects, inject Spartan UI, generate CRUDs and audit architectural governance",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -36,7 +36,7 @@
36
36
  "dependencies": {
37
37
  "commander": "^12.0.0",
38
38
  "fs-extra": "^11.2.0",
39
- "@devstroupe/devkit-core": "1.1.12"
39
+ "@devstroupe/devkit-core": "1.1.13"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/fs-extra": "^11.0.4",