@symbo.ls/create 2.9.14 → 2.10.2

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 +11 -13
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -5,7 +5,7 @@ import { isString, overwriteDeep } from '@domql/utils'
5
5
 
6
6
  import * as smbls from '@symbo.ls/uikit'
7
7
  import { init, DYNAMIC_JSON } from '@symbo.ls/init'
8
- import { fetch } from '@symbo.ls/fetch'
8
+ import { fetchRemote } from '@symbo.ls/fetch'
9
9
 
10
10
  import { define } from './define'
11
11
 
@@ -16,32 +16,29 @@ const defaultOptions = {
16
16
  pages: {},
17
17
  system: {
18
18
  useReset: true,
19
- useVariable: true,
19
+ useVariable: true
20
20
  },
21
21
  components: {},
22
22
  define
23
23
  }
24
24
 
25
- export const create = (App, options = defaultOptions) => {
26
- const designSystem = init(options.system)
27
-
25
+ export const create = async (App, options = defaultOptions) => {
28
26
  const appIsKey = isString(App)
29
27
  const key = options.key || SYMBOLS_KEY || (appIsKey && App)
30
28
 
31
- console.log(App, options, key)
32
-
33
29
  if (appIsKey) App = {}
34
30
  if (key) {
35
31
  if (options.remote) {
36
- const data = fetch(key)
32
+ const data = await fetchRemote(key)
33
+ console.log(data)
37
34
  overwriteDeep(data, options)
38
35
  }
39
36
  }
40
37
 
38
+ const designSystem = init(options.system)
39
+
41
40
  DOM.define(options.define || define)
42
-
43
- console.log(options.state)
44
-
41
+
45
42
  return DOM.create({
46
43
  extend: [App, {
47
44
  routes: options.pages,
@@ -50,11 +47,12 @@ export const create = (App, options = defaultOptions) => {
50
47
  }, null, 'app', {
51
48
  extend: [smbls.Box],
52
49
  context: {
50
+ key,
53
51
  components: { ...smbls, ...options.components },
54
52
  state: options.state,
55
53
  pages: options.pages,
56
- system: designSystem,
57
- },
54
+ system: designSystem
55
+ }
58
56
  // TODO: move define here,
59
57
  })
60
58
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/create",
3
- "version": "2.9.14",
3
+ "version": "2.10.2",
4
4
  "license": "MIT",
5
- "gitHead": "edbae8426c20d913bcd13fde1b64b698a5f8e9f8",
5
+ "gitHead": "6bcf7d813bca3f561c2c2cd789eacb4a2a4e7ac5",
6
6
  "source": "index.js",
7
7
  "main": "index.js",
8
8
  "dependencies": {