@embeddable.com/sdk-core 2.4.28 → 2.4.30

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.js CHANGED
@@ -8,6 +8,7 @@ var fsSync = require('node:fs');
8
8
  var node = require('@stencil/core/sys/node');
9
9
  var compiler = require('@stencil/core/compiler');
10
10
  var YAML = require('yaml');
11
+ var url$2 = require('node:url');
11
12
  var path$2 = require('path');
12
13
  var require$$4$1 = require('util');
13
14
  var require$$1 = require('os');
@@ -44,6 +45,7 @@ var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path$1);
44
45
  var vite__namespace = /*#__PURE__*/_interopNamespaceDefault(vite);
45
46
  var fsSync__namespace = /*#__PURE__*/_interopNamespaceDefault(fsSync);
46
47
  var YAML__namespace = /*#__PURE__*/_interopNamespaceDefault(YAML);
48
+ var url__namespace = /*#__PURE__*/_interopNamespaceDefault(url$2);
47
49
  var path__namespace$1 = /*#__PURE__*/_interopNamespaceDefault(path$2);
48
50
  var os__namespace = /*#__PURE__*/_interopNamespaceDefault(os$1);
49
51
  var archiver__namespace = /*#__PURE__*/_interopNamespaceDefault(archiver);
@@ -4653,7 +4655,8 @@ var provideConfig = async () => {
4653
4655
  console.log("Please create a proper `embeddable.config.js` file first.");
4654
4656
  process.exit(1);
4655
4657
  }
4656
- return (await import(configFilePath)).default;
4658
+ const configFileUrl = url__namespace.pathToFileURL(configFilePath).href;
4659
+ return (await import(configFileUrl)).default;
4657
4660
  };
4658
4661
 
4659
4662
  function getDefaultExportFromCjs (x) {
@@ -20264,7 +20267,7 @@ var dev = async () => {
20264
20267
  if (sys === null || sys === void 0 ? void 0 : sys.onProcessInterrupt) {
20265
20268
  sys.onProcessInterrupt(async () => await onClose(server, sys, watchers, config));
20266
20269
  }
20267
- await sendDataModels(config);
20270
+ await sendDataModelsAndSecurityContextsChanges(config);
20268
20271
  for (const getPlugin of config.plugins) {
20269
20272
  const plugin = getPlugin();
20270
20273
  await plugin.validate(config);
@@ -20272,8 +20275,8 @@ var dev = async () => {
20272
20275
  await configureWatcher(watcher, config);
20273
20276
  watchers.push(watcher);
20274
20277
  }
20275
- const modelWatcher = dataModelWatcher(config);
20276
- watchers.push(modelWatcher);
20278
+ const dataModelAndSecurityContextWatch = dataModelAndSecurityContextWatcher(config);
20279
+ watchers.push(dataModelAndSecurityContextWatch);
20277
20280
  });
20278
20281
  };
20279
20282
  const configureWatcher = async (watcher, ctx) => {
@@ -20322,29 +20325,29 @@ const onBundleBuildEnd = async (ctx) => {
20322
20325
  sendMessage("componentsBuildSuccess");
20323
20326
  }
20324
20327
  };
20325
- const dataModelWatcher = (ctx) => {
20326
- const fsWatcher = chokidar__namespace.watch([path__namespace$1.resolve(ctx.client.srcDir, "**/*.cube.{yaml,yml,js}")], {
20328
+ const dataModelAndSecurityContextWatcher = (ctx) => {
20329
+ const fsWatcher = chokidar__namespace.watch([path__namespace$1.resolve(ctx.client.srcDir, "**/*.{cube,sc}.{yaml,yml,js}")], {
20327
20330
  ignoreInitial: true,
20328
20331
  });
20329
20332
  fsWatcher.on("all", async () => {
20330
- await sendDataModels(ctx);
20333
+ await sendDataModelsAndSecurityContextsChanges(ctx);
20331
20334
  });
20332
20335
  return fsWatcher;
20333
20336
  };
20334
- const sendDataModels = async (ctx) => {
20335
- sendMessage("dataModelsUpdateStart");
20337
+ const sendDataModelsAndSecurityContextsChanges = async (ctx) => {
20338
+ sendMessage("dataModelsAndOrSecurityContextUpdateStart");
20336
20339
  const isValid = await validate(ctx, false);
20337
20340
  if (isValid) {
20338
20341
  const token = await getToken();
20339
- const sending = ora("Synchronising data models...").start();
20342
+ const sending = ora("Synchronising data models and/or security contexts...").start();
20340
20343
  const filesList = await findFiles(ctx.client.srcDir, YAML_OR_JS_FILES);
20341
20344
  await archive(ctx, filesList, false);
20342
20345
  await sendBuild(ctx, { workspaceId: previewWorkspace, token });
20343
- sending.succeed(`Data models synchronized`);
20344
- sendMessage("dataModelsUpdateSuccess");
20346
+ sending.succeed(`Data models and/or security context synchronized`);
20347
+ sendMessage("dataModelsAndOrSecurityContextUpdateSuccess");
20345
20348
  }
20346
20349
  else {
20347
- sendMessage("dataModelsUpdateError");
20350
+ sendMessage("dataModelsAndOrSecurityContextUpdateError");
20348
20351
  }
20349
20352
  };
20350
20353
  const onClose = async (server, sys, watchers, config) => {