tt-minigame-ide-cli 2.0.9 → 2.0.11

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.
@@ -160,6 +160,9 @@ export declare const SLARDAR_EVENT: {
160
160
  readonly IDE_AI_ABNORMAL_REPLY: "IDE_AI_ABNORMAL_REPLY";
161
161
  readonly IDE_AI_BUTTON_SHOW: "IDE_AI_BUTTON_SHOW";
162
162
  readonly IDE_AI_STAY_DURATION: "IDE_AI_STAY_DURATION";
163
+ readonly IDE_AI_RESPONSE_TIME: "IDE_AI_RESPONSE_TIME";
164
+ readonly IDE_AI_STREAM_TIME: "IDE_AI_STREAM_TIME";
165
+ readonly IDE_WS_RECONNECT_FAILED: "IDE_WS_RECONNECT_FAILED";
163
166
  readonly IDE_DETAIL_CONFIG_ITEM_CLICK: "IDE_DETAIL_CONFIG_ITEM_CLICK";
164
167
  readonly IDE_WORKBENCH_VIEW_STATUS: "IDE_WORKBENCH_VIEW_STATUS";
165
168
  readonly IDE_POWER_EVENT: "IDE_POWER_EVENT";
@@ -220,6 +223,7 @@ export declare const IDE_MODULES: {
220
223
  readonly UPLOAD: "UPLOAD";
221
224
  readonly SIGN_CHECK: "SIGN_CHECK";
222
225
  readonly INTELLIGENCE: "INTELLIGENCE";
226
+ readonly PROJECT_INSPECTION: "PROJECT_INSPECTION";
223
227
  readonly AI: "AI";
224
228
  readonly SHARE_PROJECT: "SHARE_PROJECT";
225
229
  readonly PROJECT_MANAGE: "PROJECT_MANAGE";
@@ -236,6 +240,7 @@ export declare const IDE_MODULES: {
236
240
  readonly WEB_PC_SDK: "WEB_PC_SDK";
237
241
  readonly SIGN_CHECKER_GUARANTEED_PAYMENT: "SIGN_CHECKER_GUARANTEED_PAYMENT";
238
242
  readonly SIGN_CHECKER_TRADE_SYSTEM: "SIGN_CHECKER_TRADE_SYSTEM";
243
+ readonly TEST_QRCODE: "TEST_QRCODE";
239
244
  };
240
245
  export declare const IDE_TIMELINE_NAMES: {
241
246
  readonly SIMULATOR_FIRST_LOADING_END: "SIMULATOR_FIRST_LOADING_END";
@@ -257,6 +262,7 @@ export declare const IDE_TIMELINE_NAMES: {
257
262
  readonly UPLOAD: "UPLOAD";
258
263
  readonly SIGN_CHECK: "SIGN_CHECK";
259
264
  readonly INTELLIGENCE: "INTELLIGENCE";
265
+ readonly PROJECT_INSPECTION: "PROJECT_INSPECTION";
260
266
  readonly AI: "AI";
261
267
  readonly SHARE_PROJECT: "SHARE_PROJECT";
262
268
  readonly PROJECT_MANAGE: "PROJECT_MANAGE";
@@ -273,6 +279,7 @@ export declare const IDE_TIMELINE_NAMES: {
273
279
  readonly WEB_PC_SDK: "WEB_PC_SDK";
274
280
  readonly SIGN_CHECKER_GUARANTEED_PAYMENT: "SIGN_CHECKER_GUARANTEED_PAYMENT";
275
281
  readonly SIGN_CHECKER_TRADE_SYSTEM: "SIGN_CHECKER_TRADE_SYSTEM";
282
+ readonly TEST_QRCODE: "TEST_QRCODE";
276
283
  };
277
284
  /**
278
285
  * IDE 性能统计 ipc 事件收敛
@@ -1,3 +1,15 @@
1
1
  export declare enum CompilerPlugin {
2
2
  TYPESCRIPT = "typescript"
3
3
  }
4
+ export declare enum PACK_TYPE {
5
+ FILE = "file",
6
+ FOLDER = "folder",
7
+ SUFFIX = "suffix",
8
+ PREFIX = "prefix",
9
+ GLOB = "glob",
10
+ REGEXP = "regexp"
11
+ }
12
+ export declare type IPackItem = {
13
+ type: PACK_TYPE;
14
+ value: string;
15
+ };
@@ -3,7 +3,7 @@ import { ExtJSON } from './ext';
3
3
  import { JSONContainer } from './jsons';
4
4
  import type { ConditionItem } from './schema/base';
5
5
  import type { IProject } from './schema/project';
6
- import { CompilerPlugin } from '../constants/project';
6
+ import { CompilerPlugin, IPackItem } from '../constants/project';
7
7
  import { GetEnvFunction } from '../network/axios';
8
8
  import { IProjectPrivate } from './schema/project.private';
9
9
  /**
@@ -54,6 +54,11 @@ export interface IProjectConfig extends IProject {
54
54
  webDetect?: boolean;
55
55
  previewPreload?: boolean;
56
56
  };
57
+ lynx?: {
58
+ debugSchema?: Record<string, {
59
+ schema: string;
60
+ }>;
61
+ };
57
62
  condition?: {
58
63
  miniprogram?: ConditionData;
59
64
  game?: ConditionData;
@@ -65,6 +70,7 @@ export interface IProjectConfig extends IProject {
65
70
  native: {
66
71
  il2cpp: string;
67
72
  apk: string;
73
+ fullApk?: string;
68
74
  };
69
75
  instantGame: string;
70
76
  };
@@ -146,6 +152,16 @@ export declare class ProjectConfig extends JSONContainer<Partial<IProjectConfig>
146
152
  getBigPackageSizeSupport(): boolean;
147
153
  getWebDetect(): boolean;
148
154
  getPreviewPreload(): boolean;
155
+ getPackOptions(): {
156
+ ignore: IPackItem[];
157
+ include: IPackItem[];
158
+ };
159
+ getLynxConfig(): {
160
+ debugSchema?: Record<string, {
161
+ schema: string;
162
+ }>;
163
+ };
164
+ getLynxPackage(): string;
149
165
  /**
150
166
  * Detect current project is 小程序 (`app.json`) or 游戏Like (`game.json`)
151
167
  * @param match Optional comparison type
@@ -0,0 +1,2 @@
1
+ import { IProject } from '../data/schema/project';
2
+ export declare function filterFile(filePath: string, packOptions: NonNullable<IProject['packOptions']>): boolean;
@@ -23,3 +23,4 @@ export declare const isNeedForceUpdate: ({ curVersion, updateVersion, date, appT
23
23
  message: string;
24
24
  type: 'warn' | 'force';
25
25
  } | null;
26
+ export declare function isSubPath(parent: string, child: string): boolean;
@@ -1,3 +1,11 @@
1
+ declare enum PUBLISH_TYPE {
2
+ ONLY_ANDROID_NATIVE = "0",
3
+ ANDROID_NATIVE_AND_IOS_WEBGL = "1",
4
+ BOTH_WEBGL = "2",
5
+ ONLY_ANDROID_WEBGL = "3",
6
+ ONLY_ANDROID_INSTANT_GAME = "4",
7
+ ANDROID_INSTANT_GAME_AND_IOS_WEBGL = "5"
8
+ }
1
9
  declare type UnityConfigType = {
2
10
  appid: string;
3
11
  build: {
@@ -5,10 +13,11 @@ declare type UnityConfigType = {
5
13
  native: {
6
14
  il2cpp: string;
7
15
  apk: string;
16
+ fullApk?: string;
8
17
  };
9
18
  instantGame: string;
10
19
  };
11
- publishType: '0' | '1' | '2' | '3' | '4' | '5';
20
+ publishType: PUBLISH_TYPE;
12
21
  starkSdkVersion: string;
13
22
  unityToolsVersion: string;
14
23
  unityEngineVersion: string;
@@ -27,6 +36,11 @@ declare type UploadProps = {
27
36
  declare type QueryProgressProps = Pick<UploadProps, 'projectPath' | 'version' | 'ideUid'> & {
28
37
  updateStatus?: (status: number | string) => void;
29
38
  };
39
+ declare type CompileMode = {
40
+ scene?: string;
41
+ query?: string;
42
+ bdpLog?: string;
43
+ };
30
44
  export declare const unityCli: {
31
45
  getVersions: ({ projectPath, ideUid }: {
32
46
  projectPath: string;
@@ -48,7 +62,7 @@ export declare const unityCli: {
48
62
  ctime: string;
49
63
  version: string;
50
64
  }>;
51
- preview: ({ projectPath, ideUid }: {
65
+ testQrcode: ({ projectPath, ideUid }: {
52
66
  projectPath: string;
53
67
  ideUid?: number;
54
68
  }) => Promise<string>;
@@ -94,7 +108,45 @@ export declare const unityCli: {
94
108
  } & {
95
109
  publishType?: UnityConfigType['publishType'];
96
110
  deviceOrientation?: UnityGameJson['deviceOrientation'];
97
- outputPath?: string;
111
+ output?: string;
98
112
  }) => Promise<void>;
113
+ preview: ({ projectPath, ideUid, compileMode, }: {
114
+ projectPath: string;
115
+ ideUid?: string;
116
+ compileMode: CompileMode;
117
+ }) => Promise<{
118
+ code: number;
119
+ data: {
120
+ short_url: string;
121
+ origin_schema: string;
122
+ expire_time: number;
123
+ };
124
+ msg: string;
125
+ }>;
126
+ makeSchema: ({ appId, ideConfig, ctime, scene, query, bdpLog, }: {
127
+ appId: string;
128
+ ideConfig: any;
129
+ ctime: number;
130
+ scene?: string;
131
+ query?: string;
132
+ bdpLog?: string;
133
+ }) => Promise<{
134
+ code: number;
135
+ data: {
136
+ short_url: string;
137
+ origin_schema: string;
138
+ expire_time: number;
139
+ };
140
+ msg: string;
141
+ }>;
142
+ previewForCli: ({ projectPath, output, compileMode, }: {
143
+ projectPath: string;
144
+ output?: string;
145
+ compileMode: CompileMode;
146
+ }) => Promise<{
147
+ short_url: string;
148
+ origin_schema: string;
149
+ expire_time: number;
150
+ }>;
99
151
  };
100
152
  export {};
@@ -1,13 +1,14 @@
1
1
  /**
2
2
  * 文件系统相关
3
3
  */
4
+ import { ProjectConfig } from '@byted/miniprogram-utils/dist/data/project';
4
5
  /** MB 转 Byte 数,即 mb * 1024 * 1024 */
5
6
  export declare const mb2Byte: (mb: number) => number;
6
7
  /** Byte size 转 MB,即 byte / 1024 / 1024,默认保留 4 位小数 */
7
8
  export declare const byte2Mb: (byte: number, fixed?: number) => number;
8
9
  /** 获取文件字节数体积,实际上文件夹也支持,获取的是文件夹本身占用的系统体积(测试为 128Byte) */
9
- export declare const getFileByteSize: (path: string) => number;
10
+ export declare const getFileByteSize: (path: string, projectConfig: ProjectConfig) => number;
10
11
  /** 获取指定目录下所有文件体积和,支持 glob pattern ignore */
11
- export declare const getDirByteSize: (path: string, ignore?: string[], whiteList?: string[]) => Promise<number>;
12
+ export declare const getDirByteSize: (path: string, ignore: string[], whiteList: string[], projectConfig: ProjectConfig) => Promise<number>;
12
13
  /** 获取指定路径(兼容文件 / 整个目录)大小 Byte 数 */
13
- export declare const getPathByteSize: (path: string, ignore?: any[], whiteList?: string[]) => number | Promise<number>;
14
+ export declare const getPathByteSize: (path: string, ignore: any[], whiteList: string[], projectConfig: ProjectConfig) => number | Promise<number>;
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * 小游戏源码、打包相关
3
3
  */
4
+ import { ProjectConfig } from '@byted/miniprogram-utils/dist/data/project';
4
5
  /** 不参与体积计算的 glob pattern */
5
6
  export declare const PKG_SIZE_IGNORE_GLOBS: string[];
6
7
  /** 计算包哈希时不参与计算的文件匹配规则 */
@@ -23,7 +24,7 @@ export declare const getSizeLimitConfig: (appId: string) => Promise<{
23
24
  * @param root 小游戏路径
24
25
  * @returns 错误信息,空串表示校验通过
25
26
  */
26
- export declare const verifyPkgSize: (root: string) => Promise<string>;
27
+ export declare const verifyPkgSize: (root: string, projectConfig: ProjectConfig) => Promise<string>;
27
28
  export declare const getDirHash: (dirPath: string) => Promise<string>;
28
29
  export declare function compressZip(filePath: string, tempStoragePath: string, extraIgnore?: string[]): Promise<string>;
29
30
  export declare const checkUCAppId: (appId: string) => boolean;
@@ -1,18 +1,32 @@
1
1
  /**
2
2
  * Utils for microapp packages
3
3
  */
4
- import type { ProjectConfig } from '@byted/miniprogram-utils/dist/data/project';
4
+ import type { IProjectConfig, 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
8
  /**
9
9
  * 计算给定文件夹下面的文件体积总值
10
- * @param folderPath directory path
11
- * @param useTypeScript typescript
12
- * @param options pass to fast-glob
13
- * @returns
10
+ *
11
+ * @param {Object} params - 参数对象
12
+ * @param {string} params.folderPath - 要计算大小的文件夹路径
13
+ * @param {boolean} params.useTypeScript - 是否使用TypeScript
14
+ * @param {fg.Options} [params.options={}] - pass to fast-glob
15
+ * @param {boolean} params.isGame - 是否为小玩法或小游戏
16
+ * @param {string[]} [params.gameFiles] - 小游戏文件列表
17
+ * @param {string} params.rootPath - 项目根路径
18
+ * @param {IProjectConfig['packOptions']} params.packOptions - 打包配置选项
19
+ * @returns {Promise<number>} - 返回包含文件夹大小的Promise
14
20
  */
15
- export declare function getFolderSize(folderPath: string, useTypeScript: boolean, options: fg.Options, isGame: boolean, gameFiles?: string[]): Promise<number>;
21
+ export declare function getFolderSize({ folderPath, useTypeScript, options, isGame, gameFiles, rootPath, packOptions, }: {
22
+ folderPath: string;
23
+ useTypeScript: boolean;
24
+ options?: fg.Options;
25
+ isGame: boolean;
26
+ gameFiles?: string[];
27
+ rootPath: string;
28
+ packOptions: IProjectConfig['packOptions'];
29
+ }): Promise<number>;
16
30
  /**
17
31
  * 以文件夹为单位的包体积统计,不适用于依赖分析
18
32
  *
@@ -25,7 +25,7 @@ declare type CompileProgressResult = {
25
25
  } & Record<string, any>;
26
26
  };
27
27
  export declare function checkProjectMatchAppid(projectConfig: ProjectConfig, appid?: string): Promise<void>;
28
- declare type PreviewOption = Pick<ProjectToQRCodeOption, 'project' | 'page' | 'qrcode' | 'cache' | 'copyToClipboard' | 'extraInfoJson' | 'localCompileVersion' | 'ideConfig' | 'interactGame' | 'penetrateMapJson'>;
28
+ declare type PreviewOption = Pick<ProjectToQRCodeOption, 'project' | 'page' | 'qrcode' | 'cache' | 'copyToClipboard' | 'extraInfoJson' | 'localCompileVersion' | 'ideConfig' | 'interactGame' | 'penetrateMapJson' | 'lynxPackages' | 'useLocalSchema'>;
29
29
  /**
30
30
  * 预览上传(功能入口)
31
31
  * @param options
@@ -91,6 +91,8 @@ export declare type ProjectToQRCodeOption = {
91
91
  compile: number;
92
92
  }) => any;
93
93
  setCheckResult?: (result: any) => any;
94
+ lynxPackages?: string;
95
+ useLocalSchema?: string;
94
96
  };
95
97
  export declare function projectToQRCode(options: ProjectToQRCodeOption, hashTimeout?: number): Promise<ProjectQRCode>;
96
98
  export {};
@@ -30,6 +30,8 @@ export interface TMACliConfig {
30
30
  upload: string;
31
31
  versionInfo: string;
32
32
  sizeLimit: string;
33
+ unityCompileProgress: string;
34
+ unityPreview: string;
33
35
  };
34
36
  env: {
35
37
  type: 'online' | 'ppe' | 'boe';
@@ -15,5 +15,5 @@ declare class CliLogger extends BaseLogger {
15
15
  loading(text: string): ora.Ora;
16
16
  stopLoading(): void;
17
17
  }
18
- declare const logger: Logger | CliLogger;
18
+ declare const logger: CliLogger | Logger;
19
19
  export default logger;
@@ -76,6 +76,7 @@ export declare type MakeSchemaOption = {
76
76
  traceVersion?: number;
77
77
  traceMode?: number;
78
78
  uploadOptions?: ProjectToQRCodeOption['uploadOptions'];
79
+ lynxSchema?: string;
79
80
  };
80
81
  export declare function makeSchema(options: MakeSchemaOption): Promise<MakeSchemaResult>;
81
82
  export declare function toQRCodeSVG(str: string): Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tt-minigame-ide-cli",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "Command line interface for micro app development",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -1,9 +0,0 @@
1
- import { microgame } from 'tt-ide-cli';
2
- import type { ProjectInfo } from 'tt-ide-cli/types';
3
- declare const preview: typeof microgame.preview, upload: typeof microgame.upload;
4
- export { loginByEmail, loginByPhone, checkSession, buildNpm, setConfig, logout, } from 'tt-ide-cli';
5
- declare function open(options: {
6
- project: ProjectInfo;
7
- remotePort?: number;
8
- }): Promise<void>;
9
- export { preview, upload, open };