g360-cli 1.4.0 → 1.6.0

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 (93) hide show
  1. package/README.md +122 -0
  2. package/package.json +11 -4
  3. package/src/assets/brand/brand.json +43 -0
  4. package/src/assets/brand/cipsa/logotypes/Logo_cipsa_borde.png +0 -0
  5. package/src/assets/brand/cipsa/logotypes/Logo_cipsa_borde.svg +9 -0
  6. package/src/assets/brand/cipsa/logotypes/Logo_cipsa_solid.png +0 -0
  7. package/src/assets/brand/cipsa/logotypes/Logo_cipsa_solid.svg +9 -0
  8. package/src/assets/brand/g360/logotypes/logo-g360-dark.svg +19 -0
  9. package/src/assets/brand/g360/logotypes/logo-g360-light.svg +19 -0
  10. package/src/assets/brand/g360/logotypes/logo_g360_dark_b64.txt +1 -0
  11. package/src/assets/brand/g360/logotypes/logo_g360_light_b64.txt +1 -0
  12. package/src/assets/config/g360-skills.json +60 -0
  13. package/src/assets/signature/g360_flet/__init__.py +5 -0
  14. package/src/assets/signature/g360_flet/__pycache__/__init__.cpython-312.pyc +0 -0
  15. package/src/assets/signature/g360_flet/__pycache__/__init__.cpython-314.pyc +0 -0
  16. package/src/assets/signature/g360_flet/__pycache__/g360_signature.cpython-312.pyc +0 -0
  17. package/src/assets/signature/g360_flet/__pycache__/g360_signature.cpython-314.pyc +0 -0
  18. package/src/assets/signature/g360_flet/g360_signature.py +224 -0
  19. package/src/assets/signature/index.js +130 -0
  20. package/src/assets/snippets/snippets.json +293 -101
  21. package/src/assets/templates/lit-web/src/core/skill.json +12 -5
  22. package/src/assets/templates/python-cli/build-portable.bat +19 -9
  23. package/src/assets/templates/python-cli/src/core/skill.json +25 -6
  24. package/src/assets/templates/python-customtkinter/README.md +32 -31
  25. package/src/assets/templates/python-customtkinter/assets/images/logo-g360-dark.svg +19 -0
  26. package/src/assets/templates/python-customtkinter/assets/images/logo-g360-light.svg +19 -0
  27. package/src/assets/templates/python-customtkinter/build.bat +50 -0
  28. package/src/assets/templates/python-customtkinter/pyproject.toml +26 -0
  29. package/src/assets/templates/python-customtkinter/run.bat +11 -20
  30. package/src/assets/templates/python-customtkinter/src/core/g360_theme.py +101 -0
  31. package/src/assets/templates/python-customtkinter/src/core/skill.json +23 -10
  32. package/src/assets/templates/python-customtkinter/src/main.py +61 -81
  33. package/src/assets/templates/python-flet/README.md +52 -93
  34. package/src/assets/templates/python-flet/assets/images/Logo_cipsa_borde.png +0 -0
  35. package/src/assets/templates/python-flet/assets/images/Logo_cipsa_borde.svg +9 -0
  36. package/src/assets/templates/python-flet/assets/images/Logo_cipsa_solid.png +0 -0
  37. package/src/assets/templates/python-flet/assets/images/Logo_cipsa_solid.svg +9 -0
  38. package/src/assets/templates/python-flet/assets/images/logo-g360-dark.svg +19 -0
  39. package/src/assets/templates/python-flet/assets/images/logo-g360-light.svg +19 -0
  40. package/src/assets/templates/python-flet/build.bat +36 -0
  41. package/src/assets/templates/python-flet/pyproject.toml +26 -0
  42. package/src/assets/templates/python-flet/run.bat +11 -72
  43. package/src/assets/templates/python-flet/src/core/__init__.py +0 -0
  44. package/src/assets/templates/python-flet/src/core/g360_theme.py +193 -0
  45. package/src/assets/templates/python-flet/src/core/skill.json +28 -8
  46. package/src/assets/templates/python-flet/src/export/__init__.py +0 -0
  47. package/src/assets/templates/python-flet/src/main.py +113 -68
  48. package/src/assets/templates/python-flet/src/test_app.py +41 -37
  49. package/src/assets/templates/python-flet/src/ui/__init__.py +0 -0
  50. package/src/assets/templates/python-flet-migrate/README.md +70 -0
  51. package/src/assets/templates/python-flet-migrate/assets/images/logo-g360-dark.svg +19 -0
  52. package/src/assets/templates/python-flet-migrate/assets/images/logo-g360-light.svg +19 -0
  53. package/src/assets/templates/python-flet-migrate/build.bat +36 -0
  54. package/src/assets/templates/python-flet-migrate/pyproject.toml +26 -0
  55. package/src/assets/templates/python-flet-migrate/run.bat +20 -0
  56. package/src/assets/templates/python-flet-migrate/src/core/__init__.py +0 -0
  57. package/src/assets/templates/python-flet-migrate/src/core/g360_theme.py +186 -0
  58. package/src/assets/templates/python-flet-migrate/src/core/skill.json +34 -0
  59. package/src/assets/templates/python-flet-migrate/src/main.py +71 -42
  60. package/src/assets/templates/solid-web/src/core/skill.json +12 -5
  61. package/src/assets/templates/svelte-web/src/core/skill.json +12 -5
  62. package/src/assets/templates/web-pwa/index.html +5 -7
  63. package/src/assets/templates/web-pwa/public/favicon.svg +4 -0
  64. package/src/assets/templates/web-pwa/public/manifest.json +11 -0
  65. package/src/assets/templates/web-pwa/src/App.jsx +22 -0
  66. package/src/assets/templates/web-pwa/src/components/FooterSignature.jsx +9 -0
  67. package/src/assets/templates/web-pwa/src/components/Header.jsx +12 -0
  68. package/src/assets/templates/web-pwa/src/components/LoadingOverlay.jsx +10 -0
  69. package/src/assets/templates/web-pwa/src/core/skill.json +25 -0
  70. package/src/assets/templates/web-pwa/src/main.jsx +9 -0
  71. package/src/assets/templates/web-pwa/src/styles/main.css +133 -0
  72. package/src/assets/templates/web-pwa/vite.config.js +12 -0
  73. package/src/cli.js +10 -5
  74. package/src/commands/bring.js +81 -6
  75. package/src/commands/list.js +79 -9
  76. package/src/commands/signature.js +252 -55
  77. package/src/lib/asset-validator.js +145 -0
  78. package/src/lib/auditor.js +48 -0
  79. package/src/lib/global-config.js +260 -0
  80. package/src/lib/i18n.js +238 -0
  81. package/src/lib/logger.js +100 -0
  82. package/src/lib/manifest.js +70 -1
  83. package/src/lib/validator.js +39 -0
  84. package/src/schemas/skills-schema.json +1 -0
  85. package/src/schemas/snippets-schema.json +1 -0
  86. package/dist/g360.exe +0 -0
  87. package/src/assets/templates/python-customtkinter/build-portable.bat +0 -28
  88. package/src/assets/templates/python-customtkinter/requirements.txt +0 -1
  89. package/src/assets/templates/python-flet/build-portable.bat +0 -42
  90. package/src/assets/templates/python-flet/create_shortcut.vbs +0 -35
  91. package/src/assets/templates/python-flet/requirements.txt +0 -3
  92. package/src/assets/templates/web-pwa/app.js +0 -1
  93. package/src/assets/templates/web-pwa/styles.css +0 -28
