vite-uni-dev-tool 0.0.10 → 0.0.11

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.
@@ -26,6 +26,7 @@ export class DevStore {
26
26
  deviceInfo: {},
27
27
  windowInfo: {},
28
28
  systemInfo: {},
29
+ appInfo: {},
29
30
  wsList: [],
30
31
  netWorkStatus: {},
31
32
  uploadList: [],
@@ -36,6 +37,7 @@ export class DevStore {
36
37
  emit: 0,
37
38
  off: 0,
38
39
  },
40
+ captureScreenList: [],
39
41
  };
40
42
 
41
43
  /** 调试配置 */
@@ -52,6 +54,8 @@ export class DevStore {
52
54
  private eventListMaxSize = 1000;
53
55
  /** js 最大运行条数 */
54
56
  private runJsMaxSize = 1000;
57
+ /** 截屏最大值 */
58
+ private captureScreenMaxSize = 1000;
55
59
 
56
60
  /** 缓存最大值 */
57
61
  cacheMaxSize = 8 * 1024 * 1024 * 10;
@@ -185,6 +189,14 @@ export class DevStore {
185
189
  const systemInfo = uni.getSystemInfoSync();
186
190
  const deviceInfo = uni.getDeviceInfo();
187
191
  const windowInfo = uni.getWindowInfo();
192
+
193
+ const appInfo = {
194
+ ...(await uni.getAppBaseInfo()),
195
+
196
+ // #ifndef H5
197
+ ...(await uni.getAppAuthorizeSetting()),
198
+ // #endif
199
+ };
188
200
  const ip = getWifiIp() || getLanIp() || (await getMicroAppIp());
189
201
  return {
190
202
  ...this.state,
@@ -192,6 +204,7 @@ export class DevStore {
192
204
  deviceInfo,
193
205
  windowInfo,
194
206
  devToolVisible: this.getDevToolVisible(),
207
+ appInfo,
195
208
  netWorkStatus: {
196
209
  ip,
197
210
  ...networkType,
@@ -344,6 +357,8 @@ export class DevStore {
344
357
  emit: 0,
345
358
  off: 0,
346
359
  };
360
+
361
+ this.state.captureScreenList = [];
347
362
  }
348
363
 
349
364
  addUploadTask(index: number | string, task: UniApp.UploadTask) {
@@ -682,4 +697,22 @@ export class DevStore {
682
697
  };
683
698
  this.state.eventList = [];
684
699
  }
700
+
701
+ updateCaptureScreenList(captureScreenList: DevTool.CaptureScreenItem[]) {
702
+ const len = this.state.captureScreenList?.length ?? 0;
703
+ const max = this.captureScreenMaxSize;
704
+ if (len + captureScreenList.length > max) {
705
+ this.state.captureScreenList?.splice(
706
+ 0,
707
+ len - max - captureScreenList.length,
708
+ );
709
+ }
710
+ this.state.captureScreenList?.push(...captureScreenList);
711
+
712
+ return this.state.captureScreenList;
713
+ }
714
+
715
+ clearCaptureScreenList() {
716
+ this.state.captureScreenList = [];
717
+ }
685
718
  }
package/dev/type.ts CHANGED
@@ -230,6 +230,11 @@ export declare namespace DevTool {
230
230
  mode?: 'input' | 'output';
231
231
  };
232
232
 
233
+ type CaptureScreenItem = {
234
+ position: string;
235
+ timer: string;
236
+ };
237
+
233
238
  type WindowData = {
234
239
  devToolVisible?: boolean;
235
240
  consoleList?: ConsoleItem[];
@@ -242,12 +247,14 @@ export declare namespace DevTool {
242
247
  deviceInfo?: Record<string, any>;
243
248
  windowInfo?: Record<string, any>;
244
249
  netWorkStatus?: Record<string, any>;
250
+ appInfo?: Record<string, any>;
245
251
  wsList?: WS[];
246
252
  size?: number;
247
253
  sizeFormat?: string;
248
254
  uploadList?: UploadItem[];
249
255
  eventCount?: EventCount;
250
256
  eventList?: EventItem[];
257
+ captureScreenList?: CaptureScreenItem[];
251
258
  };
252
259
 
253
260
  type DevInterceptOptions = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-uni-dev-tool",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "vite-uni-dev-tool, debug, uni-app, 一处编写,到处调试",
5
5
  "keywords": [
6
6
  "vite",