@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 +41 -7
- package/dist/main.js.map +2 -2
- package/dist/types/add/module/module.d.ts +1 -1
- package/dist/types/add/module/module.d.ts.map +1 -1
- package/dist/types/plugins/css/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/add/module/module.ts +28 -4
- package/src/add/new/index.ts +1 -1
- package/src/main.ts +1 -1
- package/src/plugins/css/index.ts +12 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../src/add/module/module.ts"],"names":[],"mappings":"AAKA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,QAQtC;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../src/add/module/module.ts"],"names":[],"mappings":"AAKA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,QAQtC;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,QA8CtE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/css/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK;;iBAGvB,WAAW;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/css/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK;;iBAGvB,WAAW;EA4B3B"}
|
package/package.json
CHANGED
package/src/add/module/module.ts
CHANGED
|
@@ -13,10 +13,10 @@ export function addFeature(name: string) {
|
|
|
13
13
|
updateAppModule(name);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export function addModule(name: string, baseDir: string) {
|
|
16
|
+
export function addModule(name: string, baseDir: string, root?: boolean) {
|
|
17
17
|
const structure: DirEntry = {
|
|
18
18
|
files: [
|
|
19
|
-
{ name: `${name}.module.ts`, content: createModule(name) },
|
|
19
|
+
{ name: `${name}.module.ts`, content: createModule(name, root) },
|
|
20
20
|
{ name: `${name}.service.ts`, content: createService(name) },
|
|
21
21
|
{ name: `${name}.page.tsx`, content: createPage(name) },
|
|
22
22
|
],
|
|
@@ -266,12 +266,36 @@ function addToModuleImportsArray(
|
|
|
266
266
|
);
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
function createModule(name: string) {
|
|
269
|
+
function createModule(name: string, root?: boolean) {
|
|
270
270
|
const serviceName = toPascalCase(name + "_" + "Service");
|
|
271
271
|
const pageName = toPascalCase(name + "_" + "Page");
|
|
272
272
|
const moduleName = toPascalCase(name + "_" + "Module");
|
|
273
273
|
const componentName = toPascalCase(name + "_" + "List");
|
|
274
274
|
|
|
275
|
+
if (root) {
|
|
276
|
+
return `import { Module, RouterModule, ServeStaticModule } from "@kithinji/orca";
|
|
277
|
+
import { ComponentModule } from "@/component/component.module";
|
|
278
|
+
import { ${serviceName} } from "./${name}.service";
|
|
279
|
+
import { ${pageName} } from "./${name}.page";
|
|
280
|
+
import { ${componentName} } from "./components/${name}-list.component";
|
|
281
|
+
|
|
282
|
+
@Module({
|
|
283
|
+
imports: [
|
|
284
|
+
ServeStaticModule.forRoot({
|
|
285
|
+
rootPath: "./public",
|
|
286
|
+
}),
|
|
287
|
+
RouterModule.forRoot(),
|
|
288
|
+
ComponentModule
|
|
289
|
+
],
|
|
290
|
+
providers: [${serviceName}],
|
|
291
|
+
declarations: [${pageName}, ${componentName}],
|
|
292
|
+
exports: [${serviceName}, ${pageName}],
|
|
293
|
+
bootstrap: ${pageName}
|
|
294
|
+
})
|
|
295
|
+
export class ${moduleName} {}
|
|
296
|
+
`;
|
|
297
|
+
}
|
|
298
|
+
|
|
275
299
|
return `import { Module } from "@kithinji/orca";
|
|
276
300
|
import { ComponentModule } from "@/component/component.module";
|
|
277
301
|
import { ${serviceName} } from "./${name}.service";
|
|
@@ -282,7 +306,7 @@ import { ${componentName} } from "./components/${name}-list.component";
|
|
|
282
306
|
imports: [ComponentModule],
|
|
283
307
|
providers: [${serviceName}],
|
|
284
308
|
declarations: [${pageName}, ${componentName}],
|
|
285
|
-
exports: [${serviceName}, ${pageName}]
|
|
309
|
+
exports: [${serviceName}, ${pageName}],
|
|
286
310
|
})
|
|
287
311
|
export class ${moduleName} {}
|
|
288
312
|
`;
|
package/src/add/new/index.ts
CHANGED
package/src/main.ts
CHANGED
package/src/plugins/css/index.ts
CHANGED
|
@@ -18,7 +18,18 @@ export function stylePlugin(store: Store) {
|
|
|
18
18
|
const uniqueRules = [...new Set(allRules)];
|
|
19
19
|
|
|
20
20
|
const cssOutput = uniqueRules.join("\n");
|
|
21
|
-
fs.writeFileSync(
|
|
21
|
+
fs.writeFileSync(
|
|
22
|
+
"public/index.css",
|
|
23
|
+
`html {
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
*, *::before, *::after {
|
|
28
|
+
box-sizing: inherit;
|
|
29
|
+
}
|
|
30
|
+
${cssOutput}
|
|
31
|
+
`
|
|
32
|
+
);
|
|
22
33
|
});
|
|
23
34
|
},
|
|
24
35
|
};
|