tt-minigame-ide-cli 2.0.8-beta.0 → 2.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -130,6 +130,7 @@ export declare const SLARDAR_EVENT: {
130
130
  readonly IDE_MODULE_AUTH_FORCE_LOGOUT: "IDE_MODULE_AUTH_FORCE_LOGOUT";
131
131
  readonly IDE_CANVAS_WEBGL_CONTEXT_ENABLE: "IDE_CANVAS_WEBGL_CONTEXT_ENABLE";
132
132
  readonly IDE_LOGIN_DATA_FORMAT: "IDE_LOGIN_DATA_FORMAT";
133
+ readonly IDE_IS_ENCRYPTION_AVAILABLE: "IDE_IS_ENCRYPTION_AVAILABLE";
133
134
  readonly IDE_ADD_COMPILE_MODE: "IDE_ADD_COMPILE_MODE";
134
135
  readonly IDE_DECODE_QRCODE: "IDE_DECODE_QRCODE";
135
136
  readonly IDE_DECODE_URL: "IDE_DECODE_URL";
@@ -163,6 +164,12 @@ export declare const SLARDAR_EVENT: {
163
164
  readonly IDE_EXCEPTION_RECORD: "IDE_EXCEPTION_RECORD";
164
165
  readonly IDE_PROXY_ERROR_TRACE: "IDE_PROXY_ERROR_TRACE";
165
166
  readonly IDE_EDITOR_RESOLVE_SNIPPET: "IDE_EDITOR_RESOLVE_SNIPPET";
167
+ readonly IDE_EDITOR_SNIPPET_CREATION: "IDE_EDITOR_SNIPPET_CREATION";
168
+ readonly IDE_EDITOR_REFERENCE: "IDE_EDITOR_REFERENCE";
169
+ readonly IDE_EDITOR_COMPLETION_SHOW: "IDE_EDITOR_COMPLETION_SHOW";
170
+ readonly IDE_MAIN_HELPER_FORK: "IDE_MAIN_HELPER_FORK";
171
+ readonly IDE_MAIN_HELPER_SPAWN: "IDE_MAIN_HELPER_SPAWN";
172
+ readonly IDE_MAIN_HELPER_READY: "IDE_MAIN_HELPER_READY";
166
173
  readonly IDE_LOADER_IO_ERROR: string;
167
174
  readonly IDE_LOADER_INSTALL_RECOVER_ERROR: string;
168
175
  readonly IDE_LOADER_START_FROM_ENTRY: string;
@@ -17,6 +17,7 @@ export interface IApp extends BaseApp {
17
17
  };
18
18
  openDataContext?: string;
19
19
  deviceOrientation?: 'landscape' | 'portrait';
20
+ menuButtonStyle?: 'light' | 'dark';
20
21
  }
21
22
  /**
22
23
  * JSON object wrapper for `app.json`
@@ -57,6 +57,21 @@ export interface IProjectConfig extends IProject {
57
57
  game?: ConditionData;
58
58
  };
59
59
  douyinProjectType?: string;
60
+ unity?: {
61
+ build: {
62
+ webgl: string;
63
+ native: {
64
+ il2cpp: string;
65
+ apk: string;
66
+ };
67
+ instantGame: string;
68
+ };
69
+ publishType: '0' | '1' | '2' | '3' | '4' | '5';
70
+ starkSdkVersion: string;
71
+ unityToolsVersion: string;
72
+ unityEngineVersion: string;
73
+ arch: string;
74
+ };
60
75
  }
61
76
  /**
62
77
  * 此处的技术类型与 ide 的技术类型有区别
@@ -66,8 +81,8 @@ export interface IProjectConfig extends IProject {
66
81
  * microapp 属于 app 类型
67
82
  * microgame、toybox 属于 game 类型
68
83
  */
69
- declare type TechType = 'app' | 'game' | 'toybox';
70
- declare type IDEAppTechType = 'microapp' | 'toybox' | 'microgame' | 'microapp-minicode' | 'toybox-minicode' | 'microgame-minicode' | '';
84
+ declare type TechType = 'app' | 'game' | 'toybox' | 'unity';
85
+ declare type IDEAppTechType = 'microapp' | 'toybox' | 'microgame' | 'microapp-minicode' | 'toybox-minicode' | 'microgame-minicode' | 'unity' | '';
71
86
  export declare const PROJECT_TYPE_MAP: Record<string, TechType>;
72
87
  export declare function setIDEAppTechType(type: IDEAppTechType): void;
73
88
  export declare function getIDEAppTechType(): IDEAppTechType;
@@ -0,0 +1,126 @@
1
+ import { ElectronCommandClient } from '@slardar/electron';
2
+ import { BrowserCommandClient } from '@slardar/web';
3
+ export declare function getCPUModel(): string;
4
+ export declare function getSystemMemory(): string;
5
+ export declare type SlardarClient = ElectronCommandClient | BrowserCommandClient;
6
+ export declare const BID = "electron_12345";
7
+ export interface ICommonParams {
8
+ userId?: string;
9
+ username?: string;
10
+ ideVersion: string;
11
+ deviceId: string;
12
+ osPlatform: string;
13
+ osVersion: string;
14
+ techType?: string;
15
+ ideVersionNumber?: number;
16
+ env?: string;
17
+ branch?: string;
18
+ buildId?: string;
19
+ cliName?: string;
20
+ isSandbox?: string;
21
+ frameworkType?: string;
22
+ workbenchMode?: string;
23
+ }
24
+ export declare function commonParams2Context(commonParams: ICommonParams, globalDevAppId?: string, globalTechType?: string, globalExtAppId?: string): {
25
+ user_id: string;
26
+ name: string;
27
+ device_id: string;
28
+ ide_version: string;
29
+ os_version: string;
30
+ os_platform: string;
31
+ dev_app_id: string;
32
+ ext_app_id: string;
33
+ tech_type: string;
34
+ ide_version_number: string;
35
+ ide_env: string;
36
+ branch: string;
37
+ build_id: string;
38
+ buildId: string;
39
+ arch: NodeJS.Architecture;
40
+ ide_version_int: number;
41
+ is_sandbox: string;
42
+ frameworkType: string;
43
+ workbench_mode: string;
44
+ e2e_scene: string;
45
+ cpu_model: string;
46
+ system_memory: string;
47
+ };
48
+ export declare function getHref(): string;
49
+ /**
50
+ * 去除差异性安装路径,保持 dist 之后的内容
51
+ */
52
+ export declare function getPathname(): string;
53
+ /**
54
+ * 存放打点需要在内存中缓存的数据及操作方法
55
+ */
56
+ export interface IModuleUseInfo {
57
+ count: number;
58
+ triggerNum: number;
59
+ startTime?: number;
60
+ endTime?: number;
61
+ }
62
+ export interface IModuleCacheMap {
63
+ click: {
64
+ [key: string]: IModuleUseInfo;
65
+ };
66
+ call: {
67
+ [key: string]: IModuleUseInfo;
68
+ };
69
+ }
70
+ export interface ITimelinelog {
71
+ name: string;
72
+ step: number;
73
+ timestamp: number;
74
+ }
75
+ export interface ITimeline {
76
+ moduleName: string;
77
+ logs: ITimelinelog[];
78
+ startTime: number;
79
+ currentStep: number;
80
+ endTime?: number;
81
+ }
82
+ export declare type PointEventType = 'click' | 'call';
83
+ export declare const moduleEventCacheMap: IModuleCacheMap;
84
+ export declare const timelineMap: Map<string, ITimeline>;
85
+ export declare function setModuleUseCache(eventType: PointEventType, moduleName: string, value: IModuleUseInfo): void;
86
+ export declare function getModuleUseCache(eventType: PointEventType, moduleName: string): IModuleUseInfo;
87
+ export declare function compareCacheTriggerCount(eventType: PointEventType, moduleName: string, triggerCount: number, triggerDuration?: number, nowTime?: number): boolean;
88
+ export declare const PROCESS_TYPE: {
89
+ readonly main: "main";
90
+ readonly renderer: "renderer";
91
+ };
92
+ export declare type ProcessType = keyof typeof PROCESS_TYPE;
93
+ export declare const startTime: number;
94
+ export declare const skipReport: boolean;
95
+ export declare type TechType = 'microapp' | 'microgame' | 'toybox' | 'microapp-minicode' | 'microgame-minicode' | 'toybox-minicode';
96
+ export interface PerfConfigSettings {
97
+ disabled: boolean;
98
+ fps: {
99
+ below: number;
100
+ belowCount: number;
101
+ maxReporterCount: number;
102
+ };
103
+ interval: {
104
+ duration: number;
105
+ blockFactor: number;
106
+ reportThreshold: number;
107
+ longTaskDuration: number;
108
+ longTaskDurationMain: number;
109
+ maxReporterCount: number;
110
+ preventLongTaskReportEVDuration?: number;
111
+ preventLongTaskReportEvents?: string[];
112
+ };
113
+ memory: {
114
+ freePercent: number;
115
+ free: number;
116
+ duration: number;
117
+ maxReporterCount: number;
118
+ winUsePowershell: boolean;
119
+ };
120
+ disabledHref: string[];
121
+ disabledMain: boolean;
122
+ ideUsageCollectInterval: number;
123
+ disabledJsonWorker: boolean;
124
+ largeJsonLimit?: number;
125
+ }
126
+ export declare const defaultPerfConfigSettings: PerfConfigSettings;
@@ -1,3 +1,10 @@
1
+ export declare function registerDevLogger(logger: CallableFunction): void;
2
+ export declare type TeaEvent = {
3
+ event: string;
4
+ params: string;
5
+ time?: number;
6
+ };
7
+ export declare function makeEvent(event: string, params: unknown, timestamp?: number): TeaEvent;
1
8
  export interface ICommonParams {
2
9
  userId?: string;
3
10
  username?: string;
@@ -14,4 +21,11 @@ export interface ICommonParams {
14
21
  }
15
22
  export declare function reportTea(event: string, commonParams: ICommonParams, params?: {
16
23
  [k: string]: string | number | boolean;
17
- }): void;
24
+ }, timestamp?: number): void;
25
+ export declare function clearTeaEvents(): void;
26
+ export declare function reportTeaImmediately(commonParams: ICommonParams, eventsSets: Array<{
27
+ event: string;
28
+ params: {
29
+ [k: string]: string | number | boolean;
30
+ };
31
+ }>): void;
@@ -5,4 +5,5 @@ export declare function audit(options: {
5
5
  appid: string;
6
6
  host: string[];
7
7
  autoPublish: boolean;
8
+ channel?: string;
8
9
  }): Promise<void>;
