@git.zone/cli 2.19.3 → 2.19.5

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 (36) hide show
  1. package/.smartconfig.json +4 -4
  2. package/dist_ts/00_commitinfo_data.js +1 -1
  3. package/dist_ts/classes.gitzoneconfig.js +1 -1
  4. package/dist_ts/gitzone.cli.js +2 -2
  5. package/dist_ts/helpers.changelog.js +14 -6
  6. package/dist_ts/mod_commit/mod.helpers.js +5 -3
  7. package/dist_ts/mod_format/classes.diffreporter.js +3 -2
  8. package/dist_ts/mod_format/formatters/copy.formatter.js +3 -2
  9. package/dist_ts/mod_format/formatters/packagejson.formatter.js +3 -2
  10. package/dist_ts/mod_format/formatters/templates.formatter.js +3 -2
  11. package/dist_ts/mod_format/formatters/tsconfig.formatter.js +3 -2
  12. package/dist_ts/mod_meta/meta.classes.meta.js +1 -1
  13. package/dist_ts/mod_open/index.d.ts +1 -1
  14. package/dist_ts/mod_open/index.js +3 -3
  15. package/dist_ts/mod_services/classes.dockercontainer.js +5 -3
  16. package/dist_ts/mod_services/classes.serviceconfiguration.js +1 -1
  17. package/dist_ts/mod_services/classes.servicemanager.js +10 -7
  18. package/dist_ts/mod_template/index.d.ts +1 -1
  19. package/dist_ts/mod_template/index.js +6 -2
  20. package/package.json +11 -11
  21. package/ts/00_commitinfo_data.ts +1 -1
  22. package/ts/classes.gitzoneconfig.ts +1 -1
  23. package/ts/gitzone.cli.ts +1 -1
  24. package/ts/helpers.changelog.ts +22 -8
  25. package/ts/mod_commit/mod.helpers.ts +4 -2
  26. package/ts/mod_format/classes.diffreporter.ts +2 -1
  27. package/ts/mod_format/formatters/copy.formatter.ts +2 -1
  28. package/ts/mod_format/formatters/packagejson.formatter.ts +2 -1
  29. package/ts/mod_format/formatters/templates.formatter.ts +2 -1
  30. package/ts/mod_format/formatters/tsconfig.formatter.ts +2 -1
  31. package/ts/mod_meta/meta.classes.meta.ts +1 -1
  32. package/ts/mod_open/index.ts +2 -2
  33. package/ts/mod_services/classes.dockercontainer.ts +5 -3
  34. package/ts/mod_services/classes.serviceconfiguration.ts +2 -2
  35. package/ts/mod_services/classes.servicemanager.ts +9 -6
  36. package/ts/mod_template/index.ts +5 -1
@@ -1,8 +1,8 @@
1
1
  import * as plugins from './mod.plugins.js';
2
2
  import * as paths from '../paths.js';
3
3
 
