@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.esm.js CHANGED
@@ -333,11 +333,11 @@ const formatErrorPath = (path) => {
333
333
  return formatted;
334
334
  };
335
335
 
336
- const oraP$2 = import('ora');
336
+ const oraP$3 = import('ora');
337
337
  const EMB_TYPE_FILE_REGEX = /^(.*)\.type\.emb\.[jt]s$/;
338
338
  const EMB_OPTIONS_FILE_REGEX = /^(.*)\.options\.emb\.[jt]s$/;
339
339
  var buildTypes = async (ctx) => {
340
- const ora = (await oraP$2).default;
340
+ const ora = (await oraP$3).default;
341
341
  const progress = ora("building types...").start();
342
342
  await generate$1(ctx);
343
343
  await build$1(ctx);
@@ -4488,7 +4488,16 @@ var z = /*#__PURE__*/Object.freeze({
4488
4488
  });
4489
4489
 
4490
4490
  const CUBE_YAML_FILE_REGEX$1 = /^(.*)\.cube\.ya?ml$/;
4491
+ const checkNodeVersion$1 = () => {
4492
+ const [major, minor] = process.versions.node.split(".").map(Number);
4493
+ const engines = require("../package.json").engines.node;
4494
+ const [minMajor, minMinor] = engines.split(".").map(Number);
4495
+ if (major < minMajor || (major === minMajor && minor < minMinor)) {
4496
+ throw new Error(`Node version ${minMajor}.${minMinor} or higher is required. You are running ${major}.${minor}.`);
4497
+ }
4498
+ };
4491
4499
  var validate = async (ctx) => {
4500
+ checkNodeVersion$1();
4492
4501
  const ora = (await import('ora')).default;
4493
4502
  const spinnerValidate = ora("data model validation...").start();
4494
4503
  const filesList = await findFiles(ctx.client.srcDir, CUBE_YAML_FILE_REGEX$1);
@@ -19868,8 +19877,29 @@ async function getUserData() {
19868
19877
  }
19869
19878
  }
19870
19879
 
19880
+ const oraP$2 = import('ora');
19881
+ let ora$1;
19882
+ const checkNodeVersion = async () => {
19883
+ ora$1 = (await oraP$2).default;
19884
+ ora$1("checking node version...");
19885
+ const [major, minor] = process.versions.node.split(".").map(Number);
19886
+ const engines = require("../package.json").engines.node;
19887
+ const [minMajor, minMinor] = engines
19888
+ .split(".")
19889
+ .map((v) => v.replace(/[^\d]/g, ""))
19890
+ .map(Number);
19891
+ if (major < minMajor || (major === minMajor && minor < minMinor)) {
19892
+ ora$1({
19893
+ text: `Node version ${minMajor}.${minMinor} or higher is required. You are running ${major}.${minor}.`,
19894
+ color: "red",
19895
+ }).fail();
19896
+ process.exit(1);
19897
+ }
19898
+ };
19899
+
19871
19900
  var build = async () => {
19872
19901
  try {
19902
+ checkNodeVersion();
19873
19903
  const config = await provideConfig();
19874
19904
  await validate(config);
19875
19905
  await prepare(config);
@@ -19973,6 +20003,7 @@ const CUBE_YAML_FILE_REGEX = /^(.*)\.cube\.ya?ml$/;
19973
20003
  let ora;
19974
20004
  var push = async () => {
19975
20005
  try {
20006
+ checkNodeVersion();
19976
20007
  ora = (await oraP).default;
19977
20008
  const config = await provideConfig();
19978
20009
  const token = await verify(config);