tt-minigame-ide-cli 1.0.2 → 2.0.0-alpha.1
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/README.md +5 -98
- package/bin/tmg.js +4 -161
- package/dist/cli.js +1 -0
- package/dist/index.js +1 -0
- package/dist/miniprogram-utils/src/constants/error.d.ts +41 -0
- package/dist/miniprogram-utils/src/constants/index.d.ts +217 -0
- package/dist/miniprogram-utils/src/constants/project.d.ts +3 -0
- package/dist/miniprogram-utils/src/constants/slardar-events/update-events.d.ts +24 -0
- package/dist/miniprogram-utils/src/data/app.d.ts +30 -0
- package/dist/miniprogram-utils/src/data/ext.d.ts +6 -0
- package/dist/miniprogram-utils/src/data/jsons.d.ts +23 -0
- package/dist/miniprogram-utils/src/data/project.d.ts +124 -0
- package/dist/miniprogram-utils/src/electron-monitor/common/tea-sdk.d.ts +17 -0
- package/dist/miniprogram-utils/src/formation.d.ts +17 -0
- package/dist/miniprogram-utils/src/network/axios.d.ts +28 -0
- package/dist/tt-ide-cli/src/features/audit.d.ts +9 -0
- package/dist/tt-ide-cli/src/features/cli-login.d.ts +1 -0
- package/dist/tt-ide-cli/src/features/config.d.ts +3 -0
- package/dist/tt-ide-cli/src/features/create.d.ts +7 -0
- package/dist/tt-ide-cli/src/features/login.d.ts +18 -0
- package/dist/tt-ide-cli/src/features/meta.d.ts +23 -0
- package/dist/tt-ide-cli/src/features/microgame/cloud-compile.d.ts +75 -0
- package/dist/tt-ide-cli/src/features/microgame/index.d.ts +3 -0
- package/dist/tt-ide-cli/src/features/microgame/meta.d.ts +1 -0
- package/dist/tt-ide-cli/src/features/microgame/utils/file-system.d.ts +13 -0
- package/dist/tt-ide-cli/src/features/microgame/utils/package.d.ts +22 -0
- package/dist/tt-ide-cli/src/features/microgame/utils/settings.d.ts +48 -0
- package/dist/tt-ide-cli/src/features/microgame/utils/source.type.d.ts +35 -0
- package/dist/tt-ide-cli/src/features/npm.d.ts +10 -0
- package/dist/tt-ide-cli/src/features/open.d.ts +3 -0
- package/dist/tt-ide-cli/src/features/packages.d.ts +53 -0
- package/dist/tt-ide-cli/src/features/preview.d.ts +80 -0
- package/dist/tt-ide-cli/src/features/third-party.d.ts +9 -0
- package/dist/tt-ide-cli/src/index.d.ts +22 -0
- package/dist/tt-ide-cli/src/monitor/cli-monitor.d.ts +15 -0
- package/dist/tt-ide-cli/src/monitor/constants.d.ts +7 -0
- package/dist/tt-ide-cli/src/monitor/index.d.ts +2 -0
- package/dist/tt-ide-cli/src/types.d.ts +44 -0
- package/dist/tt-ide-cli/src/utils/constants.d.ts +3 -0
- package/dist/tt-ide-cli/src/utils/cookie.d.ts +6 -0
- package/dist/tt-ide-cli/src/utils/logger.d.ts +19 -0
- package/dist/tt-ide-cli/src/utils/metrics.d.ts +67 -0
- package/dist/tt-ide-cli/src/utils/qrcode.d.ts +64 -0
- package/dist/tt-ide-cli/src/utils/util.d.ts +56 -0
- package/dist/tt-minigame-ide-cli/src/cli.d.ts +1 -0
- package/dist/tt-minigame-ide-cli/src/index.d.ts +1 -0
- package/dist/tt-minigame-ide-cli/src/types.d.ts +43 -0
- package/package.json +49 -26
- package/.yarnrc +0 -1
- package/LICENSE +0 -21
- package/README.en.md +0 -104
- package/lib/auth.js +0 -145
- package/lib/build-npm.js +0 -22
- package/lib/create.js +0 -106
- package/lib/index.d.ts +0 -23
- package/lib/index.js +0 -79
- package/lib/preview.js +0 -92
- package/lib/upload.js +0 -133
- package/lib/util/check.js +0 -84
- package/lib/util/config.js +0 -41
- package/lib/util/cookie.js +0 -36
- package/lib/util/helper.js +0 -245
- package/lib/util/logger.js +0 -54
- package/lib/util/qrcode.js +0 -34
- package/lib/util/request.js +0 -396
- package/lib/util/version.js +0 -27
- package/lib/version.js +0 -44
@@ -0,0 +1,41 @@
|
|
1
|
+
export declare const IDE_ERROR_LEVEL: {
|
2
|
+
p0: string;
|
3
|
+
p1: string;
|
4
|
+
p2: string;
|
5
|
+
p3: string;
|
6
|
+
};
|
7
|
+
export declare class LoginError extends Error {
|
8
|
+
name: string;
|
9
|
+
}
|
10
|
+
export declare class MetaError extends Error {
|
11
|
+
name: string;
|
12
|
+
}
|
13
|
+
export declare class HashError extends Error {
|
14
|
+
name: string;
|
15
|
+
}
|
16
|
+
export declare class ProjectError extends Error {
|
17
|
+
name: string;
|
18
|
+
}
|
19
|
+
export declare class PackageSizeError extends Error {
|
20
|
+
name: string;
|
21
|
+
}
|
22
|
+
export declare class CompressError extends Error {
|
23
|
+
name: string;
|
24
|
+
}
|
25
|
+
export declare class UploadError extends Error {
|
26
|
+
name: string;
|
27
|
+
code: number;
|
28
|
+
constructor(message: string, code?: number);
|
29
|
+
}
|
30
|
+
export declare class CompileError extends Error {
|
31
|
+
name: string;
|
32
|
+
code: number;
|
33
|
+
errLink: string;
|
34
|
+
constructor(message: string, errLink?: string, code?: number);
|
35
|
+
}
|
36
|
+
export declare class SchemaError extends Error {
|
37
|
+
name: string;
|
38
|
+
}
|
39
|
+
export declare class QRCodeError extends Error {
|
40
|
+
name: string;
|
41
|
+
}
|
@@ -0,0 +1,217 @@
|
|
1
|
+
export declare const SLARDAR_EVENT: {
|
2
|
+
readonly VELA_CLICK_PREVIEW: "VELA_CLICK_PREVIEW";
|
3
|
+
readonly VELA_PREVIEW_FAIL: "VELA_PREVIEW_FAIL";
|
4
|
+
readonly VELA_CLICK_UPLOAD: "VELA_CLICK_UPLOAD";
|
5
|
+
readonly UPLOAD_VERSION_FOCUS: "UPLOAD_VERSION_FOCUS";
|
6
|
+
readonly UPLOAD_VERSION_ERROR: "UPLOAD_VERSION_ERROR";
|
7
|
+
readonly VELA_UPLOAD_FAIL: "VELA_UPLOAD_FAIL";
|
8
|
+
readonly VELA_SHOW_INIT_VIEW_TIME: "VELA_SHOW_INIT_VIEW_TIME";
|
9
|
+
readonly VELA_PREVIEW_TIME: "VELA_PREVIEW_TIME";
|
10
|
+
readonly VELA_UPLOAD_TIME: "VELA_UPLOAD_TIME";
|
11
|
+
readonly VELA_COMPILE_FIRST_END: "VELA_COMPILE_FIRST_END";
|
12
|
+
readonly VELA_COMPILE_TIME: "VELA_COMPILE_TIME";
|
13
|
+
readonly PUCK_COMPILE_ERROR: "PUCK_COMPILE_ERROR";
|
14
|
+
readonly IDE_COMPILE_PERFORMANCE: "IDE_COMPILE_PERFORMANCE";
|
15
|
+
readonly IDE_COMPILE_RESULT: "IDE_COMPILE_RESULT";
|
16
|
+
readonly VELA_SIMULATOR_RENDER_TIME: "VELA_SIMULATOR_RENDER_TIME";
|
17
|
+
readonly VELA_SIMULATOR_FIRST_RENDER_SUCCESS: "VELA_SIMULATOR_FIRST_RENDER_SUCCESS";
|
18
|
+
readonly VELA_AUDIT_SCORE: "VELA_AUDIT_SCORE";
|
19
|
+
readonly MENU_BAR_DEBUG_SETTING_SAVE: "MENU_BAR_DEBUG_SETTING_SAVE";
|
20
|
+
readonly MENU_BAR_DEBUG_SETTING_SAVE_FAIL: "MENU_BAR_DEBUG_SETTING_SAVE_FAIL";
|
21
|
+
readonly MENU_BAR_DEBUG_APPLY_TEST_TMA: "MENU_BAR_DEBUG_APPLY_TEST_TMA";
|
22
|
+
readonly MENU_BAR_DEBUG_APPLY_TEST_TMA_FAIL: "MENU_BAR_DEBUG_APPLY_TEST_TMA_FAIL";
|
23
|
+
readonly MENU_BAR_DEBUG_OPEN_PAGE_FRAME_DEVTOOL: "MENU_BAR_DEBUG_OPEN_PAGE_FRAME_DEVTOOL";
|
24
|
+
readonly MENU_BAR_DEBUG_OPEN_PAGE_FRAME_DEVTOOL_FAIL: "MENU_BAR_DEBUG_OPEN_PAGE_FRAME_DEVTOOL_FAIL";
|
25
|
+
readonly MENU_BAR_DEBUG_OPEN_SIMULATOR_DEVTOOL: "MENU_BAR_DEBUG_OPEN_SIMULATOR_DEVTOOL";
|
26
|
+
readonly MENU_BAR_DEBUG_OPEN_SIMULATOR_DEVTOOL_FAIL: "MENU_BAR_DEBUG_OPEN_SIMULATOR_DEVTOOL_FAIL";
|
27
|
+
readonly MENU_BAR_DEBUG_APPLY_BOE: "MENU_BAR_DEBUG_APPLY_BOE";
|
28
|
+
readonly MENU_BAR_DEBUG_APPLY_BOE_FAIL: "MENU_BAR_DEBUG_APPLY_BOE_FAIL";
|
29
|
+
readonly MENU_BAR_DEBUG_APPLY_PPE: "MENU_BAR_DEBUG_APPLY_PPE";
|
30
|
+
readonly MENU_BAR_DEBUG_APPLY_PPE_FAIL: "MENU_BAR_DEBUG_APPLY_PPE_FAIL";
|
31
|
+
readonly VELA_POST_MESSAGE_LIST: "VELA_POST_MESSAGE_LIST";
|
32
|
+
readonly VELA_POST_MESSAGE_LIST_FAIL: "VELA_POST_MESSAGE_LIST_FAIL";
|
33
|
+
readonly VELA_AVATAR_LOGOUT: "VELA_AVATAR_LOGOUT";
|
34
|
+
readonly VELA_AVATAR_LOGOUT_FAIL: "VELA_AVATAR_LOGOUT_FAIL";
|
35
|
+
readonly VELA_CLEAR_ALL_SESSION: "VELA_CLEAR_ALL_SESSION";
|
36
|
+
readonly VELA_CLEAR_ALL_SESSION_FAIL: "VELA_CLEAR_ALL_SESSION_FAIL";
|
37
|
+
readonly VELA_CLEAR_DATA_SESSION: "VELA_CLEAR_DATA_SESSION";
|
38
|
+
readonly VELA_CLEAR_DATA_SESSION_FAIL: "VELA_CLEAR_DATA_SESSION_FAIL";
|
39
|
+
readonly VELA_CLEAR_LOGIN_SESSION: "VELA_CLEAR_LOGIN_SESSION";
|
40
|
+
readonly VELA_CLEAR_LOGIN_SESSION_FAIL: "VELA_CLEAR_LOGIN_SESSION_FAIL";
|
41
|
+
readonly VELA_CLEAR_AUTH_SESSION: "VELA_CLEAR_AUTH_SESSION";
|
42
|
+
readonly VELA_CLEAR_AUTH_SESSION_FAIL: "VELA_CLEAR_AUTH_SESSION_FAIL";
|
43
|
+
readonly VELA_ADD_COMPILE_MODE: "VELA_ADD_COMPILE_MODE";
|
44
|
+
readonly VELA_ADD_COMPILE_MODE_FAIL: "VELA_ADD_COMPILE_MODE_FAIL";
|
45
|
+
readonly VELA_COMPILE: "VELA_COMPILE";
|
46
|
+
readonly VELA_COMPILE_FAIL: "VELA_COMPILE_FAIL";
|
47
|
+
readonly VELA_CHANGE_COMPILE_MODE: "VELA_CHANGE_COMPILE_MODE";
|
48
|
+
readonly VELA_CHANGE_COMPILE_MODE_FAIL: "VELA_CHANGE_COMPILE_MODE_FAIL";
|
49
|
+
readonly VELA_SELECT_SDK: "VELA_SELECT_SDK";
|
50
|
+
readonly VELA_SELECT_SDK_FAIL: "VELA_SELECT_SDK_FAIL";
|
51
|
+
readonly VELA_CLICK_CONVERT_TOOL: "VELA_CLICK_CONVERT_TOOL";
|
52
|
+
readonly VELA_CONVERT_EMIT: "VELA_CONVERT_EMIT";
|
53
|
+
readonly VELA_OPEN_PROJECT_FROM_CONVERT_TOOL: "VELA_OPEN_PROJECT_FROM_CONVERT_TOOL";
|
54
|
+
readonly VELA_BUILD_NPM: "VELA_BUILD_NPM";
|
55
|
+
readonly VELA_BUILD_NPM_FAIL: "VELA_BUILD_NPM_FAIL";
|
56
|
+
readonly PACKAGE_SIZE: "PACKAGE_SIZE";
|
57
|
+
readonly UPLOAD_SUCCESS_EVENT: "UPLOAD_SUCCESS_EVENT";
|
58
|
+
readonly SIMULATOR_SHARE_DEBUG_COMPILATION_MODE_CHANGE_CONFIRM: "SIMULATOR_SHARE_DEBUG_COMPILATION_MODE_CHANGE_CONFIRM";
|
59
|
+
readonly SIMULATOR_SHARE_DEBUG_COMPILATION_MODE_CHANGE_CANCEL: "SIMULATOR_SHARE_DEBUG_COMPILATION_MODE_CHANGE_CANCEL";
|
60
|
+
readonly IDE_GET_SDK_LIST_FAIL: "IDE_GET_SDK_LIST_FAIL";
|
61
|
+
readonly IDE_REQUEST_START: "IDE_REQUEST_START";
|
62
|
+
readonly IDE_REQUEST_FAIL: "IDE_REQUEST_FAIL";
|
63
|
+
readonly IDE_COLOR_THEME: "IDE_COLOR_THEME";
|
64
|
+
readonly IDE_HELP_DEVELOPER_COMMUNITY: "IDE_HELP_DEVELOPER_COMMUNITY";
|
65
|
+
readonly IDE_MESSAGE_EXPAND_CLICK: "IDE_MESSAGE_EXPAND_CLICK";
|
66
|
+
readonly IDE_MODULE_CLICK: "IDE_MODULE_CLICK";
|
67
|
+
readonly IDE_MODULE_USAGE: "IDE_MODULE_USAGE";
|
68
|
+
readonly IDE_MODULE_LOADTIME: "IDE_MODULE_LOADTIME";
|
69
|
+
readonly IDE_MODULE_PERFORMANCE: "IDE_MODULE_PERFORMANCE";
|
70
|
+
readonly IDE_PERFORMANCE: "IDE_PERFORMANCE";
|
71
|
+
readonly IDE_DEVICE_INFO_DISPLAY: "IDE_DEVICE_INFO_DISPLAY";
|
72
|
+
readonly IDE_DEVICE_INFO_CPU: "IDE_DEVICE_INFO_CPU";
|
73
|
+
readonly IDE_DEVICE_INFO_OS: "IDE_DEVICE_INFO_OS";
|
74
|
+
readonly IDE_SIMULATOR_LOAD_TIME: "IDE_SIMULATOR_LOAD_TIME";
|
75
|
+
readonly IDE_MENU_CLICK: "IDE_MENU_CLICK";
|
76
|
+
readonly IDE_LANGUAGE: "IDE_LANGUAGE";
|
77
|
+
readonly IDE_ROOM_SERVICE_TRACE: "IDE_ROOM_SERVICE_TRACE";
|
78
|
+
readonly IDE_UPDATE_STEP_ERROR: "IDE_UPDATE_STEP_ERROR";
|
79
|
+
readonly IDE_SCENE_START: "IDE_SCENE_START";
|
80
|
+
readonly IDE_SCENE_END: "IDE_SCENE_END";
|
81
|
+
readonly IDE_APPID_SELECT: "IDE_APPID_SELECT";
|
82
|
+
readonly IDE_APPID_CHANGE: "IDE_APPID_CHANGE";
|
83
|
+
readonly IDE_JS_BLOCK: "IDE_JS_BLOCK";
|
84
|
+
readonly IDE_LOW_FPS: "IDE_LOW_FPS";
|
85
|
+
readonly IDE_LOW_MEMORY: "IDE_LOW_MEMORY";
|
86
|
+
readonly IDE_FETCH_ADMIN_XCONFIG_TMAR: "IDE_FETCH_ADMIN_XCONFIG_TMAR";
|
87
|
+
readonly IDE_BIG_PACKAGESIZE_CHECK: "IDE_BIG_PACKAGESIZE_CHECK";
|
88
|
+
readonly IDE_LOADER_IO_ERROR: string;
|
89
|
+
readonly IDE_LOADER_INSTALL_RECOVER_ERROR: string;
|
90
|
+
readonly IDE_LOADER_START_FROM_ENTRY: string;
|
91
|
+
readonly IDE_LAUNCH_FAIL: string;
|
92
|
+
readonly IDE_LAUNCH: "IDE_LAUNCH";
|
93
|
+
readonly IDE_UPGRADE_SUGGGEST_POP: "IDE_UPGRADE_SUGGGEST_POP";
|
94
|
+
readonly IDE_UPGRADE_SUGGGEST_POP_CLOSE: "IDE_UPGRADE_SUGGGEST_POP_CLOSE";
|
95
|
+
readonly IDE_UPGRADE_SUGGGEST_POP_NO: "IDE_UPGRADE_SUGGGEST_POP_NO";
|
96
|
+
readonly IDE_UPGRADE_SUGGGEST_POP_YES: "IDE_UPGRADE_SUGGGEST_POP_YES";
|
97
|
+
readonly IDE_UPGRADE_SUGGGEST_POP_VIEWDETAIL: "IDE_UPGRADE_SUGGGEST_POP_VIEWDETAIL";
|
98
|
+
readonly IDE_UPGRADE_ICON: "IDE_UPGRADE_ICON";
|
99
|
+
readonly IDE_UPGRADE_ICON_CLOSE: "IDE_UPGRADE_ICON_CLOSE";
|
100
|
+
readonly IDE_UPGRADE_ICON_RESTART: "IDE_UPGRADE_ICON_RESTART";
|
101
|
+
readonly IDE_UPGRADE_ICON_VIEWDETAIL: "IDE_UPGRADE_ICON_VIEWDETAIL";
|
102
|
+
readonly IDE_FULLUPGRADE_POP: "IDE_FULLUPGRADE_POP";
|
103
|
+
readonly IDE_FULLUPGRADE_POP_CLOSE: "IDE_FULLUPGRADE_POP_CLOSE";
|
104
|
+
readonly IDE_FULLUPGRADE_POP_NO: "IDE_FULLUPGRADE_POP_NO";
|
105
|
+
readonly IDE_FULLUPGRADE_POP_YESBACK: "IDE_FULLUPGRADE_POP_YESBACK";
|
106
|
+
readonly IDE_FULLUPGRADE_POP_YESONCE: "IDE_FULLUPGRADE_POP_YESONCE";
|
107
|
+
readonly IDE_FULLUPGRADE_POP_VIEWDETAIL: "IDE_FULLUPGRADE_POP_VIEWDETAIL";
|
108
|
+
};
|
109
|
+
/**
|
110
|
+
* IDE的模块统计
|
111
|
+
*/
|
112
|
+
export declare const IDE_MODULES: {
|
113
|
+
readonly LOGIN: "LOGIN";
|
114
|
+
readonly MESSAGE: "MESSAGE";
|
115
|
+
readonly SIMULATOR: "SIMULATOR";
|
116
|
+
readonly SIMULATOR_USAGE: "SIMULATOR_USAGE";
|
117
|
+
readonly DEVTOOL: "DEVTOOL";
|
118
|
+
readonly DEVTOOL_USAGE: "DEVTOOL_USAGE";
|
119
|
+
readonly REFRESH: "REFRESH";
|
120
|
+
readonly CLEAR_CACHE: "CLEAR_CACHE";
|
121
|
+
readonly COMPILE_ORDINARY: "COMPILE_ORDINARY";
|
122
|
+
readonly SELF_COMPILE_MODE: "SELF_COMPILE_MODE";
|
123
|
+
readonly COMPILE: "COMPILE";
|
124
|
+
readonly PREVIEW: "PREVIEW";
|
125
|
+
readonly REMOTE_DEBUG: "REMOTE_DEBUG";
|
126
|
+
readonly UPLOAD: "UPLOAD";
|
127
|
+
readonly SIGN_CHECK: "SIGN_CHECK";
|
128
|
+
readonly INTELLIGENCE: "INTELLIGENCE";
|
129
|
+
readonly SHARE_PROJECT: "SHARE_PROJECT";
|
130
|
+
readonly PROJECT_MANAGE: "PROJECT_MANAGE";
|
131
|
+
readonly PROJECT_DETAIL: "PROJECT_DETAIL";
|
132
|
+
readonly CHECK_THIRD_PART_MINIAPP: "CHECK_THIRD_PART_MINIAPP";
|
133
|
+
readonly NPM_FUNCTION: "NPM_FUNCTION";
|
134
|
+
readonly EDITOR: "EDITOR";
|
135
|
+
readonly WORKBENCH: "WORKBENCH";
|
136
|
+
readonly SETTING: "SETTING";
|
137
|
+
readonly AVATAR: "AVATAR";
|
138
|
+
readonly UPDATE: "UPDATE";
|
139
|
+
};
|
140
|
+
export declare const IDE_TIMELINE_NAMES: {
|
141
|
+
readonly SIMULATOR_FIRST_LOADING_END: "SIMULATOR_FIRST_LOADING_END";
|
142
|
+
readonly SIMULATOR_LOADING: "SIMULATOR_LOADING";
|
143
|
+
readonly LOGIN: "LOGIN";
|
144
|
+
readonly MESSAGE: "MESSAGE";
|
145
|
+
readonly SIMULATOR: "SIMULATOR";
|
146
|
+
readonly SIMULATOR_USAGE: "SIMULATOR_USAGE";
|
147
|
+
readonly DEVTOOL: "DEVTOOL";
|
148
|
+
readonly DEVTOOL_USAGE: "DEVTOOL_USAGE";
|
149
|
+
readonly REFRESH: "REFRESH";
|
150
|
+
readonly CLEAR_CACHE: "CLEAR_CACHE";
|
151
|
+
readonly COMPILE_ORDINARY: "COMPILE_ORDINARY";
|
152
|
+
readonly SELF_COMPILE_MODE: "SELF_COMPILE_MODE";
|
153
|
+
readonly COMPILE: "COMPILE";
|
154
|
+
readonly PREVIEW: "PREVIEW";
|
155
|
+
readonly REMOTE_DEBUG: "REMOTE_DEBUG";
|
156
|
+
readonly UPLOAD: "UPLOAD";
|
157
|
+
readonly SIGN_CHECK: "SIGN_CHECK";
|
158
|
+
readonly INTELLIGENCE: "INTELLIGENCE";
|
159
|
+
readonly SHARE_PROJECT: "SHARE_PROJECT";
|
160
|
+
readonly PROJECT_MANAGE: "PROJECT_MANAGE";
|
161
|
+
readonly PROJECT_DETAIL: "PROJECT_DETAIL";
|
162
|
+
readonly CHECK_THIRD_PART_MINIAPP: "CHECK_THIRD_PART_MINIAPP";
|
163
|
+
readonly NPM_FUNCTION: "NPM_FUNCTION";
|
164
|
+
readonly EDITOR: "EDITOR";
|
165
|
+
readonly WORKBENCH: "WORKBENCH";
|
166
|
+
readonly SETTING: "SETTING";
|
167
|
+
readonly AVATAR: "AVATAR";
|
168
|
+
readonly UPDATE: "UPDATE";
|
169
|
+
};
|
170
|
+
/**
|
171
|
+
* IDE 性能统计 ipc 事件收敛
|
172
|
+
*/
|
173
|
+
export declare const IDE_PERFORMANCE_EVENTS: {
|
174
|
+
readonly projectmanageCreated: "performance:projectmanageCreated";
|
175
|
+
readonly projectmanageReady: "performance:projectmanageReady";
|
176
|
+
readonly openProject: "performance:openProject";
|
177
|
+
readonly editorReady: "performance:editorReady";
|
178
|
+
readonly workbenchReady: "performance:workbenchReady";
|
179
|
+
readonly simulatorReady: "performance:simulatorReady";
|
180
|
+
readonly simulatorFirstLoadingEnd: "performance:simulatorFirstLoadingEnd";
|
181
|
+
readonly compilePartialEnd: "performance:compilePartialEnd";
|
182
|
+
readonly previewStart: "performance:previewStart";
|
183
|
+
readonly previewCodeReady: "performance:previewCodeReady";
|
184
|
+
readonly uploadStart: "performance:uploadStart";
|
185
|
+
readonly uploadEnd: "performance:uploadEnd";
|
186
|
+
readonly shareStart: "performance:shareStart";
|
187
|
+
readonly shareEnd: "performance:shareEnd";
|
188
|
+
readonly remoteDebugStart: "performance:remoteDebugStart";
|
189
|
+
readonly remoteDebugCodeReady: "performance:remoteDebugCodeReady";
|
190
|
+
};
|
191
|
+
/**
|
192
|
+
* 前置页的事件
|
193
|
+
*/
|
194
|
+
export declare const FRONT_PAGE_EVENT: {
|
195
|
+
VELA_CAPTCHA_REQUEST: string;
|
196
|
+
VELA_CAPTCHA_FAIL: string;
|
197
|
+
VELA_PHONE_CAPTCHA_REQUEST: string;
|
198
|
+
VELA_PHONE_CAPTCHA_FAIL: string;
|
199
|
+
VELA_PHONE_LOGIN_REQUEST: string;
|
200
|
+
VELA_PHONE_LOGIN_FAIL: string;
|
201
|
+
VELA_MAIL_LOGIN_REQUEST: string;
|
202
|
+
VELA_MAIL_LOGIN_FAIL: string;
|
203
|
+
VELA_CHECK_EXIST_PROJECT: string;
|
204
|
+
VELA_CHECK_EXIST_PROJECT_FAIL: string;
|
205
|
+
VELA_CHECK_TEMPLATE: string;
|
206
|
+
VELA_CHECK_TEMPLATE_FAIL: string;
|
207
|
+
VELA_DELETE_PROJECT: string;
|
208
|
+
VELA_DELETE_PROJECT_FAIL: string;
|
209
|
+
VELA_IMPORT_PROJECT: string;
|
210
|
+
VELA_IMPORT_PROJECT_FAIL: string;
|
211
|
+
VELA_REQUEST_TEMPLATE_LIST: string;
|
212
|
+
VELA_REQUEST_TEMPLATE_LIST_FAIL: string;
|
213
|
+
VELA_NEW_PROJECT: string;
|
214
|
+
VELA_NEW_PROJECT_FAIL: string;
|
215
|
+
VELA_SCHEMA_DOWNLOAD_MINICODE: string;
|
216
|
+
VELA_SCHEMA_DOWNLOAD_MINICODE_FAIL: string;
|
217
|
+
};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
export declare const UPDATE_SLARDAR_EVENTS: {
|
2
|
+
readonly IDE_LAUNCH: "IDE_LAUNCH";
|
3
|
+
readonly IDE_UPGRADE_SUGGGEST_POP: "IDE_UPGRADE_SUGGGEST_POP";
|
4
|
+
readonly IDE_UPGRADE_SUGGGEST_POP_CLOSE: "IDE_UPGRADE_SUGGGEST_POP_CLOSE";
|
5
|
+
readonly IDE_UPGRADE_SUGGGEST_POP_NO: "IDE_UPGRADE_SUGGGEST_POP_NO";
|
6
|
+
readonly IDE_UPGRADE_SUGGGEST_POP_YES: "IDE_UPGRADE_SUGGGEST_POP_YES";
|
7
|
+
readonly IDE_UPGRADE_SUGGGEST_POP_VIEWDETAIL: "IDE_UPGRADE_SUGGGEST_POP_VIEWDETAIL";
|
8
|
+
readonly IDE_UPGRADE_ICON: "IDE_UPGRADE_ICON";
|
9
|
+
readonly IDE_UPGRADE_ICON_CLOSE: "IDE_UPGRADE_ICON_CLOSE";
|
10
|
+
readonly IDE_UPGRADE_ICON_RESTART: "IDE_UPGRADE_ICON_RESTART";
|
11
|
+
readonly IDE_UPGRADE_ICON_VIEWDETAIL: "IDE_UPGRADE_ICON_VIEWDETAIL";
|
12
|
+
readonly IDE_FULLUPGRADE_POP: "IDE_FULLUPGRADE_POP";
|
13
|
+
readonly IDE_FULLUPGRADE_POP_CLOSE: "IDE_FULLUPGRADE_POP_CLOSE";
|
14
|
+
readonly IDE_FULLUPGRADE_POP_NO: "IDE_FULLUPGRADE_POP_NO";
|
15
|
+
readonly IDE_FULLUPGRADE_POP_YESBACK: "IDE_FULLUPGRADE_POP_YESBACK";
|
16
|
+
readonly IDE_FULLUPGRADE_POP_YESONCE: "IDE_FULLUPGRADE_POP_YESONCE";
|
17
|
+
readonly IDE_FULLUPGRADE_POP_VIEWDETAIL: "IDE_FULLUPGRADE_POP_VIEWDETAIL";
|
18
|
+
};
|
19
|
+
export declare const UPDATE_SLARDAR_EVENTS_TECH: {
|
20
|
+
IDE_LOADER_IO_ERROR: string;
|
21
|
+
IDE_LOADER_INSTALL_RECOVER_ERROR: string;
|
22
|
+
IDE_LOADER_START_FROM_ENTRY: string;
|
23
|
+
IDE_LAUNCH_FAIL: string;
|
24
|
+
};
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { JSONContainer } from './jsons';
|
2
|
+
import type { IApp as BaseApp } from './schema/app';
|
3
|
+
export interface IApp extends BaseApp {
|
4
|
+
/**
|
5
|
+
* 用于配置当插件加载失败时的兜底回退方案
|
6
|
+
*/
|
7
|
+
fallbackPluginPages?: Record<string, string>;
|
8
|
+
/**
|
9
|
+
* 骨架屏配置
|
10
|
+
*/
|
11
|
+
skeleton?: {
|
12
|
+
config?: {
|
13
|
+
timeout?: number;
|
14
|
+
loading?: 'spin' | 'chiaroscuro' | 'shine';
|
15
|
+
};
|
16
|
+
path?: string;
|
17
|
+
};
|
18
|
+
}
|
19
|
+
/**
|
20
|
+
* JSON object wrapper for `app.json`
|
21
|
+
*/
|
22
|
+
export declare class AppJSON extends JSONContainer<IApp> {
|
23
|
+
static from(filepath: string): Promise<AppJSON>;
|
24
|
+
private __isGame;
|
25
|
+
get isGame(): boolean;
|
26
|
+
/**
|
27
|
+
* Property sugar for {@link IApp.subPackages} or {@link IApp.subpackages}
|
28
|
+
*/
|
29
|
+
get subPackages(): import("./schema/base").ISubPackage[];
|
30
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
export declare class JSONContainer<T> {
|
2
|
+
/**
|
3
|
+
* file path
|
4
|
+
*/
|
5
|
+
readonly path: string;
|
6
|
+
protected __raw: T;
|
7
|
+
constructor(json: T, filepath: string);
|
8
|
+
get rawJSON(): T;
|
9
|
+
/**
|
10
|
+
* Generic way to get data in {@link __raw}
|
11
|
+
* @param key
|
12
|
+
* @param defaultValue
|
13
|
+
* @returns
|
14
|
+
*/
|
15
|
+
getKey<K extends keyof T>(key: K, defaultValue?: T[K]): T[K] | undefined;
|
16
|
+
/**
|
17
|
+
* Generic way to update the value in current jsons.
|
18
|
+
* @param key
|
19
|
+
* @param value
|
20
|
+
* @param write whether write back to file
|
21
|
+
*/
|
22
|
+
update<K extends keyof T>(key: K, value: T[K], write?: boolean): Promise<void>;
|
23
|
+
}
|
@@ -0,0 +1,124 @@
|
|
1
|
+
import { AppJSON } from './app';
|
2
|
+
import { ExtJSON } from './ext';
|
3
|
+
import { JSONContainer } from './jsons';
|
4
|
+
import type { ConditionItem } from './schema/base';
|
5
|
+
import type { IProject } from './schema/project';
|
6
|
+
import { CompilerPlugin } from '../constants/project';
|
7
|
+
import { GetEnvFunction } from '../network/axios';
|
8
|
+
/**
|
9
|
+
* 因为 @byted/miniprogram-utils 都是分模块打包和引入的,两个模块之间不共享数据,所以需要单独设置
|
10
|
+
* todo 其他文件都直接引入 @byted/miniprogram-utils 而不是 @byted/miniprogram-utils/dist/xxx/xxx
|
11
|
+
*/
|
12
|
+
export declare const setEnvFunctionForProject: (fn: GetEnvFunction) => void;
|
13
|
+
export declare const DEFAULT_PROJECT_CONFIG: {
|
14
|
+
appid: string;
|
15
|
+
projectname: string;
|
16
|
+
setting: {
|
17
|
+
urlCheck: boolean;
|
18
|
+
es6: boolean;
|
19
|
+
postcss: boolean;
|
20
|
+
minified: boolean;
|
21
|
+
newFeature: boolean;
|
22
|
+
};
|
23
|
+
scripts: {
|
24
|
+
afterOpen: string;
|
25
|
+
beforeCompile: string;
|
26
|
+
};
|
27
|
+
};
|
28
|
+
export { ConditionItem };
|
29
|
+
interface ConditionData {
|
30
|
+
current: number;
|
31
|
+
list: ConditionItem[];
|
32
|
+
}
|
33
|
+
/** 扩展一波属性,给 IDE 用的,开发者不需要感知 */
|
34
|
+
export interface IProjectConfig extends IProject {
|
35
|
+
ttappid?: string;
|
36
|
+
setting: {
|
37
|
+
urlCheck: boolean;
|
38
|
+
es6: boolean;
|
39
|
+
postcss: boolean;
|
40
|
+
minified: boolean;
|
41
|
+
newFeature: boolean;
|
42
|
+
autoCompile?: boolean;
|
43
|
+
mockUpdate?: boolean;
|
44
|
+
scripts?: boolean;
|
45
|
+
localPlugins?: boolean;
|
46
|
+
nodeModules?: boolean;
|
47
|
+
mockLogin?: boolean;
|
48
|
+
autoPush?: boolean;
|
49
|
+
IDEPreviewHotRestartCache?: boolean;
|
50
|
+
useCompilerPlugins?: CompilerPlugin[];
|
51
|
+
bigPackageSizeSupport?: boolean;
|
52
|
+
};
|
53
|
+
condition?: {
|
54
|
+
miniprogram?: ConditionData;
|
55
|
+
game?: ConditionData;
|
56
|
+
};
|
57
|
+
}
|
58
|
+
/**
|
59
|
+
* 此处的技术类型与 ide 的技术类型有区别
|
60
|
+
* 这里的 TechType 通过项目特征获得,无法识别出小游戏和小玩法
|
61
|
+
*
|
62
|
+
* IDE 本身的项目技术类型分为 microapp、microgame、toybox
|
63
|
+
* microapp 属于 app 类型
|
64
|
+
* microgame、toybox 属于 game 类型
|
65
|
+
*/
|
66
|
+
declare type TechType = 'app' | 'game';
|
67
|
+
declare type IDEAppTechType = 'microapp' | 'toybox' | 'microgame' | 'microapp-minicode' | 'toybox-minicode' | 'microgame-minicode' | '';
|
68
|
+
export declare function setIDEAppTechType(type: IDEAppTechType): void;
|
69
|
+
export declare function getIDEAppTechType(): IDEAppTechType;
|
70
|
+
export declare function isTestAppid(appid: string): boolean;
|
71
|
+
export declare function getOriginAppid(appid: string, type?: TechType): string;
|
72
|
+
/**
|
73
|
+
* 包裹 ProjectConfigJSON 文件的读取。
|
74
|
+
*
|
75
|
+
* 绝大部分数据读取都会在此处有 fallback default value。
|
76
|
+
* 上层调用时,通常是不需要再处理了,使用时请小心。
|
77
|
+
*/
|
78
|
+
export declare class ProjectConfig extends JSONContainer<IProjectConfig> {
|
79
|
+
static from(projectPath: string): Promise<ProjectConfig>;
|
80
|
+
/**
|
81
|
+
* @param projectPath path to the project that contains `project.config.json`
|
82
|
+
*/
|
83
|
+
/**
|
84
|
+
* project path
|
85
|
+
*/
|
86
|
+
readonly projectPath: string;
|
87
|
+
constructor(json: IProjectConfig, filepath: string, projectPath: string);
|
88
|
+
getAppid(): string;
|
89
|
+
getRealAppid(): Promise<string>;
|
90
|
+
getSetting(): IProjectConfig['setting'];
|
91
|
+
getProjectName(): string;
|
92
|
+
getScripts(): IProjectConfig['scripts'];
|
93
|
+
getConditionData(conditionKeyName: keyof IProjectConfig['condition']): ConditionData;
|
94
|
+
getAutoCompileSetting(): boolean;
|
95
|
+
getLocalPluginsSetting(): boolean;
|
96
|
+
getAfterOpenScript(): string;
|
97
|
+
getBeforeCompileScript(): string;
|
98
|
+
getSkipDomainCheck(): boolean;
|
99
|
+
getPreviewHotRestartCache(): boolean;
|
100
|
+
getMiniprogramRoot(): string;
|
101
|
+
getBigPackageSizeSupport(): boolean;
|
102
|
+
/**
|
103
|
+
* Detect current project is 小程序 (`app.json`) or 游戏Like (`game.json`)
|
104
|
+
* @param match Optional comparison type
|
105
|
+
* @returns return `boolean` if {@link match} provide, otherwise the {@link TechType}
|
106
|
+
*/
|
107
|
+
detectProjectType(match: TechType): Promise<boolean>;
|
108
|
+
detectProjectType(): Promise<TechType>;
|
109
|
+
/**
|
110
|
+
* 当前项目的特征,app.json / game.json
|
111
|
+
*/
|
112
|
+
private getProjectType;
|
113
|
+
/**
|
114
|
+
* This would throw error if the `app.json` doesn't exist, handler error at your own risk.
|
115
|
+
* @returns the matching program config, `app.json` or `game.json`
|
116
|
+
*/
|
117
|
+
getAppJSON(): Promise<AppJSON>;
|
118
|
+
/**
|
119
|
+
* This would throw error if the `ext.json` doesn't exist, handler error at your own risk.
|
120
|
+
* @returns the matching ext config
|
121
|
+
*/
|
122
|
+
getExtJSON(): Promise<ExtJSON>;
|
123
|
+
useTypeScript(): boolean;
|
124
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export interface ICommonParams {
|
2
|
+
userId: string;
|
3
|
+
username: string;
|
4
|
+
ideVersion: string;
|
5
|
+
deviceId: string;
|
6
|
+
osPlatform: string;
|
7
|
+
osVersion: string;
|
8
|
+
techType?: string;
|
9
|
+
ideVersionNumber?: number;
|
10
|
+
env?: string;
|
11
|
+
branch?: string;
|
12
|
+
buildId?: string;
|
13
|
+
cliName?: string;
|
14
|
+
}
|
15
|
+
export declare function reportTea(event: string, commonParams: ICommonParams, params?: {
|
16
|
+
[k: string]: string | number | boolean;
|
17
|
+
}): void;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { ProjectSize, ServerSize } from '../typings/project';
|
2
|
+
/**
|
3
|
+
* Serialize server result to {@link ProjectSize}
|
4
|
+
* @param result
|
5
|
+
*/
|
6
|
+
export declare function normalizeSize(result: ServerSize): ProjectSize;
|
7
|
+
/**
|
8
|
+
* @param size 字节数
|
9
|
+
* @returns 以 B/KB/MB 结尾的字符串
|
10
|
+
*/
|
11
|
+
export declare function formatSize(size: number): string;
|
12
|
+
/**
|
13
|
+
* Append a `/` if the given {@link p path} not end with one
|
14
|
+
* @param p
|
15
|
+
* @returns
|
16
|
+
*/
|
17
|
+
export declare function ensureEndSlash(p: string): string;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { AxiosInstance as AxiosInstanceType } from 'axios';
|
2
|
+
interface ISlardarInstance {
|
3
|
+
reportRequestError: (options: {
|
4
|
+
url: string;
|
5
|
+
statusCode?: number;
|
6
|
+
statusMessage: string;
|
7
|
+
ttLogId?: string;
|
8
|
+
caller?: string;
|
9
|
+
}) => void;
|
10
|
+
reportCustomEvent: (eventName: string, metrics?: Record<string, number>, tags?: Record<string, string>) => void;
|
11
|
+
}
|
12
|
+
declare type IEnvConfig = {
|
13
|
+
env: {
|
14
|
+
type: 'boe' | 'ppe' | 'online';
|
15
|
+
channel: string;
|
16
|
+
};
|
17
|
+
proxy: {
|
18
|
+
host: string | null;
|
19
|
+
port: string | null;
|
20
|
+
};
|
21
|
+
};
|
22
|
+
declare type GetEnvFunction = () => IEnvConfig;
|
23
|
+
declare const defaultEnv: IEnvConfig;
|
24
|
+
declare const AxiosInstance: AxiosInstanceType;
|
25
|
+
declare function setEnvFunction(fn: GetEnvFunction): void;
|
26
|
+
declare function setSlardarInstance(obj: ISlardarInstance): void;
|
27
|
+
declare function setJestMock<T extends keyof AxiosInstanceType>(mockInstance: object): void;
|
28
|
+
export { AxiosInstance, defaultEnv, GetEnvFunction, setEnvFunction, setSlardarInstance, setJestMock };
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function cliAuth(options: any): Promise<void>;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
export declare function loginByEmail(options: {
|
2
|
+
email: string;
|
3
|
+
password: string;
|
4
|
+
dontSaveCookie?: boolean;
|
5
|
+
}): Promise<any>;
|
6
|
+
export declare function sendVerificationCodeToPhone(options: {
|
7
|
+
phoneNumber: string;
|
8
|
+
}): Promise<void>;
|
9
|
+
export declare function loginByPhone(options: {
|
10
|
+
phoneNumber: string;
|
11
|
+
code: string;
|
12
|
+
dontSaveCookie?: boolean;
|
13
|
+
}): Promise<any>;
|
14
|
+
export declare function checkSession(): Promise<{
|
15
|
+
isValid: boolean;
|
16
|
+
errMsg: string;
|
17
|
+
}>;
|
18
|
+
export declare function logout(): Promise<void>;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
declare type MetaOption = {
|
2
|
+
appid: string;
|
3
|
+
isGame?: boolean;
|
4
|
+
};
|
5
|
+
declare type MetaResult = {
|
6
|
+
version: string;
|
7
|
+
};
|
8
|
+
export declare function getMeta(options: MetaOption): Promise<MetaResult>;
|
9
|
+
/**
|
10
|
+
* 检测是否真的是小玩法的 appid
|
11
|
+
* 为什么小玩法也请求 _小程序_ 的地址呢? 因为历史所然
|
12
|
+
* @param appid
|
13
|
+
*/
|
14
|
+
export declare function isRealToyId(appid: string): Promise<boolean>;
|
15
|
+
/**
|
16
|
+
* fetch Meta from Server
|
17
|
+
* @param option
|
18
|
+
*/
|
19
|
+
export declare function fetchMeta({ appid, isGame }: MetaOption): Promise<any>;
|
20
|
+
export declare function getAppVersions(appId: string): Promise<{
|
21
|
+
audit_version: string;
|
22
|
+
}>;
|
23
|
+
export {};
|