@embeddable.com/sdk-core 2.4.12 → 2.4.13

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/lib/index.js CHANGED
@@ -358,11 +358,11 @@ const formatErrorPath = (path) => {
358
358
  return formatted;
359
359
  };
360
360
 
361
- const oraP$2 = import('ora');
361
+ const oraP$3 = import('ora');
362
362
  const EMB_TYPE_FILE_REGEX = /^(.*)\.type\.emb\.[jt]s$/;
363
363
  const EMB_OPTIONS_FILE_REGEX = /^(.*)\.options\.emb\.[jt]s$/;
364
364
  var buildTypes = async (ctx) => {
365
- const ora = (await oraP$2).default;
365
+ const ora = (await oraP$3).default;
366
366
  const progress = ora("building types...").start();
367
367
  await generate$1(ctx);
368
368
  await build$1(ctx);
@@ -4513,7 +4513,16 @@ var z = /*#__PURE__*/Object.freeze({
4513
4513
  });
4514
4514
 
4515
4515
  const CUBE_YAML_FILE_REGEX$1 = /^(.*)\.cube\.ya?ml$/;
4516
+ const checkNodeVersion$1 = () => {
4517
+ const [major, minor] = process.versions.node.split(".").map(Number);
4518
+ const engines = require("../package.json").engines.node;
4519
+ const [minMajor, minMinor] = engines.split(".").map(Number);
4520
+ if (major < minMajor || (major === minMajor && minor < minMinor)) {
4521
+ throw new Error(`Node version ${minMajor}.${minMinor} or higher is required. You are running ${major}.${minor}.`);
4522
+ }
4523
+ };
4516
4524
  var validate = async (ctx) => {
4525
+ checkNodeVersion$1();
4517
4526
  const ora = (await import('ora')).default;
4518
4527
  const spinnerValidate = ora("data model validation...").start();
4519
4528
  const filesList = await findFiles(ctx.client.srcDir, CUBE_YAML_FILE_REGEX$1);
@@ -19893,8 +19902,29 @@ async function getUserData() {
19893
19902
  }
19894
19903
  }
19895
19904
 
19905
+ const oraP$2 = import('ora');
19906
+ let ora$1;
19907
+ const checkNodeVersion = async () => {
19908
+ ora$1 = (await oraP$2).default;
19909
+ ora$1("checking node version...");
19910
+ const [major, minor] = process.versions.node.split(".").map(Number);
19911
+ const engines = require("../package.json").engines.node;
19912
+ const [minMajor, minMinor] = engines
19913
+ .split(".")
19914
+ .map((v) => v.replace(/[^\d]/g, ""))
19915
+ .map(Number);
19916
+ if (major < minMajor || (major === minMajor && minor < minMinor)) {
19917
+ ora$1({
19918
+ text: `Node version ${minMajor}.${minMinor} or higher is required. You are running ${major}.${minor}.`,
19919
+ color: "red",
19920
+ }).fail();
19921
+ process.exit(1);
19922
+ }
19923
+ };
19924
+
19896
19925
  var build = async () => {
19897
19926
  try {
19927
+ checkNodeVersion();
19898
19928
  const config = await provideConfig();
19899
19929
  await validate(config);
19900
19930
  await prepare(config);
@@ -19998,6 +20028,7 @@ const CUBE_YAML_FILE_REGEX = /^(.*)\.cube\.ya?ml$/;
19998
20028
  let ora;
19999
20029
  var push = async () => {
20000
20030
  try {
20031
+ checkNodeVersion();
20001
20032
  ora = (await oraP).default;
20002
20033
  const config = await provideConfig();
20003
20034
  const token = await verify(config);