@weapp-core/schematics 6.0.4 → 6.2.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/dist/index.cjs +493 -14
- package/dist/index.d.cts +256 -19
- package/dist/index.d.ts +256 -19
- package/dist/index.js +490 -11
- package/package.json +7 -3
- package/schemas/app.json +72 -11
- package/schemas/component.json +12 -1
- package/schemas/page.json +67 -14
- package/schemas/plugin.json +18 -1
- package/schemas/sitemap.json +3 -1
- package/schemas/theme.json +4 -1
package/dist/index.d.ts
CHANGED
|
@@ -18,35 +18,87 @@ type JsonExt = 'json' | 'js' | 'ts' | (string & {});
|
|
|
18
18
|
* 全局配置, 小程序根目录下的 app.json 文件用来对微信小程序进行全局配置。
|
|
19
19
|
*/
|
|
20
20
|
interface App$1 {
|
|
21
|
+
/**
|
|
22
|
+
* AppBar 配置。
|
|
23
|
+
*/
|
|
21
24
|
appBar?: {
|
|
22
25
|
[k: string]: unknown;
|
|
23
26
|
};
|
|
24
|
-
|
|
27
|
+
/**
|
|
28
|
+
* 聊天工具分包配置
|
|
29
|
+
*/
|
|
30
|
+
chatTools?: {
|
|
31
|
+
[k: string]: unknown;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* 组件框架。仅在主动启用 WebView glass-easel 时需同时开启 glassEaselWebview。
|
|
35
|
+
*/
|
|
36
|
+
componentFramework?: "exparser" | "glass-easel";
|
|
37
|
+
/**
|
|
38
|
+
* 是否将 rpx 单位转换为 vw 单位。
|
|
39
|
+
*/
|
|
25
40
|
convertRpxToVw?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 小程序支持 DarkMode。
|
|
43
|
+
*/
|
|
26
44
|
darkmode?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* 是否开启 debug 模式。
|
|
47
|
+
*/
|
|
27
48
|
debug?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* 调试相关配置。
|
|
51
|
+
*/
|
|
28
52
|
debugOptions?: {
|
|
29
53
|
[k: string]: unknown;
|
|
30
54
|
};
|
|
55
|
+
/**
|
|
56
|
+
* 半屏小程序 appId 列表。
|
|
57
|
+
*/
|
|
31
58
|
embeddedAppIdList?: string[];
|
|
59
|
+
/**
|
|
60
|
+
* touch 事件监听是否为 passive
|
|
61
|
+
*/
|
|
32
62
|
enablePassiveEvent?: {
|
|
33
63
|
[k: string]: unknown;
|
|
34
64
|
} | boolean;
|
|
65
|
+
/**
|
|
66
|
+
* 微信消息用小程序打开。
|
|
67
|
+
*/
|
|
35
68
|
entranceDeclare?: {
|
|
36
69
|
[k: string]: unknown;
|
|
37
70
|
};
|
|
38
71
|
/**
|
|
39
|
-
*
|
|
72
|
+
* 小程序默认启动首页。
|
|
40
73
|
*/
|
|
41
74
|
entryPagePath?: string;
|
|
75
|
+
/**
|
|
76
|
+
* 是否启用插件功能页。
|
|
77
|
+
*/
|
|
42
78
|
functionalPages?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* 显式启用 WebView glass-easel,最低基础库为 3.8.12,默认不启用;需与 componentFramework: glass-easel 配套使用。
|
|
81
|
+
*/
|
|
82
|
+
glassEaselWebview?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* 视频号直播半屏场景设置。
|
|
85
|
+
*/
|
|
43
86
|
halfPage?: {
|
|
44
87
|
[k: string]: unknown;
|
|
45
88
|
};
|
|
89
|
+
/**
|
|
90
|
+
* 配置自定义组件代码按需注入。
|
|
91
|
+
*/
|
|
46
92
|
lazyCodeLoading?: string;
|
|
93
|
+
/**
|
|
94
|
+
* 多端模式场景接入身份管理服务时开启小程序授权页相关配置,详见相关文档
|
|
95
|
+
*/
|
|
47
96
|
miniApp?: {
|
|
48
97
|
[k: string]: unknown;
|
|
49
98
|
};
|
|
99
|
+
/**
|
|
100
|
+
* 网络超时时间。
|
|
101
|
+
*/
|
|
50
102
|
networkTimeout?: {
|
|
51
103
|
connectSocket?: number;
|
|
52
104
|
downloadFile?: number;
|
|
@@ -55,19 +107,34 @@ interface App$1 {
|
|
|
55
107
|
[k: string]: unknown;
|
|
56
108
|
};
|
|
57
109
|
/**
|
|
58
|
-
*
|
|
110
|
+
* 页面路径列表。
|
|
59
111
|
*/
|
|
60
112
|
pages: string[];
|
|
113
|
+
/**
|
|
114
|
+
* 小程序接口权限相关设置。
|
|
115
|
+
*/
|
|
61
116
|
permission?: {
|
|
62
117
|
[k: string]: unknown;
|
|
63
118
|
};
|
|
119
|
+
/**
|
|
120
|
+
* 使用到的插件。
|
|
121
|
+
*/
|
|
64
122
|
plugins?: {
|
|
65
123
|
[k: string]: unknown;
|
|
66
124
|
};
|
|
125
|
+
/**
|
|
126
|
+
* 分包预下载规则。
|
|
127
|
+
*/
|
|
67
128
|
preloadRule?: {
|
|
68
129
|
[k: string]: unknown;
|
|
69
130
|
};
|
|
131
|
+
/**
|
|
132
|
+
* 全局默认的渲染后端。
|
|
133
|
+
*/
|
|
70
134
|
renderer?: "webview" | "skyline";
|
|
135
|
+
/**
|
|
136
|
+
* 渲染后端选项。
|
|
137
|
+
*/
|
|
71
138
|
rendererOptions?: {
|
|
72
139
|
skyline?: {
|
|
73
140
|
defaultContentBox?: boolean;
|
|
@@ -77,21 +144,51 @@ interface App$1 {
|
|
|
77
144
|
};
|
|
78
145
|
[k: string]: unknown;
|
|
79
146
|
};
|
|
147
|
+
/**
|
|
148
|
+
* 需要在后台使用的能力。
|
|
149
|
+
*/
|
|
80
150
|
requiredBackgroundModes?: string[];
|
|
151
|
+
/**
|
|
152
|
+
* 调用的地理位置相关隐私接口。
|
|
153
|
+
*/
|
|
81
154
|
requiredPrivateInfos?: string[];
|
|
155
|
+
/**
|
|
156
|
+
* PC 小程序是否支持用户任意改变窗口大小(包括最大化窗口);iPad 小程序是否支持屏幕旋转。默认关闭
|
|
157
|
+
*/
|
|
82
158
|
resizable?: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* 自定义模块映射规则。
|
|
161
|
+
*/
|
|
83
162
|
resolveAlias?: {
|
|
84
163
|
[k: string]: unknown;
|
|
85
164
|
};
|
|
165
|
+
/**
|
|
166
|
+
* 定制化型服务商票据
|
|
167
|
+
*/
|
|
86
168
|
serviceProviderTicket?: string;
|
|
169
|
+
/**
|
|
170
|
+
* 单页模式相关配置
|
|
171
|
+
*/
|
|
87
172
|
singlePage?: {
|
|
88
173
|
[k: string]: unknown;
|
|
89
174
|
};
|
|
175
|
+
/**
|
|
176
|
+
* 指明 sitemap.json 的位置。
|
|
177
|
+
*/
|
|
90
178
|
sitemapLocation?: string;
|
|
179
|
+
/**
|
|
180
|
+
* 正常情况下默认所有资源文件都被打包发布到所有平台,可以通过 static 字段配置特定每个目录/文件只能发布到特定的平台(多端场景) 相关文档
|
|
181
|
+
*/
|
|
91
182
|
static?: {
|
|
92
183
|
[k: string]: unknown;
|
|
93
184
|
};
|
|
185
|
+
/**
|
|
186
|
+
* 指定使用升级后的weui样式
|
|
187
|
+
*/
|
|
94
188
|
style?: string;
|
|
189
|
+
/**
|
|
190
|
+
* 分包结构配置(兼容别名)。
|
|
191
|
+
*/
|
|
95
192
|
subPackages?: {
|
|
96
193
|
entry?: string;
|
|
97
194
|
independent?: boolean;
|
|
@@ -100,6 +197,9 @@ interface App$1 {
|
|
|
100
197
|
root?: string;
|
|
101
198
|
[k: string]: unknown;
|
|
102
199
|
}[];
|
|
200
|
+
/**
|
|
201
|
+
* 分包结构配置。
|
|
202
|
+
*/
|
|
103
203
|
subpackages?: {
|
|
104
204
|
entry?: string;
|
|
105
205
|
independent?: boolean;
|
|
@@ -108,9 +208,15 @@ interface App$1 {
|
|
|
108
208
|
root?: string;
|
|
109
209
|
[k: string]: unknown;
|
|
110
210
|
}[];
|
|
211
|
+
/**
|
|
212
|
+
* 聊天素材小程序打开相关配置。
|
|
213
|
+
*/
|
|
111
214
|
supportedMaterials?: {
|
|
112
215
|
[k: string]: unknown;
|
|
113
216
|
};
|
|
217
|
+
/**
|
|
218
|
+
* 底部 tab 栏的表现。
|
|
219
|
+
*/
|
|
114
220
|
tabBar?: {
|
|
115
221
|
backgroundColor: string;
|
|
116
222
|
borderStyle?: "black" | "white";
|
|
@@ -209,13 +315,25 @@ interface App$1 {
|
|
|
209
315
|
selectedColor: string;
|
|
210
316
|
[k: string]: unknown;
|
|
211
317
|
};
|
|
318
|
+
/**
|
|
319
|
+
* 指明 theme.json 的位置。
|
|
320
|
+
*/
|
|
212
321
|
themeLocation?: string;
|
|
322
|
+
/**
|
|
323
|
+
* 指定需要引用的扩展库。
|
|
324
|
+
*/
|
|
213
325
|
useExtendedLib?: {
|
|
214
326
|
[k: string]: unknown;
|
|
215
327
|
};
|
|
328
|
+
/**
|
|
329
|
+
* 全局自定义组件配置。
|
|
330
|
+
*/
|
|
216
331
|
usingComponents?: {
|
|
217
332
|
[k: string]: string;
|
|
218
333
|
};
|
|
334
|
+
/**
|
|
335
|
+
* 全局的默认窗口表现。
|
|
336
|
+
*/
|
|
219
337
|
window?: {
|
|
220
338
|
backgroundColor?: string;
|
|
221
339
|
backgroundColorBottom?: string;
|
|
@@ -224,7 +342,7 @@ interface App$1 {
|
|
|
224
342
|
enablePullDownRefresh?: boolean;
|
|
225
343
|
handleWebviewPreload?: "static" | "manual" | "auto";
|
|
226
344
|
homeButton?: boolean;
|
|
227
|
-
initialRenderingCache?: "static" | "dynamic";
|
|
345
|
+
initialRenderingCache?: "static" | "dynamic" | "capture";
|
|
228
346
|
navigationBarBackgroundColor?: string;
|
|
229
347
|
navigationBarTextStyle?: string;
|
|
230
348
|
navigationBarTitleText?: string;
|
|
@@ -235,6 +353,9 @@ interface App$1 {
|
|
|
235
353
|
visualEffectInBackground?: "none" | "hidden";
|
|
236
354
|
[k: string]: unknown;
|
|
237
355
|
};
|
|
356
|
+
/**
|
|
357
|
+
* Worker 代码放置的目录。
|
|
358
|
+
*/
|
|
238
359
|
workers?: string | {
|
|
239
360
|
isSubpackage?: boolean;
|
|
240
361
|
path?: string;
|
|
@@ -251,15 +372,33 @@ interface App$1 {
|
|
|
251
372
|
* 自定义组件配置
|
|
252
373
|
*/
|
|
253
374
|
interface Component$1 {
|
|
375
|
+
/**
|
|
376
|
+
* 声明当前配置对应自定义组件。
|
|
377
|
+
*/
|
|
254
378
|
component?: boolean;
|
|
255
|
-
|
|
379
|
+
/**
|
|
380
|
+
* 组件框架。
|
|
381
|
+
*/
|
|
382
|
+
componentFramework?: "exparser" | "glass-easel";
|
|
383
|
+
/**
|
|
384
|
+
* 组件泛型配置。
|
|
385
|
+
*/
|
|
256
386
|
componentGenerics?: {
|
|
257
387
|
[k: string]: unknown;
|
|
258
388
|
};
|
|
389
|
+
/**
|
|
390
|
+
* 组件占位配置。
|
|
391
|
+
*/
|
|
259
392
|
componentPlaceholder?: {
|
|
260
393
|
[k: string]: unknown;
|
|
261
394
|
};
|
|
395
|
+
/**
|
|
396
|
+
* 组件样式隔离策略。
|
|
397
|
+
*/
|
|
262
398
|
styleIsolation?: "isolated" | "apply-shared" | "shared";
|
|
399
|
+
/**
|
|
400
|
+
* 组件依赖的自定义组件配置。
|
|
401
|
+
*/
|
|
263
402
|
usingComponents?: {
|
|
264
403
|
[k: string]: string;
|
|
265
404
|
};
|
|
@@ -274,48 +413,120 @@ interface Component$1 {
|
|
|
274
413
|
* 页面配置, 支持对单个页面进行配置,可以在页面对应的 .json 文件来对本页面的表现进行配置
|
|
275
414
|
*/
|
|
276
415
|
interface Page$1 {
|
|
416
|
+
/**
|
|
417
|
+
* 窗口的背景色
|
|
418
|
+
*/
|
|
277
419
|
backgroundColor?: string;
|
|
420
|
+
/**
|
|
421
|
+
* 底部窗口的背景色,仅 iOS 支持
|
|
422
|
+
*/
|
|
278
423
|
backgroundColorBottom?: string;
|
|
424
|
+
/**
|
|
425
|
+
* 页面容器背景色。
|
|
426
|
+
*/
|
|
279
427
|
backgroundColorContent?: string;
|
|
428
|
+
/**
|
|
429
|
+
* 顶部窗口的背景色,仅 iOS 支持
|
|
430
|
+
*/
|
|
280
431
|
backgroundColorTop?: string;
|
|
432
|
+
/**
|
|
433
|
+
* 下拉 loading 的样式,仅支持 dark / light
|
|
434
|
+
*/
|
|
281
435
|
backgroundTextStyle?: "dark" | "light";
|
|
282
|
-
|
|
436
|
+
/**
|
|
437
|
+
* 组件框架。仅在主动启用 WebView glass-easel 时需同时开启 glassEaselWebview。
|
|
438
|
+
*/
|
|
439
|
+
componentFramework?: "exparser" | "glass-easel";
|
|
283
440
|
componentPlaceholder?: {
|
|
284
441
|
[k: string]: unknown;
|
|
285
442
|
};
|
|
443
|
+
/**
|
|
444
|
+
* 设置为 true 时页面整体不能上下滚动。
|
|
445
|
+
*/
|
|
286
446
|
disableScroll?: boolean;
|
|
447
|
+
/**
|
|
448
|
+
* 事件监听是否为 passive,若对页面单独设置则会覆盖全局的配置,详见 全局配置
|
|
449
|
+
*/
|
|
287
450
|
enablePassiveEvent?: {
|
|
288
451
|
[k: string]: unknown;
|
|
289
452
|
} | boolean;
|
|
453
|
+
/**
|
|
454
|
+
* 是否开启当前页面下拉刷新。详见 Page.onPullDownRefresh
|
|
455
|
+
*/
|
|
290
456
|
enablePullDownRefresh?: boolean;
|
|
457
|
+
/**
|
|
458
|
+
* 显式启用 WebView glass-easel,最低基础库为 3.8.12,默认不启用;需与 componentFramework: glass-easel 配套使用。
|
|
459
|
+
*/
|
|
460
|
+
glassEaselWebview?: boolean;
|
|
461
|
+
/**
|
|
462
|
+
* 控制预加载下个页面的时机。支持 static / manual / auto
|
|
463
|
+
*/
|
|
291
464
|
handleWebviewPreload?: "static" | "manual" | "auto";
|
|
465
|
+
/**
|
|
466
|
+
* 在非首页、非页面栈最底层页面或非tabbar内页面中的导航栏展示home键
|
|
467
|
+
*/
|
|
292
468
|
homeButton?: boolean;
|
|
293
|
-
|
|
469
|
+
/**
|
|
470
|
+
* 页面初始渲染缓存配置。
|
|
471
|
+
*/
|
|
472
|
+
initialRenderingCache?: "static" | "dynamic" | "capture";
|
|
473
|
+
/**
|
|
474
|
+
* 导航栏背景颜色,如 #000000
|
|
475
|
+
*/
|
|
294
476
|
navigationBarBackgroundColor?: string;
|
|
477
|
+
/**
|
|
478
|
+
* 导航栏标题、状态栏颜色,仅支持 black / white
|
|
479
|
+
*/
|
|
295
480
|
navigationBarTextStyle?: string;
|
|
481
|
+
/**
|
|
482
|
+
* 导航栏标题文字内容
|
|
483
|
+
*/
|
|
296
484
|
navigationBarTitleText?: string;
|
|
485
|
+
/**
|
|
486
|
+
* 导航栏样式,仅支持以下值:default 默认样式 custom 自定义导航栏,只保留右上角胶囊按钮。
|
|
487
|
+
*/
|
|
297
488
|
navigationStyle?: "default" | "custom";
|
|
489
|
+
/**
|
|
490
|
+
* 页面上拉触底事件触发时距页面底部距离,单位为px。详见 Page.onReachBottom
|
|
491
|
+
*/
|
|
298
492
|
onReachBottomDistance?: number;
|
|
493
|
+
/**
|
|
494
|
+
* 屏幕旋转设置,支持 auto / portrait / landscape 详见 响应显示区域变化
|
|
495
|
+
*/
|
|
299
496
|
pageOrientation?: "portrait" | "auto" | "landscape";
|
|
497
|
+
/**
|
|
498
|
+
* 页面渲染后端。
|
|
499
|
+
*/
|
|
300
500
|
renderer?: "webview" | "skyline";
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
[k: string]: unknown;
|
|
309
|
-
};
|
|
501
|
+
/**
|
|
502
|
+
* 渲染后端选项,详情相关文档
|
|
503
|
+
*/
|
|
504
|
+
rendererOptions?: string;
|
|
505
|
+
/**
|
|
506
|
+
* 重新启动策略配置
|
|
507
|
+
*/
|
|
310
508
|
restartStrategy?: "homePage" | "homePageAndLatestPage";
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
509
|
+
/**
|
|
510
|
+
* 单页模式相关配置
|
|
511
|
+
*/
|
|
512
|
+
singlePage?: string;
|
|
513
|
+
/**
|
|
514
|
+
* 启用新版的组件样式
|
|
515
|
+
*/
|
|
314
516
|
style?: string;
|
|
517
|
+
/**
|
|
518
|
+
* 页面样式隔离策略。
|
|
519
|
+
*/
|
|
315
520
|
styleIsolation?: "page-isolated" | "page-apply-shared" | "page-shared";
|
|
521
|
+
/**
|
|
522
|
+
* 页面自定义组件配置。
|
|
523
|
+
*/
|
|
316
524
|
usingComponents?: {
|
|
317
525
|
[k: string]: string;
|
|
318
526
|
};
|
|
527
|
+
/**
|
|
528
|
+
* 切入系统后台时,隐藏页面内容,保护用户隐私。支持 hidden / none,若对页面单独设置则会覆盖全局的配置,详见 全局配置
|
|
529
|
+
*/
|
|
319
530
|
visualEffectInBackground?: "none" | "hidden";
|
|
320
531
|
[k: string]: unknown;
|
|
321
532
|
}
|
|
@@ -328,6 +539,9 @@ interface Page$1 {
|
|
|
328
539
|
* https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/sitemap.html
|
|
329
540
|
*/
|
|
330
541
|
interface Sitemap$1 {
|
|
542
|
+
/**
|
|
543
|
+
* sitemap 匹配规则列表。
|
|
544
|
+
*/
|
|
331
545
|
rules: {
|
|
332
546
|
action?: "allow" | "disallow";
|
|
333
547
|
matching?: "exact" | "inclusive" | "exclusive" | "partial";
|
|
@@ -343,9 +557,15 @@ interface Sitemap$1 {
|
|
|
343
557
|
* and run json-schema-to-typescript to regenerate this file.
|
|
344
558
|
*/
|
|
345
559
|
interface Theme$1 {
|
|
560
|
+
/**
|
|
561
|
+
* 深色主题配置。
|
|
562
|
+
*/
|
|
346
563
|
dark: {
|
|
347
564
|
[k: string]: unknown;
|
|
348
565
|
};
|
|
566
|
+
/**
|
|
567
|
+
* 浅色主题配置。
|
|
568
|
+
*/
|
|
349
569
|
light: {
|
|
350
570
|
[k: string]: unknown;
|
|
351
571
|
};
|
|
@@ -360,10 +580,27 @@ interface Theme$1 {
|
|
|
360
580
|
* https://developers.weixin.qq.com/miniprogram/dev/framework/plugin/development.html#%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6
|
|
361
581
|
*/
|
|
362
582
|
interface Plugin$1 {
|
|
583
|
+
/**
|
|
584
|
+
* 插件组件框架。仅在主动启用 WebView glass-easel 时需同时开启 glassEaselWebview。
|
|
585
|
+
*/
|
|
586
|
+
componentFramework?: "exparser" | "glass-easel";
|
|
587
|
+
/**
|
|
588
|
+
* 显式启用 WebView glass-easel,最低基础库为 3.8.12,默认不启用;需与 componentFramework: glass-easel 配套使用。
|
|
589
|
+
*/
|
|
590
|
+
glassEaselWebview?: boolean;
|
|
591
|
+
/**
|
|
592
|
+
* 插件主入口文件。
|
|
593
|
+
*/
|
|
363
594
|
main?: string;
|
|
595
|
+
/**
|
|
596
|
+
* 插件页面映射。
|
|
597
|
+
*/
|
|
364
598
|
pages?: {
|
|
365
599
|
[k: string]: string;
|
|
366
600
|
};
|
|
601
|
+
/**
|
|
602
|
+
* 插件对外提供的自定义组件。
|
|
603
|
+
*/
|
|
367
604
|
publicComponents?: {
|
|
368
605
|
[k: string]: string;
|
|
369
606
|
};
|