@serwist/vite 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.js +1 -1
- package/dist/index.worker.d.ts.map +1 -1
- package/dist/index.worker.js +2 -2
- package/dist/lib/modules.d.ts +1 -1
- package/dist/lib/modules.d.ts.map +1 -1
- package/dist/lib/schema.d.ts +24 -24
- package/package.json +8 -13
- package/src/index.worker.ts +2 -2
- package/src/lib/modules.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { validationErrorMap, SerwistConfigError } from '@serwist/build/schema';
|
|
|
7
7
|
import { normalizePath } from 'vite';
|
|
8
8
|
import process from 'node:process';
|
|
9
9
|
|
|
10
|
-
var version = "9.0.0-preview.
|
|
10
|
+
var version = "9.0.0-preview.18";
|
|
11
11
|
|
|
12
12
|
const logSerwistResult = (buildResult, viteOptions)=>{
|
|
13
13
|
const { logLevel = "info" } = viteOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.worker.d.ts","sourceRoot":"","sources":["../src/index.worker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.worker.d.ts","sourceRoot":"","sources":["../src/index.worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,EA8GpC,CAAC"}
|
package/dist/index.worker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ExpirationPlugin } from '@serwist/
|
|
2
|
-
import { CacheFirst, StaleWhileRevalidate, NetworkFirst } from '@serwist/strategies';
|
|
1
|
+
import { ExpirationPlugin } from '@serwist/sw/plugins';
|
|
2
|
+
import { CacheFirst, StaleWhileRevalidate, NetworkFirst } from '@serwist/sw/strategies';
|
|
3
3
|
|
|
4
4
|
const defaultCache = import.meta.env.DEV ? [] : [
|
|
5
5
|
{
|
package/dist/lib/modules.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare const loadSerwistBuild: () => Promise<typeof SerwistBuild>;
|
|
|
4
4
|
interface BuildResult extends SerwistBuild.GetManifestResult {
|
|
5
5
|
manifestString: string;
|
|
6
6
|
}
|
|
7
|
-
export declare const injectManifest: (options: SerwistBuild.
|
|
7
|
+
export declare const injectManifest: (options: SerwistBuild.GetManifestOptionsComplete) => Promise<BuildResult>;
|
|
8
8
|
export declare const generateServiceWorker: (ctx: SerwistViteContext) => Promise<BuildResult | undefined>;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=modules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/lib/modules.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,gBAAgB,QAAa,QAAQ,mBAAmB,CASpE,CAAC;AAEF,UAAU,WAAY,SAAQ,YAAY,CAAC,iBAAiB;IAC1D,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,cAAc,YAAmB,aAAa,
|
|
1
|
+
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/lib/modules.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,gBAAgB,QAAa,QAAQ,mBAAmB,CASpE,CAAC;AAEF,UAAU,WAAY,SAAQ,YAAY,CAAC,iBAAiB;IAC1D,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,cAAc,YAAmB,aAAa,0BAA0B,KAAG,QAAQ,WAAW,CAW1G,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAe,kBAAkB,qCAwIlE,CAAC"}
|
package/dist/lib/schema.d.ts
CHANGED
|
@@ -97,100 +97,100 @@ export declare const injectManifestPartial: z.ZodObject<{
|
|
|
97
97
|
export declare const injectManifestOptions: z.ZodObject<{
|
|
98
98
|
additionalPrecacheEntries: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
99
99
|
integrity: z.ZodOptional<z.ZodString>;
|
|
100
|
-
revision: z.ZodNullable<z.ZodString
|
|
100
|
+
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
101
101
|
url: z.ZodString;
|
|
102
102
|
}, "strict", z.ZodTypeAny, {
|
|
103
|
-
revision: string | null;
|
|
104
103
|
url: string;
|
|
105
104
|
integrity?: string | undefined;
|
|
105
|
+
revision?: string | null | undefined;
|
|
106
106
|
}, {
|
|
107
|
-
revision: string | null;
|
|
108
107
|
url: string;
|
|
109
108
|
integrity?: string | undefined;
|
|
109
|
+
revision?: string | null | undefined;
|
|
110
110
|
}>]>, "many">>;
|
|
111
111
|
disablePrecacheManifest: z.ZodDefault<z.ZodBoolean>;
|
|
112
112
|
dontCacheBustURLsMatching: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
113
113
|
manifestTransforms: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodObject<{
|
|
114
114
|
integrity: z.ZodOptional<z.ZodString>;
|
|
115
|
-
revision: z.ZodNullable<z.ZodString
|
|
115
|
+
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
116
116
|
url: z.ZodString;
|
|
117
117
|
size: z.ZodNumber;
|
|
118
118
|
}, "strip", z.ZodTypeAny, {
|
|
119
|
-
revision: string | null;
|
|
120
119
|
url: string;
|
|
121
120
|
size: number;
|
|
122
121
|
integrity?: string | undefined;
|
|
122
|
+
revision?: string | null | undefined;
|
|
123
123
|
}, {
|
|
124
|
-
revision: string | null;
|
|
125
124
|
url: string;
|
|
126
125
|
size: number;
|
|
127
126
|
integrity?: string | undefined;
|
|
127
|
+
revision?: string | null | undefined;
|
|
128
128
|
}>, "many">, z.ZodOptional<z.ZodUnknown>], null>, z.ZodUnion<[z.ZodPromise<z.ZodObject<{
|
|
129
129
|
manifest: z.ZodArray<z.ZodObject<{
|
|
130
130
|
integrity: z.ZodOptional<z.ZodString>;
|
|
131
|
-
revision: z.ZodNullable<z.ZodString
|
|
131
|
+
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
132
|
url: z.ZodString;
|
|
133
133
|
size: z.ZodNumber;
|
|
134
134
|
}, "strip", z.ZodTypeAny, {
|
|
135
|
-
revision: string | null;
|
|
136
135
|
url: string;
|
|
137
136
|
size: number;
|
|
138
137
|
integrity?: string | undefined;
|
|
138
|
+
revision?: string | null | undefined;
|
|
139
139
|
}, {
|
|
140
|
-
revision: string | null;
|
|
141
140
|
url: string;
|
|
142
141
|
size: number;
|
|
143
142
|
integrity?: string | undefined;
|
|
143
|
+
revision?: string | null | undefined;
|
|
144
144
|
}>, "many">;
|
|
145
145
|
warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
146
146
|
}, "strict", z.ZodTypeAny, {
|
|
147
147
|
manifest: {
|
|
148
|
-
revision: string | null;
|
|
149
148
|
url: string;
|
|
150
149
|
size: number;
|
|
151
150
|
integrity?: string | undefined;
|
|
151
|
+
revision?: string | null | undefined;
|
|
152
152
|
}[];
|
|
153
153
|
warnings?: string[] | undefined;
|
|
154
154
|
}, {
|
|
155
155
|
manifest: {
|
|
156
|
-
revision: string | null;
|
|
157
156
|
url: string;
|
|
158
157
|
size: number;
|
|
159
158
|
integrity?: string | undefined;
|
|
159
|
+
revision?: string | null | undefined;
|
|
160
160
|
}[];
|
|
161
161
|
warnings?: string[] | undefined;
|
|
162
162
|
}>>, z.ZodObject<{
|
|
163
163
|
manifest: z.ZodArray<z.ZodObject<{
|
|
164
164
|
integrity: z.ZodOptional<z.ZodString>;
|
|
165
|
-
revision: z.ZodNullable<z.ZodString
|
|
165
|
+
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
166
166
|
url: z.ZodString;
|
|
167
167
|
size: z.ZodNumber;
|
|
168
168
|
}, "strip", z.ZodTypeAny, {
|
|
169
|
-
revision: string | null;
|
|
170
169
|
url: string;
|
|
171
170
|
size: number;
|
|
172
171
|
integrity?: string | undefined;
|
|
172
|
+
revision?: string | null | undefined;
|
|
173
173
|
}, {
|
|
174
|
-
revision: string | null;
|
|
175
174
|
url: string;
|
|
176
175
|
size: number;
|
|
177
176
|
integrity?: string | undefined;
|
|
177
|
+
revision?: string | null | undefined;
|
|
178
178
|
}>, "many">;
|
|
179
179
|
warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
180
180
|
}, "strict", z.ZodTypeAny, {
|
|
181
181
|
manifest: {
|
|
182
|
-
revision: string | null;
|
|
183
182
|
url: string;
|
|
184
183
|
size: number;
|
|
185
184
|
integrity?: string | undefined;
|
|
185
|
+
revision?: string | null | undefined;
|
|
186
186
|
}[];
|
|
187
187
|
warnings?: string[] | undefined;
|
|
188
188
|
}, {
|
|
189
189
|
manifest: {
|
|
190
|
-
revision: string | null;
|
|
191
190
|
url: string;
|
|
192
191
|
size: number;
|
|
193
192
|
integrity?: string | undefined;
|
|
193
|
+
revision?: string | null | undefined;
|
|
194
194
|
}[];
|
|
195
195
|
warnings?: string[] | undefined;
|
|
196
196
|
}>]>>, "many">>;
|
|
@@ -267,30 +267,30 @@ export declare const injectManifestOptions: z.ZodObject<{
|
|
|
267
267
|
swDest: string;
|
|
268
268
|
globDirectory: string;
|
|
269
269
|
additionalPrecacheEntries?: (string | {
|
|
270
|
-
revision: string | null;
|
|
271
270
|
url: string;
|
|
272
271
|
integrity?: string | undefined;
|
|
272
|
+
revision?: string | null | undefined;
|
|
273
273
|
})[] | undefined;
|
|
274
274
|
dontCacheBustURLsMatching?: RegExp | undefined;
|
|
275
275
|
manifestTransforms?: ((args_0: {
|
|
276
|
-
revision: string | null;
|
|
277
276
|
url: string;
|
|
278
277
|
size: number;
|
|
279
278
|
integrity?: string | undefined;
|
|
279
|
+
revision?: string | null | undefined;
|
|
280
280
|
}[], args_1: unknown) => {
|
|
281
281
|
manifest: {
|
|
282
|
-
revision: string | null;
|
|
283
282
|
url: string;
|
|
284
283
|
size: number;
|
|
285
284
|
integrity?: string | undefined;
|
|
285
|
+
revision?: string | null | undefined;
|
|
286
286
|
}[];
|
|
287
287
|
warnings?: string[] | undefined;
|
|
288
288
|
} | Promise<{
|
|
289
289
|
manifest: {
|
|
290
|
-
revision: string | null;
|
|
291
290
|
url: string;
|
|
292
291
|
size: number;
|
|
293
292
|
integrity?: string | undefined;
|
|
293
|
+
revision?: string | null | undefined;
|
|
294
294
|
}[];
|
|
295
295
|
warnings?: string[] | undefined;
|
|
296
296
|
}>)[] | undefined;
|
|
@@ -304,31 +304,31 @@ export declare const injectManifestOptions: z.ZodObject<{
|
|
|
304
304
|
swDest: string;
|
|
305
305
|
globDirectory: string;
|
|
306
306
|
additionalPrecacheEntries?: (string | {
|
|
307
|
-
revision: string | null;
|
|
308
307
|
url: string;
|
|
309
308
|
integrity?: string | undefined;
|
|
309
|
+
revision?: string | null | undefined;
|
|
310
310
|
})[] | undefined;
|
|
311
311
|
disablePrecacheManifest?: boolean | undefined;
|
|
312
312
|
dontCacheBustURLsMatching?: RegExp | undefined;
|
|
313
313
|
manifestTransforms?: ((args_0: {
|
|
314
|
-
revision: string | null;
|
|
315
314
|
url: string;
|
|
316
315
|
size: number;
|
|
317
316
|
integrity?: string | undefined;
|
|
317
|
+
revision?: string | null | undefined;
|
|
318
318
|
}[], args_1: unknown) => {
|
|
319
319
|
manifest: {
|
|
320
|
-
revision: string | null;
|
|
321
320
|
url: string;
|
|
322
321
|
size: number;
|
|
323
322
|
integrity?: string | undefined;
|
|
323
|
+
revision?: string | null | undefined;
|
|
324
324
|
}[];
|
|
325
325
|
warnings?: string[] | undefined;
|
|
326
326
|
} | Promise<{
|
|
327
327
|
manifest: {
|
|
328
|
-
revision: string | null;
|
|
329
328
|
url: string;
|
|
330
329
|
size: number;
|
|
331
330
|
integrity?: string | undefined;
|
|
331
|
+
revision?: string | null | undefined;
|
|
332
332
|
}[];
|
|
333
333
|
warnings?: string[] | undefined;
|
|
334
334
|
}>)[] | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serwist/vite",
|
|
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 Vite application.",
|
|
6
6
|
"files": [
|
|
@@ -72,29 +72,24 @@
|
|
|
72
72
|
"glob": "10.3.10",
|
|
73
73
|
"kolorist": "1.8.0",
|
|
74
74
|
"zod": "3.22.4",
|
|
75
|
-
"@serwist/build": "9.0.0-preview.
|
|
76
|
-
"@serwist/
|
|
77
|
-
"@serwist/
|
|
78
|
-
"@serwist/window": "9.0.0-preview.16"
|
|
75
|
+
"@serwist/build": "9.0.0-preview.18",
|
|
76
|
+
"@serwist/sw": "9.0.0-preview.18",
|
|
77
|
+
"@serwist/window": "9.0.0-preview.18"
|
|
79
78
|
},
|
|
80
79
|
"devDependencies": {
|
|
81
80
|
"@types/node": "20.11.30",
|
|
82
81
|
"rollup": "4.13.0",
|
|
83
82
|
"typescript": "5.5.0-dev.20240323",
|
|
84
83
|
"vite": "5.2.4",
|
|
85
|
-
"@serwist/constants": "9.0.0-preview.
|
|
86
|
-
"@serwist/sw": "9.0.0-preview.
|
|
87
|
-
"@serwist/utils": "9.0.0-preview.
|
|
84
|
+
"@serwist/constants": "9.0.0-preview.18",
|
|
85
|
+
"@serwist/sw": "9.0.0-preview.18",
|
|
86
|
+
"@serwist/utils": "9.0.0-preview.18"
|
|
88
87
|
},
|
|
89
88
|
"peerDependencies": {
|
|
90
89
|
"typescript": ">=5.0.0",
|
|
91
|
-
"vite": "^5.0.0"
|
|
92
|
-
"@serwist/sw": "9.0.0-preview.16"
|
|
90
|
+
"vite": "^5.0.0"
|
|
93
91
|
},
|
|
94
92
|
"peerDependenciesMeta": {
|
|
95
|
-
"@serwist/sw": {
|
|
96
|
-
"optional": true
|
|
97
|
-
},
|
|
98
93
|
"typescript": {
|
|
99
94
|
"optional": true
|
|
100
95
|
}
|
package/src/index.worker.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ExpirationPlugin } from "@serwist/expiration";
|
|
2
|
-
import { CacheFirst, NetworkFirst, StaleWhileRevalidate } from "@serwist/strategies";
|
|
3
1
|
import type { RuntimeCaching } from "@serwist/sw";
|
|
2
|
+
import { ExpirationPlugin } from "@serwist/sw/plugins";
|
|
3
|
+
import { CacheFirst, NetworkFirst, StaleWhileRevalidate } from "@serwist/sw/strategies";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The default, recommended list of caching strategies for applications
|
package/src/lib/modules.ts
CHANGED
|
@@ -21,7 +21,7 @@ interface BuildResult extends SerwistBuild.GetManifestResult {
|
|
|
21
21
|
manifestString: string;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export const injectManifest = async (options: SerwistBuild.
|
|
24
|
+
export const injectManifest = async (options: SerwistBuild.GetManifestOptionsComplete): Promise<BuildResult> => {
|
|
25
25
|
const { getFileManifestEntries, stringify } = await loadSerwistBuild();
|
|
26
26
|
const { count, size, manifestEntries, warnings } = await getFileManifestEntries(options);
|
|
27
27
|
const manifestString = manifestEntries === undefined ? "undefined" : stringify(manifestEntries);
|