fix(services): Improve services and commit flow: stop AiDoc, use silent docker inspect, sync ports with logging, fix config loading, and bump deps
This commit is contained in:
		
							
								
								
									
										11
									
								
								changelog.md
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								changelog.md
									
									
									
									
									
								
							| @@ -1,5 +1,16 @@ | ||||
| # Changelog | ||||
|  | ||||
| ## 2025-08-16 - 1.18.1 - fix(services) | ||||
| Improve services and commit flow: stop AiDoc, use silent docker inspect, sync ports with logging, fix config loading, and bump deps | ||||
|  | ||||
| - Ensure AiDoc is stopped after building commit recommendation to avoid resource leaks | ||||
| - Use execSilent for `docker inspect` in DockerContainer to avoid shell noise and improve JSON parsing | ||||
| - Sync Docker-exposed ports into service configuration with explicit notes (logs) when MongoDB / S3 ports are updated | ||||
| - Fix synchronous config loading by removing an unnecessary await in ServiceConfiguration.loadConfig | ||||
| - Bump dependencies: @push.rocks/smartshell -> ^3.2.4, @git.zone/tsdoc -> ^1.5.1 | ||||
| - Add pnpm.onlyBuiltDependencies for puppeteer and sharp to package.json | ||||
| - Add local Claude settings file (.claude/settings.local.json) with development permissions | ||||
|  | ||||
| ## 2025-08-16 - 1.18.0 - feat(services) | ||||
| Add Docker port mapping sync and reconfigure workflow for local services | ||||
|  | ||||
|   | ||||
							
								
								
									
										10
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								package.json
									
									
									
									
									
								
							| @@ -64,11 +64,11 @@ | ||||
|     "@push.rocks/smartfile": "^11.2.0", | ||||
|     "@push.rocks/smartinteract": "^2.0.16", | ||||
|     "@push.rocks/smartnetwork": "^4.1.2", | ||||
|     "@push.rocks/smartshell": "^3.2.3", | ||||
|     "@push.rocks/smartshell": "^3.2.4", | ||||
|     "@types/node": "^22.15.18" | ||||
|   }, | ||||
|   "dependencies": { | ||||
|     "@git.zone/tsdoc": "^1.5.0", | ||||
|     "@git.zone/tsdoc": "^1.5.1", | ||||
|     "@git.zone/tspublish": "^1.9.1", | ||||
|     "@push.rocks/commitinfo": "^1.0.12", | ||||
|     "@push.rocks/early": "^4.0.4", | ||||
| @@ -114,7 +114,11 @@ | ||||
|     "last 1 chrome versions" | ||||
|   ], | ||||
|   "pnpm": { | ||||
|     "overrides": {} | ||||
|     "overrides": {}, | ||||
|     "onlyBuiltDependencies": [ | ||||
|       "puppeteer", | ||||
|       "sharp" | ||||
|     ] | ||||
|   }, | ||||
|   "packageManager": "pnpm@10.7.0+sha512.6b865ad4b62a1d9842b61d674a393903b871d9244954f652b8842c2b553c72176b278f64c463e52d40fff8aba385c235c8c9ecf5cc7de4fd78b8bb6d49633ab6" | ||||
| } | ||||
|   | ||||
							
								
								
									
										1776
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1776
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -3,6 +3,6 @@ | ||||
|  */ | ||||
| export const commitinfo = { | ||||
|   name: '@git.zone/cli', | ||||
|   version: '1.18.0', | ||||
|   version: '1.18.1', | ||||
|   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.' | ||||
| } | ||||
|   | ||||
| @@ -16,6 +16,8 @@ export const run = async (argvArg: any) => { | ||||
|  | ||||
|   const nextCommitObject = await aidoc.buildNextCommitObject(paths.cwd); | ||||
|  | ||||
|   await aidoc.stop(); | ||||
|  | ||||
|   logger.log( | ||||
|     'info', | ||||
|     `--------- | ||||
|   | ||||
| @@ -215,7 +215,7 @@ export class DockerContainer { | ||||
|    */ | ||||
|   public async inspect(containerName: string): Promise<any> { | ||||
|     try { | ||||
|       const result = await this.smartshell.exec(`docker inspect ${containerName} 2>/dev/null`); | ||||
|       const result = await this.smartshell.execSilent(`docker inspect ${containerName}`); | ||||
|       if (result.exitCode === 0) { | ||||
|         return JSON.parse(result.stdout); | ||||
|       } | ||||
| @@ -231,7 +231,7 @@ export class DockerContainer { | ||||
|   public async getPortMappings(containerName: string): Promise<{ [key: string]: string } | null> { | ||||
|     try { | ||||
|       // Use docker inspect without format to get full JSON, then extract PortBindings | ||||
|       const result = await this.smartshell.exec(`docker inspect ${containerName} 2>/dev/null`); | ||||
|       const result = await this.smartshell.execSilent(`docker inspect ${containerName}`); | ||||
|        | ||||
|       if (result.exitCode === 0 && result.stdout) { | ||||
|         const inspectData = JSON.parse(result.stdout); | ||||
|   | ||||
| @@ -86,7 +86,7 @@ export class ServiceConfiguration { | ||||
|    * Load configuration from file | ||||
|    */ | ||||
|   private async loadConfig(): Promise<void> { | ||||
|     const configContent = await plugins.smartfile.fs.toStringSync(this.configPath); | ||||
|     const configContent = plugins.smartfile.fs.toStringSync(this.configPath); | ||||
|     this.config = JSON.parse(configContent); | ||||
|   } | ||||
|    | ||||
| @@ -301,6 +301,7 @@ export class ServiceConfiguration { | ||||
|       if (portMappings && portMappings['27017']) { | ||||
|         const dockerPort = portMappings['27017']; | ||||
|         if (this.config.MONGODB_PORT !== dockerPort) { | ||||
|           logger.log('note', `📍 Syncing MongoDB port from Docker: ${dockerPort}`); | ||||
|           this.config.MONGODB_PORT = dockerPort; | ||||
|           updated = true; | ||||
|         } | ||||
| @@ -315,6 +316,7 @@ export class ServiceConfiguration { | ||||
|         if (portMappings['9000']) { | ||||
|           const dockerPort = portMappings['9000']; | ||||
|           if (this.config.S3_PORT !== dockerPort) { | ||||
|             logger.log('note', `📍 Syncing S3 API port from Docker: ${dockerPort}`); | ||||
|             this.config.S3_PORT = dockerPort; | ||||
|             updated = true; | ||||
|           } | ||||
| @@ -322,6 +324,7 @@ export class ServiceConfiguration { | ||||
|         if (portMappings['9001']) { | ||||
|           const dockerPort = portMappings['9001']; | ||||
|           if (this.config.S3_CONSOLE_PORT !== dockerPort) { | ||||
|             logger.log('note', `📍 Syncing S3 Console port from Docker: ${dockerPort}`); | ||||
|             this.config.S3_CONSOLE_PORT = dockerPort; | ||||
|             updated = true; | ||||
|           } | ||||
| @@ -336,6 +339,7 @@ export class ServiceConfiguration { | ||||
|       this.config.S3_ENDPOINT = `${protocol}://${this.config.S3_HOST}:${this.config.S3_PORT}`; | ||||
|        | ||||
|       await this.saveConfig(); | ||||
|       logger.log('ok', '✅ Configuration synced with Docker containers'); | ||||
|     } | ||||
|   } | ||||
|    | ||||
|   | ||||
		Reference in New Issue
	
	Block a user