@platformatic/generators 1.13.3 → 1.13.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.
@@ -93,8 +93,10 @@ class BaseGenerator extends FileGenerator {
93
93
  if (!config) {
94
94
  this.config = this.getDefaultConfig()
95
95
  }
96
+ const oldConfig = this.config
96
97
  this.config = {
97
98
  ...this.getDefaultConfig(),
99
+ ...oldConfig,
98
100
  ...config
99
101
  }
100
102
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/generators",
3
- "version": "1.13.3",
3
+ "version": "1.13.5",
4
4
  "description": "Main classes and utils for generators.",
5
5
  "main": "index.js",
6
6
  "keywords": [],
@@ -143,6 +143,33 @@ test('setConfig', async (t) => {
143
143
  envPrefix: '',
144
144
  tests: false
145
145
  })
146
+
147
+ // update only some fields
148
+ bg.setConfig({
149
+ hostname: '123.123.123.123',
150
+ port: 3000
151
+ })
152
+
153
+ bg.setConfig({
154
+ port: 1234
155
+ })
156
+
157
+ assert.deepEqual(bg.config, {
158
+ port: 1234,
159
+ hostname: '123.123.123.123',
160
+ plugin: false,
161
+ typescript: false,
162
+ initGitRepository: false,
163
+ staticWorkspaceGitHubActions: false,
164
+ dynamicWorkspaceGitHubActions: false,
165
+ env: {},
166
+ dependencies: {},
167
+ devDependencies: {},
168
+ isRuntimeContext: false,
169
+ serviceName: '',
170
+ envPrefix: '',
171
+ tests: false
172
+ })
146
173
  })
147
174
 
148
175
  test('should append env values', async (t) => {
package/test/runner.js CHANGED
@@ -13,8 +13,14 @@ const files = [
13
13
  ...glob(path.join(__dirname, 'cli', '*.test.mjs'))
14
14
  ]
15
15
 
16
- run({
16
+ const stream = run({
17
17
  files,
18
18
  concurrency: 1,
19
19
  timeout: 30000
20
- }).compose(reporter).pipe(process.stdout)
20
+ })
21
+
22
+ stream.on('test:fail', () => {
23
+ process.exitCode = 1
24
+ })
25
+
26
+ stream.compose(reporter).pipe(process.stdout)