@serwist/build 9.0.0-preview.1 → 9.0.0-preview.11
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/chunks/webpack.js +1 -2
- package/dist/index.js +6 -12
- package/dist/lib/errors.d.ts +0 -3
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/get-file-details.d.ts +2 -2
- package/dist/lib/get-file-details.d.ts.map +1 -1
- package/dist/schema/next.d.ts +0 -3
- package/dist/schema/next.d.ts.map +1 -1
- package/dist/schema/webpack.d.ts +0 -6
- package/dist/schema/webpack.d.ts.map +1 -1
- package/dist/types.d.ts +7 -14
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/lib/errors.ts +0 -6
- package/src/lib/get-file-details.ts +5 -5
- package/src/lib/get-file-manifest-entries.ts +4 -4
- package/src/schema/webpack.ts +1 -2
- package/src/types.ts +7 -14
- package/src/_types.js +0 -112
package/dist/chunks/webpack.js
CHANGED
|
@@ -21,8 +21,7 @@ const webpackPartial = z.object({
|
|
|
21
21
|
z.function(z.tuple([
|
|
22
22
|
z.any()
|
|
23
23
|
]), z.boolean())
|
|
24
|
-
])).optional()
|
|
25
|
-
mode: z.string().nullable().optional()
|
|
24
|
+
])).optional()
|
|
26
25
|
}).strict("Do not pass invalid properties to WebpackPartial!");
|
|
27
26
|
const webpackInjectManifestPartial = z.object({
|
|
28
27
|
compileSrc: z.boolean().default(true),
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ export { default as stringify } from 'fast-json-stable-stringify';
|
|
|
3
3
|
import assert from 'assert';
|
|
4
4
|
import { oneLine } from 'common-tags';
|
|
5
5
|
import crypto from 'crypto';
|
|
6
|
-
import {
|
|
6
|
+
import { globSync } from 'glob';
|
|
7
7
|
import upath from 'upath';
|
|
8
8
|
import fse from 'fs-extra';
|
|
9
9
|
import prettyBytes from 'pretty-bytes';
|
|
@@ -75,12 +75,6 @@ const errors = {
|
|
|
75
75
|
Please remove or fix the following: `,
|
|
76
76
|
"bad-template-urls-asset": oneLine`There was an issue using one of the provided
|
|
77
77
|
'templatedURLs'.`,
|
|
78
|
-
"invalid-runtime-caching": oneLine`The 'runtimeCaching' parameter must an an
|
|
79
|
-
array of objects with at least a 'urlPattern' and 'handler'.`,
|
|
80
|
-
"urlPattern-is-required": oneLine`The 'urlPattern' option is required when using
|
|
81
|
-
'runtimeCaching'.`,
|
|
82
|
-
"handler-is-required": oneLine`The 'handler' option is required when using
|
|
83
|
-
runtimeCaching.`,
|
|
84
78
|
"invalid-generate-file-manifest-arg": oneLine`The input to generateFileManifest()
|
|
85
79
|
must be an Object.`,
|
|
86
80
|
"invalid-sw-src": `The 'swSrc' file can't be read.`,
|
|
@@ -145,11 +139,11 @@ function getFileSize(file) {
|
|
|
145
139
|
}
|
|
146
140
|
}
|
|
147
141
|
|
|
148
|
-
|
|
142
|
+
const getFileDetails = ({ globDirectory, globFollow, globIgnores, globPattern })=>{
|
|
149
143
|
let globbedFiles;
|
|
150
144
|
let warning = "";
|
|
151
145
|
try {
|
|
152
|
-
globbedFiles =
|
|
146
|
+
globbedFiles = globSync(globPattern, {
|
|
153
147
|
cwd: globDirectory,
|
|
154
148
|
follow: globFollow,
|
|
155
149
|
ignore: globIgnores
|
|
@@ -181,7 +175,7 @@ function getFileDetails({ globDirectory, globFollow, globIgnores, globPattern })
|
|
|
181
175
|
globbedFileDetails,
|
|
182
176
|
warning
|
|
183
177
|
};
|
|
184
|
-
}
|
|
178
|
+
};
|
|
185
179
|
|
|
186
180
|
function getStringDetails(url, str) {
|
|
187
181
|
return {
|
|
@@ -413,11 +407,11 @@ async function getFileManifestEntries({ additionalPrecacheEntries, dontCacheBust
|
|
|
413
407
|
} catch (error) {
|
|
414
408
|
const debugObj = {};
|
|
415
409
|
debugObj[url] = dependencies;
|
|
416
|
-
throw new Error(`${errors["bad-template-urls-asset"]}
|
|
410
|
+
throw new Error(`${errors["bad-template-urls-asset"]} '${globPattern}' from '${JSON.stringify(debugObj)}':\n${error instanceof Error ? error.toString() : ""}`);
|
|
417
411
|
}
|
|
418
412
|
}, []);
|
|
419
413
|
if (details.length === 0) {
|
|
420
|
-
throw new Error(`${errors["bad-template-urls-asset"]} The glob
|
|
414
|
+
throw new Error(`${errors["bad-template-urls-asset"]} The glob pattern '${dependencies.toString()}' did not match anything.`);
|
|
421
415
|
}
|
|
422
416
|
allFileDetails.set(url, getCompositeDetails(url, details));
|
|
423
417
|
} else if (typeof dependencies === "string") {
|
package/dist/lib/errors.d.ts
CHANGED
|
@@ -35,9 +35,6 @@ export declare const errors: {
|
|
|
35
35
|
"multiple-injection-points": string;
|
|
36
36
|
"useless-glob-pattern": string;
|
|
37
37
|
"bad-template-urls-asset": string;
|
|
38
|
-
"invalid-runtime-caching": string;
|
|
39
|
-
"urlPattern-is-required": string;
|
|
40
|
-
"handler-is-required": string;
|
|
41
38
|
"invalid-generate-file-manifest-arg": string;
|
|
42
39
|
"invalid-sw-src": string;
|
|
43
40
|
"same-src-and-dest": string;
|
package/dist/lib/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFlB,CAAC"}
|
|
@@ -4,10 +4,10 @@ interface FileDetails {
|
|
|
4
4
|
hash: string;
|
|
5
5
|
size: number;
|
|
6
6
|
}
|
|
7
|
-
export declare
|
|
7
|
+
export declare const getFileDetails: ({ globDirectory, globFollow, globIgnores, globPattern, }: Omit<GlobPartial, "globPatterns" | "templatedURLs" | "globDirectory"> & {
|
|
8
8
|
globDirectory: string;
|
|
9
9
|
globPattern: string;
|
|
10
|
-
})
|
|
10
|
+
}) => {
|
|
11
11
|
globbedFileDetails: FileDetails[];
|
|
12
12
|
warning: string;
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-file-details.d.ts","sourceRoot":"","sources":["../../src/lib/get-file-details.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK/C,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,
|
|
1
|
+
{"version":3,"file":"get-file-details.d.ts","sourceRoot":"","sources":["../../src/lib/get-file-details.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK/C,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,cAAc;mBAOV,MAAM;iBACR,MAAM;;wBAEC,WAAW,EAAE;aACxB,MAAM;CAkChB,CAAC"}
|
package/dist/schema/next.d.ts
CHANGED
|
@@ -132,7 +132,6 @@ export declare const nextInjectManifestOptions: z.ZodObject<Omit<{
|
|
|
132
132
|
chunks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
133
133
|
excludeChunks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
134
134
|
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">>;
|
|
135
|
-
mode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
136
135
|
compileSrc: z.ZodDefault<z.ZodBoolean>;
|
|
137
136
|
webpackCompilationPlugins: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
138
137
|
swDest: z.ZodString;
|
|
@@ -188,7 +187,6 @@ export declare const nextInjectManifestOptions: z.ZodObject<Omit<{
|
|
|
188
187
|
chunks?: string[] | undefined;
|
|
189
188
|
excludeChunks?: string[] | undefined;
|
|
190
189
|
include?: (string | RegExp | ((args_0: any) => boolean))[] | undefined;
|
|
191
|
-
mode?: string | null | undefined;
|
|
192
190
|
webpackCompilationPlugins?: any[] | undefined;
|
|
193
191
|
scope?: string | undefined;
|
|
194
192
|
}, {
|
|
@@ -229,7 +227,6 @@ export declare const nextInjectManifestOptions: z.ZodObject<Omit<{
|
|
|
229
227
|
chunks?: string[] | undefined;
|
|
230
228
|
excludeChunks?: string[] | undefined;
|
|
231
229
|
include?: (string | RegExp | ((args_0: any) => boolean))[] | undefined;
|
|
232
|
-
mode?: string | null | undefined;
|
|
233
230
|
compileSrc?: boolean | undefined;
|
|
234
231
|
webpackCompilationPlugins?: any[] | undefined;
|
|
235
232
|
cacheOnNavigation?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/schema/next.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;EAUmC,CAAC;AAE1E,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/schema/next.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;EAUmC,CAAC;AAE1E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAImC,CAAC"}
|
package/dist/schema/webpack.d.ts
CHANGED
|
@@ -4,19 +4,16 @@ export declare const webpackPartial: z.ZodObject<{
|
|
|
4
4
|
exclude: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodFunction<z.ZodTuple<[z.ZodAny], null>, z.ZodBoolean>]>, "many">>;
|
|
5
5
|
excludeChunks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
6
6
|
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">>;
|
|
7
|
-
mode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
7
|
}, "strict", z.ZodTypeAny, {
|
|
9
8
|
exclude: (string | RegExp | ((args_0: any) => boolean))[];
|
|
10
9
|
chunks?: string[] | undefined;
|
|
11
10
|
excludeChunks?: string[] | undefined;
|
|
12
11
|
include?: (string | RegExp | ((args_0: any) => boolean))[] | undefined;
|
|
13
|
-
mode?: string | null | undefined;
|
|
14
12
|
}, {
|
|
15
13
|
chunks?: string[] | undefined;
|
|
16
14
|
exclude?: (string | RegExp | ((args_0: any) => boolean))[] | undefined;
|
|
17
15
|
excludeChunks?: string[] | undefined;
|
|
18
16
|
include?: (string | RegExp | ((args_0: any) => boolean))[] | undefined;
|
|
19
|
-
mode?: string | null | undefined;
|
|
20
17
|
}>;
|
|
21
18
|
export declare const webpackInjectManifestPartial: z.ZodObject<{
|
|
22
19
|
compileSrc: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -139,7 +136,6 @@ export declare const webpackInjectManifestOptions: z.ZodObject<{
|
|
|
139
136
|
chunks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
140
137
|
excludeChunks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
141
138
|
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">>;
|
|
142
|
-
mode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
143
139
|
compileSrc: z.ZodDefault<z.ZodBoolean>;
|
|
144
140
|
swDest: z.ZodOptional<z.ZodString>;
|
|
145
141
|
webpackCompilationPlugins: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
@@ -182,7 +178,6 @@ export declare const webpackInjectManifestOptions: z.ZodObject<{
|
|
|
182
178
|
chunks?: string[] | undefined;
|
|
183
179
|
excludeChunks?: string[] | undefined;
|
|
184
180
|
include?: (string | RegExp | ((args_0: any) => boolean))[] | undefined;
|
|
185
|
-
mode?: string | null | undefined;
|
|
186
181
|
swDest?: string | undefined;
|
|
187
182
|
webpackCompilationPlugins?: any[] | undefined;
|
|
188
183
|
}, {
|
|
@@ -223,7 +218,6 @@ export declare const webpackInjectManifestOptions: z.ZodObject<{
|
|
|
223
218
|
chunks?: string[] | undefined;
|
|
224
219
|
excludeChunks?: string[] | undefined;
|
|
225
220
|
include?: (string | RegExp | ((args_0: any) => boolean))[] | undefined;
|
|
226
|
-
mode?: string | null | undefined;
|
|
227
221
|
compileSrc?: boolean | undefined;
|
|
228
222
|
swDest?: string | undefined;
|
|
229
223
|
webpackCompilationPlugins?: any[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../../src/schema/webpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../../src/schema/webpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;EASmC,CAAC;AAE/D,eAAO,MAAM,4BAA4B;;;;;;;;;;;;EAMmC,CAAC;AAE7E,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKmC,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -85,14 +85,14 @@ export interface GlobPartial {
|
|
|
85
85
|
/**
|
|
86
86
|
* Determines whether or not symlinks are followed when generating the
|
|
87
87
|
* precache manifest. For more information, see the definition of `follow` in
|
|
88
|
-
* [`glob`'s documentation](https://github.com/isaacs/node-glob#options).
|
|
88
|
+
* [`node-glob`'s documentation](https://github.com/isaacs/node-glob#options).
|
|
89
89
|
* @default true
|
|
90
90
|
*/
|
|
91
91
|
globFollow?: boolean;
|
|
92
92
|
/**
|
|
93
93
|
* A set of patterns matching files to always exclude when generating the
|
|
94
94
|
* precache manifest. For more information, see the definition of `ignore` in
|
|
95
|
-
* [`glob`'s documentation](https://github.com/isaacs/node-glob#options).
|
|
95
|
+
* [`node-glob`'s documentation](https://github.com/isaacs/node-glob#options).
|
|
96
96
|
* @default
|
|
97
97
|
* ```
|
|
98
98
|
* ["**\/node_modules\/**\/*"]
|
|
@@ -102,7 +102,7 @@ export interface GlobPartial {
|
|
|
102
102
|
/**
|
|
103
103
|
* Files matching any of these patterns will be included in the precache
|
|
104
104
|
* manifest. For more information, see
|
|
105
|
-
* [`glob`'s Glob Primer](https://github.com/isaacs/node-glob#glob-primer).
|
|
105
|
+
* [`node-glob`'s Glob Primer](https://github.com/isaacs/node-glob#glob-primer).
|
|
106
106
|
* @default
|
|
107
107
|
* ```
|
|
108
108
|
* ["**\/*.{js,css,html}"]
|
|
@@ -113,7 +113,7 @@ export interface GlobPartial {
|
|
|
113
113
|
* If true, an error reading a directory when generating a precache manifest
|
|
114
114
|
* will cause the build to fail. If false, the problematic directory will be
|
|
115
115
|
* skipped. For more information, see the definition of `strict` in
|
|
116
|
-
* [`glob`'s documentation](https://github.com/isaacs/node-glob#options).
|
|
116
|
+
* [`node-glob`'s documentation](https://github.com/isaacs/node-glob#options).
|
|
117
117
|
* @default true
|
|
118
118
|
*/
|
|
119
119
|
globStrict?: boolean;
|
|
@@ -121,7 +121,7 @@ export interface GlobPartial {
|
|
|
121
121
|
* If a URL is rendered based on some server-side logic, its contents may
|
|
122
122
|
* depend on multiple files or on some other unique string value. The keys in
|
|
123
123
|
* this object are server-rendered URLs. If the values are an array of
|
|
124
|
-
* strings, they will be interpreted as
|
|
124
|
+
* strings, they will be interpreted as glob patterns, and the contents of
|
|
125
125
|
* any files matching the patterns will be used to uniquely version the URL.
|
|
126
126
|
* If used with a single string, it will be interpreted as unique versioning
|
|
127
127
|
* information that you've generated for a given URL.
|
|
@@ -174,13 +174,6 @@ export interface WebpackPartial {
|
|
|
174
174
|
* as `webpack`'s standard `include` option.
|
|
175
175
|
*/
|
|
176
176
|
include?: (string | RegExp | ((arg0: any) => boolean))[];
|
|
177
|
-
/**
|
|
178
|
-
* If set to 'production', then an optimized service worker bundle that
|
|
179
|
-
* excludes debugging info will be produced. If not explicitly configured
|
|
180
|
-
* here, the `mode` value configured in the current `webpack` compilation
|
|
181
|
-
* will be used.
|
|
182
|
-
*/
|
|
183
|
-
mode?: string | null;
|
|
184
177
|
}
|
|
185
178
|
export type WebpackResolved = Require<WebpackPartial, "exclude">;
|
|
186
179
|
export interface RequiredSwDestPartial {
|
|
@@ -218,7 +211,7 @@ export interface WebpackInjectManifestPartial {
|
|
|
218
211
|
export type WebpackInjectManifestResolved = Require<WebpackInjectManifestPartial, "compileSrc">;
|
|
219
212
|
export interface NextInjectManifestPartial {
|
|
220
213
|
/**
|
|
221
|
-
*
|
|
214
|
+
* Enables additional route caching when users navigate through pages with
|
|
222
215
|
* `next/link`. This improves the user experience in some cases but it
|
|
223
216
|
* also adds a bit of overhead due to additional network calls.
|
|
224
217
|
* @default false
|
|
@@ -296,7 +289,7 @@ export interface NextInjectManifestPartial {
|
|
|
296
289
|
/**
|
|
297
290
|
* Files in the public directory matching any of these patterns
|
|
298
291
|
* will be included in the precache manifest. For more information,
|
|
299
|
-
* see [`
|
|
292
|
+
* see [`node-glob`'s Glob Primer](https://github.com/isaacs/node-glob#glob-primer).
|
|
300
293
|
* @default
|
|
301
294
|
* ```
|
|
302
295
|
* ["**\/*"]
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAEhG,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,MAAM,WAAW,WAAW;IAC1B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description": "A module that integrates into your build process, helping you generate a manifest of local files that should be precached.",
|
|
6
6
|
"files": [
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
"source-map": "0.8.0-beta.0",
|
|
56
56
|
"upath": "2.0.1",
|
|
57
57
|
"zod": "3.22.4",
|
|
58
|
-
"@serwist/background-sync": "9.0.0-preview.
|
|
59
|
-
"@serwist/broadcast-update": "9.0.0-preview.
|
|
60
|
-
"@serwist/cacheable-response": "9.0.0-preview.
|
|
61
|
-
"@serwist/core": "9.0.0-preview.
|
|
62
|
-
"@serwist/expiration": "9.0.0-preview.
|
|
63
|
-
"@serwist/google-analytics": "9.0.0-preview.
|
|
64
|
-
"@serwist/precaching": "9.0.0-preview.
|
|
65
|
-
"@serwist/routing": "9.0.0-preview.
|
|
58
|
+
"@serwist/background-sync": "9.0.0-preview.11",
|
|
59
|
+
"@serwist/broadcast-update": "9.0.0-preview.11",
|
|
60
|
+
"@serwist/cacheable-response": "9.0.0-preview.11",
|
|
61
|
+
"@serwist/core": "9.0.0-preview.11",
|
|
62
|
+
"@serwist/expiration": "9.0.0-preview.11",
|
|
63
|
+
"@serwist/google-analytics": "9.0.0-preview.11",
|
|
64
|
+
"@serwist/precaching": "9.0.0-preview.11",
|
|
65
|
+
"@serwist/routing": "9.0.0-preview.11"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/common-tags": "1.8.4",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"@types/node": "20.11.16",
|
|
71
71
|
"@types/stringify-object": "4.0.5",
|
|
72
72
|
"type-fest": "4.10.2",
|
|
73
|
-
"typescript": "5.4.0-dev.
|
|
74
|
-
"@serwist/constants": "9.0.0-preview.
|
|
75
|
-
"@serwist/utils": "9.0.0-preview.
|
|
73
|
+
"typescript": "5.4.0-dev.20240206",
|
|
74
|
+
"@serwist/constants": "9.0.0-preview.11",
|
|
75
|
+
"@serwist/utils": "9.0.0-preview.11"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"typescript": ">=5.0.0"
|
package/src/lib/errors.ts
CHANGED
|
@@ -72,12 +72,6 @@ export const errors = {
|
|
|
72
72
|
Please remove or fix the following: `,
|
|
73
73
|
"bad-template-urls-asset": ol`There was an issue using one of the provided
|
|
74
74
|
'templatedURLs'.`,
|
|
75
|
-
"invalid-runtime-caching": ol`The 'runtimeCaching' parameter must an an
|
|
76
|
-
array of objects with at least a 'urlPattern' and 'handler'.`,
|
|
77
|
-
"urlPattern-is-required": ol`The 'urlPattern' option is required when using
|
|
78
|
-
'runtimeCaching'.`,
|
|
79
|
-
"handler-is-required": ol`The 'handler' option is required when using
|
|
80
|
-
runtimeCaching.`,
|
|
81
75
|
"invalid-generate-file-manifest-arg": ol`The input to generateFileManifest()
|
|
82
76
|
must be an Object.`,
|
|
83
77
|
"invalid-sw-src": `The 'swSrc' file can't be read.`,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { globSync } from "glob";
|
|
10
10
|
import upath from "upath";
|
|
11
11
|
|
|
12
12
|
import type { GlobPartial } from "../types.js";
|
|
@@ -20,7 +20,7 @@ interface FileDetails {
|
|
|
20
20
|
size: number;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export
|
|
23
|
+
export const getFileDetails = ({
|
|
24
24
|
globDirectory,
|
|
25
25
|
globFollow,
|
|
26
26
|
globIgnores,
|
|
@@ -32,12 +32,12 @@ export function getFileDetails({
|
|
|
32
32
|
}): {
|
|
33
33
|
globbedFileDetails: FileDetails[];
|
|
34
34
|
warning: string;
|
|
35
|
-
} {
|
|
35
|
+
} => {
|
|
36
36
|
let globbedFiles: string[];
|
|
37
37
|
let warning = "";
|
|
38
38
|
|
|
39
39
|
try {
|
|
40
|
-
globbedFiles =
|
|
40
|
+
globbedFiles = globSync(globPattern, {
|
|
41
41
|
cwd: globDirectory,
|
|
42
42
|
follow: globFollow,
|
|
43
43
|
ignore: globIgnores,
|
|
@@ -65,4 +65,4 @@ export function getFileDetails({
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
return { globbedFileDetails, warning };
|
|
68
|
-
}
|
|
68
|
+
};
|
|
@@ -94,14 +94,14 @@ export async function getFileManifestEntries({
|
|
|
94
94
|
const debugObj: { [key: string]: string[] } = {};
|
|
95
95
|
debugObj[url] = dependencies;
|
|
96
96
|
throw new Error(
|
|
97
|
-
`${errors["bad-template-urls-asset"]}
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
`${errors["bad-template-urls-asset"]} '${globPattern}' from '${JSON.stringify(debugObj)}':\n${
|
|
98
|
+
error instanceof Error ? error.toString() : ""
|
|
99
|
+
}`,
|
|
100
100
|
);
|
|
101
101
|
}
|
|
102
102
|
}, []);
|
|
103
103
|
if (details.length === 0) {
|
|
104
|
-
throw new Error(`${errors["bad-template-urls-asset"]} The glob
|
|
104
|
+
throw new Error(`${errors["bad-template-urls-asset"]} The glob pattern '${dependencies.toString()}' did not match anything.`);
|
|
105
105
|
}
|
|
106
106
|
allFileDetails.set(url, getCompositeDetails(url, details));
|
|
107
107
|
} else if (typeof dependencies === "string") {
|
package/src/schema/webpack.ts
CHANGED
|
@@ -20,7 +20,6 @@ export const webpackPartial = z
|
|
|
20
20
|
.default([/\.map$/, /^manifest.*\.js$/]),
|
|
21
21
|
excludeChunks: z.array(z.string()).optional(),
|
|
22
22
|
include: z.array(z.union([z.string(), z.instanceof(RegExp), z.function(z.tuple([z.any()]), z.boolean())])).optional(),
|
|
23
|
-
mode: z.string().nullable().optional(),
|
|
24
23
|
})
|
|
25
24
|
.strict("Do not pass invalid properties to WebpackPartial!");
|
|
26
25
|
|
|
@@ -39,7 +38,7 @@ export const webpackInjectManifestOptions = basePartial
|
|
|
39
38
|
.merge(webpackInjectManifestPartial)
|
|
40
39
|
.strict("Do not pass invalid properties to WebpackInjectManifestOptions!");
|
|
41
40
|
|
|
42
|
-
assertType<Equals<
|
|
41
|
+
assertType<Equals<z.input<typeof webpackPartial>, WebpackPartial>>();
|
|
43
42
|
assertType<Equals<WebpackResolved, z.output<typeof webpackPartial>>>();
|
|
44
43
|
assertType<Equals<WebpackInjectManifestPartial, z.input<typeof webpackInjectManifestPartial>>>();
|
|
45
44
|
assertType<Equals<WebpackInjectManifestResolved, z.output<typeof webpackInjectManifestPartial>>>();
|
package/src/types.ts
CHANGED
|
@@ -97,14 +97,14 @@ export interface GlobPartial {
|
|
|
97
97
|
/**
|
|
98
98
|
* Determines whether or not symlinks are followed when generating the
|
|
99
99
|
* precache manifest. For more information, see the definition of `follow` in
|
|
100
|
-
* [`glob`'s documentation](https://github.com/isaacs/node-glob#options).
|
|
100
|
+
* [`node-glob`'s documentation](https://github.com/isaacs/node-glob#options).
|
|
101
101
|
* @default true
|
|
102
102
|
*/
|
|
103
103
|
globFollow?: boolean;
|
|
104
104
|
/**
|
|
105
105
|
* A set of patterns matching files to always exclude when generating the
|
|
106
106
|
* precache manifest. For more information, see the definition of `ignore` in
|
|
107
|
-
* [`glob`'s documentation](https://github.com/isaacs/node-glob#options).
|
|
107
|
+
* [`node-glob`'s documentation](https://github.com/isaacs/node-glob#options).
|
|
108
108
|
* @default
|
|
109
109
|
* ```
|
|
110
110
|
* ["**\/node_modules\/**\/*"]
|
|
@@ -114,7 +114,7 @@ export interface GlobPartial {
|
|
|
114
114
|
/**
|
|
115
115
|
* Files matching any of these patterns will be included in the precache
|
|
116
116
|
* manifest. For more information, see
|
|
117
|
-
* [`glob`'s Glob Primer](https://github.com/isaacs/node-glob#glob-primer).
|
|
117
|
+
* [`node-glob`'s Glob Primer](https://github.com/isaacs/node-glob#glob-primer).
|
|
118
118
|
* @default
|
|
119
119
|
* ```
|
|
120
120
|
* ["**\/*.{js,css,html}"]
|
|
@@ -125,7 +125,7 @@ export interface GlobPartial {
|
|
|
125
125
|
* If true, an error reading a directory when generating a precache manifest
|
|
126
126
|
* will cause the build to fail. If false, the problematic directory will be
|
|
127
127
|
* skipped. For more information, see the definition of `strict` in
|
|
128
|
-
* [`glob`'s documentation](https://github.com/isaacs/node-glob#options).
|
|
128
|
+
* [`node-glob`'s documentation](https://github.com/isaacs/node-glob#options).
|
|
129
129
|
* @default true
|
|
130
130
|
*/
|
|
131
131
|
globStrict?: boolean;
|
|
@@ -133,7 +133,7 @@ export interface GlobPartial {
|
|
|
133
133
|
* If a URL is rendered based on some server-side logic, its contents may
|
|
134
134
|
* depend on multiple files or on some other unique string value. The keys in
|
|
135
135
|
* this object are server-rendered URLs. If the values are an array of
|
|
136
|
-
* strings, they will be interpreted as
|
|
136
|
+
* strings, they will be interpreted as glob patterns, and the contents of
|
|
137
137
|
* any files matching the patterns will be used to uniquely version the URL.
|
|
138
138
|
* If used with a single string, it will be interpreted as unique versioning
|
|
139
139
|
* information that you've generated for a given URL.
|
|
@@ -194,13 +194,6 @@ export interface WebpackPartial {
|
|
|
194
194
|
* as `webpack`'s standard `include` option.
|
|
195
195
|
*/
|
|
196
196
|
include?: (string | RegExp | ((arg0: any) => boolean))[];
|
|
197
|
-
/**
|
|
198
|
-
* If set to 'production', then an optimized service worker bundle that
|
|
199
|
-
* excludes debugging info will be produced. If not explicitly configured
|
|
200
|
-
* here, the `mode` value configured in the current `webpack` compilation
|
|
201
|
-
* will be used.
|
|
202
|
-
*/
|
|
203
|
-
mode?: string | null;
|
|
204
197
|
}
|
|
205
198
|
|
|
206
199
|
export type WebpackResolved = Require<WebpackPartial, "exclude">;
|
|
@@ -249,7 +242,7 @@ export type WebpackInjectManifestResolved = Require<WebpackInjectManifestPartial
|
|
|
249
242
|
|
|
250
243
|
export interface NextInjectManifestPartial {
|
|
251
244
|
/**
|
|
252
|
-
*
|
|
245
|
+
* Enables additional route caching when users navigate through pages with
|
|
253
246
|
* `next/link`. This improves the user experience in some cases but it
|
|
254
247
|
* also adds a bit of overhead due to additional network calls.
|
|
255
248
|
* @default false
|
|
@@ -327,7 +320,7 @@ export interface NextInjectManifestPartial {
|
|
|
327
320
|
/**
|
|
328
321
|
* Files in the public directory matching any of these patterns
|
|
329
322
|
* will be included in the precache manifest. For more information,
|
|
330
|
-
* see [`
|
|
323
|
+
* see [`node-glob`'s Glob Primer](https://github.com/isaacs/node-glob#glob-primer).
|
|
331
324
|
* @default
|
|
332
325
|
* ```
|
|
333
326
|
* ["**\/*"]
|
package/src/_types.js
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2018 Google LLC
|
|
3
|
-
|
|
4
|
-
Use of this source code is governed by an MIT-style
|
|
5
|
-
license that can be found in the LICENSE file or at
|
|
6
|
-
https://opensource.org/licenses/MIT.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @typedef {Object} ManifestEntry
|
|
11
|
-
* @property {string} url The URL to the asset in the manifest.
|
|
12
|
-
* @property {string} revision The revision details for the file. This should be
|
|
13
|
-
* either a hash generated based on the file contents, or `null` if there is
|
|
14
|
-
* versioning already included in the URL.
|
|
15
|
-
* @property {string} [integrity] Integrity metadata that will be used when
|
|
16
|
-
* making the network request for the URL.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @typedef {Object} ManifestTransformResult
|
|
21
|
-
* @property {Array<module:workbox-build.ManifestEntry>} manifest
|
|
22
|
-
* @property {Array<string>|undefined} warnings
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* @typedef {Object} RuntimeCachingEntry
|
|
27
|
-
*
|
|
28
|
-
* @property {string|module:workbox-routing~handlerCallback} handler
|
|
29
|
-
* Either the name of one of the [built-in strategy classes]{@link module:workbox-strategies},
|
|
30
|
-
* or custom handler callback to use when the generated route matches.
|
|
31
|
-
*
|
|
32
|
-
* @property {string|RegExp|module:workbox-routing~matchCallback} urlPattern
|
|
33
|
-
* The value that will be passed to [`registerRoute()`]{@link module:workbox-routing.registerRoute},
|
|
34
|
-
* used to determine whether the generated route will match a given request.
|
|
35
|
-
*
|
|
36
|
-
* @property {string} [method='GET'] The
|
|
37
|
-
* [HTTP method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) that
|
|
38
|
-
* will match the generated route.
|
|
39
|
-
*
|
|
40
|
-
* @property {Object} [options]
|
|
41
|
-
*
|
|
42
|
-
* @property {Object} [options.backgroundSync]
|
|
43
|
-
*
|
|
44
|
-
* @property {string} [options.backgroundSync.name] The `name` property to use
|
|
45
|
-
* when creating the
|
|
46
|
-
* [`BackgroundSyncPlugin`]{@link module:workbox-background-sync.BackgroundSyncPlugin}.
|
|
47
|
-
*
|
|
48
|
-
* @property {Object} [options.backgroundSync.options] The `options` property
|
|
49
|
-
* to use when creating the
|
|
50
|
-
* [`BackgroundSyncPlugin`]{@link module:workbox-background-sync.BackgroundSyncPlugin}.
|
|
51
|
-
*
|
|
52
|
-
* @property {Object} [options.broadcastUpdate]
|
|
53
|
-
*
|
|
54
|
-
* @property {string} [options.broadcastUpdate.channelName] The `channelName`
|
|
55
|
-
* property to use when creating the
|
|
56
|
-
* [`BroadcastCacheUpdatePlugin`]{@link module:workbox-broadcast-update.BroadcastUpdatePlugin}.
|
|
57
|
-
*
|
|
58
|
-
* @property {Object} [options.broadcastUpdate.options] The `options` property
|
|
59
|
-
* to use when creating the
|
|
60
|
-
* [`BroadcastCacheUpdatePlugin`]{@link module:workbox-broadcast-update.BroadcastUpdatePlugin}.
|
|
61
|
-
*
|
|
62
|
-
* @property {Object} [options.cacheableResponse]
|
|
63
|
-
*
|
|
64
|
-
* @property {Object} [options.cacheableResponse.headers] The `headers` property
|
|
65
|
-
* to use when creating the
|
|
66
|
-
* [`CacheableResponsePlugin`]{@link module:workbox-cacheable-response.CacheableResponsePlugin}.
|
|
67
|
-
*
|
|
68
|
-
* @property {Array<number>} [options.cacheableResponse.statuses] `statuses`
|
|
69
|
-
* property to use when creating the
|
|
70
|
-
* [`CacheableResponsePlugin`]{@link module:workbox-cacheable-response.CacheableResponsePlugin}.
|
|
71
|
-
*
|
|
72
|
-
* @property {string} [options.cacheName] The `cacheName` to use when
|
|
73
|
-
* constructing one of the
|
|
74
|
-
* [Workbox strategy classes]{@link module:workbox-strategies}.
|
|
75
|
-
*
|
|
76
|
-
* @property {Object} [options.fetchOptions] The `fetchOptions` property value
|
|
77
|
-
* to use when constructing one of the
|
|
78
|
-
* [Workbox strategy classes]{@link module:workbox-strategies}.
|
|
79
|
-
*
|
|
80
|
-
* @property {Object} [options.expiration]
|
|
81
|
-
*
|
|
82
|
-
* @property {number} [options.expiration.maxAgeSeconds] The `maxAgeSeconds`
|
|
83
|
-
* property to use when creating the
|
|
84
|
-
* [`ExpirationPlugin`]{@link module:workbox-expiration.ExpirationPlugin}.
|
|
85
|
-
*
|
|
86
|
-
* @property {number} [options.expiration.maxEntries] The `maxEntries`
|
|
87
|
-
* property to use when creating the
|
|
88
|
-
* [`ExpirationPlugin`]{@link module:workbox-expiration.ExpirationPlugin}.
|
|
89
|
-
*
|
|
90
|
-
* @property {Object} [options.precacheFallback]
|
|
91
|
-
*
|
|
92
|
-
* @property {string} [options.precacheFallback.fallbackURL] The `fallbackURL`
|
|
93
|
-
* property to use when creating the
|
|
94
|
-
* [`PrecacheFallbackPlugin`]{@link module:workbox-precaching.PrecacheFallbackPlugin}.
|
|
95
|
-
*
|
|
96
|
-
* @property {boolean} [options.rangeRequests] Set to `true` to add the
|
|
97
|
-
* [`RangeRequestsPlugin`]{@link module:workbox-range-requests.RangeRequestsPlugin}
|
|
98
|
-
* for the strategy being configured.
|
|
99
|
-
*
|
|
100
|
-
* @property {Object} [options.matchOptions] The `matchOptions` property value
|
|
101
|
-
* to use when constructing one of the
|
|
102
|
-
* [Workbox strategy classes]{@link module:workbox-strategies}.
|
|
103
|
-
*
|
|
104
|
-
* @property {number} [options.networkTimeoutSeconds] The
|
|
105
|
-
* `networkTimeoutSeconds` property value to use when creating a
|
|
106
|
-
* [`NetworkFirst`]{@link module:workbox-strategies.NetworkFirst} strategy.
|
|
107
|
-
*
|
|
108
|
-
* @property {Array<Object>} [options.plugins]
|
|
109
|
-
* One or more [additional plugins](https://developers.google.com/web/tools/workbox/guides/using-plugins#custom_plugins)
|
|
110
|
-
* to apply to the handler. Useful when you want a plugin that doesn't have a
|
|
111
|
-
* "shortcut" configuration.
|
|
112
|
-
*/
|