@@ -1,10 +1,37 @@
1
1
  import fs from 'fs-extra';
2
2
 
3
+ /**
4
+ * @typedef {Object} ValidationResult
5
+ * @property {boolean} valid - Indica si la validación fue exitosa
6
+ * @property {string[]} errors - Lista de errores encontrados
7
+ * @property {string[]} warnings - Lista de advertencias encontradas
8
+ */
9
+
10
+ /**
11
+ * Módulo de validación para proyectos G360
12
+ * @namespace validator
13
+ */
3
14
  export const validator = {
15
+ /**
16
+ * Valida si un nombre de proyecto es válido
17
+ * @param {string} name - Nombre del proyecto a validar
18
+ * @returns {boolean} true si el nombre es válido, false en caso contrario
19
+ * @example
20
+ * validator.isValidProjectName('my-project') // true
21
+ * validator.isValidProjectName('My-Project') // false
22
+ */
4
23
  isValidProjectName(name) {
5
24
  return /^[a-z0-9][a-z0-9-]*$/.test(name);
6
25
  },
7
26
 
27
+ /**
28
+ * Valida si una ruta existe en el sistema de archivos
29
+ * @param {string} path - Ruta a validar
30
+ * @returns {boolean} true si la ruta existe, false en caso contrario
31
+ * @example
32
+ * validator.isValidPath('/existing/path') // true
33
+ * validator.isValidPath('/non/existing') // false
34
+ */
8
35
  isValidPath(path) {
9
36
  try {
10
37
  return fs.existsSync(path);
@@ -13,6 +40,18 @@ export const validator = {
13
40
  }
14
41
  },
15
42
 
43
+ /**
44
+ * Valida si un directorio es un proyecto G360 válido
45
+ * @param {string} projectDir - Ruta del directorio del proyecto
46
+ * @returns {ValidationResult} Objeto con resultado de la validación
47
+ * @example
48
+ * const result = validator.validateProject('/my/project');
49
+ * if (result.valid) {
50
+ * console.log('Proyecto válido');
51
+ * } else {
52
+ * console.error('Errores:', result.errors);
53
+ * }
54
+ */
16
55
  validateProject(projectDir) {
17
56
  const errors = [];
18
57
  const warnings = [];
@@ -0,0 +1 @@
1
+ {"$schema":"http://json-schema.org/draft-07/schema#","properties":{"skills":{"items":{"properties":{"colors":{"properties":{"accent":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"bg":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"muted":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"surface":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"},"text":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"}},"required":["bg","surface","accent","text","muted"],"type":"object"},"description":{"minLength":1,"type":"string"},"device":{"enum":["pc","movil","both"],"type":"string"},"name":{"pattern":"^[a-z0-9-]+$","type":"string"},"signature":{"properties":{"mode":{"enum":["powered","own","optional","custom"],"type":"string"},"text":{"minLength":1,"type":"string"}},"required":["mode","text"],"type":"object"}},"required":["name","description","device","colors","signature"],"type":"object"},"type":"array"}},"required":["skills"],"title":"G360 Skills Configuration","type":"object"}
@@ -0,0 +1 @@
1
+ {"$schema":"http://json-schema.org/draft-07/schema#","properties":{"snippets":{"items":{"properties":{"code":{"minLength":1,"type":"string"},"description":{"minLength":1,"type":"string"},"language":{"minLength":1,"type":"string"},"name":{"pattern":"^[a-z0-9-]+$","type":"string"}},"required":["name","description","code"],"type":"object"},"type":"array"}},"required":["snippets"],"title":"G360 Snippets Configuration","type":"object"}
package/dist/g360.exe DELETED
Binary file
@@ -1,28 +0,0 @@
1
- @echo off
2
- chcp 65001 >nul
3
- title G360 - Portable CustomTkinter
4
-
5
- echo.
6
- echo ==============================================
7
- echo G360 CustomTkinter - Portable
8
- echo (Requires Python installed)
9
- echo ==============================================
10
- echo.
11
-
12
- python --version >nul 2>&1
13
- if errorlevel 1 (
14
- echo ERROR: Python no encontrado
15
- pause
16
- exit /b 1
17
- )
18
-
19
- pip show customtkinter >nul 2>&1
20
- if errorlevel 1 (
21
- pip install customtkinter
22
- )
23
-
24
- echo.
25
- echo Ejecutando G360 App...
26
- python src\main.py
27
-
28
- pause
@@ -1 +0,0 @@
1
- customtkinter>=5.2.0
@@ -1,42 +0,0 @@
1
- @echo off
2
- chcp 65001 >nul
3
- title G360 - Portable Flet App
4
-
5
- echo.
6
- echo ==============================================
7
- echo G360 Flet - Portable Version
8
- echo (Requires Python + flet installed)
9
- echo ==============================================
10
- echo.
11
-
12
- python --version >nul 2>&1
13
- if errorlevel 1 (
14
- echo ERROR: Python no encontrado
15
- echo Instala Python desde: https://python.org
16
- pause
17
- exit /b 1
18
- )
19
-
20
- echo Verificando flet...
21
- pip show flet >nul 2>&1
22
- if errorlevel 1 (
23
- echo Flet no encontrado. Instalando...
24
- pip install flet
25
- if errorlevel 1 (
26
- echo ERROR: No se pudo instalar flet
27
- pause
28
- exit /b 1
29
- )
30
- )
31
-
32
- if not exist "src\main.py" (
33
- echo ERROR: src\main.py no encontrado
34
- pause
35
- exit /b 1
36
- )
37
-
38
- echo.
39
- echo Ejecutando G360 Flet App...
40
- python src\main.py %*
41
-
42
- pause
@@ -1,35 +0,0 @@
1
- Set objShell = CreateObject("WScript.Shell")
2
- Set objFSO = CreateObject("Scripting.FileSystemObject")
3
-
4
- strCurrentPath = objFSO.GetParentFolderName(WScript.ScriptFullName)
5
- strDesktop = objShell.SpecialFolders("Desktop")
6
-
7
- strExePath = strCurrentPath & "\dist\G360App-Portable.exe"
8
- strBatPath = strCurrentPath & "\run.bat"
9
- strIconPath = strCurrentPath & "\assets\images\app.ico"
10
-
11
- targetPath = strExePath
12
- if not objFSO.FileExists(strExePath) Then
13
- targetPath = strBatPath
14
- End If
15
-
16
- appName = "G360 App"
17
-
18
- If objFSO.FileExists(strDesktop & "\" & appName & ".lnk") Then
19
- objFSO.DeleteFile strDesktop & "\" & appName & ".lnk", True
20
- End If
21
-
22
- Set objShortcut = objShell.CreateShortcut(strDesktop & "\" & appName & ".lnk")
23
- objShortcut.TargetPath = targetPath
24
- objShortcut.WorkingDirectory = strCurrentPath
25
- objShortcut.Description = "G360 Desktop Application"
26
-
27
- If objFSO.FileExists(strIconPath) Then
28
- objShortcut.IconLocation = strIconPath & ", 0"
29
- Else
30
- objShortcut.IconLocation = "%SystemRoot%\system32\shell32.dll, 15"
31
- End If
32
-
33
- objShortcut.Save
34
-
35
- objShell.Run "ie4uinit.exe -show", 0, True
@@ -1,3 +0,0 @@
1
- flet>=0.21.0
2
- pytest>=7.0.0
3
- pytest-cov>=4.0.0
@@ -1 +0,0 @@
1
- console.log('G360 Project initialized');
@@ -1,28 +0,0 @@
1
- :root {
2
- --g360-primary: #3B82F6;
3
- --g360-secondary: #10B981;
4
- --g360-accent: #8B5CF6;
5
- --g360-bg: #ffffff;
6
- --g360-text: #1f2937;
7
- }
8
-
9
- * { box-sizing: border-box; margin: 0; padding: 0; }
10
-
11
- body {
12
- font-family: system-ui, sans-serif;
13
- background: var(--g360-bg);
14
- color: var(--g360-text);
15
- line-height: 1.6;
16
- }
17
-
18
- .g360-header {
19
- background: var(--g360-primary);
20
- color: white;
21
- padding: 1rem 2rem;
22
- }
23
-
24
- .g360-footer {
25
- text-align: center;
26
- padding: 1rem;
27
- color: #6b7280;
28
- }