@embeddable.com/sdk-core 4.1.5-next.0 → 4.1.5-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embeddable.com/sdk-core",
3
- "version": "4.1.5-next.0",
3
+ "version": "4.1.5-next.1",
4
4
  "description": "Core Embeddable SDK module responsible for web-components bundling and publishing.",
5
5
  "keywords": [
6
6
  "embeddable",
@@ -26,6 +26,9 @@ const baseConfigArgs = {
26
26
  previewBaseUrl: "previewBaseUrl",
27
27
  modelsSrc: "modelsSrc",
28
28
  presetsSrc: "presetsSrc",
29
+ starterEmbeddables: {
30
+ US: ['f4377b4f-84e9-4d0d-a8dc-6af0d509a61e']
31
+ }
29
32
  };
30
33
 
31
34
  describe("defineConfig", () => {
@@ -89,6 +92,11 @@ describe("defineConfig", () => {
89
92
  "pushModels": true,
90
93
  "region": "legacy-US",
91
94
  "rollbarAccessToken": "rollbarAccessToken",
95
+ "starterEmbeddables": {
96
+ "US": [
97
+ "f4377b4f-84e9-4d0d-a8dc-6af0d509a61e",
98
+ ],
99
+ },
92
100
  }
93
101
  `);
94
102
  });
@@ -38,6 +38,7 @@ export type EmbeddableConfig = {
38
38
  };
39
39
  rollupOptions?: RollupOptions;
40
40
  region?: Region;
41
+ starterEmbeddables?: Partial<Record<Region, string[]>>;
41
42
  componentLibraries?: string[] | ComponentLibraryConfig[];
42
43
  customizationFile?: string;
43
44
  lifecycleHooksFile?: string;
@@ -96,6 +97,7 @@ export type ResolvedEmbeddableConfig = {
96
97
  sys: any;
97
98
  };
98
99
  region: Region;
100
+ starterEmbeddables?: Partial<Record<Region, string[]>>
99
101
  [PLUGIN_NAME]: {
100
102
  rootDir: string;
101
103
  templatesDir: string;
@@ -143,6 +145,10 @@ export const embeddableConfigSchema = z
143
145
  region: z
144
146
  .union([z.literal("EU"), z.literal("US"), z.literal("legacy-US")])
145
147
  .optional(),
148
+ starterEmbeddables: z.record(
149
+ z.enum(["EU", "US", "legacy-US"]),
150
+ z.array(z.string().uuid())
151
+ ).optional(),
146
152
  pushModels: z.boolean().optional(),
147
153
  pushComponents: z.boolean().optional(),
148
154
  pushBaseUrl: z.string().optional(),
@@ -193,6 +199,7 @@ export default (config: EmbeddableConfig) => {
193
199
  plugins,
194
200
  region = "legacy-US",
195
201
  pushModels = true,
202
+ starterEmbeddables,
196
203
  pushComponents = true,
197
204
  pushBaseUrl,
198
205
  audienceUrl,
@@ -297,6 +304,7 @@ export default (config: EmbeddableConfig) => {
297
304
  sys: undefined,
298
305
  },
299
306
  region,
307
+ starterEmbeddables,
300
308
  pushModels,
301
309
  pushComponents,
302
310
  pushBaseUrl: pushBaseUrl ?? regionConfig.pushBaseUrl,
package/src/push.ts CHANGED
@@ -322,17 +322,23 @@ export async function sendBuild(
322
322
  const form = await createFormData(ctx.client.archiveFile, {
323
323
  pushModels: ctx.pushModels,
324
324
  pushComponents: ctx.pushComponents,
325
+ starterEmbeddableIds: ctx.starterEmbeddables?.[ctx.region],
325
326
  authorEmail: "",
326
327
  description: message,
327
328
  ...(cubeVersion ? { cubeVersion } : {}),
328
329
  });
329
330
 
330
- await uploadFile(
331
+ const response = await uploadFile(
331
332
  form,
332
333
  `${ctx.pushBaseUrl}/bundle/${workspaceId}/upload`,
333
334
  token,
334
335
  );
335
336
 
337
+ const warnings = response.data.warnings || [];
338
+ if (warnings.length > 0) {
339
+ console.warn(warnings.join("\n"));
340
+ }
341
+
336
342
  await fs.rm(ctx.client.archiveFile);
337
343
  }
338
344