@embeddable.com/sdk-core 3.14.5 → 3.14.6-next.0
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 +10 -10
- package/lib/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/dev.test.ts +14 -10
- package/src/dev.ts +11 -10
- package/lib/index.js +0 -22492
- package/lib/index.js.map +0 -1
package/package.json
CHANGED
package/src/dev.test.ts
CHANGED
|
@@ -122,7 +122,7 @@ describe("dev command", () => {
|
|
|
122
122
|
() =>
|
|
123
123
|
({
|
|
124
124
|
listen: listenMock,
|
|
125
|
-
}) as any
|
|
125
|
+
}) as any
|
|
126
126
|
);
|
|
127
127
|
vi.mocked(WebSocketServer).mockImplementation(() => {
|
|
128
128
|
return {
|
|
@@ -138,7 +138,7 @@ describe("dev command", () => {
|
|
|
138
138
|
vi.spyOn(process, "exit").mockImplementation(() => undefined as never);
|
|
139
139
|
|
|
140
140
|
vi.mocked(provideConfig).mockResolvedValue(
|
|
141
|
-
mockConfig as unknown as ResolvedEmbeddableConfig
|
|
141
|
+
mockConfig as unknown as ResolvedEmbeddableConfig
|
|
142
142
|
);
|
|
143
143
|
vi.mocked(getToken).mockResolvedValue("mock-token");
|
|
144
144
|
vi.mocked(axios.get).mockResolvedValue({
|
|
@@ -193,7 +193,7 @@ describe("dev command", () => {
|
|
|
193
193
|
await expect.poll(() => chokidar.watch).toBeCalledTimes(1);
|
|
194
194
|
|
|
195
195
|
expect(open.default).toHaveBeenCalledWith(
|
|
196
|
-
"http://preview.example.com/workspace/mock-workspace"
|
|
196
|
+
"http://preview.example.com/workspace/mock-workspace"
|
|
197
197
|
);
|
|
198
198
|
});
|
|
199
199
|
|
|
@@ -280,7 +280,7 @@ describe("dev command", () => {
|
|
|
280
280
|
const watcher = { on: vi.fn() } as unknown as RollupWatcher;
|
|
281
281
|
configureWatcher(
|
|
282
282
|
watcher,
|
|
283
|
-
mockConfig as unknown as ResolvedEmbeddableConfig
|
|
283
|
+
mockConfig as unknown as ResolvedEmbeddableConfig
|
|
284
284
|
);
|
|
285
285
|
|
|
286
286
|
expect(watcher.on).toHaveBeenCalledWith("change", expect.any(Function));
|
|
@@ -295,7 +295,7 @@ describe("dev command", () => {
|
|
|
295
295
|
} as unknown as RollupWatcher;
|
|
296
296
|
configureWatcher(
|
|
297
297
|
watcher,
|
|
298
|
-
mockConfig as unknown as ResolvedEmbeddableConfig
|
|
298
|
+
mockConfig as unknown as ResolvedEmbeddableConfig
|
|
299
299
|
);
|
|
300
300
|
|
|
301
301
|
await onHandler?.({
|
|
@@ -315,7 +315,7 @@ describe("dev command", () => {
|
|
|
315
315
|
} as unknown as RollupWatcher;
|
|
316
316
|
configureWatcher(
|
|
317
317
|
watcher,
|
|
318
|
-
mockConfig as unknown as ResolvedEmbeddableConfig
|
|
318
|
+
mockConfig as unknown as ResolvedEmbeddableConfig
|
|
319
319
|
);
|
|
320
320
|
|
|
321
321
|
await onHandler?.({
|
|
@@ -343,15 +343,15 @@ describe("dev command", () => {
|
|
|
343
343
|
it("should open the dev workspace page", async () => {
|
|
344
344
|
await openDevWorkspacePage(
|
|
345
345
|
"http://preview.example.com",
|
|
346
|
-
"mock-workspace"
|
|
346
|
+
"mock-workspace"
|
|
347
347
|
);
|
|
348
348
|
|
|
349
349
|
expect(open.default).toHaveBeenCalledWith(
|
|
350
|
-
"http://preview.example.com/workspace/mock-workspace"
|
|
350
|
+
"http://preview.example.com/workspace/mock-workspace"
|
|
351
351
|
);
|
|
352
352
|
|
|
353
353
|
expect(ora).toHaveBeenCalledWith(
|
|
354
|
-
"Preview workspace is available at http://preview.example.com/workspace/mock-workspace"
|
|
354
|
+
"Preview workspace is available at http://preview.example.com/workspace/mock-workspace"
|
|
355
355
|
);
|
|
356
356
|
});
|
|
357
357
|
});
|
|
@@ -361,7 +361,7 @@ describe("dev command", () => {
|
|
|
361
361
|
await sendBuildChanges(mockConfig as unknown as ResolvedEmbeddableConfig);
|
|
362
362
|
|
|
363
363
|
const filesList = [
|
|
364
|
-
...Array.from({ length:
|
|
364
|
+
...Array.from({ length: 1 }, () => [
|
|
365
365
|
"mock-model.json",
|
|
366
366
|
"/mock/root/models/mock-model.json",
|
|
367
367
|
]),
|
|
@@ -371,6 +371,10 @@ describe("dev command", () => {
|
|
|
371
371
|
? "D:\\mock\\root\\.embeddable-dev-build\\embeddable-manifest.json"
|
|
372
372
|
: "/mock/root/.embeddable-dev-build/embeddable-manifest.json",
|
|
373
373
|
],
|
|
374
|
+
...Array.from({ length: 2 }, () => [
|
|
375
|
+
"mock-model.json",
|
|
376
|
+
"/mock/root/models/mock-model.json",
|
|
377
|
+
]),
|
|
374
378
|
];
|
|
375
379
|
|
|
376
380
|
expect(getToken).toHaveBeenCalled();
|
package/src/dev.ts
CHANGED
|
@@ -390,6 +390,8 @@ export const sendBuildChanges = async (ctx: ResolvedEmbeddableConfig) => {
|
|
|
390
390
|
return sendMessage("dataModelsAndOrSecurityContextUpdateError");
|
|
391
391
|
}
|
|
392
392
|
|
|
393
|
+
sendMessage("dataModelsAndOrSecurityContextUpdateStart");
|
|
394
|
+
|
|
393
395
|
const sending = ora(
|
|
394
396
|
"Synchronising data models and/or security contexts...",
|
|
395
397
|
).start();
|
|
@@ -406,7 +408,14 @@ export const sendBuildChanges = async (ctx: ResolvedEmbeddableConfig) => {
|
|
|
406
408
|
(entry): [string, string] => [path.basename(entry[1]), entry[1]],
|
|
407
409
|
);
|
|
408
410
|
|
|
409
|
-
filesList = [
|
|
411
|
+
filesList = [
|
|
412
|
+
...clientContextFileList,
|
|
413
|
+
// add manifest to the archive
|
|
414
|
+
[
|
|
415
|
+
"embeddable-manifest.json",
|
|
416
|
+
path.resolve(ctx.client.buildDir, "embeddable-manifest.json"),
|
|
417
|
+
],
|
|
418
|
+
];
|
|
410
419
|
}
|
|
411
420
|
|
|
412
421
|
if (ctx.pushModels) {
|
|
@@ -422,15 +431,7 @@ export const sendBuildChanges = async (ctx: ResolvedEmbeddableConfig) => {
|
|
|
422
431
|
...securityContextFilesList,
|
|
423
432
|
].map((entry): [string, string] => [path.basename(entry[1]), entry[1]]);
|
|
424
433
|
|
|
425
|
-
filesList = [
|
|
426
|
-
...filesList,
|
|
427
|
-
...cubeAndSecurityContextFileList,
|
|
428
|
-
// add manifest to the archive
|
|
429
|
-
[
|
|
430
|
-
"embeddable-manifest.json",
|
|
431
|
-
path.resolve(ctx.client.buildDir, "embeddable-manifest.json"),
|
|
432
|
-
],
|
|
433
|
-
];
|
|
434
|
+
filesList = [...filesList, ...cubeAndSecurityContextFileList];
|
|
434
435
|
}
|
|
435
436
|
|
|
436
437
|
const token = await getToken();
|