@lvce-editor/test-worker 4.23.0 → 4.24.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/dist/api.d.ts CHANGED
@@ -184,6 +184,12 @@ declare const selectItem$1: (label: string) => Promise<void>;
184
184
  declare const selectIndex$2: (index: number) => Promise<void>;
185
185
  declare const selectCurrentIndex$1: () => Promise<void>;
186
186
  declare const executeCommand: (label: string) => Promise<void>;
187
+ declare const handleClickSectionWatch: () => Promise<void>;
188
+ declare const addWatchExpression: (expression: string) => Promise<void>;
189
+ declare const handleWatchValueChange: () => Promise<void>;
190
+ declare const acceptWatchExpressionEdit: () => Promise<void>;
191
+ declare const selectIndex$3: (index: number) => Promise<void>;
192
+ declare const handleRename: () => Promise<void>;
187
193
  declare const setValue$2: (value: string) => Promise<void>;
188
194
  declare const setReplaceValue: (value: string) => Promise<void>;
189
195
  declare const setExcludeValue: (value: string) => Promise<void>;
@@ -195,7 +201,7 @@ declare const collapseDetails: () => Promise<void>;
195
201
  declare const dismissItem: () => Promise<void>;
196
202
  declare const focusFirst$6: () => Promise<void>;
197
203
  declare const focusIndex$2: (index: number) => Promise<void>;
198
- declare const selectIndex$3: (index: number) => Promise<void>;
204
+ declare const selectIndex$4: (index: number) => Promise<void>;
199
205
  declare const focusNext$8: () => Promise<void>;
200
206
  declare const handleWheel$1: (deltaMode: number, deltaY: number) => Promise<void>;
201
207
  declare const focusNextPage: () => Promise<void>;
@@ -210,7 +216,7 @@ declare const toggleReplace: () => Promise<void>;
210
216
  declare const update: (settings: any) => Promise<void>;
211
217
  declare const open$4: (id: string) => Promise<void>;
212
218
  declare const hide: () => Promise<void>;
213
- declare const selectIndex$4: (index: number) => Promise<void>;
219
+ declare const selectIndex$5: (index: number) => Promise<void>;
214
220
  declare const acceptInput: () => Promise<void>;
215
221
  declare const handleInput$2: (text: string) => Promise<void>;
216
222
  declare const handleClickSourceControlButtons: (index: number, name: string) => Promise<void>;
