@embeddable.com/sdk-core 3.5.0 → 3.5.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/index.esm.js +24 -6
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +24 -6
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/defineConfig.ts +1 -1
- package/src/dev.ts +26 -10
package/package.json
CHANGED
package/src/defineConfig.ts
CHANGED
package/src/dev.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { findFiles } from "@embeddable.com/sdk-utils";
|
|
|
23
23
|
import { archive, YAML_OR_JS_FILES, sendBuild } from "./push";
|
|
24
24
|
import validate from "./validate";
|
|
25
25
|
import { checkNodeVersion } from "./utils";
|
|
26
|
+
import { createManifest } from "./cleanup";
|
|
26
27
|
const minimist = require("minimist");
|
|
27
28
|
|
|
28
29
|
const oraP = import("ora");
|
|
@@ -68,10 +69,7 @@ export default async () => {
|
|
|
68
69
|
|
|
69
70
|
const defaultConfig = await provideConfig();
|
|
70
71
|
|
|
71
|
-
const buildDir = path.resolve(
|
|
72
|
-
defaultConfig.client.rootDir,
|
|
73
|
-
".embeddable-dev-build",
|
|
74
|
-
);
|
|
72
|
+
const buildDir = path.resolve(defaultConfig.client.rootDir, BUILD_DEV_DIR);
|
|
75
73
|
|
|
76
74
|
const config = {
|
|
77
75
|
...defaultConfig,
|
|
@@ -82,7 +80,7 @@ export default async () => {
|
|
|
82
80
|
},
|
|
83
81
|
client: {
|
|
84
82
|
...defaultConfig.client,
|
|
85
|
-
buildDir
|
|
83
|
+
buildDir,
|
|
86
84
|
componentDir: path.resolve(buildDir, "component"),
|
|
87
85
|
stencilBuild: path.resolve(buildDir, "dist", "embeddable-wrapper"),
|
|
88
86
|
tmpDir: path.resolve(defaultConfig.client.rootDir, ".embeddable-dev-tmp"),
|
|
@@ -140,6 +138,20 @@ export default async () => {
|
|
|
140
138
|
);
|
|
141
139
|
}
|
|
142
140
|
|
|
141
|
+
await createManifest({
|
|
142
|
+
ctx: {
|
|
143
|
+
...config,
|
|
144
|
+
client: {
|
|
145
|
+
...config.client,
|
|
146
|
+
tmpDir: buildDir,
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
typesFileName: "embeddable-types.js",
|
|
150
|
+
stencilWrapperFileName: "embeddable-wrapper.js",
|
|
151
|
+
metaFileName: "embeddable-components-meta.js",
|
|
152
|
+
editorsMetaFileName: "embeddable-editors-meta.js",
|
|
153
|
+
});
|
|
154
|
+
|
|
143
155
|
await sendDataModelsAndSecurityContextsChanges(config);
|
|
144
156
|
|
|
145
157
|
for (const getPlugin of config.plugins) {
|
|
@@ -213,7 +225,7 @@ const onBundleBuildEnd = async (ctx: any) => {
|
|
|
213
225
|
|
|
214
226
|
const dataModelAndSecurityContextWatcher = (ctx: any): FSWatcher => {
|
|
215
227
|
const fsWatcher = chokidar.watch(
|
|
216
|
-
[path.resolve(ctx.client.
|
|
228
|
+
[path.resolve(ctx.client.modelsSrc, "**/*.{cube,sc}.{yaml,yml,js}")],
|
|
217
229
|
{
|
|
218
230
|
ignoreInitial: true,
|
|
219
231
|
},
|
|
@@ -233,10 +245,14 @@ const sendDataModelsAndSecurityContextsChanges = async (ctx: any) => {
|
|
|
233
245
|
const sending = ora(
|
|
234
246
|
"Synchronising data models and/or security contexts...",
|
|
235
247
|
).start();
|
|
236
|
-
const filesList = await findFiles(
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
248
|
+
const filesList = await findFiles(ctx.client.modelsSrc, YAML_OR_JS_FILES);
|
|
249
|
+
|
|
250
|
+
// add manifest to the archive
|
|
251
|
+
filesList.push([
|
|
252
|
+
"embeddable-manifest",
|
|
253
|
+
path.resolve(ctx.client.buildDir, "embeddable-manifest.json"),
|
|
254
|
+
]);
|
|
255
|
+
|
|
240
256
|
await archive(ctx, filesList, false);
|
|
241
257
|
await sendBuild(ctx, { workspaceId: previewWorkspace, token });
|
|
242
258
|
sending.succeed(`Data models and/or security context synchronized`);
|