@git.zone/cli 1.16.8 → 1.17.1
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/dist_ts/00_commitinfo_data.js +2 -2
- package/dist_ts/gitzone.cli.js +8 -1
- package/dist_ts/mod_format/classes.baseformatter.js +12 -2
- package/dist_ts/mod_format/format.gitignore.js +27 -7
- package/dist_ts/mod_format/format.packagejson.js +3 -3
- package/dist_ts/mod_format/formatters/prettier.formatter.js +61 -37
- package/dist_ts/mod_format/index.js +1 -1
- package/dist_ts/mod_services/classes.dockercontainer.d.ts +68 -0
- package/dist_ts/mod_services/classes.dockercontainer.js +194 -0
- package/dist_ts/mod_services/classes.serviceconfiguration.d.ts +69 -0
- package/dist_ts/mod_services/classes.serviceconfiguration.js +195 -0
- package/dist_ts/mod_services/classes.servicemanager.d.ts +49 -0
- package/dist_ts/mod_services/classes.servicemanager.js +363 -0
- package/dist_ts/mod_services/helpers.d.ts +24 -0
- package/dist_ts/mod_services/helpers.js +108 -0
- package/dist_ts/mod_services/index.d.ts +1 -0
- package/dist_ts/mod_services/index.js +184 -0
- package/dist_ts/mod_services/mod.plugins.d.ts +7 -0
- package/dist_ts/mod_services/mod.plugins.js +8 -0
- package/dist_ts/plugins.d.ts +6 -1
- package/dist_ts/plugins.js +7 -2
- package/npmextra.json +1 -1
- package/package.json +29 -24
- package/readme.hints.md +8 -3
- package/readme.md +151 -17
- package/readme.plan.md +119 -168
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/gitzone.cli.ts +8 -0
- package/ts/mod_format/classes.baseformatter.ts +13 -1
- package/ts/mod_format/format.gitignore.ts +31 -6
- package/ts/mod_format/format.packagejson.ts +2 -2
- package/ts/mod_format/formatters/prettier.formatter.ts +76 -43
- package/ts/mod_format/index.ts +4 -1
- package/ts/mod_services/classes.dockercontainer.ts +227 -0
- package/ts/mod_services/classes.serviceconfiguration.ts +246 -0
- package/ts/mod_services/classes.servicemanager.ts +423 -0
- package/ts/mod_services/helpers.ts +123 -0
- package/ts/mod_services/index.ts +219 -0
- package/ts/mod_services/mod.plugins.ts +9 -0
- package/ts/plugins.ts +10 -0
package/readme.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
## 🎯 What is gitzone?
|
|
9
9
|
|
|
10
|
-
gitzone is a powerful command-line interface that supercharges your development workflow with automated project management, intelligent code formatting,
|
|
10
|
+
gitzone is a powerful command-line interface that supercharges your development workflow with automated project management, intelligent code formatting, seamless version control, and development service orchestration. Whether you're bootstrapping a new TypeScript project, maintaining code quality, managing complex multi-repository setups, or spinning up local development databases, gitzone has got you covered.
|
|
11
11
|
|
|
12
12
|
## 🏃♂️ Quick Start
|
|
13
13
|
|
|
@@ -23,7 +23,7 @@ pnpm add -g @git.zone/cli
|
|
|
23
23
|
|
|
24
24
|
Once installed, you can use either `gitzone` or the shorter `gzone` command from anywhere in your terminal.
|
|
25
25
|
|
|
26
|
-
### Your First
|
|
26
|
+
### Your First Commands
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
29
|
# Create a new TypeScript npm package
|
|
@@ -32,12 +32,66 @@ gitzone template npm
|
|
|
32
32
|
# Format your entire codebase
|
|
33
33
|
gitzone format
|
|
34
34
|
|
|
35
|
+
# Start local MongoDB and MinIO services
|
|
36
|
+
gitzone services start
|
|
37
|
+
|
|
35
38
|
# Create a semantic commit
|
|
36
39
|
gitzone commit
|
|
37
40
|
```
|
|
38
41
|
|
|
39
42
|
## 🛠️ Core Features
|
|
40
43
|
|
|
44
|
+
### 🐳 Development Services Management (NEW!)
|
|
45
|
+
|
|
46
|
+
Effortlessly manage local MongoDB and MinIO (S3-compatible) services for your development environment:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
gitzone services [command]
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Available commands:**
|
|
53
|
+
|
|
54
|
+
- **`start [service]`** - Start services (mongo|s3|all)
|
|
55
|
+
- **`stop [service]`** - Stop services (mongo|s3|all)
|
|
56
|
+
- **`restart [service]`** - Restart services
|
|
57
|
+
- **`status`** - Show current service status
|
|
58
|
+
- **`config`** - Display configuration details
|
|
59
|
+
- **`compass`** - Get MongoDB Compass connection string with network IP
|
|
60
|
+
- **`logs [service] [lines]`** - View service logs
|
|
61
|
+
- **`remove`** - Remove containers (preserves data)
|
|
62
|
+
- **`clean`** - Remove containers AND data (⚠️ destructive)
|
|
63
|
+
|
|
64
|
+
**Key features:**
|
|
65
|
+
|
|
66
|
+
- 🎲 **Smart port assignment** - Automatically assigns random ports (20000-30000) to avoid conflicts
|
|
67
|
+
- 📦 **Project isolation** - Each project gets its own containers with unique names
|
|
68
|
+
- 💾 **Data persistence** - Data stored in `.nogit/` directories survives container restarts
|
|
69
|
+
- 🔗 **MongoDB Compass support** - Instantly get connection strings for GUI access
|
|
70
|
+
- 🌐 **Network IP detection** - Automatically detects your local network IP for remote connections
|
|
71
|
+
- ⚙️ **Auto-configuration** - Creates `.nogit/env.json` with smart defaults
|
|
72
|
+
|
|
73
|
+
**Example workflow:**
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Start all services for your project
|
|
77
|
+
gitzone services start
|
|
78
|
+
|
|
79
|
+
# Check what's running
|
|
80
|
+
gitzone services status
|
|
81
|
+
|
|
82
|
+
# Get MongoDB Compass connection string
|
|
83
|
+
gitzone services compass
|
|
84
|
+
# Output: mongodb://defaultadmin:defaultpass@192.168.1.100:27018/myproject?authSource=admin
|
|
85
|
+
|
|
86
|
+
# View MongoDB logs
|
|
87
|
+
gitzone services logs mongo 50
|
|
88
|
+
|
|
89
|
+
# Stop services when done
|
|
90
|
+
gitzone services stop
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
The services are configured via `.nogit/env.json` which is automatically created with secure defaults and random ports for each project.
|
|
94
|
+
|
|
41
95
|
### 📦 Project Templates
|
|
42
96
|
|
|
43
97
|
Instantly scaffold production-ready projects with best practices built-in:
|
|
@@ -47,12 +101,14 @@ gitzone template [template-name]
|
|
|
47
101
|
```
|
|
48
102
|
|
|
49
103
|
**Available templates:**
|
|
104
|
+
|
|
50
105
|
- **`npm`** - TypeScript npm package with testing, CI/CD, and full tooling
|
|
51
106
|
- **`service`** - Microservice architecture with Docker support
|
|
52
|
-
- **`website`** - Modern web application with LitElement and service workers
|
|
107
|
+
- **`website`** - Modern web application with LitElement and service workers
|
|
53
108
|
- **`wcc`** - Web Component Collection for reusable UI components
|
|
54
109
|
|
|
55
110
|
Each template comes pre-configured with:
|
|
111
|
+
|
|
56
112
|
- ✅ TypeScript with modern configurations
|
|
57
113
|
- ✅ Automated testing setup
|
|
58
114
|
- ✅ CI/CD pipelines (GitLab/GitHub)
|
|
@@ -81,6 +137,7 @@ gitzone format --verbose
|
|
|
81
137
|
```
|
|
82
138
|
|
|
83
139
|
**Format features:**
|
|
140
|
+
|
|
84
141
|
- 🔄 **Smart caching** - Only processes changed files
|
|
85
142
|
- 🛡️ **Rollback support** - Undo formatting changes if needed
|
|
86
143
|
- 📊 **Detailed reporting** - See exactly what changed
|
|
@@ -88,6 +145,7 @@ gitzone format --verbose
|
|
|
88
145
|
- 🎯 **Module-specific formatting** - Target specific formatters
|
|
89
146
|
|
|
90
147
|
**Rollback capabilities:**
|
|
148
|
+
|
|
91
149
|
```bash
|
|
92
150
|
# List all available backups
|
|
93
151
|
gitzone format --list-backups
|
|
@@ -103,6 +161,7 @@ gitzone format --clean-backups
|
|
|
103
161
|
```
|
|
104
162
|
|
|
105
163
|
**Formatters included:**
|
|
164
|
+
|
|
106
165
|
- **Prettier** - JavaScript/TypeScript code formatting
|
|
107
166
|
- **License** - Ensure proper licensing
|
|
108
167
|
- **Package.json** - Standardize package configurations
|
|
@@ -121,6 +180,7 @@ gitzone commit
|
|
|
121
180
|
```
|
|
122
181
|
|
|
123
182
|
Features:
|
|
183
|
+
|
|
124
184
|
- 📝 Interactive commit message builder
|
|
125
185
|
- 🏷️ Automatic version bumping (major/minor/patch)
|
|
126
186
|
- 📜 Changelog generation
|
|
@@ -128,6 +188,7 @@ Features:
|
|
|
128
188
|
- 🎯 Conventional commit compliance
|
|
129
189
|
|
|
130
190
|
The commit wizard guides you through:
|
|
191
|
+
|
|
131
192
|
1. **Type selection** (feat/fix/docs/style/refactor/perf/test/chore)
|
|
132
193
|
2. **Scope definition** (component/module affected)
|
|
133
194
|
3. **Description crafting**
|
|
@@ -153,6 +214,7 @@ gitzone meta remove [name]
|
|
|
153
214
|
```
|
|
154
215
|
|
|
155
216
|
Perfect for:
|
|
217
|
+
|
|
156
218
|
- Monorepo management
|
|
157
219
|
- Multi-package projects
|
|
158
220
|
- Coordinated deployments
|
|
@@ -168,6 +230,7 @@ gitzone docker prune
|
|
|
168
230
|
```
|
|
169
231
|
|
|
170
232
|
This command removes:
|
|
233
|
+
|
|
171
234
|
- Stopped containers
|
|
172
235
|
- Unused images
|
|
173
236
|
- Dangling volumes
|
|
@@ -196,6 +259,7 @@ gitzone deprecate
|
|
|
196
259
|
```
|
|
197
260
|
|
|
198
261
|
Interactive wizard for:
|
|
262
|
+
|
|
199
263
|
- Setting deprecation notices
|
|
200
264
|
- Guiding users to replacements
|
|
201
265
|
- Updating registry metadata
|
|
@@ -210,6 +274,7 @@ gitzone start
|
|
|
210
274
|
```
|
|
211
275
|
|
|
212
276
|
Automatically:
|
|
277
|
+
|
|
213
278
|
- Checks out master branch
|
|
214
279
|
- Pulls latest changes
|
|
215
280
|
- Installs dependencies
|
|
@@ -266,44 +331,58 @@ Customize gitzone behavior through `npmextra.json`:
|
|
|
266
331
|
## 🏆 Best Practices
|
|
267
332
|
|
|
268
333
|
### For New Projects
|
|
334
|
+
|
|
269
335
|
1. Start with a template: `gitzone template npm`
|
|
270
|
-
2.
|
|
271
|
-
3.
|
|
272
|
-
4.
|
|
336
|
+
2. Set up local services: `gitzone services start`
|
|
337
|
+
3. Customize the generated structure
|
|
338
|
+
4. Run initial format: `gitzone format`
|
|
339
|
+
5. Set up CI/CD: `gitzone open ci`
|
|
273
340
|
|
|
274
341
|
### For Existing Projects
|
|
342
|
+
|
|
275
343
|
1. Initialize: `gitzone start`
|
|
276
344
|
2. Format codebase: `gitzone format --dry-run` (preview first!)
|
|
277
345
|
3. Apply formatting: `gitzone format --yes`
|
|
278
|
-
4.
|
|
346
|
+
4. Set up services: `gitzone services start`
|
|
347
|
+
5. Commit changes: `gitzone commit`
|
|
279
348
|
|
|
280
349
|
### For Teams
|
|
350
|
+
|
|
281
351
|
1. Document format preferences in `npmextra.json`
|
|
282
|
-
2.
|
|
283
|
-
3.
|
|
284
|
-
4.
|
|
352
|
+
2. Share `.nogit/env.json` template for consistent service setup
|
|
353
|
+
3. Use `--save-plan` for reviewable format changes
|
|
354
|
+
4. Enable rollback for safety
|
|
355
|
+
5. Standardize commit conventions
|
|
285
356
|
|
|
286
357
|
## 🎯 Common Workflows
|
|
287
358
|
|
|
288
|
-
###
|
|
359
|
+
### Full-Stack Development Cycle
|
|
360
|
+
|
|
289
361
|
```bash
|
|
290
362
|
# 1. Start fresh
|
|
291
363
|
gitzone start
|
|
292
364
|
|
|
293
|
-
# 2.
|
|
365
|
+
# 2. Spin up databases and services
|
|
366
|
+
gitzone services start
|
|
367
|
+
|
|
368
|
+
# 3. Make changes
|
|
294
369
|
# ... your development work ...
|
|
295
370
|
|
|
296
|
-
#
|
|
371
|
+
# 4. Check service logs if needed
|
|
372
|
+
gitzone services logs mongo
|
|
373
|
+
|
|
374
|
+
# 5. Format code
|
|
297
375
|
gitzone format
|
|
298
376
|
|
|
299
|
-
#
|
|
377
|
+
# 6. Commit with semantic versioning
|
|
300
378
|
gitzone commit
|
|
301
379
|
|
|
302
|
-
#
|
|
303
|
-
|
|
380
|
+
# 7. Stop services when done
|
|
381
|
+
gitzone services stop
|
|
304
382
|
```
|
|
305
383
|
|
|
306
384
|
### Multi-Repository Management
|
|
385
|
+
|
|
307
386
|
```bash
|
|
308
387
|
# 1. Set up meta repository
|
|
309
388
|
gitzone meta init
|
|
@@ -318,6 +397,7 @@ gitzone meta update
|
|
|
318
397
|
```
|
|
319
398
|
|
|
320
399
|
### Safe Formatting with Rollback
|
|
400
|
+
|
|
321
401
|
```bash
|
|
322
402
|
# 1. Preview changes
|
|
323
403
|
gitzone format --dry-run
|
|
@@ -332,20 +412,45 @@ gitzone format --from-plan format-changes.json
|
|
|
332
412
|
gitzone format --rollback
|
|
333
413
|
```
|
|
334
414
|
|
|
415
|
+
### Database-Driven Development
|
|
416
|
+
|
|
417
|
+
```bash
|
|
418
|
+
# 1. Start MongoDB and MinIO
|
|
419
|
+
gitzone services start
|
|
420
|
+
|
|
421
|
+
# 2. Get connection string for your app
|
|
422
|
+
gitzone services config
|
|
423
|
+
|
|
424
|
+
# 3. Connect with MongoDB Compass
|
|
425
|
+
gitzone services compass
|
|
426
|
+
|
|
427
|
+
# 4. Monitor services
|
|
428
|
+
gitzone services status
|
|
429
|
+
|
|
430
|
+
# 5. Clean everything when done
|
|
431
|
+
gitzone services clean # ⚠️ Warning: deletes data
|
|
432
|
+
```
|
|
433
|
+
|
|
335
434
|
## 🔌 Integrations
|
|
336
435
|
|
|
337
436
|
### CI/CD Platforms
|
|
437
|
+
|
|
338
438
|
- **GitLab CI** - Full pipeline support with templates
|
|
339
439
|
- **GitHub Actions** - Automated workflows
|
|
340
440
|
- **Docker** - Container-based deployments
|
|
341
441
|
|
|
342
442
|
### Development Tools
|
|
443
|
+
|
|
343
444
|
- **TypeScript** - First-class support
|
|
344
445
|
- **Prettier** - Code formatting
|
|
345
446
|
- **ESLint** - Linting (via format modules)
|
|
346
447
|
- **npm/pnpm** - Package management
|
|
448
|
+
- **MongoDB** - Local database service
|
|
449
|
+
- **MinIO** - S3-compatible object storage
|
|
450
|
+
- **MongoDB Compass** - Database GUI integration
|
|
347
451
|
|
|
348
452
|
### Version Control
|
|
453
|
+
|
|
349
454
|
- **Git** - Deep integration
|
|
350
455
|
- **Semantic Versioning** - Automatic version bumping
|
|
351
456
|
- **Conventional Commits** - Standardized commit messages
|
|
@@ -357,38 +462,67 @@ gitzone format --rollback
|
|
|
357
462
|
3. **Leverage templates**: Start projects right with proven structures
|
|
358
463
|
4. **Enable caching**: Dramatically speeds up formatting operations
|
|
359
464
|
5. **Save format plans**: Review changes before applying in production
|
|
465
|
+
6. **Port management**: Let services auto-assign ports to avoid conflicts
|
|
466
|
+
7. **Use MongoDB Compass**: `gitzone services compass` for visual DB management
|
|
360
467
|
|
|
361
468
|
## 🐛 Troubleshooting
|
|
362
469
|
|
|
363
470
|
### Format Command Shows "Cancelled"
|
|
471
|
+
|
|
364
472
|
If the format command shows cancelled even after confirming:
|
|
473
|
+
|
|
365
474
|
- Check your `npmextra.json` configuration
|
|
366
475
|
- Try with `--yes` flag to skip confirmation
|
|
367
476
|
- Use `--verbose` for detailed output
|
|
368
477
|
|
|
369
478
|
### Docker Commands Fail
|
|
479
|
+
|
|
370
480
|
Ensure Docker daemon is running:
|
|
481
|
+
|
|
371
482
|
```bash
|
|
372
483
|
docker info
|
|
373
484
|
```
|
|
374
485
|
|
|
486
|
+
### Services Won't Start
|
|
487
|
+
|
|
488
|
+
Check for port conflicts:
|
|
489
|
+
|
|
490
|
+
```bash
|
|
491
|
+
# Services auto-assign ports, but you can check the config
|
|
492
|
+
cat .nogit/env.json
|
|
493
|
+
|
|
494
|
+
# Verify Docker is running
|
|
495
|
+
docker ps
|
|
496
|
+
```
|
|
497
|
+
|
|
375
498
|
### Template Creation Issues
|
|
499
|
+
|
|
376
500
|
Verify npm/pnpm is properly configured:
|
|
501
|
+
|
|
377
502
|
```bash
|
|
378
503
|
npm config get registry
|
|
379
504
|
```
|
|
380
505
|
|
|
506
|
+
### MongoDB Connection Issues
|
|
507
|
+
|
|
508
|
+
- Ensure services are running: `gitzone services status`
|
|
509
|
+
- Check firewall settings for the assigned ports
|
|
510
|
+
- Use `gitzone services compass` for the correct connection string
|
|
511
|
+
|
|
381
512
|
## 📈 Performance
|
|
382
513
|
|
|
383
514
|
gitzone is optimized for speed:
|
|
515
|
+
|
|
384
516
|
- **Parallel processing** for format operations
|
|
385
517
|
- **Smart caching** to avoid redundant work
|
|
386
518
|
- **Incremental updates** for meta repositories
|
|
387
519
|
- **Minimal dependencies** for fast installation
|
|
520
|
+
- **Isolated services** prevent resource conflicts
|
|
521
|
+
- **Auto port assignment** eliminates manual configuration
|
|
388
522
|
|
|
389
523
|
## License and Legal Information
|
|
390
524
|
|
|
391
|
-
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
|
525
|
+
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
|
392
526
|
|
|
393
527
|
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
|
394
528
|
|
package/readme.plan.md
CHANGED
|
@@ -1,170 +1,121 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
Please reread /home/philkunz/.claude/CLAUDE.md before proceeding with any implementation.
|
|
1
|
+
# GitZone Services Command Implementation Plan
|
|
4
2
|
|
|
5
3
|
## Overview
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
##
|
|
9
|
-
|
|
10
|
-
###
|
|
11
|
-
- [x]
|
|
12
|
-
- [x]
|
|
13
|
-
- [x] Create
|
|
14
|
-
- [x]
|
|
15
|
-
- [x]
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- [x]
|
|
21
|
-
- [x]
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- [x]
|
|
25
|
-
|
|
26
|
-
- [x]
|
|
27
|
-
- [x]
|
|
28
|
-
- [x]
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
- [x]
|
|
32
|
-
|
|
33
|
-
- [x] Implement
|
|
34
|
-
- [x]
|
|
35
|
-
- [x]
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- [x]
|
|
43
|
-
- [x]
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
- [x]
|
|
47
|
-
- [x]
|
|
48
|
-
- [x]
|
|
49
|
-
- [x]
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
- [
|
|
55
|
-
- [
|
|
56
|
-
- [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
- [
|
|
61
|
-
- [
|
|
62
|
-
- [
|
|
63
|
-
- [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
- [
|
|
67
|
-
- [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
- [ ]
|
|
73
|
-
- [ ]
|
|
74
|
-
- [ ]
|
|
75
|
-
- [ ]
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
- Basic configuration support
|
|
125
|
-
- Exception handling for specific packages
|
|
126
|
-
- Need: compatibility matrix, compliance reports
|
|
127
|
-
|
|
128
|
-
2. **Package.json Management**
|
|
129
|
-
- Basic ensureDependency implementation
|
|
130
|
-
- Need: smart sorting, script generation, validation
|
|
131
|
-
|
|
132
|
-
### ⏳ Not Started
|
|
133
|
-
|
|
134
|
-
1. **Plugin System**
|
|
135
|
-
- Need to design plugin API
|
|
136
|
-
- Hook system for pre/post operations
|
|
137
|
-
- Custom validation rules
|
|
138
|
-
|
|
139
|
-
2. **Git Integration**
|
|
140
|
-
- Pre-commit hooks
|
|
141
|
-
- Automatic formatting on commit
|
|
142
|
-
|
|
143
|
-
3. **Advanced UI**
|
|
144
|
-
- Interactive configuration mode
|
|
145
|
-
- Undo/redo capability
|
|
146
|
-
- Format presets
|
|
147
|
-
|
|
148
|
-
## Technical Achievements
|
|
149
|
-
|
|
150
|
-
1. **Type Safety**: All new code uses TypeScript interfaces and types
|
|
151
|
-
2. **Error Handling**: Comprehensive try-catch blocks with rollback
|
|
152
|
-
3. **API Compatibility**: Updated to use latest smartfile/smartnpm APIs
|
|
153
|
-
4. **Testing**: Ready for comprehensive test suite
|
|
154
|
-
5. **Performance**: Significant improvements through caching and parallelization
|
|
155
|
-
|
|
156
|
-
## Next Steps
|
|
157
|
-
|
|
158
|
-
1. Write comprehensive tests for all new functionality
|
|
159
|
-
2. Create user documentation for new features
|
|
160
|
-
3. Consider plugin API design for extensibility
|
|
161
|
-
4. Implement remaining Phase 3 features based on user feedback
|
|
162
|
-
5. Performance benchmarking and optimization
|
|
163
|
-
|
|
164
|
-
## Success Metrics Achieved
|
|
165
|
-
|
|
166
|
-
- ✅ Reduced error rates through rollback mechanism
|
|
167
|
-
- ✅ Faster execution through parallel processing and caching
|
|
168
|
-
- ✅ Enhanced user control through configuration
|
|
169
|
-
- ✅ Better visibility through reporting and statistics
|
|
170
|
-
- ✅ Improved maintainability through better architecture
|
|
4
|
+
Implement the `gitzone services` command to manage MongoDB and MinIO containers for development projects.
|
|
5
|
+
|
|
6
|
+
## Tasks
|
|
7
|
+
|
|
8
|
+
### Module Structure Setup
|
|
9
|
+
- [x] Create `ts/mod_services/` directory
|
|
10
|
+
- [x] Create `mod.plugins.ts` with required imports
|
|
11
|
+
- [x] Create `helpers.ts` with utility functions
|
|
12
|
+
- [x] Create `classes.serviceconfiguration.ts` for config handling
|
|
13
|
+
- [x] Create `classes.dockercontainer.ts` for Docker operations
|
|
14
|
+
- [x] Create `classes.servicemanager.ts` for service management
|
|
15
|
+
- [x] Create `index.ts` with main command logic
|
|
16
|
+
|
|
17
|
+
### Core Functionality
|
|
18
|
+
- [x] Implement ServiceConfiguration class
|
|
19
|
+
- [x] Load/create `.nogit/env.json` configuration
|
|
20
|
+
- [x] Generate random available ports (20000-30000 range)
|
|
21
|
+
- [x] Preserve existing custom values
|
|
22
|
+
- [x] Provide default values for missing fields
|
|
23
|
+
|
|
24
|
+
- [x] Implement DockerContainer class
|
|
25
|
+
- [x] Check container status
|
|
26
|
+
- [x] Start/stop/restart containers
|
|
27
|
+
- [x] Execute Docker commands
|
|
28
|
+
- [x] Handle container logs
|
|
29
|
+
- [x] Manage volumes and port bindings
|
|
30
|
+
|
|
31
|
+
- [x] Implement ServiceManager class
|
|
32
|
+
- [x] Manage MongoDB containers
|
|
33
|
+
- [x] Manage MinIO containers
|
|
34
|
+
- [x] Handle container lifecycle
|
|
35
|
+
- [x] Generate project-specific container names
|
|
36
|
+
- [x] Manage data directories in `.nogit/`
|
|
37
|
+
- [x] Generate MongoDB Compass connection strings
|
|
38
|
+
|
|
39
|
+
### Commands Implementation
|
|
40
|
+
- [x] `start` command - Start services (mongo|s3|all)
|
|
41
|
+
- [x] `stop` command - Stop services (mongo|s3|all)
|
|
42
|
+
- [x] `restart` command - Restart services (mongo|s3|all)
|
|
43
|
+
- [x] `status` command - Show service status
|
|
44
|
+
- [x] `config` command - Show current configuration
|
|
45
|
+
- [x] `compass` command - Show MongoDB Compass connection string
|
|
46
|
+
- [x] `logs` command - Show service logs with line count
|
|
47
|
+
- [x] `remove` command - Remove containers (preserve data)
|
|
48
|
+
- [x] `clean` command - Remove containers and data
|
|
49
|
+
|
|
50
|
+
### Integration
|
|
51
|
+
- [x] Add `@push.rocks/smartshell` to main plugins.ts
|
|
52
|
+
- [x] Add `@push.rocks/smartnetwork` to main plugins.ts
|
|
53
|
+
- [x] Add `@push.rocks/smartinteraction` to main plugins.ts
|
|
54
|
+
- [x] Register services command in `gitzone.cli.ts`
|
|
55
|
+
|
|
56
|
+
### Features
|
|
57
|
+
- [x] Auto-configuration with smart defaults
|
|
58
|
+
- [x] Random port assignment to avoid conflicts
|
|
59
|
+
- [x] Project isolation with unique container names
|
|
60
|
+
- [x] Data persistence in `.nogit/` directories
|
|
61
|
+
- [x] Status display (running/stopped/not installed)
|
|
62
|
+
- [x] Interactive confirmations for destructive operations
|
|
63
|
+
- [x] Colored console output
|
|
64
|
+
- [x] MinIO bucket auto-creation
|
|
65
|
+
- [x] MongoDB Compass connection string with network IP
|
|
66
|
+
|
|
67
|
+
### Testing
|
|
68
|
+
- [ ] Test service start/stop operations
|
|
69
|
+
- [ ] Test configuration creation and updates
|
|
70
|
+
- [ ] Test port collision handling
|
|
71
|
+
- [ ] Test data persistence
|
|
72
|
+
- [ ] Test MongoDB Compass connection string generation
|
|
73
|
+
- [ ] Test all command variations
|
|
74
|
+
|
|
75
|
+
## Configuration Format
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"PROJECT_NAME": "derived-from-package-name",
|
|
79
|
+
"MONGODB_HOST": "localhost",
|
|
80
|
+
"MONGODB_NAME": "project-name",
|
|
81
|
+
"MONGODB_PORT": "random-port",
|
|
82
|
+
"MONGODB_USER": "defaultadmin",
|
|
83
|
+
"MONGODB_PASS": "defaultpass",
|
|
84
|
+
"S3_HOST": "localhost",
|
|
85
|
+
"S3_PORT": "random-port",
|
|
86
|
+
"S3_CONSOLE_PORT": "s3-port+1",
|
|
87
|
+
"S3_USER": "defaultadmin",
|
|
88
|
+
"S3_PASS": "defaultpass",
|
|
89
|
+
"S3_BUCKET": "project-name-documents"
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Command Examples
|
|
94
|
+
```bash
|
|
95
|
+
gitzone services start # Start all services
|
|
96
|
+
gitzone services start mongo # Start only MongoDB
|
|
97
|
+
gitzone services stop # Stop all services
|
|
98
|
+
gitzone services status # Check service status
|
|
99
|
+
gitzone services config # Show configuration
|
|
100
|
+
gitzone services compass # Show MongoDB Compass connection string
|
|
101
|
+
gitzone services logs mongo 50 # Show last 50 lines of MongoDB logs
|
|
102
|
+
gitzone services remove # Remove containers (preserve data)
|
|
103
|
+
gitzone services clean # Remove containers and data
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Progress Notes
|
|
107
|
+
Implementation started: 2025-08-14
|
|
108
|
+
Implementation completed: 2025-08-14
|
|
109
|
+
|
|
110
|
+
## Summary
|
|
111
|
+
Successfully implemented the `gitzone services` command in TypeScript, providing a complete replacement for the `services.sh` shell script. The implementation includes:
|
|
112
|
+
|
|
113
|
+
1. **Complete Docker service management** for MongoDB and MinIO containers
|
|
114
|
+
2. **Smart configuration management** with automatic port assignment and conflict avoidance
|
|
115
|
+
3. **MongoDB Compass support** with network IP detection for remote connections
|
|
116
|
+
4. **Project isolation** using project-specific container names
|
|
117
|
+
5. **Data persistence** in `.nogit/` directories
|
|
118
|
+
6. **Interactive confirmations** for destructive operations
|
|
119
|
+
7. **Comprehensive command set** including start, stop, restart, status, config, compass, logs, remove, and clean commands
|
|
120
|
+
|
|
121
|
+
The module is fully integrated into the gitzone CLI and ready for testing.
|
package/ts/00_commitinfo_data.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@git.zone/cli',
|
|
6
|
-
version: '1.16.
|
|
6
|
+
version: '1.16.10',
|
|
7
7
|
description: 'A comprehensive CLI tool for enhancing and managing local development workflows with gitzone utilities, focusing on project setup, version control, code formatting, and template management.'
|
|
8
8
|
}
|