@@ -304,8 +310,11 @@ declare namespace Problems {
304
310
  declare namespace QuickPick {
305
311
  export { executeCommand, focusFirst$5 as focusFirst, focusIndex$1 as focusIndex, focusLast$5 as focusLast, focusNext$7 as focusNext, focusPrevious$5 as focusPrevious, handleClickAt$1 as handleClickAt, handleInput$1 as handleInput, open$3 as open, selectCurrentIndex$1 as selectCurrentIndex, selectIndex$2 as selectIndex, selectItem$1 as selectItem, setValue$1 as setValue };
306
312
  }
313
+ declare namespace RunAndDebug {
314
+ export { acceptWatchExpressionEdit, addWatchExpression, handleClickSectionWatch, handleRename, handleWatchValueChange, selectIndex$3 as selectIndex };
315
+ }
307
316
  declare namespace Search {
308
- export { clearSearchResults, collapseDetails, dismissItem, focusFirst$6 as focusFirst, focusIndex$2 as focusIndex, focusNext$8 as focusNext, focusNextPage, focusPrevious$6 as focusPrevious, focusPreviousPage, handleWheel$1 as handleWheel, openDetails, replaceAll, selectIndex$3 as selectIndex, setExcludeValue, setIncludeValue, setReplaceValue, setValue$2 as setValue, toggleMatchCase, toggleMatchWholeWord, togglePreserveCase, toggleReplace, toggleSearchDetails, toggleUseRegularExpression };
317
+ export { clearSearchResults, collapseDetails, dismissItem, focusFirst$6 as focusFirst, focusIndex$2 as focusIndex, focusNext$8 as focusNext, focusNextPage, focusPrevious$6 as focusPrevious, focusPreviousPage, handleWheel$1 as handleWheel, openDetails, replaceAll, selectIndex$4 as selectIndex, setExcludeValue, setIncludeValue, setReplaceValue, setValue$2 as setValue, toggleMatchCase, toggleMatchWholeWord, togglePreserveCase, toggleReplace, toggleSearchDetails, toggleUseRegularExpression };
309
318
  }
310
319
  declare namespace Settings {
311
320
  export { update };
@@ -314,7 +323,7 @@ declare namespace SideBar {
314
323
  export { hide, open$4 as open };
315
324
  }
316
325
  declare namespace SourceControl {
317
- export { acceptInput, handleClickSourceControlButtons, handleInput$2 as handleInput, selectIndex$4 as selectIndex };
326
+ export { acceptInput, handleClickSourceControlButtons, handleInput$2 as handleInput, selectIndex$5 as selectIndex };
318
327
  }
319
328
  declare namespace StatusBar {
320
329
  export { update$1 as update };
@@ -349,6 +358,7 @@ export interface TestApi {
349
358
  readonly Platform: typeof Platform,
350
359
  readonly Problems: typeof Problems,
351
360
  readonly QuickPick: typeof QuickPick,
361
+ readonly RunAndDebug: typeof RunAndDebug,
352
362
  readonly Search: typeof Search,
353
363
  readonly Settings: typeof Settings,
354
364
  readonly SideBar: typeof SideBar,
@@ -513,7 +513,7 @@ const create$4 = (method, params) => {
513
513
  };
514
514
  };
515
515
  const callbacks = Object.create(null);
516
- const set$3 = (id, fn) => {
516
+ const set$2 = (id, fn) => {
517
517
  callbacks[id] = fn;
518
518
  };
519
519
  const get$2 = id => {
@@ -532,7 +532,7 @@ const registerPromise = () => {
532
532
  resolve,
533
533
  promise
534
534
  } = Promise.withResolvers();
535
- set$3(id, resolve);
535
+ set$2(id, resolve);
536
536
  return {
537
537
  id,
538
538
  promise
@@ -746,18 +746,18 @@ const getErrorProperty = (error, prettyError) => {
746
746
  }
747
747
  };
748
748
  };
749
- const create$1$1 = (message, error) => {
749
+ const create$1$1 = (id, error) => {
750
750
  return {
751
751
  jsonrpc: Two,
752
- id: message.id,
752
+ id,
753
753
  error
754
754
  };
755
755
  };
756
- const getErrorResponse = (message, error, preparePrettyError, logError) => {
756
+ const getErrorResponse = (id, error, preparePrettyError, logError) => {
757
757
  const prettyError = preparePrettyError(error);
758
758
  logError(error, prettyError);
759
759
  const errorProperty = getErrorProperty(error, prettyError);
760
- return create$1$1(message, errorProperty);
760
+ return create$1$1(id, errorProperty);
761
761
  };
762
762
  const create$5 = (message, result) => {
763
763
  return {
@@ -770,12 +770,27 @@ const getSuccessResponse = (message, result) => {
770
770
  const resultProperty = result ?? null;
771
771
  return create$5(message, resultProperty);
772
772
  };
773
+ const getErrorResponseSimple = (id, error) => {
774
+ return {
775
+ jsonrpc: Two,
776
+ id,
777
+ error: {
778
+ code: Custom,
779
+ // @ts-ignore
780
+ message: error.message,
781
+ data: error
782
+ }
783
+ };
784
+ };
773
785
  const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
774
786
  try {
775
787
  const result = requiresSocket(message.method) ? await execute(message.method, ipc, ...message.params) : await execute(message.method, ...message.params);
776
788
  return getSuccessResponse(message, result);
777
789
  } catch (error) {
778
- return getErrorResponse(message, error, preparePrettyError, logError);
790
+ if (ipc.canUseSimpleErrorResponse) {
791
+ return getErrorResponseSimple(message.id, error);
792
+ }
793
+ return getErrorResponse(message.id, error, preparePrettyError, logError);
779
794
  }
780
795
  };
781
796
  const defaultPreparePrettyError = error => {
@@ -830,7 +845,7 @@ const handleJsonRpcMessage = async (...args) => {
830
845
  try {
831
846
  ipc.send(response);
832
847
  } catch (error) {
833
- const errorResponse = getErrorResponse(message, error, preparePrettyError, logError);
848
+ const errorResponse = getErrorResponse(message.id, error, preparePrettyError, logError);
834
849
  ipc.send(errorResponse);
835
850
  }
836
851
  return;
@@ -988,7 +1003,7 @@ const printTestError = async error => {
988
1003
  };
989
1004
 
990
1005
  const rpcs = Object.create(null);
991
- const set$b = (id, rpc) => {
1006
+ const set$f = (id, rpc) => {
992
1007
  rpcs[id] = rpc;
993
1008
  };
994
1009
  const get$1 = id => {
@@ -1012,21 +1027,24 @@ const create$1 = rpcId => {
1012
1027
  return rpc.invokeAndTransfer(method, ...params);
1013
1028
  },
1014
1029
  set(rpc) {
1015
- set$b(rpcId, rpc);
1030
+ set$f(rpcId, rpc);
1031
+ },
1032
+ async dispose() {
1033
+ const rpc = get$1(rpcId);
1034
+ await rpc.dispose();
1016
1035
  }
1017
1036
  };
1018
1037
  };
1019
1038
  const RendererWorker$1 = 1;
1020
1039
  const {
1021
- invoke: invoke$2,
1022
- invokeAndTransfer: invokeAndTransfer$2,
1023
- set: set$2
1024
- } = create$1(RendererWorker$1);
1040
+ invoke: invoke$3,
1041
+ invokeAndTransfer: invokeAndTransfer$3,
1042
+ set: set$3} = create$1(RendererWorker$1);
1025
1043
  const RendererWorker = {
1026
1044
  __proto__: null,
1027
- invoke: invoke$2,
1028
- invokeAndTransfer: invokeAndTransfer$2,
1029
- set: set$2
1045
+ invoke: invoke$3,
1046
+ invokeAndTransfer: invokeAndTransfer$3,
1047
+ set: set$3
1030
1048
  };
1031
1049
 
1032
1050
  const {
@@ -1933,7 +1951,7 @@ const TestFrameWorkComponentEditor = {
1933
1951
  type
1934
1952
  };
1935
1953
 
1936
- const selectIndex$4 = async index => {
1954
+ const selectIndex$5 = async index => {
1937
1955
  await invoke('EditorCompletion.selectIndex', index);
1938
1956
  };
1939
1957
  const selectCurrentIndex$1 = async () => {
@@ -1943,7 +1961,7 @@ const selectCurrentIndex$1 = async () => {
1943
1961
  const TestFrameWorkComponentEditorCompletion = {
1944
1962
  __proto__: null,
1945
1963
  selectCurrentIndex: selectCurrentIndex$1,
1946
- selectIndex: selectIndex$4
1964
+ selectIndex: selectIndex$5
1947
1965
  };
1948
1966
 
1949
1967
  /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
@@ -2204,7 +2222,7 @@ const TestFrameWorkComponentIconTheme = {
2204
2222
  setIconTheme
2205
2223
  };
2206
2224
 
2207
- const selectIndex$3 = async index => {
2225
+ const selectIndex$4 = async index => {
2208
2226
  return invoke('IframeInspector.selectIndex', index);
2209
2227
  };
2210
2228
  const focusNext$5 = async () => {
@@ -2226,7 +2244,7 @@ const TestFrameWorkComponentIframeInspector = {
2226
2244
  focusLast: focusLast$4,
2227
2245
  focusNext: focusNext$5,
2228
2246
  focusPrevious: focusPrevious$5,
2229
- selectIndex: selectIndex$3
2247
+ selectIndex: selectIndex$4
2230
2248
  };
2231
2249
 
2232
2250
  const open$3 = async () => {
@@ -2527,7 +2545,7 @@ const selectItem = async label => {
2527
2545
  // @ts-ignore
2528
2546
  await invoke('QuickPick.selectItem', label);
2529
2547
  };
2530
- const selectIndex$2 = async index => {
2548
+ const selectIndex$3 = async index => {
2531
2549
  // @ts-ignore
2532
2550
  await invoke('QuickPick.selectIndex', index);
2533
2551
  };
@@ -2556,11 +2574,46 @@ const TestFrameWorkComponentQuickPick = {
2556
2574
  handleInput: handleInput$1,
2557
2575
  open: open$1,
2558
2576
  selectCurrentIndex,
2559
- selectIndex: selectIndex$2,
2577
+ selectIndex: selectIndex$3,
2560
2578
  selectItem,
2561
2579
  setValue: setValue$1
2562
2580
  };
2563
2581
 
2582
+ const handleClickSectionWatch = async () => {
2583
+ // @ts-ignore
2584
+ await invoke('Run And Debug.handleClickSectionWatch');
2585
+ };
2586
+ const addWatchExpression = async expression => {
2587
+ // @ts-ignore
2588
+ await invoke('Run And Debug.addWatchExpression', expression);
2589
+ };
2590
+ const handleWatchValueChange = async () => {
2591
+ // @ts-ignore
2592
+ await invoke('Run And Debug.handleWatchValueChange');
2593
+ };
2594
+ const acceptWatchExpressionEdit = async () => {
2595
+ // @ts-ignore
2596
+ await invoke('Run And Debug.acceptWatchExpressionEdit');
2597
+ };
2598
+ const selectIndex$2 = async index => {
2599
+ // @ts-ignore
2600
+ await invoke('Run And Debug.selectIndex', index);
2601
+ };
2602
+ const handleRename = async () => {
2603
+ // @ts-ignore
2604
+ await invoke('Run And Debug.handleRename');
2605
+ };
2606
+
2607
+ const TestFrameWorkComponentRunAndDebug = {
2608
+ __proto__: null,
2609
+ acceptWatchExpressionEdit,
2610
+ addWatchExpression,
2611
+ handleClickSectionWatch,
2612
+ handleRename,
2613
+ handleWatchValueChange,
2614
+ selectIndex: selectIndex$2
2615
+ };
2616
+
2564
2617
  const Script = 2;
2565
2618
 
2566
2619
  const setValue = async value => {
@@ -2897,6 +2950,7 @@ const TestFrameWorkComponent = {
2897
2950
  Platform: TestFrameWorkComponentPlatform,
2898
2951
  Problems: TestFrameWorkComponentProblems,
2899
2952
  QuickPick: TestFrameWorkComponentQuickPick,
2953
+ RunAndDebug: TestFrameWorkComponentRunAndDebug,
2900
2954
  Search: TestFrameWorkComponentSearch,
2901
2955
  Settings: TestFrameWorkComponentSettings,
2902
2956
  SideBar: TestFrameWorkComponentSideBar,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-worker",
3
- "version": "4.23.0",
3
+ "version": "4.24.0",
4
4
  "description": "Test Worker",
5
5
  "repository": {
6
6
  "type": "git",