g360-cli 1.11.0 → 1.13.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.
- package/README.md +279 -30
- package/package.json +3 -1
- package/src/assets/brand/brand.json +34 -12
- package/src/assets/brand/cipsa/favicons/apple-touch-icon.png +0 -0
- package/src/assets/brand/cipsa/favicons/cipsa.ico +0 -0
- package/src/assets/brand/cipsa/favicons/favicon-16x16.png +0 -0
- package/src/assets/brand/cipsa/favicons/favicon-32x32.png +0 -0
- package/src/assets/brand/cipsa/favicons/favicon.ico +0 -0
- package/src/assets/brand/cipsa/favicons/favicon.svg +9 -0
- package/src/assets/brand/cipsa/logotypes/Logo_cipsa_borde.svg +1 -8
- package/src/assets/brand/cipsa/logotypes/Logo_cipsa_solid.svg +1 -8
- package/src/assets/brand/cipsa/pwa/icon-192.png +0 -0
- package/src/assets/brand/cipsa/pwa/icon-512.png +0 -0
- package/src/assets/brand/cipsa/pwa/icon-cipsa.png +0 -0
- package/src/assets/brand/g360/favicons/apple-touch-icon.png +0 -0
- package/src/assets/brand/g360/favicons/favicon-16x16.png +0 -0
- package/src/assets/brand/g360/favicons/favicon-32x32.png +0 -0
- package/src/assets/brand/g360/favicons/favicon.ico +0 -0
- package/src/assets/brand/g360/favicons/favicon.svg +17 -0
- package/src/assets/brand/g360/logotypes/logo-g360-dark.svg +1 -19
- package/src/assets/brand/g360/logotypes/logo-g360-light.svg +1 -19
- package/src/assets/brand/g360/pwa/icon-192.png +0 -0
- package/src/assets/brand/g360/pwa/icon-512.png +0 -0
- package/src/assets/brand/g360/pwa/icon-g360.png +0 -0
- package/src/assets/config/g360-skills.json +1 -1
- package/src/assets/templates/ARCHITECTURE.md +50 -0
- package/src/assets/templates/lit-web/README.md +47 -0
- package/src/assets/templates/lit-web/public/favicon.svg +17 -0
- package/src/assets/templates/python-cli/README.md +47 -0
- package/src/assets/templates/python-customtkinter/README.md +45 -34
- package/src/assets/templates/python-flet/README.md +46 -66
- package/src/assets/templates/python-flet-migrate/README.md +35 -55
- package/src/assets/templates/solid-web/README.md +47 -0
- package/src/assets/templates/solid-web/public/favicon.svg +17 -0
- package/src/assets/templates/svelte-web/README.md +47 -0
- package/src/assets/templates/svelte-web/static/favicon.svg +17 -0
- package/src/assets/templates/web-pwa/README.md +47 -0
- package/src/cli.js +16 -0
- package/src/commands/bring.js +84 -0
- package/src/commands/clean.js +2 -23
- package/src/commands/convert.js +1 -23
- package/src/commands/docs.js +815 -0
- package/src/commands/init.js +46 -4
- package/src/commands/lint.js +578 -0
- package/src/lib/file-utils.js +27 -0
- package/src/assets/brand/g360/logotypes/logo_g360_dark_b64.txt +0 -1
- package/src/assets/brand/g360/logotypes/logo_g360_light_b64.txt +0 -1
- package/src/lib/global-config.js +0 -260
- package/src/lib/i18n.js +0 -238
- package/src/lib/python_runner.js +0 -89
|
@@ -1,70 +1,50 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Mi Proyecto G360 Migracion
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="g360/brand/g360/logotypes/logo-g360-light.svg">
|
|
5
|
+
<img alt="G360" height="64" src="g360/brand/g360/logotypes/logo-g360-dark.svg">
|
|
6
|
+
</picture>
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
> Migracion de tkinter/CustomTkinter a Flet con el ecosistema G360
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
│ ├── core/
|
|
13
|
-
│ │ ├── skill.json # Configuracion del skill G360
|
|
14
|
-
│ │ └── g360_theme.py # Theme engine
|
|
15
|
-
├── assets/
|
|
16
|
-
│ └── images/
|
|
17
|
-
├── skill.json # Skill G360 aplicado
|
|
18
|
-
├── pyproject.toml # Dependencias
|
|
19
|
-
├── run.bat # Ejecutar app
|
|
20
|
-
├── build.bat # Build EXE standalone
|
|
21
|
-
└── README.md
|
|
10
|
+
## Quick Start
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
uv sync
|
|
14
|
+
uv run python src/main.py
|
|
22
15
|
```
|
|
23
16
|
|
|
24
|
-
##
|
|
17
|
+
## Estructura del Proyecto
|
|
25
18
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
```mermaid
|
|
20
|
+
flowchart TD
|
|
21
|
+
UI["UI<br/>Flet widgets"]
|
|
22
|
+
Migrate["Migration<br/>migrate_tkinter.py"]
|
|
23
|
+
Core["Core<br/>business logic"]
|
|
24
|
+
Theme["Theme<br/>G360Theme"]
|
|
31
25
|
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
UI --> Core
|
|
27
|
+
UI --> Theme
|
|
28
|
+
Migrate --> UI
|
|
34
29
|
```
|
|
35
30
|
|
|
36
|
-
|
|
37
|
-
| tkinter | Flet |
|
|
38
|
-
|---------|------|
|
|
39
|
-
| `tk.Button` | `ft.ElevatedButton` |
|
|
40
|
-
| `tk.Entry` | `ft.TextField` |
|
|
41
|
-
| `tk.Label` | `ft.Text` |
|
|
42
|
-
| `tk.Frame` | `ft.Container` |
|
|
43
|
-
| `ttk.Treeview` | `ft.DataTable` |
|
|
44
|
-
| `messagebox` | `ft.AlertDialog` |
|
|
31
|
+
## Identidad de Marca
|
|
45
32
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
self._setup_page()
|
|
53
|
-
|
|
54
|
-
def _setup_page(self):
|
|
55
|
-
self.page.title = self.theme.build_name()
|
|
56
|
-
self.page.theme_mode = ft.ThemeMode.DARK
|
|
57
|
-
self.page.bgcolor = self.theme.bg
|
|
58
|
-
```
|
|
33
|
+
| Elemento | Valor |
|
|
34
|
+
|---|---|
|
|
35
|
+
| Marca | G360 |
|
|
36
|
+
| Color primario | `#00d084` |
|
|
37
|
+
| Signature mode | `powered` |
|
|
38
|
+
| Signature text | "powered by G360" |
|
|
59
39
|
|
|
60
|
-
##
|
|
40
|
+
## Footer
|
|
61
41
|
|
|
62
|
-
```
|
|
63
|
-
|
|
42
|
+
```python
|
|
43
|
+
from core.components.g360_signature import g360_footer
|
|
44
|
+
page.add(g360_footer())
|
|
64
45
|
```
|
|
65
46
|
|
|
66
|
-
|
|
47
|
+
---
|
|
67
48
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
```
|
|
49
|
+
**Marca**: G360 · **Isotipo**: 3 puntos + chevron `>`
|
|
50
|
+
**Signature**: powered by G360 · **Powered by**: [g360-signature](https://github.com/carloscus/g360-signature)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Mi Proyecto G360
|
|
2
|
+
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="g360/brand/g360/logotypes/logo-g360-light.svg">
|
|
5
|
+
<img alt="G360" height="64" src="g360/brand/g360/logotypes/logo-g360-dark.svg">
|
|
6
|
+
</picture>
|
|
7
|
+
|
|
8
|
+
> Aplicacion web G360 con SolidJS
|
|
9
|
+
|
|
10
|
+
## Quick Start
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install
|
|
14
|
+
npm run dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Estructura del Proyecto
|
|
18
|
+
|
|
19
|
+
```mermaid
|
|
20
|
+
flowchart TD
|
|
21
|
+
Frontend["Frontend<br/>SolidJS"]
|
|
22
|
+
Assets["Assets<br/>brand · signature · favicon"]
|
|
23
|
+
Config["Config<br/>skill.json"]
|
|
24
|
+
|
|
25
|
+
Frontend --> Assets
|
|
26
|
+
Frontend --> Config
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Identidad de Marca
|
|
30
|
+
|
|
31
|
+
| Elemento | Valor |
|
|
32
|
+
|---|---|
|
|
33
|
+
| Marca | G360 |
|
|
34
|
+
| Color primario | `#00d084` |
|
|
35
|
+
| Signature mode | `powered` |
|
|
36
|
+
| Signature text | "powered by G360" |
|
|
37
|
+
|
|
38
|
+
## Footer
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<g360-signature mode="powered"></g360-signature>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
**Marca**: G360 · **Isotipo**: 3 puntos + chevron `>`
|
|
47
|
+
**Signature**: powered by G360 · **Powered by**: [g360-signature](https://github.com/carloscus/g360-signature)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<svg width="64" height="64" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<defs>
|
|
3
|
+
<filter id="favicon-glow" x="-40%" y="-40%" width="180%" height="180%">
|
|
4
|
+
<feGaussianBlur stdDeviation="2" result="blur" />
|
|
5
|
+
<feFlood flood-color="#00d084" flood-opacity="0.8" result="glowColor"/>
|
|
6
|
+
<feComposite in="glowColor" in2="blur" operator="in" result="softGlow"/>
|
|
7
|
+
<feMerge>
|
|
8
|
+
<feMergeNode in="softGlow"/>
|
|
9
|
+
<feMergeNode in="SourceGraphic"/>
|
|
10
|
+
</feMerge>
|
|
11
|
+
</filter>
|
|
12
|
+
</defs>
|
|
13
|
+
<circle cx="15" cy="15" r="4" fill="#94a3b8" />
|
|
14
|
+
<circle cx="15" cy="32" r="6" fill="#00d084" filter="url(#favicon-glow)" />
|
|
15
|
+
<circle cx="15" cy="49" r="4" fill="#94a3b8" />
|
|
16
|
+
<path d="M35 15 L 50 32 L 35 49" fill="none" stroke="#00d084" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" filter="url(#favicon-glow)"/>
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Mi Proyecto G360
|
|
2
|
+
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="g360/brand/g360/logotypes/logo-g360-light.svg">
|
|
5
|
+
<img alt="G360" height="64" src="g360/brand/g360/logotypes/logo-g360-dark.svg">
|
|
6
|
+
</picture>
|
|
7
|
+
|
|
8
|
+
> Aplicacion web G360 con SvelteKit
|
|
9
|
+
|
|
10
|
+
## Quick Start
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install
|
|
14
|
+
npm run dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Estructura del Proyecto
|
|
18
|
+
|
|
19
|
+
```mermaid
|
|
20
|
+
flowchart TD
|
|
21
|
+
Frontend["Frontend<br/>SvelteKit"]
|
|
22
|
+
Assets["Assets<br/>brand · signature · favicon"]
|
|
23
|
+
Config["Config<br/>skill.json"]
|
|
24
|
+
|
|
25
|
+
Frontend --> Assets
|
|
26
|
+
Frontend --> Config
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Identidad de Marca
|
|
30
|
+
|
|
31
|
+
| Elemento | Valor |
|
|
32
|
+
|---|---|
|
|
33
|
+
| Marca | G360 |
|
|
34
|
+
| Color primario | `#00d084` |
|
|
35
|
+
| Signature mode | `powered` |
|
|
36
|
+
| Signature text | "powered by G360" |
|
|
37
|
+
|
|
38
|
+
## Footer
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<g360-signature mode="powered"></g360-signature>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
**Marca**: G360 · **Isotipo**: 3 puntos + chevron `>`
|
|
47
|
+
**Signature**: powered by G360 · **Powered by**: [g360-signature](https://github.com/carloscus/g360-signature)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<svg width="64" height="64" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<defs>
|
|
3
|
+
<filter id="favicon-glow" x="-40%" y="-40%" width="180%" height="180%">
|
|
4
|
+
<feGaussianBlur stdDeviation="2" result="blur" />
|
|
5
|
+
<feFlood flood-color="#00d084" flood-opacity="0.8" result="glowColor"/>
|
|
6
|
+
<feComposite in="glowColor" in2="blur" operator="in" result="softGlow"/>
|
|
7
|
+
<feMerge>
|
|
8
|
+
<feMergeNode in="softGlow"/>
|
|
9
|
+
<feMergeNode in="SourceGraphic"/>
|
|
10
|
+
</feMerge>
|
|
11
|
+
</filter>
|
|
12
|
+
</defs>
|
|
13
|
+
<circle cx="15" cy="15" r="4" fill="#94a3b8" />
|
|
14
|
+
<circle cx="15" cy="32" r="6" fill="#00d084" filter="url(#favicon-glow)" />
|
|
15
|
+
<circle cx="15" cy="49" r="4" fill="#94a3b8" />
|
|
16
|
+
<path d="M35 15 L 50 32 L 35 49" fill="none" stroke="#00d084" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" filter="url(#favicon-glow)"/>
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Mi Proyecto G360
|
|
2
|
+
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="g360/brand/g360/logotypes/logo-g360-light.svg">
|
|
5
|
+
<img alt="G360" height="64" src="g360/brand/g360/logotypes/logo-g360-dark.svg">
|
|
6
|
+
</picture>
|
|
7
|
+
|
|
8
|
+
> Aplicacion web G360 con React + Vite + PWA
|
|
9
|
+
|
|
10
|
+
## Quick Start
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install
|
|
14
|
+
npm run dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Estructura del Proyecto
|
|
18
|
+
|
|
19
|
+
```mermaid
|
|
20
|
+
flowchart TD
|
|
21
|
+
Frontend["Frontend<br/>React + Vite"]
|
|
22
|
+
Assets["Assets<br/>brand · signature · favicon"]
|
|
23
|
+
Config["Config<br/>skill.json"]
|
|
24
|
+
|
|
25
|
+
Frontend --> Assets
|
|
26
|
+
Frontend --> Config
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Identidad de Marca
|
|
30
|
+
|
|
31
|
+
| Elemento | Valor |
|
|
32
|
+
|---|---|
|
|
33
|
+
| Marca | G360 |
|
|
34
|
+
| Color primario | `#00d084` |
|
|
35
|
+
| Signature mode | `powered` |
|
|
36
|
+
| Signature text | "powered by G360" |
|
|
37
|
+
|
|
38
|
+
## Footer
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<g360-signature mode="powered"></g360-signature>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
**Marca**: G360 · **Isotipo**: 3 puntos + chevron `>`
|
|
47
|
+
**Signature**: powered by G360 · **Powered by**: [g360-signature](https://github.com/carloscus/g360-signature)
|
package/src/cli.js
CHANGED
|
@@ -20,6 +20,8 @@ import { scan } from './commands/scan.js';
|
|
|
20
20
|
import { validate } from './commands/validate.js';
|
|
21
21
|
import { ingest } from './commands/ingest.js';
|
|
22
22
|
import { addon } from './commands/addon.js';
|
|
23
|
+
import { docs } from './commands/docs.js';
|
|
24
|
+
import { lint } from './commands/lint.js';
|
|
23
25
|
|
|
24
26
|
// Comando config (no requiere archivo separado)
|
|
25
27
|
function configAction(options) {
|
|
@@ -77,6 +79,7 @@ program
|
|
|
77
79
|
.option('--force', 'Overwrite existing files')
|
|
78
80
|
.option('--portable', 'Create portable version (for python-flet, python-cli)')
|
|
79
81
|
.option('--no-portable', 'Skip portable version creation')
|
|
82
|
+
.option('--brand', 'Apply G360 branding (logo, colors, signature) after init')
|
|
80
83
|
.action(init);
|
|
81
84
|
|
|
82
85
|
program
|
|
@@ -196,4 +199,17 @@ program
|
|
|
196
199
|
.option('--force', 'Force reinstall/remove')
|
|
197
200
|
.action(addon);
|
|
198
201
|
|
|
202
|
+
program
|
|
203
|
+
.command('docs')
|
|
204
|
+
.argument('[level]', 'Documentation level: readme, architecture, business-rules, api, dependencies, classes, code-graph, all', 'readme')
|
|
205
|
+
.option('--project <path>', 'Project path', '.')
|
|
206
|
+
.option('--dry-run', 'Preview without writing files')
|
|
207
|
+
.action(docs);
|
|
208
|
+
|
|
209
|
+
program
|
|
210
|
+
.command('lint')
|
|
211
|
+
.argument('[level]', 'Lint level: naming, duplicates, syntax, structure, all', 'all')
|
|
212
|
+
.option('--project <path>', 'Project path', '.')
|
|
213
|
+
.action(lint);
|
|
214
|
+
|
|
199
215
|
program.parse();
|
package/src/commands/bring.js
CHANGED
|
@@ -42,6 +42,7 @@ export async function bring(asset, options) {
|
|
|
42
42
|
const brandName = asset.split('/')[1];
|
|
43
43
|
if (brandName) {
|
|
44
44
|
await applyBrand(targetDir, brandName, dryRun);
|
|
45
|
+
await applyBrandFavicons(targetDir, brandName, dryRun);
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
}
|
|
@@ -114,6 +115,89 @@ async function applyBrand(targetDir, brandName, dryRun) {
|
|
|
114
115
|
console.log(chalk.gray(` Signature: ${brand.signature?.text || 'none'}`));
|
|
115
116
|
}
|
|
116
117
|
|
|
118
|
+
async function applyBrandFavicons(targetDir, brandName, dryRun) {
|
|
119
|
+
const brandConfigPath = path.join(targetDir, 'g360', 'brand', 'brand.json');
|
|
120
|
+
if (!fs.existsSync(brandConfigPath)) return;
|
|
121
|
+
|
|
122
|
+
let brandConfig;
|
|
123
|
+
try {
|
|
124
|
+
brandConfig = fs.readJsonSync(brandConfigPath);
|
|
125
|
+
} catch {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const brand = brandConfig.brands?.[brandName];
|
|
130
|
+
if (!brand?.assets) return;
|
|
131
|
+
|
|
132
|
+
const brandDir = path.join(targetDir, 'g360', 'brand', brandName);
|
|
133
|
+
|
|
134
|
+
const isWebProject = (
|
|
135
|
+
fs.existsSync(path.join(targetDir, 'public')) ||
|
|
136
|
+
fs.existsSync(path.join(targetDir, 'static'))
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
const isDesktopProject = (
|
|
140
|
+
fs.existsSync(path.join(targetDir, 'src', 'main.py')) &&
|
|
141
|
+
fs.existsSync(path.join(targetDir, 'pyproject.toml'))
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
if (isWebProject) {
|
|
145
|
+
const publicDir = fs.existsSync(path.join(targetDir, 'public'))
|
|
146
|
+
? path.join(targetDir, 'public')
|
|
147
|
+
: path.join(targetDir, 'static');
|
|
148
|
+
|
|
149
|
+
if (brand.assets.favicons) {
|
|
150
|
+
for (const [, srcFile] of Object.entries(brand.assets.favicons)) {
|
|
151
|
+
const srcPath = path.join(brandDir, srcFile);
|
|
152
|
+
const destPath = path.join(publicDir, path.basename(srcFile));
|
|
153
|
+
if (fs.existsSync(srcPath) && !fs.existsSync(destPath)) {
|
|
154
|
+
if (!dryRun) await fs.copy(srcPath, destPath);
|
|
155
|
+
console.log(chalk.gray(` + ${path.basename(srcFile)}`));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (brand.assets.pwa) {
|
|
161
|
+
for (const [, srcFile] of Object.entries(brand.assets.pwa)) {
|
|
162
|
+
const srcPath = path.join(brandDir, srcFile);
|
|
163
|
+
const destPath = path.join(publicDir, path.basename(srcFile));
|
|
164
|
+
if (fs.existsSync(srcPath) && !fs.existsSync(destPath)) {
|
|
165
|
+
if (!dryRun) await fs.copy(srcPath, destPath);
|
|
166
|
+
console.log(chalk.gray(` + ${path.basename(srcFile)}`));
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (isDesktopProject) {
|
|
173
|
+
const imagesDir = path.join(targetDir, 'assets', 'images');
|
|
174
|
+
if (!fs.existsSync(imagesDir)) {
|
|
175
|
+
if (!dryRun) fs.mkdirpSync(imagesDir);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (brand.assets.favicons?.ico) {
|
|
179
|
+
const srcPath = path.join(brandDir, brand.assets.favicons.ico);
|
|
180
|
+
const destPath = path.join(imagesDir, path.basename(brand.assets.favicons.ico));
|
|
181
|
+
if (fs.existsSync(srcPath) && !fs.existsSync(destPath)) {
|
|
182
|
+
if (!dryRun) await fs.copy(srcPath, destPath);
|
|
183
|
+
console.log(chalk.gray(` + ${path.basename(brand.assets.favicons.ico)}`));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (brand.assets.logotypes) {
|
|
188
|
+
for (const logoFile of brand.assets.logotypes) {
|
|
189
|
+
const srcPath = path.join(brandDir, logoFile);
|
|
190
|
+
const fileName = path.basename(logoFile).toLowerCase().replace(/-/g, '_');
|
|
191
|
+
const destPath = path.join(imagesDir, fileName);
|
|
192
|
+
if (fs.existsSync(srcPath) && !fs.existsSync(destPath)) {
|
|
193
|
+
if (!dryRun) await fs.copy(srcPath, destPath);
|
|
194
|
+
console.log(chalk.gray(` + ${fileName}`));
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
117
201
|
async function installIngestion(targetDir, dryRun, force) {
|
|
118
202
|
const assetsPath = path.join(__dirname, '../assets');
|
|
119
203
|
const ingestionDir = path.join(assetsPath, 'ingestion');
|
package/src/commands/clean.js
CHANGED
|
@@ -8,6 +8,7 @@ import chalk from 'chalk';
|
|
|
8
8
|
import fs from 'fs-extra';
|
|
9
9
|
import path from 'path';
|
|
10
10
|
import { fileURLToPath } from 'url';
|
|
11
|
+
import { getAllFiles } from '../lib/file-utils.js';
|
|
11
12
|
|
|
12
13
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
13
14
|
|
|
@@ -343,28 +344,6 @@ function findEmptyDirectories(dir, baseDir = dir) {
|
|
|
343
344
|
return empty;
|
|
344
345
|
}
|
|
345
346
|
|
|
346
|
-
|
|
347
|
-
const files = [];
|
|
348
|
-
const ignoreDirs = ['node_modules', '.git', 'dist', 'build', '.next', 'out', '.nuxt', 'coverage', '.cache', '.svelte-kit'];
|
|
349
|
-
|
|
350
|
-
if (!fs.existsSync(dir)) return files;
|
|
351
|
-
|
|
352
|
-
const items = fs.readdirSync(dir, { withFileTypes: true });
|
|
353
|
-
|
|
354
|
-
for (const item of items) {
|
|
355
|
-
if (ignoreDirs.includes(item.name)) continue;
|
|
356
|
-
|
|
357
|
-
const fullPath = path.join(dir, item.name);
|
|
358
|
-
const relativePath = path.relative(baseDir, fullPath).replace(/\\/g, '/');
|
|
359
|
-
|
|
360
|
-
if (item.isDirectory()) {
|
|
361
|
-
files.push(...await getAllFiles(fullPath, baseDir));
|
|
362
|
-
} else {
|
|
363
|
-
files.push(relativePath);
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
return files;
|
|
368
|
-
}
|
|
347
|
+
|
|
369
348
|
|
|
370
349
|
export default { clean };
|
package/src/commands/convert.js
CHANGED
|
@@ -8,6 +8,7 @@ import chalk from 'chalk';
|
|
|
8
8
|
import fs from 'fs-extra';
|
|
9
9
|
import path from 'path';
|
|
10
10
|
import { fileURLToPath } from 'url';
|
|
11
|
+
import { getAllFiles } from '../lib/file-utils.js';
|
|
11
12
|
|
|
12
13
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
13
14
|
|
|
@@ -362,27 +363,4 @@ async function createBackupFolder(projectPath) {
|
|
|
362
363
|
console.log(chalk.gray(` Backup en: ${backupDir}`));
|
|
363
364
|
}
|
|
364
365
|
|
|
365
|
-
async function getAllFiles(dir, baseDir = dir) {
|
|
366
|
-
const files = [];
|
|
367
|
-
|
|
368
|
-
if (!fs.existsSync(dir)) return files;
|
|
369
|
-
|
|
370
|
-
const items = fs.readdirSync(dir, { withFileTypes: true });
|
|
371
|
-
|
|
372
|
-
for (const item of items) {
|
|
373
|
-
const fullPath = path.join(dir, item.name);
|
|
374
|
-
const relativePath = path.relative(baseDir, fullPath);
|
|
375
|
-
|
|
376
|
-
if (item.name === 'node_modules' || item.name === '.git') continue;
|
|
377
|
-
|
|
378
|
-
if (item.isDirectory()) {
|
|
379
|
-
files.push(...await getAllFiles(fullPath, baseDir));
|
|
380
|
-
} else {
|
|
381
|
-
files.push(relativePath);
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
return files;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
366
|
export default { convert };
|