@ray-js/build-plugin-router 0.7.1-beta-1 → 0.7.3-beta-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/lib/index.js +7 -6
- package/package.json +4 -4
package/lib/index.js
CHANGED
|
@@ -227,20 +227,21 @@ function PluginRouter(api) {
|
|
|
227
227
|
* @param globalConfig - 已存在的应用配置
|
|
228
228
|
*/
|
|
229
229
|
getStandardAppConfigData(routesConfig, globalConfig) {
|
|
230
|
-
var _a, _b, _c, _d
|
|
230
|
+
var _a, _b, _c, _d;
|
|
231
231
|
const { target } = api.options;
|
|
232
232
|
const g = target === 'thing'
|
|
233
233
|
? (_b = (_a = globalConfig['thing']) !== null && _a !== void 0 ? _a : globalConfig['tuya']) !== null && _b !== void 0 ? _b : {} // 因历史原因,需要兼容老项目的老配置,老项目中都是 tuya
|
|
234
234
|
: (_c = globalConfig[target]) !== null && _c !== void 0 ? _c : {};
|
|
235
|
-
const routes =
|
|
235
|
+
const { routes = [], subpackages, subPackages, tabBar: _tabBar } = routesConfig, otherConfig = __rest(routesConfig, ["routes", "subpackages", "subPackages", "tabBar"]);
|
|
236
|
+
const _routes = routes.map((item) => {
|
|
236
237
|
var _a;
|
|
237
238
|
item.route = (_a = item.route) !== null && _a !== void 0 ? _a : item.path;
|
|
238
239
|
return item;
|
|
239
240
|
});
|
|
240
|
-
const subPkgs = (
|
|
241
|
-
const pages = lodash_1.default.uniq(
|
|
242
|
-
const tabBar = normalizeTabBarConfig(
|
|
243
|
-
const config = Object.assign(Object.assign({}, g), { pages, tabBar });
|
|
241
|
+
const subPkgs = (_d = subPackages !== null && subPackages !== void 0 ? subPackages : subpackages) !== null && _d !== void 0 ? _d : [];
|
|
242
|
+
const pages = lodash_1.default.uniq(_routes.map((r) => r.path.replace(/^\//, '')));
|
|
243
|
+
const tabBar = normalizeTabBarConfig(_tabBar, _routes, standardAppConfigFieldMap);
|
|
244
|
+
const config = Object.assign(Object.assign(Object.assign({}, g), otherConfig), { pages, tabBar });
|
|
244
245
|
if (subPkgs && subPkgs.length) {
|
|
245
246
|
config.subpackages = subPkgs.map((pkg) => {
|
|
246
247
|
var _a;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/build-plugin-router",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3-beta-1",
|
|
4
4
|
"description": "Ray build plugin for router",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ray"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"watch": "tsc -p ./tsconfig.build.json --watch"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@ray-js/shared": "^0.7.
|
|
24
|
+
"@ray-js/shared": "^0.7.3-beta-1",
|
|
25
25
|
"chokidar": "^3.5.2",
|
|
26
26
|
"colors": "1.4.0",
|
|
27
27
|
"ejs": "^3.1.6",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"url": "^0.11.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@ray-js/types": "^0.7.
|
|
33
|
+
"@ray-js/types": "^0.7.3-beta-1"
|
|
34
34
|
},
|
|
35
35
|
"maintainers": [
|
|
36
36
|
{
|
|
@@ -38,6 +38,6 @@
|
|
|
38
38
|
"email": "tuyafe@tuya.com"
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "7bf0a660651d23a0a5580e2d18f956689c30db0c",
|
|
42
42
|
"repository": {}
|
|
43
43
|
}
|