@serwist/build 10.0.0-preview.8 → 10.0.0-preview.9

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.
Files changed (69) hide show
  1. package/dist/chunks/constants.js +34 -33
  2. package/dist/chunks/get-manifest.js +11 -0
  3. package/dist/chunks/glob.js +43 -25
  4. package/dist/chunks/inject-manifest.js +29 -0
  5. package/dist/index.js +10 -10
  6. package/dist/index.schema.d.ts +9 -9
  7. package/dist/index.schema.d.ts.map +1 -1
  8. package/dist/index.schema.js +3 -3
  9. package/dist/lib/transform-manifest.d.ts.map +1 -1
  10. package/dist/lib/validate-options.d.ts.map +1 -1
  11. package/dist/schema/{assertType.d.ts → assert-type.d.ts} +1 -1
  12. package/dist/schema/assert-type.d.ts.map +1 -0
  13. package/dist/schema/base.d.ts +44 -150
  14. package/dist/schema/base.d.ts.map +1 -1
  15. package/dist/schema/{serwistConfigError.d.ts → error.d.ts} +3 -1
  16. package/dist/schema/error.d.ts.map +1 -0
  17. package/dist/schema/get-manifest.d.ts +72 -0
  18. package/dist/schema/get-manifest.d.ts.map +1 -0
  19. package/dist/schema/glob.d.ts +6 -26
  20. package/dist/schema/glob.d.ts.map +1 -1
  21. package/dist/schema/inject-manifest.d.ts +79 -0
  22. package/dist/schema/inject-manifest.d.ts.map +1 -0
  23. package/dist/schema/manifest-entry.d.ts +7 -0
  24. package/dist/schema/manifest-entry.d.ts.map +1 -0
  25. package/dist/schema/manifest-transform.d.ts +64 -0
  26. package/dist/schema/manifest-transform.d.ts.map +1 -0
  27. package/dist/schema/sw-dest.d.ts +8 -0
  28. package/dist/schema/sw-dest.d.ts.map +1 -0
  29. package/dist/schema/utils.d.ts +10 -0
  30. package/dist/schema/utils.d.ts.map +1 -0
  31. package/dist/types.d.ts +11 -4
  32. package/dist/types.d.ts.map +1 -1
  33. package/package.json +11 -9
  34. package/src/index.schema.ts +10 -8
  35. package/src/lib/transform-manifest.ts +0 -1
  36. package/src/lib/translate-url-to-sourcemap-paths.ts +3 -3
  37. package/src/lib/validate-options.ts +12 -6
  38. package/src/schema/base.ts +11 -13
  39. package/src/schema/error.ts +53 -0
  40. package/src/schema/{getManifest.ts → get-manifest.ts} +7 -6
  41. package/src/schema/glob.ts +15 -21
  42. package/src/schema/inject-manifest.ts +24 -0
  43. package/src/schema/manifest-entry.ts +7 -0
  44. package/src/schema/manifest-transform.ts +17 -0
  45. package/src/schema/{swDest.ts → sw-dest.ts} +7 -11
  46. package/src/schema/utils.ts +27 -0
  47. package/src/types.ts +10 -4
  48. package/dist/chunks/getManifest.js +0 -7
  49. package/dist/chunks/injectManifest.js +0 -23
  50. package/dist/schema/assertType.d.ts.map +0 -1
  51. package/dist/schema/getManifest.d.ts +0 -192
  52. package/dist/schema/getManifest.d.ts.map +0 -1
  53. package/dist/schema/injectManifest.d.ts +0 -213
  54. package/dist/schema/injectManifest.d.ts.map +0 -1
  55. package/dist/schema/manifestEntry.d.ts +0 -15
  56. package/dist/schema/manifestEntry.d.ts.map +0 -1
  57. package/dist/schema/manifestTransform.d.ts +0 -125
  58. package/dist/schema/manifestTransform.d.ts.map +0 -1
  59. package/dist/schema/serwistConfigError.d.ts.map +0 -1
  60. package/dist/schema/swDest.d.ts +0 -16
  61. package/dist/schema/swDest.d.ts.map +0 -1
  62. package/dist/schema/validationErrorMap.d.ts +0 -3
  63. package/dist/schema/validationErrorMap.d.ts.map +0 -1
  64. package/src/schema/injectManifest.ts +0 -25
  65. package/src/schema/manifestEntry.ts +0 -9
  66. package/src/schema/manifestTransform.ts +0 -15
  67. package/src/schema/serwistConfigError.ts +0 -6
  68. package/src/schema/validationErrorMap.ts +0 -36
  69. /package/src/schema/{assertType.ts → assert-type.ts} +0 -0
