@symbo.ls/create 2.11.276 → 2.11.291

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/dist/cjs/index.js CHANGED
@@ -43,10 +43,10 @@ var import_options = __toESM(require("./options"), 1);
43
43
  var import_dynamic = __toESM(require("@symbo.ls/init/dynamic.json"), 1);
44
44
  var import_createDomql = require("./createDomql");
45
45
  const SYMBOLS_KEY = process.env.SYMBOLS_KEY;
46
- const mergeWithLocalFile = (options, optionsExternalFile) => {
47
- const rcfile = (0, import_utils.isObject)(optionsExternalFile) ? optionsExternalFile : import_dynamic.default || {};
48
- return (0, import_utils.deepMerge)(options, rcfile);
49
- };
46
+ const mergeWithLocalFile = (options, optionsExternalFile) => (0, import_utils.deepMerge)(
47
+ options,
48
+ (0, import_utils.isObject)(optionsExternalFile) ? optionsExternalFile : import_dynamic.default || {}
49
+ );
50
50
  const create = (App, options = import_options.default, optionsExternalFile) => {
51
51
  const redefinedOptions = { ...import_options.default, ...mergeWithLocalFile(options, optionsExternalFile) };
52
52
  const domqlApp = (0, import_createDomql.createDomqlElement)(App, redefinedOptions);
@@ -80,7 +80,16 @@ const prepareState = (options, App) => {
80
80
  return (0, import_utils.deepCloneWithExtnd)(state);
81
81
  };
82
82
  const preparePages = (options) => {
83
- return options.pages || {};
83
+ const pages = options.pages || {};
84
+ Object.keys(pages).filter((v) => !v.startsWith("/")).forEach((v) => {
85
+ if (v === "main")
86
+ pages["/"] = pages.main;
87
+ else {
88
+ pages["/" + v] = pages[v];
89
+ delete pages[v];
90
+ }
91
+ });
92
+ return pages;
84
93
  };
85
94
  const prepareDocument = (options) => {
86
95
  if (typeof document === "undefined") {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/create",
3
- "version": "2.11.276",
3
+ "version": "2.11.291",
4
4
  "license": "MIT",
5
- "gitHead": "ce33b49ad632d606b7304fbda48bade4aa368667",
5
+ "gitHead": "54f3dd0f443356a9cc26b3005ad352d5333f0c11",
6
6
  "files": [
7
7
  "src",
8
8
  "dist"
package/src/index.js CHANGED
@@ -14,10 +14,10 @@ import { createDomqlElement } from './createDomql'
14
14
 
15
15
  const SYMBOLS_KEY = process.env.SYMBOLS_KEY
16
16
 
17
- const mergeWithLocalFile = (options, optionsExternalFile) => {
18
- const rcfile = isObject(optionsExternalFile) ? optionsExternalFile : DYNAMIC_JSON || {}
19
- return deepMerge(options, rcfile)
20
- }
17
+ const mergeWithLocalFile = (options, optionsExternalFile) => deepMerge(
18
+ options,
19
+ isObject(optionsExternalFile) ? optionsExternalFile : DYNAMIC_JSON || {}
20
+ )
21
21
 
22
22
  export const create = (App, options = DEFAULT_CREATE_OPTIONS, optionsExternalFile) => {
23
23
  const redefinedOptions = { ...DEFAULT_CREATE_OPTIONS, ...mergeWithLocalFile(options, optionsExternalFile) }
package/src/prepare.js CHANGED
@@ -48,7 +48,17 @@ export const prepareState = (options, App) => {
48
48
  }
49
49
 
50
50
  export const preparePages = options => {
51
- return options.pages || {}
51
+ const pages = options.pages || {}
52
+ Object.keys(pages)
53
+ .filter(v => !v.startsWith('/'))
54
+ .forEach(v => {
55
+ if (v === 'main') pages['/'] = pages.main
56
+ else {
57
+ pages['/' + v] = pages[v]
58
+ delete pages[v]
59
+ }
60
+ })
61
+ return pages
52
62
  }
53
63
 
54
64
  export const prepareDocument = options => {