@kithinji/pod 1.0.5 → 1.0.7

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/main.js CHANGED
@@ -2881,7 +2881,18 @@ function stylePlugin(store) {
2881
2881
  const allRules = styleRules.flat();
2882
2882
  const uniqueRules = [...new Set(allRules)];
2883
2883
  const cssOutput = uniqueRules.join("\n");
2884
- fs4.writeFileSync("public/index.css", cssOutput);
2884
+ fs4.writeFileSync(
2885
+ "public/index.css",
2886
+ `html {
2887
+ box-sizing: border-box;
2888
+ }
2889
+
2890
+ *, *::before, *::after {
2891
+ box-sizing: inherit;
2892
+ }
2893
+ ${cssOutput}
2894
+ `
2895
+ );
2885
2896
  });
2886
2897
  }
2887
2898
  };
@@ -3466,10 +3477,10 @@ function addFeature(name) {
3466
3477
  updateFeaturesIndex(name);
3467
3478
  updateAppModule(name);
3468
3479
  }
3469
- function addModule(name, baseDir) {
3480
+ function addModule(name, baseDir, root) {
3470
3481
  const structure = {
3471
3482
  files: [
3472
- { name: `${name}.module.ts`, content: createModule2(name) },
3483
+ { name: `${name}.module.ts`, content: createModule2(name, root) },
3473
3484
  { name: `${name}.service.ts`, content: createService(name) },
3474
3485
  { name: `${name}.page.tsx`, content: createPage(name) }
3475
3486
  ],
@@ -3668,11 +3679,34 @@ function addToModuleImportsArray(content, sourceFile, moduleName) {
3668
3679
  const newElement = `, ${moduleName}`;
3669
3680
  return content.substring(0, insertPos) + newElement + content.substring(insertPos);
3670
3681
  }
3671
- function createModule2(name) {
3682
+ function createModule2(name, root) {
3672
3683
  const serviceName = toPascalCase(name + "_Service");
3673
3684
  const pageName = toPascalCase(name + "_Page");
3674
3685
  const moduleName = toPascalCase(name + "_Module");
3675
3686
  const componentName = toPascalCase(name + "_List");
3687
+ if (root) {
3688
+ return `import { Module, RouterModule, ServeStaticModule } from "@kithinji/orca";
3689
+ import { ComponentModule } from "@/component/component.module";
3690
+ import { ${serviceName} } from "./${name}.service";
3691
+ import { ${pageName} } from "./${name}.page";
3692
+ import { ${componentName} } from "./components/${name}-list.component";
3693
+
3694
+ @Module({
3695
+ imports: [
3696
+ ServeStaticModule.forRoot({
3697
+ rootPath: "./public",
3698
+ }),
3699
+ RouterModule.forRoot(),
3700
+ ComponentModule
3701
+ ],
3702
+ providers: [${serviceName}],
3703
+ declarations: [${pageName}, ${componentName}],
3704
+ exports: [${serviceName}, ${pageName}],
3705
+ bootstrap: ${pageName}
3706
+ })
3707
+ export class ${moduleName} {}
3708
+ `;
3709
+ }
3676
3710
  return `import { Module } from "@kithinji/orca";
3677
3711
  import { ComponentModule } from "@/component/component.module";
3678
3712
  import { ${serviceName} } from "./${name}.service";
@@ -3683,7 +3717,7 @@ import { ${componentName} } from "./components/${name}-list.component";
3683
3717
  imports: [ComponentModule],
3684
3718
  providers: [${serviceName}],
3685
3719
  declarations: [${pageName}, ${componentName}],
3686
- exports: [${serviceName}, ${pageName}]
3720
+ exports: [${serviceName}, ${pageName}],
3687
3721
  })
3688
3722
  export class ${moduleName} {}
3689
3723
  `;
@@ -3940,7 +3974,7 @@ function addNew(name) {
3940
3974
  };
3941
3975
  createStructure(baseDir, structure);
3942
3976
  const appDir = path11.join(process.cwd(), name, "src", "app");
3943
- addModule("app", appDir);
3977
+ addModule("app", appDir, true);
3944
3978
  process.chdir(baseDir);
3945
3979
  addComponent("button");
3946
3980
  console.log(`App ${name} created successfully`);
@@ -4468,7 +4502,7 @@ function printNextSteps(projectName, env, services) {
4468
4502
 
4469
4503
  // src/main.ts
4470
4504
  var program = new Command();
4471
- program.name("pod").description("Pod cli tool").version("1.0.5");
4505
+ program.name("pod").description("Pod cli tool").version("1.0.7");
4472
4506
  program.command("new <name>").description("Start a new Pod Project").action(async (name) => {
4473
4507
  await addNew(name);
4474
4508
  const appDir = path13.resolve(process.cwd(), name);