@@ -1,54 +1,55 @@
1
- import { z } from 'zod';
2
-
3
1
  class SerwistConfigError extends Error {
4
2
  constructor({ moduleName, message }){
5
- super(`Received an invalid ${moduleName ?? "Serwist"} configuration: ${message}`);
3
+ super(`Invalid ${moduleName ?? "Serwist"} configuration:\n${message}`);
6
4
  Object.setPrototypeOf(this, new.target.prototype);
7
5
  }
8
6
  }
9
-
10
- const validationErrorMap = (error, ctx)=>{
11
- switch(error.code){
12
- case z.ZodIssueCode.invalid_type:
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":
13
15
  {
14
- return {
15
- message: `${error.message ?? "Received invalid type"}: expected ${error.expected}, received ${error.received}.`
16
- };
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
+ }
17
25
  }
18
- case z.ZodIssueCode.invalid_literal:
26
+ }
27
+ return t;
28
+ };
29
+ const validationErrorMap = (error)=>{
30
+ switch(error.code){
31
+ case "invalid_type":
19
32
  {
20
- return {
21
- message: `${error.message ?? "Received invalid literal"}: expected ${error.expected}, received ${error.received}.`
22
- };
33
+ return `${error.message ?? "Received invalid type"}: expected ${error.expected}, received ${parsedType(error.input)}.`;
23
34
  }
24
- case z.ZodIssueCode.unrecognized_keys:
35
+ case "invalid_value":
25
36
  {
26
- return {
27
- message: `${error.message ?? "Received unrecognized keys"}: ${error.keys.join(",")}`
28
- };
37
+ return `${error.message ?? "Received invalid value"}: expected ${error.expected}, received ${parsedType(error.input)}.`;
29
38
  }
30
- case z.ZodIssueCode.invalid_arguments:
39
+ case "invalid_union":
31
40
  {
32
- return {
33
- message: `${error.message ?? "Received invalid arguments"}: ${error.argumentsError.errors.map((e)=>validationErrorMap(e, ctx)).join(",")}.`
34
- };
41
+ return `${error.message ?? "Received invalid union"}:\n${error.errors.flatMap((err)=>err.map((e)=>` → ${e.message}`)).join("\n")}`;
35
42
  }
36
- case z.ZodIssueCode.invalid_return_type:
43
+ case "unrecognized_keys":
37
44
  {
38
- return {
39
- message: `${error.message ?? "Received invalid return type"}: ${error.returnTypeError.errors.map((e)=>validationErrorMap(e, ctx)).join(",")}.`
40
- };
45
+ return `${error.message ?? "Received unrecognized keys"}: ${error.keys.join(".")}`;
41
46
  }
42
- case z.ZodIssueCode.custom:
47
+ case "custom":
43
48
  {
44
- return {
45
- message: error.message ?? ctx.defaultError
46
- };
49
+ return error.message ?? undefined;
47
50
  }
48
51
  }
49
- return {
50
- message: ctx.defaultError
51
- };
52
+ return undefined;
52
53
  };
53
54
 
54
55
  const DEFAULT_GLOB_PATTERNS = [
@@ -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 };
@@ -1,29 +1,47 @@
1
1
  import { z } from 'zod';
2
2
  import { D as DEFAULT_GLOB_PATTERNS } from './constants.js';
3
3
 
4
- const manifestEntry = z.object({
4
+ const manifestEntry = z.strictObject({
5
5
  integrity: z.string().optional(),
6
6
  revision: z.string().nullable().optional(),
7
7
  url: z.string()
8
- }).strict("Do not pass invalid properties to ManifestEntry!");
8
+ });
9
9
 
