@koine/next 1.0.42 → 1.0.43

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/config/index.js CHANGED
@@ -52,18 +52,17 @@ export function encodePathname(pathname) {
52
52
  .join("/");
53
53
  }
54
54
  /**
55
- * It replaces `/[dynamic-slug]/` with the given replacer, and if it is found at
56
- * the end it adds an asterisk
55
+ * It replaces `/[dynamic-slug]/` with the given replacer.
57
56
  */
58
57
  function transformRoutePathname(rawPathname, replacer) {
59
58
  var pathNameParts = rawPathname.split("/").filter(function (part) { return !!part; });
60
59
  return pathNameParts
61
- .map(function (part, idx) {
60
+ .map(function (part, _idx) {
62
61
  var isDynamic = part.startsWith("[") && part.endsWith("]");
63
62
  part = isDynamic ? replacer : part;
64
- if (isDynamic && idx === pathNameParts.length - 1) {
65
- part += "*";
66
- }
63
+ // if (isDynamic && _idx === pathNameParts.length - 1) {
64
+ // part += "*";
65
+ // }
67
66
  return isDynamic ? part : encodeURIComponent(part);
68
67
  })
69
68
  .join("/");
@@ -92,6 +91,7 @@ function getRoutesMap(map, routes, pathnameBuffer, templateBuffer) {
92
91
  */
93
92
  export function getPathRewrite(pathname, template) {
94
93
  pathname = transformRoutePathname(pathname, ":path");
94
+ template = transformRoutePathname(template, ":path");
95
95
  var source = "/".concat(normaliseUrlPathname(pathname));
96
96
  var destination = "/".concat(normaliseUrlPathname(template));
97
97
  // console.log(`rewrite pathname "${source}" to template "${destination}"`);
@@ -58,18 +58,17 @@ function encodePathname(pathname) {
58
58
  }
59
59
  exports.encodePathname = encodePathname;
60
60
  /**
61
- * It replaces `/[dynamic-slug]/` with the given replacer, and if it is found at
62
- * the end it adds an asterisk
61
+ * It replaces `/[dynamic-slug]/` with the given replacer.
63
62
  */
64
63
  function transformRoutePathname(rawPathname, replacer) {
65
64
  var pathNameParts = rawPathname.split("/").filter(function (part) { return !!part; });
66
65
  return pathNameParts
67
- .map(function (part, idx) {
66
+ .map(function (part, _idx) {
68
67
  var isDynamic = part.startsWith("[") && part.endsWith("]");
69
68
  part = isDynamic ? replacer : part;
70
- if (isDynamic && idx === pathNameParts.length - 1) {
71
- part += "*";
72
- }
69
+ // if (isDynamic && _idx === pathNameParts.length - 1) {
70
+ // part += "*";
71
+ // }
73
72
  return isDynamic ? part : encodeURIComponent(part);
74
73
  })
75
74
  .join("/");
@@ -98,6 +97,7 @@ function getRoutesMap(map, routes, pathnameBuffer, templateBuffer) {
98
97
  */
99
98
  function getPathRewrite(pathname, template) {
100
99
  pathname = transformRoutePathname(pathname, ":path");
100
+ template = transformRoutePathname(template, ":path");
101
101
  var source = "/".concat(normaliseUrlPathname(pathname));
102
102
  var destination = "/".concat(normaliseUrlPathname(template));
103
103
  // console.log(`rewrite pathname "${source}" to template "${destination}"`);
package/package.json CHANGED
@@ -18,10 +18,14 @@
18
18
  "peerDependencies": {
19
19
  "react": "^16.8 || ^17 || ^18",
20
20
  "next": "^12.1.6",
21
- "@koine/utils": "1.0.42",
21
+ "@koine/utils": "1.0.43",
22
22
  "framer-motion": "^6.3.16",
23
- "@koine/react": "1.0.42",
23
+ "next-auth": "^4.6.1",
24
+ "@mui/material": "^5.8.6",
25
+ "@emotion/react": "^11.9.3",
24
26
  "styled-components": "^5.3.5",
27
+ "react-hook-form": "^7.33.0",
28
+ "@koine/react": "1.0.43",
25
29
  "@mui/base": "^5.0.0-alpha.87",
26
30
  "react-icons": "^4.4.0",
27
31
  "date-fns": "^2.28.0",
@@ -29,19 +33,15 @@
29
33
  "@tiptap/react": "^2.0.0-beta.114",
30
34
  "@tiptap/starter-kit": "^2.0.0-beta.190",
31
35
  "@kuus/yup": "^1.0.0-beta.4",
32
- "react-hook-form": "^7.33.0",
33
36
  "type-fest": "^2.14.0",
34
37
  "react-popper": "^2.3.0",
35
38
  "tslib": "^2.4.0",
36
- "next-auth": "^4.6.1",
37
- "@mui/material": "^5.8.6",
38
- "@emotion/react": "^11.9.3",
39
39
  "@emotion/server": "^11.4.0",
40
40
  "@hookform/resolvers": "^2.9.3",
41
41
  "next-translate": "^1.4.0",
42
42
  "next-seo": "^5.4.0"
43
43
  },
44
- "version": "1.0.42",
44
+ "version": "1.0.43",
45
45
  "module": "./index.js",
46
46
  "types": "./index.d.ts"
47
47
  }