tt-minigame-ide-cli 2.0.7 → 2.0.8-beta.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.
@@ -161,6 +161,8 @@ export declare const SLARDAR_EVENT: {
161
161
  readonly IDE_POWER_EVENT: "IDE_POWER_EVENT";
162
162
  readonly IDE_TASK_PERFORMANCE: "IDE_TASK_PERFORMANCE";
163
163
  readonly IDE_EXCEPTION_RECORD: "IDE_EXCEPTION_RECORD";
164
+ readonly IDE_PROXY_ERROR_TRACE: "IDE_PROXY_ERROR_TRACE";
165
+ readonly IDE_EDITOR_RESOLVE_SNIPPET: "IDE_EDITOR_RESOLVE_SNIPPET";
164
166
  readonly IDE_LOADER_IO_ERROR: string;
165
167
  readonly IDE_LOADER_INSTALL_RECOVER_ERROR: string;
166
168
  readonly IDE_LOADER_START_FROM_ENTRY: string;
@@ -1,4 +1,5 @@
1
1
  import { AxiosInstance as AxiosInstanceType } from 'axios';
2
+ declare function setBoeMap(k: RegExp, v: string): void;
2
3
  interface ISlardarInstance {
3
4
  reportRequestError: (options: {
4
5
  url: string;
@@ -25,4 +26,4 @@ declare const AxiosInstance: AxiosInstanceType;
25
26
  declare function setEnvFunction(fn: GetEnvFunction): void;
26
27
  declare function setSlardarInstance(obj: ISlardarInstance): void;
27
28
  declare function setJestMock<T extends keyof AxiosInstanceType>(mockInstance: object): void;
28
- export { AxiosInstance, defaultEnv, IEnvConfig, GetEnvFunction, setEnvFunction, setSlardarInstance, setJestMock };
29
+ export { AxiosInstance, defaultEnv, IEnvConfig, GetEnvFunction, setEnvFunction, setSlardarInstance, setJestMock, setBoeMap };
@@ -5,6 +5,16 @@
5
5
  export declare const PKG_SIZE_IGNORE_GLOBS: string[];
6
6
  /** 计算包哈希时不参与计算的文件匹配规则 */
7
7
  export declare const PKG_HASH_IGNORE_LIST: string[];
8
+ /**
9
+ * 获取上传预览 Settings 配置,支持白名单处理,兜底默认
10
+ */
11
+ export declare const getSizeLimitConfig: (appId: string) => Promise<{
12
+ normalTotal: number;
13
+ subMain: number;
14
+ subPkg: number;
15
+ subTotal: number;
16
+ openData: number;
17
+ }>;
8
18
  /**
9
19
  * 校验包体大小,支持白名单逻辑,具体限制以 Settings 下发为准
10
20
  * 默认:普通包最大 8MB,开放数据域 & 分包主包最大 4MB,子包不限制,总包 20MB
@@ -5,7 +5,6 @@ import type { 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
- import { IApp } from '@byted/miniprogram-utils/dist/data/app';
9
8
  /**
10
9
  * 计算给定文件夹下面的文件体积总值
11
10
  * @param folderPath directory path
@@ -17,12 +16,10 @@ export declare function getFolderSize(folderPath: string, useTypeScript: boolean
17
16
  /**
18
17
  * 以文件夹为单位的包体积统计,不适用于依赖分析
19
18
  *
20
- * @param projectConfig
21
- * @param appJson
22
19
  * @param projectPath
23
20
  * @param isGame
24
21
  */
25
- export declare function getProjectSize(projectConfig: ProjectConfig, appJson: IApp, projectPath: string, isGame: boolean): Promise<ProjectSize>;
22
+ export declare function getProjectSize(projectPath: string, isGame?: boolean): Promise<ProjectSize>;
26
23
  /**
27
24
  * 校验当前项目的分包体积是否符合要求
28
25
  * 若有错误,会抛出 promise 异常
@@ -39,7 +36,7 @@ declare type FolderToZipStreamOption = {
39
36
  *
40
37
  * @param dir path to folder
41
38
  */
42
- export declare function folderToZipStream(dir: string, { whiteList, useTypeScript }: FolderToZipStreamOption, isGame: boolean): Promise<archiver.Archiver>;
39
+ export declare function folderToZipStream(dir: string, { whiteList, useTypeScript }: FolderToZipStreamOption, isGame: boolean, highWaterMark?: number): Promise<archiver.Archiver>;
43
40
  /**
44
41
  * For cli only
45
42
  * @param input
@@ -29,6 +29,7 @@ export interface TMACliConfig {
29
29
  preview: string;
30
30
  upload: string;
31
31
  versionInfo: string;
32
+ sizeLimit: string;
32
33
  };
33
34
  env: {
34
35
  type: 'online' | 'ppe' | 'boe';
@@ -4,13 +4,10 @@ export declare const getUserId: () => string;
4
4
  export declare function saveUserCookies(cookies: string[], userId: string): void;
5
5
  export declare function removeUserCookies(): void;
6
6
  export declare function setCookieFn(fn: GetCookieFunction): void;
7
- export declare const getLogInfoHeaders: (appId: string) => Promise<{
8
- 'x-cli-token': any;
9
- 'x-cli-appid': string;
10
- Cookie: any;
11
- } | {
12
- Cookie: string;
13
- 'x-cli-token'?: undefined;
14
- 'x-cli-appid'?: undefined;
15
- }>;
7
+ declare type LogInfoHeaders = {
8
+ 'x-cli-token'?: any;
9
+ 'x-cli-appid'?: string;
10
+ Cookie?: any;
11
+ };
12
+ export declare const getLogInfoHeaders: (appId: string) => Promise<LogInfoHeaders>;
16
13
  export {};
@@ -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: CliLogger | Logger;
18
+ declare const logger: Logger | CliLogger;
19
19
  export default logger;
@@ -56,3 +56,4 @@ export declare function getMD5Stream(source: archiver.Archiver): Promise<Transfo
56
56
  export declare const getNextVersion: (version: string) => string;
57
57
  export declare const isGameFileValid: (pattern: string) => boolean;
58
58
  export declare const isObject: (value: any) => boolean;
59
+ export declare function sleep(timer: number): Promise<unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tt-minigame-ide-cli",
3
- "version": "2.0.7",
3
+ "version": "2.0.8-beta.0",
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
+ }
@@ -1,48 +0,0 @@
1
- /**
2
- * AppSettings 相关逻辑封装
3
- * https://site.bytedance.net/docs/428/3356/request_params/
4
- */
5
- import { SizeLimitConfig, TmgSdkInfo } from './source.type';
6
- /**
7
- * 网络请求相关相关的 typings 声明
8
- */
9
- declare type BaseResponse<T = any> = {
10
- data: T;
11
- message: string;
12
- };
13
- declare type Dict<T = any> = {
14
- [key: string]: T;
15
- };
16
- export declare type SettingsResponse = BaseResponse<{
17
- settings: {
18
- compile_config?: {
19
- limit: SizeLimitConfig;
20
- };
21
- tt_tma_sdk_config?: TmgSdkInfo[];
22
- };
23
- settings_time: number;
24
- }>;
25
- export declare const SETTINGS_URL = "https://is.snssdk.com/service/settings/v3/";
26
- export declare const genDefault: (params: Dict) => {
27
- caller_name: string;
28
- channel: string;
29
- device_platform: string;
30
- device_id: any;
31
- device_id_str: any;
32
- version_code: any;
33
- user_id: any;
34
- };
35
- /**
36
- * 获取小游戏 IDE AppSettings 配置
37
- * https://cloud.bytedance.net/appSettings-v2/detail/product/608/config/list
38
- */
39
- export declare const getIdeSettings: (params?: Dict) => Promise<{
40
- settings: {
41
- compile_config?: {
42
- limit: SizeLimitConfig;
43
- };
44
- tt_tma_sdk_config?: TmgSdkInfo[];
45
- };
46
- settings_time: number;
47
- }>;
48
- export {};