@serwist/build 9.1.0-preview.0 → 10.0.0-preview.2
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/get-manifest.d.ts.map +1 -1
- package/dist/index.js +1 -4
- package/dist/inject-manifest.d.ts.map +1 -1
- package/dist/lib/additional-precache-entries-transform.d.ts.map +1 -1
- package/dist/lib/escape-regexp.d.ts.map +1 -1
- package/dist/lib/get-composite-details.d.ts.map +1 -1
- package/dist/lib/get-file-details.d.ts.map +1 -1
- package/dist/lib/get-file-hash.d.ts.map +1 -1
- package/dist/lib/get-file-manifest-entries.d.ts.map +1 -1
- package/dist/lib/get-file-size.d.ts.map +1 -1
- package/dist/lib/get-string-details.d.ts.map +1 -1
- package/dist/lib/validate-options.d.ts.map +1 -1
- package/dist/schema/base.d.ts +9 -9
- package/dist/schema/getManifest.d.ts +13 -13
- package/dist/schema/injectManifest.d.ts +15 -15
- package/dist/schema/manifestTransform.d.ts +12 -12
- package/dist/types.d.ts +13 -13
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -10
- package/src/lib/rebase-path.ts +1 -1
- package/src/types.ts +15 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-manifest.d.ts","sourceRoot":"","sources":["../src/get-manifest.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAExE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"get-manifest.d.ts","sourceRoot":"","sources":["../src/get-manifest.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAExE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW,GAAU,QAAQ,kBAAkB,KAAG,OAAO,CAAC,iBAAiB,CAIvF,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import fs, { readFileSync } from 'node:fs';
|
|
|
7
7
|
import prettyBytes from 'pretty-bytes';
|
|
8
8
|
import { v as validationErrorMap, S as SerwistConfigError } from './chunks/validationErrorMap.js';
|
|
9
9
|
import fsp from 'node:fs/promises';
|
|
10
|
+
import { toUnix } from '@serwist/utils';
|
|
10
11
|
import { SourceMapGenerator, SourceMapConsumer } from 'source-map';
|
|
11
12
|
import 'zod';
|
|
12
13
|
|
|
@@ -457,10 +458,6 @@ const getManifest = async (config)=>{
|
|
|
457
458
|
return await getFileManifestEntries(options);
|
|
458
459
|
};
|
|
459
460
|
|
|
460
|
-
const toUnix = (p)=>{
|
|
461
|
-
return p.replace(/\\/g, "/").replace(/(?<!^)\/+/g, "/");
|
|
462
|
-
};
|
|
463
|
-
|
|
464
461
|
const innerRegex = /[#@] sourceMappingURL=([^\s'"]*)/;
|
|
465
462
|
const regex = RegExp(`(?:/\\*(?:\\s*\r?\n(?://)?)?(?:${innerRegex.source})\\s*\\*/|//(?:${innerRegex.source}))\\s*`);
|
|
466
463
|
function getSourceMapURL(srcContents) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inject-manifest.d.ts","sourceRoot":"","sources":["../src/inject-manifest.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"inject-manifest.d.ts","sourceRoot":"","sources":["../src/inject-manifest.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,cAAc,GAAU,QAAQ,qBAAqB,KAAG,OAAO,CAAC,WAAW,CAwFvF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"additional-precache-entries-transform.d.ts","sourceRoot":"","sources":["../../src/lib/additional-precache-entries-transform.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,KAAK,kCAAkC,GAAG,CAAC,QAAQ,EAAE,CAAC,aAAa,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,KAAK;IAC5F,QAAQ,EAAE,CAAC,aAAa,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IAC/C,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,kCAAkC,
|
|
1
|
+
{"version":3,"file":"additional-precache-entries-transform.d.ts","sourceRoot":"","sources":["../../src/lib/additional-precache-entries-transform.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,KAAK,kCAAkC,GAAG,CAAC,QAAQ,EAAE,CAAC,aAAa,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,KAAK;IAC5F,QAAQ,EAAE,CAAC,aAAa,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IAC/C,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,kCAAkC,GAAI,2BAA2B,CAAC,aAAa,GAAG,MAAM,CAAC,EAAE,KAAG,kCAqC1G,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escape-regexp.d.ts","sourceRoot":"","sources":["../../src/lib/escape-regexp.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"escape-regexp.d.ts","sourceRoot":"","sources":["../../src/lib/escape-regexp.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,MAE1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-composite-details.d.ts","sourceRoot":"","sources":["../../src/lib/get-composite-details.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"get-composite-details.d.ts","sourceRoot":"","sources":["../../src/lib/get-composite-details.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,eAAO,MAAM,mBAAmB,GAAI,cAAc,MAAM,EAAE,mBAAmB,WAAW,EAAE,KAAG,WAkB5F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-file-details.d.ts","sourceRoot":"","sources":["../../src/lib/get-file-details.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK5D,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"get-file-details.d.ts","sourceRoot":"","sources":["../../src/lib/get-file-details.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK5D,eAAO,MAAM,cAAc,GAAI,0DAK5B,IAAI,CAAC,WAAW,EAAE,eAAe,GAAG,cAAc,GAAG,eAAe,CAAC,GAAG;IAEzE,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,KAAG;IACF,kBAAkB,EAAE,WAAW,EAAE,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;CAkCjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-file-hash.d.ts","sourceRoot":"","sources":["../../src/lib/get-file-hash.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"get-file-hash.d.ts","sourceRoot":"","sources":["../../src/lib/get-file-hash.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG,MAO1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-file-manifest-entries.d.ts","sourceRoot":"","sources":["../../src/lib/get-file-manifest-entries.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAe,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAO9F,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"get-file-manifest-entries.d.ts","sourceRoot":"","sources":["../../src/lib/get-file-manifest-entries.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAe,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAO9F,eAAO,MAAM,sBAAsB,GAAU,yOAa1C,0BAA0B,KAAG,OAAO,CAAC,iBAAiB,CA+FxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-file-size.d.ts","sourceRoot":"","sources":["../../src/lib/get-file-size.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"get-file-size.d.ts","sourceRoot":"","sources":["../../src/lib/get-file-size.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG,MAAM,GAAG,IAUnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-string-details.d.ts","sourceRoot":"","sources":["../../src/lib/get-string-details.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"get-string-details.d.ts","sourceRoot":"","sources":["../../src/lib/get-string-details.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,WAI1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-options.d.ts","sourceRoot":"","sources":["../../src/lib/validate-options.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAE7F,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"validate-options.d.ts","sourceRoot":"","sources":["../../src/lib/validate-options.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAE7F,eAAO,MAAM,0BAA0B,GAAU,OAAO,OAAO,KAAG,OAAO,CAAC,0BAA0B,CAMnG,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAU,OAAO,OAAO,KAAG,OAAO,CAAC,6BAA6B,CAMzG,CAAC"}
|
package/dist/schema/base.d.ts
CHANGED
|
@@ -15,13 +15,13 @@ export declare const basePartial: z.ZodObject<{
|
|
|
15
15
|
}>]>, "many">>;
|
|
16
16
|
disablePrecacheManifest: z.ZodDefault<z.ZodBoolean>;
|
|
17
17
|
dontCacheBustURLsMatching: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
18
|
-
manifestTransforms: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodObject<
|
|
18
|
+
manifestTransforms: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodObject<{
|
|
19
19
|
integrity: z.ZodOptional<z.ZodString>;
|
|
20
20
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
21
|
url: z.ZodString;
|
|
22
|
-
}
|
|
22
|
+
} & {
|
|
23
23
|
size: z.ZodNumber;
|
|
24
|
-
}
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
25
|
url: string;
|
|
26
26
|
size: number;
|
|
27
27
|
integrity?: string | undefined;
|
|
@@ -32,13 +32,13 @@ export declare const basePartial: z.ZodObject<{
|
|
|
32
32
|
integrity?: string | undefined;
|
|
33
33
|
revision?: string | null | undefined;
|
|
34
34
|
}>, "many">, z.ZodOptional<z.ZodUnknown>], null>, z.ZodUnion<[z.ZodPromise<z.ZodObject<{
|
|
35
|
-
manifest: z.ZodArray<z.ZodObject<
|
|
35
|
+
manifest: z.ZodArray<z.ZodObject<{
|
|
36
36
|
integrity: z.ZodOptional<z.ZodString>;
|
|
37
37
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
38
38
|
url: z.ZodString;
|
|
39
|
-
}
|
|
39
|
+
} & {
|
|
40
40
|
size: z.ZodNumber;
|
|
41
|
-
}
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
42
|
url: string;
|
|
43
43
|
size: number;
|
|
44
44
|
integrity?: string | undefined;
|
|
@@ -67,13 +67,13 @@ export declare const basePartial: z.ZodObject<{
|
|
|
67
67
|
}[];
|
|
68
68
|
warnings?: string[] | undefined;
|
|
69
69
|
}>>, z.ZodObject<{
|
|
70
|
-
manifest: z.ZodArray<z.ZodObject<
|
|
70
|
+
manifest: z.ZodArray<z.ZodObject<{
|
|
71
71
|
integrity: z.ZodOptional<z.ZodString>;
|
|
72
72
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
73
|
url: z.ZodString;
|
|
74
|
-
}
|
|
74
|
+
} & {
|
|
75
75
|
size: z.ZodNumber;
|
|
76
|
-
}
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
77
|
url: string;
|
|
78
78
|
size: number;
|
|
79
79
|
integrity?: string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { z } from "zod";
|
|
2
|
-
export declare const getManifestOptions: z.ZodObject<
|
|
2
|
+
export declare const getManifestOptions: z.ZodObject<{
|
|
3
3
|
additionalPrecacheEntries: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
4
4
|
integrity: z.ZodOptional<z.ZodString>;
|
|
5
5
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -15,13 +15,13 @@ export declare const getManifestOptions: z.ZodObject<z.objectUtil.extendShape<z.
|
|
|
15
15
|
}>]>, "many">>;
|
|
16
16
|
disablePrecacheManifest: z.ZodDefault<z.ZodBoolean>;
|
|
17
17
|
dontCacheBustURLsMatching: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
18
|
-
manifestTransforms: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodObject<
|
|
18
|
+
manifestTransforms: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodObject<{
|
|
19
19
|
integrity: z.ZodOptional<z.ZodString>;
|
|
20
20
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
21
|
url: z.ZodString;
|
|
22
|
-
}
|
|
22
|
+
} & {
|
|
23
23
|
size: z.ZodNumber;
|
|
24
|
-
}
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
25
|
url: string;
|
|
26
26
|
size: number;
|
|
27
27
|
integrity?: string | undefined;
|
|
@@ -32,13 +32,13 @@ export declare const getManifestOptions: z.ZodObject<z.objectUtil.extendShape<z.
|
|
|
32
32
|
integrity?: string | undefined;
|
|
33
33
|
revision?: string | null | undefined;
|
|
34
34
|
}>, "many">, z.ZodOptional<z.ZodUnknown>], null>, z.ZodUnion<[z.ZodPromise<z.ZodObject<{
|
|
35
|
-
manifest: z.ZodArray<z.ZodObject<
|
|
35
|
+
manifest: z.ZodArray<z.ZodObject<{
|
|
36
36
|
integrity: z.ZodOptional<z.ZodString>;
|
|
37
37
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
38
38
|
url: z.ZodString;
|
|
39
|
-
}
|
|
39
|
+
} & {
|
|
40
40
|
size: z.ZodNumber;
|
|
41
|
-
}
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
42
|
url: string;
|
|
43
43
|
size: number;
|
|
44
44
|
integrity?: string | undefined;
|
|
@@ -67,13 +67,13 @@ export declare const getManifestOptions: z.ZodObject<z.objectUtil.extendShape<z.
|
|
|
67
67
|
}[];
|
|
68
68
|
warnings?: string[] | undefined;
|
|
69
69
|
}>>, z.ZodObject<{
|
|
70
|
-
manifest: z.ZodArray<z.ZodObject<
|
|
70
|
+
manifest: z.ZodArray<z.ZodObject<{
|
|
71
71
|
integrity: z.ZodOptional<z.ZodString>;
|
|
72
72
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
73
|
url: z.ZodString;
|
|
74
|
-
}
|
|
74
|
+
} & {
|
|
75
75
|
size: z.ZodNumber;
|
|
76
|
-
}
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
77
|
url: string;
|
|
78
78
|
size: number;
|
|
79
79
|
integrity?: string | undefined;
|
|
@@ -104,15 +104,15 @@ export declare const getManifestOptions: z.ZodObject<z.objectUtil.extendShape<z.
|
|
|
104
104
|
}>]>>, "many">>;
|
|
105
105
|
maximumFileSizeToCacheInBytes: z.ZodDefault<z.ZodNumber>;
|
|
106
106
|
modifyURLPrefix: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
107
|
-
}
|
|
107
|
+
} & {
|
|
108
108
|
globFollow: z.ZodDefault<z.ZodBoolean>;
|
|
109
109
|
globIgnores: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
110
110
|
globPatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
111
111
|
globStrict: z.ZodDefault<z.ZodBoolean>;
|
|
112
112
|
templatedURLs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
|
|
113
|
-
}
|
|
113
|
+
} & {
|
|
114
114
|
globDirectory: z.ZodString;
|
|
115
|
-
}
|
|
115
|
+
}, "strict", z.ZodTypeAny, {
|
|
116
116
|
disablePrecacheManifest: boolean;
|
|
117
117
|
maximumFileSizeToCacheInBytes: number;
|
|
118
118
|
globFollow: boolean;
|
|
@@ -9,7 +9,7 @@ export declare const baseInjectPartial: z.ZodObject<{
|
|
|
9
9
|
swSrc: string;
|
|
10
10
|
injectionPoint?: string | undefined;
|
|
11
11
|
}>;
|
|
12
|
-
export declare const injectManifestOptions: z.ZodObject<
|
|
12
|
+
export declare const injectManifestOptions: z.ZodObject<{
|
|
13
13
|
additionalPrecacheEntries: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
14
14
|
integrity: z.ZodOptional<z.ZodString>;
|
|
15
15
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -25,13 +25,13 @@ export declare const injectManifestOptions: z.ZodObject<z.objectUtil.extendShape
|
|
|
25
25
|
}>]>, "many">>;
|
|
26
26
|
disablePrecacheManifest: z.ZodDefault<z.ZodBoolean>;
|
|
27
27
|
dontCacheBustURLsMatching: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
28
|
-
manifestTransforms: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodObject<
|
|
28
|
+
manifestTransforms: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodObject<{
|
|
29
29
|
integrity: z.ZodOptional<z.ZodString>;
|
|
30
30
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
31
|
url: z.ZodString;
|
|
32
|
-
}
|
|
32
|
+
} & {
|
|
33
33
|
size: z.ZodNumber;
|
|
34
|
-
}
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
35
|
url: string;
|
|
36
36
|
size: number;
|
|
37
37
|
integrity?: string | undefined;
|
|
@@ -42,13 +42,13 @@ export declare const injectManifestOptions: z.ZodObject<z.objectUtil.extendShape
|
|
|
42
42
|
integrity?: string | undefined;
|
|
43
43
|
revision?: string | null | undefined;
|
|
44
44
|
}>, "many">, z.ZodOptional<z.ZodUnknown>], null>, z.ZodUnion<[z.ZodPromise<z.ZodObject<{
|
|
45
|
-
manifest: z.ZodArray<z.ZodObject<
|
|
45
|
+
manifest: z.ZodArray<z.ZodObject<{
|
|
46
46
|
integrity: z.ZodOptional<z.ZodString>;
|
|
47
47
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
48
48
|
url: z.ZodString;
|
|
49
|
-
}
|
|
49
|
+
} & {
|
|
50
50
|
size: z.ZodNumber;
|
|
51
|
-
}
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
52
|
url: string;
|
|
53
53
|
size: number;
|
|
54
54
|
integrity?: string | undefined;
|
|
@@ -77,13 +77,13 @@ export declare const injectManifestOptions: z.ZodObject<z.objectUtil.extendShape
|
|
|
77
77
|
}[];
|
|
78
78
|
warnings?: string[] | undefined;
|
|
79
79
|
}>>, z.ZodObject<{
|
|
80
|
-
manifest: z.ZodArray<z.ZodObject<
|
|
80
|
+
manifest: z.ZodArray<z.ZodObject<{
|
|
81
81
|
integrity: z.ZodOptional<z.ZodString>;
|
|
82
82
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
83
83
|
url: z.ZodString;
|
|
84
|
-
}
|
|
84
|
+
} & {
|
|
85
85
|
size: z.ZodNumber;
|
|
86
|
-
}
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
87
|
url: string;
|
|
88
88
|
size: number;
|
|
89
89
|
integrity?: string | undefined;
|
|
@@ -114,20 +114,20 @@ export declare const injectManifestOptions: z.ZodObject<z.objectUtil.extendShape
|
|
|
114
114
|
}>]>>, "many">>;
|
|
115
115
|
maximumFileSizeToCacheInBytes: z.ZodDefault<z.ZodNumber>;
|
|
116
116
|
modifyURLPrefix: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
117
|
-
}
|
|
117
|
+
} & {
|
|
118
118
|
globFollow: z.ZodDefault<z.ZodBoolean>;
|
|
119
119
|
globIgnores: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
120
120
|
globPatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
121
121
|
globStrict: z.ZodDefault<z.ZodBoolean>;
|
|
122
122
|
templatedURLs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
|
|
123
|
-
}
|
|
123
|
+
} & {
|
|
124
124
|
injectionPoint: z.ZodDefault<z.ZodString>;
|
|
125
125
|
swSrc: z.ZodString;
|
|
126
|
-
}
|
|
126
|
+
} & {
|
|
127
127
|
swDest: z.ZodString;
|
|
128
|
-
}
|
|
128
|
+
} & {
|
|
129
129
|
globDirectory: z.ZodString;
|
|
130
|
-
}
|
|
130
|
+
}, "strict", z.ZodTypeAny, {
|
|
131
131
|
disablePrecacheManifest: boolean;
|
|
132
132
|
maximumFileSizeToCacheInBytes: number;
|
|
133
133
|
globFollow: boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const manifestTransformResult: z.ZodObject<{
|
|
3
|
-
manifest: z.ZodArray<z.ZodObject<
|
|
3
|
+
manifest: z.ZodArray<z.ZodObject<{
|
|
4
4
|
integrity: z.ZodOptional<z.ZodString>;
|
|
5
5
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6
6
|
url: z.ZodString;
|
|
7
|
-
}
|
|
7
|
+
} & {
|
|
8
8
|
size: z.ZodNumber;
|
|
9
|
-
}
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
10
|
url: string;
|
|
11
11
|
size: number;
|
|
12
12
|
integrity?: string | undefined;
|
|
@@ -35,13 +35,13 @@ export declare const manifestTransformResult: z.ZodObject<{
|
|
|
35
35
|
}[];
|
|
36
36
|
warnings?: string[] | undefined;
|
|
37
37
|
}>;
|
|
38
|
-
export declare const manifestTransform: z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodObject<
|
|
38
|
+
export declare const manifestTransform: z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodObject<{
|
|
39
39
|
integrity: z.ZodOptional<z.ZodString>;
|
|
40
40
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
41
41
|
url: z.ZodString;
|
|
42
|
-
}
|
|
42
|
+
} & {
|
|
43
43
|
size: z.ZodNumber;
|
|
44
|
-
}
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
45
|
url: string;
|
|
46
46
|
size: number;
|
|
47
47
|
integrity?: string | undefined;
|
|
@@ -52,13 +52,13 @@ export declare const manifestTransform: z.ZodFunction<z.ZodTuple<[z.ZodArray<z.Z
|
|
|
52
52
|
integrity?: string | undefined;
|
|
53
53
|
revision?: string | null | undefined;
|
|
54
54
|
}>, "many">, z.ZodOptional<z.ZodUnknown>], null>, z.ZodUnion<[z.ZodPromise<z.ZodObject<{
|
|
55
|
-
manifest: z.ZodArray<z.ZodObject<
|
|
55
|
+
manifest: z.ZodArray<z.ZodObject<{
|
|
56
56
|
integrity: z.ZodOptional<z.ZodString>;
|
|
57
57
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
58
58
|
url: z.ZodString;
|
|
59
|
-
}
|
|
59
|
+
} & {
|
|
60
60
|
size: z.ZodNumber;
|
|
61
|
-
}
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
62
|
url: string;
|
|
63
63
|
size: number;
|
|
64
64
|
integrity?: string | undefined;
|
|
@@ -87,13 +87,13 @@ export declare const manifestTransform: z.ZodFunction<z.ZodTuple<[z.ZodArray<z.Z
|
|
|
87
87
|
}[];
|
|
88
88
|
warnings?: string[] | undefined;
|
|
89
89
|
}>>, z.ZodObject<{
|
|
90
|
-
manifest: z.ZodArray<z.ZodObject<
|
|
90
|
+
manifest: z.ZodArray<z.ZodObject<{
|
|
91
91
|
integrity: z.ZodOptional<z.ZodString>;
|
|
92
92
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
93
93
|
url: z.ZodString;
|
|
94
|
-
}
|
|
94
|
+
} & {
|
|
95
95
|
size: z.ZodNumber;
|
|
96
|
-
}
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
97
|
url: string;
|
|
98
98
|
size: number;
|
|
99
99
|
integrity?: string | undefined;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Require } from "@serwist/utils";
|
|
1
|
+
import type { Prettify, Require } from "@serwist/utils";
|
|
2
2
|
import type { PackageJson } from "type-fest";
|
|
3
3
|
import type { z } from "zod";
|
|
4
4
|
import type { manifestEntry } from "./schema/manifestEntry.js";
|
|
@@ -63,7 +63,7 @@ export interface BasePartial {
|
|
|
63
63
|
[key: string]: string;
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
export type BaseResolved = Require<BasePartial, "disablePrecacheManifest" | "maximumFileSizeToCacheInBytes"
|
|
66
|
+
export type BaseResolved = Prettify<Require<BasePartial, "disablePrecacheManifest" | "maximumFileSizeToCacheInBytes">>;
|
|
67
67
|
export interface RequiredGlobDirectoryPartial {
|
|
68
68
|
/**
|
|
69
69
|
* The local directory you wish to match `globPatterns` against. The path is
|
|
@@ -71,7 +71,7 @@ export interface RequiredGlobDirectoryPartial {
|
|
|
71
71
|
*/
|
|
72
72
|
globDirectory: string;
|
|
73
73
|
}
|
|
74
|
-
export type RequiredGlobDirectoryResolved = RequiredGlobDirectoryPartial
|
|
74
|
+
export type RequiredGlobDirectoryResolved = Prettify<RequiredGlobDirectoryPartial>;
|
|
75
75
|
export interface OptionalGlobDirectoryPartial {
|
|
76
76
|
/**
|
|
77
77
|
* The local directory you wish to match `globPatterns` against. The path is
|
|
@@ -79,7 +79,7 @@ export interface OptionalGlobDirectoryPartial {
|
|
|
79
79
|
*/
|
|
80
80
|
globDirectory?: string;
|
|
81
81
|
}
|
|
82
|
-
export type OptionalGlobDirectoryResolved = OptionalGlobDirectoryPartial
|
|
82
|
+
export type OptionalGlobDirectoryResolved = Prettify<OptionalGlobDirectoryPartial>;
|
|
83
83
|
export interface GlobPartial {
|
|
84
84
|
/**
|
|
85
85
|
* Determines whether or not symlinks are followed when generating the
|
|
@@ -129,7 +129,7 @@ export interface GlobPartial {
|
|
|
129
129
|
[key: string]: string | string[];
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
|
-
export type GlobResolved = Require<GlobPartial, "globFollow" | "globIgnores" | "globPatterns" | "globStrict"
|
|
132
|
+
export type GlobResolved = Prettify<Require<GlobPartial, "globFollow" | "globIgnores" | "globPatterns" | "globStrict">>;
|
|
133
133
|
export interface InjectPartial {
|
|
134
134
|
/**
|
|
135
135
|
* The string to find inside of the `swSrc` file. Once found, it will be
|
|
@@ -143,7 +143,7 @@ export interface InjectPartial {
|
|
|
143
143
|
*/
|
|
144
144
|
swSrc: string;
|
|
145
145
|
}
|
|
146
|
-
export type InjectResolved = Require<InjectPartial, "injectionPoint"
|
|
146
|
+
export type InjectResolved = Prettify<Require<InjectPartial, "injectionPoint">>;
|
|
147
147
|
export interface RequiredSwDestPartial {
|
|
148
148
|
/**
|
|
149
149
|
* The path and filename of the service worker file that will be created by
|
|
@@ -151,7 +151,7 @@ export interface RequiredSwDestPartial {
|
|
|
151
151
|
*/
|
|
152
152
|
swDest: string;
|
|
153
153
|
}
|
|
154
|
-
export type RequiredSwDestResolved = RequiredSwDestPartial
|
|
154
|
+
export type RequiredSwDestResolved = Prettify<RequiredSwDestPartial>;
|
|
155
155
|
export interface OptionalSwDestPartial {
|
|
156
156
|
/**
|
|
157
157
|
* The path and filename of the service worker file that will be created by
|
|
@@ -160,11 +160,11 @@ export interface OptionalSwDestPartial {
|
|
|
160
160
|
*/
|
|
161
161
|
swDest?: string;
|
|
162
162
|
}
|
|
163
|
-
export type OptionalSwDestResolved = OptionalSwDestPartial
|
|
164
|
-
export type GetManifestOptions = BasePartial & GlobPartial & RequiredGlobDirectoryPartial
|
|
165
|
-
export type GetManifestOptionsComplete = BaseResolved & GlobResolved & RequiredGlobDirectoryResolved
|
|
166
|
-
export type InjectManifestOptions = BasePartial & GlobPartial & InjectPartial & RequiredSwDestPartial & RequiredGlobDirectoryPartial
|
|
167
|
-
export type InjectManifestOptionsComplete = BaseResolved & GlobResolved & InjectResolved & RequiredSwDestResolved & RequiredGlobDirectoryResolved
|
|
163
|
+
export type OptionalSwDestResolved = Prettify<OptionalSwDestPartial>;
|
|
164
|
+
export type GetManifestOptions = Prettify<BasePartial & GlobPartial & RequiredGlobDirectoryPartial>;
|
|
165
|
+
export type GetManifestOptionsComplete = Prettify<BaseResolved & GlobResolved & RequiredGlobDirectoryResolved>;
|
|
166
|
+
export type InjectManifestOptions = Prettify<BasePartial & GlobPartial & InjectPartial & RequiredSwDestPartial & RequiredGlobDirectoryPartial>;
|
|
167
|
+
export type InjectManifestOptionsComplete = Prettify<BaseResolved & GlobResolved & InjectResolved & RequiredSwDestResolved & RequiredGlobDirectoryResolved>;
|
|
168
168
|
export interface GetManifestResult {
|
|
169
169
|
count: number;
|
|
170
170
|
manifestEntries: ManifestEntry[] | undefined;
|
|
@@ -189,7 +189,7 @@ export type BuildType = "dev" | "prod";
|
|
|
189
189
|
/**
|
|
190
190
|
* @private
|
|
191
191
|
*/
|
|
192
|
-
export type SerwistPackageJSON = PackageJson
|
|
192
|
+
export type SerwistPackageJSON = Prettify<PackageJson>;
|
|
193
193
|
/**
|
|
194
194
|
* @private
|
|
195
195
|
*/
|
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;
|
|
1
|
+
{"version":3,"file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10.0.0-preview.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A module that integrates into your build process, helping you generate a manifest of local files that should be precached.",
|
|
6
6
|
"files": [
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"file manifest"
|
|
18
18
|
],
|
|
19
19
|
"engines": {
|
|
20
|
-
"node": ">=
|
|
20
|
+
"node": ">=20.0.0"
|
|
21
21
|
},
|
|
22
22
|
"author": "Google's Web DevRel Team",
|
|
23
23
|
"contributors": [
|
|
@@ -49,19 +49,19 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"common-tags": "1.8.2",
|
|
52
|
-
"glob": "
|
|
52
|
+
"glob": "11.0.1",
|
|
53
53
|
"pretty-bytes": "6.1.1",
|
|
54
54
|
"source-map": "0.8.0-beta.0",
|
|
55
|
-
"zod": "3.
|
|
55
|
+
"zod": "3.24.3",
|
|
56
|
+
"@serwist/utils": "10.0.0-preview.2"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
59
|
"@types/common-tags": "1.8.4",
|
|
59
|
-
"@types/node": "22.
|
|
60
|
-
"rollup": "4.
|
|
61
|
-
"type-fest": "4.
|
|
62
|
-
"typescript": "5.
|
|
63
|
-
"@serwist/configs": "
|
|
64
|
-
"@serwist/utils": "9.1.0-preview.0"
|
|
60
|
+
"@types/node": "22.14.1",
|
|
61
|
+
"rollup": "4.40.0",
|
|
62
|
+
"type-fest": "4.40.0",
|
|
63
|
+
"typescript": "5.8.3",
|
|
64
|
+
"@serwist/configs": "10.0.0-preview.2"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"typescript": ">=5.0.0"
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"build": "rimraf dist && NODE_OPTIONS='--max-old-space-size=4096' NODE_ENV=production rollup --config rollup.config.js",
|
|
76
76
|
"dev": "rollup --config rollup.config.js --watch",
|
|
77
77
|
"lint": "biome lint ./src",
|
|
78
|
+
"qcheck": "biome check ./src",
|
|
78
79
|
"typecheck": "tsc"
|
|
79
80
|
}
|
|
80
81
|
}
|
package/src/lib/rebase-path.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { toUnix } from "@serwist/utils";
|
|
10
9
|
import path from "node:path";
|
|
10
|
+
import { toUnix } from "@serwist/utils";
|
|
11
11
|
|
|
12
12
|
export function rebasePath({ baseDirectory, file }: { baseDirectory: string; file: string }): string {
|
|
13
13
|
// The initial path is relative to the current directory, so make it absolute.
|
package/src/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Require } from "@serwist/utils";
|
|
1
|
+
import type { Prettify, Require } from "@serwist/utils";
|
|
2
2
|
import type { PackageJson } from "type-fest";
|
|
3
3
|
import type { z } from "zod";
|
|
4
4
|
import type { manifestEntry } from "./schema/manifestEntry.js";
|
|
@@ -68,7 +68,7 @@ export interface BasePartial {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
export type BaseResolved = Require<BasePartial, "disablePrecacheManifest" | "maximumFileSizeToCacheInBytes"
|
|
71
|
+
export type BaseResolved = Prettify<Require<BasePartial, "disablePrecacheManifest" | "maximumFileSizeToCacheInBytes">>;
|
|
72
72
|
|
|
73
73
|
// This needs to be set when using GetManifest or InjectManifest. This is
|
|
74
74
|
// enforced via runtime validation, and needs to be documented.
|
|
@@ -80,7 +80,7 @@ export interface RequiredGlobDirectoryPartial {
|
|
|
80
80
|
globDirectory: string;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
export type RequiredGlobDirectoryResolved = RequiredGlobDirectoryPartial
|
|
83
|
+
export type RequiredGlobDirectoryResolved = Prettify<RequiredGlobDirectoryPartial>;
|
|
84
84
|
|
|
85
85
|
export interface OptionalGlobDirectoryPartial {
|
|
86
86
|
/**
|
|
@@ -90,7 +90,7 @@ export interface OptionalGlobDirectoryPartial {
|
|
|
90
90
|
globDirectory?: string;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
export type OptionalGlobDirectoryResolved = OptionalGlobDirectoryPartial
|
|
93
|
+
export type OptionalGlobDirectoryResolved = Prettify<OptionalGlobDirectoryPartial>;
|
|
94
94
|
|
|
95
95
|
export interface GlobPartial {
|
|
96
96
|
/**
|
|
@@ -142,7 +142,7 @@ export interface GlobPartial {
|
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
export type GlobResolved = Require<GlobPartial, "globFollow" | "globIgnores" | "globPatterns" | "globStrict"
|
|
145
|
+
export type GlobResolved = Prettify<Require<GlobPartial, "globFollow" | "globIgnores" | "globPatterns" | "globStrict">>;
|
|
146
146
|
|
|
147
147
|
export interface InjectPartial {
|
|
148
148
|
/**
|
|
@@ -158,7 +158,7 @@ export interface InjectPartial {
|
|
|
158
158
|
swSrc: string;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
export type InjectResolved = Require<InjectPartial, "injectionPoint"
|
|
161
|
+
export type InjectResolved = Prettify<Require<InjectPartial, "injectionPoint">>;
|
|
162
162
|
|
|
163
163
|
export interface RequiredSwDestPartial {
|
|
164
164
|
/**
|
|
@@ -168,7 +168,7 @@ export interface RequiredSwDestPartial {
|
|
|
168
168
|
swDest: string;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
export type RequiredSwDestResolved = RequiredSwDestPartial
|
|
171
|
+
export type RequiredSwDestResolved = Prettify<RequiredSwDestPartial>;
|
|
172
172
|
|
|
173
173
|
export interface OptionalSwDestPartial {
|
|
174
174
|
/**
|
|
@@ -179,15 +179,17 @@ export interface OptionalSwDestPartial {
|
|
|
179
179
|
swDest?: string;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
export type OptionalSwDestResolved = OptionalSwDestPartial
|
|
182
|
+
export type OptionalSwDestResolved = Prettify<OptionalSwDestPartial>;
|
|
183
183
|
|
|
184
|
-
export type GetManifestOptions = BasePartial & GlobPartial & RequiredGlobDirectoryPartial
|
|
184
|
+
export type GetManifestOptions = Prettify<BasePartial & GlobPartial & RequiredGlobDirectoryPartial>;
|
|
185
185
|
|
|
186
|
-
export type GetManifestOptionsComplete = BaseResolved & GlobResolved & RequiredGlobDirectoryResolved
|
|
186
|
+
export type GetManifestOptionsComplete = Prettify<BaseResolved & GlobResolved & RequiredGlobDirectoryResolved>;
|
|
187
187
|
|
|
188
|
-
export type InjectManifestOptions = BasePartial & GlobPartial & InjectPartial & RequiredSwDestPartial & RequiredGlobDirectoryPartial
|
|
188
|
+
export type InjectManifestOptions = Prettify<BasePartial & GlobPartial & InjectPartial & RequiredSwDestPartial & RequiredGlobDirectoryPartial>;
|
|
189
189
|
|
|
190
|
-
export type InjectManifestOptionsComplete =
|
|
190
|
+
export type InjectManifestOptionsComplete = Prettify<
|
|
191
|
+
BaseResolved & GlobResolved & InjectResolved & RequiredSwDestResolved & RequiredGlobDirectoryResolved
|
|
192
|
+
>;
|
|
191
193
|
|
|
192
194
|
export interface GetManifestResult {
|
|
193
195
|
count: number;
|
|
@@ -217,7 +219,7 @@ export type BuildType = "dev" | "prod";
|
|
|
217
219
|
/**
|
|
218
220
|
* @private
|
|
219
221
|
*/
|
|
220
|
-
export type SerwistPackageJSON = PackageJson
|
|
222
|
+
export type SerwistPackageJSON = Prettify<PackageJson>;
|
|
221
223
|
|
|
222
224
|
/**
|
|
223
225
|
* @private
|