@uxf/router 11.80.2 → 11.80.5
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/README.md +1 -1
- package/package.json +1 -1
- package/{router/routes-check → routes-check}/routes-check.js +8 -5
- package/{router/routes-check → routes-check}/routes-check.test.js +1 -0
- package/router/routes-check/__test__/app/app-directory/[param]/page.d.ts +0 -0
- package/router/routes-check/__test__/app/app-directory/[param]/page.js +0 -1
- package/router/routes-check/__test__/app/app-directory/page.d.ts +0 -0
- package/router/routes-check/__test__/app/app-directory/page.js +0 -1
- package/router/routes-check/__test__/pages/index.d.ts +0 -0
- package/router/routes-check/__test__/pages/index.js +0 -1
- package/router/routes-check/__test__/pages/product/[id].d.ts +0 -0
- package/router/routes-check/__test__/pages/product/[id].js +0 -1
- package/router/routes-check/__test__/pages/product/edit.d.ts +0 -0
- package/router/routes-check/__test__/pages/product/edit.js +0 -1
- package/router/routes-check/__test__/pages/product/index.d.ts +0 -0
- package/router/routes-check/__test__/pages/product/index.js +0 -1
- package/router/routes-check/__test__/pages/product-2/[id]/index.d.ts +0 -0
- package/router/routes-check/__test__/pages/product-2/[id]/index.js +0 -1
- /package/{router/helper.d.ts → helper.d.ts} +0 -0
- /package/{router/helper.js → helper.js} +0 -0
- /package/{router/helper.test.d.ts → helper.test.d.ts} +0 -0
- /package/{router/helper.test.js → helper.test.js} +0 -0
- /package/{router/index.d.ts → index.d.ts} +0 -0
- /package/{router/index.js → index.js} +0 -0
- /package/{router/merge-route-matchers.d.ts → merge-route-matchers.d.ts} +0 -0
- /package/{router/merge-route-matchers.js → merge-route-matchers.js} +0 -0
- /package/{router/router.d.ts → router.d.ts} +0 -0
- /package/{router/router.js → router.js} +0 -0
- /package/{router/router.test.d.ts → router.test.d.ts} +0 -0
- /package/{router/router.test.js → router.test.js} +0 -0
- /package/{router/routes-check → routes-check}/routes-check.d.ts +0 -0
- /package/{router/routes-check → routes-check}/routes-check.test.d.ts +0 -0
- /package/{router/sitemap-generator.d.ts → sitemap-generator.d.ts} +0 -0
- /package/{router/sitemap-generator.js → sitemap-generator.js} +0 -0
- /package/{router/sitemap-generator.test.d.ts → sitemap-generator.test.d.ts} +0 -0
- /package/{router/sitemap-generator.test.js → sitemap-generator.test.js} +0 -0
- /package/{router/superstruct → superstruct}/array.d.ts +0 -0
- /package/{router/superstruct → superstruct}/array.js +0 -0
- /package/{router/superstruct → superstruct}/boolean.d.ts +0 -0
- /package/{router/superstruct → superstruct}/boolean.js +0 -0
- /package/{router/superstruct → superstruct}/index.d.ts +0 -0
- /package/{router/superstruct → superstruct}/index.js +0 -0
- /package/{router/superstruct → superstruct}/integer.d.ts +0 -0
- /package/{router/superstruct → superstruct}/integer.js +0 -0
- /package/{router/types.d.ts → types.d.ts} +0 -0
- /package/{router/types.js → types.js} +0 -0
- /package/{router/utils → utils}/object-to-xml.d.ts +0 -0
- /package/{router/utils → utils}/object-to-xml.js +0 -0
- /package/{router/utils → utils}/object-to-xml.test.d.ts +0 -0
- /package/{router/utils → utils}/object-to-xml.test.js +0 -0
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -31,16 +31,19 @@ function routesCheck(routes, options) {
|
|
|
31
31
|
if (fileExists((0, path_1.join)(options.pagesDir, ...pathParts, "index.ts"))) {
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
+
const pagesPathParts = [...pathParts]; // clone
|
|
34
35
|
// TODO @vejvis - proč tu je tahle podmínka?
|
|
35
|
-
const lastPart =
|
|
36
|
-
const pagePath =
|
|
37
|
-
? (0, path_1.join)(options.pagesDir, ...
|
|
36
|
+
const lastPart = pagesPathParts.splice(-1);
|
|
37
|
+
const pagePath = pagesPathParts.length > 0
|
|
38
|
+
? (0, path_1.join)(options.pagesDir, ...pagesPathParts, `${lastPart[0] || "index"}.ts`)
|
|
38
39
|
: (0, path_1.join)(options.pagesDir, `${lastPart[0] || "index"}.tsx`);
|
|
39
40
|
if (fileExists(pagePath)) {
|
|
40
41
|
return;
|
|
41
42
|
}
|
|
42
|
-
if (fileExists((0, path_1.join)(options.appDir, ...
|
|
43
|
-
|
|
43
|
+
if (fileExists((0, path_1.join)(options.appDir, ...pathParts, "page.ts"))) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (fileExists((0, path_1.join)(options.appDir, ...pathParts, "route.ts"))) {
|
|
44
47
|
return;
|
|
45
48
|
}
|
|
46
49
|
throw new Error("Invalid");
|
|
@@ -12,6 +12,7 @@ describe("routesCheck", () => {
|
|
|
12
12
|
route5: { path: "/product-2/[id]" }, // path parameter, index file
|
|
13
13
|
app1: { path: "/app-directory" },
|
|
14
14
|
app2: { path: "/app-directory/[param]" },
|
|
15
|
+
app3: { path: "/api" },
|
|
15
16
|
}, {
|
|
16
17
|
shouldProcessExit: false,
|
|
17
18
|
appDir: (0, path_1.join)(__dirname, "__test__", "app"),
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|