vite-uni-dev-tool 0.0.12 → 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 (181) hide show
  1. package/dist/const.d.ts +133 -0
  2. package/dist/const.d.ts.map +1 -0
  3. package/dist/const.js +36 -0
  4. package/dist/core.d.ts +52 -0
  5. package/dist/core.d.ts.map +1 -0
  6. package/dist/core.js +80 -0
  7. package/dist/devConsole/index.d.ts +169 -0
  8. package/dist/devConsole/index.d.ts.map +1 -0
  9. package/dist/devConsole/index.js +270 -0
  10. package/dist/devEvent/index.d.ts +286 -0
  11. package/dist/devEvent/index.d.ts.map +1 -0
  12. package/dist/devEvent/index.js +435 -0
  13. package/dist/devEventBus/index.d.ts +42 -0
  14. package/dist/devEventBus/index.d.ts.map +1 -0
  15. package/dist/devEventBus/index.js +70 -0
  16. package/dist/devIntercept/index.d.ts +119 -0
  17. package/dist/devIntercept/index.d.ts.map +1 -0
  18. package/dist/devIntercept/index.js +582 -0
  19. package/dist/devRunJS/index.d.ts +67 -0
  20. package/dist/devRunJS/index.d.ts.map +1 -0
  21. package/dist/devStore/index.d.ts +178 -0
  22. package/dist/devStore/index.d.ts.map +1 -0
  23. package/dist/devStore/index.js +395 -0
  24. package/dist/devToolInfo/index.d.ts +17 -0
  25. package/dist/devToolInfo/index.d.ts.map +1 -0
  26. package/dist/devToolInfo/index.js +15 -0
  27. package/{dev → dist}/plugins/uniDevTool/uniDevTool.d.ts +7 -1
  28. package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -0
  29. package/dist/plugins/uniDevTool/uniDevTool.js +35 -0
  30. package/{dev → dist}/plugins/utils/index.d.ts +3 -0
  31. package/{dev → dist}/plugins/utils/index.d.ts.map +1 -1
  32. package/dist/plugins/utils/index.js +1 -0
  33. package/dist/type.d.ts +264 -0
  34. package/dist/type.d.ts.map +1 -0
  35. package/dist/utils/array.d.ts +2 -0
  36. package/dist/utils/array.d.ts.map +1 -0
  37. package/dist/utils/array.js +12 -0
  38. package/dist/utils/date.d.ts +19 -0
  39. package/dist/utils/date.d.ts.map +1 -0
  40. package/dist/utils/date.js +40 -0
  41. package/dist/utils/file.d.ts +11 -0
  42. package/dist/utils/file.d.ts.map +1 -0
  43. package/dist/utils/file.js +87 -0
  44. package/dist/utils/function.d.ts +28 -0
  45. package/dist/utils/function.d.ts.map +1 -0
  46. package/dist/utils/function.js +46 -0
  47. package/dist/utils/index.d.ts +11 -0
  48. package/dist/utils/index.d.ts.map +1 -0
  49. package/dist/utils/index.js +55 -0
  50. package/dist/utils/ip.d.ts +5 -0
  51. package/dist/utils/ip.d.ts.map +1 -0
  52. package/dist/utils/ip.js +21 -0
  53. package/dist/utils/language.d.ts +29 -0
  54. package/dist/utils/language.d.ts.map +1 -0
  55. package/dist/utils/language.js +50 -0
  56. package/dist/utils/object.d.ts +49 -0
  57. package/dist/utils/object.d.ts.map +1 -0
  58. package/dist/utils/object.js +118 -0
  59. package/dist/utils/page.d.ts +7 -0
  60. package/dist/utils/page.d.ts.map +1 -0
  61. package/dist/utils/page.js +7 -0
  62. package/dist/utils/platform.d.ts +4 -0
  63. package/dist/utils/platform.d.ts.map +1 -0
  64. package/dist/utils/platform.js +14 -0
  65. package/dist/utils/string.d.ts +45 -0
  66. package/dist/utils/string.d.ts.map +1 -0
  67. package/dist/utils/string.js +88 -0
  68. package/dist/utils/utils.d.ts +16 -0
  69. package/dist/utils/utils.d.ts.map +1 -0
  70. package/dist/v2/AutoSizer/utils.d.ts +5 -0
  71. package/dist/v2/AutoSizer/utils.d.ts.map +1 -0
  72. package/dist/v2/JsonPretty/hooks/useClipboard.d.ts +4 -0
  73. package/dist/v2/JsonPretty/hooks/useClipboard.d.ts.map +1 -0
  74. package/dist/v2/JsonPretty/hooks/useError.d.ts +8 -0
  75. package/dist/v2/JsonPretty/hooks/useError.d.ts.map +1 -0
  76. package/dist/v2/JsonPretty/type.d.ts +93 -0
  77. package/dist/v2/JsonPretty/type.d.ts.map +1 -0
  78. package/dist/v3/AutoSizer/utils.d.ts +5 -0
  79. package/dist/v3/AutoSizer/utils.d.ts.map +1 -0
  80. package/dist/v3/ConsoleList/staticTips.d.ts +13 -0
  81. package/dist/v3/ConsoleList/staticTips.d.ts.map +1 -0
  82. package/dist/v3/JsonPretty/hooks/useClipboard.d.ts +4 -0
  83. package/dist/v3/JsonPretty/hooks/useClipboard.d.ts.map +1 -0
  84. package/dist/v3/JsonPretty/hooks/useError.d.ts +8 -0
  85. package/dist/v3/JsonPretty/hooks/useError.d.ts.map +1 -0
  86. package/dist/v3/JsonPretty/type.d.ts +93 -0
  87. package/dist/v3/JsonPretty/type.d.ts.map +1 -0
  88. package/dist/v3/JsonPretty/utils/index.d.ts +10 -0
  89. package/dist/v3/JsonPretty/utils/index.d.ts.map +1 -0
  90. package/package.json +5 -5
  91. package/dev/components/AppInfo/index.vue +0 -36
  92. package/dev/components/AutoSizer/index.vue +0 -193
  93. package/dev/components/AutoSizer/index1.vue +0 -186
  94. package/dev/components/AutoSizer/utils.ts +0 -49
  95. package/dev/components/Button/index.vue +0 -34
  96. package/dev/components/CaptureScreen/index.vue +0 -62
  97. package/dev/components/Checkbox/index.vue +0 -40
  98. package/dev/components/CloseButton/index.vue +0 -26
  99. package/dev/components/Code/index.vue +0 -230
  100. package/dev/components/Connection/index.vue +0 -88
  101. package/dev/components/ConsoleList/Code.vue +0 -227
  102. package/dev/components/ConsoleList/ConsoleItem.vue +0 -207
  103. package/dev/components/ConsoleList/RunJSInput.vue +0 -237
  104. package/dev/components/ConsoleList/index.vue +0 -139
  105. package/dev/components/ConsoleList/staticTips.ts +0 -1145
  106. package/dev/components/DevTool/index.vue +0 -188
  107. package/dev/components/DevToolButton/index.vue +0 -210
  108. package/dev/components/DevToolTitle/index.vue +0 -21
  109. package/dev/components/DevToolWindow/index.vue +0 -1053
  110. package/dev/components/DeviceInfo/index.vue +0 -32
  111. package/dev/components/Empty/empty.png +0 -0
  112. package/dev/components/Empty/index.vue +0 -28
  113. package/dev/components/FilterInput/index.vue +0 -86
  114. package/dev/components/JsonPretty/components/Brackets/index.vue +0 -23
  115. package/dev/components/JsonPretty/components/Carets/index.vue +0 -59
  116. package/dev/components/JsonPretty/components/CheckController/index.vue +0 -125
  117. package/dev/components/JsonPretty/components/TreeNode/index.vue +0 -349
  118. package/dev/components/JsonPretty/hooks/useClipboard.ts +0 -21
  119. package/dev/components/JsonPretty/hooks/useError.ts +0 -21
  120. package/dev/components/JsonPretty/index.vue +0 -476
  121. package/dev/components/JsonPretty/type.ts +0 -125
  122. package/dev/components/JsonPretty/utils/index.ts +0 -172
  123. package/dev/components/NetworkList/NetworkDetail.vue +0 -194
  124. package/dev/components/NetworkList/NetworkItem.vue +0 -119
  125. package/dev/components/NetworkList/index.vue +0 -128
  126. package/dev/components/PiniaList/index.vue +0 -64
  127. package/dev/components/RouteList/index.vue +0 -121
  128. package/dev/components/RunJS/index.vue +0 -128
  129. package/dev/components/SettingList/index.vue +0 -222
  130. package/dev/components/SourceCode/index.vue +0 -231
  131. package/dev/components/StorageList/index.vue +0 -170
  132. package/dev/components/SystemInfo/index.vue +0 -34
  133. package/dev/components/Tabs/index.vue +0 -123
  134. package/dev/components/Tag/index.vue +0 -89
  135. package/dev/components/UniEvent/UniEventItem.vue +0 -126
  136. package/dev/components/UniEvent/index.vue +0 -98
  137. package/dev/components/UploadList/UploadDetail.vue +0 -204
  138. package/dev/components/UploadList/UploadItem.vue +0 -117
  139. package/dev/components/UploadList/index.vue +0 -117
  140. package/dev/components/VirtualList/index.vue +0 -112
  141. package/dev/components/VirtualListPro/AutoSize.vue +0 -43
  142. package/dev/components/VirtualListPro/index.vue +0 -238
  143. package/dev/components/VirtualListPro/readme.md +0 -40
  144. package/dev/components/VuexList/index.vue +0 -54
  145. package/dev/components/WebSocket/WebSocketItem.vue +0 -103
  146. package/dev/components/WebSocket/WebSocketList.vue +0 -173
  147. package/dev/components/WebSocket/index.vue +0 -124
  148. package/dev/components/WindowInfo/index.vue +0 -33
  149. package/dev/const.ts +0 -164
  150. package/dev/core.ts +0 -118
  151. package/dev/devConsole/index.ts +0 -350
  152. package/dev/devEvent/index.ts +0 -810
  153. package/dev/devEventBus/index.ts +0 -94
  154. package/dev/devIntercept/index.ts +0 -745
  155. package/dev/devRunJS/index.ts +0 -170
  156. package/dev/devStore/index.ts +0 -732
  157. package/dev/devToolInfo/index.ts +0 -26
  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 -291
  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 -51
  169. package/dev/utils/ip.ts +0 -79
  170. package/dev/utils/language.ts +0 -77
  171. package/dev/utils/object.ts +0 -306
  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
  181. /package/{dev → dist}/plugins/uniGlobalComponents/uniGlobalComponents.js +0 -0
