@embeddable.com/sdk-core 3.14.0-next.5 → 3.14.0-next.7

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": "3.14.0-next.5",
3
+ "version": "3.14.0-next.7",
4
4
  "description": "Core Embeddable SDK module responsible for web-components bundling and publishing.",
5
5
  "keywords": [
6
6
  "embeddable",
package/src/build.ts CHANGED
@@ -25,6 +25,13 @@ export default async () => {
25
25
  removeBuildSuccessFlag();
26
26
  const config = await provideConfig();
27
27
 
28
+ if (!config.plugins.length) {
29
+ console.warn(
30
+ "⚠️ No plugins found in your embeddable.config file. Example: https://github.com/embeddable-hq/vanilla-components/blob/main/embeddable.config.js#L5",
31
+ );
32
+ process.exit(0);
33
+ }
34
+
28
35
  await validate(config);
29
36
 
30
37
  await prepare(config);
package/src/push.ts CHANGED
@@ -31,15 +31,15 @@ export default async () => {
31
31
  checkNodeVersion();
32
32
  breadcrumbs.push("checkNodeVersion");
33
33
  const isBuildSuccess = await checkBuildSuccess();
34
- if (!isBuildSuccess) {
34
+ const config = await provideConfig();
35
+
36
+ if (!isBuildSuccess && config.pushComponents) {
35
37
  console.error(
36
38
  "Build failed or not completed. Please run `embeddable:build` first.",
37
39
  );
38
40
  process.exit(1);
39
41
  }
40
42
 
41
- const config = await provideConfig();
42
-
43
43
  if (process.argv.includes("--api-key") || process.argv.includes("-k")) {
44
44
  spinnerPushing = ora("Using API key...").start();
45
45
  breadcrumbs.push("push by api key");
@@ -127,11 +127,13 @@ async function pushByApiKey(config: ResolvedEmbeddableConfig, spinner: any) {
127
127
  }
128
128
 
129
129
  async function verify(ctx: ResolvedEmbeddableConfig) {
130
- try {
131
- await fs.access(ctx.client.buildDir);
132
- } catch (_e) {
133
- console.error("No embeddable build was produced.");
134
- process.exit(1);
130
+ if (ctx.pushComponents) {
131
+ try {
132
+ await fs.access(ctx.client.buildDir);
133
+ } catch (_e) {
134
+ console.error("No embeddable build was produced.");
135
+ process.exit(1);
136
+ }
135
137
  }
136
138
 
137
139
  // TODO: initiate login if no/invalid token.
@@ -28,6 +28,15 @@ export class EmbeddableComponent {
28
28
  this.handlePops();
29
29
  }
30
30
 
31
+ @Watch('theme')
32
+ watchTheme() {
33
+ const eventClientContext = new CustomEvent('embeddable-event:update-theme', {
34
+ bubbles: false,
35
+ detail: this.theme,
36
+ });
37
+ this.rootElement.dispatchEvent(eventClientContext);
38
+ }
39
+
31
40
  componentDidLoad() {
32
41
  this.handlePops();
33
42
  const props = JSON.parse(this.props);