tt-minigame-ide-cli 2.0.14 → 2.0.16

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.
Files changed (27) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/miniprogram-utils/src/constants/index.d.ts +18 -0
  4. package/dist/miniprogram-utils/src/constants/project.d.ts +3 -1
  5. package/dist/miniprogram-utils/src/data/app.d.ts +1 -0
  6. package/dist/miniprogram-utils/src/data/project.d.ts +20 -4
  7. package/dist/miniprogram-utils/src/electron-monitor/common/share.d.ts +4 -0
  8. package/dist/miniprogram-utils/src/utils/crypto.d.ts +19 -0
  9. package/dist/miniprogram-utils/src/utils/index.d.ts +14 -1
  10. package/dist/tt-ide-cli/src/features/audit.d.ts +7 -0
  11. package/dist/tt-ide-cli/src/features/auditV2.d.ts +63 -0
  12. package/dist/tt-ide-cli/src/features/meta.d.ts +1 -0
  13. package/dist/tt-ide-cli/src/features/microgame/cloud-compile.d.ts +1 -0
  14. package/dist/tt-ide-cli/src/features/microgame/mixed-cloud-compile.d.ts +103 -0
  15. package/dist/tt-ide-cli/src/features/microgame/mixed-index.d.ts +4 -0
  16. package/dist/tt-ide-cli/src/features/microgame/unity.d.ts +3 -19
  17. package/dist/tt-ide-cli/src/features/microgame/utils/mixed-constant.d.ts +8 -0
  18. package/dist/tt-ide-cli/src/features/microgame/utils/mixed-package.d.ts +73 -0
  19. package/dist/tt-ide-cli/src/features/microgame/utils/package.d.ts +15 -7
  20. package/dist/tt-ide-cli/src/features/microgame/utils/source.type.d.ts +4 -0
  21. package/dist/tt-ide-cli/src/features/preview.d.ts +2 -0
  22. package/dist/tt-ide-cli/src/index.d.ts +4 -2
  23. package/dist/tt-ide-cli/src/types.d.ts +14 -0
  24. package/dist/tt-ide-cli/src/utils/qrcode.d.ts +1 -0
  25. package/dist/tt-ide-cli/src/utils/util.d.ts +0 -7
  26. package/dist/tt-ide-cli/src/utils/white-list.d.ts +1 -1
  27. package/package.json +1 -1
@@ -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,16 @@ 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";
210
+ readonly IDE_OPERATOR_TIME: "IDE_OPERATOR_TIME";
199
211
  readonly IDE_LOADER_IO_ERROR: string;
200
212
  readonly IDE_LOADER_INSTALL_RECOVER_ERROR: string;
201
213
  readonly IDE_LOADER_START_FROM_ENTRY: string;
@@ -262,6 +274,7 @@ export declare const IDE_MODULES: {
262
274
  readonly AI_COMMAND: "AI_COMMAND";
263
275
  readonly AI_FAQ: "AI_FAQ";
264
276
  readonly PROJECT_TO_QRCODE: "PROJECT_TO_QRCODE";
277
+ readonly PREVIEW_DIFF_RELOAD: "PREVIEW_DIFF_RELOAD";
265
278
  };
