@akinon/next 2.0.74-rc.0 → 2.0.74-rc.1

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,5 +1,11 @@
1
1
  # @akinon/next
2
2
 
3
+ ## 2.0.74-rc.1
4
+
5
+ ### Patch Changes
6
+
7
+ - b1111d7b: ZERO-4841: Guard `withPrettyUrl` against calling `String.prototype.replace` with an `undefined` locale prefix on projects without a URL locale prefix (e.g. `HideDefaultLocale`) — previously this coerced to the literal string `"undefined"` and silently stripped a trailing `/undefined` segment from the path before the pretty-url lookup, causing bogus URLs like `/{product-slug}/undefined` to resolve and rewrite to the real product page (200) instead of 404
8
+
3
9
  ## 2.0.74-rc.0
4
10
 
5
11
  ### Patch Changes
@@ -86,7 +86,9 @@ const withPrettyUrl =
86
86
  const matchedLanguagePrefix = url.pathname.match(
87
87
  urlLocaleMatcherRegex
88
88
  )?.[0];
89
- const prettyUrlPathname = url.pathname.replace(matchedLanguagePrefix, '');
89
+ const prettyUrlPathname = matchedLanguagePrefix
90
+ ? url.pathname.replace(matchedLanguagePrefix, '')
91
+ : url.pathname;
90
92
  const isValidPrettyUrlPath = (pathname: string) => {
91
93
  return (
92
94
  new RegExp(/^\/[a-zA-Z0-9/]+(?:-[a-zA-Z0-9/]+)*$/).test(pathname) &&
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@akinon/next",
3
3
  "description": "Core package for Project Zero Next",
4
- "version": "2.0.74-rc.0",
4
+ "version": "2.0.74-rc.1",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -36,7 +36,7 @@
36
36
  "set-cookie-parser": "2.6.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@akinon/eslint-plugin-projectzero": "2.0.74-rc.0",
39
+ "@akinon/eslint-plugin-projectzero": "2.0.74-rc.1",
40
40
  "@babel/core": "7.26.10",
41
41
  "@babel/preset-env": "7.26.9",
42
42
  "@babel/preset-typescript": "7.27.0",