@serwist/build 10.0.0-preview.1 → 10.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/constants.js +59 -0
- package/dist/chunks/get-manifest.js +11 -0
- package/dist/chunks/glob.js +50 -30
- package/dist/chunks/inject-manifest.js +29 -0
- package/dist/get-manifest.d.ts +1 -1
- package/dist/get-manifest.d.ts.map +1 -1
- package/dist/index.d.ts +3 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -151
- package/dist/index.schema.d.ts +9 -9
- package/dist/index.schema.d.ts.map +1 -1
- package/dist/index.schema.js +4 -4
- package/dist/inject-manifest.d.ts.map +1 -1
- package/dist/lib/additional-precache-entries-transform.d.ts +3 -7
- package/dist/lib/additional-precache-entries-transform.d.ts.map +1 -1
- package/dist/lib/constants.d.ts +2 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/escape-regexp.d.ts.map +1 -1
- package/dist/lib/get-file-details.d.ts +2 -1
- package/dist/lib/get-file-details.d.ts.map +1 -1
- package/dist/lib/get-file-manifest-entries.d.ts.map +1 -1
- package/dist/lib/modify-url-prefix-transform.d.ts.map +1 -1
- package/dist/lib/no-revision-for-urls-matching-transform.d.ts.map +1 -1
- package/dist/lib/transform-manifest.d.ts +2 -1
- package/dist/lib/transform-manifest.d.ts.map +1 -1
- package/dist/lib/validate-options.d.ts.map +1 -1
- package/dist/schema/{assertType.d.ts → assert-type.d.ts} +1 -1
- package/dist/schema/assert-type.d.ts.map +1 -0
- package/dist/schema/base.d.ts +5 -166
- package/dist/schema/base.d.ts.map +1 -1
- package/dist/schema/{serwistConfigError.d.ts → error.d.ts} +3 -1
- package/dist/schema/error.d.ts.map +1 -0
- package/dist/schema/get-manifest.d.ts +16 -0
- package/dist/schema/get-manifest.d.ts.map +1 -0
- package/dist/schema/glob.d.ts +6 -26
- package/dist/schema/glob.d.ts.map +1 -1
- package/dist/schema/inject-manifest.d.ts +23 -0
- package/dist/schema/inject-manifest.d.ts.map +1 -0
- package/dist/schema/manifest-entry.d.ts +16 -0
- package/dist/schema/manifest-entry.d.ts.map +1 -0
- package/dist/schema/manifest-transform.d.ts +8 -0
- package/dist/schema/manifest-transform.d.ts.map +1 -0
- package/dist/schema/sw-dest.d.ts +8 -0
- package/dist/schema/sw-dest.d.ts.map +1 -0
- package/dist/schema/utils.d.ts +16 -0
- package/dist/schema/utils.d.ts.map +1 -0
- package/dist/types.d.ts +12 -28
- package/dist/types.d.ts.map +1 -1
- package/package.json +13 -12
- package/src/get-manifest.ts +1 -1
- package/src/index.schema.ts +10 -8
- package/src/index.ts +5 -11
- package/src/inject-manifest.ts +2 -1
- package/src/lib/additional-precache-entries-transform.ts +5 -6
- package/src/lib/constants.ts +1 -0
- package/src/lib/get-file-details.ts +3 -4
- package/src/lib/get-file-manifest-entries.ts +3 -4
- package/src/lib/modify-url-prefix-transform.ts +1 -1
- package/src/lib/no-revision-for-urls-matching-transform.ts +1 -1
- package/src/lib/rebase-path.ts +1 -1
- package/src/lib/transform-manifest.ts +3 -3
- package/src/lib/translate-url-to-sourcemap-paths.ts +4 -4
- package/src/lib/validate-options.ts +12 -6
- package/src/schema/base.ts +13 -15
- package/src/schema/error.ts +53 -0
- package/src/schema/{getManifest.ts → get-manifest.ts} +7 -6
- package/src/schema/glob.ts +15 -20
- package/src/schema/inject-manifest.ts +24 -0
- package/src/schema/manifest-entry.ts +11 -0
- package/src/schema/manifest-transform.ts +14 -0
- package/src/schema/{swDest.ts → sw-dest.ts} +7 -11
- package/src/schema/utils.ts +48 -0
- package/src/types.ts +9 -32
- package/dist/chunks/getManifest.js +0 -6
- package/dist/chunks/injectManifest.js +0 -23
- package/dist/chunks/validationErrorMap.js +0 -54
- package/dist/lib/errors.d.ts +0 -47
- package/dist/lib/errors.d.ts.map +0 -1
- package/dist/lib/get-composite-details.d.ts +0 -3
- package/dist/lib/get-composite-details.d.ts.map +0 -1
- package/dist/lib/get-file-hash.d.ts +0 -2
- package/dist/lib/get-file-hash.d.ts.map +0 -1
- package/dist/lib/get-file-size.d.ts +0 -2
- package/dist/lib/get-file-size.d.ts.map +0 -1
- package/dist/lib/get-string-details.d.ts +0 -3
- package/dist/lib/get-string-details.d.ts.map +0 -1
- package/dist/lib/get-string-hash.d.ts +0 -3
- package/dist/lib/get-string-hash.d.ts.map +0 -1
- package/dist/schema/assertType.d.ts.map +0 -1
- package/dist/schema/getManifest.d.ts +0 -192
- package/dist/schema/getManifest.d.ts.map +0 -1
- package/dist/schema/injectManifest.d.ts +0 -213
- package/dist/schema/injectManifest.d.ts.map +0 -1
- package/dist/schema/manifestEntry.d.ts +0 -15
- package/dist/schema/manifestEntry.d.ts.map +0 -1
- package/dist/schema/manifestTransform.d.ts +0 -125
- package/dist/schema/manifestTransform.d.ts.map +0 -1
- package/dist/schema/serwistConfigError.d.ts.map +0 -1
- package/dist/schema/swDest.d.ts +0 -16
- package/dist/schema/swDest.d.ts.map +0 -1
- package/dist/schema/validationErrorMap.d.ts +0 -3
- package/dist/schema/validationErrorMap.d.ts.map +0 -1
- package/src/lib/errors.ts +0 -93
- package/src/lib/get-composite-details.ts +0 -31
- package/src/lib/get-file-hash.ts +0 -21
- package/src/lib/get-file-size.ts +0 -22
- package/src/lib/get-string-details.ts +0 -16
- package/src/lib/get-string-hash.ts +0 -15
- package/src/schema/injectManifest.ts +0 -25
- package/src/schema/manifestEntry.ts +0 -9
- package/src/schema/manifestTransform.ts +0 -15
- package/src/schema/serwistConfigError.ts +0 -6
- package/src/schema/validationErrorMap.ts +0 -36
- /package/src/schema/{assertType.ts → assert-type.ts} +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
class SerwistConfigError extends Error {
|
|
2
|
+
constructor({ moduleName, message }){
|
|
3
|
+
super(`Invalid ${moduleName ?? "Serwist"} configuration:\n${message}`);
|
|
4
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
const parsedType = (data)=>{
|
|
8
|
+
const t = typeof data;
|
|
9
|
+
switch(t){
|
|
10
|
+
case "number":
|
|
11
|
+
{
|
|
12
|
+
return Number.isNaN(data) ? "NaN" : "number";
|
|
13
|
+
}
|
|
14
|
+
case "object":
|
|
15
|
+
{
|
|
16
|
+
if (Array.isArray(data)) {
|
|
17
|
+
return "array";
|
|
18
|
+
}
|
|
19
|
+
if (data === null) {
|
|
20
|
+
return "null";
|
|
21
|
+
}
|
|
22
|
+
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
|
23
|
+
return data.constructor.name;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return t;
|
|
28
|
+
};
|
|
29
|
+
const validationErrorMap = (error)=>{
|
|
30
|
+
switch(error.code){
|
|
31
|
+
case "invalid_type":
|
|
32
|
+
{
|
|
33
|
+
return `${error.message ?? "Received invalid type"}: expected ${error.expected}, received ${parsedType(error.input)}.`;
|
|
34
|
+
}
|
|
35
|
+
case "invalid_value":
|
|
36
|
+
{
|
|
37
|
+
return `${error.message ?? "Received invalid value"}: expected ${error.expected}, received ${parsedType(error.input)}.`;
|
|
38
|
+
}
|
|
39
|
+
case "invalid_union":
|
|
40
|
+
{
|
|
41
|
+
return `${error.message ?? "Received invalid union"}:\n${error.errors.flatMap((err)=>err.map((e)=>` → ${e.message}`)).join("\n")}`;
|
|
42
|
+
}
|
|
43
|
+
case "unrecognized_keys":
|
|
44
|
+
{
|
|
45
|
+
return `${error.message ?? "Received unrecognized keys"}: ${error.keys.join(".")}`;
|
|
46
|
+
}
|
|
47
|
+
case "custom":
|
|
48
|
+
{
|
|
49
|
+
return error.message ?? undefined;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return undefined;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const DEFAULT_GLOB_PATTERNS = [
|
|
56
|
+
"**/*.{js,css,html,ico,apng,png,avif,jpg,jpeg,jfif,pjpeg,pjp,gif,svg,webp,json,webmanifest}"
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
export { DEFAULT_GLOB_PATTERNS as D, SerwistConfigError as S, validationErrorMap as v };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { r as requiredGlobDirectoryPartial, g as globPartial, b as basePartial } from './glob.js';
|
|
3
|
+
import './constants.js';
|
|
4
|
+
|
|
5
|
+
const getManifestOptions = z.strictObject({
|
|
6
|
+
...basePartial.shape,
|
|
7
|
+
...globPartial.shape,
|
|
8
|
+
...requiredGlobDirectoryPartial.shape
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { getManifestOptions };
|
package/dist/chunks/glob.js
CHANGED
|
@@ -1,58 +1,78 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { D as DEFAULT_GLOB_PATTERNS } from './constants.js';
|
|
2
3
|
|
|
3
|
-
const manifestEntry = z.
|
|
4
|
+
const manifestEntry = z.strictObject({
|
|
4
5
|
integrity: z.string().optional(),
|
|
5
6
|
revision: z.string().nullable().optional(),
|
|
6
7
|
url: z.string()
|
|
7
|
-
})
|
|
8
|
+
});
|
|
9
|
+
const sizeObject = z.object({
|
|
10
|
+
size: z.number()
|
|
11
|
+
});
|
|
12
|
+
const manifestEntryWithSize = z.object({
|
|
13
|
+
...manifestEntry.shape,
|
|
14
|
+
...sizeObject.shape
|
|
15
|
+
});
|
|
8
16
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
17
|
+
const reference = (schema)=>{
|
|
18
|
+
return schema;
|
|
19
|
+
};
|
|
20
|
+
const asyncFn = ({ input, output })=>{
|
|
21
|
+
const schema = z.function({
|
|
22
|
+
input: z.tuple(input),
|
|
23
|
+
output
|
|
24
|
+
});
|
|
25
|
+
return z.custom((arg)=>typeof arg === "function").transform((arg)=>schema.implementAsync(arg));
|
|
26
|
+
};
|
|
27
|
+
const fn = ({ input, output })=>{
|
|
28
|
+
const schema = z.function({
|
|
29
|
+
input: z.tuple(input),
|
|
30
|
+
output
|
|
31
|
+
});
|
|
32
|
+
return z.custom((arg)=>typeof arg === "function").transform((arg)=>schema.implement(arg));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const manifestTransformResult = z.strictObject({
|
|
36
|
+
manifest: z.array(reference(manifestEntryWithSize)),
|
|
13
37
|
warnings: z.array(z.string()).optional()
|
|
14
|
-
})
|
|
15
|
-
const manifestTransform =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
manifestTransformResult
|
|
23
|
-
]));
|
|
38
|
+
});
|
|
39
|
+
const manifestTransform = asyncFn({
|
|
40
|
+
input: [
|
|
41
|
+
z.array(reference(manifestEntryWithSize)),
|
|
42
|
+
z.unknown().optional()
|
|
43
|
+
],
|
|
44
|
+
output: reference(manifestTransformResult)
|
|
45
|
+
});
|
|
24
46
|
|
|
25
|
-
const basePartial = z.
|
|
47
|
+
const basePartial = z.strictObject({
|
|
26
48
|
additionalPrecacheEntries: z.array(z.union([
|
|
27
49
|
z.string(),
|
|
28
|
-
manifestEntry
|
|
50
|
+
reference(manifestEntry)
|
|
29
51
|
])).optional(),
|
|
30
52
|
disablePrecacheManifest: z.boolean().default(false),
|
|
31
53
|
dontCacheBustURLsMatching: z.instanceof(RegExp).optional(),
|
|
32
|
-
manifestTransforms: z.array(manifestTransform).optional(),
|
|
54
|
+
manifestTransforms: z.array(reference(manifestTransform)).optional(),
|
|
33
55
|
maximumFileSizeToCacheInBytes: z.number().default(2097152),
|
|
34
56
|
modifyURLPrefix: z.record(z.string(), z.string()).optional()
|
|
35
|
-
})
|
|
57
|
+
});
|
|
36
58
|
|
|
37
|
-
const globPartial = z.
|
|
59
|
+
const globPartial = z.strictObject({
|
|
38
60
|
globFollow: z.boolean().default(true),
|
|
39
61
|
globIgnores: z.array(z.string()).default([
|
|
40
62
|
"**/node_modules/**/*"
|
|
41
63
|
]),
|
|
42
|
-
globPatterns: z.array(z.string()).default(
|
|
43
|
-
"**/*.{js,css,html}"
|
|
44
|
-
]),
|
|
64
|
+
globPatterns: z.array(z.string()).default(DEFAULT_GLOB_PATTERNS),
|
|
45
65
|
globStrict: z.boolean().default(true),
|
|
46
66
|
templatedURLs: z.record(z.string(), z.union([
|
|
47
67
|
z.string(),
|
|
48
68
|
z.array(z.string())
|
|
49
69
|
])).optional()
|
|
50
|
-
})
|
|
51
|
-
const optionalGlobDirectoryPartial = z.
|
|
70
|
+
});
|
|
71
|
+
const optionalGlobDirectoryPartial = z.strictObject({
|
|
52
72
|
globDirectory: z.string().optional()
|
|
53
|
-
})
|
|
54
|
-
const requiredGlobDirectoryPartial = z.
|
|
73
|
+
});
|
|
74
|
+
const requiredGlobDirectoryPartial = z.strictObject({
|
|
55
75
|
globDirectory: z.string()
|
|
56
|
-
})
|
|
76
|
+
});
|
|
57
77
|
|
|
58
|
-
export {
|
|
78
|
+
export { asyncFn as a, basePartial as b, manifestTransform as c, manifestTransformResult as d, fn as f, globPartial as g, manifestEntry as m, optionalGlobDirectoryPartial as o, requiredGlobDirectoryPartial as r };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { r as requiredGlobDirectoryPartial, g as globPartial, b as basePartial } from './glob.js';
|
|
3
|
+
|
|
4
|
+
const optionalSwDestPartial = z.strictObject({
|
|
5
|
+
swDest: z.string().optional()
|
|
6
|
+
});
|
|
7
|
+
const requiredSwDestPartial = z.strictObject({
|
|
8
|
+
swDest: z.string()
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const baseInjectPartial = z.strictObject({
|
|
12
|
+
injectionPoint: z.string().prefault("self.__SW_MANIFEST"),
|
|
13
|
+
swSrc: z.string()
|
|
14
|
+
});
|
|
15
|
+
const injectManifestOptions = z.strictObject({
|
|
16
|
+
...basePartial.shape,
|
|
17
|
+
...globPartial.shape,
|
|
18
|
+
...baseInjectPartial.shape,
|
|
19
|
+
...requiredSwDestPartial.shape,
|
|
20
|
+
...requiredGlobDirectoryPartial.shape
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
var injectManifest = /*#__PURE__*/Object.freeze({
|
|
24
|
+
__proto__: null,
|
|
25
|
+
baseInjectPartial: baseInjectPartial,
|
|
26
|
+
injectManifestOptions: injectManifestOptions
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export { injectManifest as a, baseInjectPartial as b, injectManifestOptions as i, optionalSwDestPartial as o, requiredSwDestPartial as r };
|
package/dist/get-manifest.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { GetManifestOptions, GetManifestResult } from "./types.js";
|
|
|
7
7
|
* ```
|
|
8
8
|
* // The following lists some common options; see the rest of the documentation
|
|
9
9
|
* // for the full set of options and defaults.
|
|
10
|
-
* const {count, manifestEntries, size, warnings} = await getManifest({
|
|
10
|
+
* const { count, manifestEntries, size, warnings } = await getManifest({
|
|
11
11
|
* dontCacheBustURLsMatching: [new RegExp('...')],
|
|
12
12
|
* globDirectory: '...',
|
|
13
13
|
* globPatterns: ['...', '...'],
|
|
@@ -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.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { errors } from "@serwist/utils/node";
|
|
1
2
|
import { getManifest } from "./get-manifest.js";
|
|
2
3
|
import { injectManifest } from "./inject-manifest.js";
|
|
3
|
-
import {
|
|
4
|
+
import { DEFAULT_GLOB_PATTERNS } from "./lib/constants.js";
|
|
4
5
|
import { escapeRegExp } from "./lib/escape-regexp.js";
|
|
5
6
|
import { getFileManifestEntries } from "./lib/get-file-manifest-entries.js";
|
|
6
7
|
import { getSourceMapURL } from "./lib/get-source-map-url.js";
|
|
@@ -9,15 +10,6 @@ import { replaceAndUpdateSourceMap } from "./lib/replace-and-update-source-map.j
|
|
|
9
10
|
import { transformManifest } from "./lib/transform-manifest.js";
|
|
10
11
|
import { translateURLToSourcemapPaths } from "./lib/translate-url-to-sourcemap-paths.js";
|
|
11
12
|
import { validateGetManifestOptions, validateInjectManifestOptions } from "./lib/validate-options.js";
|
|
12
|
-
|
|
13
|
-
* Use `JSON.stringify` instead.
|
|
14
|
-
*
|
|
15
|
-
* @deprecated
|
|
16
|
-
*/
|
|
17
|
-
declare const stringify: {
|
|
18
|
-
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
19
|
-
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
20
|
-
};
|
|
21
|
-
export { errors, escapeRegExp, getFileManifestEntries, getManifest, getSourceMapURL, injectManifest, rebasePath, replaceAndUpdateSourceMap, stringify, transformManifest, translateURLToSourcemapPaths, validateGetManifestOptions, validateInjectManifestOptions, };
|
|
13
|
+
export { errors, DEFAULT_GLOB_PATTERNS, escapeRegExp, getFileManifestEntries, getManifest, getSourceMapURL, injectManifest, rebasePath, replaceAndUpdateSourceMap, transformManifest, translateURLToSourcemapPaths, validateGetManifestOptions, validateInjectManifestOptions, };
|
|
22
14
|
export type * from "./types.js";
|
|
23
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAEtG,OAAO,EACL,MAAM,EACN,qBAAqB,EACrB,YAAY,EACZ,sBAAsB,EACtB,WAAW,EACX,eAAe,EACf,cAAc,EACd,UAAU,EACV,yBAAyB,EACzB,iBAAiB,EACjB,4BAA4B,EAC5B,0BAA0B,EAC1B,6BAA6B,GAC9B,CAAC;AAEF,mBAAmB,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,143 +1,16 @@
|
|
|
1
|
+
import { errors, getFileSize, getFileHash, getCompositeDetails, getStringDetails } from '@serwist/utils/node';
|
|
2
|
+
export { errors } from '@serwist/utils/node';
|
|
1
3
|
import assert from 'node:assert';
|
|
2
|
-
import { oneLine } from 'common-tags';
|
|
3
|
-
import crypto from 'node:crypto';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { globSync } from 'glob';
|
|
6
|
-
import fs, { readFileSync } from 'node:fs';
|
|
7
6
|
import prettyBytes from 'pretty-bytes';
|
|
8
|
-
import {
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { v as validationErrorMap, S as SerwistConfigError } from './chunks/constants.js';
|
|
9
|
+
export { D as DEFAULT_GLOB_PATTERNS } from './chunks/constants.js';
|
|
9
10
|
import fsp from 'node:fs/promises';
|
|
10
11
|
import { toUnix } from '@serwist/utils';
|
|
11
12
|
import { SourceMapGenerator, SourceMapConsumer } from 'source-map';
|
|
12
|
-
import '
|
|
13
|
-
|
|
14
|
-
const errors = {
|
|
15
|
-
"unable-to-get-rootdir": "Unable to get the root directory of your web app.",
|
|
16
|
-
"no-extension": oneLine`Unable to detect a usable extension for a file in your web
|
|
17
|
-
app directory.`,
|
|
18
|
-
"invalid-file-manifest-name": oneLine`The File Manifest Name must have at least one
|
|
19
|
-
character.`,
|
|
20
|
-
"unable-to-get-file-manifest-name": "Unable to get a file manifest name.",
|
|
21
|
-
"invalid-sw-dest": `The 'swDest' value must be a valid path.`,
|
|
22
|
-
"unable-to-get-sw-name": "Unable to get a service worker file name.",
|
|
23
|
-
"unable-to-get-save-config": oneLine`An error occurred when asking to save details
|
|
24
|
-
in a config file.`,
|
|
25
|
-
"unable-to-get-file-hash": oneLine`An error occurred when attempting to create a
|
|
26
|
-
file hash.`,
|
|
27
|
-
"unable-to-get-file-size": oneLine`An error occurred when attempting to get a file
|
|
28
|
-
size.`,
|
|
29
|
-
"unable-to-glob-files": "An error occurred when globbing for files.",
|
|
30
|
-
"unable-to-make-manifest-directory": oneLine`Unable to make output directory for
|
|
31
|
-
file manifest.`,
|
|
32
|
-
"read-manifest-template-failure": "Unable to read template for file manifest",
|
|
33
|
-
"populating-manifest-tmpl-failed": oneLine`An error occurred when populating the
|
|
34
|
-
file manifest template.`,
|
|
35
|
-
"manifest-file-write-failure": "Unable to write the file manifest.",
|
|
36
|
-
"unable-to-make-sw-directory": oneLine`Unable to make the directories to output
|
|
37
|
-
the service worker path.`,
|
|
38
|
-
"sw-write-failure": "Unable to write the service worker file.",
|
|
39
|
-
"sw-write-failure-directory": oneLine`Unable to write the service worker file;
|
|
40
|
-
'swDest' should be a full path to the file, not a path to a directory.`,
|
|
41
|
-
"unable-to-copy-serwist-libraries": oneLine`One or more of the Serwist libraries
|
|
42
|
-
could not be copied over to the destination directory: `,
|
|
43
|
-
"invalid-glob-directory": oneLine`The supplied globDirectory must be a path as a
|
|
44
|
-
string.`,
|
|
45
|
-
"invalid-dont-cache-bust": oneLine`The supplied 'dontCacheBustURLsMatching'
|
|
46
|
-
parameter must be a RegExp.`,
|
|
47
|
-
"invalid-exclude-files": "The excluded files should be an array of strings.",
|
|
48
|
-
"invalid-get-manifest-entries-input": oneLine`The input to
|
|
49
|
-
'getFileManifestEntries()' must be an object.`,
|
|
50
|
-
"invalid-manifest-path": oneLine`The supplied manifest path is not a string with
|
|
51
|
-
at least one character.`,
|
|
52
|
-
"invalid-manifest-entries": oneLine`The manifest entries must be an array of
|
|
53
|
-
strings or JavaScript objects containing a url parameter.`,
|
|
54
|
-
"invalid-manifest-format": oneLine`The value of the 'format' option passed to
|
|
55
|
-
generateFileManifest() must be either 'iife' (the default) or 'es'.`,
|
|
56
|
-
"invalid-static-file-globs": oneLine`The 'globPatterns' value must be an array
|
|
57
|
-
of strings.`,
|
|
58
|
-
"invalid-templated-urls": oneLine`The 'templatedURLs' value should be an object
|
|
59
|
-
that maps URLs to either a string, or to an array of glob patterns.`,
|
|
60
|
-
"templated-url-matches-glob": oneLine`One of the 'templatedURLs' URLs is already
|
|
61
|
-
being tracked via 'globPatterns': `,
|
|
62
|
-
"invalid-glob-ignores": oneLine`The 'globIgnores' parameter must be an array of
|
|
63
|
-
glob pattern strings.`,
|
|
64
|
-
"manifest-entry-bad-url": oneLine`The generated manifest contains an entry without
|
|
65
|
-
a URL string. This is likely an error with @serwist/build.`,
|
|
66
|
-
"modify-url-prefix-bad-prefixes": oneLine`The 'modifyURLPrefix' parameter must be
|
|
67
|
-
an object with string key value pairs.`,
|
|
68
|
-
"invalid-inject-manifest-arg": oneLine`The input to 'injectManifest()' must be an
|
|
69
|
-
object.`,
|
|
70
|
-
"injection-point-not-found": oneLine`Unable to find a place to inject the manifest.
|
|
71
|
-
Please ensure that your service worker file contains the following: `,
|
|
72
|
-
"multiple-injection-points": oneLine`Please ensure that your 'swSrc' file contains
|
|
73
|
-
only one match for the following: `,
|
|
74
|
-
"useless-glob-pattern": oneLine`One of the glob patterns doesn't match any files.
|
|
75
|
-
Please remove or fix the following: `,
|
|
76
|
-
"bad-template-urls-asset": oneLine`There was an issue using one of the provided
|
|
77
|
-
'templatedURLs'.`,
|
|
78
|
-
"invalid-generate-file-manifest-arg": oneLine`The input to generateFileManifest()
|
|
79
|
-
must be an Object.`,
|
|
80
|
-
"invalid-sw-src": `The 'swSrc' file can't be read.`,
|
|
81
|
-
"same-src-and-dest": oneLine`Unable to find a place to inject the manifest. This is
|
|
82
|
-
likely because swSrc and swDest are configured to the same file.
|
|
83
|
-
Please ensure that your swSrc file contains the following:`,
|
|
84
|
-
"no-module-name": oneLine`You must provide a moduleName parameter when calling
|
|
85
|
-
getModuleURL().`,
|
|
86
|
-
"bad-manifest-transforms-return-value": oneLine`The return value from a
|
|
87
|
-
manifestTransform should be an object with 'manifest' and optionally
|
|
88
|
-
'warnings' properties.`,
|
|
89
|
-
"string-entry-warning": oneLine`Some items were passed to additionalPrecacheEntries
|
|
90
|
-
without revisioning info. This is generally NOT safe. Learn more at
|
|
91
|
-
https://bit.ly/wb-precache.`,
|
|
92
|
-
"cant-find-sourcemap": oneLine`The swSrc file refers to a sourcemap that can't be
|
|
93
|
-
opened:`,
|
|
94
|
-
"manifest-transforms": oneLine`When using manifestTransforms, you must provide
|
|
95
|
-
an array of functions.`
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const getCompositeDetails = (compositeURL, dependencyDetails)=>{
|
|
99
|
-
let totalSize = 0;
|
|
100
|
-
let compositeHash = "";
|
|
101
|
-
for (const fileDetails of dependencyDetails){
|
|
102
|
-
totalSize += fileDetails.size;
|
|
103
|
-
compositeHash += fileDetails.hash === null ? "" : fileDetails.hash;
|
|
104
|
-
}
|
|
105
|
-
const md5 = crypto.createHash("md5");
|
|
106
|
-
md5.update(compositeHash);
|
|
107
|
-
const hashOfHashes = md5.digest("hex");
|
|
108
|
-
return {
|
|
109
|
-
file: compositeURL,
|
|
110
|
-
hash: hashOfHashes,
|
|
111
|
-
size: totalSize
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
function getStringHash(input) {
|
|
116
|
-
const md5 = crypto.createHash("md5");
|
|
117
|
-
md5.update(input);
|
|
118
|
-
return md5.digest("hex");
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const getFileHash = (file)=>{
|
|
122
|
-
try {
|
|
123
|
-
const buffer = readFileSync(file);
|
|
124
|
-
return getStringHash(buffer);
|
|
125
|
-
} catch (err) {
|
|
126
|
-
throw new Error(`${errors["unable-to-get-file-hash"]} '${err instanceof Error && err.message ? err.message : ""}'`);
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
const getFileSize = (file)=>{
|
|
131
|
-
try {
|
|
132
|
-
const stat = fs.statSync(file);
|
|
133
|
-
if (!stat.isFile()) {
|
|
134
|
-
return null;
|
|
135
|
-
}
|
|
136
|
-
return stat.size;
|
|
137
|
-
} catch (err) {
|
|
138
|
-
throw new Error(`${errors["unable-to-get-file-size"]} '${err instanceof Error && err.message ? err.message : ""}'`);
|
|
139
|
-
}
|
|
140
|
-
};
|
|
13
|
+
import fs from 'node:fs';
|
|
141
14
|
|
|
142
15
|
const getFileDetails = ({ globDirectory, globFollow, globIgnores, globPattern })=>{
|
|
143
16
|
let globbedFiles;
|
|
@@ -177,12 +50,6 @@ const getFileDetails = ({ globDirectory, globFollow, globIgnores, globPattern })
|
|
|
177
50
|
};
|
|
178
51
|
};
|
|
179
52
|
|
|
180
|
-
const getStringDetails = (url, str)=>({
|
|
181
|
-
file: url,
|
|
182
|
-
hash: getStringHash(str),
|
|
183
|
-
size: str.length
|
|
184
|
-
});
|
|
185
|
-
|
|
186
53
|
const additionalPrecacheEntriesTransform = (additionalPrecacheEntries)=>{
|
|
187
54
|
return (manifest)=>{
|
|
188
55
|
const warnings = [];
|
|
@@ -429,25 +296,25 @@ const getFileManifestEntries = async ({ additionalPrecacheEntries, dontCacheBust
|
|
|
429
296
|
};
|
|
430
297
|
|
|
431
298
|
const validateGetManifestOptions = async (input)=>{
|
|
432
|
-
const result = await (await import('./chunks/
|
|
433
|
-
|
|
299
|
+
const result = await (await import('./chunks/get-manifest.js')).getManifestOptions.spa(input, {
|
|
300
|
+
error: validationErrorMap
|
|
434
301
|
});
|
|
435
302
|
if (!result.success) {
|
|
436
303
|
throw new SerwistConfigError({
|
|
437
304
|
moduleName: "@serwist/build",
|
|
438
|
-
message:
|
|
305
|
+
message: z.prettifyError(result.error)
|
|
439
306
|
});
|
|
440
307
|
}
|
|
441
308
|
return result.data;
|
|
442
309
|
};
|
|
443
310
|
const validateInjectManifestOptions = async (input)=>{
|
|
444
|
-
const result = await (await import('./chunks/
|
|
445
|
-
|
|
311
|
+
const result = await (await import('./chunks/inject-manifest.js').then(function (n) { return n.a; })).injectManifestOptions.spa(input, {
|
|
312
|
+
error: validationErrorMap
|
|
446
313
|
});
|
|
447
314
|
if (!result.success) {
|
|
448
315
|
throw new SerwistConfigError({
|
|
449
316
|
moduleName: "@serwist/build",
|
|
450
|
-
message:
|
|
317
|
+
message: z.prettifyError(result.error)
|
|
451
318
|
});
|
|
452
319
|
}
|
|
453
320
|
return result.data;
|
|
@@ -535,9 +402,9 @@ async function replaceAndUpdateSourceMap({ jsFilename, originalMap, originalSour
|
|
|
535
402
|
}
|
|
536
403
|
|
|
537
404
|
function translateURLToSourcemapPaths(url, swSrc, swDest) {
|
|
538
|
-
let destPath
|
|
539
|
-
let srcPath
|
|
540
|
-
let warning
|
|
405
|
+
let destPath;
|
|
406
|
+
let srcPath;
|
|
407
|
+
let warning;
|
|
541
408
|
if (url && !url.startsWith("data:")) {
|
|
542
409
|
const possibleSrcPath = path.resolve(path.dirname(swSrc), url);
|
|
543
410
|
if (fs.existsSync(possibleSrcPath)) {
|
|
@@ -621,6 +488,4 @@ const injectManifest = async (config)=>{
|
|
|
621
488
|
};
|
|
622
489
|
};
|
|
623
490
|
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
export { errors, escapeRegExp, getFileManifestEntries, getManifest, getSourceMapURL, injectManifest, rebasePath, replaceAndUpdateSourceMap, stringify, transformManifest, translateURLToSourcemapPaths, validateGetManifestOptions, validateInjectManifestOptions };
|
|
491
|
+
export { escapeRegExp, getFileManifestEntries, getManifest, getSourceMapURL, injectManifest, rebasePath, replaceAndUpdateSourceMap, transformManifest, translateURLToSourcemapPaths, validateGetManifestOptions, validateInjectManifestOptions };
|
package/dist/index.schema.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { type Assignable, type Equals
|
|
1
|
+
import { type Assignable, assertType, type Equals } from "./schema/assert-type.js";
|
|
2
2
|
import { basePartial } from "./schema/base.js";
|
|
3
|
-
import {
|
|
3
|
+
import { SerwistConfigError, validationErrorMap } from "./schema/error.js";
|
|
4
|
+
import { getManifestOptions } from "./schema/get-manifest.js";
|
|
4
5
|
import { globPartial, optionalGlobDirectoryPartial, requiredGlobDirectoryPartial } from "./schema/glob.js";
|
|
5
|
-
import { baseInjectPartial, injectManifestOptions } from "./schema/
|
|
6
|
-
import { manifestEntry } from "./schema/
|
|
7
|
-
import { manifestTransform, manifestTransformResult } from "./schema/
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
export { assertType, basePartial, globPartial, baseInjectPartial as injectPartial, injectManifestOptions, getManifestOptions, manifestEntry, manifestTransform, manifestTransformResult, optionalGlobDirectoryPartial, requiredGlobDirectoryPartial, optionalSwDestPartial, requiredSwDestPartial, validationErrorMap, SerwistConfigError, };
|
|
6
|
+
import { baseInjectPartial, injectManifestOptions } from "./schema/inject-manifest.js";
|
|
7
|
+
import { manifestEntry } from "./schema/manifest-entry.js";
|
|
8
|
+
import { manifestTransform, manifestTransformResult } from "./schema/manifest-transform.js";
|
|
9
|
+
import { optionalSwDestPartial, requiredSwDestPartial } from "./schema/sw-dest.js";
|
|
10
|
+
import { asyncFn, fn } from "./schema/utils.js";
|
|
11
|
+
export { assertType, fn, asyncFn, basePartial, globPartial, baseInjectPartial as injectPartial, injectManifestOptions, getManifestOptions, manifestEntry, manifestTransform, manifestTransformResult, optionalGlobDirectoryPartial, requiredGlobDirectoryPartial, optionalSwDestPartial, requiredSwDestPartial, validationErrorMap, SerwistConfigError, };
|
|
12
12
|
export type { Assignable, Equals };
|
|
13
13
|
//# sourceMappingURL=index.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.schema.d.ts","sourceRoot":"","sources":["../src/index.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"index.schema.d.ts","sourceRoot":"","sources":["../src/index.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,UAAU,EAAE,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAC3G,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAC5F,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,UAAU,EACV,EAAE,EACF,OAAO,EACP,WAAW,EACX,WAAW,EACX,iBAAiB,IAAI,aAAa,EAClC,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,EAC5B,4BAA4B,EAC5B,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,GACnB,CAAC;AACF,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/index.schema.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { b as basePartial, g as globPartial, m as manifestEntry,
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
1
|
+
export { a as asyncFn, b as basePartial, f as fn, g as globPartial, m as manifestEntry, c as manifestTransform, d as manifestTransformResult, o as optionalGlobDirectoryPartial, r as requiredGlobDirectoryPartial } from './chunks/glob.js';
|
|
2
|
+
export { S as SerwistConfigError, v as validationErrorMap } from './chunks/constants.js';
|
|
3
|
+
export { getManifestOptions } from './chunks/get-manifest.js';
|
|
4
|
+
export { i as injectManifestOptions, b as injectPartial, o as optionalSwDestPartial, r as requiredSwDestPartial } from './chunks/inject-manifest.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
|
7
7
|
function assertType() {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inject-manifest.d.ts","sourceRoot":"","sources":["../src/inject-manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inject-manifest.d.ts","sourceRoot":"","sources":["../src/inject-manifest.ts"],"names":[],"mappings":"AAqBA,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,10 +1,6 @@
|
|
|
1
|
-
import type { ManifestEntry } from "../types.js";
|
|
2
|
-
type AdditionalManifestEntriesTransform = (manifest:
|
|
3
|
-
|
|
4
|
-
})[]) => {
|
|
5
|
-
manifest: (ManifestEntry & {
|
|
6
|
-
size: number;
|
|
7
|
-
})[];
|
|
1
|
+
import type { ManifestEntry, ManifestEntryWithSize } from "../types.js";
|
|
2
|
+
type AdditionalManifestEntriesTransform = (manifest: ManifestEntryWithSize[]) => {
|
|
3
|
+
manifest: ManifestEntryWithSize[];
|
|
8
4
|
warnings: string[];
|
|
9
5
|
};
|
|
10
6
|
export declare const additionalPrecacheEntriesTransform: (additionalPrecacheEntries: (ManifestEntry | string)[]) => AdditionalManifestEntriesTransform;
|
|
@@ -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;
|
|
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,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAExE,KAAK,kCAAkC,GAAG,CAAC,QAAQ,EAAE,qBAAqB,EAAE,KAAK;IAC/E,QAAQ,EAAE,qBAAqB,EAAE,CAAC;IAClC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,kCAAkC,GAAI,2BAA2B,CAAC,aAAa,GAAG,MAAM,CAAC,EAAE,KAAG,kCAqC1G,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/lib/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,UAAiG,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,4 +1,5 @@
|
|
|
1
|
-
import type { FileDetails
|
|
1
|
+
import type { FileDetails } from "@serwist/utils";
|
|
2
|
+
import type { GlobPartial } from "../types.js";
|
|
2
3
|
export declare const getFileDetails: ({ globDirectory, globFollow, globIgnores, globPattern, }: Omit<GlobPartial, "globDirectory" | "globPatterns" | "templatedURLs"> & {
|
|
3
4
|
globDirectory: string;
|
|
4
5
|
globPattern: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-file-details.d.ts","sourceRoot":"","sources":["../../src/lib/get-file-details.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-file-details.d.ts","sourceRoot":"","sources":["../../src/lib/get-file-details.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,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-manifest-entries.d.ts","sourceRoot":"","sources":["../../src/lib/get-file-manifest-entries.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-file-manifest-entries.d.ts","sourceRoot":"","sources":["../../src/lib/get-file-manifest-entries.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIjF,eAAO,MAAM,sBAAsB,GAAU,yOAa1C,0BAA0B,KAAG,OAAO,CAAC,iBAAiB,CA+FxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modify-url-prefix-transform.d.ts","sourceRoot":"","sources":["../../src/lib/modify-url-prefix-transform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"modify-url-prefix-transform.d.ts","sourceRoot":"","sources":["../../src/lib/modify-url-prefix-transform.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,wBAAgB,wBAAwB,CAAC,eAAe,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG,iBAAiB,CA0CtG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-revision-for-urls-matching-transform.d.ts","sourceRoot":"","sources":["../../src/lib/no-revision-for-urls-matching-transform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"no-revision-for-urls-matching-transform.d.ts","sourceRoot":"","sources":["../../src/lib/no-revision-for-urls-matching-transform.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,CAoBpF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FileDetails } from "@serwist/utils";
|
|
2
|
+
import type { BaseResolved, ManifestEntry } from "../types.js";
|
|
2
3
|
/**
|
|
3
4
|
* A `ManifestTransform` function can be used to modify the modify the `url` or
|
|
4
5
|
* `revision` properties of some or all of the {@linkcode ManifestEntry} in the manifest.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform-manifest.d.ts","sourceRoot":"","sources":["../../src/lib/transform-manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transform-manifest.d.ts","sourceRoot":"","sources":["../../src/lib/transform-manifest.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAqB,MAAM,aAAa,CAAC;AAMlF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,UAAU,mCAAmC;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,aAAa,EAAE,GAAG,SAAS,CAAC;IAC7C,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAID,UAAU,wBACR,SAAQ,IAAI,CACV,YAAY,EACV,2BAA2B,GAC3B,2BAA2B,GAC3B,oBAAoB,GACpB,+BAA+B,GAC/B,iBAAiB,GACjB,yBAAyB,CAC5B;IACD,WAAW,EAAE,WAAW,EAAE,CAAC;IAG3B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAsB,iBAAiB,CAAC,EACtC,yBAAyB,EACzB,yBAAyB,EACzB,WAAW,EACX,kBAAkB,EAClB,6BAA6B,EAC7B,eAAe,EACf,cAAc,EACd,uBAAuB,GACxB,EAAE,wBAAwB,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAsEzE"}
|
|
@@ -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,CASnG,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAU,OAAO,OAAO,KAAG,OAAO,CAAC,6BAA6B,CASzG,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type Equals<T, S> = [T] extends [S] ? ([S] extends [T] ? true : false) : false;
|
|
2
2
|
export type Assignable<T, U> = [U] extends [T] ? true : false;
|
|
3
3
|
export declare function assertType<_T extends true>(): void;
|
|
4
|
-
//# sourceMappingURL=
|
|
4
|
+
//# sourceMappingURL=assert-type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-type.d.ts","sourceRoot":"","sources":["../../src/schema/assert-type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;AAEtF,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AAE9D,wBAAgB,UAAU,CAAC,EAAE,SAAS,IAAI,UAEzC"}
|