@websolutespa/bom-core 0.6.5 → 0.6.6

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/CHANGELOG.md CHANGED
@@ -1,102 +1,108 @@
1
- # @websolutespa/bom-core
2
-
3
- ## 0.6.5
4
-
5
- ### Patch Changes
6
-
7
- - Added: collectFeatureTypes, collectOptions
8
- - Modified: Category, collectRoutes, getRouteHref, entity
9
-
10
- ## 0.6.4
11
-
12
- ### Patch Changes
13
-
14
- - Added: typeGuards, IPagedResult
15
- - Modified: IUndecoratedMenuCustom
16
-
17
- ## 0.6.3
18
-
19
- ### Patch Changes
20
-
21
- - Added: isReservedCollectionDescription
22
-
23
- ## 0.6.2
24
-
25
- ### Patch Changes
26
-
27
- - Modified: IMedia
28
-
29
- ## 0.6.1
30
-
31
- ### Patch Changes
32
-
33
- - Added: defaultMarket, defaultLocale
34
-
35
- ## 0.6.0
36
-
37
- ### Minor Changes
38
-
39
- - Added Logger, IPaginationResult
40
-
41
- ## 0.5.0
42
-
43
- ### Minor Changes
44
-
45
- - Modified: JsonService, qs
46
- - Added: asEquatable, cloneItem, typeGuards
47
-
48
- ## 0.4.1
49
-
50
- ### Patch Changes
51
-
52
- - Added: IAnchor, babelCase
53
- - Modified: IApplication, IPageRelation
54
-
55
- ## 0.4.0
56
-
57
- ### Minor Changes
58
-
59
- - Updating: next 13
60
-
61
- ## 0.3.0
62
-
63
- ### Minor Changes
64
-
65
- - Modified: HttpService
66
-
67
- ## 0.2.1
68
-
69
- ### Patch Changes
70
-
71
- - Added: env ROOT_CATEGORY
72
-
73
- ## 0.2.0
74
-
75
- ### Minor Changes
76
-
77
- - Modified routes, added redirects
78
-
79
- ## 0.1.2
80
-
81
- ### Patch Changes
82
-
83
- - Modified: MockMenuService
84
-
85
- ## 0.1.1
86
-
87
- ### Patch Changes
88
-
89
- - Modified: ILocalizable
90
-
91
- ## 0.1.0
92
-
93
- ### Minor Changes
94
-
95
- - Added: splat routes
96
- - Added: variants
97
-
98
- ## 0.0.1
99
-
100
- ### Patch Changes
101
-
102
- - Added: first release
1
+ # @websolutespa/bom-core
2
+
3
+ ## 0.6.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Modified: collectRoutes
8
+
9
+ ## 0.6.5
10
+
11
+ ### Patch Changes
12
+
13
+ - Added: collectFeatureTypes, collectOptions
14
+ - Modified: Category, collectRoutes, getRouteHref, entity
15
+
16
+ ## 0.6.4
17
+
18
+ ### Patch Changes
19
+
20
+ - Added: typeGuards, IPagedResult
21
+ - Modified: IUndecoratedMenuCustom
22
+
23
+ ## 0.6.3
24
+
25
+ ### Patch Changes
26
+
27
+ - Added: isReservedCollectionDescription
28
+
29
+ ## 0.6.2
30
+
31
+ ### Patch Changes
32
+
33
+ - Modified: IMedia
34
+
35
+ ## 0.6.1
36
+
37
+ ### Patch Changes
38
+
39
+ - Added: defaultMarket, defaultLocale
40
+
41
+ ## 0.6.0
42
+
43
+ ### Minor Changes
44
+
45
+ - Added Logger, IPaginationResult
46
+
47
+ ## 0.5.0
48
+
49
+ ### Minor Changes
50
+
51
+ - Modified: JsonService, qs
52
+ - Added: asEquatable, cloneItem, typeGuards
53
+
54
+ ## 0.4.1
55
+
56
+ ### Patch Changes
57
+
58
+ - Added: IAnchor, babelCase
59
+ - Modified: IApplication, IPageRelation
60
+
61
+ ## 0.4.0
62
+
63
+ ### Minor Changes
64
+
65
+ - Updating: next 13
66
+
67
+ ## 0.3.0
68
+
69
+ ### Minor Changes
70
+
71
+ - Modified: HttpService
72
+
73
+ ## 0.2.1
74
+
75
+ ### Patch Changes
76
+
77
+ - Added: env ROOT_CATEGORY
78
+
79
+ ## 0.2.0
80
+
81
+ ### Minor Changes
82
+
83
+ - Modified routes, added redirects
84
+
85
+ ## 0.1.2
86
+
87
+ ### Patch Changes
88
+
89
+ - Modified: MockMenuService
90
+
91
+ ## 0.1.1
92
+
93
+ ### Patch Changes
94
+
95
+ - Modified: ILocalizable
96
+
97
+ ## 0.1.0
98
+
99
+ ### Minor Changes
100
+
101
+ - Added: splat routes
102
+ - Added: variants
103
+
104
+ ## 0.0.1
105
+
106
+ ### Patch Changes
107
+
108
+ - Added: first release
package/dist/index.js CHANGED
@@ -1005,10 +1005,14 @@ function collectRoutes(store, categories, markets, locales) {
1005
1005
  const rootCategory = getRootCategory(categories);
1006
1006
  eachCategorized(store, (item, key) => {
1007
1007
  const segments = getCategorySegments(item, categories);
1008
+ const slugs = segments.map((x) => ({ slug: x.slug }));
1009
+ if (!item.isDefault) {
1010
+ slugs.push({ slug: item.slug });
1011
+ }
1008
1012
  eachMarketLocale(markets, locales, (market, locale, markets2, locales2) => {
1009
1013
  if (!item.markets || item.markets.includes(market.id)) {
1010
1014
  const title = localize(item.title, locale.id);
1011
- const id = getRouteHref([...segments, { slug: item.slug }], market, locale, markets2, locales2);
1015
+ const id = getRouteHref(slugs, market, locale, markets2, locales2);
1012
1016
  const route = {
1013
1017
  category: item.category,
1014
1018
  id,
package/dist/index.mjs CHANGED
@@ -888,10 +888,14 @@ function collectRoutes(store, categories, markets, locales) {
888
888
  const rootCategory = getRootCategory(categories);
889
889
  eachCategorized(store, (item, key) => {
890
890
  const segments = getCategorySegments(item, categories);
891
+ const slugs = segments.map((x) => ({ slug: x.slug }));
892
+ if (!item.isDefault) {
893
+ slugs.push({ slug: item.slug });
894
+ }
891
895
  eachMarketLocale(markets, locales, (market, locale, markets2, locales2) => {
892
896
  if (!item.markets || item.markets.includes(market.id)) {
893
897
  const title = localize(item.title, locale.id);
894
- const id = getRouteHref([...segments, { slug: item.slug }], market, locale, markets2, locales2);
898
+ const id = getRouteHref(slugs, market, locale, markets2, locales2);
895
899
  const route = {
896
900
  category: item.category,
897
901
  id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@websolutespa/bom-core",
3
- "version": "0.6.5",
3
+ "version": "0.6.6",
4
4
  "description": "Core module of the BOM Repository",
5
5
  "keywords": [
6
6
  "bom",