tt-minigame-ide-cli 2.0.13 → 2.0.15

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.
@@ -116,6 +116,8 @@ export declare const SLARDAR_EVENT: {
116
116
  readonly VELA_REQUEST_TEMPLATE_LIST_FAIL: "VELA_REQUEST_TEMPLATE_LIST_FAIL";
117
117
  readonly VELA_CHECK_TEMPLATE: "VELA_CHECK_TEMPLATE";
118
118
  readonly VELA_SCHEMA_DOWNLOAD_MINICODE: "VELA_SCHEMA_DOWNLOAD_MINICODE";
119
+ readonly IDE_FRONT_PAGE_PM_IMPORT_MINICODE: "IDE_FRONT_PAGE_PM_IMPORT_MINICODE";
120
+ readonly IDE_FRONT_PAGE_PM_IMPORT_MINICODE_FAILED: "IDE_FRONT_PAGE_PM_IMPORT_MINICODE_FAILED";
119
121
  readonly IDE_FRONTPAGE_PM_LIST: "IDE_FRONTPAGE_PM_LIST";
120
122
  readonly CREATE_PROGRAM: "CREATE_PROGRAM";
121
123
  readonly IDE_WXTOTT_ERROR: "IDE_WXTOTT_ERROR";
@@ -195,6 +197,16 @@ export declare const SLARDAR_EVENT: {
195
197
  readonly IDE_CLOUD_COPY: "IDE_CLOUD_COPY";
196
198
  readonly IDE_CLOUD_DEBUG: "IDE_CLOUD_DEBUG";
197
199
  readonly IDE_CLOUD_REQUEST: "IDE_CLOUD_REQUEST";
200
+ readonly IDE_PROJECT_TO_QRCODE_STEP: "IDE_PROJECT_TO_QRCODE_STEP";
201
+ readonly IDE_TTPKG_COMPILE_REPORT: "IDE_TTPKG_COMPILE_REPORT";
202
+ readonly IDE_AI_AGENT_QUESTION: "IDE_AI_AGENT_QUESTION";
203
+ readonly IDE_AI_AGENT_INTENTION: "IDE_AI_AGENT_INTENTION";
204
+ readonly IDE_AI_AGENT_TTFT: "IDE_AI_AGENT_TTFT";
205
+ readonly IDE_AI_AGENT_COST: "IDE_AI_AGENT_COST";
206
+ readonly IDE_AI_AGENT_FUNCTION_CALL: "IDE_AI_AGENT_FUNCTION_CALL";
207
+ readonly IDE_AI_AGENT_GENERATE: "IDE_AI_AGENT_GENERATE";
208
+ readonly IDE_AI_AGENT_DIFF_ACTION: "IDE_AI_AGENT_DIFF_ACTION";
209
+ readonly IDE_AI_AGENT_GEN_UI: "IDE_AI_AGENT_GEN_UI";
198
210
  readonly IDE_LOADER_IO_ERROR: string;
199
211
  readonly IDE_LOADER_INSTALL_RECOVER_ERROR: string;
200
212
  readonly IDE_LOADER_START_FROM_ENTRY: string;
@@ -261,6 +273,7 @@ export declare const IDE_MODULES: {
261
273
  readonly AI_COMMAND: "AI_COMMAND";
262
274
  readonly AI_FAQ: "AI_FAQ";
263
275
  readonly PROJECT_TO_QRCODE: "PROJECT_TO_QRCODE";
276
+ readonly PREVIEW_DIFF_RELOAD: "PREVIEW_DIFF_RELOAD";
264
277
  };
265
278
  export declare const IDE_TIMELINE_NAMES: {
266
279
  readonly SIMULATOR_FIRST_LOADING_END: "SIMULATOR_FIRST_LOADING_END";
@@ -306,6 +319,7 @@ export declare const IDE_TIMELINE_NAMES: {
306
319
  readonly AI_COMMAND: "AI_COMMAND";
307
320
  readonly AI_FAQ: "AI_FAQ";
308
321
  readonly PROJECT_TO_QRCODE: "PROJECT_TO_QRCODE";
322
+ readonly PREVIEW_DIFF_RELOAD: "PREVIEW_DIFF_RELOAD";
309
323
  };
310
324
  /**
311
325
  * IDE 性能统计 ipc 事件收敛
@@ -26,6 +26,7 @@ export interface IApp extends BaseApp {
26
26
  version?: string;
27
27
  provider?: string;
28
28
  }>;
29
+ enableIOSHighPerformanceModePlus?: boolean;
29
30
  }
30
31
  /**
31
32
  * JSON object wrapper for `app.json`
@@ -31,6 +31,16 @@ interface ConditionData {
31
31
  current: number;
32
32
  list: ConditionItem[];
33
33
  }
34
+ /**
35
+ * 用户自定义命令执行阶段
36
+ */
37
+ export declare enum UserScriptExecutePhase {
38
+ AfterOpen = "afterOpen",
39
+ BeforeCompile = "beforeCompile",
40
+ BeforePreview = "beforePreview",
41
+ BeforeUpload = "beforeUpload",
42
+ AfterUpload = "afterUpload"
43
+ }
34
44
  /** 扩展一波属性,给 IDE 用的,开发者不需要感知 */
35
45
  export interface IProjectConfig extends IProject {
36
46
  ttappid?: string;
@@ -49,6 +59,7 @@ export interface IProjectConfig extends IProject {
49
59
  mockLogin?: boolean;
50
60
  autoPush?: boolean;
51
61
  IDEPreviewHotRestartCache?: boolean;
62
+ IDEPreviewXScreen?: boolean;
52
63
  IDEPreviewOpenVConsole?: boolean;
53
64
  useCompilerPlugins?: CompilerPlugin[];
54
65
  bigPackageSizeSupport?: boolean;
@@ -147,10 +158,15 @@ export declare class ProjectConfig extends JSONContainer<Partial<IProjectConfig>
147
158
  getCompileHotReloadSetting(): boolean;
148
159
  getNativeCompileSetting(): boolean;
149
160
  getLocalPluginsSetting(): boolean;
150
- getAfterOpenScript(): string;
151
- getBeforeCompileScript(): string;
161
+ /**
162
+ * 获取用户自定义命令
163
+ * @param phase 用户自定义命令执行阶段
164
+ * @returns 对应阶段的用户自定义命令
165
+ */
166
+ getUserScript(phase: UserScriptExecutePhase): string;
152
167
  getSkipDomainCheck(): boolean;
153
168
  getPreviewHotRestartCache(): boolean;
169
+ getIDEPreviewXScreen(): boolean;
154
170
  getPreviewOpenVConsole(): boolean;
155
171
  getMiniprogramRoot(): string;
156
172
  getCloudfunctionRoot(): string;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * 文件hash计算
3
+ * @param path
4
+ * @param fullString 是否完整内容,为false时,只返回前7位
5
+ * @param algorithm
6
+ * @returns
7
+ */
8
+ export declare function getFileHash(path: string, fullString?: boolean, algorithm?: string): Promise<string>;
9
+ /**
10
+ * 遍历目录并计算文件的哈希值
11
+ * @param root 根目录
12
+ * @param ignore 忽略的文件正则表达式数组
13
+ * @param algorithm 算法
14
+ * @returns 包含文件相对路径和哈希值的对象
15
+ */
16
+ export declare function getDirHash(root: string, ignore?: string[], algorithm?: string): Promise<{
17
+ [file: string]: string;
18
+ }>;
@@ -1,10 +1,11 @@
1
+ export * from './crypto';
1
2
  export declare function parseJson<T>(json: string, errorDefault?: {}): T;
2
3
  export declare function waitUntil(task: () => Promise<boolean>, timeout?: number, interval?: number): Promise<boolean>;
3
4
  export declare function sleep(millisecond: number): Promise<void>;
4
5
  /**
5
6
  * 延时重试任务
6
7
  */
7
- export declare function retryTask(task: () => Promise<void>, tryCount?: number, delay?: number | (() => Promise<unknown>)): Promise<void>;
8
+ export declare function retryTask<T>(task: () => Promise<T>, tryCount?: number, delay?: number | (() => Promise<unknown>)): Promise<T>;
8
9
  /**
9
10
  * @description 输入现版本号与下一个版本号,比较两个版本大小
10
11
  * @param [curVersion] - string 现版本号
@@ -24,3 +25,15 @@ export declare const isNeedForceUpdate: ({ curVersion, updateVersion, date, appT
24
25
  type: 'warn' | 'force';
25
26
  } | null;
26
27
  export declare function isSubPath(parent: string, child: string): boolean;
28
+ export declare type E2ETestSdkInfo = {
29
+ latestSDKUrl: string;
30
+ sdkUpdateVersion: string;
31
+ };
32
+ export declare function fetchE2ETestSdk(): Promise<E2ETestSdkInfo | undefined>;
33
+ export declare type TimeReporter = {
34
+ startStep: (step: string) => () => void;
35
+ finish: () => ({
36
+ [x: string]: number;
37
+ });
38
+ };
39
+ export declare function createTimeReporter(): TimeReporter;
@@ -1,3 +1,10 @@
1
+ export declare function getAuditInfo(options: {
2
+ appid: string;
3
+ }): Promise<{
4
+ success: boolean;
5
+ msg: any;
6
+ data: any;
7
+ }>;
1
8
  export declare function getAuditHostsList(options: {
2
9
  appid: string;
3
10
  }): Promise<string[]>;
@@ -0,0 +1,63 @@
1
+ export declare const HARMONY_HOST_TAIL = "harmony";
2
+ export declare enum OsType {
3
+ Default = 1,
4
+ OS_Harmony = 2,
5
+ OS_Android = 3,
6
+ OS_iOS = 4
7
+ }
8
+ export interface GetHostInfoListResponse {
9
+ /**
10
+ *可选宿主端列表 k:v -> toutiao:头条
11
+ */
12
+ HostInfo?: Record<string, string>;
13
+ /**
14
+ *上次发布的宿主端,也是当前可见宿主端,为空则表示未发布过。且,只有可选宿主端列表里面的端k才会出现在此数组中。
15
+ */
16
+ PrePublishHost?: string[];
17
+ /**
18
+ *可选宿主端支持的操作系统
19
+ */
20
+ HostSupportOSList?: Record<OsType, string[]>;
21
+ /**
22
+ *上次发布的宿主端的操作系统,也是当前可见宿主端,为空则表示未发布过。且,只有可选宿主端列表里面的端k才会出现在此数组中。
23
+ */
24
+ PrePublishHostOSList?: Record<OsType, string[]>;
25
+ }
26
+ export declare function getAuditHostsListV2(options: {
27
+ appid: string;
28
+ }): Promise<any[]>;
29
+ interface VersionTagQuery {
30
+ Version?: string;
31
+ Tag?: string;
32
+ Page?: number;
33
+ PageSize?: number;
34
+ }
35
+ interface IAuditAppRequestParams {
36
+ UserId?: number;
37
+ AppId?: string;
38
+ AutoPublish?: number;
39
+ TestReport?: string;
40
+ ScreenShotUrls?: string;
41
+ FromThirdParty?: boolean;
42
+ HostNames?: string[];
43
+ NotifyContent?: string;
44
+ TpAppId?: string;
45
+ IPAddress?: string;
46
+ AuditNote?: string;
47
+ AuditWay?: 0 | 1;
48
+ VersionTag?: VersionTagQuery;
49
+ MainCategoryId?: string;
50
+ IsForceSkipPluginCheck?: boolean;
51
+ HostOsList?: {
52
+ [osType: string]: string[];
53
+ };
54
+ IsForceSkipPluginJssdkCheck?: boolean;
55
+ }
56
+ export declare function sendAuditInfoV2(auditInfo: IAuditAppRequestParams, appid: string): Promise<void>;
57
+ export declare function auditV2(options: {
58
+ appid: string;
59
+ host: string[];
60
+ autoPublish: boolean;
61
+ channel?: string;
62
+ }): Promise<void>;
63
+ export {};
@@ -78,6 +78,7 @@ export declare type ProjectToQRCodeOption = {
78
78
  upload: number;
79
79
  check: number;
80
80
  compile: number;
81
+ uploadSuccess?: boolean;
81
82
  }) => any;
82
83
  setCheckResult?: (result: any) => any;
83
84
  isNewPlatform?: (value: boolean) => void;
@@ -43,26 +43,10 @@ declare type CompileMode = {
43
43
  bdpLog?: string;
44
44
  };
45
45
  export declare const unityCli: {
46
- getVersions: ({ projectPath, ideUid }: {
46
+ getVersion: ({ projectPath, ideUid }: {
47
47
  projectPath: string;
48
48
  ideUid?: number;
49
- }) => Promise<{
50
- latest: {
51
- ctime: string;
52
- version: string;
53
- };
54
- current: {
55
- ctime: string;
56
- version: string;
57
- };
58
- }>;
59
- getLatestVersion: ({ projectPath, ideUid }: {
60
- projectPath: string;
61
- ideUid?: number;
62
- }) => Promise<{
63
- ctime: string;
64
- version: string;
65
- }>;
49
+ }) => Promise<any>;
66
50
  upload: ({ projectPath, version, publishDesc, ideUid, channel }: UploadProps) => Promise<{
67
51
  code: number;
68
52
  message: string;
@@ -169,6 +153,6 @@ export declare const unityCli: {
169
153
  expire_time: number;
170
154
  }>;
171
155
  validatePreviewFiles: (unityConfig: UnityConfigType) => Promise<void>;
172
- uploadAndQueryProgressThroughPlatform: ({ projectPath, version, publishDesc, updateStatus, ideUid, channel }: UploadProps & QueryProgressProps) => Promise<boolean>;
156
+ uploadAndQueryProgressThroughPlatform: ({ projectPath, version, publishDesc, updateStatus, ideUid, channel }: UploadProps & QueryProgressProps) => Promise<void>;
173
157
  };
174
158
  export {};
@@ -12,3 +12,10 @@ export declare const getFileByteSize: (path: string, projectConfig: ProjectConfi
12
12
  export declare const getDirByteSize: (path: string, ignore: string[], whiteList: string[], projectConfig: ProjectConfig) => Promise<number>;
13
13
  /** 获取指定路径(兼容文件 / 整个目录)大小 Byte 数 */
14
14
  export declare const getPathByteSize: (path: string, ignore: any[], whiteList: string[], projectConfig: ProjectConfig) => number | Promise<number>;
15
+ /**
16
+ * @description: 把game.json插入到zip中
17
+ * @param {string} gameJsonPath
18
+ * @param {string} webglPath
19
+ * @return {Promise<Buffer>}
20
+ */
21
+ export declare const appendGameJsonToZipForUnity: (gameJsonPath: string, webglPath: string) => Promise<Buffer | null>;
@@ -11,6 +11,9 @@ export declare type ProjectQRCode = {
11
11
  qrcodeSVG?: string;
12
12
  qrcodeFilePath?: string;
13
13
  useCache: boolean;
14
+ timeReport?: {
15
+ [k: string]: number;
16
+ };
14
17
  } & Pick<CompileProgressResult, 'metrics' | 'passJson'>;
15
18
  export declare function checkChannel(appid: string, channel: string): Promise<void>;
16
19
  declare type CompileProgressResult = {
@@ -86,6 +89,7 @@ export declare type ProjectToQRCodeOption = {
86
89
  };
87
90
  supportSourcemap?: boolean;
88
91
  enableHotRestartCache?: boolean;
92
+ xScreen?: boolean;
89
93
  penetrateMapJson?: Record<string, unknown>;
90
94
  traceVersion?: number;
91
95
  traceMode?: number;
@@ -93,10 +97,12 @@ export declare type ProjectToQRCodeOption = {
93
97
  upload: number;
94
98
  check: number;
95
99
  compile: number;
100
+ uploadSuccess?: boolean;
96
101
  }) => any;
97
102
  setCheckResult?: (result: any) => any;
98
103
  lynxPackages?: string;
99
104
  useLocalSchema?: string;
105
+ needTimeReport?: boolean;
100
106
  };
101
107
  export declare function projectToQRCode(options: ProjectToQRCodeOption, hashTimeout?: number): Promise<ProjectQRCode>;
102
108
  export {};
@@ -1,4 +1,3 @@
1
- import { audit, getAuditHostsList } from './features/audit';
2
1
  import { getConfig, setConfig } from './features/config';
3
2
  import { createProject } from './features/create';
4
3
  import { checkSession, loginByEmail, loginByPhone, logout, sendVerificationCodeToPhone } from './features/login';
@@ -9,6 +8,8 @@ import { ProjectInfo } from './types';
9
8
  import { setCookieFn } from './utils/cookie';
10
9
  import { IDEConfig, IDESandboxConfig, makeSchema, MakeSchemaOption, MakeSchemaResult } from './utils/qrcode';
11
10
  import { setAppConfig } from './features/app-config';
11
+ import { Metrics } from './utils/metrics';
12
+ import { getAuditHostsListV2, auditV2 } from './features/auditV2';
12
13
  declare function open(options: {
13
14
  project: ProjectInfo;
14
15
  remotePort?: number;
@@ -18,9 +19,11 @@ declare function buildNpmFunc(options: {
18
19
  }): Promise<import("./features/npm").BuildNpmResult>;
19
20
  declare function upload(options: UploadOption): Promise<ProjectQRCode>;
20
21
  export { ProjectQRCode, ProjectToQRCodeOption };
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, };
22
+ export { open, setConfig, createProject as create, loginByEmail, loginByPhone, logout, sendVerificationCodeToPhone, checkSession, auditV2 as audit, getAuditHostsListV2 as getAuditHostsList, buildNpmFunc as buildNpm, preview, upload, projectToQRCode, setCookieFn, getConfig, detectValidExtApp, getProjectSize, verifySubPackageSize, checkProjectMatchAppid, INVALID_EXTAPP_REASON, IDEConfig, makeSchema, MakeSchemaOption, MakeSchemaResult, IDESandboxConfig, setAppConfig, Metrics, };
22
23
  export * from './features/meta';
23
24
  export { folderToZipStream } from './features/packages';
24
25
  export * from './utils/metrics';
25
26
  export * as microgame from './features/microgame';
26
27
  export { getProjectHash, setProjectHashFn } from './utils/hash';
28
+ export { getProjectToQRCodeStepReporterDesc } from './utils/util';
29
+ export { PROJECT_TO_QR_CODE_STEP } from './utils/constants';
@@ -2,3 +2,25 @@ export declare const IDE_SCHEMA = "bytedanceide:";
2
2
  export declare const TEMPLATE_DOWNLOAD_URL = "https://sf1-cdn-tos.douyinstatic.com/obj/microapp/frontend/ide/template/tma-demo-master.zip";
3
3
  export declare const TS_TEMPLATE_DOWNLOAD_URL = "https://sf1-cdn-tos.douyinstatic.com/obj/microapp/frontend/ide/template/tma-demo-master-ts.zip";
4
4
  export declare const TEMPLATE_PLUGIN_DOWNLOAD_URL = "https://sf1-cdn-tos.douyinstatic.com/obj/microapp/frontend/ide/template/microapp-plugin-template-js.zip";
5
+ export declare const PROJECT_TO_QR_CODE_STEP: {
6
+ readonly channelCheck: "channel_check";
7
+ readonly zip: "source_zip";
8
+ readonly upload: "upload_source_zip";
9
+ readonly hash: "hash_project";
10
+ readonly prepare: "prepare";
11
+ readonly check: "check";
12
+ readonly compile: "cloud_download_and_compile";
13
+ readonly preCheck: "pre_check";
14
+ readonly makeSchema: "make_schema";
15
+ };
16
+ export declare const PROJECT_TO_QR_CODE_STEP_DESC: {
17
+ readonly channel_check: "通道检查耗时";
18
+ readonly source_zip: "打压缩包耗时";
19
+ readonly upload_source_zip: "上传压缩包耗时";
20
+ readonly hash_project: "hash计算耗时";
21
+ readonly prepare: "各项检测准备耗时";
22
+ readonly check: "包体检查耗时";
23
+ readonly cloud_download_and_compile: "云端下载编译耗时";
24
+ readonly pre_check: "项目预检耗时";
25
+ readonly make_schema: "schema生成耗时";
26
+ };
@@ -81,6 +81,7 @@ export declare type MakeSchemaOption = {
81
81
  shelledTechType?: number;
82
82
  pluginAppid?: string;
83
83
  previewPluginMode?: PreviewMode;
84
+ xScreen?: boolean;
84
85
  };
85
86
  export declare function makeSchema(options: MakeSchemaOption): Promise<MakeSchemaResult>;
86
87
  export declare function toQRCodeSVG(str: string): Promise<string>;
@@ -61,3 +61,8 @@ export declare const isGameFileValid: (pattern: string) => boolean;
61
61
  export declare const isObject: (value: any) => boolean;
62
62
  export declare function sleep(timer: number): Promise<unknown>;
63
63
  export declare function verifyLoginTypeAuth(projectPath: string): Promise<void>;
64
+ export declare function getProjectToQRCodeStepReporterDesc(report: {
65
+ [k: string]: number;
66
+ }): {
67
+ 总耗时: string;
68
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tt-minigame-ide-cli",
3
- "version": "2.0.13",
3
+ "version": "2.0.15",
4
4
  "description": "Command line interface for micro app development",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -61,4 +61,4 @@
61
61
  "publishConfig": {
62
62
  "registry": "https://registry.npmjs.org"
63
63
  }
64
- }
64
+ }