@embeddable.com/sdk-core 3.12.1 → 3.12.3

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
@@ -25,6 +25,7 @@ var http = require('node:http');
25
25
  var ws = require('ws');
26
26
  var chokidar = require('chokidar');
27
27
  var fg = require('fast-glob');
28
+ var dotenv = require('dotenv');
28
29
  var promises = require('fs/promises');
29
30
 
30
31
  function _interopNamespaceDefault(e) {
@@ -57,6 +58,7 @@ var path__namespace$1 = /*#__PURE__*/_interopNamespaceDefault(path$1);
57
58
  var archiver__namespace = /*#__PURE__*/_interopNamespaceDefault(archiver);
58
59
  var http__namespace = /*#__PURE__*/_interopNamespaceDefault(http);
59
60
  var chokidar__namespace = /*#__PURE__*/_interopNamespaceDefault(chokidar);
61
+ var dotenv__namespace = /*#__PURE__*/_interopNamespaceDefault(dotenv);
60
62
 
61
63
  var findFiles = async (initialSrcDir, regex) => {
62
64
  const filesList = [];
@@ -21693,6 +21695,7 @@ async function uploadFile(formData, url, token) {
21693
21695
  }
21694
21696
 
21695
21697
  const minimist = require("minimist");
21698
+ dotenv__namespace.config();
21696
21699
  const oraP = import('ora');
21697
21700
  let wss;
21698
21701
  let changedFiles = [];
@@ -21944,8 +21947,6 @@ const onClose = async (server, sys, watchers, config) => {
21944
21947
  process.exit(0);
21945
21948
  };
21946
21949
  const getPreviewWorkspace = async (startedOra, ctx) => {
21947
- // login and retry
21948
- await login();
21949
21950
  const token = await getToken();
21950
21951
  const params = minimist(process.argv.slice(2));
21951
21952
  let primaryWorkspace = params.w || params.workspace;
@@ -21956,8 +21957,12 @@ const getPreviewWorkspace = async (startedOra, ctx) => {
21956
21957
  startedOra.start();
21957
21958
  }
21958
21959
  try {
21960
+ const instanceUrl = process.env.CUBE_CLOUD_ENDPOINT;
21959
21961
  const response = await axios.get(`${ctx.pushBaseUrl}/workspace/dev-workspace`, {
21960
- params: { primaryWorkspace },
21962
+ params: {
21963
+ primaryWorkspace,
21964
+ instanceUrl,
21965
+ },
21961
21966
  headers: {
21962
21967
  Authorization: `Bearer ${token}`,
21963
21968
  },
@@ -21976,7 +21981,34 @@ const getPreviewWorkspace = async (startedOra, ctx) => {
21976
21981
  }
21977
21982
  };
21978
21983
 
21979
- var defineConfig = ({ plugins, pushBaseUrl, audienceUrl, authDomain, authClientId, errorFallbackComponent, applicationEnvironment, rollbarAccessToken, previewBaseUrl, modelsSrc = "src", presetsSrc = "src", componentsSrc = "src", globalCss = "src/global.css", viteConfig = {}, rollupOptions = {}, }) => {
21984
+ const REGION_CONFIGS = {
21985
+ EU: {
21986
+ pushBaseUrl: "https://api.eu.embeddable.com",
21987
+ audienceUrl: "https://auth.eu.embeddable.com",
21988
+ previewBaseUrl: "https://app.eu.embeddable.com",
21989
+ authDomain: "auth.eu.embeddable.com",
21990
+ authClientId: "6OGPwIQsVmtrBKhNrwAaXh4ePb0kBGV",
21991
+ },
21992
+ US: {
21993
+ pushBaseUrl: "https://api.us.embeddable.com",
21994
+ audienceUrl: "https://auth.embeddable.com",
21995
+ previewBaseUrl: "https://app.us.embeddable.com",
21996
+ authDomain: "auth.embeddable.com",
21997
+ authClientId: "dygrSUmI6HmgY5ymVbEAoLDEBxIOyr1V",
21998
+ },
21999
+ "legacy-US": {
22000
+ pushBaseUrl: "https://api.embeddable.com",
22001
+ audienceUrl: "https://auth.embeddable.com",
22002
+ previewBaseUrl: "https://app.embeddable.com",
22003
+ authDomain: "auth.embeddable.com",
22004
+ authClientId: "dygrSUmI6HmgY5ymVbEAoLDEBxIOyr1V",
22005
+ },
22006
+ };
22007
+ var defineConfig = ({ plugins, region = "legacy-US", pushBaseUrl, audienceUrl, authDomain, authClientId, errorFallbackComponent, applicationEnvironment, rollbarAccessToken, previewBaseUrl, modelsSrc = "src", presetsSrc = "src", componentsSrc = "src", globalCss = "src/global.css", viteConfig = {}, rollupOptions = {}, }) => {
22008
+ if (region && !REGION_CONFIGS[region]) {
22009
+ throw new Error(`Unsupported region: ${region}. Supported regions are: EU, US, legacy-US`);
22010
+ }
22011
+ const regionConfig = REGION_CONFIGS[region];
21980
22012
  const coreRoot = path__namespace.resolve(__dirname, "..");
21981
22013
  const clientRoot = process.cwd();
21982
22014
  if (!path__namespace.isAbsolute(componentsSrc)) {
@@ -22024,11 +22056,11 @@ var defineConfig = ({ plugins, pushBaseUrl, audienceUrl, authDomain, authClientI
22024
22056
  outputOptions: {
22025
22057
  typesEntryPointFilename: "embeddable-types-entry-point.js",
22026
22058
  },
22027
- pushBaseUrl: pushBaseUrl !== null && pushBaseUrl !== void 0 ? pushBaseUrl : "https://api.embeddable.com",
22028
- audienceUrl: audienceUrl !== null && audienceUrl !== void 0 ? audienceUrl : "https://auth.embeddable.com",
22029
- previewBaseUrl: previewBaseUrl !== null && previewBaseUrl !== void 0 ? previewBaseUrl : "https://app.embeddable.com",
22030
- authDomain: authDomain !== null && authDomain !== void 0 ? authDomain : "auth.embeddable.com",
22031
- authClientId: authClientId !== null && authClientId !== void 0 ? authClientId : "dygrSUmI6HmgY5ymVbEAoLDEBxIOyr1V",
22059
+ pushBaseUrl: pushBaseUrl !== null && pushBaseUrl !== void 0 ? pushBaseUrl : regionConfig.pushBaseUrl,
22060
+ audienceUrl: audienceUrl !== null && audienceUrl !== void 0 ? audienceUrl : regionConfig.audienceUrl,
22061
+ previewBaseUrl: previewBaseUrl !== null && previewBaseUrl !== void 0 ? previewBaseUrl : regionConfig.previewBaseUrl,
22062
+ authDomain: authDomain !== null && authDomain !== void 0 ? authDomain : regionConfig.authDomain,
22063
+ authClientId: authClientId !== null && authClientId !== void 0 ? authClientId : regionConfig.authClientId,
22032
22064
  applicationEnvironment: applicationEnvironment !== null && applicationEnvironment !== void 0 ? applicationEnvironment : "production",
22033
22065
  rollbarAccessToken: rollbarAccessToken !== null && rollbarAccessToken !== void 0 ? rollbarAccessToken : "5c6028038d844bf1835a0f4db5f55d9e",
22034
22066
  plugins,
@@ -22036,7 +22068,7 @@ var defineConfig = ({ plugins, pushBaseUrl, audienceUrl, authDomain, authClientI
22036
22068
  };
22037
22069
 
22038
22070
  var name = "@embeddable.com/sdk-core";
22039
- var version = "3.12.0-next.2";
22071
+ var version = "3.12.2";
22040
22072
  var description = "Core Embeddable SDK module responsible for web-components bundling and publishing.";
22041
22073
  var keywords = [
22042
22074
  "embeddable",
@@ -22074,13 +22106,14 @@ var engines = {
22074
22106
  };
22075
22107
  var license = "MIT";
22076
22108
  var dependencies = {
22077
- "@embeddable.com/sdk-utils": "0.6.0-next.0",
22078
- "@inquirer/prompts": "^7.1.0",
22079
- "@stencil/core": "^4.22.3",
22109
+ "@embeddable.com/sdk-utils": "0.6.1",
22110
+ "@inquirer/prompts": "^7.2.1",
22111
+ "@stencil/core": "^4.23.0",
22080
22112
  "@swc-node/register": "^1.10.9",
22081
22113
  archiver: "^5.3.2",
22082
- axios: "^1.7.8",
22083
- chokidar: "^4.0.1",
22114
+ axios: "^1.7.9",
22115
+ chokidar: "^4.0.3",
22116
+ dotenv: "^16.4.7",
22084
22117
  "fast-glob": "^3.3.2",
22085
22118
  finalhandler: "^1.3.1",
22086
22119
  "formdata-node": "^6.0.3",