@builder.io/sdk-solid 0.5.2 → 0.5.4

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.
@@ -2,7 +2,7 @@ import { logger } from "../../helpers/logger.js";
2
2
  import { isBrowser } from "../is-browser.js";
3
3
  import { isEditing } from "../is-editing.js";
4
4
  import { isNonNodeServer } from "../is-non-node-server.js";
5
- import { runInNonNode } from "./non-node-runtime.js";
5
+ import { runInNonNode } from "./non-node-runtime/index.js";
6
6
  function evaluate({
7
7
  code,
8
8
  context,
@@ -0,0 +1,18 @@
1
+ import { logger } from "../../../helpers/logger.js";
2
+ import { isNonNodeServer } from "../../is-non-node-server.js";
3
+ let runInNonNode;
4
+ if (isNonNodeServer()) {
5
+ import("./non-node-runtime.js").then(m => {
6
+ runInNonNode = m.runInNonNode;
7
+ }).catch(err => {
8
+ const ERROR_MESSAGE = `Error importing JS interpreter for non-Node.js runtimes. Make sure \`js-interpreter\` is installed.
9
+ Read more here: https://github.com/BuilderIO/builder/tree/main/packages/sdks/README.md#non-nodejs-runtimes-edge-serverless
10
+ `;
11
+ logger.error(ERROR_MESSAGE, err);
12
+ runInNonNode = (..._args) => {
13
+ logger.error(ERROR_MESSAGE);
14
+ return void 0;
15
+ };
16
+ });
17
+ }
18
+ export { runInNonNode }
@@ -15,9 +15,9 @@ var __spreadValues = (a, b) => {
15
15
  }
16
16
  return a;
17
17
  };
18
- import { logger } from "../../helpers/logger";
19
- import { set } from "../set";
20
- import Interpreter from "./interpreter.js";
18
+ import { logger } from "../../../helpers/logger";
19
+ import { set } from "../../set";
20
+ import Interpreter from "../acorn-interpreter.js";
21
21
  const processCode = code => {
22
22
  return code.split("\n").map(line => {
23
23
  const trimmed = line.trim();