@sealcode/sealgen 0.15.13 → 0.15.14

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.
@@ -65,7 +65,9 @@ ${files.map(
65
65
  ).join("\n")}
66
66
 
67
67
  export default function mountAutoRoutes(router: Router) {
68
- ${files.map(
68
+ ${files.sort(
69
+ ({ url: url1 }, { url: url2 }) => url1.includes(":") ? 1 : url2.includes(":") ? -1 : url1 < url2 ? -1 : 1
70
+ ).map(
69
71
  ({ actionName }) => ` mount(router, URLs.${actionName}URL, ${actionName});`
70
72
  ).join("\n")}
71
73
  }`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sealcode/sealgen",
3
- "version": "0.15.13",
3
+ "version": "0.15.14",
4
4
  "description": "Module to automate adding routes and collections to a sealious application",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",
@@ -90,6 +90,16 @@ ${files
90
90
 
91
91
  export default function mountAutoRoutes(router: Router) {
92
92
  ${files
93
+
94
+ .sort(({ url: url1 }, { url: url2 }) =>
95
+ url1.includes(":") // make sure the parametrized ones come later, so the more concrete ones show up first. This is not a full solution, but works for single-parameter urls
96
+ ? 1
97
+ : url2.includes(":")
98
+ ? -1
99
+ : url1 < url2
100
+ ? -1
101
+ : 1
102
+ )
93
103
  .map(
94
104
  ({ actionName }) =>
95
105
  ` mount(router, URLs.${actionName}URL, ${actionName});`