@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.esm.js +15 -13
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +16 -13
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.esm.js
CHANGED
|
@@ -8,6 +8,7 @@ import * as fsSync from 'node:fs';
|
|
|
8
8
|
import { createNodeLogger, createNodeSys } from '@stencil/core/sys/node';
|
|
9
9
|
import { loadConfig, createCompiler } from '@stencil/core/compiler';
|
|
10
10
|
import * as YAML from 'yaml';
|
|
11
|
+
import * as url$2 from 'node:url';
|
|
11
12
|
import * as path$2 from 'path';
|
|
12
13
|
import path__default, { basename } from 'path';
|
|
13
14
|
import require$$4$1 from 'util';
|
|
@@ -4627,7 +4628,8 @@ var provideConfig = async () => {
|
|
|
4627
4628
|
console.log("Please create a proper `embeddable.config.js` file first.");
|
|
4628
4629
|
process.exit(1);
|
|
4629
4630
|
}
|
|
4630
|
-
|
|
4631
|
+
const configFileUrl = url$2.pathToFileURL(configFilePath).href;
|
|
4632
|
+
return (await import(configFileUrl)).default;
|
|
4631
4633
|
};
|
|
4632
4634
|
|
|
4633
4635
|
function getDefaultExportFromCjs (x) {
|
|
@@ -20238,7 +20240,7 @@ var dev = async () => {
|
|
|
20238
20240
|
if (sys === null || sys === void 0 ? void 0 : sys.onProcessInterrupt) {
|
|
20239
20241
|
sys.onProcessInterrupt(async () => await onClose(server, sys, watchers, config));
|
|
20240
20242
|
}
|
|
20241
|
-
await
|
|
20243
|
+
await sendDataModelsAndSecurityContextsChanges(config);
|
|
20242
20244
|
for (const getPlugin of config.plugins) {
|
|
20243
20245
|
const plugin = getPlugin();
|
|
20244
20246
|
await plugin.validate(config);
|
|
@@ -20246,8 +20248,8 @@ var dev = async () => {
|
|
|
20246
20248
|
await configureWatcher(watcher, config);
|
|
20247
20249
|
watchers.push(watcher);
|
|
20248
20250
|
}
|
|
20249
|
-
const
|
|
20250
|
-
watchers.push(
|
|
20251
|
+
const dataModelAndSecurityContextWatch = dataModelAndSecurityContextWatcher(config);
|
|
20252
|
+
watchers.push(dataModelAndSecurityContextWatch);
|
|
20251
20253
|
});
|
|
20252
20254
|
};
|
|
20253
20255
|
const configureWatcher = async (watcher, ctx) => {
|
|
@@ -20296,29 +20298,29 @@ const onBundleBuildEnd = async (ctx) => {
|
|
|
20296
20298
|
sendMessage("componentsBuildSuccess");
|
|
20297
20299
|
}
|
|
20298
20300
|
};
|
|
20299
|
-
const
|
|
20300
|
-
const fsWatcher = chokidar.watch([path$2.resolve(ctx.client.srcDir, "**/*.cube.{yaml,yml,js}")], {
|
|
20301
|
+
const dataModelAndSecurityContextWatcher = (ctx) => {
|
|
20302
|
+
const fsWatcher = chokidar.watch([path$2.resolve(ctx.client.srcDir, "**/*.{cube,sc}.{yaml,yml,js}")], {
|
|
20301
20303
|
ignoreInitial: true,
|
|
20302
20304
|
});
|
|
20303
20305
|
fsWatcher.on("all", async () => {
|
|
20304
|
-
await
|
|
20306
|
+
await sendDataModelsAndSecurityContextsChanges(ctx);
|
|
20305
20307
|
});
|
|
20306
20308
|
return fsWatcher;
|
|
20307
20309
|
};
|
|
20308
|
-
const
|
|
20309
|
-
sendMessage("
|
|
20310
|
+
const sendDataModelsAndSecurityContextsChanges = async (ctx) => {
|
|
20311
|
+
sendMessage("dataModelsAndOrSecurityContextUpdateStart");
|
|
20310
20312
|
const isValid = await validate(ctx, false);
|
|
20311
20313
|
if (isValid) {
|
|
20312
20314
|
const token = await getToken();
|
|
20313
|
-
const sending = ora("Synchronising data models...").start();
|
|
20315
|
+
const sending = ora("Synchronising data models and/or security contexts...").start();
|
|
20314
20316
|
const filesList = await findFiles(ctx.client.srcDir, YAML_OR_JS_FILES);
|
|
20315
20317
|
await archive(ctx, filesList, false);
|
|
20316
20318
|
await sendBuild(ctx, { workspaceId: previewWorkspace, token });
|
|
20317
|
-
sending.succeed(`Data models synchronized`);
|
|
20318
|
-
sendMessage("
|
|
20319
|
+
sending.succeed(`Data models and/or security context synchronized`);
|
|
20320
|
+
sendMessage("dataModelsAndOrSecurityContextUpdateSuccess");
|
|
20319
20321
|
}
|
|
20320
20322
|
else {
|
|
20321
|
-
sendMessage("
|
|
20323
|
+
sendMessage("dataModelsAndOrSecurityContextUpdateError");
|
|
20322
20324
|
}
|
|
20323
20325
|
};
|
|
20324
20326
|
const onClose = async (server, sys, watchers, config) => {
|