fix(uniapp): 修复pages.json虚拟分包导致的微信开发者工具丢失wxml错误,确保13个原生页面物理文件对齐
这个提交包含在:
@@ -125,77 +125,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"subPackages": [
|
|
||||||
{
|
|
||||||
"root": "subpackages/expert",
|
|
||||||
"name": "expert-subpkg",
|
|
||||||
"pages": [
|
|
||||||
{
|
|
||||||
"path": "workspace",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "大神接单工作台",
|
|
||||||
"navigationBarBackgroundColor": "#0A0F1D",
|
|
||||||
"navigationBarTextStyle": "white",
|
|
||||||
"backgroundColor": "#0A0F1D"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "radar",
|
|
||||||
"style": {
|
|
||||||
"navigationStyle": "custom",
|
|
||||||
"navigationBarTitleText": "我要接单",
|
|
||||||
"navigationBarBackgroundColor": "#0A0F1D",
|
|
||||||
"navigationBarTextStyle": "white",
|
|
||||||
"backgroundColor": "#0A0F1D"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "hall",
|
|
||||||
"style": {
|
|
||||||
"navigationStyle": "custom",
|
|
||||||
"navigationBarTitleText": "接单大厅",
|
|
||||||
"navigationBarBackgroundColor": "#0A0F1D",
|
|
||||||
"navigationBarTextStyle": "white",
|
|
||||||
"backgroundColor": "#0A0F1D"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"root": "subpackages/activity",
|
|
||||||
"name": "activity-subpkg",
|
|
||||||
"pages": [
|
|
||||||
{
|
|
||||||
"path": "create",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "我要发单 / 发起组队",
|
|
||||||
"navigationBarBackgroundColor": "#0A0F1D",
|
|
||||||
"navigationBarTextStyle": "white",
|
|
||||||
"backgroundColor": "#0A0F1D"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "my-ticket",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "我的活动门票",
|
|
||||||
"navigationBarBackgroundColor": "#0A0F1D",
|
|
||||||
"navigationBarTextStyle": "white",
|
|
||||||
"backgroundColor": "#0A0F1D"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"preloadRule": {
|
|
||||||
"pages/index/index": {
|
|
||||||
"network": "all",
|
|
||||||
"packages": ["subpackages/activity"]
|
|
||||||
},
|
|
||||||
"pages/user/index": {
|
|
||||||
"network": "all",
|
|
||||||
"packages": ["subpackages/expert"]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationBarTitleText": "陪玩中心",
|
"navigationBarTitleText": "陪玩中心",
|
||||||
|
|||||||
@@ -123,29 +123,28 @@ describe('ContentSecurityService & Compliance Architecture (TDD 微信内容安
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('4. 小程序主包与分包架构配置规范性验证 (pages.json)', () => {
|
describe('4. 小程序页面架构配置与文件完整性门禁验证 (pages.json)', () => {
|
||||||
const pagesJsonPath = path.join(rootDir, 'pwuniapp', 'pages.json');
|
const pagesJsonPath = path.join(rootDir, 'pwuniapp', 'pages.json');
|
||||||
|
|
||||||
it('pages.json 必须显式配置 subPackages 分包结构', () => {
|
it('pages.json 注册的所有页面必须在源码目录物理存在,杜绝模拟器启动丢失 wxml 崩溃', () => {
|
||||||
const raw = fs.readFileSync(pagesJsonPath, 'utf-8');
|
const raw = fs.readFileSync(pagesJsonPath, 'utf-8');
|
||||||
const config = JSON.parse(raw);
|
const config = JSON.parse(raw);
|
||||||
expect(Array.isArray(config.subPackages)).toBe(true);
|
expect(Array.isArray(config.pages)).toBe(true);
|
||||||
expect(config.subPackages.length).toBeGreaterThanOrEqual(2);
|
expect(config.pages.length).toBe(13);
|
||||||
|
|
||||||
const roots = config.subPackages.map((s: any) => s.root);
|
for (const pageItem of config.pages) {
|
||||||
expect(roots).toContain('subpackages/expert');
|
const vueFilePath = path.join(rootDir, 'pwuniapp', `${pageItem.path}.vue`);
|
||||||
expect(roots).toContain('subpackages/activity');
|
expect({
|
||||||
|
path: pageItem.path,
|
||||||
|
exists: fs.existsSync(vueFilePath)
|
||||||
|
}).toEqual({
|
||||||
|
path: pageItem.path,
|
||||||
|
exists: true
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('必须配置主包向分包的智能预加载规则 preloadRule', () => {
|
it('主包核心 TabBar 页面保持精炼且四大主页全部就绪', () => {
|
||||||
const raw = fs.readFileSync(pagesJsonPath, 'utf-8');
|
|
||||||
const config = JSON.parse(raw);
|
|
||||||
expect(config.preloadRule).toBeDefined();
|
|
||||||
expect(config.preloadRule['pages/index/index']).toBeDefined();
|
|
||||||
expect(config.preloadRule['pages/user/index']).toBeDefined();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('主包核心 TabBar 页面保持精炼', () => {
|
|
||||||
const raw = fs.readFileSync(pagesJsonPath, 'utf-8');
|
const raw = fs.readFileSync(pagesJsonPath, 'utf-8');
|
||||||
const config = JSON.parse(raw);
|
const config = JSON.parse(raw);
|
||||||
const tabPaths = config.tabBar.list.map((t: any) => t.pagePath);
|
const tabPaths = config.tabBar.list.map((t: any) => t.pagePath);
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户