@open-wxa/wxa-runner-core 0.4.0 → 0.4.1
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.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -15,6 +15,7 @@ interface AppJson {
|
|
|
15
15
|
entryPagePath?: string;
|
|
16
16
|
window?: Record<string, any>;
|
|
17
17
|
tabBar?: {
|
|
18
|
+
custom?: boolean;
|
|
18
19
|
list: Array<{
|
|
19
20
|
pagePath: string;
|
|
20
21
|
text?: string;
|
|
@@ -66,7 +67,7 @@ declare class MiniProgram {
|
|
|
66
67
|
* 规则:/ 开头为根目录绝对路径;否则先按相对路径找,再沿目录向上查找 miniprogram_npm。
|
|
67
68
|
*/
|
|
68
69
|
resolveComponent(fromId: string, ref: string): string | null;
|
|
69
|
-
/**
|
|
70
|
+
/** 收集页面、隐式自定义 tabBar 及它们(递归)引用到的组件 */
|
|
70
71
|
collectUnits(app: AppJson): {
|
|
71
72
|
pages: string[];
|
|
72
73
|
components: string[];
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ interface AppJson {
|
|
|
15
15
|
entryPagePath?: string;
|
|
16
16
|
window?: Record<string, any>;
|
|
17
17
|
tabBar?: {
|
|
18
|
+
custom?: boolean;
|
|
18
19
|
list: Array<{
|
|
19
20
|
pagePath: string;
|
|
20
21
|
text?: string;
|
|
@@ -66,7 +67,7 @@ declare class MiniProgram {
|
|
|
66
67
|
* 规则:/ 开头为根目录绝对路径;否则先按相对路径找,再沿目录向上查找 miniprogram_npm。
|
|
67
68
|
*/
|
|
68
69
|
resolveComponent(fromId: string, ref: string): string | null;
|
|
69
|
-
/**
|
|
70
|
+
/** 收集页面、隐式自定义 tabBar 及它们(递归)引用到的组件 */
|
|
70
71
|
collectUnits(app: AppJson): {
|
|
71
72
|
pages: string[];
|
|
72
73
|
components: string[];
|
package/dist/index.js
CHANGED
|
@@ -412,7 +412,7 @@ var MiniProgram = class {
|
|
|
412
412
|
}
|
|
413
413
|
return null;
|
|
414
414
|
}
|
|
415
|
-
/**
|
|
415
|
+
/** 收集页面、隐式自定义 tabBar 及它们(递归)引用到的组件 */
|
|
416
416
|
collectUnits(app) {
|
|
417
417
|
const pages = this.allPages(app);
|
|
418
418
|
const components = [];
|
|
@@ -423,15 +423,15 @@ var MiniProgram = class {
|
|
|
423
423
|
for (const generic of Object.values(json.componentGenerics || {})) {
|
|
424
424
|
if (typeof generic === "object" && generic.default) refs.push(generic.default);
|
|
425
425
|
}
|
|
426
|
-
for (const ref of refs)
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
}
|
|
426
|
+
for (const ref of refs) enter(this.resolveComponent(id, ref));
|
|
427
|
+
};
|
|
428
|
+
const enter = (id) => {
|
|
429
|
+
if (!id || visited.has(id)) return;
|
|
430
|
+
visited.add(id);
|
|
431
|
+
components.push(id);
|
|
432
|
+
visit(id);
|
|
434
433
|
};
|
|
434
|
+
if (app.tabBar?.custom) enter(this.resolveComponent("app", "/custom-tab-bar/index"));
|
|
435
435
|
pages.forEach(visit);
|
|
436
436
|
return { pages, components };
|
|
437
437
|
}
|