@superblocksteam/vite-plugin-file-sync 2.0.6-next.18 → 2.0.6-next.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.
Files changed (100) hide show
  1. package/dist/ai-service/app-interface/shell.d.ts +0 -1
  2. package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
  3. package/dist/ai-service/app-interface/shell.js +1 -8
  4. package/dist/ai-service/app-interface/shell.js.map +1 -1
  5. package/dist/ai-service/const.d.ts +0 -2
  6. package/dist/ai-service/const.d.ts.map +1 -1
  7. package/dist/ai-service/const.js +0 -2
  8. package/dist/ai-service/const.js.map +1 -1
  9. package/dist/ai-service/prompts/generated/library-components/SbButtonPropsDocs.js +1 -1
  10. package/dist/ai-service/prompts/generated/library-components/SbCheckboxPropsDocs.js +1 -1
  11. package/dist/ai-service/prompts/generated/library-components/SbColumnPropsDocs.js +1 -1
  12. package/dist/ai-service/prompts/generated/library-components/SbContainerPropsDocs.js +1 -1
  13. package/dist/ai-service/prompts/generated/library-components/SbDatePickerPropsDocs.js +1 -1
  14. package/dist/ai-service/prompts/generated/library-components/SbDropdownPropsDocs.js +1 -1
  15. package/dist/ai-service/prompts/generated/library-components/SbIconPropsDocs.js +1 -1
  16. package/dist/ai-service/prompts/generated/library-components/SbImagePropsDocs.js +1 -1
  17. package/dist/ai-service/prompts/generated/library-components/SbInputPropsDocs.js +1 -1
  18. package/dist/ai-service/prompts/generated/library-components/SbModalPropsDocs.js +1 -1
  19. package/dist/ai-service/prompts/generated/library-components/SbPagePropsDocs.js +1 -1
  20. package/dist/ai-service/prompts/generated/library-components/SbSectionPropsDocs.js +1 -1
  21. package/dist/ai-service/prompts/generated/library-components/SbSlideoutPropsDocs.js +1 -1
  22. package/dist/ai-service/prompts/generated/library-components/SbSwitchPropsDocs.js +1 -1
  23. package/dist/ai-service/prompts/generated/library-components/SbTablePropsDocs.js +1 -1
  24. package/dist/ai-service/prompts/generated/library-components/SbTextPropsDocs.js +1 -1
  25. package/dist/ai-service/prompts/generated/library-typedefs/Dim.js +1 -1
  26. package/dist/ai-service/prompts/generated/library-typedefs/SbEventFlow.js +1 -1
  27. package/dist/ai-service/prompts/generated/subprompts/full-examples.js +1 -1
  28. package/dist/ai-service/prompts/generated/subprompts/superblocks-api.js +1 -1
  29. package/dist/ai-service/prompts/generated/subprompts/superblocks-components-rules.js +1 -1
  30. package/dist/ai-service/prompts/generated/subprompts/superblocks-custom-components.js +1 -1
  31. package/dist/ai-service/prompts/generated/subprompts/superblocks-data-filtering.js +1 -1
  32. package/dist/ai-service/prompts/generated/subprompts/superblocks-event-flow.js +1 -1
  33. package/dist/ai-service/prompts/generated/subprompts/superblocks-forms.js +1 -1
  34. package/dist/ai-service/prompts/generated/subprompts/superblocks-layouts.js +1 -1
  35. package/dist/ai-service/prompts/generated/subprompts/superblocks-page.js +1 -1
  36. package/dist/ai-service/prompts/generated/subprompts/superblocks-rbac.js +1 -1
  37. package/dist/ai-service/prompts/generated/subprompts/superblocks-routes.js +1 -1
  38. package/dist/ai-service/prompts/generated/subprompts/superblocks-state.js +1 -1
  39. package/dist/ai-service/prompts/generated/subprompts/superblocks-theming.js +1 -1
  40. package/dist/ai-service/prompts/generated/subprompts/system.js +1 -1
  41. package/dist/ai-service/state-machine/clark-fsm.d.ts +0 -1
  42. package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
  43. package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
  44. package/dist/ai-service/state-machine/handlers/agent-planning.js +0 -2
  45. package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
  46. package/dist/ai-service/state-machine/handlers/llm-generating.d.ts +1 -1
  47. package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
  48. package/dist/ai-service/state-machine/handlers/llm-generating.js +8 -40
  49. package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
  50. package/dist/ai-service/types.d.ts +0 -1
  51. package/dist/ai-service/types.d.ts.map +1 -1
  52. package/dist/ai-service/types.js.map +1 -1
  53. package/dist/file-sync-vite-plugin.d.ts.map +1 -1
  54. package/dist/file-sync-vite-plugin.js +3 -12
  55. package/dist/file-sync-vite-plugin.js.map +1 -1
  56. package/dist/file-system-helpers.d.ts +0 -2
  57. package/dist/file-system-helpers.d.ts.map +1 -1
  58. package/dist/file-system-helpers.js +0 -6
  59. package/dist/file-system-helpers.js.map +1 -1
  60. package/dist/file-system-manager.d.ts +2 -11
  61. package/dist/file-system-manager.d.ts.map +1 -1
  62. package/dist/file-system-manager.js +135 -207
  63. package/dist/file-system-manager.js.map +1 -1
  64. package/dist/index.d.ts +0 -1
  65. package/dist/index.d.ts.map +1 -1
  66. package/dist/index.js +0 -1
  67. package/dist/index.js.map +1 -1
  68. package/dist/inject-index-vite-plugin.js.map +1 -1
  69. package/dist/injected-index.d.ts +2 -2
  70. package/dist/injected-index.d.ts.map +1 -1
  71. package/dist/injected-index.js.map +1 -1
  72. package/dist/parsing/events/to-code-events.d.ts.map +1 -1
  73. package/dist/parsing/events/to-code-events.js +0 -7
  74. package/dist/parsing/events/to-code-events.js.map +1 -1
  75. package/dist/parsing/events/to-value-events.d.ts.map +1 -1
  76. package/dist/parsing/events/to-value-events.js +0 -28
  77. package/dist/parsing/events/to-value-events.js.map +1 -1
  78. package/dist/socket-manager.d.ts +2 -2
  79. package/dist/socket-manager.d.ts.map +1 -1
  80. package/dist/source-tracker.d.ts +20 -20
  81. package/dist/source-tracker.d.ts.map +1 -1
  82. package/dist/source-tracker.js +12 -26
  83. package/dist/source-tracker.js.map +1 -1
  84. package/package.json +6 -14
  85. package/dist/binding-extraction/index.d.ts +0 -2
  86. package/dist/binding-extraction/index.d.ts.map +0 -1
  87. package/dist/binding-extraction/index.js +0 -2
  88. package/dist/binding-extraction/index.js.map +0 -1
  89. package/dist/operations/operation-processor.d.ts +0 -24
  90. package/dist/operations/operation-processor.d.ts.map +0 -1
  91. package/dist/operations/operation-processor.js +0 -80
  92. package/dist/operations/operation-processor.js.map +0 -1
  93. package/dist/operations/types.d.ts +0 -8
  94. package/dist/operations/types.d.ts.map +0 -1
  95. package/dist/operations/types.js +0 -2
  96. package/dist/operations/types.js.map +0 -1
  97. package/dist/parsing/index.d.ts +0 -3
  98. package/dist/parsing/index.d.ts.map +0 -1
  99. package/dist/parsing/index.js +0 -3
  100. package/dist/parsing/index.js.map +0 -1
