@spark-ui/cli-utils 2.14.0-beta.4 → 2.14.0-beta.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spark-ui/cli-utils",
3
- "version": "2.14.0-beta.4",
3
+ "version": "2.14.0-beta.6",
4
4
  "description": "Spark CLI utils",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -18,11 +18,11 @@ export async function adoption(options) {
18
18
 
19
19
  config = {
20
20
  adoption: merge(
21
- { ...defaultConfig },
21
+ { ...config.adoption },
22
22
  {
23
- ...optionsConfig.adoption,
24
- imports: optionsConfig.imports || defaultConfig.imports,
25
- extensions: optionsConfig.extensions || defaultConfig.extensions,
23
+ ...optionsConfig,
24
+ imports: optionsConfig.imports || config.imports,
25
+ extensions: optionsConfig.extensions || config.extensions,
26
26
  }
27
27
  ),
28
28
  }
@@ -1,4 +1,7 @@
1
1
  import { existsSync } from 'fs'
2
+ import merge from 'lodash.merge'
3
+
4
+ import * as defaultConfig from './config.mjs'
2
5
 
3
6
  export async function loadConfig(configFileRoute, { logger }) {
4
7
  try {
@@ -6,16 +9,24 @@ export async function loadConfig(configFileRoute, { logger }) {
6
9
  logger.info('ℹ️ Loading spark-ui custom configuration file')
7
10
  const { default: customConfig } = await import(configFileRoute)
8
11
 
9
- return customConfig
12
+ const config = {
13
+ adoption: merge(defaultConfig, {
14
+ ...customConfig.adoption,
15
+ imports: customConfig.imports || defaultConfig.imports,
16
+ extensions: customConfig.extensions || defaultConfig.extensions,
17
+ }),
18
+ }
19
+
20
+ return config
10
21
  } else {
11
22
  logger.warn('⚠️ No custom configuration file found')
12
23
  logger.info('ℹ️ Loading default configuration')
13
24
 
14
- return {}
25
+ return { ...defaultConfig }
15
26
  }
16
27
  } catch (error) {
17
28
  logger.error('💥 Something went wrong loading the custom configuration file')
18
29
 
19
- return {}
30
+ return { ...defaultConfig }
20
31
  }
21
32
  }