266
279
  export declare const IDE_TIMELINE_NAMES: {
267
280
  readonly SIMULATOR_FIRST_LOADING_END: "SIMULATOR_FIRST_LOADING_END";
@@ -307,6 +320,7 @@ export declare const IDE_TIMELINE_NAMES: {
307
320
  readonly AI_COMMAND: "AI_COMMAND";
308
321
  readonly AI_FAQ: "AI_FAQ";
309
322
  readonly PROJECT_TO_QRCODE: "PROJECT_TO_QRCODE";
323
+ readonly PREVIEW_DIFF_RELOAD: "PREVIEW_DIFF_RELOAD";
310
324
  };
311
325
  /**
312
326
  * IDE 性能统计 ipc 事件收敛
@@ -356,3 +370,7 @@ export declare const FRONT_PAGE_EVENT: {
356
370
  VELA_SCHEMA_DOWNLOAD_MINICODE: string;
357
371
  VELA_SCHEMA_DOWNLOAD_MINICODE_FAIL: string;
358
372
  };
373
+ export declare const PROJECT_TECH_TYPE: {
374
+ PLAYABLE_GAME: number;
375
+ GAME: number;
376
+ };
@@ -1,5 +1,7 @@
1
1
  export declare enum CompilerPlugin {
2
- TYPESCRIPT = "typescript"
2
+ TYPESCRIPT = "typescript",
3
+ LESS = "less",
4
+ SASS = "sass"
3
5
  }
4
6
  export declare enum PACK_TYPE {
5
7
  FILE = "file",
@@ -26,6 +26,7 @@ export interface IApp extends BaseApp {
26
26
  version?: string;
27
27
  provider?: string;
28
28
  }>;
29
+ enableIOSHighPerformanceMode?: boolean;
29
30
  enableIOSHighPerformanceModePlus?: boolean;
30
31
  }
31
32
  /**
@@ -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;
@@ -91,8 +102,8 @@ export interface IProjectConfig extends IProject {
91
102
  * microgame 属于 game 类型
92
103
  * live-plugin 为直播间互动插件
93
104
  */
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' | '';
105
+ declare type TechType = 'app' | 'game' | 'unity' | 'liveplugin' | 'playablegame';
106
+ declare type IDEAppTechType = 'microapp' | 'microgame' | 'microapp-minicode' | 'plugin' | 'plugin-minicode' | 'microgame-minicode' | 'liveplugin-minicode' | 'unity' | 'liveplugin' | 'microapp-plugin' | 'microapp-plugin-minicode' | 'playablegame' | 'playablegame-minicode' | '';
96
107
  export declare const PROJECT_TYPE_MAP: Record<string, TechType>;
97
108
  export declare function setIDEAppTechType(type: IDEAppTechType): void;
98
109
  export declare function getIDEAppTechType(): IDEAppTechType;
@@ -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;
@@ -21,6 +21,8 @@ export interface ICommonParams {
21
21
  isSandbox?: string;
22
22
  frameworkType?: string;
23
23
  workbenchMode?: string;
24
+ mixType?: number;
25
+ isMixed?: '0' | '1';
24
26
  }
25
27
  export declare function commonParams2Context(commonParams: ICommonParams, globalDevAppId?: string, globalTechType?: string, globalExtAppId?: string): {
26
28
  user_id: string;
@@ -45,6 +47,8 @@ export declare function commonParams2Context(commonParams: ICommonParams, global
45
47
  e2e_scene: string;
46
48
  cpu_model: string;
47
49
  system_memory: string;
50
+ is_mixed: string;
51
+ mix_type: number;
48
52
  };
49
53
  export declare function getHref(): string;
50
54
  /**
@@ -0,0 +1,19 @@
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
+ }>;
19
+ export declare const getBufferMd5: (buffer: Buffer) => string;
@@ -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 {};
@@ -19,5 +19,6 @@ export declare function isRealToyId(appid: string): Promise<boolean>;
19
19
  export declare function fetchMeta({ appid, isGame }: MetaOption): Promise<any>;
20
20
  export declare function getAppVersions(appId: string, isPlugin?: boolean): Promise<{
21
21
  audit_version: string;
22
+ plugin_base_library_version: string;
22
23
  }>;
23
24
  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;
@@ -0,0 +1,103 @@
1
+ import { ServerSize } from '@byted/miniprogram-utils/typings/project';
2
+ import { ProjectInfo, QrcodeInfo } from '../../types';
3
+ import { IMetrics } from '../../utils/metrics';
4
+ import { IDEConfig, MakeSchemaOption } from '../../utils/qrcode';
5
+ export declare type ProjectQRCode = {
6
+ expireTime: number;
7
+ shortUrl: string;
8
+ originSchema: string;
9
+ qrcodeSVG?: string;
10
+ qrcodeFilePath?: string;
11
+ useCache: boolean;
12
+ } & Pick<CompileProgressResult, 'metrics' | 'passJson'>;
13
+ export declare enum MixType {
14
+ Cocos = 1,
15
+ WebGl = 2,
16
+ Native = 3
17
+ }
18
+ declare type CompileProgressResult = {
19
+ success: boolean;
20
+ /** error code */
21
+ error: number;
22
+ done: boolean;
23
+ msg: string;
24
+ metrics?: IMetrics;
25
+ errLink?: string;
26
+ passJson: {
27
+ packageSize?: ServerSize;
28
+ } & Record<string, any>;
29
+ };
30
+ export declare type PreviewOption = Pick<ProjectToQRCodeOption, 'project' | 'page' | 'qrcode' | 'cache' | 'copyToClipboard' | 'extraInfoJson' | 'localCompileVersion' | 'ideConfig' | 'mixType'>;
31
+ /**
32
+ * 预览上传(功能入口)
33
+ * @param options
34
+ * @returns
35
+ */
36
+ export declare function preview(options: PreviewOption): Promise<ProjectQRCode>;
37
+ export declare type UploadOption = Pick<ProjectToQRCodeOption, 'project' | 'qrcode' | 'copyToClipboard' | 'extraInfoJson' | 'localCompileVersion' | 'ideConfig' | 'updateStatus' | 'setCheckResult' | 'isNewPlatform' | 'mixType'> & {
38
+ version: string;
39
+ changeLog: string;
40
+ needUploadSourcemap?: boolean;
41
+ extraCheckInfoJson?: string;
42
+ channel?: string;
43
+ };
44
+ /**
45
+ * 发布上传(功能入口)
46
+ * @param options
47
+ * @returns
48
+ */
49
+ export declare function upload(options: UploadOption): Promise<ProjectQRCode>;
50
+ export declare type ProjectToQRCodeOption = {
51
+ project: ProjectInfo;
52
+ page: {
53
+ path: string;
54
+ query: string;
55
+ scene: string;
56
+ launchFrom: string;
57
+ location: string;
58
+ } & Pick<MakeSchemaOption, 'referrerInfo'>;
59
+ qrcode: QrcodeInfo;
60
+ cache: boolean;
61
+ copyToClipboard: boolean;
62
+ uploadOptions?: {
63
+ version: string;
64
+ changeLog: string;
65
+ needUploadSourcemap: boolean;
66
+ extraCheckInfoJson?: string;
67
+ channel?: string;
68
+ };
69
+ extraInfoJson?: string;
70
+ localCompileVersion?: string;
71
+ ideConfig?: IDEConfig;
72
+ debug?: {
73
+ query: {
74
+ gtoken: string;
75
+ roomid: string;
76
+ session: string;
77
+ };
78
+ };
79
+ uploadCache?: boolean;
80
+ supportSourcemap?: boolean;
81
+ enableHotRestartCache?: boolean;
82
+ updateStatus?: (status: {
83
+ upload: number;
84
+ check: number;
85
+ compile: number;
86
+ uploadSuccess?: boolean;
87
+ }) => any;
88
+ setCheckResult?: (result: any) => any;
89
+ isNewPlatform?: (value: boolean) => void;
90
+ mixType: MixType;
91
+ };
92
+ export declare function projectToQRCode(options: ProjectToQRCodeOption): Promise<ProjectQRCode>;
93
+ export declare function getChannelLimit(appid: string): Promise<{
94
+ limit_num: number;
95
+ } | null>;
96
+ export declare function checkChannel(appid: string, channel: string): Promise<void>;
97
+ export declare const previewForCli: (options: PreviewOption & {
98
+ useAndroidNative?: boolean;
99
+ }) => Promise<ProjectQRCode>;
100
+ export declare const uploadForCli: (options: UploadOption & {
101
+ useAndroidNative?: boolean;
102
+ }) => Promise<ProjectQRCode>;
103
+ export {};
@@ -0,0 +1,4 @@
1
+ export * from './mixed-cloud-compile';
2
+ export * from './utils/mixed-package';
3
+ export * from './meta';
4
+ export * from './utils/mixed-constant';
@@ -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 {};
@@ -0,0 +1,8 @@
1
+ export declare const NATIVE_RELATIVE_PATH = "native";
2
+ export declare const NATIVE_FULL_APK_NAME = "full.apk";
3
+ export declare const NATIVE_IL2CPP_NAME = "il2cpp.zip";
4
+ export declare const NATIVE_APK_NAME = "intermediate.apk";
5
+ export declare const UNITY_PLUGIN_PROVIDER = "tt674511f8f84ea91612";
6
+ export declare const UNITY_CACHE_DIR = ".dy-game-cache";
7
+ export declare const WEBGL_SYMBOLS_NAME = "webgl.symbols.json";
8
+ export declare const WEBGL_STREAMING_ASSETS_NAME = "StreamingAssets";
@@ -0,0 +1,73 @@
1
+ /// <reference types="node" />
2
+ import { PassThrough, Stream } from 'stream';
3
+ import { NATIVE_FULL_APK_NAME, NATIVE_APK_NAME, NATIVE_IL2CPP_NAME } from './mixed-constant';
4
+ import { SizeLimitConfig } from './source.type';
5
+ import { checkAppId, getAppId } from './package';
6
+ /** 不参与体积计算的 glob pattern */
7
+ export declare const PKG_SIZE_IGNORE_GLOBS: string[];
8
+ export declare const getSizeLimitConfig: (appId: string) => Promise<Omit<SizeLimitConfig, "demo">>;
9
+ /**
10
+ * @description: 目前小游戏分包大小有以下限制:
11
+ 整个小游戏所有主包+分包大小不超过 30M
12
+ 主包不超过 4M
13
+ 单个普通分包不限制大小
14
+ * @return {*}
15
+ */
16
+ export declare function verifyPkgSize(devAppid: string, projectPath: string, options?: {
17
+ withNative: boolean;
18
+ isUpload: boolean;
19
+ }): Promise<string>;
20
+ declare type NativeFileName = typeof NATIVE_APK_NAME | typeof NATIVE_FULL_APK_NAME | typeof NATIVE_IL2CPP_NAME;
21
+ export declare function getProjectSize(projectPath: string, options?: {
22
+ withNative: boolean;
23
+ isUpload: boolean;
24
+ }): Promise<{
25
+ main: number;
26
+ subPkgs: {
27
+ subs: Array<[
28
+ string,
29
+ number
30
+ ]>;
31
+ total: number;
32
+ };
33
+ openData: number;
34
+ total: number;
35
+ native?: {
36
+ il2cpp: number;
37
+ apk: number;
38
+ };
39
+ }>;
40
+ declare type ReturnTypeOfFolderToZipStream = Partial<Record<NativeFileName, Stream>> & {
41
+ zipStream: PassThrough;
42
+ };
43
+ /**
44
+ * @description: 将项目打包为 zip,如果是native,则一起返回native产物
45
+ * @param {string} folderPath
46
+ * @return {ReturnTypeOfFolderToZipStream}
47
+ */
48
+ export declare function folderToZipStream(folderPath: string, options?: {
49
+ withNative: boolean;
50
+ isUpload: boolean;
51
+ }): Promise<ReturnTypeOfFolderToZipStream>;
52
+ /**
53
+ * @description: 压缩文件
54
+ * @return {Buffer | PassThrough}
55
+ */
56
+ export declare const compress: ({ entries, rootPath, }: {
57
+ entries: string[];
58
+ rootPath: string;
59
+ }) => Promise<PassThrough>;
60
+ export { getAppId, checkAppId };
61
+ export declare const validateAppId: (appId: string) => Promise<void>;
62
+ /**
63
+ * @description: for 混合引擎小游戏,计算项目 hash:
64
+ * StreamingAssets下面所有文件均计算
65
+ * native 预览只计算full.apk
66
+ * 除去 native 和StreamingAssets的文件按白名单计算
67
+ * 最后把三个hash拼起来作为最终的hash
68
+ * 目前上传不需要计算hash(上传不做缓存,预览才做)
69
+ * @param {string} projectPath
70
+ * @param {boolean} withNative
71
+ * @return {string}
72
+ */
73
+ export declare const getMixedProjectHash: (projectPath: string, withNative: boolean) => Promise<string>;
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * 小游戏源码、打包相关
3
3
  */
4
+ import { SizeLimitConfig } from './source.type';
4
5
  import { ProjectConfig } from '@byted/miniprogram-utils/dist/data/project';
5
6
  /** 不参与体积计算的 glob pattern */
6
7
  export declare const PKG_SIZE_IGNORE_GLOBS: string[];
@@ -9,13 +10,7 @@ export declare const PKG_HASH_IGNORE_LIST: string[];
9
10
  /**
10
11
  * 获取上传预览 Settings 配置,支持白名单处理,兜底默认
11
12
  */
12
- export declare const getSizeLimitConfig: (appId: string) => Promise<{
13
- normalTotal: number;
14
- subMain: number;
15
- subPkg: number;
16
- subTotal: number;
17
- openData: number;
18
- }>;
13
+ export declare const getSizeLimitConfig: (appId: string) => Promise<SizeLimitConfig>;
19
14
  /**
20
15
  * 校验包体大小,支持白名单逻辑,具体限制以 Settings 下发为准
21
16
  * 默认:普通包最大 8MB,开放数据域 & 分包主包最大 4MB,子包不限制,总包 20MB
@@ -31,3 +26,16 @@ export declare const checkUCAppId: (appId: string) => boolean;
31
26
  export declare const checkAppId: (appId: string) => boolean;
32
27
  export declare const getAppId: (projectPath: string) => Promise<string>;
33
28
  export declare const validateAppId: (appId: string) => Promise<void>;
29
+ export declare const getTechType: (appId: string) => Promise<number>;
30
+ export declare const isPlayableGame: (appId: string) => Promise<boolean>;
31
+ export declare const getConfigUrl: (appid: string) => Promise<{
32
+ makeSchema: string;
33
+ compileProgress: string;
34
+ preview: string;
35
+ upload: string;
36
+ versionInfo: string;
37
+ sizeLimit: string;
38
+ unityCompileProgress: string;
39
+ unityPreview: string;
40
+ getChannelNumber: string;
41
+ }>;
@@ -28,6 +28,10 @@ export declare type SizeLimitConfig = {
28
28
  subTotal: number;
29
29
  /** 开放数据域包最大 MB 数 */
30
30
  openData: number;
31
+ /** 试玩游戏最大 MB 数 */
32
+ demo: number;
33
+ apkSource?: number;
34
+ il2cppSource?: number;
31
35
  };
