@builder.io/sdk-solid 1.0.20 → 1.0.21

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/index.d.ts CHANGED
@@ -938,11 +938,11 @@ interface GetContentOptions {
938
938
  /**
939
939
  * Optional override of the `fetch` function. (Defaults to global `fetch`)
940
940
  */
941
- fetch?: typeof global.fetch;
941
+ fetch?: (input: string, init?: object) => Promise<any>;
942
942
  /**
943
- * Optional fetch options to be passed to the `fetch` function.
943
+ * Optional fetch options to be passed as the second argument to the `fetch` function.
944
944
  */
945
- fetchOptions?: RequestInit;
945
+ fetchOptions?: object;
946
946
  }
947
947
 
948
948
  type GetBuilderPropsOptions = (Omit<GetContentOptions, 'model'> & {
@@ -4450,7 +4450,7 @@ function isFromTrustedHost(trustedHosts, e) {
4450
4450
  }
4451
4451
 
4452
4452
  // src/constants/sdk-version.ts
4453
- var SDK_VERSION = "1.0.20";
4453
+ var SDK_VERSION = "1.0.21";
4454
4454
 
4455
4455
  // src/functions/register.ts
4456
4456
  var registry = {};
@@ -4033,7 +4033,7 @@ function isFromTrustedHost(trustedHosts, e) {
4033
4033
  }
4034
4034
 
4035
4035
  // src/constants/sdk-version.ts
4036
- var SDK_VERSION = "1.0.20";
4036
+ var SDK_VERSION = "1.0.21";
4037
4037
 
4038
4038
  // src/functions/register.ts
4039
4039
  var registry = {};
@@ -4435,7 +4435,7 @@ function isFromTrustedHost(trustedHosts, e) {
4435
4435
  }
4436
4436
 
4437
4437
  // src/constants/sdk-version.ts
4438
- var SDK_VERSION = "1.0.20";
4438
+ var SDK_VERSION = "1.0.21";
4439
4439
 
4440
4440
  // src/functions/register.ts
4441
4441
  var registry = {};
@@ -4018,7 +4018,7 @@ function isFromTrustedHost(trustedHosts, e) {
4018
4018
  }
4019
4019
 
4020
4020
  // src/constants/sdk-version.ts
4021
- var SDK_VERSION = "1.0.20";
4021
+ var SDK_VERSION = "1.0.21";
4022
4022
 
4023
4023
  // src/functions/register.ts
4024
4024
  var registry = {};
package/lib/edge/dev.js CHANGED
@@ -7603,7 +7603,7 @@ function isFromTrustedHost(trustedHosts, e) {
7603
7603
  }
7604
7604
 
7605
7605
  // src/constants/sdk-version.ts
7606
- var SDK_VERSION = "1.0.20";
7606
+ var SDK_VERSION = "1.0.21";
7607
7607
 
7608
7608
  // src/functions/register.ts
7609
7609
  var registry = {};
package/lib/edge/dev.jsx CHANGED
@@ -7188,7 +7188,7 @@ function isFromTrustedHost(trustedHosts, e) {
7188
7188
  }
7189
7189
 
7190
7190
  // src/constants/sdk-version.ts
7191
- var SDK_VERSION = "1.0.20";
7191
+ var SDK_VERSION = "1.0.21";
7192
7192
 
7193
7193
  // src/functions/register.ts
7194
7194
  var registry = {};
package/lib/edge/index.js CHANGED
@@ -7588,7 +7588,7 @@ function isFromTrustedHost(trustedHosts, e) {
7588
7588
  }
7589
7589
 
7590
7590
  // src/constants/sdk-version.ts
7591
- var SDK_VERSION = "1.0.20";
7591
+ var SDK_VERSION = "1.0.21";
7592
7592
 
7593
7593
  // src/functions/register.ts
7594
7594
  var registry = {};
@@ -7173,7 +7173,7 @@ function isFromTrustedHost(trustedHosts, e) {
7173
7173
  }
7174
7174
 
7175
7175
  // src/constants/sdk-version.ts
7176
- var SDK_VERSION = "1.0.20";
7176
+ var SDK_VERSION = "1.0.21";
7177
7177
 
7178
7178
  // src/functions/register.ts
7179
7179
  var registry = {};
package/lib/node/dev.js CHANGED
@@ -381,8 +381,28 @@ if (typeof output === 'object' && output !== null) {
381
381
  output;
382
382
  `;
383
383
  };
384
+ var IVM_INSTANCE = null;
385
+ var getIvm = () => {
386
+ try {
387
+ if (IVM_INSTANCE)
388
+ return IVM_INSTANCE;
389
+ const dynRequiredIvm = safeDynamicRequire("isolated-vm");
390
+ if (dynRequiredIvm)
391
+ return dynRequiredIvm;
392
+ } catch (error2) {
393
+ logger.error("isolated-vm import error.", error2);
394
+ }
395
+ throw new Error(`${MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on Node server.
396
+
397
+ In certain Node environments, the SDK requires additional initialization steps. This can be achieved by
398
+ importing and calling \`initializeNodeRuntime()\` from "@builder.io/sdk-react/node/init". This must be done in
399
+ a server-only execution path within your application.
400
+
401
+ Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
402
+ `);
403
+ };
384
404
  var getIsolateContext = () => {
385
- const ivm = safeDynamicRequire("isolated-vm");
405
+ const ivm = getIvm();
386
406
  const isolate = new ivm.Isolate({
387
407
  memoryLimit: 128
388
408
  });
@@ -397,7 +417,7 @@ var runInNode = ({
397
417
  rootSetState,
398
418
  rootState
399
419
  }) => {
400
- const ivm = safeDynamicRequire("isolated-vm");
420
+ const ivm = getIvm();
401
421
  const state = fastClone({
402
422
  ...rootState,
403
423
  ...localState
@@ -4575,7 +4595,7 @@ function isFromTrustedHost(trustedHosts, e) {
4575
4595
  }
4576
4596
 
4577
4597
  // src/constants/sdk-version.ts
4578
- var SDK_VERSION = "1.0.20";
4598
+ var SDK_VERSION = "1.0.21";
4579
4599
 
4580
4600
  // src/functions/register.ts
4581
4601
  var registry = {};
package/lib/node/dev.jsx CHANGED
@@ -370,8 +370,28 @@ if (typeof output === 'object' && output !== null) {
370
370
  output;
371
371
  `;
372
372
  };
373
+ var IVM_INSTANCE = null;
374
+ var getIvm = () => {
375
+ try {
376
+ if (IVM_INSTANCE)
377
+ return IVM_INSTANCE;
378
+ const dynRequiredIvm = safeDynamicRequire("isolated-vm");
379
+ if (dynRequiredIvm)
380
+ return dynRequiredIvm;
381
+ } catch (error2) {
382
+ logger.error("isolated-vm import error.", error2);
383
+ }
384
+ throw new Error(`${MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on Node server.
385
+
386
+ In certain Node environments, the SDK requires additional initialization steps. This can be achieved by
387
+ importing and calling \`initializeNodeRuntime()\` from "@builder.io/sdk-react/node/init". This must be done in
388
+ a server-only execution path within your application.
389
+
390
+ Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
391
+ `);
392
+ };
373
393
  var getIsolateContext = () => {
374
- const ivm = safeDynamicRequire("isolated-vm");
394
+ const ivm = getIvm();
375
395
  const isolate = new ivm.Isolate({
376
396
  memoryLimit: 128
377
397
  });
@@ -386,7 +406,7 @@ var runInNode = ({
386
406
  rootSetState,
387
407
  rootState
388
408
  }) => {
389
- const ivm = safeDynamicRequire("isolated-vm");
409
+ const ivm = getIvm();
390
410
  const state = fastClone({
391
411
  ...rootState,
392
412
  ...localState
@@ -4160,7 +4180,7 @@ function isFromTrustedHost(trustedHosts, e) {
4160
4180
  }
4161
4181
 
4162
4182
  // src/constants/sdk-version.ts
4163
- var SDK_VERSION = "1.0.20";
4183
+ var SDK_VERSION = "1.0.21";
4164
4184
 
4165
4185
  // src/functions/register.ts
4166
4186
  var registry = {};
package/lib/node/index.js CHANGED
@@ -128,6 +128,7 @@ function getBlockComponentOptions(block) {
128
128
  }
129
129
 
130
130
  // src/helpers/logger.ts
131
+ var MSG_PREFIX = "[Builder.io]: ";
131
132
  var logger = {
132
133
  log: (...message) => void 0,
133
134
  error: (...message) => void 0,
@@ -379,8 +380,28 @@ if (typeof output === 'object' && output !== null) {
379
380
  output;
380
381
  `;
381
382
  };
383
+ var IVM_INSTANCE = null;
384
+ var getIvm = () => {
385
+ try {
386
+ if (IVM_INSTANCE)
387
+ return IVM_INSTANCE;
388
+ const dynRequiredIvm = safeDynamicRequire("isolated-vm");
389
+ if (dynRequiredIvm)
390
+ return dynRequiredIvm;
391
+ } catch (error2) {
392
+ logger.error("isolated-vm import error.", error2);
393
+ }
394
+ throw new Error(`${MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on Node server.
395
+
396
+ In certain Node environments, the SDK requires additional initialization steps. This can be achieved by
397
+ importing and calling \`initializeNodeRuntime()\` from "@builder.io/sdk-react/node/init". This must be done in
398
+ a server-only execution path within your application.
399
+
400
+ Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
401
+ `);
402
+ };
382
403
  var getIsolateContext = () => {
383
- const ivm = safeDynamicRequire("isolated-vm");
404
+ const ivm = getIvm();
384
405
  const isolate = new ivm.Isolate({
385
406
  memoryLimit: 128
386
407
  });
@@ -395,7 +416,7 @@ var runInNode = ({
395
416
  rootSetState,
396
417
  rootState
397
418
  }) => {
398
- const ivm = safeDynamicRequire("isolated-vm");
419
+ const ivm = getIvm();
399
420
  const state = fastClone({
400
421
  ...rootState,
401
422
  ...localState
@@ -4559,7 +4580,7 @@ function isFromTrustedHost(trustedHosts, e) {
4559
4580
  }
4560
4581
 
4561
4582
  // src/constants/sdk-version.ts
4562
- var SDK_VERSION = "1.0.20";
4583
+ var SDK_VERSION = "1.0.21";
4563
4584
 
4564
4585
  // src/functions/register.ts
4565
4586
  var registry = {};
@@ -114,6 +114,7 @@ function getBlockComponentOptions(block) {
114
114
  }
115
115
 
116
116
  // src/helpers/logger.ts
117
+ var MSG_PREFIX = "[Builder.io]: ";
117
118
  var logger = {
118
119
  log: (...message) => void 0,
119
120
  error: (...message) => void 0,
@@ -368,8 +369,28 @@ if (typeof output === 'object' && output !== null) {
368
369
  output;
369
370
  `;
370
371
  };
372
+ var IVM_INSTANCE = null;
373
+ var getIvm = () => {
374
+ try {
375
+ if (IVM_INSTANCE)
376
+ return IVM_INSTANCE;
377
+ const dynRequiredIvm = safeDynamicRequire("isolated-vm");
378
+ if (dynRequiredIvm)
379
+ return dynRequiredIvm;
380
+ } catch (error2) {
381
+ logger.error("isolated-vm import error.", error2);
382
+ }
383
+ throw new Error(`${MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on Node server.
384
+
385
+ In certain Node environments, the SDK requires additional initialization steps. This can be achieved by
386
+ importing and calling \`initializeNodeRuntime()\` from "@builder.io/sdk-react/node/init". This must be done in
387
+ a server-only execution path within your application.
388
+
389
+ Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
390
+ `);
391
+ };
371
392
  var getIsolateContext = () => {
372
- const ivm = safeDynamicRequire("isolated-vm");
393
+ const ivm = getIvm();
373
394
  const isolate = new ivm.Isolate({
374
395
  memoryLimit: 128
375
396
  });
@@ -384,7 +405,7 @@ var runInNode = ({
384
405
  rootSetState,
385
406
  rootState
386
407
  }) => {
387
- const ivm = safeDynamicRequire("isolated-vm");
408
+ const ivm = getIvm();
388
409
  const state = fastClone({
389
410
  ...rootState,
390
411
  ...localState
@@ -4144,7 +4165,7 @@ function isFromTrustedHost(trustedHosts, e) {
4144
4165
  }
4145
4166
 
4146
4167
  // src/constants/sdk-version.ts
4147
- var SDK_VERSION = "1.0.20";
4168
+ var SDK_VERSION = "1.0.21";
4148
4169
 
4149
4170
  // src/functions/register.ts
4150
4171
  var registry = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-solid",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist",