@symbo.ls/init 1.1.2 → 1.1.4

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": "@symbo.ls/init",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "license": "MIT",
5
5
  "gitHead": "54fa6500c697604b3f48ba33a573545d7bff35fa",
6
6
  "source": "src/index.js",
@@ -0,0 +1 @@
1
+ {}
package/src/index.js CHANGED
@@ -8,9 +8,13 @@ import {
8
8
  CONFIG
9
9
  } from '@symbo.ls/scratch'
10
10
 
11
+ import { deepMerge, isObject } from '@domql/utils'
12
+
11
13
  import CONFIG_DEFAULT from '@symbo.ls/config-default'
12
14
  import SYMBOLSRC_FILE from '../.symbolsrc.json'
13
15
 
16
+ import DYNAMIC_JSON from './dynamic.json'
17
+
14
18
  import createEmotion from '@emotion/css/create-instance'
15
19
  import { setClassname } from 'css-in-props'
16
20
 
@@ -18,10 +22,13 @@ const { css, injectGlobal } = createEmotion({
18
22
  key: 'smbls'
19
23
  })
20
24
 
21
- export const init = (config) => {
25
+ export const init = (config, rcfile) => {
22
26
  const defaultConfig = config || CONFIG_DEFAULT || SYMBOLSRC_FILE
23
27
 
24
- const conf = set({ verbose: false, ...defaultConfig })
28
+ const RC_FILE = isObject(rcfile) ? rcfile : DYNAMIC_JSON
29
+ const resultConfig = deepMerge(RC_FILE, defaultConfig)
30
+
31
+ const conf = set({ verbose: false, ...resultConfig })
25
32
  const FontFace = getFontFaceString(FONT)
26
33
 
27
34
  injectGlobal(FontFace)
@@ -30,6 +37,8 @@ export const init = (config) => {
30
37
  return conf
31
38
  }
32
39
 
40
+ export const updateReset = () => injectGlobal(RESET)
41
+
33
42
  export const setClass = props => setClassname(props, css)
34
43
 
35
44
  export { CONFIG }