@embeddable.com/sdk-core 3.14.2-next.2 → 3.14.2

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/dev.d.ts CHANGED
@@ -1,2 +1,10 @@
1
+ import { RollupWatcher } from "rollup";
2
+ import { ChildProcess } from "node:child_process";
3
+ import { ResolvedEmbeddableConfig } from "./defineConfig";
4
+ export declare const buildWebComponent: (config: any) => Promise<void>;
1
5
  declare const _default: () => Promise<void>;
2
6
  export default _default;
7
+ export declare const configureWatcher: (watcher: RollupWatcher, ctx: ResolvedEmbeddableConfig) => Promise<void>;
8
+ export declare const globalHookWatcher: (watcher: RollupWatcher) => Promise<void>;
9
+ export declare const openDevWorkspacePage: (previewBaseUrl: string, workspaceId: string) => Promise<ChildProcess>;
10
+ export declare const sendBuildChanges: (ctx: ResolvedEmbeddableConfig) => Promise<void>;
package/lib/index.esm.js CHANGED
@@ -27,6 +27,7 @@ import require$$2$1, { createReadStream } from 'fs';
27
27
  import axios from 'axios';
28
28
  import archiver from 'archiver';
29
29
  import { select } from '@inquirer/prompts';
30
+ import open from 'open';
30
31
  import * as http from 'node:http';
31
32
  import { WebSocketServer } from 'ws';
32
33
  import * as chokidar from 'chokidar';
@@ -22194,16 +22195,16 @@ var dev = async () => {
22194
22195
  const customGlobalCssWatch = globalCssWatcher(config);
22195
22196
  watchers.push(customGlobalCssWatch);
22196
22197
  if (themeWatcher) {
22197
- await globalHookWatcher(themeWatcher, config);
22198
+ await globalHookWatcher(themeWatcher);
22198
22199
  watchers.push(themeWatcher);
22199
22200
  }
22200
22201
  if (lifecycleWatcher) {
22201
- await globalHookWatcher(lifecycleWatcher, config);
22202
+ await globalHookWatcher(lifecycleWatcher);
22202
22203
  watchers.push(lifecycleWatcher);
22203
22204
  }
22204
22205
  }
22205
22206
  else {
22206
- await openDevWorkspacePage(config.previewBaseUrl);
22207
+ await openDevWorkspacePage(config.previewBaseUrl, previewWorkspace);
22207
22208
  }
22208
22209
  const cubeSecurityContextAndClientContextWatch = await cubeSecurityContextAndClientContextWatcher(config);
22209
22210
  watchers.push(cubeSecurityContextAndClientContextWatch);
@@ -22234,7 +22235,7 @@ const configureWatcher = async (watcher, ctx) => {
22234
22235
  }
22235
22236
  });
22236
22237
  };
22237
- const globalHookWatcher = async (watcher, ctx) => {
22238
+ const globalHookWatcher = async (watcher) => {
22238
22239
  watcher.on("change", (path) => {
22239
22240
  changedFiles.push(path);
22240
22241
  });
@@ -22269,16 +22270,16 @@ const onBuildStart = async (ctx) => {
22269
22270
  }
22270
22271
  sendMessage("componentsBuildStart", { changedFiles });
22271
22272
  };
22272
- const openDevWorkspacePage = async (previewBaseUrl) => {
22273
- const open = (await import('open')).default;
22274
- return await open(`${previewBaseUrl}/workspace/${previewWorkspace}`);
22273
+ const openDevWorkspacePage = async (previewBaseUrl, workspaceId) => {
22274
+ ora(`Preview workspace is available at ${previewBaseUrl}/workspace/${workspaceId}`).info();
22275
+ return await open(`${previewBaseUrl}/workspace/${workspaceId}`);
22275
22276
  };
22276
22277
  const onBundleBuildEnd = async (ctx) => {
22277
22278
  if (!onlyTypesChanged() || changedFiles.length === 0) {
22278
22279
  await buildWebComponent(ctx);
22279
22280
  }
22280
22281
  if (browserWindow == null) {
22281
- browserWindow = await openDevWorkspacePage(ctx.previewBaseUrl);
22282
+ browserWindow = await openDevWorkspacePage(ctx.previewBaseUrl, previewWorkspace);
22282
22283
  }
22283
22284
  else {
22284
22285
  sendMessage("componentsBuildSuccess");