generator-codedesignplus 0.1.0 → 0.1.1-alpha.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.
@@ -39,15 +39,16 @@ export default class AppSettingsGenerator {
39
39
  });
40
40
 
41
41
  try {
42
- this.updateConfigVault(path.join('tools', 'vault','config-vault.ps1'), options);
43
- this.updateConfigVault(path.join('tools', 'vault','config-vault.sh'), options);
42
+ this._updateConfigVault(path.join('tools', 'vault','config-vault.ps1'), options);
43
+ this._updateConfigVault(path.join('tools', 'vault','config-vault.sh'), options);
44
+ this._updateReadme(options);
44
45
  } catch (error) {
45
46
  console.log('The vault configuration could not be updated.');
46
47
  console.log(error);
47
48
  }
48
49
  }
49
50
 
50
- updateConfigVault(file, options) {
51
+ _updateConfigVault(file, options) {
51
52
  const configFile = this._generator.destinationPath(file);
52
53
 
53
54
  let config = this._generator.fs.read(configFile);
@@ -64,6 +65,16 @@ export default class AppSettingsGenerator {
64
65
  this._generator.fs.write(configFile, config);
65
66
  }
66
67
 
68
+ _updateReadme(options) {
69
+ const readmeFile = this._generator.destinationPath('README.md');
70
+
71
+ let readme = this._generator.fs.read(readmeFile);
72
+
73
+ readme = readme.replace(/\bms-archetype\b/g, options.appSettings.appName);
74
+
75
+ this._generator.fs.write(readmeFile, readme);
76
+ }
77
+
67
78
  getArguments() {
68
79
  this._generator.option('description', { type: String, alias: 'd', required: true, description: 'A detailed description of the microservice providing clear context about its purpose.' });
69
80
  this._generator.option('contact-name', { type: String, alias: 'cn', required: true, description: 'Name of the contact person responsible for the microservice.' });
@@ -49,14 +49,14 @@ export default class Utils {
49
49
 
50
50
  answers = {
51
51
  ...answers,
52
- organization: archetypeValues.organization,
53
- microservice: archetypeValues.microservice,
54
- description: archetypeValues.description,
55
- organization: archetypeValues.organization,
52
+ organization: archetypeValues?.organization ?? answers.organization,
53
+ microservice: archetypeValues?.microservice ?? answers.microservice,
54
+ description: archetypeValues?.description ?? answers.description,
55
+ organization: archetypeValues?.organization ?? answers.organization,
56
56
  aggregate: answers.aggregate ?? archetypeValues.aggregate,
57
- vault: archetypeValues.vault,
58
- contactName: archetypeValues.contactName,
59
- contactEmail: archetypeValues.contactEmail
57
+ vault: archetypeValues?.vault ?? answers.vault,
58
+ contactName: archetypeValues?.contactName ?? answers.contactName,
59
+ contactEmail: archetypeValues?.contactEmail ?? answers.contactEmail
60
60
  };
61
61
 
62
62
  const organization = this.toPascalCase(answers.organization);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-codedesignplus",
3
- "version": "0.1.0",
3
+ "version": "0.1.1-alpha.1",
4
4
  "description": "Yeoman generator for creating microservices based on the CodeDesignPlus.Net.Microservice archetype.",
5
5
  "private": false,
6
6
  "main": "generators/index.mjs",