@spark-ui/cli-utils 2.14.0-beta.5 → 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 +1 -1
- package/src/scan/index.mjs +1 -1
- package/src/scan/loadConfig.mjs +14 -3
package/package.json
CHANGED
package/src/scan/index.mjs
CHANGED
|
@@ -20,7 +20,7 @@ export async function adoption(options) {
|
|
|
20
20
|
adoption: merge(
|
|
21
21
|
{ ...config.adoption },
|
|
22
22
|
{
|
|
23
|
-
...optionsConfig
|
|
23
|
+
...optionsConfig,
|
|
24
24
|
imports: optionsConfig.imports || config.imports,
|
|
25
25
|
extensions: optionsConfig.extensions || config.extensions,
|
|
26
26
|
}
|
package/src/scan/loadConfig.mjs
CHANGED
|
@@ -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
|
-
|
|
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
|
}
|