@symbo.ls/create 2.10.121 → 2.10.125

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.
Files changed (2) hide show
  1. package/index.js +15 -2
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -14,6 +14,9 @@ import { fetchStateAsync, fetchProject } from '@symbo.ls/fetch'
14
14
  import { emotion as defaultEmotion, createEmotion } from '@symbo.ls/emotion'
15
15
  import { defaultDefine } from './define'
16
16
 
17
+ import DYNAMIC_JSON from '@symbo.ls/init/dynamic.json'
18
+ import { deepMerge, isObject } from '@domql/utils'
19
+
17
20
  const SYMBOLS_KEY = process.env.SYMBOLS_KEY
18
21
 
19
22
  const defaultOptions = {
@@ -36,8 +39,14 @@ const defaultOptions = {
36
39
  define: defaultDefine
37
40
  }
38
41
 
39
- export const create = async (App, options = defaultOptions) => {
42
+ const mergeWithLocalFile = (options, RC_FILE) => {
43
+ const rcfile = isObject(RC_FILE) ? RC_FILE : DYNAMIC_JSON || {}
44
+ return deepMerge(options, rcfile)
45
+ }
46
+
47
+ export const create = async (App, options = defaultOptions, RC_FILE) => {
40
48
  const appIsKey = domqlUtils.isString(App)
49
+ options = mergeWithLocalFile(options, RC_FILE)
41
50
  const key = options.key || SYMBOLS_KEY || (appIsKey ? App : '')
42
51
 
43
52
  if (appIsKey) App = {}
@@ -56,7 +65,9 @@ export const create = async (App, options = defaultOptions) => {
56
65
 
57
66
  const doc = options.parent || document
58
67
 
59
- const designSystem = init(options.system || {}, null, {
68
+ console.log(options)
69
+
70
+ const designSystem = init(options.system || {}, {
60
71
  key,
61
72
  emotion,
62
73
  verbose: options.verbose,
@@ -65,6 +76,8 @@ export const create = async (App, options = defaultOptions) => {
65
76
  ...initOptions
66
77
  })
67
78
 
79
+ console.log(designSystem)
80
+
68
81
  const domqlApp = DOM.create({
69
82
  extend: [App],
70
83
  routes: options.pages,
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/create",
3
- "version": "2.10.121",
3
+ "version": "2.10.125",
4
4
  "license": "MIT",
5
- "gitHead": "056cc9dcdadcc2022ec2b400eb1a8a3909d42380",
5
+ "gitHead": "57e1d4f1ba73357d2452a833b28ccdb51f219b2a",
6
6
  "source": "index.js",
7
7
  "main": "index.js",
8
8
  "dependencies": {