@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.
- package/.smartconfig.json +4 -4
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.gitzoneconfig.js +1 -1
- package/dist_ts/gitzone.cli.js +2 -2
- package/dist_ts/helpers.changelog.js +14 -6
- package/dist_ts/mod_commit/mod.helpers.js +5 -3
- package/dist_ts/mod_format/classes.diffreporter.js +3 -2
- package/dist_ts/mod_format/formatters/copy.formatter.js +3 -2
- package/dist_ts/mod_format/formatters/packagejson.formatter.js +3 -2
- package/dist_ts/mod_format/formatters/templates.formatter.js +3 -2
- package/dist_ts/mod_format/formatters/tsconfig.formatter.js +3 -2
- package/dist_ts/mod_meta/meta.classes.meta.js +1 -1
- package/dist_ts/mod_open/index.d.ts +1 -1
- package/dist_ts/mod_open/index.js +3 -3
- package/dist_ts/mod_services/classes.dockercontainer.js +5 -3
- package/dist_ts/mod_services/classes.serviceconfiguration.js +1 -1
- package/dist_ts/mod_services/classes.servicemanager.js +10 -7
- package/dist_ts/mod_template/index.d.ts +1 -1
- package/dist_ts/mod_template/index.js +6 -2
- package/package.json +11 -11
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.gitzoneconfig.ts +1 -1
- package/ts/gitzone.cli.ts +1 -1
- package/ts/helpers.changelog.ts +22 -8
- package/ts/mod_commit/mod.helpers.ts +4 -2
- package/ts/mod_format/classes.diffreporter.ts +2 -1
- package/ts/mod_format/formatters/copy.formatter.ts +2 -1
- package/ts/mod_format/formatters/packagejson.formatter.ts +2 -1
- package/ts/mod_format/formatters/templates.formatter.ts +2 -1
- package/ts/mod_format/formatters/tsconfig.formatter.ts +2 -1
- package/ts/mod_meta/meta.classes.meta.ts +1 -1
- package/ts/mod_open/index.ts +2 -2
- package/ts/mod_services/classes.dockercontainer.ts +5 -3
- package/ts/mod_services/classes.serviceconfiguration.ts +2 -2
- package/ts/mod_services/classes.servicemanager.ts +9 -6
- package/ts/mod_template/index.ts +5 -1
package/ts/mod_open/index.ts
CHANGED
|
@@ -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 =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
64
|
+
const enabledServices = response.value || ['mongodb', 'minio', 'elasticsearch'];
|
|
65
|
+
this.enabledServices = enabledServices;
|
|
65
66
|
|
|
66
67
|
// Save to .smartconfig.json
|
|
67
|
-
await this.saveServiceConfiguration(
|
|
68
|
+
await this.saveServiceConfiguration(enabledServices);
|
|
68
69
|
} else {
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
907
|
+
const enabledServices = response.value || ['mongodb', 'minio', 'elasticsearch'];
|
|
908
|
+
this.enabledServices = enabledServices;
|
|
906
909
|
|
|
907
910
|
// Save to .smartconfig.json
|
|
908
|
-
await this.saveServiceConfiguration(
|
|
911
|
+
await this.saveServiceConfiguration(enabledServices);
|
|
909
912
|
|
|
910
913
|
logger.log('ok', '✅ Service configuration updated');
|
|
911
914
|
}
|
package/ts/mod_template/index.ts
CHANGED
|
@@ -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
|
};
|