@xfe-repo/mini-router 0.0.1 → 0.0.2

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.ts CHANGED
@@ -22,6 +22,7 @@ type Config = {
22
22
  declare const getAppConfig: () => Config;
23
23
  declare const getAllPages: () => string[];
24
24
  declare const getTabBarPages: () => string[];
25
+ declare const getHomePage: () => string;
25
26
 
26
27
  declare const asyncNavigateTo: (path: string, replace?: boolean) => Promise<TaroGeneral.CallbackResult | undefined>;
27
28
  declare const navigateTo: debounce<(path: string, replace?: boolean) => Promise<TaroGeneral.CallbackResult | undefined>>;
@@ -30,4 +31,4 @@ declare const navigateBack: (option?: Taro.navigateBack.Option & {
30
31
  }) => Promise<void>;
31
32
  declare const formatPath: (path: string) => string;
32
33
 
33
- export { asyncNavigateTo, formatPath, getAllPages, getAppConfig, getTabBarPages, navigateBack, navigateTo };
34
+ export { asyncNavigateTo, formatPath, getAllPages, getAppConfig, getHomePage, getTabBarPages, navigateBack, navigateTo };
package/dist/index.js CHANGED
@@ -196,6 +196,9 @@ __export(src_exports, {
196
196
  getAppConfig: function() {
197
197
  return getAppConfig;
198
198
  },
199
+ getHomePage: function() {
200
+ return getHomePage;
201
+ },
199
202
  getTabBarPages: function() {
200
203
  return getTabBarPages;
201
204
  },
@@ -234,9 +237,12 @@ var getTabBarPages = function() {
234
237
  var _getAppConfig_tabBar;
235
238
  return ((_getAppConfig_tabBar = getAppConfig().tabBar) === null || _getAppConfig_tabBar === void 0 ? void 0 : _getAppConfig_tabBar.list.map(function(param) {
236
239
  var pagePath = param.pagePath;
237
- return pagePath;
240
+ return "/".concat(pagePath);
238
241
  })) || [];
239
242
  };
243
+ var getHomePage = function() {
244
+ return getTabBarPages()[0] || "/pages/home/index";
245
+ };
240
246
  // src/index.ts
241
247
  var asyncNavigateTo = function() {
242
248
  var _ref = _async_to_generator(function(path) {
@@ -378,6 +384,7 @@ var formatPath = function(path) {
378
384
  formatPath: formatPath,
379
385
  getAllPages: getAllPages,
380
386
  getAppConfig: getAppConfig,
387
+ getHomePage: getHomePage,
381
388
  getTabBarPages: getTabBarPages,
382
389
  navigateBack: navigateBack,
383
390
  navigateTo: navigateTo
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xfe-repo/mini-router",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "sideEffects": false,
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,13 +11,16 @@
11
11
  "@tarojs/taro": "4.0.8",
12
12
  "query-string": "^7.1.3",
13
13
  "@xfe-repo/mini-utils": "0.0.1",
14
- "@xfe-repo/web-utils": "1.2.1"
14
+ "@xfe-repo/web-utils": "1.3.1"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/node": "^20.16.5",
18
18
  "@xfe-repo/eslint-config": "0.0.5",
19
19
  "@xfe-repo/typescript-config": "0.0.6"
20
20
  },
21
+ "publishConfig": {
22
+ "registry": "https://registry.npmjs.org/"
23
+ },
21
24
  "scripts": {
22
25
  "build": "tsup",
23
26
  "dev": "tsup --watch",