weapp-vite 6.18.7 → 6.19.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 -0
- package/dist/auto-import-components/resolvers.d.mts +2 -2
- package/dist/auto-import-components/resolvers.mjs +2 -334
- package/dist/auto-routes.mjs +1 -1
- package/dist/cli.mjs +41 -9
- package/dist/{config-DEdY6_Qn.d.mts → config-CKToDk5V.d.mts} +22 -4
- package/dist/config.d.mts +1 -1
- package/dist/{createContext-C3XuGjnq.mjs → createContext-B5rRMSjV.mjs} +864 -330
- package/dist/docs/README.md +28 -0
- package/dist/docs/getting-started.md +13 -0
- package/dist/docs/index.md +7 -3
- package/dist/docs/testing.md +38 -0
- package/dist/docs/uni-app-component-libraries.md +213 -0
- package/dist/docs/weapp-config.md +29 -0
- package/dist/{file-DjQkG6ce.mjs → file-BgstESAr.mjs} +1 -1
- package/dist/file-DDpy9efy.mjs +2 -0
- package/dist/getInstance-DYwC9HEv.mjs +2 -0
- package/dist/{index-Bmclyjw8.d.mts → index-CaXAtb9e.d.mts} +24 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/json.d.mts +1 -1
- package/dist/mcp.d.mts +1 -1
- package/dist/resolvers-w4g7O94W.mjs +684 -0
- package/dist/resolvers.d.mts +2 -0
- package/dist/resolvers.mjs +2 -0
- package/dist/test.d.mts +33 -0
- package/dist/test.mjs +82 -0
- package/dist/types.d.mts +3 -3
- package/package.json +25 -17
- package/dist/file-CWBCL2N8.mjs +0 -2
- package/dist/getInstance-DrwD5CVt.mjs +0 -2
|
@@ -0,0 +1,684 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import path from "pathe";
|
|
3
|
+
import { defu } from "@weapp-core/shared";
|
|
4
|
+
import process from "node:process";
|
|
5
|
+
//#region src/auto-import-components/resolvers/json/tdesign.json
|
|
6
|
+
var tdesign_default = [
|
|
7
|
+
"action-sheet",
|
|
8
|
+
"avatar",
|
|
9
|
+
"avatar-group",
|
|
10
|
+
"back-top",
|
|
11
|
+
"badge",
|
|
12
|
+
"button",
|
|
13
|
+
"calendar",
|
|
14
|
+
"cascader",
|
|
15
|
+
"cell",
|
|
16
|
+
"cell-group",
|
|
17
|
+
"check-tag",
|
|
18
|
+
"checkbox",
|
|
19
|
+
"checkbox-group",
|
|
20
|
+
"col",
|
|
21
|
+
"collapse",
|
|
22
|
+
"collapse-panel",
|
|
23
|
+
"color-picker",
|
|
24
|
+
"config-provider",
|
|
25
|
+
"count-down",
|
|
26
|
+
"date-time-picker",
|
|
27
|
+
"dialog",
|
|
28
|
+
"divider",
|
|
29
|
+
"drawer",
|
|
30
|
+
"dropdown-item",
|
|
31
|
+
"dropdown-menu",
|
|
32
|
+
"empty",
|
|
33
|
+
"fab",
|
|
34
|
+
"footer",
|
|
35
|
+
"form",
|
|
36
|
+
"form-item",
|
|
37
|
+
"grid",
|
|
38
|
+
"grid-item",
|
|
39
|
+
"guide",
|
|
40
|
+
"icon",
|
|
41
|
+
"image",
|
|
42
|
+
"image-viewer",
|
|
43
|
+
"indexes",
|
|
44
|
+
"indexes-anchor",
|
|
45
|
+
"input",
|
|
46
|
+
"link",
|
|
47
|
+
"loading",
|
|
48
|
+
"message",
|
|
49
|
+
"message-item",
|
|
50
|
+
"navbar",
|
|
51
|
+
"notice-bar",
|
|
52
|
+
"overlay",
|
|
53
|
+
"paragraph",
|
|
54
|
+
"picker",
|
|
55
|
+
"picker-item",
|
|
56
|
+
"popover",
|
|
57
|
+
"popup",
|
|
58
|
+
"progress",
|
|
59
|
+
"pull-down-refresh",
|
|
60
|
+
"qrcode",
|
|
61
|
+
"radio",
|
|
62
|
+
"radio-group",
|
|
63
|
+
"rate",
|
|
64
|
+
"result",
|
|
65
|
+
"row",
|
|
66
|
+
"scroll-view",
|
|
67
|
+
"search",
|
|
68
|
+
"segmented",
|
|
69
|
+
"side-bar",
|
|
70
|
+
"side-bar-item",
|
|
71
|
+
"skeleton",
|
|
72
|
+
"slider",
|
|
73
|
+
"step-item",
|
|
74
|
+
"stepper",
|
|
75
|
+
"steps",
|
|
76
|
+
"sticky",
|
|
77
|
+
"swipe-cell",
|
|
78
|
+
"swiper",
|
|
79
|
+
"swiper-nav",
|
|
80
|
+
"switch",
|
|
81
|
+
"tab-bar",
|
|
82
|
+
"tab-bar-item",
|
|
83
|
+
"tab-panel",
|
|
84
|
+
"table",
|
|
85
|
+
"tabs",
|
|
86
|
+
"tag",
|
|
87
|
+
"text",
|
|
88
|
+
"textarea",
|
|
89
|
+
"title",
|
|
90
|
+
"toast",
|
|
91
|
+
"transition",
|
|
92
|
+
"tree-select",
|
|
93
|
+
"upload",
|
|
94
|
+
"watermark"
|
|
95
|
+
];
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/auto-import-components/resolvers/tdesign.ts
|
|
98
|
+
const defaultPrefix$2 = "t-";
|
|
99
|
+
const TDesignResolver = (opts) => {
|
|
100
|
+
const { prefix, resolve, supportFilesStrategy } = defu(opts, {
|
|
101
|
+
prefix: defaultPrefix$2,
|
|
102
|
+
supportFilesStrategy: "full",
|
|
103
|
+
resolve({ name, prefix }) {
|
|
104
|
+
return {
|
|
105
|
+
key: `${prefix}${name}`,
|
|
106
|
+
value: `tdesign-miniprogram/${name}/${name}`
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
const map = tdesign_default.reduce((acc, cur) => {
|
|
111
|
+
const { key, value } = resolve({
|
|
112
|
+
name: cur,
|
|
113
|
+
prefix
|
|
114
|
+
});
|
|
115
|
+
acc[key] = value;
|
|
116
|
+
return acc;
|
|
117
|
+
}, {});
|
|
118
|
+
return {
|
|
119
|
+
components: Object.freeze({ ...map }),
|
|
120
|
+
componentLookupStrategy: "static",
|
|
121
|
+
supportFilesStrategy,
|
|
122
|
+
resolve(componentName) {
|
|
123
|
+
const from = map[componentName];
|
|
124
|
+
if (!from) return;
|
|
125
|
+
return {
|
|
126
|
+
name: componentName,
|
|
127
|
+
from
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
resolveExternalMetadataCandidates(from) {
|
|
131
|
+
if (!from.startsWith("tdesign-miniprogram/")) return;
|
|
132
|
+
const segments = from.slice(20).split("/").filter(Boolean);
|
|
133
|
+
const componentDir = segments[0];
|
|
134
|
+
const fileBase = segments[segments.length - 1];
|
|
135
|
+
if (!componentDir || !fileBase) return;
|
|
136
|
+
const baseDir = `miniprogram_dist/${componentDir}`;
|
|
137
|
+
const base = `${baseDir}/${fileBase}`;
|
|
138
|
+
return {
|
|
139
|
+
packageName: "tdesign-miniprogram",
|
|
140
|
+
dts: [
|
|
141
|
+
`${baseDir}/type.d.ts`,
|
|
142
|
+
`${baseDir}/props.d.ts`,
|
|
143
|
+
`${base}.d.ts`,
|
|
144
|
+
`${baseDir}/index.d.ts`
|
|
145
|
+
],
|
|
146
|
+
js: [
|
|
147
|
+
`${baseDir}/type.js`,
|
|
148
|
+
`${baseDir}/props.js`,
|
|
149
|
+
`${base}.js`,
|
|
150
|
+
`${baseDir}/index.js`
|
|
151
|
+
]
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/auto-import-components/resolvers/json/uviewPlus.json
|
|
158
|
+
var uviewPlus_default = [
|
|
159
|
+
"u-action-sheet",
|
|
160
|
+
"u-action-sheet-data",
|
|
161
|
+
"u-agreement",
|
|
162
|
+
"u-album",
|
|
163
|
+
"u-alert",
|
|
164
|
+
"u-avatar",
|
|
165
|
+
"u-avatar-group",
|
|
166
|
+
"u-back-top",
|
|
167
|
+
"u-badge",
|
|
168
|
+
"u-barcode",
|
|
169
|
+
"u-box",
|
|
170
|
+
"u-button",
|
|
171
|
+
"u-calendar",
|
|
172
|
+
"u-calendar-strip",
|
|
173
|
+
"u-canvas",
|
|
174
|
+
"u-car-keyboard",
|
|
175
|
+
"u-card",
|
|
176
|
+
"u-cascader",
|
|
177
|
+
"u-cate-tab",
|
|
178
|
+
"u-cell",
|
|
179
|
+
"u-cell-group",
|
|
180
|
+
"u-checkbox",
|
|
181
|
+
"u-checkbox-group",
|
|
182
|
+
"u-choose",
|
|
183
|
+
"u-circle-progress",
|
|
184
|
+
"u-city-locate",
|
|
185
|
+
"u-code",
|
|
186
|
+
"u-code-input",
|
|
187
|
+
"u-col",
|
|
188
|
+
"u-collapse",
|
|
189
|
+
"u-collapse-item",
|
|
190
|
+
"u-color-picker",
|
|
191
|
+
"u-column-notice",
|
|
192
|
+
"u-copy",
|
|
193
|
+
"u-count-down",
|
|
194
|
+
"u-count-to",
|
|
195
|
+
"u-coupon",
|
|
196
|
+
"u-cropper",
|
|
197
|
+
"u-datetime-picker",
|
|
198
|
+
"u-divider",
|
|
199
|
+
"u-dragsort",
|
|
200
|
+
"u-dropdown",
|
|
201
|
+
"u-dropdown-item",
|
|
202
|
+
"u-empty",
|
|
203
|
+
"u-float-button",
|
|
204
|
+
"u-form",
|
|
205
|
+
"u-form-item",
|
|
206
|
+
"u-gap",
|
|
207
|
+
"u-goods-sku",
|
|
208
|
+
"u-grid",
|
|
209
|
+
"u-grid-item",
|
|
210
|
+
"u-guide",
|
|
211
|
+
"u-icon",
|
|
212
|
+
"u-image",
|
|
213
|
+
"u-index-anchor",
|
|
214
|
+
"u-index-item",
|
|
215
|
+
"u-index-list",
|
|
216
|
+
"u-input",
|
|
217
|
+
"u-keyboard",
|
|
218
|
+
"u-lazy-load",
|
|
219
|
+
"u-line",
|
|
220
|
+
"u-line-progress",
|
|
221
|
+
"u-link",
|
|
222
|
+
"u-list",
|
|
223
|
+
"u-list-item",
|
|
224
|
+
"u-loading-icon",
|
|
225
|
+
"u-loading-page",
|
|
226
|
+
"u-loadmore",
|
|
227
|
+
"u-markdown",
|
|
228
|
+
"u-message-input",
|
|
229
|
+
"u-modal",
|
|
230
|
+
"u-navbar",
|
|
231
|
+
"u-navbar-mini",
|
|
232
|
+
"u-no-network",
|
|
233
|
+
"u-notice-bar",
|
|
234
|
+
"u-notify",
|
|
235
|
+
"u-number-box",
|
|
236
|
+
"u-number-keyboard",
|
|
237
|
+
"u-overlay",
|
|
238
|
+
"u-pagination",
|
|
239
|
+
"u-parse",
|
|
240
|
+
"u-pdf-reader",
|
|
241
|
+
"u-picker",
|
|
242
|
+
"u-picker-column",
|
|
243
|
+
"u-picker-data",
|
|
244
|
+
"u-popover",
|
|
245
|
+
"u-popup",
|
|
246
|
+
"u-poster",
|
|
247
|
+
"u-pull-refresh",
|
|
248
|
+
"u-qrcode",
|
|
249
|
+
"u-radio",
|
|
250
|
+
"u-radio-group",
|
|
251
|
+
"u-rate",
|
|
252
|
+
"u-read-more",
|
|
253
|
+
"u-refresh-virtual-list",
|
|
254
|
+
"u-row",
|
|
255
|
+
"u-row-notice",
|
|
256
|
+
"u-safe-bottom",
|
|
257
|
+
"u-scroll-list",
|
|
258
|
+
"u-search",
|
|
259
|
+
"u-select",
|
|
260
|
+
"u-short-video",
|
|
261
|
+
"u-signature",
|
|
262
|
+
"u-skeleton",
|
|
263
|
+
"u-slider",
|
|
264
|
+
"u-status-bar",
|
|
265
|
+
"u-steps",
|
|
266
|
+
"u-steps-item",
|
|
267
|
+
"u-sticky",
|
|
268
|
+
"u-subsection",
|
|
269
|
+
"u-swipe-action",
|
|
270
|
+
"u-swipe-action-item",
|
|
271
|
+
"u-swiper",
|
|
272
|
+
"u-swiper-indicator",
|
|
273
|
+
"u-switch",
|
|
274
|
+
"u-tabbar",
|
|
275
|
+
"u-tabbar-item",
|
|
276
|
+
"u-table",
|
|
277
|
+
"u-table2",
|
|
278
|
+
"u-tabs",
|
|
279
|
+
"u-tabs-item",
|
|
280
|
+
"u-tag",
|
|
281
|
+
"u-td",
|
|
282
|
+
"u-text",
|
|
283
|
+
"u-textarea",
|
|
284
|
+
"u-th",
|
|
285
|
+
"u-title",
|
|
286
|
+
"u-toast",
|
|
287
|
+
"u-toolbar",
|
|
288
|
+
"u-tooltip",
|
|
289
|
+
"u-tr",
|
|
290
|
+
"u-transition",
|
|
291
|
+
"u-tree",
|
|
292
|
+
"u-upload",
|
|
293
|
+
"u-view",
|
|
294
|
+
"u-virtual-list",
|
|
295
|
+
"u-waterfall"
|
|
296
|
+
];
|
|
297
|
+
//#endregion
|
|
298
|
+
//#region src/auto-import-components/resolvers/uviewPlus.ts
|
|
299
|
+
const PACKAGE_NAME$1 = "uview-plus";
|
|
300
|
+
const require = createRequire(import.meta.url);
|
|
301
|
+
function resolveComponentId(from, importerBaseName) {
|
|
302
|
+
const paths = importerBaseName ? [path.dirname(importerBaseName), process.cwd()] : [process.cwd()];
|
|
303
|
+
try {
|
|
304
|
+
return require.resolve(from, { paths });
|
|
305
|
+
} catch {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
function toCamelCase(value) {
|
|
310
|
+
return value.replace(/-([a-z0-9])/g, (_match, letter) => letter.toUpperCase());
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* 创建 uview-plus 的 Vue SFC 自动导入解析器。
|
|
314
|
+
*/
|
|
315
|
+
function UviewPlusResolver(options = {}) {
|
|
316
|
+
const componentMap = Object.fromEntries(uviewPlus_default.flatMap((componentName) => {
|
|
317
|
+
const suffix = componentName.slice(2);
|
|
318
|
+
const from = `${PACKAGE_NAME$1}/components/${componentName}/${componentName}.vue`;
|
|
319
|
+
return [[componentName, from], [`up-${suffix}`, from]];
|
|
320
|
+
}));
|
|
321
|
+
return {
|
|
322
|
+
components: Object.freeze(componentMap),
|
|
323
|
+
supportFilesStrategy: options.supportFilesStrategy ?? "used",
|
|
324
|
+
resolve(componentName, importerBaseName) {
|
|
325
|
+
const from = componentMap[componentName];
|
|
326
|
+
if (!from) return;
|
|
327
|
+
return {
|
|
328
|
+
name: componentName,
|
|
329
|
+
from,
|
|
330
|
+
resolvedId: resolveComponentId(from, importerBaseName),
|
|
331
|
+
sourceType: "wevu-sfc",
|
|
332
|
+
typeImport: false
|
|
333
|
+
};
|
|
334
|
+
},
|
|
335
|
+
resolveExternalMetadataCandidates(from) {
|
|
336
|
+
if (!from.startsWith(`${PACKAGE_NAME$1}/components/`)) return;
|
|
337
|
+
const componentName = from.slice(`${PACKAGE_NAME$1}/components/`.length).split("/")[0];
|
|
338
|
+
if (!uviewPlus_default.includes(componentName)) return;
|
|
339
|
+
const suffix = componentName.slice(2);
|
|
340
|
+
const camelName = toCamelCase(suffix);
|
|
341
|
+
const componentConfigFiles = [`components/${componentName}/${camelName}.js`, `components/${componentName}/${suffix.replaceAll("-", "")}.js`].filter((candidate, index, all) => all.indexOf(candidate) === index);
|
|
342
|
+
return {
|
|
343
|
+
packageName: PACKAGE_NAME$1,
|
|
344
|
+
dts: [
|
|
345
|
+
`types/comps/${camelName}.d.ts`,
|
|
346
|
+
"types/comps.d.ts",
|
|
347
|
+
"types/index.d.ts"
|
|
348
|
+
],
|
|
349
|
+
js: [`components/${componentName}/props.js`, ...componentConfigFiles]
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region src/auto-import-components/resolvers/json/vant.json
|
|
356
|
+
var vant_default = [
|
|
357
|
+
"action-sheet",
|
|
358
|
+
"area",
|
|
359
|
+
"button",
|
|
360
|
+
"calendar",
|
|
361
|
+
"card",
|
|
362
|
+
"cascader",
|
|
363
|
+
"cell",
|
|
364
|
+
"cell-group",
|
|
365
|
+
"checkbox",
|
|
366
|
+
"checkbox-group",
|
|
367
|
+
"circle",
|
|
368
|
+
"col",
|
|
369
|
+
"collapse",
|
|
370
|
+
"collapse-item",
|
|
371
|
+
"config-provider",
|
|
372
|
+
"count-down",
|
|
373
|
+
"datetime-picker",
|
|
374
|
+
"definitions",
|
|
375
|
+
"dialog",
|
|
376
|
+
"divider",
|
|
377
|
+
"dropdown-item",
|
|
378
|
+
"dropdown-menu",
|
|
379
|
+
"empty",
|
|
380
|
+
"field",
|
|
381
|
+
"goods-action",
|
|
382
|
+
"goods-action-button",
|
|
383
|
+
"goods-action-icon",
|
|
384
|
+
"grid",
|
|
385
|
+
"grid-item",
|
|
386
|
+
"icon",
|
|
387
|
+
"image",
|
|
388
|
+
"index-anchor",
|
|
389
|
+
"index-bar",
|
|
390
|
+
"info",
|
|
391
|
+
"loading",
|
|
392
|
+
"nav-bar",
|
|
393
|
+
"notice-bar",
|
|
394
|
+
"notify",
|
|
395
|
+
"overlay",
|
|
396
|
+
"panel",
|
|
397
|
+
"picker",
|
|
398
|
+
"picker-column",
|
|
399
|
+
"popup",
|
|
400
|
+
"progress",
|
|
401
|
+
"radio",
|
|
402
|
+
"radio-group",
|
|
403
|
+
"rate",
|
|
404
|
+
"row",
|
|
405
|
+
"search",
|
|
406
|
+
"share-sheet",
|
|
407
|
+
"sidebar",
|
|
408
|
+
"sidebar-item",
|
|
409
|
+
"skeleton",
|
|
410
|
+
"slider",
|
|
411
|
+
"stepper",
|
|
412
|
+
"steps",
|
|
413
|
+
"sticky",
|
|
414
|
+
"submit-bar",
|
|
415
|
+
"swipe-cell",
|
|
416
|
+
"switch",
|
|
417
|
+
"tab",
|
|
418
|
+
"tabbar",
|
|
419
|
+
"tabbar-item",
|
|
420
|
+
"tabs",
|
|
421
|
+
"tag",
|
|
422
|
+
"toast",
|
|
423
|
+
"transition",
|
|
424
|
+
"tree-select",
|
|
425
|
+
"uploader"
|
|
426
|
+
];
|
|
427
|
+
//#endregion
|
|
428
|
+
//#region src/auto-import-components/resolvers/vant.ts
|
|
429
|
+
const defaultPrefix$1 = "van-";
|
|
430
|
+
const VantResolver = (opts) => {
|
|
431
|
+
const { prefix, resolve, supportFilesStrategy } = defu(opts, {
|
|
432
|
+
prefix: defaultPrefix$1,
|
|
433
|
+
supportFilesStrategy: "full",
|
|
434
|
+
resolve({ name, prefix }) {
|
|
435
|
+
return {
|
|
436
|
+
key: `${prefix}${name}`,
|
|
437
|
+
value: `@vant/weapp/${name}`
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
const map = vant_default.reduce((acc, cur) => {
|
|
442
|
+
const { key, value } = resolve({
|
|
443
|
+
name: cur,
|
|
444
|
+
prefix
|
|
445
|
+
});
|
|
446
|
+
acc[key] = value;
|
|
447
|
+
return acc;
|
|
448
|
+
}, {});
|
|
449
|
+
return {
|
|
450
|
+
components: Object.freeze({ ...map }),
|
|
451
|
+
componentLookupStrategy: "static",
|
|
452
|
+
supportFilesStrategy,
|
|
453
|
+
resolve(componentName) {
|
|
454
|
+
const from = map[componentName];
|
|
455
|
+
if (!from) return;
|
|
456
|
+
return {
|
|
457
|
+
name: componentName,
|
|
458
|
+
from
|
|
459
|
+
};
|
|
460
|
+
},
|
|
461
|
+
resolveExternalMetadataCandidates(from) {
|
|
462
|
+
if (!from.startsWith("@vant/weapp/")) return;
|
|
463
|
+
const component = from.slice(12);
|
|
464
|
+
if (!component) return;
|
|
465
|
+
return {
|
|
466
|
+
packageName: "@vant/weapp",
|
|
467
|
+
dts: [`lib/${component}/index.d.ts`, `dist/${component}/index.d.ts`],
|
|
468
|
+
js: [`lib/${component}/index.js`, `dist/${component}/index.js`]
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
};
|
|
472
|
+
};
|
|
473
|
+
//#endregion
|
|
474
|
+
//#region src/auto-import-components/resolvers/json/weui.json
|
|
475
|
+
var weui_default = [
|
|
476
|
+
"actionsheet",
|
|
477
|
+
"badge",
|
|
478
|
+
"cell",
|
|
479
|
+
"cells",
|
|
480
|
+
"checkbox",
|
|
481
|
+
"checkbox-group",
|
|
482
|
+
"dialog",
|
|
483
|
+
"form",
|
|
484
|
+
"form-page",
|
|
485
|
+
"gallery",
|
|
486
|
+
"grids",
|
|
487
|
+
"half-screen-dialog",
|
|
488
|
+
"icon",
|
|
489
|
+
"loading",
|
|
490
|
+
"msg",
|
|
491
|
+
"navigation-bar",
|
|
492
|
+
"searchbar",
|
|
493
|
+
"slideview",
|
|
494
|
+
"tabbar",
|
|
495
|
+
"toptips",
|
|
496
|
+
"uploader"
|
|
497
|
+
];
|
|
498
|
+
//#endregion
|
|
499
|
+
//#region src/auto-import-components/resolvers/weui.ts
|
|
500
|
+
const defaultPrefix = "mp-";
|
|
501
|
+
const WeuiResolver = (opts) => {
|
|
502
|
+
const { prefix, resolve, supportFilesStrategy } = defu(opts, {
|
|
503
|
+
prefix: defaultPrefix,
|
|
504
|
+
supportFilesStrategy: "full",
|
|
505
|
+
resolve({ name, prefix }) {
|
|
506
|
+
return {
|
|
507
|
+
key: `${prefix}${name}`,
|
|
508
|
+
value: `weui-miniprogram/${name}/${name}`
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
const map = weui_default.reduce((acc, cur) => {
|
|
513
|
+
const { key, value } = resolve({
|
|
514
|
+
name: cur,
|
|
515
|
+
prefix
|
|
516
|
+
});
|
|
517
|
+
acc[key] = value;
|
|
518
|
+
return acc;
|
|
519
|
+
}, {});
|
|
520
|
+
return {
|
|
521
|
+
components: Object.freeze({ ...map }),
|
|
522
|
+
componentLookupStrategy: "static",
|
|
523
|
+
supportFilesStrategy,
|
|
524
|
+
resolve(componentName) {
|
|
525
|
+
const from = map[componentName];
|
|
526
|
+
if (!from) return;
|
|
527
|
+
return {
|
|
528
|
+
name: componentName,
|
|
529
|
+
from
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
};
|
|
534
|
+
//#endregion
|
|
535
|
+
//#region src/auto-import-components/resolvers/json/wotUi.json
|
|
536
|
+
var wotUi_default = [
|
|
537
|
+
"wd-action-sheet",
|
|
538
|
+
"wd-avatar",
|
|
539
|
+
"wd-avatar-group",
|
|
540
|
+
"wd-backtop",
|
|
541
|
+
"wd-badge",
|
|
542
|
+
"wd-button",
|
|
543
|
+
"wd-calendar",
|
|
544
|
+
"wd-calendar-view",
|
|
545
|
+
"wd-card",
|
|
546
|
+
"wd-cascader",
|
|
547
|
+
"wd-cell",
|
|
548
|
+
"wd-cell-group",
|
|
549
|
+
"wd-checkbox",
|
|
550
|
+
"wd-checkbox-group",
|
|
551
|
+
"wd-circle",
|
|
552
|
+
"wd-col",
|
|
553
|
+
"wd-collapse",
|
|
554
|
+
"wd-collapse-item",
|
|
555
|
+
"wd-config-provider",
|
|
556
|
+
"wd-count-down",
|
|
557
|
+
"wd-count-to",
|
|
558
|
+
"wd-curtain",
|
|
559
|
+
"wd-datetime-picker",
|
|
560
|
+
"wd-datetime-picker-view",
|
|
561
|
+
"wd-dialog",
|
|
562
|
+
"wd-divider",
|
|
563
|
+
"wd-drop-menu",
|
|
564
|
+
"wd-drop-menu-item",
|
|
565
|
+
"wd-empty",
|
|
566
|
+
"wd-fab",
|
|
567
|
+
"wd-floating-panel",
|
|
568
|
+
"wd-form",
|
|
569
|
+
"wd-form-item",
|
|
570
|
+
"wd-gap",
|
|
571
|
+
"wd-grid",
|
|
572
|
+
"wd-grid-item",
|
|
573
|
+
"wd-icon",
|
|
574
|
+
"wd-image-preview",
|
|
575
|
+
"wd-img",
|
|
576
|
+
"wd-img-cropper",
|
|
577
|
+
"wd-index-anchor",
|
|
578
|
+
"wd-index-bar",
|
|
579
|
+
"wd-input",
|
|
580
|
+
"wd-input-number",
|
|
581
|
+
"wd-keyboard",
|
|
582
|
+
"wd-loading",
|
|
583
|
+
"wd-loadmore",
|
|
584
|
+
"wd-navbar",
|
|
585
|
+
"wd-navbar-capsule",
|
|
586
|
+
"wd-notice-bar",
|
|
587
|
+
"wd-notify",
|
|
588
|
+
"wd-overlay",
|
|
589
|
+
"wd-pagination",
|
|
590
|
+
"wd-password-input",
|
|
591
|
+
"wd-picker",
|
|
592
|
+
"wd-picker-view",
|
|
593
|
+
"wd-popover",
|
|
594
|
+
"wd-popup",
|
|
595
|
+
"wd-progress",
|
|
596
|
+
"wd-radio",
|
|
597
|
+
"wd-radio-group",
|
|
598
|
+
"wd-rate",
|
|
599
|
+
"wd-resize",
|
|
600
|
+
"wd-root-portal",
|
|
601
|
+
"wd-row",
|
|
602
|
+
"wd-search",
|
|
603
|
+
"wd-segmented",
|
|
604
|
+
"wd-select-picker",
|
|
605
|
+
"wd-sidebar",
|
|
606
|
+
"wd-sidebar-item",
|
|
607
|
+
"wd-signature",
|
|
608
|
+
"wd-skeleton",
|
|
609
|
+
"wd-slide-verify",
|
|
610
|
+
"wd-slider",
|
|
611
|
+
"wd-sort-button",
|
|
612
|
+
"wd-step",
|
|
613
|
+
"wd-steps",
|
|
614
|
+
"wd-sticky",
|
|
615
|
+
"wd-sticky-box",
|
|
616
|
+
"wd-swipe-action",
|
|
617
|
+
"wd-swiper",
|
|
618
|
+
"wd-swiper-nav",
|
|
619
|
+
"wd-switch",
|
|
620
|
+
"wd-tab",
|
|
621
|
+
"wd-tabbar",
|
|
622
|
+
"wd-tabbar-item",
|
|
623
|
+
"wd-table",
|
|
624
|
+
"wd-table-column",
|
|
625
|
+
"wd-tabs",
|
|
626
|
+
"wd-tag",
|
|
627
|
+
"wd-text",
|
|
628
|
+
"wd-textarea",
|
|
629
|
+
"wd-toast",
|
|
630
|
+
"wd-tooltip",
|
|
631
|
+
"wd-tour",
|
|
632
|
+
"wd-transition",
|
|
633
|
+
"wd-upload",
|
|
634
|
+
"wd-video-preview",
|
|
635
|
+
"wd-watermark"
|
|
636
|
+
];
|
|
637
|
+
//#endregion
|
|
638
|
+
//#region src/auto-import-components/resolvers/wotUi.ts
|
|
639
|
+
const PACKAGE_NAME = "@wot-ui/ui";
|
|
640
|
+
/**
|
|
641
|
+
* 创建 Wot UI 的 Vue SFC 自动导入解析器。
|
|
642
|
+
*/
|
|
643
|
+
function WotUiResolver(options) {
|
|
644
|
+
const resolvedOptions = defu(options, {
|
|
645
|
+
prefix: "wd-",
|
|
646
|
+
supportFilesStrategy: "used"
|
|
647
|
+
});
|
|
648
|
+
const componentMap = Object.fromEntries(wotUi_default.map((componentName) => {
|
|
649
|
+
const suffix = componentName.slice(3);
|
|
650
|
+
return [`${resolvedOptions.prefix}${suffix}`, `${PACKAGE_NAME}/components/${componentName}/${componentName}.vue`];
|
|
651
|
+
}));
|
|
652
|
+
return {
|
|
653
|
+
components: Object.freeze(componentMap),
|
|
654
|
+
supportFilesStrategy: resolvedOptions.supportFilesStrategy,
|
|
655
|
+
resolve(componentName) {
|
|
656
|
+
const from = componentMap[componentName];
|
|
657
|
+
if (!from) return;
|
|
658
|
+
return {
|
|
659
|
+
name: componentName,
|
|
660
|
+
from,
|
|
661
|
+
resolvedId: from,
|
|
662
|
+
sourceType: "wevu-sfc",
|
|
663
|
+
typeImport: false
|
|
664
|
+
};
|
|
665
|
+
},
|
|
666
|
+
resolveExternalMetadataCandidates(from) {
|
|
667
|
+
if (!from.startsWith(`${PACKAGE_NAME}/components/`)) return;
|
|
668
|
+
const relative = from.slice(`${PACKAGE_NAME}/`.length).replace(/\.vue$/, "");
|
|
669
|
+
const componentDir = relative.split("/")[1];
|
|
670
|
+
return {
|
|
671
|
+
packageName: PACKAGE_NAME,
|
|
672
|
+
dts: [
|
|
673
|
+
`${relative}.d.ts`,
|
|
674
|
+
`components/${componentDir}/types.d.ts`,
|
|
675
|
+
`components/${componentDir}/type.d.ts`,
|
|
676
|
+
"global.d.ts"
|
|
677
|
+
],
|
|
678
|
+
js: []
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
//#endregion
|
|
684
|
+
export { TDesignResolver as a, UviewPlusResolver as i, WeuiResolver as n, VantResolver as r, WotUiResolver as t };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as UviewPlusResolver, c as CreateResolver, d as ResolvedValue, f as Resolver, g as ResolverSupportFilesStrategy, h as ResolverObject, i as VantResolver, l as ExternalMetadataFileCandidates, m as ResolverMeta, n as WotUiResolverOptions, o as UviewPlusResolverOptions, p as ResolverFn, r as WeuiResolver, s as TDesignResolver, t as WotUiResolver, u as Options } from "./index-CaXAtb9e.mjs";
|
|
2
|
+
export { CreateResolver, ExternalMetadataFileCandidates, Options, ResolvedValue, Resolver, ResolverFn, ResolverMeta, ResolverObject, ResolverSupportFilesStrategy, TDesignResolver, UviewPlusResolver, UviewPlusResolverOptions, VantResolver, WeuiResolver, WotUiResolver, WotUiResolverOptions };
|
package/dist/test.d.mts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/testArtifact.d.ts
|
|
2
|
+
interface BuildTestArtifactOptions {
|
|
3
|
+
configFile?: string;
|
|
4
|
+
cwd?: string;
|
|
5
|
+
mode?: string;
|
|
6
|
+
outDir?: string;
|
|
7
|
+
projectConfigPath?: string;
|
|
8
|
+
skipNpm?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface WeappViteTestArtifact {
|
|
11
|
+
appConfigPath: string;
|
|
12
|
+
miniprogramRootPath: string;
|
|
13
|
+
projectPath: string;
|
|
14
|
+
sourceRootPath: string;
|
|
15
|
+
}
|
|
16
|
+
interface WatchTestArtifactOptions extends BuildTestArtifactOptions {
|
|
17
|
+
onError?: (error: unknown) => void;
|
|
18
|
+
onRebuilt?: (artifact: WeappViteTestArtifact) => void | Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
interface WeappViteTestArtifactWatcher {
|
|
21
|
+
artifact: WeappViteTestArtifact;
|
|
22
|
+
close: () => Promise<void>;
|
|
23
|
+
rebuild: () => Promise<WeappViteTestArtifact>;
|
|
24
|
+
}
|
|
25
|
+
declare function buildTestArtifact(options?: BuildTestArtifactOptions): Promise<{
|
|
26
|
+
appConfigPath: string;
|
|
27
|
+
miniprogramRootPath: string;
|
|
28
|
+
projectPath: string;
|
|
29
|
+
sourceRootPath: string;
|
|
30
|
+
}>;
|
|
31
|
+
declare function watchTestArtifact(options?: WatchTestArtifactOptions): Promise<WeappViteTestArtifactWatcher>;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { BuildTestArtifactOptions, WatchTestArtifactOptions, WeappViteTestArtifact, WeappViteTestArtifactWatcher, buildTestArtifact, watchTestArtifact };
|