@@ -12,9 +12,8 @@ import { generateJSXAttribute } from "./codegen.js";
12
12
  import { ComponentsManager } from "./components-manager.js";
13
13
  import { addLegacyCustomComponentVariables, modifyLegacyCustomComponentElements, modifyLegacyCustomComponentImports, } from "./custom-components.js";
14
14
  import { applyErrorHandling, } from "./errors/error-handler.js";
15
- import { getPageFolder, isPageFilePath, PAGES_DIRECTORY, ROUTES_FILE, SCOPE_FILE, } from "./file-system-helpers.js";
15
+ import { getPageFolder, PAGES_DIRECTORY, ROUTES_FILE, SCOPE_FILE, } from "./file-system-helpers.js";
16
16
  import { generate } from "./generate.js";
17
- import { OperationProcessor } from "./operations/operation-processor.js";
18
17
  import { doesElementHaveBinding } from "./parsing/bindings.js";
19
18
  import { getSbElementId } from "./parsing/ids.js";
20
19
  import { makeJSXAttribute } from "./parsing/jsx.js";
@@ -48,13 +47,12 @@ const SUPPORTED_FILETYPES = [
48
47
  },
49
48
  ];
50
49
  const APP_THEME_FILE_NAME = "appTheme.ts";
51
- export class FileSystemManager extends TracedEventEmitter {
50
+ export class FileSyncManager extends TracedEventEmitter {
52
51
  rootDir;
53
52
  tsFiles = {};
54
53
  apiFiles = {};
55
54
  sourceTracker;
56
55
  fsOperationQueue;
57
- operationProcessor;
58
56
  generationNumberSequence;
59
57
  routes = {};
60
58
  watcher;
@@ -67,12 +65,6 @@ export class FileSystemManager extends TracedEventEmitter {
67
65
  this.fsOperationQueue = fsOperationQueue;
68
66
  this.generationNumberSequence = generationNumberSequence;
69
67
  this._tracer = tracer;
70
- // intentionally a new queue here, we don't want to share the queue with the fsOperationQueue
71
- this.operationProcessor = new OperationProcessor({
72
- batchWindowMs: 50,
73
- maxBatchSize: 100,
74
- });
75
- this.operationProcessor.disable();
76
68
  applyErrorHandling(this, {
77
69
  watch: { operation: "editing from code" },
78
70
  handleCreatePage: { operation: "creating a page" },
@@ -227,203 +219,139 @@ export class FileSystemManager extends TracedEventEmitter {
227
219
  this.updateApi(content, path);
228
220
  }
229
221
  });
230
- watcher.on("all", this.handleFileChange);
231
- }
232
- enableOperationsQueue() {
233
- this.operationProcessor.enable();
234
- }
235
- disableOperationsQueue() {
236
- this.operationProcessor.disable();
237
- }
238
- async flushOperations() {
239
- await this.operationProcessor.flush();
240
- }
241
- handleFileChange = async (event, filePath) => {
242
- const logger = getLogger();
243
- logger.info(`File changed: ${filePath}, event: ${event}`);
244
- const rootPath = this.rootDir;
245
- if (!rootPath) {
246
- throw new Error("Root directory not set");
247
- }
248
- // Skip directory events
249
- if (event === "addDir" || event === "unlinkDir") {
250
- return;
251
- }
252
- const routePath = path.join(rootPath, ROUTES_FILE);
253
- const fileType = SUPPORTED_FILETYPES.find((f) => filePath.endsWith(f.extension));
254
- // Only handle files we care about and that are in our root path
255
- if (!fileType || !filePath.startsWith(rootPath)) {
256
- return;
257
- }
258
- // Queue the operation based on the event type
259
- switch (event) {
260
- case "add": {
261
- const data = await readFile(filePath);
262
- if (typeof data !== "string")
263
- return;
264
- const isPage = isPageFilePath(filePath);
265
- if (isPage) {
266
- void this.operationProcessor.addOperation({
267
- metadata: {
268
- filePath,
269
- },
270
- execute: async () => {
271
- const file = await readFile(filePath);
272
- if (!file) {
273
- logger.error(`Failed to read file: ${filePath}`);
274
- return;
275
- }
276
- if (!(filePath in this.tsFiles)) {
277
- this.tsFiles[filePath] = file;
278
- this.handleNonVisualChangeByDeletingIds(filePath, file);
279
- this.emit("addPage", filePath);
280
- }
281
- },
282
- });
222
+ const handleFileChange = async (event, filePath) => {
223
+ logger.info(`File changed: ${filePath}, event: ${event}`);
224
+ switch (event) {
225
+ case "add": {
226
+ const fileType = SUPPORTED_FILETYPES.find((f) => filePath.endsWith(f.extension));
227
+ if (!fileType || !filePath.startsWith(rootPath)) {
228
+ return;
229
+ }
230
+ const data = await readFile(filePath);
231
+ if (typeof data !== "string")
232
+ return;
233
+ // if we match pages/*/index.tsx, we want to emit an addPage event
234
+ if (/pages\/.*\/index\.tsx/.test(filePath)) {
235
+ const file = await readFile(filePath);
236
+ if (!file) {
237
+ logger.error(`Failed to read file: ${filePath}`);
238
+ return;
239
+ }
240
+ if (!(filePath in this.tsFiles)) {
241
+ this.tsFiles[filePath] = file;
242
+ this.handleNonVisualChangeByDeletingIds(filePath, file);
243
+ this.emit("addPage", filePath);
244
+ }
245
+ }
246
+ switch (fileType.type) {
247
+ case "api":
248
+ case "python-api-step":
249
+ case "js-api-step": {
250
+ await this.processApiUpdates(filePath, fileType);
251
+ break;
252
+ }
253
+ }
254
+ break;
283
255
  }
284
- else {
285
- void this.operationProcessor.addOperation({
286
- metadata: {
287
- filePath,
288
- },
289
- execute: async () => {
290
- switch (fileType.type) {
291
- case "api":
292
- case "python-api-step":
293
- case "js-api-step": {
294
- await this.processApiUpdates(filePath, fileType);
295
- break;
256
+ case "change": {
257
+ // Special routes file handling
258
+ if (filePath === routePath) {
259
+ const data = await readFile(filePath);
260
+ try {
261
+ this.routes = JSON.parse(data);
262
+ this.emit("routesChanged", this.routes);
263
+ }
264
+ catch (e) {
265
+ logger.error("Error parsing routes file", getErrorMeta(e));
266
+ }
267
+ return;
268
+ }
269
+ const fileType = SUPPORTED_FILETYPES.find((f) => filePath.endsWith(f.extension));
270
+ if (!fileType || !filePath.startsWith(rootPath)) {
271
+ return;
272
+ }
273
+ const data = await readFile(filePath);
274
+ if (typeof data !== "string")
275
+ return;
276
+ switch (fileType.type) {
277
+ case "tsx":
278
+ case "scope":
279
+ {
280
+ if (!(filePath in this.tsFiles && this.tsFiles[filePath] === data)) {
281
+ logger.info(`File changed: ${filePath} updating AST tracker`);
282
+ this.tsFiles[filePath] = data;
283
+ // only update the source tracker if the file is different
284
+ this.handleNonVisualChangeByDeletingIds(filePath, data);
285
+ this.emit("fileChanged", filePath, data, true);
296
286
  }
297
- }
298
- },
299
- });
300
- }
301
- break;
302
- }
303
- case "change": {
304
- if (filePath === routePath) {
305
- void this.operationProcessor.addOperation({
306
- metadata: {
307
- filePath,
308
- },
309
- priority: true,
310
- execute: async () => {
311
- try {
312
- const data = JSON.parse((await readFile(filePath)) ?? "{}");
313
- if (!isEqual(this.routes, data)) {
314
- this.routes = data;
315
- this.emit("routesChanged", this.routes);
287
+ else {
288
+ logger.info(`File unchanged from last tracked state: ${filePath}`);
289
+ this.emit("fileChanged", filePath, data, false);
316
290
  }
317
291
  }
318
- catch (e) {
319
- logger.error("Error parsing routes file", getErrorMeta(e));
292
+ break;
293
+ case "api":
294
+ case "python-api-step":
295
+ case "js-api-step":
296
+ {
297
+ await this.processApiUpdates(filePath, fileType);
320
298
  }
321
- },
322
- });
323
- return;
299
+ break;
300
+ }
301
+ break;
324
302
  }
325
- else {
326
- void this.operationProcessor.addOperation({
327
- metadata: {
328
- filePath,
329
- },
330
- execute: async () => {
331
- const fileType = SUPPORTED_FILETYPES.find((f) => filePath.endsWith(f.extension));
332
- if (!fileType || !filePath.startsWith(rootPath)) {
333
- return;
334
- }
335
- const data = await readFile(filePath);
336
- if (typeof data !== "string")
337
- return;
338
- switch (fileType.type) {
339
- case "tsx":
340
- case "scope":
341
- {
342
- if (!(filePath in this.tsFiles &&
343
- this.tsFiles[filePath] === data)) {
344
- logger.info(`File changed: ${filePath} updating AST tracker`);
345
- this.tsFiles[filePath] = data;
346
- // only update the source tracker if the file is different
347
- this.handleNonVisualChangeByDeletingIds(filePath, data);
348
- this.emit("fileChanged", filePath, data, true);
349
- }
350
- else {
351
- logger.info(`File unchanged from last tracked state: ${filePath}`);
352
- this.emit("fileChanged", filePath, data, false);
353
- }
354
- }
355
- break;
356
- case "api":
357
- case "python-api-step":
358
- case "js-api-step":
359
- {
360
- await this.processApiUpdates(filePath, fileType);
361
- }
362
- break;
363
- }
364
- },
365
- });
303
+ case "unlink": {
304
+ if (filePath in this.apiFiles) {
305
+ const api = this.apiFiles[filePath];
306
+ delete this.apiFiles[filePath];
307
+ if (!api || !this.sourceTracker)
308
+ break;
309
+ const scopeId = await this.sourceTracker.deleteApi({
310
+ pageName: api.pageName,
311
+ apiName: api.apiPb.metadata.name,
312
+ });
313
+ const changes = (await this.sourceTracker?.getAndFlushChanges()) ?? [];
314
+ await this.writeChanges(changes);
315
+ this.emit("apiManualDelete", {
316
+ api: {
317
+ id: getClientApiId(api.apiPb.metadata.name, api.pageName),
318
+ apiName: api.apiPb.metadata.name,
319
+ // TODO(saksham): get pagename more defensively
320
+ pageName: getPageName(filePath),
321
+ scopeId,
322
+ },
323
+ });
324
+ }
325
+ if (filePath in this.tsFiles) {
326
+ delete this.tsFiles[filePath];
327
+ this.sourceTracker?.removeFile(filePath);
328
+ this.emit("deletePage", filePath);
329
+ }
330
+ break;
366
331
  }
367
- break;
368
332
  }
369
- case "unlink": {
370
- if (filePath in this.tsFiles) {
371
- void this.operationProcessor.addOperation({
372
- metadata: {
373
- filePath,
374
- },
375
- execute: async () => {
376
- await this.deleteTsFile(filePath);
377
- },
333
+ };
334
+ watcher.on("all", async (event, filePath) => {
335
+ const fileType = SUPPORTED_FILETYPES.find((f) => filePath.endsWith(f.extension));
336
+ switch (fileType?.type) {
337
+ case "tsx":
338
+ case "scope":
339
+ // these can be awaited to ensure sequential execution
340
+ this.fsOperationQueue.enqueue(async () => {
341
+ return await handleFileChange(event, filePath);
378
342
  });
379
- }
380
- else if (filePath in this.apiFiles) {
381
- void this.operationProcessor.addOperation({
382
- metadata: {
383
- filePath,
384
- },
385
- execute: async () => {
386
- await this.deleteApiFile(filePath);
387
- },
343
+ break;
344
+ default:
345
+ // some files including APIs cannot be awaited currently
346
+ this.fsOperationQueue.enqueue(async () => {
347
+ void handleFileChange(event, filePath);
388
348
  });
389
- }
390
- break;
391
349
  }
392
- }
393
- };
350
+ });
351
+ }
394
352
  getApiFiles() {
395
353
  return this.formatApisToClientApis(this.apiFiles);
396
354
  }
397
- async deleteTsFile(filePath) {
398
- delete this.tsFiles[filePath];
399
- this.sourceTracker?.removeFile(filePath);
400
- if (isPageFilePath(filePath)) {
401
- this.emit("deletePage", filePath);
402
- }
403
- }
404
- async deleteApiFile(filePath) {
405
- const api = this.apiFiles[filePath];
406
- if (!api) {
407
- return;
408
- }
409
- delete this.apiFiles[filePath];
410
- this.sourceTracker?.deleteApi({
411
- pageName: api.pageName,
412
- apiName: api.apiPb.metadata.name,
413
- });
414
- const changes = (await this.sourceTracker?.getAndFlushChanges()) ?? [];
415
- await this.writeChanges(changes);
416
- const scopeId = this.sourceTracker?.getScopeDefinitionForPage(api.pageName)?.id;
417
- this.emit("apiManualDelete", {
418
- api: {
419
- id: getClientApiId(api.apiPb.metadata.name, api.pageName),
420
- apiName: api.apiPb.metadata.name,
421
- // TODO(saksham): get pagename more defensively
422
- pageName: getPageName(filePath),
423
- scopeId,
424
- },
425
- });
426
- }
427
355
  getTsFilePaths() {
428
356
  return Object.keys(this.tsFiles);
429
357
  }
@@ -640,11 +568,11 @@ export default registerPage(Page, { name: "${name}" });
640
568
  handleReparent = async (payload, writeFile = true) => {
641
569
  const { from, to, changedProps, transaction } = payload;
642
570
  this.trackTransaction(transaction?.id);
643
- this.sourceTracker?.setProperties({
571
+ await this.sourceTracker?.setProperties({
644
572
  source: from.source,
645
573
  changes: changedProps ?? {},
646
574
  });
647
- this.sourceTracker?.moveElement({
575
+ await this.sourceTracker?.moveElement({
648
576
  from,
649
577
  to,
650
578
  });
@@ -658,7 +586,7 @@ export default registerPage(Page, { name: "${name}" });
658
586
  };
659
587
  handleCreateComponent = async (payload, writeFile = true) => {
660
588
  this.trackTransaction(payload.transaction?.id);
661
- const sourceId = this.sourceTracker?.addElement(payload);
589
+ const sourceId = await this.sourceTracker?.addElement(payload);
662
590
  if (writeFile) {
663
591
  const changes = (await this.sourceTracker?.getAndFlushChanges()) ?? [];
664
592
  await this.writeChanges(changes ?? [], (fileName) => {
@@ -672,7 +600,7 @@ export default registerPage(Page, { name: "${name}" });
672
600
  const { elements, transaction } = payload;
673
601
  this.trackTransaction(transaction?.id);
674
602
  for (const element of elements) {
675
- this.sourceTracker?.deleteElement({
603
+ await this.sourceTracker?.deleteElement({
676
604
  source: element.source,
677
605
  scopeName: element.scopeName,
678
606
  });
@@ -688,7 +616,7 @@ export default registerPage(Page, { name: "${name}" });
688
616
  handleSetProperty = async (payload, writeFile = true) => {
689
617
  const { element: { source }, property, value, transaction, } = payload;
690
618
  this.trackTransaction(transaction?.id);
691
- this.sourceTracker?.setProperty({
619
+ await this.sourceTracker?.setProperty({
692
620
  source,
693
621
  property,
694
622
  info: value,
@@ -703,7 +631,7 @@ export default registerPage(Page, { name: "${name}" });
703
631
  handleSetProperties = async (payload, writeFile = true) => {
704
632
  const { element: { source }, properties, transaction, } = payload;
705
633
  this.trackTransaction(transaction?.id);
706
- this.sourceTracker?.setProperties({
634
+ await this.sourceTracker?.setProperties({
707
635
  source,
708
636
  changes: properties,
709
637
  });
@@ -837,7 +765,7 @@ export default registerPage(Page, { name: "${name}" });
837
765
  await fs.rmdir(apiDir, { recursive: true });
838
766
  }
839
767
  delete this.apiFiles[apiFilePath];
840
- const scopeId = this.sourceTracker.deleteApi({
768
+ const scopeId = await this.sourceTracker.deleteApi({
841
769
  pageName,
842
770
  apiName,
843
771
  });
@@ -936,7 +864,7 @@ export default registerPage(Page, { name: "${name}" });
936
864
  }));
937
865
  };
938
866
  handleAddEntity = async (payload) => {
939
- this.sourceTracker?.addEntity({
867
+ await this.sourceTracker?.addEntity({
940
868
  scopeId: payload.scopeId,
941
869
  entity: {
942
870
  type: payload.type,
@@ -950,7 +878,7 @@ export default registerPage(Page, { name: "${name}" });
950
878
  });
951
879
  };
952
880
  handleUpdateEntity = async (payload) => {
953
- this.sourceTracker?.updateEntity({
881
+ await this.sourceTracker?.updateEntity({
954
882
  entityId: payload.entityId,
955
883
  updates: payload.updates,
956
884
  });
@@ -960,7 +888,7 @@ export default registerPage(Page, { name: "${name}" });
960
888
  });
961
889
  };
962
890
  handleDeleteEntity = async (payload) => {
963
- const deletedEntityName = this.sourceTracker?.deleteEntity({
891
+ const deletedEntityName = await this.sourceTracker?.deleteEntity({
964
892
  entityId: payload.entityId,
965
893
  });
966
894
  const changes = (await this.sourceTracker?.getAndFlushChanges()) ?? [];
@@ -976,7 +904,7 @@ export default registerPage(Page, { name: "${name}" });
976
904
  throw new Error("Root directory not set");
977
905
  }
978
906
  const filePath = path.join(this.rootDir, APP_THEME_FILE_NAME);
979
- this.sourceTracker?.updateTheme({
907
+ await this.sourceTracker?.updateTheme({
980
908
  themeFilePath: filePath,
981
909
  theme,
982
910
  });
@@ -1014,7 +942,7 @@ export default registerPage(Page, { name: "${name}" });
1014
942
  };
1015
943
  handleRenameEntity = async (payload) => {
1016
944
  const { elementId, newName, oldName, scopeName } = payload;
1017
- this.sourceTracker?.renameEntity({
945
+ await this.sourceTracker?.renameEntity({
1018
946
  entityId: elementId,
1019
947
  oldName,
1020
948
  newName,
@@ -1233,7 +1161,7 @@ export default registerPage(Page, { name: "${name}" });
1233
1161
  }
1234
1162
  }
1235
1163
  // Add new mock implementation
1236
- export class MockFileSyncManager extends FileSystemManager {
1164
+ export class MockFileSyncManager extends FileSyncManager {
1237
1165
  tsFiles = {};
1238
1166
  apiFiles = {};
1239
1167
  async watch(_watcher, _path) {
@@ -1309,7 +1237,7 @@ async function readFiles(dir) {
1309
1237
  const getMergedApiContent = async (path) => {
1310
1238
  return readAppApiYamlFile(path.split("/").slice(0, -1).join("/"));
1311
1239
  };
1312
- export const getPageName = (path) => {
1240
+ const getPageName = (path) => {
1313
1241
  const parts = path.split("/");
1314
1242
  const pagesIndex = parts.findIndex((part) => part === "pages");
1315
1243
  if (pagesIndex !== -1 && parts[pagesIndex + 1]) {