vite-uni-dev-tool 0.0.11 → 0.0.13

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 (180) hide show
  1. package/README.md +55 -1
  2. package/dist/const.d.ts +133 -0
  3. package/dist/const.d.ts.map +1 -0
  4. package/dist/const.js +36 -0
  5. package/dist/core.d.ts +52 -0
  6. package/dist/core.d.ts.map +1 -0
  7. package/dist/core.js +80 -0
  8. package/dist/devConsole/index.d.ts +169 -0
  9. package/dist/devConsole/index.d.ts.map +1 -0
  10. package/dist/devConsole/index.js +270 -0
  11. package/dist/devEvent/index.d.ts +286 -0
  12. package/dist/devEvent/index.d.ts.map +1 -0
  13. package/dist/devEvent/index.js +435 -0
  14. package/dist/devEventBus/index.d.ts +42 -0
  15. package/dist/devEventBus/index.d.ts.map +1 -0
  16. package/dist/devEventBus/index.js +70 -0
  17. package/dist/devIntercept/index.d.ts +119 -0
  18. package/dist/devIntercept/index.d.ts.map +1 -0
  19. package/dist/devIntercept/index.js +582 -0
  20. package/dist/devRunJS/index.d.ts +67 -0
  21. package/dist/devRunJS/index.d.ts.map +1 -0
  22. package/dist/devStore/index.d.ts +178 -0
  23. package/dist/devStore/index.d.ts.map +1 -0
  24. package/dist/devStore/index.js +395 -0
  25. package/dist/devToolInfo/index.d.ts +17 -0
  26. package/dist/devToolInfo/index.d.ts.map +1 -0
  27. package/dist/devToolInfo/index.js +15 -0
  28. package/{dev → dist}/plugins/uniDevTool/uniDevTool.d.ts +15 -1
  29. package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -0
  30. package/dist/plugins/uniDevTool/uniDevTool.js +35 -0
  31. package/{dev → dist}/plugins/uniGlobalComponents/uniGlobalComponents.js +7 -7
  32. package/{dev → dist}/plugins/utils/index.d.ts +3 -0
  33. package/{dev → dist}/plugins/utils/index.d.ts.map +1 -1
  34. package/dist/plugins/utils/index.js +1 -0
  35. package/dist/type.d.ts +264 -0
  36. package/dist/type.d.ts.map +1 -0
  37. package/dist/utils/array.d.ts +2 -0
  38. package/dist/utils/array.d.ts.map +1 -0
  39. package/dist/utils/array.js +12 -0
  40. package/dist/utils/date.d.ts +19 -0
  41. package/dist/utils/date.d.ts.map +1 -0
  42. package/dist/utils/date.js +40 -0
  43. package/dist/utils/file.d.ts +11 -0
  44. package/dist/utils/file.d.ts.map +1 -0
  45. package/dist/utils/file.js +87 -0
  46. package/dist/utils/function.d.ts +28 -0
  47. package/dist/utils/function.d.ts.map +1 -0
  48. package/dist/utils/function.js +46 -0
  49. package/dist/utils/index.d.ts +11 -0
  50. package/dist/utils/index.d.ts.map +1 -0
  51. package/dist/utils/index.js +55 -0
  52. package/dist/utils/ip.d.ts +5 -0
  53. package/dist/utils/ip.d.ts.map +1 -0
  54. package/dist/utils/ip.js +21 -0
  55. package/dist/utils/language.d.ts +29 -0
  56. package/dist/utils/language.d.ts.map +1 -0
  57. package/dist/utils/language.js +50 -0
  58. package/dist/utils/object.d.ts +49 -0
  59. package/dist/utils/object.d.ts.map +1 -0
  60. package/dist/utils/object.js +118 -0
  61. package/dist/utils/page.d.ts +7 -0
  62. package/dist/utils/page.d.ts.map +1 -0
  63. package/dist/utils/page.js +7 -0
  64. package/dist/utils/platform.d.ts +4 -0
  65. package/dist/utils/platform.d.ts.map +1 -0
  66. package/dist/utils/platform.js +14 -0
  67. package/dist/utils/string.d.ts +45 -0
  68. package/dist/utils/string.d.ts.map +1 -0
  69. package/dist/utils/string.js +88 -0
  70. package/dist/utils/utils.d.ts +16 -0
  71. package/dist/utils/utils.d.ts.map +1 -0
  72. package/dist/v2/AutoSizer/utils.d.ts +5 -0
  73. package/dist/v2/AutoSizer/utils.d.ts.map +1 -0
  74. package/dist/v2/JsonPretty/hooks/useClipboard.d.ts +4 -0
  75. package/dist/v2/JsonPretty/hooks/useClipboard.d.ts.map +1 -0
  76. package/dist/v2/JsonPretty/hooks/useError.d.ts +8 -0
  77. package/dist/v2/JsonPretty/hooks/useError.d.ts.map +1 -0
  78. package/dist/v2/JsonPretty/type.d.ts +93 -0
  79. package/dist/v2/JsonPretty/type.d.ts.map +1 -0
  80. package/dist/v3/AutoSizer/utils.d.ts +5 -0
  81. package/dist/v3/AutoSizer/utils.d.ts.map +1 -0
  82. package/dist/v3/ConsoleList/staticTips.d.ts +13 -0
  83. package/dist/v3/ConsoleList/staticTips.d.ts.map +1 -0
  84. package/dist/v3/JsonPretty/hooks/useClipboard.d.ts +4 -0
  85. package/dist/v3/JsonPretty/hooks/useClipboard.d.ts.map +1 -0
  86. package/dist/v3/JsonPretty/hooks/useError.d.ts +8 -0
  87. package/dist/v3/JsonPretty/hooks/useError.d.ts.map +1 -0
  88. package/dist/v3/JsonPretty/type.d.ts +93 -0
  89. package/dist/v3/JsonPretty/type.d.ts.map +1 -0
  90. package/dist/v3/JsonPretty/utils/index.d.ts +10 -0
  91. package/dist/v3/JsonPretty/utils/index.d.ts.map +1 -0
  92. package/package.json +5 -5
  93. package/dev/components/AppInfo/index.vue +0 -36
  94. package/dev/components/AutoSizer/index.vue +0 -193
  95. package/dev/components/AutoSizer/index1.vue +0 -186
  96. package/dev/components/AutoSizer/utils.ts +0 -49
  97. package/dev/components/Button/index.vue +0 -34
  98. package/dev/components/CaptureScreen/index.vue +0 -62
  99. package/dev/components/Checkbox/index.vue +0 -40
  100. package/dev/components/CloseButton/index.vue +0 -26
  101. package/dev/components/Code/index.vue +0 -230
  102. package/dev/components/Connection/index.vue +0 -88
  103. package/dev/components/ConsoleList/Code.vue +0 -227
  104. package/dev/components/ConsoleList/ConsoleItem.vue +0 -186
  105. package/dev/components/ConsoleList/RunJSInput.vue +0 -235
  106. package/dev/components/ConsoleList/index.vue +0 -130
  107. package/dev/components/ConsoleList/staticTips.ts +0 -1145
  108. package/dev/components/DevTool/index.vue +0 -182
  109. package/dev/components/DevToolButton/index.vue +0 -213
  110. package/dev/components/DevToolTitle/index.vue +0 -21
  111. package/dev/components/DevToolWindow/index.vue +0 -1037
  112. package/dev/components/DeviceInfo/index.vue +0 -32
  113. package/dev/components/Empty/empty.png +0 -0
  114. package/dev/components/Empty/index.vue +0 -28
  115. package/dev/components/FilterInput/index.vue +0 -86
  116. package/dev/components/JsonPretty/components/Brackets/index.vue +0 -23
  117. package/dev/components/JsonPretty/components/Carets/index.vue +0 -59
  118. package/dev/components/JsonPretty/components/CheckController/index.vue +0 -125
  119. package/dev/components/JsonPretty/components/TreeNode/index.vue +0 -349
  120. package/dev/components/JsonPretty/hooks/useClipboard.ts +0 -21
  121. package/dev/components/JsonPretty/hooks/useError.ts +0 -21
  122. package/dev/components/JsonPretty/index.vue +0 -474
  123. package/dev/components/JsonPretty/type.ts +0 -125
  124. package/dev/components/JsonPretty/utils/index.ts +0 -172
  125. package/dev/components/NetworkList/NetworkDetail.vue +0 -197
  126. package/dev/components/NetworkList/NetworkItem.vue +0 -106
  127. package/dev/components/NetworkList/index.vue +0 -115
  128. package/dev/components/PiniaList/index.vue +0 -64
  129. package/dev/components/RouteList/index.vue +0 -110
  130. package/dev/components/RunJS/index.vue +0 -128
  131. package/dev/components/SettingList/index.vue +0 -225
  132. package/dev/components/StorageList/index.vue +0 -170
  133. package/dev/components/SystemInfo/index.vue +0 -34
  134. package/dev/components/Tabs/index.vue +0 -123
  135. package/dev/components/Tag/index.vue +0 -89
  136. package/dev/components/UniEvent/UniEventItem.vue +0 -124
  137. package/dev/components/UniEvent/index.vue +0 -94
  138. package/dev/components/UploadList/UploadDetail.vue +0 -208
  139. package/dev/components/UploadList/UploadItem.vue +0 -111
  140. package/dev/components/UploadList/index.vue +0 -104
  141. package/dev/components/VirtualList/index.vue +0 -112
  142. package/dev/components/VirtualListPro/AutoSize.vue +0 -43
  143. package/dev/components/VirtualListPro/index.vue +0 -175
  144. package/dev/components/VirtualListPro/readme.md +0 -40
  145. package/dev/components/VuexList/index.vue +0 -54
  146. package/dev/components/WebSocket/WebSocketItem.vue +0 -98
  147. package/dev/components/WebSocket/WebSocketList.vue +0 -176
  148. package/dev/components/WebSocket/index.vue +0 -111
  149. package/dev/components/WindowInfo/index.vue +0 -33
  150. package/dev/const.ts +0 -166
  151. package/dev/core.ts +0 -118
  152. package/dev/devConsole/index.ts +0 -350
  153. package/dev/devEvent/index.ts +0 -806
  154. package/dev/devEventBus/index.ts +0 -94
  155. package/dev/devIntercept/index.ts +0 -745
  156. package/dev/devRunJS/index.ts +0 -170
  157. package/dev/devStore/index.ts +0 -718
  158. package/dev/plugins/uniDevTool/uniDevTool.d.ts.map +0 -1
  159. package/dev/plugins/uniDevTool/uniDevTool.js +0 -36
  160. package/dev/plugins/utils/index.js +0 -1
  161. package/dev/shims-uni.d.ts +0 -43
  162. package/dev/type.ts +0 -264
  163. package/dev/utils/array.ts +0 -15
  164. package/dev/utils/date.ts +0 -75
  165. package/dev/utils/file.ts +0 -121
  166. package/dev/utils/function.ts +0 -192
  167. package/dev/utils/index.d.ts +0 -6
  168. package/dev/utils/index.ts +0 -46
  169. package/dev/utils/ip.ts +0 -79
  170. package/dev/utils/language.ts +0 -72
  171. package/dev/utils/object.ts +0 -298
  172. package/dev/utils/page.ts +0 -13
  173. package/dev/utils/platform.ts +0 -14
  174. package/dev/utils/string.ts +0 -133
  175. package/dev/utils/utils.ts +0 -198
  176. /package/{dev → dist}/index.d.ts +0 -0
  177. /package/{dev → dist}/index.d.ts.map +0 -0
  178. /package/{dev → dist}/index.js +0 -0
  179. /package/{dev → dist}/plugins/uniGlobalComponents/uniGlobalComponents.d.ts +0 -0
  180. /package/{dev → dist}/plugins/uniGlobalComponents/uniGlobalComponents.d.ts.map +0 -0
