tt-minigame-ide-cli 2.0.11 → 2.0.13

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.
@@ -109,6 +109,7 @@ export declare const SLARDAR_EVENT: {
109
109
  readonly IDE_MODULE_CLICK_AUTH_UNREGPOP_DUEQRCODE: "IDE_MODULE_CLICK_AUTH_UNREGPOP_DUEQRCODE";
110
110
  readonly VELA_CHECK_EXIST_PROJECT: "VELA_CHECK_EXIST_PROJECT";
111
111
  readonly VELA_DELETE_PROJECT: "VELA_DELETE_PROJECT";
112
+ readonly VELA_DELETE_PROJECT_FOLDER: "VELA_DELETE_PROJECT_FOLDER";
112
113
  readonly VELA_NEW_PROJECT: "VELA_NEW_PROJECT";
113
114
  readonly VELA_NEW_PROJECT_FAIL: "VELA_NEW_PROJECT_FAIL";
114
115
  readonly VELA_REQUEST_TEMPLATE_LIST: "VELA_REQUEST_TEMPLATE_LIST";
@@ -181,6 +182,19 @@ export declare const SLARDAR_EVENT: {
181
182
  readonly IDE_WEB_CREATE: "IDE_WEB_CREATE";
182
183
  readonly IDE_WEB_LOAD: "IDE_WEB_LOAD";
183
184
  readonly IDE_WEB_DETECT: "IDE_WEB_DETECT";
185
+ readonly IDE_ENABLE_LYNX_DEBUG: "IDE_ENABLE_LYNX_DEBUG";
186
+ readonly IDE_USE_LYNX_SCHEMA: "IDE_USE_LYNX_SCHEMA";
187
+ readonly IDE_LIVE_PLUGIN_NOT_DEV_MODE: "IDE_LIVE_PLUGIN_NOT_DEV_MODE";
188
+ readonly IDE_SHOW_DYCLOUD_MODAL: "IDE_SHOW_DYCLOUD_MODAL";
189
+ readonly IDE_MODULE_POST_MESSAGE_TITLE_CLICK: "IDE_MODULE_POST_MESSAGE_TITLE_CLICK";
190
+ readonly SWITCH_BACKEND_RADIO: "SWITCH_BACKEND_RADIO";
191
+ readonly IDE_MARSCODE_LOGIN_MODAL_SHOW: "IDE_MARSCODE_LOGIN_MODAL_SHOW";
192
+ readonly IDE_MARSCODE_ERROR_MESSAGE_SHOW: "IDE_MARSCODE_ERROR_MESSAGE_SHOW";
193
+ readonly IDE_CLOUD_DEPLOY: "IDE_CLOUD_DEPLOY";
194
+ readonly IDE_CLOUD_PULL: "IDE_CLOUD_PULL";
195
+ readonly IDE_CLOUD_COPY: "IDE_CLOUD_COPY";
196
+ readonly IDE_CLOUD_DEBUG: "IDE_CLOUD_DEBUG";
197
+ readonly IDE_CLOUD_REQUEST: "IDE_CLOUD_REQUEST";
184
198
  readonly IDE_LOADER_IO_ERROR: string;
185
199
  readonly IDE_LOADER_INSTALL_RECOVER_ERROR: string;
186
200
  readonly IDE_LOADER_START_FROM_ENTRY: string;
@@ -224,6 +238,7 @@ export declare const IDE_MODULES: {
224
238
  readonly SIGN_CHECK: "SIGN_CHECK";
225
239
  readonly INTELLIGENCE: "INTELLIGENCE";
226
240
  readonly PROJECT_INSPECTION: "PROJECT_INSPECTION";
241
+ readonly WASM_SPLIT: "WASM_SPLIT";
227
242
  readonly AI: "AI";
228
243
  readonly SHARE_PROJECT: "SHARE_PROJECT";
229
244
  readonly PROJECT_MANAGE: "PROJECT_MANAGE";
@@ -241,6 +256,11 @@ export declare const IDE_MODULES: {
241
256
  readonly SIGN_CHECKER_GUARANTEED_PAYMENT: "SIGN_CHECKER_GUARANTEED_PAYMENT";
242
257
  readonly SIGN_CHECKER_TRADE_SYSTEM: "SIGN_CHECKER_TRADE_SYSTEM";
243
258
  readonly TEST_QRCODE: "TEST_QRCODE";
259
+ readonly LYNX_DEBUG: "LYNX_DEBUG";
260
+ readonly SIMULATOR_HEART_BEAT: "SIMULATOR_HEART_BEAT";
261
+ readonly AI_COMMAND: "AI_COMMAND";
262
+ readonly AI_FAQ: "AI_FAQ";
263
+ readonly PROJECT_TO_QRCODE: "PROJECT_TO_QRCODE";
244
264
  };
245
265
  export declare const IDE_TIMELINE_NAMES: {
246
266
  readonly SIMULATOR_FIRST_LOADING_END: "SIMULATOR_FIRST_LOADING_END";
@@ -263,6 +283,7 @@ export declare const IDE_TIMELINE_NAMES: {
263
283
  readonly SIGN_CHECK: "SIGN_CHECK";
264
284
  readonly INTELLIGENCE: "INTELLIGENCE";
265
285
  readonly PROJECT_INSPECTION: "PROJECT_INSPECTION";
286
+ readonly WASM_SPLIT: "WASM_SPLIT";
266
287
  readonly AI: "AI";
267
288
  readonly SHARE_PROJECT: "SHARE_PROJECT";
268
289
  readonly PROJECT_MANAGE: "PROJECT_MANAGE";
@@ -280,6 +301,11 @@ export declare const IDE_TIMELINE_NAMES: {
280
301
  readonly SIGN_CHECKER_GUARANTEED_PAYMENT: "SIGN_CHECKER_GUARANTEED_PAYMENT";
281
302
  readonly SIGN_CHECKER_TRADE_SYSTEM: "SIGN_CHECKER_TRADE_SYSTEM";
282
303
  readonly TEST_QRCODE: "TEST_QRCODE";
304
+ readonly LYNX_DEBUG: "LYNX_DEBUG";
305
+ readonly SIMULATOR_HEART_BEAT: "SIMULATOR_HEART_BEAT";
306
+ readonly AI_COMMAND: "AI_COMMAND";
307
+ readonly AI_FAQ: "AI_FAQ";
308
+ readonly PROJECT_TO_QRCODE: "PROJECT_TO_QRCODE";
283
309
  };
284
310
  /**
285
311
  * IDE 性能统计 ipc 事件收敛
@@ -18,6 +18,14 @@ export interface IApp extends BaseApp {
18
18
  openDataContext?: string;
19
19
  deviceOrientation?: 'landscape' | 'portrait';
20
20
  menuButtonStyle?: 'light' | 'dark';
21
+ liveCards?: string[];
22
+ /**
23
+ * 小程序插件配置
24
+ */
25
+ plugins?: Record<string, {
26
+ version?: string;
27
+ provider?: string;
28
+ }>;
21
29
  }
22
30
  /**
23
31
  * JSON object wrapper for `app.json`
@@ -26,6 +34,7 @@ export declare class AppJSON extends JSONContainer<IApp> {
26
34
  static from(filepath: string): Promise<AppJSON>;
27
35
  private __isGame;
28
36
  get isGame(): boolean;
37
+ get isLivePlugin(): boolean;
29
38
  /**
30
39
  * Property sugar for {@link IApp.subPackages} or {@link IApp.subpackages}
31
40
  */
@@ -49,6 +49,7 @@ export interface IProjectConfig extends IProject {
49
49
  mockLogin?: boolean;
50
50
  autoPush?: boolean;
51
51
  IDEPreviewHotRestartCache?: boolean;
52
+ IDEPreviewOpenVConsole?: boolean;
52
53
  useCompilerPlugins?: CompilerPlugin[];
53
54
  bigPackageSizeSupport?: boolean;
54
55
  webDetect?: boolean;
@@ -85,12 +86,13 @@ export interface IProjectConfig extends IProject {
85
86
  * 此处的技术类型与 ide 的技术类型有区别
86
87
  * 这里的 TechType 通过项目特征获得,无法识别出小游戏和小玩法
87
88
  *
88
- * IDE 本身的项目技术类型分为 microapp、microgame、toybox
89
- * microapp 属于 app 类型
90
- * microgame、toybox 属于 game 类型
89
+ * IDE 本身的项目技术类型分为 microapp、microgame、plugin
90
+ * microapp、plugin 属于 app 类型
91
+ * microgame 属于 game 类型
92
+ * live-plugin 为直播间互动插件
91
93
  */
92
- declare type TechType = 'app' | 'game' | 'toybox' | 'unity';
93
- declare type IDEAppTechType = 'microapp' | 'toybox' | 'microgame' | 'microapp-minicode' | 'toybox-minicode' | 'microgame-minicode' | 'unity' | '';
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' | '';
94
96
  export declare const PROJECT_TYPE_MAP: Record<string, TechType>;
95
97
  export declare function setIDEAppTechType(type: IDEAppTechType): void;
96
98
  export declare function getIDEAppTechType(): IDEAppTechType;
@@ -136,6 +138,7 @@ export declare class ProjectConfig extends JSONContainer<Partial<IProjectConfig>
136
138
  getPrivateRawJSON(): Partial<IProjectPrivate>;
137
139
  getAppid(): string;
138
140
  getRealAppid(): Promise<string>;
141
+ getRealPluginAppid(): string | null;
139
142
  getSetting(): IProjectConfig['setting'];
140
143
  getProjectName(): string;
141
144
  getScripts(): IProjectConfig['scripts'];
@@ -148,7 +151,11 @@ export declare class ProjectConfig extends JSONContainer<Partial<IProjectConfig>
148
151
  getBeforeCompileScript(): string;
149
152
  getSkipDomainCheck(): boolean;
150
153
  getPreviewHotRestartCache(): boolean;
154
+ getPreviewOpenVConsole(): boolean;
151
155
  getMiniprogramRoot(): string;
156
+ getCloudfunctionRoot(): string;
157
+ getPluginRoot(): string;
158
+ isPluginProject(): boolean;
152
159
  getBigPackageSizeSupport(): boolean;
153
160
  getWebDetect(): boolean;
154
161
  getPreviewPreload(): boolean;
@@ -4,10 +4,17 @@ export declare type InpInfo = {
4
4
  inpt: number;
5
5
  inputDelay: number;
6
6
  processTime: number;
7
+ inputDelayPercent: number;
8
+ processPercent: number;
7
9
  };
8
10
  tags: {
9
11
  outerHTML?: string;
10
12
  type: string;
13
+ stageAfterDelay?: string;
14
+ stageBeforeDelay?: string;
15
+ eventBeforeDelay?: string;
16
+ eventInDelay?: string;
17
+ matchedLongtask?: string;
11
18
  };
12
19
  };
13
20
  export declare type InpReporter = (inpInfo: InpInfo, stop: () => void) => void;
@@ -0,0 +1,47 @@
1
+ declare type LongTaskExecutedInfo = {
2
+ id: string;
3
+ tag: string;
4
+ start: number;
5
+ end?: number;
6
+ duration?: number;
7
+ };
8
+ declare enum MaybeLongTask {
9
+ jsAnalyzeCode = "jsAnalyzeCode",
10
+ importTS = "importTS",
11
+ registerFileChange = "registerFileChange",
12
+ ttmlAnalyzeCode = "ttmlAnalyzeCode",
13
+ _updateButtonSelected = "_updateButtonSelected",
14
+ handleSelectedStatus = "handleSelectedStatus",
15
+ getProcessUsage = "getProcessUsage",
16
+ flushNetworkCdpMsgAndDisconnect = "flushNetworkCdpMsgAndDisconnect"
17
+ }
18
+ export declare const markUnNameLongtask: (task: Omit<LongTaskExecutedInfo, 'id'>) => void;
19
+ export declare const markMaybeLongTask: (tag: keyof typeof MaybeLongTask, of: 'start' | 'end') => LongTaskExecutedInfo;
20
+ export declare const markStage: (scope: 'init' | string, stage: string) => void;
21
+ export declare const markSlardarEventAsStage: (event: string, category: Record<string, string>) => void;
22
+ /**
23
+ * 对 slardar 发送的事件进行收集,在上报 inp 的时候选择有交集的事件进行关联
24
+ * 关联的定义: INP 的 start 时间点前的 2 个事件
25
+ */
26
+ export declare const markEvent: (eventName: string, category: Record<string, string>) => void;
27
+ /**
28
+ * 意图是通过 inp 事件的触发时间,寻找与其相关的事件,用于后续归类优化
29
+ * - stage 的概念: 几个目前比较怀疑会导致 INP 的行为: 1. 启动期间 2. 编译期间 3. 预览期间。这些通过 stage 来抽象,复用 slardar 中相关的上报事件,记录事件序列,
30
+ * 然后通过 inp 的 inpDelayStartAt 找所在的事件区间
31
+ * - event 的概念, 与用户行为进行关联,将 slardar 的事件上报用栈进行存储,然后在发生 inp 的时候,根据inpDelayStartAt查找之前发生的 3 个事件进行关联上报
32
+ * @param inpDelayStartAt
33
+ * @param inpDelayEndAt
34
+ * @returns
35
+ */
36
+ export declare const getINPRelativeInformation: (inpDelayStartAt: number, inpDelayEndAt: number, inpt: number) => {
37
+ stage: {
38
+ left?: string;
39
+ right?: string;
40
+ };
41
+ matchedEvent: {
42
+ in: string[];
43
+ before: any[];
44
+ };
45
+ matchedLongtask: string;
46
+ };
47
+ export {};
@@ -89,7 +89,7 @@ export declare const PROCESS_TYPE: {
89
89
  export declare type ProcessType = keyof typeof PROCESS_TYPE;
90
90
  export declare const startTime: number;
91
91
  export declare const skipReport: boolean;
92
- export declare type TechType = 'microapp' | 'microgame' | 'toybox' | 'microapp-minicode' | 'microgame-minicode' | 'toybox-minicode';
92
+ export declare type TechType = 'microapp' | 'microgame' | 'liveplugin' | 'microapp-minicode' | 'microgame-minicode' | 'liveplugin-minicode' | 'microapp-plugin' | 'microapp-plugin-minicode';
93
93
  export interface PerfConfigSettings {
94
94
  disabled: boolean;
95
95
  fps: {
@@ -119,5 +119,7 @@ export interface PerfConfigSettings {
119
119
  ideUsageCollectInterval: number;
120
120
  disabledJsonWorker: boolean;
121
121
  largeJsonLimit?: number;
122
+ lowMemoryLimit?: number;
123
+ lowPerformanceCpus?: string[];
122
124
  }
123
125
  export declare const defaultPerfConfigSettings: PerfConfigSettings;
@@ -4,4 +4,5 @@ export declare function createProject(options: {
4
4
  template: 'rich' | 'empty';
5
5
  type?: 'js' | 'ts';
6
6
  targetDir?: string;
7
+ plugin?: boolean;
7
8
  }): Promise<void>;
@@ -2,14 +2,17 @@ export declare function loginByEmail(options: {
2
2
  email: string;
3
3
  password: string;
4
4
  dontSaveCookie?: boolean;
5
+ partner?: boolean;
5
6
  }): Promise<any>;
6
7
  export declare function sendVerificationCodeToPhone(options: {
7
8
  phoneNumber: string;
9
+ partner?: boolean;
8
10
  }): Promise<void>;
9
11
  export declare function loginByPhone(options: {
10
12
  phoneNumber: string;
11
13
  code: string;
12
14
  dontSaveCookie?: boolean;
15
+ partner?: boolean;
13
16
  }): Promise<any>;
14
17
  export declare function checkSession(): Promise<{
15
18
  isValid: boolean;
@@ -17,7 +17,7 @@ export declare function isRealToyId(appid: string): Promise<boolean>;
17
17
  * @param option
18
18
  */
19
19
  export declare function fetchMeta({ appid, isGame }: MetaOption): Promise<any>;
20
- export declare function getAppVersions(appId: string): Promise<{
20
+ export declare function getAppVersions(appId: string, isPlugin?: boolean): Promise<{
21
21
  audit_version: string;
22
22
  }>;
23
23
  export {};
@@ -34,6 +34,7 @@ export declare type UploadOption = Pick<ProjectToQRCodeOption, 'project' | 'qrco
34
34
  changeLog: string;
35
35
  needUploadSourcemap?: boolean;
36
36
  extraCheckInfoJson?: string;
37
+ channel?: string;
37
38
  };
38
39
  /**
39
40
  * 发布上传(功能入口)
@@ -58,6 +59,7 @@ export declare type ProjectToQRCodeOption = {
58
59
  changeLog: string;
59
60
  needUploadSourcemap: boolean;
60
61
  extraCheckInfoJson?: string;
62
+ channel?: string;
61
63
  };
62
64
  extraInfoJson?: string;
63
65
  localCompileVersion?: string;
@@ -81,4 +83,8 @@ export declare type ProjectToQRCodeOption = {
81
83
  isNewPlatform?: (value: boolean) => void;
82
84
  };
83
85
  export declare function projectToQRCode(options: ProjectToQRCodeOption): Promise<ProjectQRCode>;
86
+ export declare function getChannelLimit(appid: string): Promise<{
87
+ limit_num: number;
88
+ } | null>;
89
+ export declare function checkChannel(appid: string, channel: string): Promise<void>;
84
90
  export {};
@@ -32,8 +32,9 @@ declare type UploadProps = {
32
32
  version: string;
33
33
  publishDesc?: string;
34
34
  ideUid?: number;
35
+ channel?: string;
35
36
  };
36
- declare type QueryProgressProps = Pick<UploadProps, 'projectPath' | 'version' | 'ideUid'> & {
37
+ declare type QueryProgressProps = Pick<UploadProps, 'projectPath' | 'version' | 'ideUid' | 'channel'> & {
37
38
  updateStatus?: (status: number | string) => void;
38
39
  };
39
40
  declare type CompileMode = {
@@ -62,19 +63,14 @@ export declare const unityCli: {
62
63
  ctime: string;
63
64
  version: string;
64
65
  }>;
65
- testQrcode: ({ projectPath, ideUid }: {
66
- projectPath: string;
67
- ideUid?: number;
68
- }) => Promise<string>;
69
- upload: ({ projectPath, version, publishDesc, ideUid }: UploadProps) => Promise<{
66
+ upload: ({ projectPath, version, publishDesc, ideUid, channel }: UploadProps) => Promise<{
70
67
  code: number;
71
68
  message: string;
72
69
  }>;
73
- queryProgress: ({ projectPath, version, updateStatus, ideUid }: QueryProgressProps) => Promise<void>;
74
- uploadAndQueryProgress: ({ projectPath, version, publishDesc, updateStatus, ideUid }: UploadProps & QueryProgressProps) => Promise<void>;
70
+ queryProgress: ({ projectPath, version, updateStatus, ideUid, channel }: QueryProgressProps) => Promise<boolean>;
71
+ uploadAndQueryProgress: ({ projectPath, version, publishDesc, updateStatus, ideUid, channel }: UploadProps & QueryProgressProps) => Promise<boolean>;
75
72
  validateFiles: (unityConfig: UnityConfigType) => Promise<void>;
76
73
  validateAppId: (appid: string) => Promise<boolean>;
77
- validateVersion: (latestVersion: string, version: string) => boolean;
78
74
  PROGRESS: {
79
75
  0: string;
80
76
  1: string;
@@ -103,17 +99,32 @@ export declare const unityCli: {
103
99
  defaultText: string;
104
100
  };
105
101
  isUnity: (projectPath: string) => Promise<boolean>;
106
- unityUpload: (options: UploadProps & Pick<UploadProps, "projectPath" | "version" | "ideUid"> & {
102
+ unityUpload: (options: UploadProps & Pick<UploadProps, "projectPath" | "channel" | "version" | "ideUid"> & {
107
103
  updateStatus?: (status: number | string) => void;
108
104
  } & {
109
105
  publishType?: UnityConfigType['publishType'];
110
106
  deviceOrientation?: UnityGameJson['deviceOrientation'];
111
107
  output?: string;
112
- }) => Promise<void>;
113
- preview: ({ projectPath, ideUid, compileMode, }: {
108
+ channel?: string;
109
+ bgColor?: string;
110
+ }) => Promise<{
111
+ short_url: string;
112
+ origin_schema: string;
113
+ expire_time: number;
114
+ }>;
115
+ preview: ({ projectPath, ideUid, compileMode, customOptions, }: {
114
116
  projectPath: string;
115
117
  ideUid?: string;
116
118
  compileMode: CompileMode;
119
+ customOptions?: {
120
+ publishType?: PUBLISH_TYPE;
121
+ webGLSource?: string;
122
+ debug?: {
123
+ phoneRoomServiceUrl: string;
124
+ session?: string;
125
+ };
126
+ isPerformanceTest?: boolean;
127
+ };
117
128
  }) => Promise<{
118
129
  code: number;
119
130
  data: {
@@ -123,13 +134,22 @@ export declare const unityCli: {
123
134
  };
124
135
  msg: string;
125
136
  }>;
126
- makeSchema: ({ appId, ideConfig, ctime, scene, query, bdpLog, }: {
137
+ makeSchema: ({ appId, ideConfig, ctime, scene, query, bdpLog, version, channel, debug, }: {
127
138
  appId: string;
128
139
  ideConfig: any;
129
- ctime: number;
140
+ ctime?: number;
130
141
  scene?: string;
131
142
  query?: string;
132
143
  bdpLog?: string;
144
+ version?: string;
145
+ channel?: string;
146
+ debug?: {
147
+ query: {
148
+ gtoken: string;
149
+ roomid: string;
150
+ session: string;
151
+ };
152
+ };
133
153
  }) => Promise<{
134
154
  code: number;
135
155
  data: {
@@ -148,5 +168,7 @@ export declare const unityCli: {
148
168
  origin_schema: string;
149
169
  expire_time: number;
150
170
  }>;
171
+ validatePreviewFiles: (unityConfig: UnityConfigType) => Promise<void>;
172
+ uploadAndQueryProgressThroughPlatform: ({ projectPath, version, publishDesc, updateStatus, ideUid, channel }: UploadProps & QueryProgressProps) => Promise<boolean>;
151
173
  };
152
174
  export {};
@@ -1,5 +1,5 @@
1
1
  export default function openProject(options: {
2
2
  projectPath: string;
3
3
  mode?: 'full' | 'lite';
4
- type: 'microapp' | 'microgame' | 'toybox';
4
+ type: 'microapp' | 'microgame';
5
5
  }, remotePort?: number): Promise<void>;
@@ -18,14 +18,16 @@ import fg from 'fast-glob';
18
18
  * @param {IProjectConfig['packOptions']} params.packOptions - 打包配置选项
19
19
  * @returns {Promise<number>} - 返回包含文件夹大小的Promise
20
20
  */
21
- export declare function getFolderSize({ folderPath, useTypeScript, options, isGame, gameFiles, rootPath, packOptions, }: {
21
+ export declare function getFolderSize({ folderPath, useTypeScript, options, isGame, isLivePlugin, gameFiles, rootPath, packOptions, projectConfig, }: {
22
22
  folderPath: string;
23
23
  useTypeScript: boolean;
24
24
  options?: fg.Options;
25
25
  isGame: boolean;
26
+ isLivePlugin?: boolean;
26
27
  gameFiles?: string[];
27
28
  rootPath: string;
28
29
  packOptions: IProjectConfig['packOptions'];
30
+ projectConfig: ProjectConfig;
29
31
  }): Promise<number>;
30
32
  /**
31
33
  * 以文件夹为单位的包体积统计,不适用于依赖分析
@@ -50,7 +52,9 @@ declare type FolderToZipStreamOption = {
50
52
  *
51
53
  * @param dir path to folder
52
54
  */
53
- export declare function folderToZipStream(dir: string, { whiteList, useTypeScript }: FolderToZipStreamOption, isGame: boolean, highWaterMark?: number): Promise<archiver.Archiver>;
55
+ export declare function folderToZipStream(dir: string, { whiteList, useTypeScript }: FolderToZipStreamOption, isGame: boolean, highWaterMark?: number, options?: {
56
+ isLivePlugin?: boolean;
57
+ }): Promise<archiver.Archiver>;
54
58
  /**
55
59
  * For cli only
56
60
  * @param input
@@ -3,6 +3,7 @@ import { ServerSize } from '@byted/miniprogram-utils/typings/project';
3
3
  import { ProjectInfo, QrcodeInfo } from '../types';
4
4
  import { IMetrics } from '../utils/metrics';
5
5
  import { IDEConfig, MakeSchemaOption } from '../utils/qrcode';
6
+ export declare type PreviewMode = 'plugin' | 'normal';
6
7
  export declare type ProjectQRCode = {
7
8
  expireTime: number;
8
9
  shortUrl: string;
@@ -25,7 +26,7 @@ declare type CompileProgressResult = {
25
26
  } & Record<string, any>;
26
27
  };
27
28
  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' | 'lynxPackages' | 'useLocalSchema'>;
29
+ declare type PreviewOption = Pick<ProjectToQRCodeOption, 'project' | 'page' | 'qrcode' | 'cache' | 'copyToClipboard' | 'extraInfoJson' | 'localCompileVersion' | 'ideConfig' | 'interactGame' | 'penetrateMapJson' | 'lynxPackages' | 'useLocalSchema' | 'previewPluginMode'>;
29
30
  /**
30
31
  * 预览上传(功能入口)
31
32
  * @param options
@@ -39,6 +40,7 @@ export declare type UploadOption = Pick<ProjectToQRCodeOption, 'project' | 'qrco
39
40
  needUploadCheck?: boolean;
40
41
  extraCheckInfoJson?: string;
41
42
  channel?: string;
43
+ minJssdk?: string;
42
44
  };
43
45
  /**
44
46
  * 发布上传(功能入口)
@@ -65,9 +67,11 @@ export declare type ProjectToQRCodeOption = {
65
67
  needUploadCheck: boolean;
66
68
  extraCheckInfoJson?: string;
67
69
  channel?: string;
70
+ minJssdk?: string;
68
71
  };
69
72
  extraInfoJson?: string;
70
73
  localCompileVersion?: string;
74
+ previewPluginMode?: PreviewMode;
71
75
  ideConfig?: IDEConfig;
72
76
  debug?: {
73
77
  query: {
@@ -32,6 +32,7 @@ export interface TMACliConfig {
32
32
  sizeLimit: string;
33
33
  unityCompileProgress: string;
34
34
  unityPreview: string;
35
+ getChannelNumber: string;
35
36
  };
36
37
  env: {
37
38
  type: 'online' | 'ppe' | 'boe';
@@ -42,6 +43,7 @@ export interface TMACliConfig {
42
43
  export interface QrcodeInfo {
43
44
  format: 'imageFile' | 'terminal' | 'imageSVG' | 'plain' | null;
44
45
  output?: string;
46
+ bgColor?: string;
45
47
  options?: {
46
48
  small?: boolean;
47
49
  };
@@ -1,3 +1,4 @@
1
1
  export declare const IDE_SCHEMA = "bytedanceide:";
2
2
  export declare const TEMPLATE_DOWNLOAD_URL = "https://sf1-cdn-tos.douyinstatic.com/obj/microapp/frontend/ide/template/tma-demo-master.zip";
3
3
  export declare const TS_TEMPLATE_DOWNLOAD_URL = "https://sf1-cdn-tos.douyinstatic.com/obj/microapp/frontend/ide/template/tma-demo-master-ts.zip";
4
+ export declare const TEMPLATE_PLUGIN_DOWNLOAD_URL = "https://sf1-cdn-tos.douyinstatic.com/obj/microapp/frontend/ide/template/microapp-plugin-template-js.zip";
@@ -1,10 +1,11 @@
1
+ import { getWhiteList } from './white-list';
1
2
  /**
2
3
  *
3
4
  * @param dir path to microapp project
4
5
  * @param timeout 预留给worker进程hash逻辑使用参数
5
6
  * @returns
6
7
  */
7
- export declare let getProjectHash: (dir: string, isGame: boolean, timeout?: number) => Promise<string>;
8
+ export declare let getProjectHash: (dir: string, isGame: boolean, timeout?: number, options?: Parameters<typeof getWhiteList>[1]) => Promise<string>;
8
9
  /**
9
10
  * IDE workbench 中调用该函数,最终会在MainHelperWindow中计算hash
10
11
  */
@@ -0,0 +1,14 @@
1
+ declare type ILoginInfo = {
2
+ type: 'mobile' | 'email' | '';
3
+ partner?: boolean;
4
+ };
5
+ declare class LoginCache {
6
+ private _loginInfo;
7
+ constructor();
8
+ private readCache;
9
+ private writeCache;
10
+ getLoginInfo(): ILoginInfo;
11
+ setLoginInfo(obj: Partial<ILoginInfo>): void;
12
+ }
13
+ export declare const loginInfo: LoginCache;
14
+ export {};
@@ -1,4 +1,4 @@
1
- import type { ProjectToQRCodeOption } from '../features/preview';
1
+ import type { PreviewMode, ProjectToQRCodeOption } from '../features/preview';
2
2
  export interface MakeSchemaResult {
3
3
  originSchema: string;
4
4
  shortUrl: string;
@@ -44,6 +44,7 @@ export interface IDEBaseConfig {
44
44
  };
45
45
  extraInfo?: IDEExtraInfo;
46
46
  performanceTest?: boolean;
47
+ openApplicationType?: string;
47
48
  }
48
49
  export interface IDESandboxConfig {
49
50
  isSandbox?: boolean;
@@ -77,10 +78,13 @@ export declare type MakeSchemaOption = {
77
78
  traceMode?: number;
78
79
  uploadOptions?: ProjectToQRCodeOption['uploadOptions'];
79
80
  lynxSchema?: string;
81
+ shelledTechType?: number;
82
+ pluginAppid?: string;
83
+ previewPluginMode?: PreviewMode;
80
84
  };
81
85
  export declare function makeSchema(options: MakeSchemaOption): Promise<MakeSchemaResult>;
82
86
  export declare function toQRCodeSVG(str: string): Promise<string>;
83
- export declare function toQRCodeFile(text: string, filePath: string): Promise<string>;
87
+ export declare function toQRCodeFile(text: string, filePath: string, bgColor?: string): Promise<string>;
84
88
  export declare function generateTerminalQrCode(url: string, options: {
85
89
  small?: boolean;
86
90
  copy?: boolean;
@@ -1,15 +1,18 @@
1
1
  /// <reference types="node" />
2
2
  import { ProjectConfig } from '@byted/miniprogram-utils/dist/data/project';
3
3
  import archiver from 'archiver';
4
+ import { loginInfo } from './login-storage';
4
5
  import { Transform } from 'stream';
6
+ export { loginInfo };
5
7
  export declare const HIGH_WATER_MARK: number;
8
+ export declare function getHighWaterMarkByTotalMem(): number;
6
9
  export declare function isMac(): boolean;
7
10
  export declare function isCli(): boolean;
8
11
  export declare function isMiniGameCli(): boolean;
9
12
  export declare function isIDE(): boolean;
10
13
  export declare const maxConcurrency: () => number;
11
14
  export declare function cleanArgs(cmd: any): any;
12
- export declare function createProjectConfigFile(projectName: string, projectDir: string, useTypeScript?: boolean): Promise<void>;
15
+ export declare function createProjectConfigFile(projectName: string, projectDir: string, useTypeScript?: boolean, isPlugin?: boolean): Promise<void>;
13
16
  export declare function getPackageRoot(): string;
14
17
  /**
15
18
  * Will throw {@link Error} if invalid
@@ -57,3 +60,4 @@ export declare const getNextVersion: (version: string) => string;
57
60
  export declare const isGameFileValid: (pattern: string) => boolean;
58
61
  export declare const isObject: (value: any) => boolean;
59
62
  export declare function sleep(timer: number): Promise<unknown>;
63
+ export declare function verifyLoginTypeAuth(projectPath: string): Promise<void>;
@@ -1,2 +1,5 @@
1
1
  export declare const ALLOWED_MICROGAME_EXTS_REG: RegExp;
2
- export declare function getWhiteList(isGame?: boolean): string[];
2
+ export declare function getWhiteList(isGame?: boolean, options?: {
3
+ isLivePlugin?: boolean;
4
+ isMicroappPlugin?: boolean;
5
+ }): string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tt-minigame-ide-cli",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
4
4
  "description": "Command line interface for micro app development",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -50,7 +50,7 @@
50
50
  "@types/qrcode-terminal": "^0.12.0",
51
51
  "@types/unzipper": "^0.10.4",
52
52
  "@types/webpack-merge": "4.1.5",
53
- "clean-webpack-plugin": "3.0.0",
53
+ "clean-webpack-plugin": "4.0.0",
54
54
  "cross-env": "^7.0.3",
55
55
  "jest": "^26.6.3",
56
56
  "patch-package": "^6.4.7",