@serwist/next 10.0.0-preview.12 → 10.0.0-preview.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.worker.d.ts","sourceRoot":"","sources":["../src/index.worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,EAsQlC,CAAC"}
1
+ {"version":3,"file":"index.worker.d.ts","sourceRoot":"","sources":["../src/index.worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,EAkQlC,CAAC"}
@@ -170,15 +170,13 @@ const defaultCache = process.env.NODE_ENV !== "production" ? [
170
170
  })
171
171
  },
172
172
  {
173
- matcher: ({ sameOrigin, url: { pathname } })=>{
174
- if (!sameOrigin || pathname.startsWith("/api/auth/callback")) {
175
- return false;
176
- }
177
- if (pathname.startsWith("/api/")) {
178
- return true;
179
- }
180
- return false;
181
- },
173
+ matcher: /\/api\/auth\/.*/,
174
+ handler: new NetworkOnly({
175
+ networkTimeoutSeconds: 10
176
+ })
177
+ },
178
+ {
179
+ matcher: ({ sameOrigin, url: { pathname } })=>sameOrigin && pathname.startsWith("/api/"),
182
180
  method: "GET",
183
181
  handler: new NetworkFirst({
184
182
  cacheName: "apis",
@@ -252,6 +250,11 @@ const defaultCache = process.env.NODE_ENV !== "production" ? [
252
250
  ],
253
251
  networkTimeoutSeconds: 10
254
252
  })
253
+ },
254
+ {
255
+ matcher: /.*/i,
256
+ method: "GET",
257
+ handler: new NetworkOnly()
255
258
  }
256
259
  ];
257
260
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serwist/next",
3
- "version": "10.0.0-preview.12",
3
+ "version": "10.0.0-preview.14",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "A module that integrates Serwist into your Next.js application.",
@@ -63,25 +63,25 @@
63
63
  "./package.json": "./package.json"
64
64
  },
65
65
  "dependencies": {
66
- "chalk": "5.4.1",
66
+ "chalk": "5.6.0",
67
67
  "glob": "11.0.3",
68
- "zod": "4.0.5",
69
- "@serwist/build": "10.0.0-preview.12",
70
- "@serwist/utils": "10.0.0-preview.12",
71
- "@serwist/webpack-plugin": "10.0.0-preview.12",
72
- "@serwist/window": "10.0.0-preview.12",
73
- "serwist": "10.0.0-preview.12"
68
+ "zod": "4.1.5",
69
+ "@serwist/build": "10.0.0-preview.14",
70
+ "@serwist/utils": "10.0.0-preview.14",
71
+ "@serwist/webpack-plugin": "10.0.0-preview.14",
72
+ "@serwist/window": "10.0.0-preview.14",
73
+ "serwist": "10.0.0-preview.14"
74
74
  },
75
75
  "devDependencies": {
76
- "@types/node": "24.0.14",
77
- "next": "15.4.1",
78
- "react": "19.1.0",
79
- "react-dom": "19.1.0",
80
- "rollup": "4.45.1",
76
+ "@types/node": "24.3.0",
77
+ "next": "15.5.2",
78
+ "react": "19.1.1",
79
+ "react-dom": "19.1.1",
80
+ "rollup": "4.49.0",
81
81
  "type-fest": "4.41.0",
82
- "typescript": "5.8.3",
83
- "webpack": "5.100.2",
84
- "@serwist/configs": "10.0.0-preview.12"
82
+ "typescript": "5.9.2",
83
+ "webpack": "5.101.3",
84
+ "@serwist/configs": "10.0.0-preview.14"
85
85
  },
86
86
  "peerDependencies": {
87
87
  "next": ">=14.0.0",
@@ -181,24 +181,15 @@ export const defaultCache: RuntimeCaching[] =
181
181
  }),
182
182
  },
183
183
  {
184
- matcher: ({ sameOrigin, url: { pathname } }) => {
185
- // Exclude /api/auth/callback/* to fix OAuth workflow in Safari without having
186
- // an impact on other environments
187
- // The above route is the default for next-auth, you may need to change it if
188
- // your OAuth workflow has a different callback route.
189
- // Issue: https://github.com/shadowwalker/next-pwa/issues/131#issuecomment-821894809
190
- // TODO(ducanhgh): Investigate Auth.js's "/api/auth/*" failing when we allow them
191
- // to be cached (the current behaviour).
192
- if (!sameOrigin || pathname.startsWith("/api/auth/callback")) {
193
- return false;
194
- }
195
-
196
- if (pathname.startsWith("/api/")) {
197
- return true;
198
- }
199
-
200
- return false;
201
- },
184
+ // Exclude /api/auth/* to fix auth callback
185
+ // https://github.com/serwist/serwist/discussions/28
186
+ matcher: /\/api\/auth\/.*/,
187
+ handler: new NetworkOnly({
188
+ networkTimeoutSeconds: 10, // fallback to cache if API does not response within 10 seconds
189
+ }),
190
+ },
191
+ {
192
+ matcher: ({ sameOrigin, url: { pathname } }) => sameOrigin && pathname.startsWith("/api/"),
202
193
  method: "GET",
203
194
  handler: new NetworkFirst({
204
195
  cacheName: "apis",
@@ -275,4 +266,9 @@ export const defaultCache: RuntimeCaching[] =
275
266
  networkTimeoutSeconds: 10,
276
267
  }),
277
268
  },
269
+ {
270
+ matcher: /.*/i,
271
+ method: "GET",
272
+ handler: new NetworkOnly(),
273
+ },
278
274
  ];