slicejs-cli 1.0.36 → 1.0.38

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 (31) hide show
  1. package/PROJECT_TEMPLATES/Basic/Slice/Components/components.js +12 -0
  2. package/PROJECT_TEMPLATES/Basic/src/Views/LandingPage/index.html +18 -0
  3. package/PROJECT_TEMPLATES/Basic/src/Views/LandingPage/index.js +23 -0
  4. package/PROJECT_TEMPLATES/Basic/src/Views/LandingPage/style.css +0 -0
  5. package/client.js +3 -6
  6. package/commands/createComponent/createComponent.js +1 -0
  7. package/commands/deleteComponent/deleteComponent.js +1 -0
  8. package/package.json +2 -2
  9. /package/PROJECT_TEMPLATES/Basic/{Components → Slice/Components}/Provider/TestProvider/TestProvider.js +0 -0
  10. /package/PROJECT_TEMPLATES/Basic/{Components → Slice/Components}/Service/FetchManager/FetchManager.js +0 -0
  11. /package/PROJECT_TEMPLATES/Basic/{Components → Slice/Components}/Service/IndexedDbManager/IndexedDbManager.js +0 -0
  12. /package/PROJECT_TEMPLATES/Basic/{Components → Slice/Components}/Service/LocalStorageManager/LocalStorageManager.js +0 -0
  13. /package/PROJECT_TEMPLATES/Basic/{Components → Slice/Components}/Service/Translator/Translator.js +0 -0
  14. /package/PROJECT_TEMPLATES/Basic/{Components → Slice/Components}/Structural/Controller/Controller.js +0 -0
  15. /package/PROJECT_TEMPLATES/Basic/{Components → Slice/Components}/Structural/Debugger/Debugger.css +0 -0
  16. /package/PROJECT_TEMPLATES/Basic/{Components → Slice/Components}/Structural/Debugger/Debugger.html +0 -0
  17. /package/PROJECT_TEMPLATES/Basic/{Components → Slice/Components}/Structural/Debugger/Debugger.js +0 -0
  18. /package/PROJECT_TEMPLATES/Basic/{Components → Slice/Components}/Structural/Logger/Log.js +0 -0
  19. /package/PROJECT_TEMPLATES/Basic/{Components → Slice/Components}/Structural/Logger/Logger.js +0 -0
  20. /package/PROJECT_TEMPLATES/Basic/{Components → Slice/Components}/Structural/StylesManager/CustomStylesManager/CustomStylesManager.js +0 -0
  21. /package/PROJECT_TEMPLATES/Basic/{Components → Slice/Components}/Structural/StylesManager/StylesManager.js +0 -0
  22. /package/PROJECT_TEMPLATES/Basic/{Components → Slice/Components}/Structural/StylesManager/ThemeManager/ThemeManager.js +0 -0
  23. /package/PROJECT_TEMPLATES/Basic/{Components → Slice/Components}/Visual/TestComponent/TestComponent.css +0 -0
  24. /package/PROJECT_TEMPLATES/Basic/{Components → Slice/Components}/Visual/TestComponent/TestComponent.html +0 -0
  25. /package/PROJECT_TEMPLATES/Basic/{Components → Slice/Components}/Visual/TestComponent/TestComponent.js +0 -0
  26. /package/PROJECT_TEMPLATES/Basic/{Slice.js → Slice/Slice.js} +0 -0
  27. /package/PROJECT_TEMPLATES/Basic/{Styles → Slice/Styles}/Custom/custom.css +0 -0
  28. /package/PROJECT_TEMPLATES/Basic/{Themes → Slice/Themes}/Dark.css +0 -0
  29. /package/PROJECT_TEMPLATES/Basic/{Themes → Slice/Themes}/Light.css +0 -0
  30. /package/PROJECT_TEMPLATES/Basic/{Themes → Slice/Themes}/Slice.css +0 -0
  31. /package/PROJECT_TEMPLATES/Basic/{sliceConfig.json → Slice/sliceConfig.json} +0 -0