10
- const manifestTransformResult = z.object({
11
- manifest: z.array(manifestEntry.merge(z.object({
12
- size: z.number()
13
- }))),
10
+ const fn = ({ input, output })=>{
11
+ const schema = z.function({
12
+ input: z.tuple(input),
13
+ output
14
+ });
15
+ return z.custom((arg)=>typeof arg === "function").transform((arg)=>schema.implement(arg));
16
+ };
17
+ const asyncFn = ({ input, output })=>{
18
+ const schema = z.function({
19
+ input: z.tuple(input),
20
+ output
21
+ });
22
+ return z.custom((arg)=>typeof arg === "function").transform((arg)=>schema.implementAsync(arg));
23
+ };
24
+
25
+ const sizeObject = z.object({
26
+ size: z.number()
27
+ });
28
+ const manifestEntryWithSize = z.object({
29
+ ...manifestEntry.shape,
30
+ ...sizeObject.shape
31
+ });
32
+ const manifestTransformResult = z.strictObject({
33
+ manifest: z.array(manifestEntryWithSize),
14
34
  warnings: z.array(z.string()).optional()
15
- }).strict("Do not pass invalid properties to ManifestTransformResult!");
16
- const manifestTransform = z.function(z.tuple([
17
- z.array(manifestEntry.merge(z.object({
18
- size: z.number()
19
- }))),
20
- z.unknown().optional()
21
- ]), z.union([
22
- z.promise(manifestTransformResult),
23
- manifestTransformResult
24
- ]));
35
+ });
36
+ const manifestTransform = asyncFn({
37
+ input: [
38
+ z.array(manifestEntryWithSize),
39
+ z.unknown().optional()
40
+ ],
41
+ output: manifestTransformResult
42
+ });
25
43
 
