@symbo.ls/create 2.27.8 → 2.27.15

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.
@@ -45,7 +45,7 @@ var import_initEmotion = require("./initEmotion");
45
45
  var uikit = __toESM(require("@symbo.ls/uikit"), 1);
46
46
  var utils = __toESM(require("./utilImports"), 1);
47
47
  var routerUtils = __toESM(require("@domql/router"), 1);
48
- const ENV = "development";
48
+ // @preserve-env
49
49
  const prepareWindow = (context) => {
50
50
  if (typeof window === "undefined") window = globalThis || {};
51
51
  if (typeof document === "undefined") {
@@ -75,7 +75,14 @@ const prepareComponents = (context) => {
75
75
  return context.components ? { ...UIkitWithPrefix(), ...context.components } : UIkitWithPrefix();
76
76
  };
77
77
  const prepareUtils = (context) => {
78
- return { ...utils, ...routerUtils, ...utils.scratchUtils, ...context.utils, ...context.snippets, ...context.functions };
78
+ return {
79
+ ...utils,
80
+ ...routerUtils,
81
+ ...utils.scratchUtils,
82
+ ...context.utils,
83
+ ...context.snippets,
84
+ ...context.functions
85
+ };
79
86
  };
80
87
  const prepareMethods = (context) => {
81
88
  return {
@@ -101,7 +108,7 @@ const prepareDependencies = ({
101
108
  if (version === "loading" || version === "error") {
102
109
  continue;
103
110
  }
104
- const random = ENV === "development" ? `?${Math.random()}` : "";
111
+ const random = (0, import_utils.isDevelopment)() ? `?${Math.random()}` : "";
105
112
  let url = `https://pkg.symbo.ls/${dependency}/${version}.js${random}`;
106
113
  if (dependency.split("/").length > 2 || !onlyDotsAndNumbers(version)) {
107
114
  url = `https://pkg.symbo.ls/${dependency}${random}`;
@@ -130,7 +137,7 @@ const prepareRequire = (packages, ctx) => {
130
137
  const documentOpts = ctx2.document || document;
131
138
  const windowOpts2 = ctx2.window || window;
132
139
  if (!windowOpts2.packages[key]) {
133
- const random = ENV === "development" ? `?${Math.random()}` : "";
140
+ const random = (0, import_utils.isDevelopment)() ? `?${Math.random()}` : "";
134
141
  if (dependenciesOnDemand && dependenciesOnDemand[key]) {
135
142
  const version = dependenciesOnDemand[key];
136
143
  const url = `https://pkg.symbo.ls/${key}/${version}.js${random}`;
@@ -22,13 +22,14 @@ import {
22
22
  deepMerge,
23
23
  deepClone,
24
24
  merge,
25
- checkIfKeyIsComponent
25
+ checkIfKeyIsComponent,
26
+ isDevelopment
26
27
  } from "@domql/utils";
27
28
  import { initEmotion } from "./initEmotion";
28
29
  import * as uikit from "@symbo.ls/uikit";
29
30
  import * as utils from "./utilImports";
30
31
  import * as routerUtils from "@domql/router";
31
- const ENV = "development";
32
+ // @preserve-env
32
33
  const prepareWindow = (context) => {
33
34
  if (typeof window === "undefined") window = globalThis || {};
34
35
  if (typeof document === "undefined") {
@@ -83,7 +84,7 @@ const prepareDependencies = ({
83
84
  if (version === "loading" || version === "error") {
84
85
  continue;
85
86
  }
86
- const random = ENV === "development" ? `?${Math.random()}` : "";
87
+ const random = isDevelopment() ? `?${Math.random()}` : "";
87
88
  let url = `https://pkg.symbo.ls/${dependency}/${version}.js${random}`;
88
89
  if (dependency.split("/").length > 2 || !onlyDotsAndNumbers(version)) {
89
90
  url = `https://pkg.symbo.ls/${dependency}${random}`;
@@ -112,7 +113,7 @@ const prepareRequire = (packages, ctx) => {
112
113
  const documentOpts = ctx2.document || document;
113
114
  const windowOpts2 = ctx2.window || window;
114
115
  if (!windowOpts2.packages[key]) {
115
- const random = ENV === "development" ? `?${Math.random()}` : "";
116
+ const random = isDevelopment() ? `?${Math.random()}` : "";
116
117
  if (dependenciesOnDemand && dependenciesOnDemand[key]) {
117
118
  const version = dependenciesOnDemand[key];
118
119
  const url = `https://pkg.symbo.ls/${key}/${version}.js${random}`;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/create",
3
- "version": "2.27.8",
3
+ "version": "2.27.15",
4
4
  "license": "MIT",
5
- "gitHead": "e783fd54228d5c7aaab9d4b5624199a17a6c4713",
5
+ "gitHead": "aa562640d37f34a66e567c177be8f6ab6b41eccc",
6
6
  "type": "module",
7
7
  "module": "src/index.js",
8
8
  "main": "src/index.js",
@@ -10,9 +10,9 @@
10
10
  "jsdelivr": "dist/iife/index.js",
11
11
  "exports": {
12
12
  ".": {
13
- "default": "./dist/esm/index.js",
14
13
  "import": "./dist/esm/index.js",
15
- "require": "./dist/cjs/index.js"
14
+ "require": "./dist/cjs/index.js",
15
+ "default": "./dist/esm/index.js"
16
16
  }
17
17
  },
18
18
  "source": "src/index.js",
@@ -22,24 +22,24 @@
22
22
  ],
23
23
  "scripts": {
24
24
  "copy:package:cjs": "cp ../../build/package-cjs.json dist/cjs/package.json",
25
- "build:esm": "cross-env NODE_ENV=$NODE_ENV npx esbuild src/*.js --target=es2017 --format=esm --outdir=dist/esm",
26
- "build:cjs": "cross-env NODE_ENV=$NODE_ENV npx esbuild src/*.js --target=node16 --format=cjs --outdir=dist/cjs",
27
- "build:iife": "cross-env NODE_ENV=$NODE_ENV npx esbuild src/*.js --target=node16 --format=iife --outdir=dist/iife",
25
+ "build:esm": "npx cross-env NODE_ENV=$NODE_ENV npx esbuild src/*.js --target=es2017 --format=esm --outdir=dist/esm",
26
+ "build:cjs": "npx cross-env NODE_ENV=$NODE_ENV npx esbuild src/*.js --target=node16 --format=cjs --outdir=dist/cjs",
27
+ "build:iife": "npx cross-env NODE_ENV=$NODE_ENV npx esbuild src/*.js --target=node16 --format=iife --outdir=dist/iife",
28
28
  "build": "rimraf -I dist; npm run build:cjs; npm run build:esm",
29
29
  "prepublish": "npm run build; npm run copy:package:cjs"
30
30
  },
31
31
  "dependencies": {
32
- "@domql/emotion": "^2.27.8",
33
- "@domql/event": "^2.27.8",
34
- "@domql/report": "^2.27.8",
35
- "@domql/router": "^2.27.8",
36
- "@symbo.ls/fetch": "^2.27.8",
37
- "@symbo.ls/init": "^2.27.8",
38
- "@symbo.ls/scratch": "^2.27.8",
39
- "@symbo.ls/sync": "^2.27.8",
40
- "@symbo.ls/uikit": "^2.27.8",
41
- "@symbo.ls/utils": "^2.27.8",
42
- "domql": "^2.27.8"
32
+ "@domql/emotion": "^2.27.15",
33
+ "@domql/event": "^2.27.15",
34
+ "@domql/report": "^2.27.15",
35
+ "@domql/router": "^2.27.15",
36
+ "@symbo.ls/fetch": "^2.27.15",
37
+ "@symbo.ls/init": "^2.27.15",
38
+ "@symbo.ls/scratch": "^2.27.15",
39
+ "@symbo.ls/sync": "^2.27.15",
40
+ "@symbo.ls/uikit": "^2.27.15",
41
+ "@symbo.ls/utils": "^2.27.15",
42
+ "domql": "^2.27.15"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@babel/core": "^7.26.0"
package/src/prepare.js CHANGED
@@ -5,7 +5,8 @@ import {
5
5
  deepMerge,
6
6
  deepClone,
7
7
  merge,
8
- checkIfKeyIsComponent
8
+ checkIfKeyIsComponent,
9
+ isDevelopment
9
10
  } from '@domql/utils'
10
11
  import { initEmotion } from './initEmotion'
11
12
 
@@ -13,11 +14,11 @@ import * as uikit from '@symbo.ls/uikit'
13
14
  import * as utils from './utilImports'
14
15
  import * as routerUtils from '@domql/router'
15
16
 
16
- const ENV = process.env.NODE_ENV
17
+ // @preserve-env
17
18
 
18
- export const prepareWindow = (context) => {
19
- if (typeof (window) === 'undefined') window = globalThis || {} // eslint-disable-line
20
- if (typeof (document) === 'undefined') {
19
+ export const prepareWindow = context => {
20
+ if (typeof window === 'undefined') window = globalThis || {} // eslint-disable-line
21
+ if (typeof document === 'undefined') {
21
22
  if (!window.document) window.document = globalThis.document || { body: {} }
22
23
  document = window.document // eslint-disable-line
23
24
  }
@@ -44,20 +45,34 @@ export const UIkitWithPrefix = () => {
44
45
  }
45
46
 
46
47
  export const prepareComponents = context => {
47
- return context.components ? { ...UIkitWithPrefix(), ...context.components } : UIkitWithPrefix()
48
+ return context.components
49
+ ? { ...UIkitWithPrefix(), ...context.components }
50
+ : UIkitWithPrefix()
48
51
  }
49
52
 
50
53
  export const prepareUtils = context => {
51
- return { ...utils, ...routerUtils, ...utils.scratchUtils, ...context.utils, ...context.snippets, ...context.functions }
54
+ return {
55
+ ...utils,
56
+ ...routerUtils,
57
+ ...utils.scratchUtils,
58
+ ...context.utils,
59
+ ...context.snippets,
60
+ ...context.functions
61
+ }
52
62
  }
53
63
 
54
- export const prepareMethods = (context) => {
64
+ export const prepareMethods = context => {
55
65
  return {
56
66
  ...(context.methods || {}),
57
67
  require: context.utils.require,
58
68
  requireOnDemand: context.utils.requireOnDemand,
59
69
  call: function (fnKey, ...args) {
60
- return (context.utils[fnKey] || context.functions[fnKey] || context.methods[fnKey] || context.snippets[fnKey])?.call(this, ...args)
70
+ return (
71
+ context.utils[fnKey] ||
72
+ context.functions[fnKey] ||
73
+ context.methods[fnKey] ||
74
+ context.snippets[fnKey]
75
+ )?.call(this, ...args)
61
76
  }
62
77
  }
63
78
  }
@@ -77,7 +92,7 @@ export const prepareDependencies = ({
77
92
  continue
78
93
  }
79
94
 
80
- const random = ENV === 'development' ? `?${Math.random()}` : ''
95
+ const random = isDevelopment() ? `?${Math.random()}` : ''
81
96
  let url = `https://pkg.symbo.ls/${dependency}/${version}.js${random}`
82
97
 
83
98
  if (dependency.split('/').length > 2 || !onlyDotsAndNumbers(version)) {
@@ -113,7 +128,7 @@ export const prepareRequire = (packages, ctx) => {
113
128
  const documentOpts = ctx.document || document
114
129
  const windowOpts = ctx.window || window
115
130
  if (!windowOpts.packages[key]) {
116
- const random = ENV === 'development' ? `?${Math.random()}` : ''
131
+ const random = isDevelopment() ? `?${Math.random()}` : ''
117
132
  if (dependenciesOnDemand && dependenciesOnDemand[key]) {
118
133
  const version = dependenciesOnDemand[key]
119
134
  const url = `https://pkg.symbo.ls/${key}/${version}.js${random}`