@serwist/next 9.0.0-preview.16 → 9.0.0-preview.18
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.map +1 -1
- package/dist/index.js +7 -13
- package/dist/index.worker.js +2 -3
- package/dist/lib/schema.d.ts +24 -24
- package/dist/worker/defaultCache.d.ts.map +1 -1
- package/package.json +9 -16
- package/src/index.ts +5 -15
- package/src/worker/defaultCache.ts +2 -3
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAIvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAInE;;;;GAIG;AACH,QAAA,MAAM,eAAe,gBAAiB,qBAAqB,mBAAkB,UAAU,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAIvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAInE;;;;GAIG;AACH,QAAA,MAAM,eAAe,gBAAiB,qBAAqB,mBAAkB,UAAU,KAAK,UAwN3F,CAAC;AAEF,eAAe,eAAe,CAAC;AAC/B,OAAO,EAAE,6BAA6B,EAAE,CAAC;AACzC,YAAY,EAAE,qBAAqB,IAAI,aAAa,EAAE,6BAA6B,IAAI,qBAAqB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -211,20 +211,14 @@ const withSerwistInit = (userOptions)=>{
|
|
|
211
211
|
info(` Scope: ${_scope}`);
|
|
212
212
|
let resolvedManifestEntries = additionalPrecacheEntries;
|
|
213
213
|
if (!resolvedManifestEntries) {
|
|
214
|
-
const
|
|
215
|
-
globPublicPatterns
|
|
216
|
-
] : globPublicPatterns ?? [
|
|
217
|
-
"**/*"
|
|
218
|
-
];
|
|
219
|
-
const publicScan = globSync([
|
|
220
|
-
...userPublicGlob,
|
|
221
|
-
"!swe-worker-*.js",
|
|
222
|
-
"!swe-worker-*.js.map",
|
|
223
|
-
`!${destBase}`,
|
|
224
|
-
`!${destBase}.map`
|
|
225
|
-
], {
|
|
214
|
+
const publicScan = globSync(globPublicPatterns, {
|
|
226
215
|
nodir: true,
|
|
227
|
-
cwd: publicDir
|
|
216
|
+
cwd: publicDir,
|
|
217
|
+
ignore: [
|
|
218
|
+
"swe-worker-*.js",
|
|
219
|
+
destBase,
|
|
220
|
+
`${destBase}.map`
|
|
221
|
+
]
|
|
228
222
|
});
|
|
229
223
|
resolvedManifestEntries = publicScan.map((f)=>({
|
|
230
224
|
url: path.posix.join(basePath, f),
|
package/dist/index.worker.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ExpirationPlugin } from '@serwist/
|
|
2
|
-
import {
|
|
3
|
-
import { CacheFirst, StaleWhileRevalidate, NetworkFirst } from '@serwist/strategies';
|
|
1
|
+
import { ExpirationPlugin, RangeRequestsPlugin } from '@serwist/sw/plugins';
|
|
2
|
+
import { CacheFirst, StaleWhileRevalidate, NetworkFirst } from '@serwist/sw/strategies';
|
|
4
3
|
|
|
5
4
|
const PAGES_CACHE_NAME = {
|
|
6
5
|
rscPrefetch: "pages-rsc-prefetch",
|
package/dist/lib/schema.d.ts
CHANGED
|
@@ -31,100 +31,100 @@ export declare const injectManifestOptions: z.ZodObject<Omit<{
|
|
|
31
31
|
include: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodFunction<z.ZodTuple<[z.ZodAny], null>, z.ZodBoolean>]>, "many">>;
|
|
32
32
|
additionalPrecacheEntries: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
33
33
|
integrity: z.ZodOptional<z.ZodString>;
|
|
34
|
-
revision: z.ZodNullable<z.ZodString
|
|
34
|
+
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
35
|
url: z.ZodString;
|
|
36
36
|
}, "strict", z.ZodTypeAny, {
|
|
37
|
-
revision: string | null;
|
|
38
37
|
url: string;
|
|
39
38
|
integrity?: string | undefined;
|
|
39
|
+
revision?: string | null | undefined;
|
|
40
40
|
}, {
|
|
41
|
-
revision: string | null;
|
|
42
41
|
url: string;
|
|
43
42
|
integrity?: string | undefined;
|
|
43
|
+
revision?: string | null | undefined;
|
|
44
44
|
}>]>, "many">>;
|
|
45
45
|
disablePrecacheManifest: z.ZodDefault<z.ZodBoolean>;
|
|
46
46
|
dontCacheBustURLsMatching: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
47
47
|
manifestTransforms: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodObject<{
|
|
48
48
|
integrity: z.ZodOptional<z.ZodString>;
|
|
49
|
-
revision: z.ZodNullable<z.ZodString
|
|
49
|
+
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
50
|
url: z.ZodString;
|
|
51
51
|
size: z.ZodNumber;
|
|
52
52
|
}, "strip", z.ZodTypeAny, {
|
|
53
|
-
revision: string | null;
|
|
54
53
|
url: string;
|
|
55
54
|
size: number;
|
|
56
55
|
integrity?: string | undefined;
|
|
56
|
+
revision?: string | null | undefined;
|
|
57
57
|
}, {
|
|
58
|
-
revision: string | null;
|
|
59
58
|
url: string;
|
|
60
59
|
size: number;
|
|
61
60
|
integrity?: string | undefined;
|
|
61
|
+
revision?: string | null | undefined;
|
|
62
62
|
}>, "many">, z.ZodOptional<z.ZodUnknown>], null>, z.ZodUnion<[z.ZodPromise<z.ZodObject<{
|
|
63
63
|
manifest: z.ZodArray<z.ZodObject<{
|
|
64
64
|
integrity: z.ZodOptional<z.ZodString>;
|
|
65
|
-
revision: z.ZodNullable<z.ZodString
|
|
65
|
+
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
66
|
url: z.ZodString;
|
|
67
67
|
size: z.ZodNumber;
|
|
68
68
|
}, "strip", z.ZodTypeAny, {
|
|
69
|
-
revision: string | null;
|
|
70
69
|
url: string;
|
|
71
70
|
size: number;
|
|
72
71
|
integrity?: string | undefined;
|
|
72
|
+
revision?: string | null | undefined;
|
|
73
73
|
}, {
|
|
74
|
-
revision: string | null;
|
|
75
74
|
url: string;
|
|
76
75
|
size: number;
|
|
77
76
|
integrity?: string | undefined;
|
|
77
|
+
revision?: string | null | undefined;
|
|
78
78
|
}>, "many">;
|
|
79
79
|
warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
80
80
|
}, "strict", z.ZodTypeAny, {
|
|
81
81
|
manifest: {
|
|
82
|
-
revision: string | null;
|
|
83
82
|
url: string;
|
|
84
83
|
size: number;
|
|
85
84
|
integrity?: string | undefined;
|
|
85
|
+
revision?: string | null | undefined;
|
|
86
86
|
}[];
|
|
87
87
|
warnings?: string[] | undefined;
|
|
88
88
|
}, {
|
|
89
89
|
manifest: {
|
|
90
|
-
revision: string | null;
|
|
91
90
|
url: string;
|
|
92
91
|
size: number;
|
|
93
92
|
integrity?: string | undefined;
|
|
93
|
+
revision?: string | null | undefined;
|
|
94
94
|
}[];
|
|
95
95
|
warnings?: string[] | undefined;
|
|
96
96
|
}>>, z.ZodObject<{
|
|
97
97
|
manifest: z.ZodArray<z.ZodObject<{
|
|
98
98
|
integrity: z.ZodOptional<z.ZodString>;
|
|
99
|
-
revision: z.ZodNullable<z.ZodString
|
|
99
|
+
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
100
100
|
url: z.ZodString;
|
|
101
101
|
size: z.ZodNumber;
|
|
102
102
|
}, "strip", z.ZodTypeAny, {
|
|
103
|
-
revision: string | null;
|
|
104
103
|
url: string;
|
|
105
104
|
size: number;
|
|
106
105
|
integrity?: string | undefined;
|
|
106
|
+
revision?: string | null | undefined;
|
|
107
107
|
}, {
|
|
108
|
-
revision: string | null;
|
|
109
108
|
url: string;
|
|
110
109
|
size: number;
|
|
111
110
|
integrity?: string | undefined;
|
|
111
|
+
revision?: string | null | undefined;
|
|
112
112
|
}>, "many">;
|
|
113
113
|
warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
114
114
|
}, "strict", z.ZodTypeAny, {
|
|
115
115
|
manifest: {
|
|
116
|
-
revision: string | null;
|
|
117
116
|
url: string;
|
|
118
117
|
size: number;
|
|
119
118
|
integrity?: string | undefined;
|
|
119
|
+
revision?: string | null | undefined;
|
|
120
120
|
}[];
|
|
121
121
|
warnings?: string[] | undefined;
|
|
122
122
|
}, {
|
|
123
123
|
manifest: {
|
|
124
|
-
revision: string | null;
|
|
125
124
|
url: string;
|
|
126
125
|
size: number;
|
|
127
126
|
integrity?: string | undefined;
|
|
127
|
+
revision?: string | null | undefined;
|
|
128
128
|
}[];
|
|
129
129
|
warnings?: string[] | undefined;
|
|
130
130
|
}>]>>, "many">>;
|
|
@@ -160,30 +160,30 @@ export declare const injectManifestOptions: z.ZodObject<Omit<{
|
|
|
160
160
|
excludeChunks?: string[] | undefined;
|
|
161
161
|
include?: (string | RegExp | ((args_0: any) => boolean))[] | undefined;
|
|
162
162
|
additionalPrecacheEntries?: (string | {
|
|
163
|
-
revision: string | null;
|
|
164
163
|
url: string;
|
|
165
164
|
integrity?: string | undefined;
|
|
165
|
+
revision?: string | null | undefined;
|
|
166
166
|
})[] | undefined;
|
|
167
167
|
dontCacheBustURLsMatching?: RegExp | undefined;
|
|
168
168
|
manifestTransforms?: ((args_0: {
|
|
169
|
-
revision: string | null;
|
|
170
169
|
url: string;
|
|
171
170
|
size: number;
|
|
172
171
|
integrity?: string | undefined;
|
|
172
|
+
revision?: string | null | undefined;
|
|
173
173
|
}[], args_1: unknown) => {
|
|
174
174
|
manifest: {
|
|
175
|
-
revision: string | null;
|
|
176
175
|
url: string;
|
|
177
176
|
size: number;
|
|
178
177
|
integrity?: string | undefined;
|
|
178
|
+
revision?: string | null | undefined;
|
|
179
179
|
}[];
|
|
180
180
|
warnings?: string[] | undefined;
|
|
181
181
|
} | Promise<{
|
|
182
182
|
manifest: {
|
|
183
|
-
revision: string | null;
|
|
184
183
|
url: string;
|
|
185
184
|
size: number;
|
|
186
185
|
integrity?: string | undefined;
|
|
186
|
+
revision?: string | null | undefined;
|
|
187
187
|
}[];
|
|
188
188
|
warnings?: string[] | undefined;
|
|
189
189
|
}>)[] | undefined;
|
|
@@ -204,30 +204,30 @@ export declare const injectManifestOptions: z.ZodObject<Omit<{
|
|
|
204
204
|
excludeChunks?: string[] | undefined;
|
|
205
205
|
include?: (string | RegExp | ((args_0: any) => boolean))[] | undefined;
|
|
206
206
|
additionalPrecacheEntries?: (string | {
|
|
207
|
-
revision: string | null;
|
|
208
207
|
url: string;
|
|
209
208
|
integrity?: string | undefined;
|
|
209
|
+
revision?: string | null | undefined;
|
|
210
210
|
})[] | undefined;
|
|
211
211
|
dontCacheBustURLsMatching?: RegExp | undefined;
|
|
212
212
|
manifestTransforms?: ((args_0: {
|
|
213
|
-
revision: string | null;
|
|
214
213
|
url: string;
|
|
215
214
|
size: number;
|
|
216
215
|
integrity?: string | undefined;
|
|
216
|
+
revision?: string | null | undefined;
|
|
217
217
|
}[], args_1: unknown) => {
|
|
218
218
|
manifest: {
|
|
219
|
-
revision: string | null;
|
|
220
219
|
url: string;
|
|
221
220
|
size: number;
|
|
222
221
|
integrity?: string | undefined;
|
|
222
|
+
revision?: string | null | undefined;
|
|
223
223
|
}[];
|
|
224
224
|
warnings?: string[] | undefined;
|
|
225
225
|
} | Promise<{
|
|
226
226
|
manifest: {
|
|
227
|
-
revision: string | null;
|
|
228
227
|
url: string;
|
|
229
228
|
size: number;
|
|
230
229
|
integrity?: string | undefined;
|
|
230
|
+
revision?: string | null | undefined;
|
|
231
231
|
}[];
|
|
232
232
|
warnings?: string[] | undefined;
|
|
233
233
|
}>)[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultCache.d.ts","sourceRoot":"","sources":["../../src/worker/defaultCache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"defaultCache.d.ts","sourceRoot":"","sources":["../../src/worker/defaultCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAMlD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,EAiQlC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serwist/next",
|
|
3
|
-
"version": "9.0.0-preview.
|
|
3
|
+
"version": "9.0.0-preview.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A module that integrates Serwist into your Next.js application.",
|
|
6
6
|
"files": [
|
|
@@ -65,13 +65,11 @@
|
|
|
65
65
|
"chalk": "5.3.0",
|
|
66
66
|
"glob": "10.3.10",
|
|
67
67
|
"zod": "3.22.4",
|
|
68
|
-
"@serwist/build": "9.0.0-preview.
|
|
69
|
-
"@serwist/core": "9.0.0-preview.
|
|
70
|
-
"@serwist/
|
|
71
|
-
"@serwist/
|
|
72
|
-
"@serwist/
|
|
73
|
-
"@serwist/webpack-plugin": "9.0.0-preview.16",
|
|
74
|
-
"@serwist/window": "9.0.0-preview.16"
|
|
68
|
+
"@serwist/build": "9.0.0-preview.18",
|
|
69
|
+
"@serwist/core": "9.0.0-preview.18",
|
|
70
|
+
"@serwist/sw": "9.0.0-preview.18",
|
|
71
|
+
"@serwist/webpack-plugin": "9.0.0-preview.18",
|
|
72
|
+
"@serwist/window": "9.0.0-preview.18"
|
|
75
73
|
},
|
|
76
74
|
"devDependencies": {
|
|
77
75
|
"@types/node": "20.11.30",
|
|
@@ -82,19 +80,14 @@
|
|
|
82
80
|
"type-fest": "4.13.1",
|
|
83
81
|
"typescript": "5.5.0-dev.20240323",
|
|
84
82
|
"webpack": "5.91.0",
|
|
85
|
-
"@serwist/constants": "9.0.0-preview.
|
|
86
|
-
"@serwist/
|
|
87
|
-
"@serwist/utils": "9.0.0-preview.16"
|
|
83
|
+
"@serwist/constants": "9.0.0-preview.18",
|
|
84
|
+
"@serwist/utils": "9.0.0-preview.18"
|
|
88
85
|
},
|
|
89
86
|
"peerDependencies": {
|
|
90
87
|
"next": ">=14.0.0",
|
|
91
|
-
"typescript": ">=5.0.0"
|
|
92
|
-
"@serwist/sw": "9.0.0-preview.16"
|
|
88
|
+
"typescript": ">=5.0.0"
|
|
93
89
|
},
|
|
94
90
|
"peerDependenciesMeta": {
|
|
95
|
-
"@serwist/sw": {
|
|
96
|
-
"optional": true
|
|
97
|
-
},
|
|
98
91
|
"typescript": {
|
|
99
92
|
"optional": true
|
|
100
93
|
}
|
package/src/index.ts
CHANGED
|
@@ -169,21 +169,11 @@ const withSerwistInit = (userOptions: InjectManifestOptions): ((nextConfig?: Nex
|
|
|
169
169
|
let resolvedManifestEntries = additionalPrecacheEntries;
|
|
170
170
|
|
|
171
171
|
if (!resolvedManifestEntries) {
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
"!swe-worker-*.js",
|
|
178
|
-
"!swe-worker-*.js.map",
|
|
179
|
-
`!${destBase}`,
|
|
180
|
-
`!${destBase}.map`,
|
|
181
|
-
],
|
|
182
|
-
{
|
|
183
|
-
nodir: true,
|
|
184
|
-
cwd: publicDir,
|
|
185
|
-
},
|
|
186
|
-
);
|
|
172
|
+
const publicScan = globSync(globPublicPatterns, {
|
|
173
|
+
nodir: true,
|
|
174
|
+
cwd: publicDir,
|
|
175
|
+
ignore: ["swe-worker-*.js", destBase, `${destBase}.map`],
|
|
176
|
+
});
|
|
187
177
|
resolvedManifestEntries = publicScan.map((f) => ({
|
|
188
178
|
url: path.posix.join(basePath, f),
|
|
189
179
|
revision: getFileHash(path.join(publicDir, f)),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ExpirationPlugin } from "@serwist/expiration";
|
|
2
|
-
import { RangeRequestsPlugin } from "@serwist/range-requests";
|
|
3
|
-
import { CacheFirst, NetworkFirst, StaleWhileRevalidate } from "@serwist/strategies";
|
|
4
1
|
import type { RuntimeCaching } from "@serwist/sw";
|
|
2
|
+
import { ExpirationPlugin, RangeRequestsPlugin } from "@serwist/sw/plugins";
|
|
3
|
+
import { CacheFirst, NetworkFirst, StaleWhileRevalidate } from "@serwist/sw/strategies";
|
|
5
4
|
|
|
6
5
|
import { PAGES_CACHE_NAME } from "./constants.js";
|
|
7
6
|
|