@@ -1,124 +0,0 @@
1
- <template>
2
- <view class="websocket-content">
3
- <view class="websocket-control">
4
- <FilterInput
5
- :modelValue="modelValue"
6
- placeholder="查询url"
7
- @search="emit('search', $event)"
8
- @update:modelValue="emit('update:modelValue', $event)"
9
- />
10
- <Tag
11
- v-for="item in webSocketFilter"
12
- :mode="item.mode"
13
- :key="item.value"
14
- :active="item.value === currentWebSocketType"
15
- @click="onChoose(item.value)"
16
- >
17
- {{ item.label }}
18
- </Tag>
19
- </view>
20
-
21
- <VirtualListPro
22
- :data="wsList"
23
- :pageSize="10"
24
- :height="height"
25
- className="websocket-list"
26
- >
27
- <template v-slot="{ list, start }">
28
- <AutoSize
29
- v-for="(item, index) in list"
30
- :index="start + index"
31
- :key="start + index"
32
- >
33
- <WebSocketItem :ws="item" :zIndex="zIndex" />
34
- </AutoSize>
35
- <Empty v-if="!wsList || wsList.length === 0" />
36
- </template>
37
- </VirtualListPro>
38
- </view>
39
- </template>
40
- <script lang="ts" setup>
41
- import WebSocketItem from './WebSocketItem.vue';
42
- import Tag from '../Tag/index.vue';
43
- import Empty from '../Empty/index.vue';
44
- import FilterInput from '../FilterInput/index.vue';
45
- import type { DevTool } from '../../type';
46
- import VirtualListPro from '../VirtualListPro/index.vue';
47
- import AutoSize from '../VirtualListPro/AutoSize.vue';
48
- import { onMounted, ref } from 'vue';
49
-
50
- defineProps<{
51
- wsList: DevTool.WS[];
52
- currentWebSocketType: string;
53
- modelValue: string;
54
- zIndex?: number;
55
- }>();
56
- const emit = defineEmits<{
57
- (e: 'choose', type: string): void;
58
- (e: 'update:modelValue', value: string): void;
59
- (e: 'search', value: string): void;
60
- }>();
61
- const webSocketFilter = [
62
- {
63
- label: '全部',
64
- value: 'all',
65
- mode: 'all',
66
- },
67
- {
68
- label: 'con',
69
- value: 'connection',
70
- mode: 'info',
71
- },
72
- {
73
- label: 'open',
74
- value: 'open',
75
- mode: 'success',
76
- },
77
- {
78
- label: 'close',
79
- value: 'close',
80
- mode: 'warn',
81
- },
82
- {
83
- label: 'error',
84
- value: 'error',
85
- mode: 'error',
86
- },
87
- {
88
- label: '清除',
89
- value: 'clear',
90
- mode: 'clear',
91
- },
92
- ];
93
-
94
- function onChoose(type: string) {
95
- emit('choose', type);
96
- }
97
-
98
- const height = ref(0);
99
- onMounted(() => {
100
- const { windowHeight } = uni.getWindowInfo();
101
- height.value = windowHeight - 32 - 32;
102
- });
103
- </script>
104
- <style scoped>
105
- .websocket-content {
106
- height: 100%;
107
- font-size: var(--dev-tool-base-font-size);
108
- }
109
-
110
- .websocket-control {
111
- display: flex;
112
- align-items: center;
113
- justify-content: space-between;
114
- gap: 8px;
115
- padding: 0 16px;
116
- height: 32px;
117
- border-bottom: 1px solid var(--dev-tool-border-color);
118
- box-sizing: border-box;
119
- }
120
- .websocket-list {
121
- height: calc(100% - 32px);
122
- overflow: auto;
123
- }
124
- </style>
@@ -1,33 +0,0 @@
1
- <template>
2
- <view class="window-info-content">
3
- <JsonPretty v-if="showJson" :data="windowInfo" />
4
- <Empty v-else />
5
- </view>
6
- </template>
7
- <script lang="ts" setup>
8
- import { computed } from 'vue';
9
- import JsonPretty from '../JsonPretty/index.vue';
10
-
11
- import Empty from '../Empty/index.vue';
12
- const props = defineProps<{
13
- windowInfo: Record<string, any>;
14
- }>();
15
-
16
- const showJson = computed(() => {
17
- try {
18
- const str = JSON.stringify(props.windowInfo);
19
- if (typeof props.windowInfo === 'object' && (str === '' || str === '{}')) {
20
- return false;
21
- }
22
- return true;
23
- } catch (error) {
24
- return false;
25
- }
26
- });
27
- </script>
28
- <style scoped>
29
- .window-info-content {
30
- padding: 16px;
31
- font-size: var(--dev-tool-base-font-size);
32
- }
33
- </style>
package/dev/const.ts DELETED
@@ -1,164 +0,0 @@
1
- /**
2
- * 调试按钮事件
3
- */
4
- export const DEV_BUTTON_VISIBLE = 'dev-button-visible';
5
-
6
- /**
7
- * 调试弹窗事件
8
- */
9
- export const DEV_WINDOW_VISIBLE = 'dev-window-visible';
10
-
11
- /**
12
- * app 发出的信息
13
- */
14
- export const DEV_APP_MESSAGE = 'dev-app-message';
15
-
16
- /**
17
- * 调试弹窗发出的消息
18
- */
19
- export const DEV_WINDOW_MESSAGE = 'dev-window-message';
20
-
21
- /**
22
- * 调试器销毁
23
- */
24
- export const DEV_IS_DESTROY = 'dev-is-destroy';
25
-
26
- /**
27
- * 清空console
28
- */
29
- export const DEV_CONSOLE_CLEAR = 'dev-console-clear';
30
-
31
- /**
32
- * 清空network
33
- */
34
- export const DEV_NETWORK_CLEAR = 'dev-network-clear';
35
-
36
- /**
37
- * 清空websocket
38
- */
39
- export const DEV_WEBSOCKET_CLEAR = 'dev-websocket-clear';
40
-
41
- /**
42
- * 清空upload
43
- */
44
- export const DEV_UPLOAD_CLEAR = 'dev-upload-clear';
45
-
46
- /**
47
- * 清空storage
48
- */
49
- export const DEV_STORAGE_CLEAR = 'dev-storage-clear';
50
-
51
- /**
52
- * 刷新storage
53
- */
54
- export const DEV_STORAGE_REFRESH = 'dev-storage-refresh';
55
-
56
- /**
57
- * 移除storage
58
- */
59
- export const DEV_STORAGE_REMOVE = 'dev-storage-remove';
60
-
61
- /**
62
- * 新增storage
63
- */
64
- export const DEV_STORAGE_ADD = 'dev-storage-add';
65
-
66
- /**
67
- * 更新storage
68
- */
69
- export const DEV_STORAGE_UPDATE = 'dev-storage-update';
70
-
71
- /**
72
- * 页面跳转
73
- */
74
- export const DEV_PAGE_JUMP = 'dev-page-jump';
75
-
76
- /**
77
- * 隐藏调试按钮
78
- */
79
- export const DEV_BUTTON_SHOW_OR_HIDE = 'dev-button-show-or-hide';
80
-
81
- /**
82
- * 重启调试器
83
- */
84
- export const DEV_RESTART_DEBUGGER = 'dev-restart-debugger';
85
-
86
- /**
87
- * 重启app
88
- */
89
- export const DEV_RESTART_APP = 'dev-restart-app';
90
-
91
- /**
92
- * 导出日志
93
- */
94
- export const DEV_EXPORT_LOG = 'dev-export-log';
95
-
96
- /**
97
- * 改变vuex数据
98
- */
99
- export const DEV_VUEX_CHANGE = 'dev-vuex-change';
100
-
101
- /**
102
- * 改变pinia
103
- */
104
- export const DEV_PINIA_CHANGE = 'dev-pinia-change';
105
-
106
- /**
107
- * 清除日志缓存
108
- */
109
- export const DEV_LOG_CACHE_CLEAR = 'dev-log-cache-clear';
110
-
111
- /**
112
- * 销毁调试工具
113
- */
114
- export const DEV_DESTROY = 'dev-destroy';
115
-
116
- /**
117
- * 显示调试弹窗
118
- */
119
- export const DEV_WINDOW_OPEN = 'dev-window-open';
120
-
121
- /**
122
- * 显示调试弹窗
123
- */
124
- export const DEV_WINDOW_CLOSE = 'dev-window-close';
125
-
126
- /**
127
- * 刷新路由列表
128
- */
129
- export const DEV_ROUTE_REFRESH = 'dev-route-refresh';
130
-
131
- /**
132
- * 获取 dev option
133
- */
134
- export const DEV_OPTION = 'dev-option';
135
-
136
- /**
137
- * 获取options
138
- */
139
- export const DEV_OPTION_GET = 'dev-option-get';
140
-
141
- /**
142
- * 发送 options
143
- */
144
- export const DEV_OPTION_SEND = 'dev-option-send';
145
-
146
- /**
147
- * 清空事件
148
- */
149
- export const DEV_UNI_EVENT_CLEAR = 'dev-uni-event-clear';
150
-
151
- /**
152
- * 运行js
153
- */
154
- export const DEV_RUN_JS = 'dev-uni-run-js';
155
-
156
- /**
157
- * 清空截屏列表
158
- */
159
- export const DEV_CAPTURE_SCREEN_CLEAR = 'dev-capture-screen-clear';
160
-
161
- /**
162
- * 存储的dev-tool 信息
163
- */
164
- export const DEV_TOOL_INFO = 'dev-tool-info';
package/dev/core.ts DELETED
@@ -1,118 +0,0 @@
1
- import { DevStore } from './devStore';
2
- import { DevEvent } from './devEvent';
3
- import { DevIntercept } from './devIntercept';
4
- import { DevConsole } from './devConsole';
5
-
6
- import type { DevTool } from './type';
7
-
8
- import { EventBus } from './devEventBus';
9
- /**
10
- * 备份原生方法
11
- *
12
- * @private
13
- * @memberof DevStore
14
- */
15
- const backup = {
16
- // log: console.log,
17
- // info: console.info,
18
- // warn: console.warn,
19
- // error: console.error,
20
- setStorage: uni?.setStorage,
21
- setStorageSync: uni?.setStorageSync,
22
- clearStorage: uni?.clearStorage,
23
- clearStorageSync: uni?.clearStorageSync,
24
- removeStorage: uni?.removeStorage,
25
- removeStorageSync: uni?.removeStorageSync,
26
- reject: Promise.reject,
27
- connectSocket: uni?.connectSocket,
28
- uploadFile: uni?.uploadFile,
29
- $on: uni.$on,
30
- $once: uni.$once,
31
- $emit: uni.$emit,
32
- $off: uni.$off,
33
- __log__: (uni as any).__log__,
34
- };
35
-
36
- const eventBus = new EventBus();
37
-
38
- const store = new DevStore();
39
-
40
- const event = new DevEvent({
41
- store,
42
- eventBus,
43
- });
44
-
45
- const console = new DevConsole(event);
46
-
47
- const intercept = new DevIntercept({
48
- event,
49
- enableInterceptPromiseReject: store?.enableInterceptPromiseReject,
50
- });
51
-
52
- function getDevToolOptions() {
53
- return store.getDevToolOptions();
54
- }
55
-
56
- function initDevTool(options?: DevTool.DevToolOptions) {
57
- if (!options?.mode) {
58
- console.error('[DevTool] 请传入 mode: import.meta.env.MODE');
59
- }
60
-
61
- store.setDevToolOptions(options || { mode: '' });
62
-
63
- intercept.interceptVue3(options?.vue3instance);
64
- }
65
-
66
- function showDevToolButton() {
67
- event.showDevToolButton();
68
- }
69
-
70
- function hideDevToolButton() {
71
- event.hideDevToolButton();
72
- }
73
-
74
- function openDevToolWindow() {
75
- event.openDevToolWindow();
76
- }
77
-
78
- function closeDevToolWindow() {
79
- event.closeDevToolWindow();
80
- }
81
-
82
- function createDevTool() {
83
- event.createDevTool();
84
- intercept.init({
85
- event,
86
- enableInterceptPromiseReject: store?.enableInterceptPromiseReject,
87
- });
88
- }
89
-
90
- function destroyDevTool() {
91
- event.destroyDevTool();
92
- }
93
-
94
- function interceptVuexStorage(store: any) {
95
- return intercept.interceptVuexStorage(store);
96
- }
97
-
98
- function interceptPiniaStore(context: any) {
99
- return intercept.interceptPiniaStore(context);
100
- }
101
-
102
- uni.__dev__console = console;
103
-
104
- export {
105
- backup,
106
- console,
107
- initDevTool,
108
- createDevTool,
109
- destroyDevTool,
110
- showDevToolButton,
111
- hideDevToolButton,
112
- openDevToolWindow,
113
- closeDevToolWindow,
114
- getDevToolOptions,
115
- interceptVuexStorage,
116
- interceptPiniaStore,
117
- eventBus,
118
- };