@@ -29,10 +29,11 @@ export declare type PreviewOption = Pick<ProjectToQRCodeOption, 'project' | 'pag
29
29
  * @returns
30
30
  */
31
31
  export declare function preview(options: PreviewOption): Promise<ProjectQRCode>;
32
- export declare type UploadOption = Pick<ProjectToQRCodeOption, 'project' | 'qrcode' | 'copyToClipboard' | 'extraInfoJson' | 'localCompileVersion' | 'ideConfig'> & {
32
+ export declare type UploadOption = Pick<ProjectToQRCodeOption, 'project' | 'qrcode' | 'copyToClipboard' | 'extraInfoJson' | 'localCompileVersion' | 'ideConfig' | 'updateStatus' | 'setCheckResult' | 'isNewPlatform'> & {
33
33
  version: string;
34
34
  changeLog: string;
35
35
  needUploadSourcemap?: boolean;
36
+ extraCheckInfoJson?: string;
36
37
  };
37
38
  /**
38
39
  * 发布上传(功能入口)
@@ -56,6 +57,7 @@ export declare type ProjectToQRCodeOption = {
56
57
  version: string;
57
58
  changeLog: string;
58
59
  needUploadSourcemap: boolean;
60
+ extraCheckInfoJson?: string;
59
61
  };
60
62
  extraInfoJson?: string;
61
63
  localCompileVersion?: string;
@@ -70,6 +72,13 @@ export declare type ProjectToQRCodeOption = {
70
72
  uploadCache?: boolean;
71
73
  supportSourcemap?: boolean;
72
74
  enableHotRestartCache?: boolean;
75
+ updateStatus?: (status: {
76
+ upload: number;
77
+ check: number;
78
+ compile: number;
79
+ }) => any;
80
+ setCheckResult?: (result: any) => any;
81
+ isNewPlatform?: (value: boolean) => void;
73
82
  };
74
83
  export declare function projectToQRCode(options: ProjectToQRCodeOption): Promise<ProjectQRCode>;
75
84
  export {};
@@ -1,3 +1,4 @@
1
1
  export * from './cloud-compile';
2
2
  export * from './utils/package';
3
3
  export * from './meta';
4
+ export * from './unity';
@@ -1 +1,2 @@
1
1
  export declare const getMeta: (appId: string) => Promise<any>;
2
+ export declare const getMicroappInfo: (appId: string) => Promise<number | null>;
@@ -0,0 +1,99 @@
1
+ declare type UnityConfigType = {
2
+ appid: string;
3
+ build: {
4
+ webgl: string;
5
+ native: {
6
+ il2cpp: string;
7
+ apk: string;
8
+ };
9
+ instantGame: string;
10
+ };
11
+ publishType: '0' | '1' | '2' | '3' | '4' | '5';
12
+ starkSdkVersion: string;
13
+ unityToolsVersion: string;
14
+ unityEngineVersion: string;
15
+ arch: string;
16
+ };
17
+ declare type UnityGameJson = {
18
+ deviceOrientation: 'portrait' | 'landscape';
19
+ menuButtonStyle: 'light' | 'dark';
20
+ };
21
+ declare type UploadProps = {
22
+ projectPath: string;
23
+ version: string;
24
+ publishDesc?: string;
25
+ ideUid?: number;
26
+ };
27
+ declare type QueryProgressProps = Pick<UploadProps, 'projectPath' | 'version' | 'ideUid'> & {
28
+ updateStatus?: (status: number | string) => void;
29
+ };
30
+ export declare const unityCli: {
31
+ getVersions: ({ projectPath, ideUid }: {
32
+ projectPath: string;
33
+ ideUid?: number;
34
+ }) => Promise<{
35
+ latest: {
36
+ ctime: string;
37
+ version: string;
38
+ };
39
+ current: {
40
+ ctime: string;
41
+ version: string;
42
+ };
43
+ }>;
44
+ getLatestVersion: ({ projectPath, ideUid }: {
45
+ projectPath: string;
46
+ ideUid?: number;
47
+ }) => Promise<{
48
+ ctime: string;
49
+ version: string;
50
+ }>;
51
+ preview: ({ projectPath, ideUid }: {
52
+ projectPath: string;
53
+ ideUid?: number;
54
+ }) => Promise<string>;
55
+ upload: ({ projectPath, version, publishDesc, ideUid }: UploadProps) => Promise<{
56
+ code: number;
57
+ message: string;
58
+ }>;
59
+ queryProgress: ({ projectPath, version, updateStatus, ideUid }: QueryProgressProps) => Promise<void>;
60
+ uploadAndQueryProgress: ({ projectPath, version, publishDesc, updateStatus, ideUid }: UploadProps & QueryProgressProps) => Promise<void>;
61
+ validateFiles: (unityConfig: UnityConfigType) => Promise<void>;
62
+ validateAppId: (appid: string) => Promise<boolean>;
63
+ validateVersion: (latestVersion: string, version: string) => boolean;
64
+ PROGRESS: {
65
+ 0: string;
66
+ 1: string;
67
+ 2: string;
68
+ 3: string;
69
+ 4: string;
70
+ 5: string;
71
+ 6: string;
72
+ 7: string;
73
+ 8: string;
74
+ 9: string;
75
+ 99: string;
76
+ 100: string;
77
+ '-1': string;
78
+ '-2': string;
79
+ '-4': string;
80
+ '-5': string;
81
+ '-6': string;
82
+ '-7': string;
83
+ '-8': string;
84
+ '-9': string;
85
+ '-99': string;
86
+ '-100': string;
87
+ uploadError: string;
88
+ uploadFailed: string;
89
+ defaultText: string;
90
+ };
91
+ isUnity: (projectPath: string) => Promise<boolean>;
92
+ unityUpload: (options: UploadProps & Pick<UploadProps, "projectPath" | "version" | "ideUid"> & {
93
+ updateStatus?: (status: number | string) => void;
94
+ } & {
95
+ publishType?: UnityConfigType['publishType'];
96
+ deviceOrientation?: UnityGameJson['deviceOrientation'];
97
+ }) => Promise<void>;
98
+ };
99
+ export {};
@@ -11,6 +11,7 @@ export declare type ProjectQRCode = {
11
11
  qrcodeFilePath?: string;
12
12
  useCache: boolean;
13
13
  } & Pick<CompileProgressResult, 'metrics' | 'passJson'>;
14
+ export declare function checkChannel(appid: string, channel: string): Promise<void>;
14
15
  declare type CompileProgressResult = {
15
16
  success: boolean;
16
17
  /** error code */
@@ -37,6 +38,7 @@ export declare type UploadOption = Pick<ProjectToQRCodeOption, 'project' | 'qrco
37
38
  needUploadSourcemap?: boolean;
38
39
  needUploadCheck?: boolean;
39
40
  extraCheckInfoJson?: string;
41
+ channel?: string;
40
42
  };
41
43
  /**
42
44
  * 发布上传(功能入口)
@@ -62,6 +64,7 @@ export declare type ProjectToQRCodeOption = {
62
64
  needUploadSourcemap: boolean;
63
65
  needUploadCheck: boolean;
64
66
  extraCheckInfoJson?: string;
67
+ channel?: string;
65
68
  };
66
69
  extraInfoJson?: string;
67
70
  localCompileVersion?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tt-minigame-ide-cli",
3
- "version": "2.0.8-beta.0",
3
+ "version": "2.0.8",
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
+ }