slicejs-cli 1.0.53 → 1.0.54
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.
|
@@ -7,7 +7,7 @@ import Validations from '../Validations.js';
|
|
|
7
7
|
import Print from '../Print.js';
|
|
8
8
|
const __dirname = path.dirname(new URL(import.meta.url).pathname);
|
|
9
9
|
|
|
10
|
-
function createComponent(componentName, category, properties) {
|
|
10
|
+
function createComponent(componentName, category, properties, methods) {
|
|
11
11
|
|
|
12
12
|
if (!componentName) {
|
|
13
13
|
Print.error('Component name is required');
|
|
@@ -38,7 +38,7 @@ function createComponent(componentName, category, properties) {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
if(category==='Service'){
|
|
41
|
-
template = componentTemplates.service(className,
|
|
41
|
+
template = componentTemplates.service(className, methods);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
//RUTA PARA CUANDO SE COLOQUE DE USUARIO
|
|
@@ -63,8 +63,11 @@ function createComponent(componentName, category, properties) {
|
|
|
63
63
|
|
|
64
64
|
// Escribir el código del componente en el archivo
|
|
65
65
|
fs.writeFileSync(componentPath, template);
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
|
|
67
|
+
if(category==='Visual'){
|
|
68
|
+
fs.writeFileSync(`${componentDir}/${className}.css`, '');
|
|
69
|
+
fs.writeFileSync(`${componentDir}/${className}.html`, `<div>${componentName}</div>`);
|
|
70
|
+
}
|
|
68
71
|
|
|
69
72
|
Print.success(`Component '${componentName}' created successfully.`);
|
|
70
73
|
return true;
|