tt-minigame-ide-cli 2.0.6 → 2.0.8-beta.0
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 +20 -0
- package/dist/miniprogram-utils/src/data/project.d.ts +2 -0
- package/dist/miniprogram-utils/src/network/axios.d.ts +2 -1
- package/dist/tt-ide-cli/src/features/app-config.d.ts +7 -0
- package/dist/tt-ide-cli/src/features/audit.d.ts +0 -1
- package/dist/tt-ide-cli/src/features/login.d.ts +1 -0
- package/dist/tt-ide-cli/src/features/microgame/utils/package.d.ts +10 -0
- package/dist/tt-ide-cli/src/features/packages.d.ts +2 -5
- package/dist/tt-ide-cli/src/index.d.ts +2 -1
- package/dist/tt-ide-cli/src/types.d.ts +1 -0
- package/dist/tt-ide-cli/src/utils/cookie.d.ts +6 -0
- package/dist/tt-ide-cli/src/utils/qrcode.d.ts +1 -0
- package/dist/tt-ide-cli/src/utils/util.d.ts +2 -0
- package/package.json +1 -1
- package/dist/tt-ide-cli/src/features/microgame/utils/settings.d.ts +0 -48
@@ -125,6 +125,7 @@ export declare const SLARDAR_EVENT: {
|
|
125
125
|
readonly IDE_TEMPLATE_DOWNLOAD: "IDE_TEMPLATE_DOWNLOAD";
|
126
126
|
readonly IDE_QUICK_JS_ERROR: "IDE_QUICK_JS_ERROR";
|
127
127
|
readonly IDE_REMOTE_DEBUG_CONNECTION_QUALITY: "IDE_REMOTE_DEBUG_CONNECTION_QUALITY";
|
128
|
+
readonly IDE_LOCAL_COMPILE_TRACE: "IDE_LOCAL_COMPILE_TRACE";
|
128
129
|
readonly IDE_REMOTE_DEBUG_EXCEPTION: "IDE_REMOTE_DEBUG_EXCEPTION";
|
129
130
|
readonly IDE_MODULE_AUTH_FORCE_LOGOUT: "IDE_MODULE_AUTH_FORCE_LOGOUT";
|
130
131
|
readonly IDE_CANVAS_WEBGL_CONTEXT_ENABLE: "IDE_CANVAS_WEBGL_CONTEXT_ENABLE";
|
@@ -133,6 +134,7 @@ export declare const SLARDAR_EVENT: {
|
|
133
134
|
readonly IDE_DECODE_QRCODE: "IDE_DECODE_QRCODE";
|
134
135
|
readonly IDE_DECODE_URL: "IDE_DECODE_URL";
|
135
136
|
readonly IDE_MAIN_HELPER_FORK_TIME: "IDE_MAIN_HELPER_FORK_TIME";
|
137
|
+
readonly IDE_MAIN_HELPER_ERROR: "IDE_MAIN_HELPER_ERROR";
|
136
138
|
readonly IDE_INSTALL_PATH: "IDE_INSTALL_PATH";
|
137
139
|
readonly IDE_SWITCH_WORKBENCH_MODE: "IDE_SWITCH_WORKBENCH_MODE";
|
138
140
|
readonly IDE_TOGGLE_REMOTE_VIEW: "IDE_TOGGLE_REMOTE_VIEW";
|
@@ -147,6 +149,20 @@ export declare const SLARDAR_EVENT: {
|
|
147
149
|
readonly IDE_WB_SCENE_END: "IDE_WB_SCENE_END";
|
148
150
|
readonly IDE_GECKO_ERROR: "IDE_GECKO_ERROR";
|
149
151
|
readonly PUCK_COMPILE_ERROR: "PUCK_COMPILE_ERROR";
|
152
|
+
readonly IDE_DEVTOOLS_PANEL_INIT: "IDE_DEVTOOLS_PANEL_INIT";
|
153
|
+
readonly IDE_DEVTOOLS_SENSORS_PANEL_USAGE: "IDE_DEVTOOLS_SENSORS_PANEL_USAGE";
|
154
|
+
readonly IDE_FRONT_PAGE_CLICK_SETTINGS: "IDE_FRONT_PAGE_CLICK_SETTINGS";
|
155
|
+
readonly IDE_AI_OPEN: "IDE_AI_OPEN";
|
156
|
+
readonly IDE_AI_QUESTION: "IDE_AI_QUESTION";
|
157
|
+
readonly IDE_AI_FEEDBACK: "IDE_AI_FEEDBACK";
|
158
|
+
readonly IDE_AI_OPEN_LINK: "IDE_AI_OPEN_LINK";
|
159
|
+
readonly IDE_DETAIL_CONFIG_ITEM_CLICK: "IDE_DETAIL_CONFIG_ITEM_CLICK";
|
160
|
+
readonly IDE_WORKBENCH_VIEW_STATUS: "IDE_WORKBENCH_VIEW_STATUS";
|
161
|
+
readonly IDE_POWER_EVENT: "IDE_POWER_EVENT";
|
162
|
+
readonly IDE_TASK_PERFORMANCE: "IDE_TASK_PERFORMANCE";
|
163
|
+
readonly IDE_EXCEPTION_RECORD: "IDE_EXCEPTION_RECORD";
|
164
|
+
readonly IDE_PROXY_ERROR_TRACE: "IDE_PROXY_ERROR_TRACE";
|
165
|
+
readonly IDE_EDITOR_RESOLVE_SNIPPET: "IDE_EDITOR_RESOLVE_SNIPPET";
|
150
166
|
readonly IDE_LOADER_IO_ERROR: string;
|
151
167
|
readonly IDE_LOADER_INSTALL_RECOVER_ERROR: string;
|
152
168
|
readonly IDE_LOADER_START_FROM_ENTRY: string;
|
@@ -188,6 +204,7 @@ export declare const IDE_MODULES: {
|
|
188
204
|
readonly UPLOAD: "UPLOAD";
|
189
205
|
readonly SIGN_CHECK: "SIGN_CHECK";
|
190
206
|
readonly INTELLIGENCE: "INTELLIGENCE";
|
207
|
+
readonly AI: "AI";
|
191
208
|
readonly SHARE_PROJECT: "SHARE_PROJECT";
|
192
209
|
readonly PROJECT_MANAGE: "PROJECT_MANAGE";
|
193
210
|
readonly PROJECT_DETAIL: "PROJECT_DETAIL";
|
@@ -199,6 +216,7 @@ export declare const IDE_MODULES: {
|
|
199
216
|
readonly AVATAR: "AVATAR";
|
200
217
|
readonly UPDATE: "UPDATE";
|
201
218
|
readonly EDITOR_SAVE: "EDITOR_SAVE";
|
219
|
+
readonly MAIN_HELPER: "MAIN_HELPER";
|
202
220
|
};
|
203
221
|
export declare const IDE_TIMELINE_NAMES: {
|
204
222
|
readonly SIMULATOR_FIRST_LOADING_END: "SIMULATOR_FIRST_LOADING_END";
|
@@ -220,6 +238,7 @@ export declare const IDE_TIMELINE_NAMES: {
|
|
220
238
|
readonly UPLOAD: "UPLOAD";
|
221
239
|
readonly SIGN_CHECK: "SIGN_CHECK";
|
222
240
|
readonly INTELLIGENCE: "INTELLIGENCE";
|
241
|
+
readonly AI: "AI";
|
223
242
|
readonly SHARE_PROJECT: "SHARE_PROJECT";
|
224
243
|
readonly PROJECT_MANAGE: "PROJECT_MANAGE";
|
225
244
|
readonly PROJECT_DETAIL: "PROJECT_DETAIL";
|
@@ -231,6 +250,7 @@ export declare const IDE_TIMELINE_NAMES: {
|
|
231
250
|
readonly AVATAR: "AVATAR";
|
232
251
|
readonly UPDATE: "UPDATE";
|
233
252
|
readonly EDITOR_SAVE: "EDITOR_SAVE";
|
253
|
+
readonly MAIN_HELPER: "MAIN_HELPER";
|
234
254
|
};
|
235
255
|
/**
|
236
256
|
* IDE 性能统计 ipc 事件收敛
|
@@ -42,6 +42,7 @@ export interface IProjectConfig extends IProject {
|
|
42
42
|
newFeature: boolean;
|
43
43
|
autoCompile?: boolean;
|
44
44
|
compileHotReLoad?: boolean;
|
45
|
+
nativeCompile?: boolean;
|
45
46
|
scripts?: boolean;
|
46
47
|
localPlugins?: boolean;
|
47
48
|
nodeModules?: boolean;
|
@@ -118,6 +119,7 @@ export declare class ProjectConfig extends JSONContainer<Partial<IProjectConfig>
|
|
118
119
|
getConditionData(conditionKeyName: keyof NonNullable<IProjectConfig['condition']>): ConditionData;
|
119
120
|
getAutoCompileSetting(): boolean;
|
120
121
|
getCompileHotReloadSetting(): boolean;
|
122
|
+
getNativeCompileSetting(): boolean;
|
121
123
|
getLocalPluginsSetting(): boolean;
|
122
124
|
getAfterOpenScript(): string;
|
123
125
|
getBeforeCompileScript(): string;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { AxiosInstance as AxiosInstanceType } from 'axios';
|
2
|
+
declare function setBoeMap(k: RegExp, v: string): void;
|
2
3
|
interface ISlardarInstance {
|
3
4
|
reportRequestError: (options: {
|
4
5
|
url: string;
|
@@ -25,4 +26,4 @@ declare const AxiosInstance: AxiosInstanceType;
|
|
25
26
|
declare function setEnvFunction(fn: GetEnvFunction): void;
|
26
27
|
declare function setSlardarInstance(obj: ISlardarInstance): void;
|
27
28
|
declare function setJestMock<T extends keyof AxiosInstanceType>(mockInstance: object): void;
|
28
|
-
export { AxiosInstance, defaultEnv, IEnvConfig, GetEnvFunction, setEnvFunction, setSlardarInstance, setJestMock };
|
29
|
+
export { AxiosInstance, defaultEnv, IEnvConfig, GetEnvFunction, setEnvFunction, setSlardarInstance, setJestMock, setBoeMap };
|
@@ -5,6 +5,16 @@
|
|
5
5
|
export declare const PKG_SIZE_IGNORE_GLOBS: string[];
|
6
6
|
/** 计算包哈希时不参与计算的文件匹配规则 */
|
7
7
|
export declare const PKG_HASH_IGNORE_LIST: string[];
|
8
|
+
/**
|
9
|
+
* 获取上传预览 Settings 配置,支持白名单处理,兜底默认
|
10
|
+
*/
|
11
|
+
export declare const getSizeLimitConfig: (appId: string) => Promise<{
|
12
|
+
normalTotal: number;
|
13
|
+
subMain: number;
|
14
|
+
subPkg: number;
|
15
|
+
subTotal: number;
|
16
|
+
openData: number;
|
17
|
+
}>;
|
8
18
|
/**
|
9
19
|
* 校验包体大小,支持白名单逻辑,具体限制以 Settings 下发为准
|
10
20
|
* 默认:普通包最大 8MB,开放数据域 & 分包主包最大 4MB,子包不限制,总包 20MB
|
@@ -5,7 +5,6 @@ import type { ProjectConfig } from '@byted/miniprogram-utils/dist/data/project';
|
|
5
5
|
import { ProjectSize } from '@byted/miniprogram-utils/typings/project';
|
6
6
|
import archiver from 'archiver';
|
7
7
|
import fg from 'fast-glob';
|
8
|
-
import { IApp } from '@byted/miniprogram-utils/dist/data/app';
|
9
8
|
/**
|
10
9
|
* 计算给定文件夹下面的文件体积总值
|
11
10
|
* @param folderPath directory path
|
@@ -17,12 +16,10 @@ export declare function getFolderSize(folderPath: string, useTypeScript: boolean
|
|
17
16
|
/**
|
18
17
|
* 以文件夹为单位的包体积统计,不适用于依赖分析
|
19
18
|
*
|
20
|
-
* @param projectConfig
|
21
|
-
* @param appJson
|
22
19
|
* @param projectPath
|
23
20
|
* @param isGame
|
24
21
|
*/
|
25
|
-
export declare function getProjectSize(
|
22
|
+
export declare function getProjectSize(projectPath: string, isGame?: boolean): Promise<ProjectSize>;
|
26
23
|
/**
|
27
24
|
* 校验当前项目的分包体积是否符合要求
|
28
25
|
* 若有错误,会抛出 promise 异常
|
@@ -39,7 +36,7 @@ declare type FolderToZipStreamOption = {
|
|
39
36
|
*
|
40
37
|
* @param dir path to folder
|
41
38
|
*/
|
42
|
-
export declare function folderToZipStream(dir: string, { whiteList, useTypeScript }: FolderToZipStreamOption, isGame: boolean): Promise<archiver.Archiver>;
|
39
|
+
export declare function folderToZipStream(dir: string, { whiteList, useTypeScript }: FolderToZipStreamOption, isGame: boolean, highWaterMark?: number): Promise<archiver.Archiver>;
|
43
40
|
/**
|
44
41
|
* For cli only
|
45
42
|
* @param input
|
@@ -8,6 +8,7 @@ import { detectValidExtApp, INVALID_EXTAPP_REASON } from './features/third-party
|
|
8
8
|
import { ProjectInfo } from './types';
|
9
9
|
import { setCookieFn } from './utils/cookie';
|
10
10
|
import { IDEConfig, IDESandboxConfig, makeSchema, MakeSchemaOption, MakeSchemaResult } from './utils/qrcode';
|
11
|
+
import { setAppConfig } from './features/app-config';
|
11
12
|
declare function open(options: {
|
12
13
|
project: ProjectInfo;
|
13
14
|
remotePort?: number;
|
@@ -17,7 +18,7 @@ declare function buildNpmFunc(options: {
|
|
17
18
|
}): Promise<import("./features/npm").BuildNpmResult>;
|
18
19
|
declare function upload(options: UploadOption): Promise<ProjectQRCode>;
|
19
20
|
export { ProjectQRCode, ProjectToQRCodeOption };
|
20
|
-
export { open, setConfig, createProject as create, loginByEmail, loginByPhone, logout, sendVerificationCodeToPhone, checkSession, audit, getAuditHostsList, buildNpmFunc as buildNpm, preview, upload, projectToQRCode, setCookieFn, getConfig, detectValidExtApp, getProjectSize, verifySubPackageSize, checkProjectMatchAppid, INVALID_EXTAPP_REASON, IDEConfig, makeSchema, MakeSchemaOption, MakeSchemaResult, IDESandboxConfig, };
|
21
|
+
export { open, setConfig, createProject as create, loginByEmail, loginByPhone, logout, sendVerificationCodeToPhone, checkSession, audit, getAuditHostsList, buildNpmFunc as buildNpm, preview, upload, projectToQRCode, setCookieFn, getConfig, detectValidExtApp, getProjectSize, verifySubPackageSize, checkProjectMatchAppid, INVALID_EXTAPP_REASON, IDEConfig, makeSchema, MakeSchemaOption, MakeSchemaResult, IDESandboxConfig, setAppConfig, };
|
21
22
|
export * from './features/meta';
|
22
23
|
export { folderToZipStream } from './features/packages';
|
23
24
|
export * from './utils/metrics';
|
@@ -4,4 +4,10 @@ export declare const getUserId: () => string;
|
|
4
4
|
export declare function saveUserCookies(cookies: string[], userId: string): void;
|
5
5
|
export declare function removeUserCookies(): void;
|
6
6
|
export declare function setCookieFn(fn: GetCookieFunction): void;
|
7
|
+
declare type LogInfoHeaders = {
|
8
|
+
'x-cli-token'?: any;
|
9
|
+
'x-cli-appid'?: string;
|
10
|
+
Cookie?: any;
|
11
|
+
};
|
12
|
+
export declare const getLogInfoHeaders: (appId: string) => Promise<LogInfoHeaders>;
|
7
13
|
export {};
|
@@ -55,3 +55,5 @@ export declare function getMD5Stream(source: archiver.Archiver): Promise<Transfo
|
|
55
55
|
}>;
|
56
56
|
export declare const getNextVersion: (version: string) => string;
|
57
57
|
export declare const isGameFileValid: (pattern: string) => boolean;
|
58
|
+
export declare const isObject: (value: any) => boolean;
|
59
|
+
export declare function sleep(timer: number): Promise<unknown>;
|
package/package.json
CHANGED
@@ -1,48 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* AppSettings 相关逻辑封装
|
3
|
-
* https://site.bytedance.net/docs/428/3356/request_params/
|
4
|
-
*/
|
5
|
-
import { SizeLimitConfig, TmgSdkInfo } from './source.type';
|
6
|
-
/**
|
7
|
-
* 网络请求相关相关的 typings 声明
|
8
|
-
*/
|
9
|
-
declare type BaseResponse<T = any> = {
|
10
|
-
data: T;
|
11
|
-
message: string;
|
12
|
-
};
|
13
|
-
declare type Dict<T = any> = {
|
14
|
-
[key: string]: T;
|
15
|
-
};
|
16
|
-
export declare type SettingsResponse = BaseResponse<{
|
17
|
-
settings: {
|
18
|
-
compile_config?: {
|
19
|
-
limit: SizeLimitConfig;
|
20
|
-
};
|
21
|
-
tt_tma_sdk_config?: TmgSdkInfo[];
|
22
|
-
};
|
23
|
-
settings_time: number;
|
24
|
-
}>;
|
25
|
-
export declare const SETTINGS_URL = "https://is.snssdk.com/service/settings/v3/";
|
26
|
-
export declare const genDefault: (params: Dict) => {
|
27
|
-
caller_name: string;
|
28
|
-
channel: string;
|
29
|
-
device_platform: string;
|
30
|
-
device_id: any;
|
31
|
-
device_id_str: any;
|
32
|
-
version_code: any;
|
33
|
-
user_id: any;
|
34
|
-
};
|
35
|
-
/**
|
36
|
-
* 获取小游戏 IDE AppSettings 配置
|
37
|
-
* https://cloud.bytedance.net/appSettings-v2/detail/product/608/config/list
|
38
|
-
*/
|
39
|
-
export declare const getIdeSettings: (params?: Dict) => Promise<{
|
40
|
-
settings: {
|
41
|
-
compile_config?: {
|
42
|
-
limit: SizeLimitConfig;
|
43
|
-
};
|
44
|
-
tt_tma_sdk_config?: TmgSdkInfo[];
|
45
|
-
};
|
46
|
-
settings_time: number;
|
47
|
-
}>;
|
48
|
-
export {};
|