@embeddable.com/sdk-core 2.5.2 → 2.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.
package/lib/index.js CHANGED
@@ -20229,6 +20229,7 @@ async function getWorkspaces(ctx, token, workspaceSpinner) {
20229
20229
  }
20230
20230
  }
20231
20231
 
20232
+ const minimist = require("minimist");
20232
20233
  const oraP = import('ora');
20233
20234
  let wss;
20234
20235
  let changedFiles = [];
@@ -20240,6 +20241,7 @@ const buildWebComponent = async (config) => {
20240
20241
  await generate(config, "sdk-react");
20241
20242
  };
20242
20243
  var dev = async () => {
20244
+ var _a;
20243
20245
  const http = require("http");
20244
20246
  ora = (await oraP).default;
20245
20247
  process.on("warning", (e) => console.warn(e.stack));
@@ -20258,7 +20260,13 @@ var dev = async () => {
20258
20260
  const serveStatic = require("serve-static");
20259
20261
  const serve = serveStatic(config.client.buildDir);
20260
20262
  const workspacePreparation = ora("Preparing workspace...").start();
20261
- previewWorkspace = await getPreviewWorkspace(config);
20263
+ try {
20264
+ previewWorkspace = await getPreviewWorkspace(config);
20265
+ }
20266
+ catch (e) {
20267
+ workspacePreparation.fail((_a = e.response.data) === null || _a === void 0 ? void 0 : _a.errorMessage);
20268
+ process.exit(1);
20269
+ }
20262
20270
  workspacePreparation.succeed("Workspace is ready");
20263
20271
  const server = http.createServer((request, res) => {
20264
20272
  res.setHeader("Access-Control-Allow-Origin", "*");
@@ -20373,8 +20381,11 @@ const onClose = async (server, sys, watchers, config) => {
20373
20381
  };
20374
20382
  const getPreviewWorkspace = async (ctx) => {
20375
20383
  const token = await getToken();
20384
+ const params = minimist(process.argv.slice(2));
20385
+ const primaryWorkspace = params.w || params.workspace;
20376
20386
  try {
20377
20387
  const response = await axios.get(`${ctx.pushBaseUrl}/workspace/dev-workspace`, {
20388
+ params: { primaryWorkspace },
20378
20389
  headers: {
20379
20390
  Authorization: `Bearer ${token}`,
20380
20391
  },