transone-cli 0.4.0 → 0.6.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.
- package/README.md +28 -2
- package/dist/{build-mp-6j38wf4r.js → build-mp-004pd4h0.js} +50 -4
- package/dist/{build-mp-6j38wf4r.js.map → build-mp-004pd4h0.js.map} +5 -5
- package/dist/cli.js +1 -1
- package/dist/create.d.ts +1 -1
- package/dist/{index-m455xjw2.js → index-pg5v7h1t.js} +51 -19
- package/dist/{index-m455xjw2.js.map → index-pg5v7h1t.js.map} +5 -5
- package/dist/index.js +1 -1
- package/dist/types.d.ts +12 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export type { MpTargetType, TargetType } from './target/types';
|
|
|
3
3
|
export { MP_TARGET_TYPES, APP_TARGET_TYPES, isAppTargetType, isMpTargetType, isTargetType, TARGET_TYPES, } from './target/types';
|
|
4
4
|
/** 原生 App 目标通用配置。 */
|
|
5
5
|
export interface AppConfig {
|
|
6
|
+
/** 接口请求基础地址(http/https);平台配置可覆盖。 */
|
|
7
|
+
host?: string;
|
|
6
8
|
appName?: string;
|
|
7
9
|
bundleId?: string;
|
|
8
10
|
outDir?: string;
|
|
@@ -13,8 +15,10 @@ export interface AppConfig {
|
|
|
13
15
|
}
|
|
14
16
|
/** 按原生 App 平台分组的配置。 */
|
|
15
17
|
export type AppConfigMap = Partial<Record<AppTargetType, AppConfig>>;
|
|
16
|
-
export type UserAppConfig = AppConfig | AppConfigMap;
|
|
18
|
+
export type UserAppConfig = AppConfig | (AppConfigMap & Pick<AppConfig, 'host'>);
|
|
17
19
|
export interface ResolvedAppConfig {
|
|
20
|
+
/** 接口请求基础地址(http/https);平台配置可覆盖。 */
|
|
21
|
+
host?: string;
|
|
18
22
|
appName: string;
|
|
19
23
|
bundleId: string;
|
|
20
24
|
outDir: string;
|
|
@@ -29,6 +33,8 @@ export interface ProxyOptions {
|
|
|
29
33
|
}
|
|
30
34
|
/** 小程序目标端通用配置(--target mp-*)。 */
|
|
31
35
|
export interface MiniProgramConfig {
|
|
36
|
+
/** 接口请求基础地址(http/https);平台配置可覆盖。 */
|
|
37
|
+
host?: string;
|
|
32
38
|
/** 小程序 appid;默认 "touristappid"(平台开发工具测试号/占位 ID)。 */
|
|
33
39
|
appId?: string;
|
|
34
40
|
/** 小程序产物目录;默认 dist/build/{target}。 */
|
|
@@ -53,6 +59,8 @@ export interface MiniProgramConfig {
|
|
|
53
59
|
globalData?: Record<string, unknown>;
|
|
54
60
|
}
|
|
55
61
|
export interface ResolvedMiniProgramConfig {
|
|
62
|
+
/** 接口请求基础地址(http/https);平台配置可覆盖。 */
|
|
63
|
+
host?: string;
|
|
56
64
|
appId: string;
|
|
57
65
|
outDir: string;
|
|
58
66
|
navigationBarTitleText: string;
|
|
@@ -67,12 +75,8 @@ export interface ResolvedMiniProgramConfig {
|
|
|
67
75
|
}
|
|
68
76
|
/** 按小程序平台分组的目标端配置:{ 'mp-weixin': {...}, 'mp-xiaohongshu': {...} }。 */
|
|
69
77
|
export type MiniProgramConfigMap = Partial<Record<MpTargetType, MiniProgramConfig>>;
|
|
70
|
-
/**
|
|
71
|
-
|
|
72
|
-
* - 单一 `MiniProgramConfig`:作用于任意小程序目标(向后兼容,微信单端推荐);
|
|
73
|
-
* - `MiniProgramConfigMap`:按平台分组,构建时只取当前 target 对应的那份。
|
|
74
|
-
*/
|
|
75
|
-
export type UserMiniProgramConfig = MiniProgramConfig | MiniProgramConfigMap;
|
|
78
|
+
/** 公共字段直接放在 mp 下;平台配置递归覆盖公共字段,数组整体替换。 */
|
|
79
|
+
export type UserMiniProgramConfig = MiniProgramConfig & MiniProgramConfigMap;
|
|
76
80
|
export interface ServerConfig {
|
|
77
81
|
host?: string;
|
|
78
82
|
port?: number;
|
|
@@ -120,7 +124,7 @@ export interface UserConfig {
|
|
|
120
124
|
server?: ServerConfig;
|
|
121
125
|
build?: BuildConfig;
|
|
122
126
|
library?: LibraryConfig;
|
|
123
|
-
/**
|
|
127
|
+
/** 小程序公共配置与平台覆盖配置(键为 mp-* target)。 */
|
|
124
128
|
mp?: UserMiniProgramConfig;
|
|
125
129
|
/** 原生 App 目标配置:扁平配置或按 app-* 平台分组。 */
|
|
126
130
|
app?: UserAppConfig;
|