@sitecore-jss/sitecore-jss-nextjs 22.11.0-canary.7 → 22.11.0-canary.8

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.
@@ -201,10 +201,12 @@ class RedirectsMiddleware extends middleware_1.MiddlewareBase {
201
201
  ? (0, utils_1.mergeURLSearchParams)(new URLSearchParams((_a = url.search) !== null && _a !== void 0 ? _a : ''), new URLSearchParams(targetQueryString || ''))
202
202
  : targetQueryString || '';
203
203
  const prepareNewURL = new URL(`${targetPath}${mergedQueryString ? `?${mergedQueryString}` : ''}`, url.origin);
204
+ const basePath = url.basePath; // setting NextUrl.href overrides basePath, so we need to store it
204
205
  url.href = prepareNewURL.href;
205
206
  url.pathname = prepareNewURL.pathname;
206
207
  url.search = prepareNewURL.search;
207
208
  url.locale = req.nextUrl.locale;
209
+ url.basePath = basePath;
208
210
  return this.dispatchRedirect(url, existsRedirect.redirectType, req, response, false);
209
211
  }
210
212
  });
@@ -258,9 +260,11 @@ class RedirectsMiddleware extends middleware_1.MiddlewareBase {
258
260
  .filter((param) => !splittedPathname.includes(param))
259
261
  .join('&');
260
262
  const newUrl = new URL(`${url.pathname.toLowerCase()}?${newQueryString}`, url.origin);
263
+ const basePath = url.basePath; // setting NextUrl.href overrides basePath, so we need to store it
261
264
  url.search = newUrl.search;
262
265
  url.pathname = newUrl.pathname.toLowerCase();
263
266
  url.href = newUrl.href;
267
+ url.basePath = basePath;
264
268
  return url;
265
269
  }
266
270
  /**
@@ -195,10 +195,12 @@ export class RedirectsMiddleware extends MiddlewareBase {
195
195
  ? mergeURLSearchParams(new URLSearchParams((_a = url.search) !== null && _a !== void 0 ? _a : ''), new URLSearchParams(targetQueryString || ''))
196
196
  : targetQueryString || '';
197
197
  const prepareNewURL = new URL(`${targetPath}${mergedQueryString ? `?${mergedQueryString}` : ''}`, url.origin);
198
+ const basePath = url.basePath; // setting NextUrl.href overrides basePath, so we need to store it
198
199
  url.href = prepareNewURL.href;
199
200
  url.pathname = prepareNewURL.pathname;
200
201
  url.search = prepareNewURL.search;
201
202
  url.locale = req.nextUrl.locale;
203
+ url.basePath = basePath;
202
204
  return this.dispatchRedirect(url, existsRedirect.redirectType, req, response, false);
203
205
  }
204
206
  });
@@ -252,9 +254,11 @@ export class RedirectsMiddleware extends MiddlewareBase {
252
254
  .filter((param) => !splittedPathname.includes(param))
253
255
  .join('&');
254
256
  const newUrl = new URL(`${url.pathname.toLowerCase()}?${newQueryString}`, url.origin);
257
+ const basePath = url.basePath; // setting NextUrl.href overrides basePath, so we need to store it
255
258
  url.search = newUrl.search;
256
259
  url.pathname = newUrl.pathname.toLowerCase();
257
260
  url.href = newUrl.href;
261
+ url.basePath = basePath;
258
262
  return url;
259
263
  }
260
264
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitecore-jss/sitecore-jss-nextjs",
3
- "version": "22.11.0-canary.7",
3
+ "version": "22.11.0-canary.8",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "sideEffects": false,
@@ -72,16 +72,16 @@
72
72
  "react-dom": "^19.1.0"
73
73
  },
74
74
  "dependencies": {
75
- "@sitecore-jss/sitecore-jss": "22.11.0-canary.7",
76
- "@sitecore-jss/sitecore-jss-dev-tools": "22.11.0-canary.7",
77
- "@sitecore-jss/sitecore-jss-react": "22.11.0-canary.7",
75
+ "@sitecore-jss/sitecore-jss": "22.11.0-canary.8",
76
+ "@sitecore-jss/sitecore-jss-dev-tools": "22.11.0-canary.8",
77
+ "@sitecore-jss/sitecore-jss-react": "22.11.0-canary.8",
78
78
  "@vercel/kv": "^0.2.1",
79
79
  "regex-parser": "^2.2.11",
80
80
  "sync-disk-cache": "^2.1.0"
81
81
  },
82
82
  "description": "",
83
83
  "types": "types/index.d.ts",
84
- "gitHead": "8de47145f9d9ed3b50b3fa72dff8758df03188bc",
84
+ "gitHead": "a364c52b72ef5f8736944eb97198b1290c182d72",
85
85
  "files": [
86
86
  "dist",
87
87
  "types",