4
- export let run = (argvArg) => {
5
- let projectInfo = new plugins.projectinfo.ProjectInfo(paths.cwd);
4
+ export let run = async (argvArg) => {
5
+ let projectInfo = await plugins.projectinfo.ProjectInfo.create(paths.cwd);
6
6
  if (argvArg._[1] === 'ci') {
7
7
  plugins.smartopen.openUrl(
8
8
  `https://gitlab.com/${projectInfo.git.gituser}/${projectInfo.git.gitrepo}/settings/ci_cd`,
@@ -148,7 +148,8 @@ export class DockerContainer {
148
148
  const result = await this.smartshell.exec(command);
149
149
  return result.exitCode === 0;
150
150
  } catch (error) {
151
- logger.log('error', `Failed to run container: ${error.message}`);
151
+ const errorMessage = error instanceof Error ? error.message : String(error);
152
+ logger.log('error', `Failed to run container: ${errorMessage}`);
152
153
  return false;
153
154
  }
154
155
  }
@@ -177,7 +178,8 @@ export class DockerContainer {
177
178
  const result = await this.smartshell.exec(`docker logs ${tailFlag} ${containerName}`);
178
179
  return result.stdout;
179
180
  } catch (error) {
180
- return `Error getting logs: ${error.message}`;
181
+ const errorMessage = error instanceof Error ? error.message : String(error);
182
+ return `Error getting logs: ${errorMessage}`;
181
183
  }
182
184
  }
183
185
 
@@ -258,4 +260,4 @@ export class DockerContainer {
258
260
  return null;
259
261
  }
260
262
  }
261
- }
263
+ }
@@ -28,7 +28,7 @@ export interface IServiceConfig {
28
28
 
29
29
  export class ServiceConfiguration {
30
30
  private configPath: string;
31
- private config: IServiceConfig;
31
+ private config!: IServiceConfig;
32
32
  private docker: DockerContainer;
33
33
 
34
34
  constructor() {
@@ -515,4 +515,4 @@ export class ServiceConfiguration {
515
515
  logger.log('info', ` 📍 S3 Console: ${s3ConsolePort}`);
516
516
  logger.log('info', ` 📍 Elasticsearch: ${esPort}`);
517
517
  }
518
- }
518
+ }
@@ -61,13 +61,15 @@ export class ServiceManager {
61
61
  default: ['mongodb', 'minio', 'elasticsearch']
62
62
  });
63
63
 
64
- this.enabledServices = response.value || ['mongodb', 'minio', 'elasticsearch'];
64
+ const enabledServices = response.value || ['mongodb', 'minio', 'elasticsearch'];
65
+ this.enabledServices = enabledServices;
65
66
 
66
67
  // Save to .smartconfig.json
67
- await this.saveServiceConfiguration(this.enabledServices);
68
+ await this.saveServiceConfiguration(enabledServices);
68
69
  } else {
69
- this.enabledServices = gitzoneConfig.services;
70
- logger.log('info', `🔧 Enabled services: ${this.enabledServices.join(', ')}`);
70
+ const enabledServices = gitzoneConfig.services as string[];
71
+ this.enabledServices = enabledServices;
72
+ logger.log('info', `🔧 Enabled services: ${enabledServices.join(', ')}`);
71
73
  }
72
74
  }
73
75
 
@@ -902,10 +904,11 @@ export class ServiceManager {
902
904
  default: currentServices
903
905
  });
904
906
 
905
- this.enabledServices = response.value || ['mongodb', 'minio', 'elasticsearch'];
907
+ const enabledServices = response.value || ['mongodb', 'minio', 'elasticsearch'];
908
+ this.enabledServices = enabledServices;
906
909
 
907
910
  // Save to .smartconfig.json
908
- await this.saveServiceConfiguration(this.enabledServices);
911
+ await this.saveServiceConfiguration(enabledServices);
909
912
 
910
913
  logger.log('ok', '✅ Service configuration updated');
911
914
  }
@@ -15,7 +15,7 @@ export const isTemplate = async (templateNameArg: string) => {
15
15
  };
16
16
 
17
17
  export const getTemplate = async (templateNameArg: string) => {
18
- if (isTemplate(templateNameArg)) {
18
+ if (await isTemplate(templateNameArg)) {
19
19
  const localScafTemplate = new plugins.smartscaf.ScafTemplate(
20
20
  getTemplatePath(templateNameArg),
21
21
  );
@@ -50,6 +50,10 @@ export const run = async (argvArg: any) => {
50
50
  }
51
51
 
52
52
  const localScafTemplate = await getTemplate(chosenTemplate);
53
+ if (!localScafTemplate) {
54
+ logger.log('error', `Template ${chosenTemplate} not available`);
55
+ return;
56
+ }
53
57
  await localScafTemplate.askCliForMissingVariables();
54
58
  await localScafTemplate.writeToDisk(paths.cwd);
55
59
  };