tt-minigame-ide-cli 2.0.17 → 2.1.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.
@@ -207,6 +207,12 @@ export declare const SLARDAR_EVENT: {
207
207
  readonly IDE_AI_AGENT_GENERATE: "IDE_AI_AGENT_GENERATE";
208
208
  readonly IDE_AI_AGENT_DIFF_ACTION: "IDE_AI_AGENT_DIFF_ACTION";
209
209
  readonly IDE_AI_AGENT_GEN_UI: "IDE_AI_AGENT_GEN_UI";
210
+ readonly IDE_AI_AGENT_CONTRIBUTION: "IDE_AI_AGENT_CONTRIBUTION";
211
+ readonly IDE_AI_AGENT_SUMMARY: "IDE_AI_AGENT_SUMMARY";
212
+ readonly IDE_OPERATOR_TIME: "IDE_OPERATOR_TIME";
213
+ readonly IDE_DISK_USAGE: "IDE_DISK_USAGE";
214
+ readonly IDE_DISK_CLEAN_RESULT: "IDE_DISK_CLEAN_RESULT";
215
+ readonly IDE_AI_AGENT_CONTRIBUTION_CONFIG: "IDE_AI_AGENT_CONTRIBUTION_CONFIG";
210
216
  readonly IDE_LOADER_IO_ERROR: string;
211
217
  readonly IDE_LOADER_INSTALL_RECOVER_ERROR: string;
212
218
  readonly IDE_LOADER_START_FROM_ENTRY: string;
@@ -368,6 +374,7 @@ export declare const FRONT_PAGE_EVENT: {
368
374
  VELA_NEW_PROJECT_FAIL: string;
369
375
  VELA_SCHEMA_DOWNLOAD_MINICODE: string;
370
376
  VELA_SCHEMA_DOWNLOAD_MINICODE_FAIL: string;
377
+ IDE_DISK_USAGE: string;
371
378
  };
372
379
  export declare const PROJECT_TECH_TYPE: {
373
380
  PLAYABLE_GAME: number;
@@ -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,7 +26,9 @@ export interface IApp extends BaseApp {
26
26
  version?: string;
27
27
  provider?: string;
28
28
  }>;
29
+ enableIOSHighPerformanceMode?: boolean;
29
30
  enableIOSHighPerformanceModePlus?: boolean;
31
+ useMode?: 'razor';
30
32
  }
31
33
  /**
32
34
  * JSON object wrapper for `app.json`
@@ -65,7 +65,9 @@ export interface IProjectConfig extends IProject {
65
65
  bigPackageSizeSupport?: boolean;
66
66
  webDetect?: boolean;
67
67
  previewPreload?: boolean;
68
+ useRazor?: boolean;
68
69
  };
70
+ useRazor?: boolean;
69
71
  lynx?: {
70
72
  debugSchema?: Record<string, {
71
73
  schema: 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
  /**
@@ -16,3 +16,4 @@ export declare function getFileHash(path: string, fullString?: boolean, algorith
16
16
  export declare function getDirHash(root: string, ignore?: string[], algorithm?: string): Promise<{
17
17
  [file: string]: string;
18
18
  }>;
19
+ export declare const getBufferMd5: (buffer: Buffer) => string;
@@ -29,7 +29,7 @@ export declare type E2ETestSdkInfo = {
29
29
  latestSDKUrl: string;
30
30
  sdkUpdateVersion: string;
31
31
  };
32
- export declare function fetchE2ETestSdk(): Promise<E2ETestSdkInfo | undefined>;
32
+ export declare function fetchE2ETestSdk(tmarVersion?: string): Promise<E2ETestSdkInfo | undefined>;
33
33
  export declare type TimeReporter = {
34
34
  startStep: (step: string) => () => void;
35
35
  finish: () => ({
@@ -37,3 +37,4 @@ export declare type TimeReporter = {
37
37
  });
38
38
  };
39
39
  export declare function createTimeReporter(): TimeReporter;
40
+ export declare function openAppByProtocol(appProtocol: string): Promise<unknown>;
@@ -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 {};
@@ -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';
@@ -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,93 @@
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 { ISubPackage } from '@byted/miniprogram-utils/dist/data/schema/base';
6
+ import { checkAppId, getAppId } from './package';
7
+ /** 不参与体积计算的 glob pattern */
8
+ export declare const PKG_SIZE_IGNORE_GLOBS: string[];
9
+ export declare const getSizeLimitConfig: (appId: string) => Promise<Omit<SizeLimitConfig, "demo">>;
10
+ /**
11
+ * @description: 目前小游戏分包大小有以下限制:
12
+ 整个小游戏所有主包+分包大小不超过 30M
13
+ 主包不超过 4M
14
+ 单个普通分包不限制大小
15
+ * @return {*}
16
+ */
17
+ export declare function verifyPkgSize(devAppid: string, projectPath: string, options?: {
18
+ withNative: boolean;
19
+ isUpload: boolean;
20
+ }): Promise<string>;
21
+ declare type NativeFileName = typeof NATIVE_APK_NAME | typeof NATIVE_FULL_APK_NAME | typeof NATIVE_IL2CPP_NAME;
22
+ declare type GetProjectEntriesReturn = {
23
+ main: string[] | null;
24
+ subPkgs: Array<ISubPackage & {
25
+ entries: string[];
26
+ }> | null;
27
+ openData: string[] | null;
28
+ total: string[];
29
+ native: Partial<{
30
+ [K in NativeFileName]: string;
31
+ }>;
32
+ };
33
+ /**
34
+ * @description: 获取项目下的所有文件
35
+ * @return {*}
36
+ */
37
+ export declare const getProjectEntries: (projectPath: string, ignore?: string[], options?: {
38
+ withNative: boolean;
39
+ isUpload: boolean;
40
+ }) => Promise<GetProjectEntriesReturn>;
41
+ export declare function getProjectSize(projectPath: string, options?: {
42
+ withNative: boolean;
43
+ isUpload: boolean;
44
+ }): Promise<{
45
+ main: number;
46
+ subPkgs: {
47
+ subs: Array<[
48
+ string,
49
+ number
50
+ ]>;
51
+ total: number;
52
+ };
53
+ openData: number;
54
+ total: number;
55
+ native?: {
56
+ il2cpp: number;
57
+ apk: number;
58
+ };
59
+ }>;
60
+ declare type ReturnTypeOfFolderToZipStream = Partial<Record<NativeFileName, Stream>> & {
61
+ zipStream: PassThrough;
62
+ };
63
+ /**
64
+ * @description: 将项目打包为 zip,如果是native,则一起返回native产物
65
+ * @param {string} folderPath
66
+ * @return {ReturnTypeOfFolderToZipStream}
67
+ */
68
+ export declare function folderToZipStream(folderPath: string, options?: {
69
+ withNative: boolean;
70
+ isUpload: boolean;
71
+ }): Promise<ReturnTypeOfFolderToZipStream>;
72
+ /**
73
+ * @description: 压缩文件
74
+ * @return {Buffer | PassThrough}
75
+ */
76
+ export declare const compress: ({ entries, rootPath, }: {
77
+ entries: string[];
78
+ rootPath: string;
79
+ }) => Promise<PassThrough>;
80
+ export { getAppId, checkAppId };
81
+ export declare const validateAppId: (appId: string) => Promise<void>;
82
+ /**
83
+ * @description: for 混合引擎小游戏,计算项目 hash:
84
+ * StreamingAssets下面所有文件均计算
85
+ * native 预览只计算full.apk
86
+ * 除去 native 和StreamingAssets的文件按白名单计算
87
+ * 最后把三个hash拼起来作为最终的hash
88
+ * 目前上传不需要计算hash(上传不做缓存,预览才做)
89
+ * @param {string} projectPath
90
+ * @param {boolean} withNative
91
+ * @return {string}
92
+ */
93
+ export declare const getMixedProjectHash: (projectPath: string, withNative: boolean) => Promise<string>;
@@ -30,6 +30,8 @@ export declare type SizeLimitConfig = {
30
30
  openData: number;
31
31
  /** 试玩游戏最大 MB 数 */
32
32
  demo: number;
33
+ apkSource?: number;
34
+ il2cppSource?: number;
33
35
  };
34
36
  export declare type TmgSdkInfo = {
35
37
  latestSDKUrl: string;
@@ -27,3 +27,4 @@ export * as microgame from './features/microgame';
27
27
  export { getProjectHash, setProjectHashFn } from './utils/hash';
28
28
  export { getProjectToQRCodeStepReporterDesc } from './utils/util';
29
29
  export { PROJECT_TO_QR_CODE_STEP } from './utils/constants';
30
+ export * as mixedGame from './features/microgame/mixed-index';
@@ -33,6 +33,9 @@ export interface TMACliConfig {
33
33
  unityCompileProgress: string;
34
34
  unityPreview: string;
35
35
  getChannelNumber: string;
36
+ uploadMixed: string;
37
+ previewMixed: string;
38
+ compileProgressMixed: string;
36
39
  };
37
40
  playablegameUrl: {
38
41
  makeSchema: string;
@@ -26,6 +26,7 @@ export declare type IDEExtraInfo = {
26
26
  packages_token?: string;
27
27
  is_app_auto_test?: boolean;
28
28
  preload?: '0' | '1';
29
+ enableWebkitDebug?: boolean;
29
30
  };
30
31
  export interface IDEBaseConfig {
31
32
  previewScene: 'live' | 'default';
@@ -82,6 +83,7 @@ export declare type MakeSchemaOption = {
82
83
  pluginAppid?: string;
83
84
  previewPluginMode?: PreviewMode;
84
85
  xScreen?: boolean;
86
+ razorTmarVersion?: string;
85
87
  };
86
88
  export declare function makeSchema(options: MakeSchemaOption): Promise<MakeSchemaResult>;
87
89
  export declare function toQRCodeSVG(str: string): Promise<string>;
@@ -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[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tt-minigame-ide-cli",
3
- "version": "2.0.17",
3
+ "version": "2.1.0",
4
4
  "description": "Command line interface for micro app development",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",