@embeddable.com/sdk-core 2.5.3 → 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.esm.js +12 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +12 -1
- package/lib/index.js.map +1 -1
- package/package.json +2 -1
package/lib/index.esm.js
CHANGED
|
@@ -20202,6 +20202,7 @@ async function getWorkspaces(ctx, token, workspaceSpinner) {
|
|
|
20202
20202
|
}
|
|
20203
20203
|
}
|
|
20204
20204
|
|
|
20205
|
+
const minimist = require("minimist");
|
|
20205
20206
|
const oraP = import('ora');
|
|
20206
20207
|
let wss;
|
|
20207
20208
|
let changedFiles = [];
|
|
@@ -20213,6 +20214,7 @@ const buildWebComponent = async (config) => {
|
|
|
20213
20214
|
await generate(config, "sdk-react");
|
|
20214
20215
|
};
|
|
20215
20216
|
var dev = async () => {
|
|
20217
|
+
var _a;
|
|
20216
20218
|
const http = require("http");
|
|
20217
20219
|
ora = (await oraP).default;
|
|
20218
20220
|
process.on("warning", (e) => console.warn(e.stack));
|
|
@@ -20231,7 +20233,13 @@ var dev = async () => {
|
|
|
20231
20233
|
const serveStatic = require("serve-static");
|
|
20232
20234
|
const serve = serveStatic(config.client.buildDir);
|
|
20233
20235
|
const workspacePreparation = ora("Preparing workspace...").start();
|
|
20234
|
-
|
|
20236
|
+
try {
|
|
20237
|
+
previewWorkspace = await getPreviewWorkspace(config);
|
|
20238
|
+
}
|
|
20239
|
+
catch (e) {
|
|
20240
|
+
workspacePreparation.fail((_a = e.response.data) === null || _a === void 0 ? void 0 : _a.errorMessage);
|
|
20241
|
+
process.exit(1);
|
|
20242
|
+
}
|
|
20235
20243
|
workspacePreparation.succeed("Workspace is ready");
|
|
20236
20244
|
const server = http.createServer((request, res) => {
|
|
20237
20245
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
@@ -20346,8 +20354,11 @@ const onClose = async (server, sys, watchers, config) => {
|
|
|
20346
20354
|
};
|
|
20347
20355
|
const getPreviewWorkspace = async (ctx) => {
|
|
20348
20356
|
const token = await getToken();
|
|
20357
|
+
const params = minimist(process.argv.slice(2));
|
|
20358
|
+
const primaryWorkspace = params.w || params.workspace;
|
|
20349
20359
|
try {
|
|
20350
20360
|
const response = await axios.get(`${ctx.pushBaseUrl}/workspace/dev-workspace`, {
|
|
20361
|
+
params: { primaryWorkspace },
|
|
20351
20362
|
headers: {
|
|
20352
20363
|
Authorization: `Bearer ${token}`,
|
|
20353
20364
|
},
|