tt-minigame-ide-cli 2.0.14 → 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";
@@ -196,6 +198,15 @@ export declare const SLARDAR_EVENT: {
196
198
  readonly IDE_CLOUD_DEBUG: "IDE_CLOUD_DEBUG";
197
199
  readonly IDE_CLOUD_REQUEST: "IDE_CLOUD_REQUEST";
198
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";
199
210
  readonly IDE_LOADER_IO_ERROR: string;
200
211
  readonly IDE_LOADER_INSTALL_RECOVER_ERROR: string;
201
212
  readonly IDE_LOADER_START_FROM_ENTRY: string;
@@ -262,6 +273,7 @@ export declare const IDE_MODULES: {
262
273
  readonly AI_COMMAND: "AI_COMMAND";
263
274
  readonly AI_FAQ: "AI_FAQ";
264
275
  readonly PROJECT_TO_QRCODE: "PROJECT_TO_QRCODE";
276
+ readonly PREVIEW_DIFF_RELOAD: "PREVIEW_DIFF_RELOAD";
265
277
  };
266
278
  export declare const IDE_TIMELINE_NAMES: {
267
279
  readonly SIMULATOR_FIRST_LOADING_END: "SIMULATOR_FIRST_LOADING_END";
@@ -307,6 +319,7 @@ export declare const IDE_TIMELINE_NAMES: {
307
319
  readonly AI_COMMAND: "AI_COMMAND";
308
320
  readonly AI_FAQ: "AI_FAQ";
309
321
  readonly PROJECT_TO_QRCODE: "PROJECT_TO_QRCODE";
322
+ readonly PREVIEW_DIFF_RELOAD: "PREVIEW_DIFF_RELOAD";
310
323
  };
311
324
  /**
312
325
  * IDE 性能统计 ipc 事件收敛
@@ -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 {};
@@ -89,6 +89,7 @@ export declare type ProjectToQRCodeOption = {
89
89
  };
90
90
  supportSourcemap?: boolean;
91
91
  enableHotRestartCache?: boolean;
92
+ xScreen?: boolean;
92
93
  penetrateMapJson?: Record<string, unknown>;
93
94
  traceVersion?: number;
94
95
  traceMode?: number;
@@ -96,6 +97,7 @@ export declare type ProjectToQRCodeOption = {
96
97
  upload: number;
97
98
  check: number;
98
99
  compile: number;
100
+ uploadSuccess?: boolean;
99
101
  }) => any;
100
102
  setCheckResult?: (result: any) => any;
101
103
  lynxPackages?: string;
@@ -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,7 +19,7 @@ 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';
@@ -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,13 +61,6 @@ 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 type TimeReporter = {
65
- startStep: (step: string) => () => void;
66
- finish: () => ({
67
- [x: string]: number;
68
- });
69
- };
70
- export declare function createTimeReporter(): TimeReporter;
71
64
  export declare function getProjectToQRCodeStepReporterDesc(report: {
72
65
  [k: string]: number;
73
66
  }): {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tt-minigame-ide-cli",
3
- "version": "2.0.14",
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
+ }