@embeddable.com/sdk-core 4.1.6-next.0 → 4.1.6-next.1
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 +10 -4
- package/lib/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/push.ts +11 -5
package/package.json
CHANGED
package/src/push.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as fs from "node:fs/promises";
|
|
2
2
|
import * as fsSync from "node:fs";
|
|
3
3
|
import archiver from "archiver";
|
|
4
|
-
import axios from "axios";
|
|
4
|
+
import axios, {AxiosResponse} from "axios";
|
|
5
5
|
import ora, { Ora } from "ora";
|
|
6
6
|
import { initLogger, logError } from "./logger";
|
|
7
7
|
import * as path from "path";
|
|
@@ -290,6 +290,7 @@ export async function sendBuildByApiKey(
|
|
|
290
290
|
const form = await createFormData(ctx.client.archiveFile, {
|
|
291
291
|
pushModels: ctx.pushModels,
|
|
292
292
|
pushComponents: ctx.pushComponents,
|
|
293
|
+
starterEmbeddableIds: ctx.starterEmbeddables?.[ctx.region],
|
|
293
294
|
authorEmail: email,
|
|
294
295
|
description: message,
|
|
295
296
|
...(cubeVersion ? { cubeVersion } : {}),
|
|
@@ -301,6 +302,7 @@ export async function sendBuildByApiKey(
|
|
|
301
302
|
apiKey,
|
|
302
303
|
);
|
|
303
304
|
await fs.rm(ctx.client.archiveFile);
|
|
305
|
+
checkAndLogWarnings(response);
|
|
304
306
|
|
|
305
307
|
return { ...response.data, message, cubeVersion };
|
|
306
308
|
}
|
|
@@ -334,10 +336,7 @@ export async function sendBuild(
|
|
|
334
336
|
token,
|
|
335
337
|
);
|
|
336
338
|
|
|
337
|
-
|
|
338
|
-
if (warnings.length > 0) {
|
|
339
|
-
console.warn(warnings.join("\n"));
|
|
340
|
-
}
|
|
339
|
+
checkAndLogWarnings(response);
|
|
341
340
|
|
|
342
341
|
await fs.rm(ctx.client.archiveFile);
|
|
343
342
|
}
|
|
@@ -352,3 +351,10 @@ async function uploadFile(formData: any, url: string, token: string) {
|
|
|
352
351
|
maxBodyLength: Infinity,
|
|
353
352
|
});
|
|
354
353
|
}
|
|
354
|
+
|
|
355
|
+
function checkAndLogWarnings(response: AxiosResponse) {
|
|
356
|
+
const warnings = response.data.warnings || [];
|
|
357
|
+
if (warnings.length > 0) {
|
|
358
|
+
ora().warn(warnings.join("\n"));
|
|
359
|
+
}
|
|
360
|
+
}
|