package/README.md CHANGED
@@ -27,6 +27,10 @@ import * as path from 'path';
27
27
 
28
28
  // https://vitejs.dev/config/
29
29
  export default defineConfig({
30
+ optimizeDeps: {
31
+ // 预构建排除 vite-uni-dev-tool 模块,防止 eventBus 冲突
32
+ exclude: ['vite-uni-dev-tool'],
33
+ },
30
34
  plugins: [
31
35
  // 一定要在 uni() 之前调用 否则微信小程序将无法正常编译组件
32
36
  uniDevTool({
@@ -46,6 +50,28 @@ export default defineConfig({
46
50
  });
47
51
  ```
48
52
 
53
+ ### uniDevTool 配置项
54
+
55
+ | 参数 | 说明 | 类型 | 默认值 |
56
+ | ---------------------------- | ---------------------------------------------------------------------------------------------- | -------- | ---------------------- |
57
+ | pages | 配置pages.json | object | {} |
58
+ | enableInterceptPromiseReject | 是否拦截Promise.reject 最好不要拦截 默认禁用 | boolean | false |
59
+ | consoleMaxSize | 最大的console条数 | number | 1000 |
60
+ | networkMaxSize | 最大的网络请求条数 | number | 1000 |
61
+ | uploadMaxSize | 最大的上传文件条数 | number | 1000 |
62
+ | wsDataMaxSize | 最大的套接字消息条数 | number | 1000 |
63
+ | captureScreenMaxSize | 最大的截图记录条数 | number | 1000 |
64
+ | cacheMaxSize | 最大占用缓存空间 bytes | number | 8\*1024\*1024\*10 |
65
+ | buttonSize | 按钮大小 | number | 50 |
66
+ | buttonText | 按钮文本 | string | 🐜 |
67
+ | buttonFontSize | 按钮字体大小 | string | 16px |
68
+ | buttonBackgroundColor | 按钮背景颜色 | string | rgba(255, 255, 255, 0) |
69
+ | initShowDevTool | 初始化时是否显示调试按钮,默认显示 | boolean | true |
70
+ | zIndex | 调试按钮的zIndex,默认1000 | number | 1000 |
71
+ | useDevSource | 该属性处于实验当中,谨慎使用,读取开发环境 source file,source map,默认 禁用 | boolean | false |
72
+ | sourceFileServers | 该属性处于实验当中,谨慎使用,开发环境 source file 服务器地址,默认 [] ,配合 useDevSource 使用 | string[] | [] |
73
+ | importConsole | 是否导入 console 默认不导入, 只会捕获error 和 warn | boolean | false |
74
+
49
75
  ### 为什么不用 subPackages?
50
76
 
51
77
  - 从当前页跳转到subPackages页面时,会触发 uni-app 页面生命周期,有时是不希望如此的,比如在开发过程中,希望可以直接在当前页面进行调试。
@@ -53,7 +79,6 @@ export default defineConfig({
53
79
  ### 如何将 console 日志输出到控制台
54
80
 
55
81
  - 0.0.5版本之后为了在生产环境中移除插件,开发环境中插件将会自动导入 `console`,无需手动导入
56
-
57
82
  - 0.0.5版本之后不推荐使用 `uni.__dev__console` , 在未来版本中可能会进行移除
58
83
 
59
84
  ```ts
@@ -67,6 +92,24 @@ console.log('hello vite-uni-dev-tool');
67
92
  uni.__dev__console.log('hello vite-uni-dev-tool');
68
93
  ```
69
94
 
95
+ ### 0.0.12 版本在插件中增加了 `importConsole` 属性,默认不导入,只捕获`error`, `warn`, 用户手动调用的`console` 将不再进行捕获,如需捕获传入`true`即可
96
+
97
+ ```ts
98
+ uniDevTool({
99
+ pages,
100
+ importConsole: true
101
+ }),
102
+ ```
103
+
104
+ ### vite 预加载导致的 `eventBus` 事件冲突 , 预加载排除 `vite-uni-dev-tool` 即可
105
+
106
+ ```ts
107
+ optimizeDeps: {
108
+ // 预构建排除 vite-uni-dev-tool 模块,防止 eventBus 冲突
109
+ exclude: ['vite-uni-dev-tool'],
110
+ }
111
+ ```
112
+
70
113
  ### 注意事项
71
114
 
72
115
  ### 兼容性说明
@@ -151,6 +194,17 @@ uni.__dev__console.log('hello vite-uni-dev-tool');
151
194
 
152
195
  ## 更新日志
153
196
 
197
+ ### 0.0.12
198
+
199
+ - 修复 network url显示长度
200
+ - 修复部分样式
201
+ - 修复列表高度异常
202
+ - 修复销毁之后操作
203
+ - 刷新之后隐藏调试弹窗
204
+ - 列表返回到顶部
205
+ - 增加层级属性,默认层级1000
206
+ - 构建导致的 eventBus 冲突
207
+
154
208
  ### 0.0.11
155
209
 
156
210
  - 新增 console run 简易提示
@@ -0,0 +1,133 @@
1
+ /**
2
+ * 调试按钮事件
3
+ */
4
+ export declare const DEV_BUTTON_VISIBLE = "dev-button-visible";
5
+ /**
6
+ * 调试弹窗事件
7
+ */
8
+ export declare const DEV_WINDOW_VISIBLE = "dev-window-visible";
9
+ /**
10
+ * app 发出的信息
11
+ */
12
+ export declare const DEV_APP_MESSAGE = "dev-app-message";
13
+ /**
14
+ * 调试弹窗发出的消息
15
+ */
16
+ export declare const DEV_WINDOW_MESSAGE = "dev-window-message";
17
+ /**
18
+ * 调试器销毁
19
+ */
20
+ export declare const DEV_IS_DESTROY = "dev-is-destroy";
21
+ /**
22
+ * 清空console
23
+ */
24
+ export declare const DEV_CONSOLE_CLEAR = "dev-console-clear";
25
+ /**
26
+ * 清空network
27
+ */
28
+ export declare const DEV_NETWORK_CLEAR = "dev-network-clear";
29
+ /**
30
+ * 清空websocket
31
+ */
32
+ export declare const DEV_WEBSOCKET_CLEAR = "dev-websocket-clear";
33
+ /**
34
+ * 清空upload
35
+ */
36
+ export declare const DEV_UPLOAD_CLEAR = "dev-upload-clear";
37
+ /**
38
+ * 清空storage
39
+ */
40
+ export declare const DEV_STORAGE_CLEAR = "dev-storage-clear";
41
+ /**
42
+ * 刷新storage
43
+ */
44
+ export declare const DEV_STORAGE_REFRESH = "dev-storage-refresh";
45
+ /**
46
+ * 移除storage
47
+ */
48
+ export declare const DEV_STORAGE_REMOVE = "dev-storage-remove";
49
+ /**
50
+ * 新增storage
51
+ */
52
+ export declare const DEV_STORAGE_ADD = "dev-storage-add";
53
+ /**
54
+ * 更新storage
55
+ */
56
+ export declare const DEV_STORAGE_UPDATE = "dev-storage-update";
57
+ /**
58
+ * 页面跳转
59
+ */
60
+ export declare const DEV_PAGE_JUMP = "dev-page-jump";
61
+ /**
62
+ * 隐藏调试按钮
63
+ */
64
+ export declare const DEV_BUTTON_SHOW_OR_HIDE = "dev-button-show-or-hide";
65
+ /**
66
+ * 重启调试器
67
+ */
68
+ export declare const DEV_RESTART_DEBUGGER = "dev-restart-debugger";
69
+ /**
70
+ * 重启app
71
+ */
72
+ export declare const DEV_RESTART_APP = "dev-restart-app";
73
+ /**
74
+ * 导出日志
75
+ */
76
+ export declare const DEV_EXPORT_LOG = "dev-export-log";
77
+ /**
78
+ * 改变vuex数据
79
+ */
80
+ export declare const DEV_VUEX_CHANGE = "dev-vuex-change";
81
+ /**
82
+ * 改变pinia
83
+ */
84
+ export declare const DEV_PINIA_CHANGE = "dev-pinia-change";
85
+ /**
86
+ * 清除日志缓存
87
+ */
88
+ export declare const DEV_LOG_CACHE_CLEAR = "dev-log-cache-clear";
89
+ /**
90
+ * 销毁调试工具
91
+ */
92
+ export declare const DEV_DESTROY = "dev-destroy";
93
+ /**
94
+ * 显示调试弹窗
95
+ */
96
+ export declare const DEV_WINDOW_OPEN = "dev-window-open";
97
+ /**
98
+ * 显示调试弹窗
99
+ */
100
+ export declare const DEV_WINDOW_CLOSE = "dev-window-close";
101
+ /**
102
+ * 刷新路由列表
103
+ */
104
+ export declare const DEV_ROUTE_REFRESH = "dev-route-refresh";
105
+ /**
106
+ * 获取 dev option
107
+ */
108
+ export declare const DEV_OPTION = "dev-option";
109
+ /**
110
+ * 获取options
111
+ */
112
+ export declare const DEV_OPTION_GET = "dev-option-get";
113
+ /**
114
+ * 发送 options
115
+ */
116
+ export declare const DEV_OPTION_SEND = "dev-option-send";
117
+ /**
118
+ * 清空事件
119
+ */
120
+ export declare const DEV_UNI_EVENT_CLEAR = "dev-uni-event-clear";
121
+ /**
122
+ * 运行js
123
+ */
124
+ export declare const DEV_RUN_JS = "dev-uni-run-js";
125
+ /**
126
+ * 清空截屏列表
127
+ */
128
+ export declare const DEV_CAPTURE_SCREEN_CLEAR = "dev-capture-screen-clear";
129
+ /**
130
+ * 存储的dev-tool 信息
131
+ */
132
+ export declare const DEV_TOOL_INFO = "dev-tool-info";
133
+ //# sourceMappingURL=const.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../dev/const.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C;;GAEG;AACH,e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,oBAAoB,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,wBAAwB,6BAA6B,CAAC;AAEnE;;GAEG;AACH,eAAO,MAAM,aAAa,kBAAkB,CAAC"}
package/dist/const.js ADDED
@@ -0,0 +1,36 @@
1
+ const e = "dev-button-visible", E = "dev-window-visible", o = "dev-app-message", _ = "dev-window-message", t = "dev-is-destroy", s = "dev-console-clear", n = "dev-network-clear", c = "dev-websocket-clear", d = "dev-upload-clear", D = "dev-storage-clear", v = "dev-storage-refresh", V = "dev-storage-remove", O = "dev-storage-add", r = "dev-storage-update", R = "dev-page-jump", a = "dev-button-show-or-hide", A = "dev-restart-debugger", T = "dev-restart-app", S = "dev-export-log", N = "dev-vuex-change", i = "dev-pinia-change", C = "dev-log-cache-clear", I = "dev-destroy", l = "dev-window-open", p = "dev-window-close", L = "dev-route-refresh", g = "dev-option", G = "dev-option-get", P = "dev-option-send", u = "dev-uni-event-clear", w = "dev-uni-run-js", U = "dev-capture-screen-clear", W = "dev-tool-info";
2
+ export {
3
+ o as DEV_APP_MESSAGE,
4
+ a as DEV_BUTTON_SHOW_OR_HIDE,
5
+ e as DEV_BUTTON_VISIBLE,
6
+ U as DEV_CAPTURE_SCREEN_CLEAR,
7
+ s as DEV_CONSOLE_CLEAR,
8
+ I as DEV_DESTROY,
9
+ S as DEV_EXPORT_LOG,
10
+ t as DEV_IS_DESTROY,
11
+ C as DEV_LOG_CACHE_CLEAR,
12
+ n as DEV_NETWORK_CLEAR,
13
+ g as DEV_OPTION,
14
+ G as DEV_OPTION_GET,
15
+ P as DEV_OPTION_SEND,
16
+ R as DEV_PAGE_JUMP,
17
+ i as DEV_PINIA_CHANGE,
18
+ T as DEV_RESTART_APP,
19
+ A as DEV_RESTART_DEBUGGER,
20
+ L as DEV_ROUTE_REFRESH,
21
+ w as DEV_RUN_JS,
22
+ O as DEV_STORAGE_ADD,
23
+ D as DEV_STORAGE_CLEAR,
24
+ v as DEV_STORAGE_REFRESH,
25
+ V as DEV_STORAGE_REMOVE,
26
+ r as DEV_STORAGE_UPDATE,
27
+ W as DEV_TOOL_INFO,
28
+ u as DEV_UNI_EVENT_CLEAR,
29
+ d as DEV_UPLOAD_CLEAR,
30
+ N as DEV_VUEX_CHANGE,
31
+ c as DEV_WEBSOCKET_CLEAR,
32
+ p as DEV_WINDOW_CLOSE,
33
+ _ as DEV_WINDOW_MESSAGE,
34
+ l as DEV_WINDOW_OPEN,
35
+ E as DEV_WINDOW_VISIBLE
36
+ };
package/dist/core.d.ts ADDED
@@ -0,0 +1,52 @@
1
+ import { DevConsole } from './devConsole';
2
+ import { DevTool } from './type';
3
+ import { EventBus } from './devEventBus';
4
+
5
+ /**
6
+ * 备份原生方法
7
+ *
8
+ * @private
9
+ * @memberof DevStore
10
+ */
11
+ declare const backup: {
12
+ setStorage: {
13
+ (options: UniApp.SetStorageOptions): void;
14
+ <T extends UniApp.SetStorageOptions = UniApp.SetStorageOptions>(options: T): UniApp.PromisifySuccessResult<T, UniApp.SetStorageOptions, void>;
15
+ };
16
+ setStorageSync: (key: string, value: any) => void;
17
+ clearStorage: () => void;
18
+ clearStorageSync: () => void;
19
+ removeStorage: {
20
+ (options: UniApp.RemoveStorageOptions): void;
21
+ <T_1 extends UniApp.RemoveStorageOptions = UniApp.RemoveStorageOptions>(options: T_1): UniApp.PromisifySuccessResult<T_1, UniApp.RemoveStorageOptions, void>;
22
+ };
23
+ removeStorageSync: (key: string) => void;
24
+ reject: <T_2 = never>(reason?: any) => Promise<T_2>;
25
+ connectSocket: {
26
+ (options: UniApp.ConnectSocketOption): UniApp.SocketTask;
27
+ <T_3 extends UniApp.ConnectSocketOption = UniApp.ConnectSocketOption>(options: T_3): UniApp.PromisifySuccessResult<T_3, UniApp.ConnectSocketOption, UniApp.SocketTask>;
28
+ };
29
+ uploadFile: {
30
+ (options: UniApp.UploadFileOption): UniApp.UploadTask;
31
+ <T_4 extends UniApp.UploadFileOption = UniApp.UploadFileOption>(options: T_4): UniApp.PromisifySuccessResult<T_4, UniApp.UploadFileOption, UniApp.UploadTask>;
32
+ };
33
+ $on: (eventName: string, callback: (result: any) => void) => void;
34
+ $once: (eventName: string, callback: (result: any) => void) => void;
35
+ $emit: (eventName: string, param?: any) => void;
36
+ $off: (eventName?: string | string[] | undefined, callback?: ((result: any) => void) | undefined) => void;
37
+ __log__: any;
38
+ };
39
+ declare const eventBus: EventBus;
40
+ declare const console: DevConsole;
41
+ declare function getDevToolOptions(): DevTool.DevToolOptions | undefined;
42
+ declare function initDevTool(options?: DevTool.DevToolOptions): void;
43
+ declare function showDevToolButton(): void;
44
+ declare function hideDevToolButton(): void;
45
+ declare function openDevToolWindow(): void;
46
+ declare function closeDevToolWindow(): void;
47
+ declare function createDevTool(): void;
48
+ declare function destroyDevTool(): void;
49
+ declare function interceptVuexStorage(store: any): void;
50
+ declare function interceptPiniaStore(context: any): any;
51
+ export { backup, console, initDevTool, createDevTool, destroyDevTool, showDevToolButton, hideDevToolButton, openDevToolWindow, closeDevToolWindow, getDevToolOptions, interceptVuexStorage, interceptPiniaStore, eventBus, };
52
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../dev/core.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC;;;;;GAKG;AACH,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBX,CAAC;AAEF,QAAA,MAAM,QAAQ,UAAiB,CAAC;AAShC,QAAA,MAAM,OAAO,YAAwB,CAAC;AAOtC,iBAAS,iBAAiB,uCAEzB;AAED,iBAAS,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,QAQpD;AAED,iBAAS,iBAAiB,SAEzB;AAED,iBAAS,iBAAiB,SAEzB;AAED,iBAAS,iBAAiB,SAEzB;AAED,iBAAS,kBAAkB,SAE1B;AAED,iBAAS,aAAa,SAMrB;AAED,iBAAS,cAAc,SAEtB;AAED,iBAAS,oBAAoB,CAAC,KAAK,EAAE,GAAG,QAEvC;AAED,iBAAS,mBAAmB,CAAC,OAAO,EAAE,GAAG,OAExC;AAID,OAAO,EACL,MAAM,EACN,OAAO,EACP,WAAW,EACX,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,QAAQ,GACT,CAAC"}
package/dist/core.js ADDED
@@ -0,0 +1,80 @@
1
+ import { DevStore as c } from "./devStore/index.js";
2
+ import { DevEvent as i } from "./devEvent/index.js";
3
+ import { DevIntercept as u } from "./devIntercept/index.js";
4
+ import { DevConsole as l } from "./devConsole/index.js";
5
+ import { EventBus as v } from "./devEventBus/index.js";
6
+ const s = {
7
+ // log: console.log,
8
+ // info: console.info,
9
+ // warn: console.warn,
10
+ // error: console.error,
11
+ setStorage: uni == null ? void 0 : uni.setStorage,
12
+ setStorageSync: uni == null ? void 0 : uni.setStorageSync,
13
+ clearStorage: uni == null ? void 0 : uni.clearStorage,
14
+ clearStorageSync: uni == null ? void 0 : uni.clearStorageSync,
15
+ removeStorage: uni == null ? void 0 : uni.removeStorage,
16
+ removeStorageSync: uni == null ? void 0 : uni.removeStorageSync,
17
+ reject: Promise.reject,
18
+ connectSocket: uni == null ? void 0 : uni.connectSocket,
19
+ uploadFile: uni == null ? void 0 : uni.uploadFile,
20
+ $on: uni.$on,
21
+ $once: uni.$once,
22
+ $emit: uni.$emit,
23
+ $off: uni.$off,
24
+ __log__: uni.__log__
25
+ }, a = new v(), o = new c(), n = new i({
26
+ store: o,
27
+ eventBus: a
28
+ }), r = new l(n), t = new u({
29
+ event: n,
30
+ enableInterceptPromiseReject: o == null ? void 0 : o.enableInterceptPromiseReject
31
+ });
32
+ function T() {
33
+ return o.getDevToolOptions();
34
+ }
35
+ function p(e) {
36
+ e != null && e.mode || r.error("[DevTool] 请传入 mode: import.meta.env.MODE"), o.setDevToolOptions(e || { mode: "" }), t.interceptVue3(e == null ? void 0 : e.vue3instance);
37
+ }
38
+ function d() {
39
+ n.showDevToolButton();
40
+ }
41
+ function _() {
42
+ n.hideDevToolButton();
43
+ }
44
+ function w() {
45
+ n.openDevToolWindow();
46
+ }
47
+ function y() {
48
+ n.closeDevToolWindow();
49
+ }
50
+ function $() {
51
+ n.createDevTool(), t.init({
52
+ event: n,
53
+ enableInterceptPromiseReject: o == null ? void 0 : o.enableInterceptPromiseReject
54
+ });
55
+ }
56
+ function P() {
57
+ n.destroyDevTool();
58
+ }
59
+ function j(e) {
60
+ return t.interceptVuexStorage(e);
61
+ }
62
+ function B(e) {
63
+ return t.interceptPiniaStore(e);
64
+ }
65
+ uni.__dev__console = r;
66
+ export {
67
+ s as backup,
68
+ y as closeDevToolWindow,
69
+ r as console,
70
+ $ as createDevTool,
71
+ P as destroyDevTool,
72
+ a as eventBus,
73
+ T as getDevToolOptions,
74
+ _ as hideDevToolButton,
75
+ p as initDevTool,
76
+ B as interceptPiniaStore,
77
+ j as interceptVuexStorage,
78
+ w as openDevToolWindow,
79
+ d as showDevToolButton
80
+ };
@@ -0,0 +1,169 @@
1
+ import { DevEvent } from '../devEvent';
2
+ import { DevTool } from '../type';
3
+
4
+ /**
5
+ * DevTool 包装之后的 console 类
6
+ *
7
+ * 用于记录 console 日志
8
+ *
9
+ * 覆盖 console 将会导致难以预料的事情发生,因此不建议覆盖 console
10
+ *
11
+ * @export
12
+ * @class DevConsole
13
+ */
14
+ export declare class DevConsole {
15
+ event: DevEvent;
16
+ /**
17
+ * 时间戳记录
18
+ *
19
+ * @memberof DevConsole
20
+ */
21
+ timeMap: Map<string, number>;
22
+ /**
23
+ * 计数器记录
24
+ *
25
+ * @memberof DevConsole
26
+ */
27
+ countMap: Map<string, number>;
28
+ constructor(event: DevEvent);
29
+ /**
30
+ * 包装之后的 console 方法
31
+ *
32
+ * @param {DevTool.ConsoleType} type
33
+ * @param {any[]} args
34
+ * @memberof DevConsole
35
+ */
36
+ factory(type: DevTool.ConsoleType, args: any[]): void;
37
+ /**
38
+ * DevTool 包装之后的 console.log 方法
39
+ *
40
+ * @param {...any[]} args
41
+ * @memberof DevConsole
42
+ */
43
+ log(...args: any[]): void;
44
+ /**
45
+ * DevTool 包装之后的 console.info 方法
46
+ *
47
+ * @param {...any[]} args
48
+ * @memberof DevConsole
49
+ */
50
+ info(...args: any[]): void;
51
+ /**
52
+ * DevTool 包装之后的 console.warn 方法
53
+ *
54
+ * @param {...any[]} args
55
+ * @memberof DevConsole
56
+ */
57
+ warn(...args: any[]): void;
58
+ /**
59
+ * DevTool 包装之后的 console.error 方法
60
+ *
61
+ * @param {...any[]} args
62
+ * @memberof DevConsole
63
+ */
64
+ error(...args: any[]): void;
65
+ /**
66
+ * DevTool 包装之后的 console.time 方法
67
+ *
68
+ * @param {string} label
69
+ * @memberof DevConsole
70
+ */
71
+ time(label: string): void;
72
+ /**
73
+ * DevTool 包装之后的 console.timeEnd 方法
74
+ *
75
+ * @param {string} label
76
+ * @memberof DevConsole
77
+ */
78
+ timeEnd(label: string): void;
79
+ /**
80
+ * DevTool 包装之后的 console.clear 方法
81
+ *
82
+ * @memberof DevConsole
83
+ */
84
+ clear(): void;
85
+ /**
86
+ * DevTool 包装之后的 console.count 方法
87
+ *
88
+ * @param {string} [label='']
89
+ * @memberof DevConsole
90
+ */
91
+ count(label?: string): void;
92
+ /**
93
+ * DevTool 包装之后的 console.countReset 方法
94
+ *
95
+ * @param {string} [label='']
96
+ * @memberof DevConsole
97
+ */
98
+ countReset(label?: string): void;
99
+ /**
100
+ * 原始 console.assert 方法
101
+ *
102
+ * @param {...any[]} args
103
+ * @memberof DevConsole
104
+ */
105
+ assert(...args: any[]): void;
106
+ /**
107
+ * 原始 console.debug 方法
108
+ *
109
+ * @param {...any[]} args
110
+ * @memberof DevConsole
111
+ */
112
+ debug(...args: any[]): void;
113
+ /**
114
+ * 原始 console.dir 方法
115
+ *
116
+ * @param {...any[]} args
117
+ * @memberof DevConsole
118
+ */
119
+ dir(...args: any[]): void;
120
+ /**
121
+ * 原始 console.dirxml 方法
122
+ *
123
+ * @param {...any[]} args
124
+ * @memberof DevConsole
125
+ */
126
+ dirxml(...args: any[]): void;
127
+ /**
128
+ * 原始 console.group 方法
129
+ *
130
+ * @param {...any[]} args
131
+ * @memberof DevConsole
132
+ */
133
+ group(...args: any[]): void;
134
+ /**
135
+ * 原始 console.groupCollapsed 方法
136
+ *
137
+ * @param {...any[]} args
138
+ * @memberof DevConsole
139
+ */
140
+ groupCollapsed(...args: any[]): void;
141
+ /**
142
+ * 原始 console.groupEnd 方法
143
+ *
144
+ * @memberof DevConsole
145
+ */
146
+ groupEnd(): void;
147
+ /**
148
+ * 原始 console.table 方法
149
+ *
150
+ * @param {...any[]} args
151
+ * @memberof DevConsole
152
+ */
153
+ table(...args: any[]): void;
154
+ /**
155
+ * 原始 console.timeStamp 方法
156
+ *
157
+ * @param {...any[]} args
158
+ * @memberof DevConsole
159
+ */
160
+ timeStamp(...args: any[]): void;
161
+ /**
162
+ * 原始 console.profile 方法
163
+ *
164
+ * @param {...any[]} args
165
+ * @memberof DevConsole
166
+ */
167
+ trace(...args: any[]): void;
168
+ }
169
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../dev/devConsole/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AASvC;;;;;;;;;GASG;AACH,qBAAa,UAAU;IACrB,KAA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