32
36
  export declare type TmgSdkInfo = {
33
37
  latestSDKUrl: string;
@@ -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';
@@ -26,3 +27,4 @@ export * as microgame from './features/microgame';
26
27
  export { getProjectHash, setProjectHashFn } from './utils/hash';
27
28
  export { getProjectToQRCodeStepReporterDesc } from './utils/util';
28
29
  export { PROJECT_TO_QR_CODE_STEP } from './utils/constants';
30
+ export * as mixedGame from './features/microgame/mixed-index';
@@ -33,6 +33,20 @@ export interface TMACliConfig {
33
33
  unityCompileProgress: string;
34
34
  unityPreview: string;
35
35
  getChannelNumber: string;
36
+ uploadMixed: string;
37
+ previewMixed: string;
38
+ compileProgressMixed: string;
39
+ };
40
+ playablegameUrl: {
41
+ makeSchema: string;
42
+ compileProgress: string;
43
+ preview: string;
44
+ upload: string;
45
+ versionInfo: string;
46
+ sizeLimit: string;
47
+ unityCompileProgress: string;
48
+ unityPreview: string;
49
+ getChannelNumber: string;
36
50
  };
37
51
  env: {
38
52
  type: 'online' | 'ppe' | 'boe';
@@ -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
  }): {
@@ -2,4 +2,4 @@ export declare const ALLOWED_MICROGAME_EXTS_REG: RegExp;
2
2
  export declare function getWhiteList(isGame?: boolean, options?: {
3
3
  isLivePlugin?: boolean;
4
4
  isMicroappPlugin?: boolean;
5
- }): string[];
5
+ }, projectPath?: string): Promise<string[]>;