@serwist/next 8.4.4 → 9.0.0-preview.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/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -716
- package/dist/index.worker.d.ts +5 -0
- package/dist/index.worker.d.ts.map +1 -0
- package/dist/{index.browser.cjs → index.worker.js} +53 -26
- package/dist/internal-types.d.ts +7 -1
- package/dist/internal-types.d.ts.map +1 -0
- package/dist/sw-entry-worker.d.ts +1 -0
- package/dist/sw-entry-worker.d.ts.map +1 -0
- package/dist/sw-entry.d.ts +1 -0
- package/dist/sw-entry.d.ts.map +1 -0
- package/dist/sw-entry.js +5 -5
- package/dist/utils/find-first-truthy.d.ts +1 -0
- package/dist/utils/find-first-truthy.d.ts.map +1 -0
- package/dist/utils/get-content-hash.d.ts +1 -0
- package/dist/utils/get-content-hash.d.ts.map +1 -0
- package/dist/utils/get-file-hash.d.ts +1 -0
- package/dist/utils/get-file-hash.d.ts.map +1 -0
- package/dist/utils/get-package-version.d.ts +1 -0
- package/dist/utils/get-package-version.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/load-tsconfig.d.ts +1 -0
- package/dist/utils/load-tsconfig.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +1 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/worker/defaultCache.d.ts +3 -0
- package/dist/worker/defaultCache.d.ts.map +1 -0
- package/dist/worker/definePageRuntimeCaching.d.ts +16 -0
- package/dist/worker/definePageRuntimeCaching.d.ts.map +1 -0
- package/package.json +48 -50
- package/src/index.ts +241 -0
- package/src/index.worker.ts +5 -0
- package/src/internal-types.ts +17 -0
- package/src/sw-entry-worker.ts +46 -0
- package/src/sw-entry.ts +64 -0
- package/src/utils/find-first-truthy.ts +15 -0
- package/src/utils/get-content-hash.ts +10 -0
- package/src/utils/get-file-hash.ts +4 -0
- package/src/utils/get-package-version.ts +16 -0
- package/src/utils/load-tsconfig.ts +27 -0
- package/src/utils/logger.ts +57 -0
- package/src/utils.ts +11 -0
- package/src/worker/defaultCache.ts +223 -0
- package/src/worker/definePageRuntimeCaching.ts +36 -0
- package/dist/index.browser.d.cts +0 -2
- package/dist/index.browser.d.ts +0 -2
- package/dist/index.browser.js +0 -208
- package/dist/index.cjs +0 -928
- package/dist/index.d.cts +0 -5
- package/dist/internal-types.d.cts +0 -9
- package/dist/sw-entry-worker.cjs +0 -35
- package/dist/sw-entry-worker.d.cts +0 -7
- package/dist/sw-entry.cjs +0 -43
- package/dist/sw-entry.d.cts +0 -6
- package/dist/types.d.cts +0 -81
- package/dist/types.d.ts +0 -81
- package/dist/utils/find-first-truthy.d.cts +0 -7
- package/dist/utils/get-content-hash.d.cts +0 -3
- package/dist/utils/get-file-hash.d.cts +0 -3
- package/dist/utils/get-package-version.d.cts +0 -6
- package/dist/utils/load-tsconfig.d.cts +0 -2
- package/dist/utils/logger.d.cts +0 -5
- package/dist/utils.d.cts +0 -4
- /package/{dist/utils/index.d.cts → src/utils/index.ts} +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { defaultCache } from "./worker/defaultCache.js";
|
|
2
|
+
import { type DefinePageRuntimeCachingOptions, type PageRuntimeCaching, definePageRuntimeCaching } from "./worker/definePageRuntimeCaching.js";
|
|
3
|
+
export { defaultCache, definePageRuntimeCaching };
|
|
4
|
+
export type { DefinePageRuntimeCachingOptions, PageRuntimeCaching };
|
|
5
|
+
//# sourceMappingURL=index.worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.worker.d.ts","sourceRoot":"","sources":["../src/index.worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,KAAK,+BAA+B,EAAE,KAAK,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAE/I,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAE,CAAC;AAClD,YAAY,EAAE,+BAA+B,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,6 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
const nonNullable = (value)=>value !== null && value !== undefined;
|
|
2
|
+
|
|
3
|
+
const definePageRuntimeCaching = ({ rscPrefetch, rsc, html })=>{
|
|
4
|
+
const pageRcs = [
|
|
5
|
+
rscPrefetch,
|
|
6
|
+
rsc,
|
|
7
|
+
html
|
|
8
|
+
];
|
|
9
|
+
if (pageRcs[0]) {
|
|
10
|
+
if (!pageRcs[0].options) pageRcs[0].options = {};
|
|
11
|
+
pageRcs[0].options.cacheName = "pages-rsc-prefetch";
|
|
12
|
+
}
|
|
13
|
+
if (pageRcs[1]) {
|
|
14
|
+
if (!pageRcs[1].options) pageRcs[1].options = {};
|
|
15
|
+
pageRcs[1].options.cacheName = "pages-rsc";
|
|
16
|
+
}
|
|
17
|
+
if (pageRcs[2]) {
|
|
18
|
+
if (!pageRcs[2].options) pageRcs[2].options = {};
|
|
19
|
+
pageRcs[2].options.cacheName = "pages";
|
|
20
|
+
}
|
|
21
|
+
return pageRcs.filter(nonNullable);
|
|
22
|
+
};
|
|
2
23
|
|
|
3
|
-
// Serwist RuntimeCaching config: https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.RuntimeCachingEntry
|
|
4
24
|
const defaultCache = [
|
|
5
25
|
{
|
|
6
26
|
urlPattern: /^https:\/\/fonts\.(?:gstatic)\.com\/.*/i,
|
|
@@ -138,9 +158,6 @@ const defaultCache = [
|
|
|
138
158
|
},
|
|
139
159
|
{
|
|
140
160
|
urlPattern: ({ sameOrigin, url: { pathname } })=>{
|
|
141
|
-
// Exclude /api/auth/callback/* to fix OAuth workflow in Safari without having an impact on other environments
|
|
142
|
-
// The above route is the default for next-auth, you may need to change it if your OAuth workflow has a different callback route
|
|
143
|
-
// Issue: https://github.com/shadowwalker/next-pwa/issues/131#issuecomment-821894809
|
|
144
161
|
if (!sameOrigin || pathname.startsWith("/api/auth/callback")) {
|
|
145
162
|
return false;
|
|
146
163
|
}
|
|
@@ -160,33 +177,43 @@ const defaultCache = [
|
|
|
160
177
|
networkTimeoutSeconds: 10
|
|
161
178
|
}
|
|
162
179
|
},
|
|
163
|
-
{
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
180
|
+
...definePageRuntimeCaching({
|
|
181
|
+
rscPrefetch: {
|
|
182
|
+
urlPattern: ({ request, url: { pathname }, sameOrigin })=>request.headers.get("RSC") === "1" && request.headers.get("Next-Router-Prefetch") === "1" && sameOrigin && !pathname.startsWith("/api/"),
|
|
183
|
+
handler: "NetworkFirst",
|
|
184
|
+
options: {
|
|
185
|
+
expiration: {
|
|
186
|
+
maxEntries: 32,
|
|
187
|
+
maxAgeSeconds: 24 * 60 * 60
|
|
188
|
+
}
|
|
171
189
|
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
190
|
+
},
|
|
191
|
+
rsc: {
|
|
192
|
+
urlPattern: ({ request, url: { pathname }, sameOrigin })=>request.headers.get("RSC") === "1" && sameOrigin && !pathname.startsWith("/api/"),
|
|
193
|
+
handler: "NetworkFirst",
|
|
194
|
+
options: {
|
|
195
|
+
expiration: {
|
|
196
|
+
maxEntries: 32,
|
|
197
|
+
maxAgeSeconds: 24 * 60 * 60
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
html: {
|
|
202
|
+
urlPattern: ({ request, url: { pathname }, sameOrigin })=>request.headers.get("Content-Type")?.includes("text/html") && sameOrigin && !pathname.startsWith("/api/"),
|
|
203
|
+
handler: "NetworkFirst",
|
|
204
|
+
options: {
|
|
205
|
+
expiration: {
|
|
206
|
+
maxEntries: 32,
|
|
207
|
+
maxAgeSeconds: 24 * 60 * 60
|
|
208
|
+
}
|
|
182
209
|
}
|
|
183
210
|
}
|
|
184
|
-
},
|
|
211
|
+
}),
|
|
185
212
|
{
|
|
186
213
|
urlPattern: ({ url: { pathname }, sameOrigin })=>sameOrigin && !pathname.startsWith("/api/"),
|
|
187
214
|
handler: "NetworkFirst",
|
|
188
215
|
options: {
|
|
189
|
-
cacheName: "
|
|
216
|
+
cacheName: "others",
|
|
190
217
|
expiration: {
|
|
191
218
|
maxEntries: 32,
|
|
192
219
|
maxAgeSeconds: 24 * 60 * 60
|
|
@@ -207,4 +234,4 @@ const defaultCache = [
|
|
|
207
234
|
}
|
|
208
235
|
];
|
|
209
236
|
|
|
210
|
-
|
|
237
|
+
export { defaultCache, definePageRuntimeCaching };
|
package/dist/internal-types.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import type { Asset, Compilation } from "webpack";
|
|
1
2
|
export type SerwistNextOptionsKey = "self.__SERWIST_SW_ENTRY";
|
|
2
3
|
export interface SerwistNextOptions {
|
|
3
4
|
sw: string;
|
|
4
5
|
scope: string;
|
|
5
|
-
|
|
6
|
+
cacheOnNavigation: boolean;
|
|
6
7
|
register: boolean;
|
|
7
8
|
reloadOnOnline: boolean;
|
|
8
9
|
swEntryWorker: string | undefined;
|
|
9
10
|
}
|
|
11
|
+
export interface ExcludeParams {
|
|
12
|
+
asset: Asset;
|
|
13
|
+
compilation: Compilation;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=internal-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["../src/internal-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElD,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AAE9D,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,OAAO,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,WAAW,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sw-entry-worker.d.ts","sourceRoot":"","sources":["../src/sw-entry-worker.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GACnB;IACE,IAAI,EAAE,wBAAwB,CAAC;IAC/B,GAAG,EAAE,GAAG,GAAG,MAAM,CAAC;CACnB,GACD;IACE,IAAI,EAAE,qBAAqB,CAAC;IAC5B,GAAG,EAAE,GAAG,GAAG,MAAM,CAAC;CACnB,CAAC"}
|
package/dist/sw-entry.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sw-entry.d.ts","sourceRoot":"","sources":["../src/sw-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAK1C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,OAAO,EAAE,OAAO,CAAC;KAClB;CACF"}
|
package/dist/sw-entry.js
CHANGED
|
@@ -11,8 +11,8 @@ if (typeof window !== "undefined" && "serviceWorker" in navigator && typeof cach
|
|
|
11
11
|
if (self.__SERWIST_SW_ENTRY.register) {
|
|
12
12
|
window.serwist.register();
|
|
13
13
|
}
|
|
14
|
-
if (self.__SERWIST_SW_ENTRY.
|
|
15
|
-
const
|
|
14
|
+
if (self.__SERWIST_SW_ENTRY.cacheOnNavigation) {
|
|
15
|
+
const cacheOnNavigation = async (url)=>{
|
|
16
16
|
if (!window.navigator.onLine || !url) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
@@ -24,15 +24,15 @@ if (typeof window !== "undefined" && "serviceWorker" in navigator && typeof cach
|
|
|
24
24
|
const pushState = history.pushState;
|
|
25
25
|
history.pushState = (...args)=>{
|
|
26
26
|
pushState.apply(history, args);
|
|
27
|
-
|
|
27
|
+
cacheOnNavigation(args[2]);
|
|
28
28
|
};
|
|
29
29
|
const replaceState = history.replaceState;
|
|
30
30
|
history.replaceState = (...args)=>{
|
|
31
31
|
replaceState.apply(history, args);
|
|
32
|
-
|
|
32
|
+
cacheOnNavigation(args[2]);
|
|
33
33
|
};
|
|
34
34
|
window.addEventListener("online", ()=>{
|
|
35
|
-
|
|
35
|
+
cacheOnNavigation(window.location.pathname);
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
if (self.__SERWIST_SW_ENTRY.reloadOnOnline) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-first-truthy.d.ts","sourceRoot":"","sources":["../../src/utils/find-first-truthy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,eAAe,mEAQ3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-content-hash.d.ts","sourceRoot":"","sources":["../../src/utils/get-content-hash.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAI9B,eAAO,MAAM,cAAc,SAAU,GAAG,oBAAoB,SAAS,OAAO,WAK3E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-file-hash.d.ts","sourceRoot":"","sources":["../../src/utils/get-file-hash.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,eAAO,MAAM,WAAW,SAAU,GAAG,oBAAoB,WAAyE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-package-version.d.ts","sourceRoot":"","sources":["../../src/utils/get-package-version.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,gBAAiB,MAAM,KAAG,MAAM,GAAG,SAMhE,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-tsconfig.d.ts","sourceRoot":"","sources":["../../src/utils/load-tsconfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,IAAI,YAAY,EAAE,MAAM,WAAW,CAAC;AAI9D,eAAO,MAAM,YAAY,YAAa,MAAM,wBAAwB,MAAM,GAAG,SAAS,KAAG,YAAY,GAAG,SAmBvG,CAAC"}
|
package/dist/utils/logger.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAsCA,eAAO,MAAM,IAAI,eAAgB,GAAG,EAAE,SAErC,CAAC;AAEF,eAAO,MAAM,KAAK,eAAgB,GAAG,EAAE,SAEtC,CAAC;AAEF,eAAO,MAAM,IAAI,eAAgB,GAAG,EAAE,SAErC,CAAC;AAEF,eAAO,MAAM,IAAI,eAAgB,GAAG,EAAE,SAErC,CAAC;AAEF,eAAO,MAAM,KAAK,eAAgB,GAAG,EAAE,SAEtC,CAAC"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,eAAO,MAAM,WAAW,SAAU,GAAG,oBAAoB,WAAyE,CAAC;AAEnI,eAAO,MAAM,cAAc,SAAU,GAAG,oBAAoB,SAAS,OAAO,WAK3E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultCache.d.ts","sourceRoot":"","sources":["../../src/worker/defaultCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,eAAO,MAAM,YAAY,kBA0NG,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RuntimeCaching } from "@serwist/sw";
|
|
2
|
+
export interface PageRuntimeCaching extends Omit<RuntimeCaching, "options"> {
|
|
3
|
+
options?: Omit<NonNullable<RuntimeCaching["options"]>, "cacheName">;
|
|
4
|
+
}
|
|
5
|
+
export interface DefinePageRuntimeCachingOptions {
|
|
6
|
+
rscPrefetch?: PageRuntimeCaching;
|
|
7
|
+
rsc?: PageRuntimeCaching;
|
|
8
|
+
html?: PageRuntimeCaching;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Conveniently define three `runtimeCaching` entries for Next.js pages.
|
|
12
|
+
* @param options
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export declare const definePageRuntimeCaching: ({ rscPrefetch, rsc, html }: DefinePageRuntimeCachingOptions) => RuntimeCaching[];
|
|
16
|
+
//# sourceMappingURL=definePageRuntimeCaching.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definePageRuntimeCaching.d.ts","sourceRoot":"","sources":["../../src/worker/definePageRuntimeCaching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC;IACzE,OAAO,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;CACrE;AAED,MAAM,WAAW,+BAA+B;IAC9C,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,GAAG,CAAC,EAAE,kBAAkB,CAAC;IACzB,IAAI,CAAC,EAAE,kBAAkB,CAAC;CAC3B;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,+BAAgC,+BAA+B,KAAG,cAAc,EAiBpH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serwist/next",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-preview.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A module that integrates Serwist into your Next.js application.",
|
|
6
6
|
"files": [
|
|
7
|
-
"
|
|
8
|
-
"
|
|
7
|
+
"src",
|
|
8
|
+
"dist"
|
|
9
9
|
],
|
|
10
10
|
"keywords": [
|
|
11
11
|
"serwist",
|
|
@@ -15,77 +15,75 @@
|
|
|
15
15
|
"web",
|
|
16
16
|
"service-worker"
|
|
17
17
|
],
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=18.0.0"
|
|
20
|
+
},
|
|
18
21
|
"author": "Serwist's Team",
|
|
19
22
|
"license": "MIT",
|
|
20
23
|
"repository": "serwist/serwist",
|
|
21
24
|
"bugs": "https://github.com/serwist/serwist/issues",
|
|
22
25
|
"homepage": "https://serwist.pages.dev",
|
|
23
|
-
"
|
|
24
|
-
"main": "./dist/index.cjs",
|
|
26
|
+
"main": "./dist/index.js",
|
|
25
27
|
"types": "./dist/index.d.ts",
|
|
26
|
-
"exports": {
|
|
27
|
-
".": {
|
|
28
|
-
"import": {
|
|
29
|
-
"types": "./dist/index.d.ts",
|
|
30
|
-
"default": "./dist/index.js"
|
|
31
|
-
},
|
|
32
|
-
"require": {
|
|
33
|
-
"types": "./dist/index.d.cts",
|
|
34
|
-
"default": "./dist/index.cjs"
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"./browser": {
|
|
38
|
-
"import": {
|
|
39
|
-
"types": "./dist/index.browser.d.ts",
|
|
40
|
-
"default": "./dist/index.browser.js"
|
|
41
|
-
},
|
|
42
|
-
"require": {
|
|
43
|
-
"types": "./dist/index.browser.d.cts",
|
|
44
|
-
"default": "./dist/index.browser.cjs"
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
"./typings": {
|
|
48
|
-
"import": {
|
|
49
|
-
"types": "./dist/sw-entry.d.ts"
|
|
50
|
-
},
|
|
51
|
-
"require": {
|
|
52
|
-
"types": "./dist/sw-entry.d.cts"
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
"./package.json": "./package.json"
|
|
56
|
-
},
|
|
57
28
|
"typesVersions": {
|
|
58
29
|
"*": {
|
|
59
|
-
"
|
|
60
|
-
"./dist/index.
|
|
30
|
+
"worker": [
|
|
31
|
+
"./dist/index.worker.d.ts"
|
|
61
32
|
],
|
|
62
33
|
"typings": [
|
|
63
34
|
"./dist/sw-entry.d.ts"
|
|
64
35
|
]
|
|
65
36
|
}
|
|
66
37
|
},
|
|
38
|
+
"exports": {
|
|
39
|
+
".": {
|
|
40
|
+
"types": "./dist/index.d.ts",
|
|
41
|
+
"default": "./dist/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./worker": {
|
|
44
|
+
"types": "./dist/index.worker.d.ts",
|
|
45
|
+
"default": "./dist/index.worker.js"
|
|
46
|
+
},
|
|
47
|
+
"./typings": {
|
|
48
|
+
"types": "./dist/sw-entry.d.ts"
|
|
49
|
+
},
|
|
50
|
+
"./package.json": "./package.json"
|
|
51
|
+
},
|
|
67
52
|
"dependencies": {
|
|
53
|
+
"chalk": "5.3.0",
|
|
68
54
|
"clean-webpack-plugin": "4.0.0",
|
|
69
55
|
"fast-glob": "3.3.2",
|
|
70
|
-
"@serwist/build": "
|
|
71
|
-
"@serwist/
|
|
72
|
-
"@serwist/
|
|
56
|
+
"@serwist/build": "9.0.0-preview.1",
|
|
57
|
+
"@serwist/core": "9.0.0-preview.1",
|
|
58
|
+
"@serwist/webpack-plugin": "9.0.0-preview.1",
|
|
59
|
+
"@serwist/window": "9.0.0-preview.1"
|
|
73
60
|
},
|
|
74
61
|
"devDependencies": {
|
|
75
|
-
"@types/node": "20.
|
|
76
|
-
"
|
|
77
|
-
"next": "14.0.4",
|
|
62
|
+
"@types/node": "20.11.16",
|
|
63
|
+
"next": "14.1.0",
|
|
78
64
|
"react": "18.2.0",
|
|
79
65
|
"react-dom": "18.2.0",
|
|
80
|
-
"rollup": "4.9.
|
|
81
|
-
"type-fest": "4.
|
|
82
|
-
"typescript": "5.4.0-dev.
|
|
83
|
-
"webpack": "5.
|
|
84
|
-
"@serwist/constants": "
|
|
66
|
+
"rollup": "4.9.6",
|
|
67
|
+
"type-fest": "4.10.2",
|
|
68
|
+
"typescript": "5.4.0-dev.20240203",
|
|
69
|
+
"webpack": "5.90.1",
|
|
70
|
+
"@serwist/constants": "9.0.0-preview.1",
|
|
71
|
+
"@serwist/sw": "9.0.0-preview.1",
|
|
72
|
+
"@serwist/utils": "9.0.0-preview.1"
|
|
85
73
|
},
|
|
86
74
|
"peerDependencies": {
|
|
87
75
|
"next": ">=14.0.0",
|
|
88
|
-
"
|
|
76
|
+
"typescript": ">=5.0.0",
|
|
77
|
+
"webpack": ">=5.9.0",
|
|
78
|
+
"@serwist/sw": "9.0.0-preview.1"
|
|
79
|
+
},
|
|
80
|
+
"peerDependenciesMeta": {
|
|
81
|
+
"@serwist/sw": {
|
|
82
|
+
"optional": true
|
|
83
|
+
},
|
|
84
|
+
"typescript": {
|
|
85
|
+
"optional": true
|
|
86
|
+
}
|
|
89
87
|
},
|
|
90
88
|
"scripts": {
|
|
91
89
|
"build": "rimraf dist && cross-env NODE_ENV=production rollup --config rollup.config.js",
|