@dcloudio/uni-cli-shared 3.0.0-alpha-5000420260319001 → 3.0.0-alpha-5000520260323001

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.
@@ -64,6 +64,30 @@ function checkPagesJson(jsonStr, inputDir) {
64
64
  });
65
65
  }
66
66
  });
67
+ const tabBarNode = root.children?.find((child) => child.type === 'property' &&
68
+ child.children?.length === 2 &&
69
+ child.children[0].value === 'tabBar');
70
+ if (process.env.UNI_APP_X_DOM2 !== 'true' && tabBarNode) {
71
+ // dom2下不支持tabBar配置项,这里先不校验
72
+ let allPages = []; // 收集全部页面,包含分包页面
73
+ let tabBarPages = []; // 收集 tabBar 页面
74
+ allPages.push(...pagePathNodes.map((node) => node.value));
75
+ findRootNode(tabBarNode.children[1], ['list']).forEach((node) => {
76
+ const pagePathNode = node.type === 'object' &&
77
+ node.children?.find((child) => child.type === 'property' &&
78
+ child.children?.length === 2 &&
79
+ child.children[0].value === 'pagePath');
80
+ if (pagePathNode) {
81
+ const pagePathValueNode = pagePathNode.children[1];
82
+ const pagePath = pagePathValueNode.value;
83
+ tabBarPages.push(pagePath);
84
+ if (!allPages.includes(pagePath) &&
85
+ !allPages.includes(pagePath.substring(1))) {
86
+ throwCompilerError(jsonStr, pagePathValueNode, messages_1.M['pages.json.tabbar.page.notfound'].replace('{pagePath}', pagePath));
87
+ }
88
+ }
89
+ });
90
+ }
67
91
  for (const node of pagePathNodes) {
68
92
  const pagePath = node.value ?? '';
69
93
  if (!pageExistsWithCaseSync(path_1.default.join(inputDir, pagePath))) {
@@ -48,5 +48,6 @@ declare const _default: {
48
48
  readonly 'uni_modules.import': "Plug-in [{0}] only supports @/uni_modules/{1}.";
49
49
  readonly 'pages.json.page.notfound': "The page \"{pagePath}\" does not exist.";
50
50
  readonly 'pages.json.page.slash': "The Path \"{pagePath}\" cannot start with \"/\"";
51
+ readonly 'pages.json.tabbar.page.notfound': "The tabBar page \"{pagePath}\" is not declared in \"pages.json\".";
51
52
  };
52
53
  export default _default;
@@ -50,4 +50,5 @@ exports.default = {
50
50
  'uni_modules.import': 'Plug-in [{0}] only supports @/uni_modules/{1}.',
51
51
  'pages.json.page.notfound': 'The page "{pagePath}" does not exist.',
52
52
  'pages.json.page.slash': 'The Path "{pagePath}" cannot start with "/"',
53
+ 'pages.json.tabbar.page.notfound': 'The tabBar page "{pagePath}" is not declared in "pages.json".',
53
54
  };
@@ -48,6 +48,7 @@ export declare const M: {
48
48
  readonly 'uni_modules.import': "插件[{0}]仅支持 @/uni_modules/{1} 方式引入,不支持直接导入内部文件 {2}。";
49
49
  readonly 'pages.json.page.notfound': "页面\"{pagePath}\"不存在,请确保填写的页面路径不包含文件后缀,且必须与真实的文件路径大小写保持一致。";
50
50
  readonly 'pages.json.page.slash': "路径 \"{pagePath}\" 不能以 \"/\" 开头";
51
+ readonly 'pages.json.tabbar.page.notfound': "tabBar 中配置的页面 \"{pagePath}\" 未在 pages.json 中注册。";
51
52
  } | {
52
53
  readonly 'app.compiler.version': "Compiler version: {version}";
53
54
  readonly compiling: "Compiling...";
@@ -98,4 +99,5 @@ export declare const M: {
98
99
  readonly 'uni_modules.import': "Plug-in [{0}] only supports @/uni_modules/{1}.";
99
100
  readonly 'pages.json.page.notfound': "The page \"{pagePath}\" does not exist.";
100
101
  readonly 'pages.json.page.slash': "The Path \"{pagePath}\" cannot start with \"/\"";
102
+ readonly 'pages.json.tabbar.page.notfound': "The tabBar page \"{pagePath}\" is not declared in \"pages.json\".";
101
103
  };
@@ -48,5 +48,6 @@ declare const _default: {
48
48
  readonly 'uni_modules.import': "插件[{0}]仅支持 @/uni_modules/{1} 方式引入,不支持直接导入内部文件 {2}。";
49
49
  readonly 'pages.json.page.notfound': "页面\"{pagePath}\"不存在,请确保填写的页面路径不包含文件后缀,且必须与真实的文件路径大小写保持一致。";
50
50
  readonly 'pages.json.page.slash': "路径 \"{pagePath}\" 不能以 \"/\" 开头";
51
+ readonly 'pages.json.tabbar.page.notfound': "tabBar 中配置的页面 \"{pagePath}\" 未在 pages.json 中注册。";
51
52
  };
52
53
  export default _default;
@@ -51,4 +51,5 @@ exports.default = {
51
51
  'uni_modules.import': '插件[{0}]仅支持 @/uni_modules/{1} 方式引入,不支持直接导入内部文件 {2}。',
52
52
  'pages.json.page.notfound': '页面"{pagePath}"不存在,请确保填写的页面路径不包含文件后缀,且必须与真实的文件路径大小写保持一致。',
53
53
  'pages.json.page.slash': '路径 "{pagePath}" 不能以 "/" 开头',
54
+ 'pages.json.tabbar.page.notfound': 'tabBar 中配置的页面 "{pagePath}" 未在 pages.json 中注册。',
54
55
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-cli-shared",
3
- "version": "3.0.0-alpha-5000420260319001",
3
+ "version": "3.0.0-alpha-5000520260323001",
4
4
  "description": "@dcloudio/uni-cli-shared",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -69,9 +69,9 @@
69
69
  "unimport": "4.1.1",
70
70
  "unplugin-auto-import": "19.1.0",
71
71
  "xregexp": "5.1.2",
72
- "@dcloudio/uni-nvue-styler": "3.0.0-alpha-5000420260319001",
73
- "@dcloudio/uni-shared": "3.0.0-alpha-5000420260319001",
74
- "@dcloudio/uni-i18n": "3.0.0-alpha-5000420260319001"
72
+ "@dcloudio/uni-nvue-styler": "3.0.0-alpha-5000520260323001",
73
+ "@dcloudio/uni-i18n": "3.0.0-alpha-5000520260323001",
74
+ "@dcloudio/uni-shared": "3.0.0-alpha-5000520260323001"
75
75
  },
76
76
  "gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
77
77
  "devDependencies": {
@@ -91,6 +91,6 @@
91
91
  "code-frame": "link:@types/@babel/code-frame",
92
92
  "postcss": "8.4.45",
93
93
  "vue": "3.4.21",
94
- "@dcloudio/uni-uts-v1": "3.0.0-alpha-5000420260319001"
94
+ "@dcloudio/uni-uts-v1": "3.0.0-alpha-5000520260323001"
95
95
  }
96
96
  }