slicejs-cli 1.0.52 → 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.
@@ -61,8 +61,8 @@ export default class Controller {
61
61
  return component;
62
62
  }
63
63
 
64
- getComponentCategory(componentSliceId) {
65
- return this.componentCategories.get(componentSliceId);
64
+ getComponentCategory(componentName) {
65
+ return this.componentCategories.get(componentName);
66
66
  }
67
67
 
68
68
  async fetchText(componentName, fileType) {
@@ -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, properties);
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
- fs.writeFileSync(`${componentDir}/${className}.css`, '');
67
- fs.writeFileSync(`${componentDir}/${className}.html`, '');
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;
@@ -29,6 +29,8 @@ function deleteComponent(componentName, category) {
29
29
  //PARA DEVELOPERS
30
30
  // ../../../../Slice/Components
31
31
 
32
+
33
+
32
34
  // Construir la ruta del directorio del componente
33
35
  let componentDir = path.join(__dirname, '../../../../src/Components', category, componentName);
34
36
  componentDir = componentDir.slice(1);
@@ -27,11 +27,11 @@ function modifyComponent(componentName, category, addProperties, removePropertie
27
27
 
28
28
  category = flagCategory.category;
29
29
 
30
- const componentDir = path.join(__dirname, '../../../../Slice/Components', category, componentName);
31
- const fileName = `${componentName}.js`;
30
+ let componentDir = path.join(__dirname, '../../../../src/Components', category, componentName);
31
+ componentDir = componentDir.slice(1);
32
32
 
33
- let componentPath = path.join(componentDir, fileName);
34
- componentPath=componentPath.slice(1);
33
+ // let componentPath = path.join(componentDir, fileName);
34
+ //componentPath=componentPath.slice(1);
35
35
 
36
36
  if (!fs.existsSync(componentPath)) {
37
37
  Print.error(`Component '${componentName}' does not exist.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slicejs-cli",
3
- "version": "1.0.52",
3
+ "version": "1.0.54",
4
4
  "description": "Command client for developing web applications with Slice.js framework",
5
5
  "main": "client.js",
6
6
  "scripts": {