@@ -0,0 +1,12 @@
1
+ const components = {
2
+ "TestComponent": "Visual",
3
+ "FetchManager": "Service",
4
+ "IndexedDbManager": "Service",
5
+ "LocalStorageManager": "Service",
6
+ "Translator": "Service",
7
+ "TestProvider": "Provider",
8
+ "Controller": "Structural",
9
+ "Debugger": "Structural",
10
+ "Logger": "Structural",
11
+ "StylesManager": "Structural"
12
+ }; export default components;
@@ -0,0 +1,18 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>Document</title>
8
+ <link rel="stylesheet" href="style.css">
9
+ </head>
10
+
11
+ <body>
12
+ <div>Slice web Framework</div>
13
+ <button id="boton"></button>
14
+ <script src="../../../Slice/Slice.js" type="module"></script>
15
+ <script src="index.js" type="module"></script>
16
+ </body>
17
+
18
+ </html>
@@ -0,0 +1,23 @@
1
+ const boton = document.getElementById("boton");
2
+
3
+ let theme = "Light";
4
+ await slice.stylesManager.setTheme("Light");
5
+ boton.innerHTML = "Cambiar al tema Dark";
6
+
7
+ boton.addEventListener("click", async () => {
8
+ if (theme === "Slice") {
9
+ await slice.stylesManager.setTheme("Light");
10
+ theme = "Light";
11
+ boton.innerHTML = "Cambiar al tema Dark";
12
+ } else if (theme === "Light") {
13
+ await slice.stylesManager.setTheme("Dark");
14
+ theme = "Dark";
15
+ boton.innerHTML = "Cambiar al tema Slice";
16
+ } else if (theme === "Dark") {
17
+ await slice.stylesManager.setTheme("Slice");
18
+ theme = "Slice";
19
+ boton.innerHTML = "Cambiar al tema Light";
20
+ }
21
+ // console.log(theme);
22
+ });
23
+
package/client.js CHANGED
@@ -27,9 +27,7 @@ sliceClient
27
27
  .action((componentName, options) => {
28
28
  const { Category, Properties } = options;
29
29
  const propertiesList = Properties ? Properties.split(',') : [];
30
- createComponent(componentName, Category, propertiesList);
31
- listComponents();
32
-
30
+ if( createComponent(componentName, Category, propertiesList)) listComponents();
33
31
  });
34
32
 
35
33
  // Comando para modificar un componente
@@ -43,7 +41,7 @@ sliceClient
43
41
  const { Add, Remove,Category } = options;
44
42
  const addProperties = Add ? Add.split(',') : [];
45
43
  const removeProperties = Remove ? Remove.split(',') : [];
46
- modifyComponent(componentName,Category, addProperties, removeProperties);
44
+ modifyComponent(componentName,Category, addProperties, removeProperties)
47
45
  });
48
46
 
49
47
  sliceClient.command('delete <componentName>')
@@ -51,8 +49,7 @@ sliceClient
51
49
  .option('-category <category>', 'Component category')
52
50
  .action((componentName, options) => {
53
51
  const { Category } = options;
54
- deleteComponent(componentName, Category);
55
- listComponents();
52
+ if(deleteComponent(componentName, Category)) listComponents();
56
53
  });
57
54
 
58
55
  // Comando para listar todos los componentes
@@ -56,6 +56,7 @@ function createComponent(componentName, category, properties) {
56
56
  fs.writeFileSync(`${componentDir}/${className}.html`, '');
57
57
 
58
58
  Print.success(`Component '${componentName}' created successfully.`);
59
+ return true;
59
60
  }
60
61
 
61
62
 
@@ -37,6 +37,7 @@ function deleteComponent(componentName, category) {
37
37
  fs.removeSync(componentDir);
38
38
 
39
39
  Print.success(`Component '${componentName}' deleted successfully.`);
40
+ return true;
40
41
  }
41
42
 
42
43
  export default deleteComponent;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "slicejs-cli",
3
- "version": "1.0.36",
4
- "description": "Command client for developing web applications with Slice.js",
3
+ "version": "1.0.38",
4
+ "description": "Command client for developing web applications with Slice.js framework",
5
5
  "main": "client.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1",