tt-minigame-ide-cli 2.0.12 → 2.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.
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/miniprogram-utils/src/constants/index.d.ts +14 -0
- package/dist/miniprogram-utils/src/data/app.d.ts +7 -0
- package/dist/miniprogram-utils/src/data/project.d.ts +6 -5
- package/dist/miniprogram-utils/src/electron-monitor/common/share.d.ts +3 -1
- package/dist/tt-ide-cli/src/features/login.d.ts +3 -0
- package/dist/tt-ide-cli/src/features/microgame/unity.d.ts +20 -2
- package/dist/tt-ide-cli/src/features/open.d.ts +1 -1
- package/dist/tt-ide-cli/src/features/packages.d.ts +2 -1
- package/dist/tt-ide-cli/src/features/preview.d.ts +2 -0
- package/dist/tt-ide-cli/src/types.d.ts +1 -0
- package/dist/tt-ide-cli/src/utils/hash.d.ts +2 -1
- package/dist/tt-ide-cli/src/utils/logger.d.ts +1 -1
- package/dist/tt-ide-cli/src/utils/login-storage.d.ts +14 -0
- package/dist/tt-ide-cli/src/utils/qrcode.d.ts +1 -1
- package/dist/tt-ide-cli/src/utils/util.d.ts +4 -0
- package/package.json +2 -2
@@ -109,6 +109,7 @@ export declare const SLARDAR_EVENT: {
|
|
109
109
|
readonly IDE_MODULE_CLICK_AUTH_UNREGPOP_DUEQRCODE: "IDE_MODULE_CLICK_AUTH_UNREGPOP_DUEQRCODE";
|
110
110
|
readonly VELA_CHECK_EXIST_PROJECT: "VELA_CHECK_EXIST_PROJECT";
|
111
111
|
readonly VELA_DELETE_PROJECT: "VELA_DELETE_PROJECT";
|
112
|
+
readonly VELA_DELETE_PROJECT_FOLDER: "VELA_DELETE_PROJECT_FOLDER";
|
112
113
|
readonly VELA_NEW_PROJECT: "VELA_NEW_PROJECT";
|
113
114
|
readonly VELA_NEW_PROJECT_FAIL: "VELA_NEW_PROJECT_FAIL";
|
114
115
|
readonly VELA_REQUEST_TEMPLATE_LIST: "VELA_REQUEST_TEMPLATE_LIST";
|
@@ -185,6 +186,15 @@ export declare const SLARDAR_EVENT: {
|
|
185
186
|
readonly IDE_USE_LYNX_SCHEMA: "IDE_USE_LYNX_SCHEMA";
|
186
187
|
readonly IDE_LIVE_PLUGIN_NOT_DEV_MODE: "IDE_LIVE_PLUGIN_NOT_DEV_MODE";
|
187
188
|
readonly IDE_SHOW_DYCLOUD_MODAL: "IDE_SHOW_DYCLOUD_MODAL";
|
189
|
+
readonly IDE_MODULE_POST_MESSAGE_TITLE_CLICK: "IDE_MODULE_POST_MESSAGE_TITLE_CLICK";
|
190
|
+
readonly SWITCH_BACKEND_RADIO: "SWITCH_BACKEND_RADIO";
|
191
|
+
readonly IDE_MARSCODE_LOGIN_MODAL_SHOW: "IDE_MARSCODE_LOGIN_MODAL_SHOW";
|
192
|
+
readonly IDE_MARSCODE_ERROR_MESSAGE_SHOW: "IDE_MARSCODE_ERROR_MESSAGE_SHOW";
|
193
|
+
readonly IDE_CLOUD_DEPLOY: "IDE_CLOUD_DEPLOY";
|
194
|
+
readonly IDE_CLOUD_PULL: "IDE_CLOUD_PULL";
|
195
|
+
readonly IDE_CLOUD_COPY: "IDE_CLOUD_COPY";
|
196
|
+
readonly IDE_CLOUD_DEBUG: "IDE_CLOUD_DEBUG";
|
197
|
+
readonly IDE_CLOUD_REQUEST: "IDE_CLOUD_REQUEST";
|
188
198
|
readonly IDE_LOADER_IO_ERROR: string;
|
189
199
|
readonly IDE_LOADER_INSTALL_RECOVER_ERROR: string;
|
190
200
|
readonly IDE_LOADER_START_FROM_ENTRY: string;
|
@@ -228,6 +238,7 @@ export declare const IDE_MODULES: {
|
|
228
238
|
readonly SIGN_CHECK: "SIGN_CHECK";
|
229
239
|
readonly INTELLIGENCE: "INTELLIGENCE";
|
230
240
|
readonly PROJECT_INSPECTION: "PROJECT_INSPECTION";
|
241
|
+
readonly WASM_SPLIT: "WASM_SPLIT";
|
231
242
|
readonly AI: "AI";
|
232
243
|
readonly SHARE_PROJECT: "SHARE_PROJECT";
|
233
244
|
readonly PROJECT_MANAGE: "PROJECT_MANAGE";
|
@@ -249,6 +260,7 @@ export declare const IDE_MODULES: {
|
|
249
260
|
readonly SIMULATOR_HEART_BEAT: "SIMULATOR_HEART_BEAT";
|
250
261
|
readonly AI_COMMAND: "AI_COMMAND";
|
251
262
|
readonly AI_FAQ: "AI_FAQ";
|
263
|
+
readonly PROJECT_TO_QRCODE: "PROJECT_TO_QRCODE";
|
252
264
|
};
|
253
265
|
export declare const IDE_TIMELINE_NAMES: {
|
254
266
|
readonly SIMULATOR_FIRST_LOADING_END: "SIMULATOR_FIRST_LOADING_END";
|
@@ -271,6 +283,7 @@ export declare const IDE_TIMELINE_NAMES: {
|
|
271
283
|
readonly SIGN_CHECK: "SIGN_CHECK";
|
272
284
|
readonly INTELLIGENCE: "INTELLIGENCE";
|
273
285
|
readonly PROJECT_INSPECTION: "PROJECT_INSPECTION";
|
286
|
+
readonly WASM_SPLIT: "WASM_SPLIT";
|
274
287
|
readonly AI: "AI";
|
275
288
|
readonly SHARE_PROJECT: "SHARE_PROJECT";
|
276
289
|
readonly PROJECT_MANAGE: "PROJECT_MANAGE";
|
@@ -292,6 +305,7 @@ export declare const IDE_TIMELINE_NAMES: {
|
|
292
305
|
readonly SIMULATOR_HEART_BEAT: "SIMULATOR_HEART_BEAT";
|
293
306
|
readonly AI_COMMAND: "AI_COMMAND";
|
294
307
|
readonly AI_FAQ: "AI_FAQ";
|
308
|
+
readonly PROJECT_TO_QRCODE: "PROJECT_TO_QRCODE";
|
295
309
|
};
|
296
310
|
/**
|
297
311
|
* IDE 性能统计 ipc 事件收敛
|
@@ -19,6 +19,13 @@ export interface IApp extends BaseApp {
|
|
19
19
|
deviceOrientation?: 'landscape' | 'portrait';
|
20
20
|
menuButtonStyle?: 'light' | 'dark';
|
21
21
|
liveCards?: string[];
|
22
|
+
/**
|
23
|
+
* 小程序插件配置
|
24
|
+
*/
|
25
|
+
plugins?: Record<string, {
|
26
|
+
version?: string;
|
27
|
+
provider?: string;
|
28
|
+
}>;
|
22
29
|
}
|
23
30
|
/**
|
24
31
|
* JSON object wrapper for `app.json`
|
@@ -86,13 +86,13 @@ export interface IProjectConfig extends IProject {
|
|
86
86
|
* 此处的技术类型与 ide 的技术类型有区别
|
87
87
|
* 这里的 TechType 通过项目特征获得,无法识别出小游戏和小玩法
|
88
88
|
*
|
89
|
-
* IDE 本身的项目技术类型分为 microapp、microgame、
|
89
|
+
* IDE 本身的项目技术类型分为 microapp、microgame、plugin
|
90
90
|
* microapp、plugin 属于 app 类型
|
91
|
-
* microgame
|
91
|
+
* microgame 属于 game 类型
|
92
92
|
* live-plugin 为直播间互动插件
|
93
93
|
*/
|
94
|
-
declare type TechType = 'app' | 'game' | '
|
95
|
-
declare type IDEAppTechType = 'microapp' | '
|
94
|
+
declare type TechType = 'app' | 'game' | 'unity' | 'liveplugin';
|
95
|
+
declare type IDEAppTechType = 'microapp' | 'microgame' | 'microapp-minicode' | 'plugin' | 'plugin-minicode' | 'microgame-minicode' | 'liveplugin-minicode' | 'unity' | 'liveplugin' | 'microapp-plugin' | 'microapp-plugin-minicode' | '';
|
96
96
|
export declare const PROJECT_TYPE_MAP: Record<string, TechType>;
|
97
97
|
export declare function setIDEAppTechType(type: IDEAppTechType): void;
|
98
98
|
export declare function getIDEAppTechType(): IDEAppTechType;
|
@@ -138,7 +138,7 @@ export declare class ProjectConfig extends JSONContainer<Partial<IProjectConfig>
|
|
138
138
|
getPrivateRawJSON(): Partial<IProjectPrivate>;
|
139
139
|
getAppid(): string;
|
140
140
|
getRealAppid(): Promise<string>;
|
141
|
-
getRealPluginAppid():
|
141
|
+
getRealPluginAppid(): string | null;
|
142
142
|
getSetting(): IProjectConfig['setting'];
|
143
143
|
getProjectName(): string;
|
144
144
|
getScripts(): IProjectConfig['scripts'];
|
@@ -153,6 +153,7 @@ export declare class ProjectConfig extends JSONContainer<Partial<IProjectConfig>
|
|
153
153
|
getPreviewHotRestartCache(): boolean;
|
154
154
|
getPreviewOpenVConsole(): boolean;
|
155
155
|
getMiniprogramRoot(): string;
|
156
|
+
getCloudfunctionRoot(): string;
|
156
157
|
getPluginRoot(): string;
|
157
158
|
isPluginProject(): boolean;
|
158
159
|
getBigPackageSizeSupport(): boolean;
|
@@ -89,7 +89,7 @@ export declare const PROCESS_TYPE: {
|
|
89
89
|
export declare type ProcessType = keyof typeof PROCESS_TYPE;
|
90
90
|
export declare const startTime: number;
|
91
91
|
export declare const skipReport: boolean;
|
92
|
-
export declare type TechType = 'microapp' | 'microgame' | '
|
92
|
+
export declare type TechType = 'microapp' | 'microgame' | 'liveplugin' | 'microapp-minicode' | 'microgame-minicode' | 'liveplugin-minicode' | 'microapp-plugin' | 'microapp-plugin-minicode';
|
93
93
|
export interface PerfConfigSettings {
|
94
94
|
disabled: boolean;
|
95
95
|
fps: {
|
@@ -119,5 +119,7 @@ export interface PerfConfigSettings {
|
|
119
119
|
ideUsageCollectInterval: number;
|
120
120
|
disabledJsonWorker: boolean;
|
121
121
|
largeJsonLimit?: number;
|
122
|
+
lowMemoryLimit?: number;
|
123
|
+
lowPerformanceCpus?: string[];
|
122
124
|
}
|
123
125
|
export declare const defaultPerfConfigSettings: PerfConfigSettings;
|
@@ -2,14 +2,17 @@ export declare function loginByEmail(options: {
|
|
2
2
|
email: string;
|
3
3
|
password: string;
|
4
4
|
dontSaveCookie?: boolean;
|
5
|
+
partner?: boolean;
|
5
6
|
}): Promise<any>;
|
6
7
|
export declare function sendVerificationCodeToPhone(options: {
|
7
8
|
phoneNumber: string;
|
9
|
+
partner?: boolean;
|
8
10
|
}): Promise<void>;
|
9
11
|
export declare function loginByPhone(options: {
|
10
12
|
phoneNumber: string;
|
11
13
|
code: string;
|
12
14
|
dontSaveCookie?: boolean;
|
15
|
+
partner?: boolean;
|
13
16
|
}): Promise<any>;
|
14
17
|
export declare function checkSession(): Promise<{
|
15
18
|
isValid: boolean;
|
@@ -106,15 +106,25 @@ export declare const unityCli: {
|
|
106
106
|
deviceOrientation?: UnityGameJson['deviceOrientation'];
|
107
107
|
output?: string;
|
108
108
|
channel?: string;
|
109
|
+
bgColor?: string;
|
109
110
|
}) => Promise<{
|
110
111
|
short_url: string;
|
111
112
|
origin_schema: string;
|
112
113
|
expire_time: number;
|
113
114
|
}>;
|
114
|
-
preview: ({ projectPath, ideUid, compileMode, }: {
|
115
|
+
preview: ({ projectPath, ideUid, compileMode, customOptions, }: {
|
115
116
|
projectPath: string;
|
116
117
|
ideUid?: string;
|
117
118
|
compileMode: CompileMode;
|
119
|
+
customOptions?: {
|
120
|
+
publishType?: PUBLISH_TYPE;
|
121
|
+
webGLSource?: string;
|
122
|
+
debug?: {
|
123
|
+
phoneRoomServiceUrl: string;
|
124
|
+
session?: string;
|
125
|
+
};
|
126
|
+
isPerformanceTest?: boolean;
|
127
|
+
};
|
118
128
|
}) => Promise<{
|
119
129
|
code: number;
|
120
130
|
data: {
|
@@ -124,7 +134,7 @@ export declare const unityCli: {
|
|
124
134
|
};
|
125
135
|
msg: string;
|
126
136
|
}>;
|
127
|
-
makeSchema: ({ appId, ideConfig, ctime, scene, query, bdpLog, version, channel, }: {
|
137
|
+
makeSchema: ({ appId, ideConfig, ctime, scene, query, bdpLog, version, channel, debug, }: {
|
128
138
|
appId: string;
|
129
139
|
ideConfig: any;
|
130
140
|
ctime?: number;
|
@@ -133,6 +143,13 @@ export declare const unityCli: {
|
|
133
143
|
bdpLog?: string;
|
134
144
|
version?: string;
|
135
145
|
channel?: string;
|
146
|
+
debug?: {
|
147
|
+
query: {
|
148
|
+
gtoken: string;
|
149
|
+
roomid: string;
|
150
|
+
session: string;
|
151
|
+
};
|
152
|
+
};
|
136
153
|
}) => Promise<{
|
137
154
|
code: number;
|
138
155
|
data: {
|
@@ -152,5 +169,6 @@ export declare const unityCli: {
|
|
152
169
|
expire_time: number;
|
153
170
|
}>;
|
154
171
|
validatePreviewFiles: (unityConfig: UnityConfigType) => Promise<void>;
|
172
|
+
uploadAndQueryProgressThroughPlatform: ({ projectPath, version, publishDesc, updateStatus, ideUid, channel }: UploadProps & QueryProgressProps) => Promise<boolean>;
|
155
173
|
};
|
156
174
|
export {};
|
@@ -18,7 +18,7 @@ import fg from 'fast-glob';
|
|
18
18
|
* @param {IProjectConfig['packOptions']} params.packOptions - 打包配置选项
|
19
19
|
* @returns {Promise<number>} - 返回包含文件夹大小的Promise
|
20
20
|
*/
|
21
|
-
export declare function getFolderSize({ folderPath, useTypeScript, options, isGame, isLivePlugin, gameFiles, rootPath, packOptions, }: {
|
21
|
+
export declare function getFolderSize({ folderPath, useTypeScript, options, isGame, isLivePlugin, gameFiles, rootPath, packOptions, projectConfig, }: {
|
22
22
|
folderPath: string;
|
23
23
|
useTypeScript: boolean;
|
24
24
|
options?: fg.Options;
|
@@ -27,6 +27,7 @@ export declare function getFolderSize({ folderPath, useTypeScript, options, isGa
|
|
27
27
|
gameFiles?: string[];
|
28
28
|
rootPath: string;
|
29
29
|
packOptions: IProjectConfig['packOptions'];
|
30
|
+
projectConfig: ProjectConfig;
|
30
31
|
}): Promise<number>;
|
31
32
|
/**
|
32
33
|
* 以文件夹为单位的包体积统计,不适用于依赖分析
|
@@ -40,6 +40,7 @@ export declare type UploadOption = Pick<ProjectToQRCodeOption, 'project' | 'qrco
|
|
40
40
|
needUploadCheck?: boolean;
|
41
41
|
extraCheckInfoJson?: string;
|
42
42
|
channel?: string;
|
43
|
+
minJssdk?: string;
|
43
44
|
};
|
44
45
|
/**
|
45
46
|
* 发布上传(功能入口)
|
@@ -66,6 +67,7 @@ export declare type ProjectToQRCodeOption = {
|
|
66
67
|
needUploadCheck: boolean;
|
67
68
|
extraCheckInfoJson?: string;
|
68
69
|
channel?: string;
|
70
|
+
minJssdk?: string;
|
69
71
|
};
|
70
72
|
extraInfoJson?: string;
|
71
73
|
localCompileVersion?: string;
|
@@ -1,10 +1,11 @@
|
|
1
|
+
import { getWhiteList } from './white-list';
|
1
2
|
/**
|
2
3
|
*
|
3
4
|
* @param dir path to microapp project
|
4
5
|
* @param timeout 预留给worker进程hash逻辑使用参数
|
5
6
|
* @returns
|
6
7
|
*/
|
7
|
-
export declare let getProjectHash: (dir: string, isGame: boolean, timeout?: number) => Promise<string>;
|
8
|
+
export declare let getProjectHash: (dir: string, isGame: boolean, timeout?: number, options?: Parameters<typeof getWhiteList>[1]) => Promise<string>;
|
8
9
|
/**
|
9
10
|
* IDE workbench 中调用该函数,最终会在MainHelperWindow中计算hash
|
10
11
|
*/
|
@@ -0,0 +1,14 @@
|
|
1
|
+
declare type ILoginInfo = {
|
2
|
+
type: 'mobile' | 'email' | '';
|
3
|
+
partner?: boolean;
|
4
|
+
};
|
5
|
+
declare class LoginCache {
|
6
|
+
private _loginInfo;
|
7
|
+
constructor();
|
8
|
+
private readCache;
|
9
|
+
private writeCache;
|
10
|
+
getLoginInfo(): ILoginInfo;
|
11
|
+
setLoginInfo(obj: Partial<ILoginInfo>): void;
|
12
|
+
}
|
13
|
+
export declare const loginInfo: LoginCache;
|
14
|
+
export {};
|
@@ -84,7 +84,7 @@ export declare type MakeSchemaOption = {
|
|
84
84
|
};
|
85
85
|
export declare function makeSchema(options: MakeSchemaOption): Promise<MakeSchemaResult>;
|
86
86
|
export declare function toQRCodeSVG(str: string): Promise<string>;
|
87
|
-
export declare function toQRCodeFile(text: string, filePath: string): Promise<string>;
|
87
|
+
export declare function toQRCodeFile(text: string, filePath: string, bgColor?: string): Promise<string>;
|
88
88
|
export declare function generateTerminalQrCode(url: string, options: {
|
89
89
|
small?: boolean;
|
90
90
|
copy?: boolean;
|
@@ -1,8 +1,11 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
import { ProjectConfig } from '@byted/miniprogram-utils/dist/data/project';
|
3
3
|
import archiver from 'archiver';
|
4
|
+
import { loginInfo } from './login-storage';
|
4
5
|
import { Transform } from 'stream';
|
6
|
+
export { loginInfo };
|
5
7
|
export declare const HIGH_WATER_MARK: number;
|
8
|
+
export declare function getHighWaterMarkByTotalMem(): number;
|
6
9
|
export declare function isMac(): boolean;
|
7
10
|
export declare function isCli(): boolean;
|
8
11
|
export declare function isMiniGameCli(): boolean;
|
@@ -57,3 +60,4 @@ export declare const getNextVersion: (version: string) => string;
|
|
57
60
|
export declare const isGameFileValid: (pattern: string) => boolean;
|
58
61
|
export declare const isObject: (value: any) => boolean;
|
59
62
|
export declare function sleep(timer: number): Promise<unknown>;
|
63
|
+
export declare function verifyLoginTypeAuth(projectPath: string): Promise<void>;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "tt-minigame-ide-cli",
|
3
|
-
"version": "2.0.
|
3
|
+
"version": "2.0.13",
|
4
4
|
"description": "Command line interface for micro app development",
|
5
5
|
"license": "ISC",
|
6
6
|
"main": "dist/index.js",
|
@@ -50,7 +50,7 @@
|
|
50
50
|
"@types/qrcode-terminal": "^0.12.0",
|
51
51
|
"@types/unzipper": "^0.10.4",
|
52
52
|
"@types/webpack-merge": "4.1.5",
|
53
|
-
"clean-webpack-plugin": "
|
53
|
+
"clean-webpack-plugin": "4.0.0",
|
54
54
|
"cross-env": "^7.0.3",
|
55
55
|
"jest": "^26.6.3",
|
56
56
|
"patch-package": "^6.4.7",
|