26
- const basePartial = z.object({
44
+ const basePartial = z.strictObject({
27
45
  additionalPrecacheEntries: z.array(z.union([
28
46
  z.string(),
29
47
  manifestEntry
@@ -33,9 +51,9 @@ const basePartial = z.object({
33
51
  manifestTransforms: z.array(manifestTransform).optional(),
34
52
  maximumFileSizeToCacheInBytes: z.number().default(2097152),
35
53
  modifyURLPrefix: z.record(z.string(), z.string()).optional()
36
- }).strict("Do not pass invalid properties to BasePartial!");
54
+ });
37
55
 
38
- const globPartial = z.object({
56
+ const globPartial = z.strictObject({
39
57
  globFollow: z.boolean().default(true),
40
58
  globIgnores: z.array(z.string()).default([
41
59
  "**/node_modules/**/*"
@@ -46,12 +64,12 @@ const globPartial = z.object({
46
64
  z.string(),
47
65
  z.array(z.string())
48
66
  ])).optional()
49
- }).strict("Do not pass invalid properties to GlobPartial!");
50
- const optionalGlobDirectoryPartial = z.object({
67
+ });
68
+ const optionalGlobDirectoryPartial = z.strictObject({
51
69
  globDirectory: z.string().optional()
52
- }).strict("Do not pass invalid properties to OptionalGlobDirectoryPartial!");
53
- const requiredGlobDirectoryPartial = z.object({
70
+ });
71
+ const requiredGlobDirectoryPartial = z.strictObject({
54
72
  globDirectory: z.string()
55
- }).strict("Do not pass invalid properties to RequiredGlobDirectoryPartial!");
73
+ });
56
74
 
57
- export { manifestTransform as a, basePartial as b, manifestTransformResult as c, globPartial as g, manifestEntry as m, optionalGlobDirectoryPartial as o, requiredGlobDirectoryPartial as r };
75
+ 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().default("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/index.js CHANGED
@@ -4,13 +4,13 @@ import assert from 'node:assert';
4
4
  import path from 'node:path';
5
5
  import { globSync } from 'glob';
6
6
  import prettyBytes from 'pretty-bytes';
7
+ import { z } from 'zod';
7
8
  import { v as validationErrorMap, S as SerwistConfigError } from './chunks/constants.js';
8
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
13
  import fs from 'node:fs';
13
- import 'zod';
14
14
 
15
15
  const getFileDetails = ({ globDirectory, globFollow, globIgnores, globPattern })=>{
16
16
  let globbedFiles;
@@ -296,25 +296,25 @@ const getFileManifestEntries = async ({ additionalPrecacheEntries, dontCacheBust
296
296
  };
297
297
 
298
298
  const validateGetManifestOptions = async (input)=>{
299
- const result = await (await import('./chunks/getManifest.js')).getManifestOptions.spa(input, {
300
- errorMap: validationErrorMap
299
+ const result = await (await import('./chunks/get-manifest.js')).getManifestOptions.spa(input, {
300
+ error: validationErrorMap
301
301
  });
302
302
  if (!result.success) {
303
303
  throw new SerwistConfigError({
304
304
  moduleName: "@serwist/build",
305
- message: JSON.stringify(result.error.format(), null, 2)
305
+ message: z.prettifyError(result.error)
306
306
  });
307
307
  }
308
308
  return result.data;
309
309
  };
310
310
  const validateInjectManifestOptions = async (input)=>{
311
- const result = await (await import('./chunks/injectManifest.js').then(function (n) { return n.a; })).injectManifestOptions.spa(input, {
312
- errorMap: validationErrorMap
311
+ const result = await (await import('./chunks/inject-manifest.js').then(function (n) { return n.a; })).injectManifestOptions.spa(input, {
312
+ error: validationErrorMap
313
313
  });
314
314
  if (!result.success) {
315
315
  throw new SerwistConfigError({
316
316
  moduleName: "@serwist/build",
317
- message: JSON.stringify(result.error.format(), null, 2)
317
+ message: z.prettifyError(result.error)
318
318
  });
319
319
  }
320
320
  return result.data;
@@ -402,9 +402,9 @@ async function replaceAndUpdateSourceMap({ jsFilename, originalMap, originalSour
402
402
  }
403
403
 
404
404
  function translateURLToSourcemapPaths(url, swSrc, swDest) {
405
- let destPath = undefined;
406
- let srcPath = undefined;
407
- let warning = undefined;
405
+ let destPath;
406
+ let srcPath;
407
+ let warning;
408
408
  if (url && !url.startsWith("data:")) {
409
409
  const possibleSrcPath = path.resolve(path.dirname(swSrc), url);
410
410
  if (fs.existsSync(possibleSrcPath)) {
@@ -1,13 +1,13 @@
1
- import { type Assignable, type Equals, assertType } from "./schema/assertType.js";
1
+ import { type Assignable, assertType, type Equals } from "./schema/assert-type.js";
2
2
  import { basePartial } from "./schema/base.js";
3
- import { getManifestOptions } from "./schema/getManifest.js";
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/injectManifest.js";
6
- import { manifestEntry } from "./schema/manifestEntry.js";
7
- import { manifestTransform, manifestTransformResult } from "./schema/manifestTransform.js";
8
- import { SerwistConfigError } from "./schema/serwistConfigError.js";
9
- import { optionalSwDestPartial, requiredSwDestPartial } from "./schema/swDest.js";
10
- import { validationErrorMap } from "./schema/validationErrorMap.js";
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,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAC3G,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EACL,UAAU,EACV,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"}
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"}
@@ -1,7 +1,7 @@
1
- export { b as basePartial, g as globPartial, m as manifestEntry, a as manifestTransform, c as manifestTransformResult, o as optionalGlobDirectoryPartial, r as requiredGlobDirectoryPartial } from './chunks/glob.js';
2
- export { getManifestOptions } from './chunks/getManifest.js';
3
- export { i as injectManifestOptions, b as injectPartial, o as optionalSwDestPartial, r as requiredSwDestPartial } from './chunks/injectManifest.js';
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';
4
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":"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,CAuEzE"}
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,GAAU,OAAO,OAAO,KAAG,OAAO,CAAC,0BAA0B,CAMnG,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAU,OAAO,OAAO,KAAG,OAAO,CAAC,6BAA6B,CAMzG,CAAC"}
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=assertType.d.ts.map
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"}
@@ -1,172 +1,66 @@
1
1
  import { z } from "zod";
2
2
  export declare const basePartial: z.ZodObject<{
3
- additionalPrecacheEntries: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
3
+ additionalPrecacheEntries: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
4
4
  integrity: z.ZodOptional<z.ZodString>;
5
5
  revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6
6
  url: z.ZodString;
7
- }, "strict", z.ZodTypeAny, {
8
- url: string;
9
- integrity?: string | undefined;
10
- revision?: string | null | undefined;
11
- }, {
12
- url: string;
13
- integrity?: string | undefined;
14
- revision?: string | null | undefined;
15
- }>]>, "many">>;
7
+ }, z.core.$strict>]>>>;
16
8
  disablePrecacheManifest: z.ZodDefault<z.ZodBoolean>;
17
- dontCacheBustURLsMatching: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
18
- manifestTransforms: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodObject<{
9
+ dontCacheBustURLsMatching: z.ZodOptional<z.ZodCustom<RegExp, RegExp>>;
10
+ manifestTransforms: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodCustom<z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodArray<z.ZodObject<{
11
+ size: z.ZodNumber;
19
12
  integrity: z.ZodOptional<z.ZodString>;
20
13
  revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21
14
  url: z.ZodString;
22
- } & {
23
- size: z.ZodNumber;
24
- }, "strip", z.ZodTypeAny, {
25
- url: string;
26
- size: number;
27
- integrity?: string | undefined;
28
- revision?: string | null | undefined;
29
- }, {
30
- url: string;
31
- size: number;
32
- integrity?: string | undefined;
33
- revision?: string | null | undefined;
34
- }>, "many">, z.ZodOptional<z.ZodUnknown>], null>, z.ZodUnion<[z.ZodPromise<z.ZodObject<{
15
+ }, z.core.$strip>>, z.ZodOptional<z.ZodUnknown>], null>, z.ZodObject<{
35
16
  manifest: z.ZodArray<z.ZodObject<{
17
+ size: z.ZodNumber;
36
18
  integrity: z.ZodOptional<z.ZodString>;
37
19
  revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
38
20
  url: z.ZodString;
39
- } & {
21
+ }, z.core.$strip>>;
22
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
23
+ }, z.core.$strict>>, z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodArray<z.ZodObject<{
24
+ size: z.ZodNumber;
25
+ integrity: z.ZodOptional<z.ZodString>;
26
+ revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ url: z.ZodString;
28
+ }, z.core.$strip>>, z.ZodOptional<z.ZodUnknown>], null>, z.ZodObject<{
29
+ manifest: z.ZodArray<z.ZodObject<{
40
30
  size: z.ZodNumber;
41
- }, "strip", z.ZodTypeAny, {
42
- url: string;
43
- size: number;
44
- integrity?: string | undefined;
45
- revision?: string | null | undefined;
46
- }, {
47
- url: string;
48
- size: number;
49
- integrity?: string | undefined;
50
- revision?: string | null | undefined;
51
- }>, "many">;
52
- warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
53
- }, "strict", z.ZodTypeAny, {
54
- manifest: {
55
- url: string;
56
- size: number;
57
- integrity?: string | undefined;
58
- revision?: string | null | undefined;
59
- }[];
60
- warnings?: string[] | undefined;
61
- }, {
62
- manifest: {
63
- url: string;
64
- size: number;
65
- integrity?: string | undefined;
66
- revision?: string | null | undefined;
67
- }[];
68
- warnings?: string[] | undefined;
69
- }>>, z.ZodObject<{
31
+ integrity: z.ZodOptional<z.ZodString>;
32
+ revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
+ url: z.ZodString;
34
+ }, z.core.$strip>>;
35
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
36
+ }, z.core.$strict>>>, z.ZodTransform<z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodArray<z.ZodObject<{
37
+ size: z.ZodNumber;
38
+ integrity: z.ZodOptional<z.ZodString>;
39
+ revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
40
+ url: z.ZodString;
41
+ }, z.core.$strip>>, z.ZodOptional<z.ZodUnknown>], null>, z.ZodObject<{
70
42
  manifest: z.ZodArray<z.ZodObject<{
43
+ size: z.ZodNumber;
71
44
  integrity: z.ZodOptional<z.ZodString>;
72
45
  revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
73
46
  url: z.ZodString;
74
- } & {
47
+ }, z.core.$strip>>;
48
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
49
+ }, z.core.$strict>>, z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodArray<z.ZodObject<{
50
+ size: z.ZodNumber;
51
+ integrity: z.ZodOptional<z.ZodString>;
52
+ revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
+ url: z.ZodString;
54
+ }, z.core.$strip>>, z.ZodOptional<z.ZodUnknown>], null>, z.ZodObject<{
55
+ manifest: z.ZodArray<z.ZodObject<{
75
56
  size: z.ZodNumber;
76
- }, "strip", z.ZodTypeAny, {
77
- url: string;
78
- size: number;
79
- integrity?: string | undefined;
80
- revision?: string | null | undefined;
81
- }, {
82
- url: string;
83
- size: number;
84
- integrity?: string | undefined;
85
- revision?: string | null | undefined;
86
- }>, "many">;
87
- warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
88
- }, "strict", z.ZodTypeAny, {
89
- manifest: {
90
- url: string;
91
- size: number;
92
- integrity?: string | undefined;
93
- revision?: string | null | undefined;
94
- }[];
95
- warnings?: string[] | undefined;
96
- }, {
97
- manifest: {
98
- url: string;
99
- size: number;
100
- integrity?: string | undefined;
101
- revision?: string | null | undefined;
102
- }[];
103
- warnings?: string[] | undefined;
104
- }>]>>, "many">>;
57
+ integrity: z.ZodOptional<z.ZodString>;
58
+ revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
59
+ url: z.ZodString;
60
+ }, z.core.$strip>>;
61
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
62
+ }, z.core.$strict>>>>>>;
105
63
  maximumFileSizeToCacheInBytes: z.ZodDefault<z.ZodNumber>;
106
64
  modifyURLPrefix: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
107
- }, "strict", z.ZodTypeAny, {
108
- disablePrecacheManifest: boolean;
109
- maximumFileSizeToCacheInBytes: number;
110
- additionalPrecacheEntries?: (string | {
111
- url: string;
112
- integrity?: string | undefined;
113
- revision?: string | null | undefined;
114
- })[] | undefined;
115
- dontCacheBustURLsMatching?: RegExp | undefined;
116
- manifestTransforms?: ((args_0: {
117
- url: string;
118
- size: number;
119
- integrity?: string | undefined;
120
- revision?: string | null | undefined;
121
- }[], args_1: unknown) => {
122
- manifest: {
123
- url: string;
124
- size: number;
125
- integrity?: string | undefined;
126
- revision?: string | null | undefined;
127
- }[];
128
- warnings?: string[] | undefined;
129
- } | Promise<{
130
- manifest: {
131
- url: string;
132
- size: number;
133
- integrity?: string | undefined;
134
- revision?: string | null | undefined;
135
- }[];
136
- warnings?: string[] | undefined;
137
- }>)[] | undefined;
138
- modifyURLPrefix?: Record<string, string> | undefined;
139
- }, {
140
- disablePrecacheManifest?: boolean | undefined;
141
- maximumFileSizeToCacheInBytes?: number | undefined;
142
- additionalPrecacheEntries?: (string | {
143
- url: string;
144
- integrity?: string | undefined;
145
- revision?: string | null | undefined;
146
- })[] | undefined;
147
- dontCacheBustURLsMatching?: RegExp | undefined;
148
- manifestTransforms?: ((args_0: {
149
- url: string;
150
- size: number;
151
- integrity?: string | undefined;
152
- revision?: string | null | undefined;
153
- }[], args_1: unknown) => {
154
- manifest: {
155
- url: string;
156
- size: number;
157
- integrity?: string | undefined;
158
- revision?: string | null | undefined;
159
- }[];
160
- warnings?: string[] | undefined;
161
- } | Promise<{
162
- manifest: {
163
- url: string;
164
- size: number;
165
- integrity?: string | undefined;
166
- revision?: string | null | undefined;
167
- }[];
168
- warnings?: string[] | undefined;
169
- }>)[] | undefined;
170
- modifyURLPrefix?: Record<string, string> | undefined;
171
- }>;
65
+ }, z.core.$strict>;
172
66
  //# sourceMappingURL=base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/schema/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASmC,CAAC"}
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/schema/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAOtB,CAAC"}
@@ -1,7 +1,9 @@
1
+ import type { z } from "zod";
1
2
  export declare class SerwistConfigError extends Error {
2
3
  constructor({ moduleName, message }: {
3
4
  moduleName?: string;
4
5
  message?: string;
5
6
  });
6
7
  }
7
- //# sourceMappingURL=serwistConfigError.d.ts.map
8
+ export declare const validationErrorMap: z.core.$ZodErrorMap;
9
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/schema/error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;CAI/E;AAyBD,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,IAAI,CAAC,YAoBvC,CAAC"}