@serwist/build 8.4.3 → 9.0.0-preview.0

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 (125) hide show
  1. package/dist/chunks/getManifest.js +6 -0
  2. package/dist/chunks/glob.js +60 -0
  3. package/dist/chunks/injectManifest.js +23 -0
  4. package/dist/chunks/serwist-config-error.js +57 -0
  5. package/dist/chunks/vite.js +7 -0
  6. package/dist/chunks/webpack.js +34 -0
  7. package/dist/get-manifest.d.ts +2 -1
  8. package/dist/get-manifest.d.ts.map +1 -0
  9. package/dist/index.d.ts +2 -1
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +53 -813
  12. package/dist/index.next.d.ts +3 -0
  13. package/dist/index.next.d.ts.map +1 -0
  14. package/dist/index.next.js +35 -0
  15. package/dist/inject-manifest.d.ts +2 -1
  16. package/dist/inject-manifest.d.ts.map +1 -0
  17. package/dist/lib/additional-precache-entries-transform.d.ts +6 -5
  18. package/dist/lib/additional-precache-entries-transform.d.ts.map +1 -0
  19. package/dist/lib/errors.d.ts +1 -2
  20. package/dist/lib/errors.d.ts.map +1 -0
  21. package/dist/lib/escape-regexp.d.ts +2 -1
  22. package/dist/lib/escape-regexp.d.ts.map +1 -0
  23. package/dist/lib/get-composite-details.d.ts +2 -1
  24. package/dist/lib/get-composite-details.d.ts.map +1 -0
  25. package/dist/lib/get-file-details.d.ts +2 -1
  26. package/dist/lib/get-file-details.d.ts.map +1 -0
  27. package/dist/lib/get-file-hash.d.ts +1 -0
  28. package/dist/lib/get-file-hash.d.ts.map +1 -0
  29. package/dist/lib/get-file-manifest-entries.d.ts +1 -0
  30. package/dist/lib/get-file-manifest-entries.d.ts.map +1 -0
  31. package/dist/lib/get-file-size.d.ts +1 -0
  32. package/dist/lib/get-file-size.d.ts.map +1 -0
  33. package/dist/lib/get-source-map-url.d.ts +1 -0
  34. package/dist/lib/get-source-map-url.d.ts.map +1 -0
  35. package/dist/lib/get-string-details.d.ts +1 -0
  36. package/dist/lib/get-string-details.d.ts.map +1 -0
  37. package/dist/lib/get-string-hash.d.ts +1 -0
  38. package/dist/lib/get-string-hash.d.ts.map +1 -0
  39. package/dist/lib/maximum-size-transform.d.ts +1 -0
  40. package/dist/lib/maximum-size-transform.d.ts.map +1 -0
  41. package/dist/lib/modify-url-prefix-transform.d.ts +1 -0
  42. package/dist/lib/modify-url-prefix-transform.d.ts.map +1 -0
  43. package/dist/lib/no-revision-for-urls-matching-transform.d.ts +1 -0
  44. package/dist/lib/no-revision-for-urls-matching-transform.d.ts.map +1 -0
  45. package/dist/lib/rebase-path.d.ts +1 -0
  46. package/dist/lib/rebase-path.d.ts.map +1 -0
  47. package/dist/lib/replace-and-update-source-map.d.ts +1 -0
  48. package/dist/lib/replace-and-update-source-map.d.ts.map +1 -0
  49. package/dist/lib/serwist-config-error.d.ts +7 -0
  50. package/dist/lib/serwist-config-error.d.ts.map +1 -0
  51. package/dist/lib/transform-manifest.d.ts +2 -1
  52. package/dist/lib/transform-manifest.d.ts.map +1 -0
  53. package/dist/lib/translate-url-to-sourcemap-paths.d.ts +1 -0
  54. package/dist/lib/translate-url-to-sourcemap-paths.d.ts.map +1 -0
  55. package/dist/lib/validate-next-options.d.ts +3 -0
  56. package/dist/lib/validate-next-options.d.ts.map +1 -0
  57. package/dist/lib/validate-options.d.ts +6 -8
  58. package/dist/lib/validate-options.d.ts.map +1 -0
  59. package/dist/schema/base.d.ts +169 -0
  60. package/dist/schema/base.d.ts.map +1 -0
  61. package/dist/schema/getManifest.d.ts +187 -0
  62. package/dist/schema/getManifest.d.ts.map +1 -0
  63. package/dist/schema/glob.d.ts +35 -0
  64. package/dist/schema/glob.d.ts.map +1 -0
  65. package/dist/schema/injectManifest.d.ts +206 -0
  66. package/dist/schema/injectManifest.d.ts.map +1 -0
  67. package/dist/schema/manifestEntry.d.ts +15 -0
  68. package/dist/schema/manifestEntry.d.ts.map +1 -0
  69. package/dist/schema/manifestTransform.d.ts +121 -0
  70. package/dist/schema/manifestTransform.d.ts.map +1 -0
  71. package/dist/schema/next.d.ts +243 -0
  72. package/dist/schema/next.d.ts.map +1 -0
  73. package/dist/schema/swDest.d.ts +16 -0
  74. package/dist/schema/swDest.d.ts.map +1 -0
  75. package/dist/schema/validationErrorMap.d.ts +3 -0
  76. package/dist/schema/validationErrorMap.d.ts.map +1 -0
  77. package/dist/schema/vite.d.ts +196 -0
  78. package/dist/schema/vite.d.ts.map +1 -0
  79. package/dist/schema/webpack.d.ts +231 -0
  80. package/dist/schema/webpack.d.ts.map +1 -0
  81. package/dist/types.d.ts +147 -175
  82. package/dist/types.d.ts.map +1 -0
  83. package/package.json +42 -28
  84. package/src/_types.js +112 -0
  85. package/src/get-manifest.ts +33 -0
  86. package/src/index.next.ts +3 -0
  87. package/{dist/index.d.cts → src/index.ts} +27 -2
  88. package/src/inject-manifest.ts +140 -0
  89. package/src/lib/additional-precache-entries-transform.ts +58 -0
  90. package/src/lib/errors.ts +99 -0
  91. package/src/lib/escape-regexp.ts +12 -0
  92. package/src/lib/get-composite-details.ts +31 -0
  93. package/src/lib/get-file-details.ts +68 -0
  94. package/src/lib/get-file-hash.ts +21 -0
  95. package/src/lib/get-file-manifest-entries.ts +126 -0
  96. package/src/lib/get-file-size.ts +23 -0
  97. package/src/lib/get-source-map-url.ts +17 -0
  98. package/src/lib/get-string-details.ts +18 -0
  99. package/src/lib/get-string-hash.ts +15 -0
  100. package/src/lib/maximum-size-transform.ts +29 -0
  101. package/src/lib/modify-url-prefix-transform.ts +55 -0
  102. package/src/lib/no-revision-for-urls-matching-transform.ts +32 -0
  103. package/src/lib/rebase-path.ts +22 -0
  104. package/src/lib/replace-and-update-source-map.ts +122 -0
  105. package/src/lib/serwist-config-error.ts +6 -0
  106. package/src/lib/transform-manifest.ts +158 -0
  107. package/src/lib/translate-url-to-sourcemap-paths.ts +38 -0
  108. package/src/lib/validate-next-options.ts +14 -0
  109. package/src/lib/validate-options.ts +47 -0
  110. package/src/schema/base.ts +16 -0
  111. package/src/schema/getManifest.ts +14 -0
  112. package/src/schema/glob.ts +41 -0
  113. package/src/schema/injectManifest.ts +23 -0
  114. package/src/schema/manifestEntry.ts +9 -0
  115. package/src/schema/manifestTransform.ts +15 -0
  116. package/src/schema/next.ts +35 -0
  117. package/src/schema/swDest.ts +14 -0
  118. package/src/schema/validationErrorMap.ts +36 -0
  119. package/src/schema/vite.ts +18 -0
  120. package/src/schema/webpack.ts +47 -0
  121. package/src/types.ts +407 -0
  122. package/dist/index.cjs +0 -1632
  123. package/dist/lib/cdn-utils.d.ts +0 -1
  124. package/dist/lib/copy-serwist-libraries.d.ts +0 -16
  125. package/dist/schema/index.d.ts +0 -605
@@ -1 +0,0 @@
1
- export {};
@@ -1,16 +0,0 @@
1
- /**
2
- * This copies over a set of runtime libraries used by Serwist into a
3
- * local directory, which should be deployed alongside your service worker file.
4
- *
5
- * As an alternative to deploying these local copies, you could instead use
6
- * Serwist from its official CDN URL.
7
- *
8
- * This method is exposed for the benefit of developers using
9
- * `@serwist/build.injectManifest` who would
10
- * prefer not to use the CDN copies of Serwist.
11
- *
12
- * @param destDirectory The path to the parent directory under which
13
- * the new directory of libraries will be created.
14
- * @returns The name of the newly created directory.
15
- */
16
- export declare function copySerwistLibraries(destDirectory: string): Promise<string>;
@@ -1,605 +0,0 @@
1
- export declare const optionsSchemas: {
2
- GetManifest: {
3
- additionalProperties: boolean;
4
- type: string;
5
- properties: {
6
- additionalPrecacheEntries: {
7
- description: string;
8
- type: string;
9
- items: {
10
- anyOf: ({
11
- $ref: string;
12
- type?: undefined;
13
- } | {
14
- type: string;
15
- $ref?: undefined;
16
- })[];
17
- };
18
- };
19
- dontCacheBustURLsMatching: {
20
- description: string;
21
- $ref: string;
22
- };
23
- manifestTransforms: {
24
- description: string;
25
- type: string;
26
- items: {};
27
- };
28
- maximumFileSizeToCacheInBytes: {
29
- description: string;
30
- default: number;
31
- type: string;
32
- };
33
- modifyURLPrefix: {
34
- description: string;
35
- type: string;
36
- additionalProperties: {
37
- type: string;
38
- };
39
- };
40
- globFollow: {
41
- description: string;
42
- default: boolean;
43
- type: string;
44
- };
45
- globIgnores: {
46
- description: string;
47
- default: string[];
48
- type: string;
49
- items: {
50
- type: string;
51
- };
52
- };
53
- globPatterns: {
54
- description: string;
55
- default: string[];
56
- type: string;
57
- items: {
58
- type: string;
59
- };
60
- };
61
- globStrict: {
62
- description: string;
63
- default: boolean;
64
- type: string;
65
- };
66
- templatedURLs: {
67
- description: string;
68
- type: string;
69
- additionalProperties: {
70
- anyOf: ({
71
- type: string;
72
- items: {
73
- type: string;
74
- };
75
- } | {
76
- type: string;
77
- items?: undefined;
78
- })[];
79
- };
80
- };
81
- globDirectory: {
82
- description: string;
83
- type: string;
84
- };
85
- };
86
- required: string[];
87
- definitions: {
88
- ManifestEntry: {
89
- type: string;
90
- properties: {
91
- integrity: {
92
- type: string;
93
- };
94
- revision: {
95
- type: string[];
96
- };
97
- url: {
98
- type: string;
99
- };
100
- };
101
- additionalProperties: boolean;
102
- required: string[];
103
- };
104
- RegExp: {
105
- type: string;
106
- properties: {
107
- source: {
108
- type: string;
109
- };
110
- global: {
111
- type: string;
112
- };
113
- ignoreCase: {
114
- type: string;
115
- };
116
- multiline: {
117
- type: string;
118
- };
119
- lastIndex: {
120
- type: string;
121
- };
122
- flags: {
123
- type: string;
124
- };
125
- sticky: {
126
- type: string;
127
- };
128
- unicode: {
129
- type: string;
130
- };
131
- dotAll: {
132
- type: string;
133
- };
134
- };
135
- additionalProperties: boolean;
136
- required: string[];
137
- };
138
- };
139
- $schema: string;
140
- };
141
- InjectManifest: {
142
- additionalProperties: boolean;
143
- type: string;
144
- properties: {
145
- additionalPrecacheEntries: {
146
- description: string;
147
- type: string;
148
- items: {
149
- anyOf: ({
150
- $ref: string;
151
- type?: undefined;
152
- } | {
153
- type: string;
154
- $ref?: undefined;
155
- })[];
156
- };
157
- };
158
- dontCacheBustURLsMatching: {
159
- description: string;
160
- $ref: string;
161
- };
162
- manifestTransforms: {
163
- description: string;
164
- type: string;
165
- items: {};
166
- };
167
- maximumFileSizeToCacheInBytes: {
168
- description: string;
169
- default: number;
170
- type: string;
171
- };
172
- modifyURLPrefix: {
173
- description: string;
174
- type: string;
175
- additionalProperties: {
176
- type: string;
177
- };
178
- };
179
- globFollow: {
180
- description: string;
181
- default: boolean;
182
- type: string;
183
- };
184
- globIgnores: {
185
- description: string;
186
- default: string[];
187
- type: string;
188
- items: {
189
- type: string;
190
- };
191
- };
192
- globPatterns: {
193
- description: string;
194
- default: string[];
195
- type: string;
196
- items: {
197
- type: string;
198
- };
199
- };
200
- globStrict: {
201
- description: string;
202
- default: boolean;
203
- type: string;
204
- };
205
- templatedURLs: {
206
- description: string;
207
- type: string;
208
- additionalProperties: {
209
- anyOf: ({
210
- type: string;
211
- items: {
212
- type: string;
213
- };
214
- } | {
215
- type: string;
216
- items?: undefined;
217
- })[];
218
- };
219
- };
220
- injectionPoint: {
221
- description: string;
222
- default: string;
223
- type: string;
224
- };
225
- swSrc: {
226
- description: string;
227
- type: string;
228
- };
229
- swDest: {
230
- description: string;
231
- type: string;
232
- };
233
- globDirectory: {
234
- description: string;
235
- type: string;
236
- };
237
- disablePrecacheManifest: {
238
- description: string;
239
- default: boolean;
240
- type: string;
241
- };
242
- };
243
- required: string[];
244
- definitions: {
245
- ManifestEntry: {
246
- type: string;
247
- properties: {
248
- integrity: {
249
- type: string;
250
- };
251
- revision: {
252
- type: string[];
253
- };
254
- url: {
255
- type: string;
256
- };
257
- };
258
- additionalProperties: boolean;
259
- required: string[];
260
- };
261
- RegExp: {
262
- type: string;
263
- properties: {
264
- source: {
265
- type: string;
266
- };
267
- global: {
268
- type: string;
269
- };
270
- ignoreCase: {
271
- type: string;
272
- };
273
- multiline: {
274
- type: string;
275
- };
276
- lastIndex: {
277
- type: string;
278
- };
279
- flags: {
280
- type: string;
281
- };
282
- sticky: {
283
- type: string;
284
- };
285
- unicode: {
286
- type: string;
287
- };
288
- dotAll: {
289
- type: string;
290
- };
291
- };
292
- additionalProperties: boolean;
293
- required: string[];
294
- };
295
- };
296
- $schema: string;
297
- };
298
- WebpackInjectManifest: {
299
- additionalProperties: boolean;
300
- type: string;
301
- properties: {
302
- additionalPrecacheEntries: {
303
- description: string;
304
- type: string;
305
- items: {
306
- anyOf: ({
307
- $ref: string;
308
- type?: undefined;
309
- } | {
310
- type: string;
311
- $ref?: undefined;
312
- })[];
313
- };
314
- };
315
- dontCacheBustURLsMatching: {
316
- description: string;
317
- $ref: string;
318
- };
319
- manifestTransforms: {
320
- description: string;
321
- type: string;
322
- items: {};
323
- };
324
- maximumFileSizeToCacheInBytes: {
325
- description: string;
326
- default: number;
327
- type: string;
328
- };
329
- modifyURLPrefix: {
330
- description: string;
331
- type: string;
332
- additionalProperties: {
333
- type: string;
334
- };
335
- };
336
- chunks: {
337
- description: string;
338
- type: string;
339
- items: {
340
- type: string;
341
- };
342
- };
343
- exclude: {
344
- description: string;
345
- type: string;
346
- items: {};
347
- };
348
- excludeChunks: {
349
- description: string;
350
- type: string;
351
- items: {
352
- type: string;
353
- };
354
- };
355
- include: {
356
- description: string;
357
- type: string;
358
- items: {};
359
- };
360
- mode: {
361
- description: string;
362
- type: string[];
363
- };
364
- injectionPoint: {
365
- description: string;
366
- default: string;
367
- type: string;
368
- };
369
- swSrc: {
370
- description: string;
371
- type: string;
372
- };
373
- compileSrc: {
374
- description: string;
375
- default: boolean;
376
- type: string;
377
- };
378
- swDest: {
379
- description: string;
380
- type: string;
381
- };
382
- webpackCompilationPlugins: {
383
- description: string;
384
- type: string;
385
- items: {};
386
- };
387
- disablePrecacheManifest: {
388
- description: string;
389
- default: boolean;
390
- type: string;
391
- };
392
- };
393
- required: string[];
394
- definitions: {
395
- ManifestEntry: {
396
- type: string;
397
- properties: {
398
- integrity: {
399
- type: string;
400
- };
401
- revision: {
402
- type: string[];
403
- };
404
- url: {
405
- type: string;
406
- };
407
- };
408
- additionalProperties: boolean;
409
- required: string[];
410
- };
411
- RegExp: {
412
- type: string;
413
- properties: {
414
- source: {
415
- type: string;
416
- };
417
- global: {
418
- type: string;
419
- };
420
- ignoreCase: {
421
- type: string;
422
- };
423
- multiline: {
424
- type: string;
425
- };
426
- lastIndex: {
427
- type: string;
428
- };
429
- flags: {
430
- type: string;
431
- };
432
- sticky: {
433
- type: string;
434
- };
435
- unicode: {
436
- type: string;
437
- };
438
- dotAll: {
439
- type: string;
440
- };
441
- };
442
- additionalProperties: boolean;
443
- required: string[];
444
- };
445
- };
446
- $schema: string;
447
- };
448
- ViteInjectManifest: {
449
- additionalProperties: boolean;
450
- type: string;
451
- properties: {
452
- additionalPrecacheEntries: {
453
- description: string;
454
- type: string;
455
- items: {
456
- anyOf: ({
457
- $ref: string;
458
- type?: undefined;
459
- } | {
460
- type: string;
461
- $ref?: undefined;
462
- })[];
463
- };
464
- };
465
- dontCacheBustURLsMatching: {
466
- description: string;
467
- $ref: string;
468
- };
469
- manifestTransforms: {
470
- description: string;
471
- type: string;
472
- items: {};
473
- };
474
- maximumFileSizeToCacheInBytes: {
475
- description: string;
476
- default: number;
477
- type: string;
478
- };
479
- modifyURLPrefix: {
480
- description: string;
481
- type: string;
482
- additionalProperties: {
483
- type: string;
484
- };
485
- };
486
- globFollow: {
487
- description: string;
488
- default: boolean;
489
- type: string;
490
- };
491
- globIgnores: {
492
- description: string;
493
- default: string[];
494
- type: string;
495
- items: {
496
- type: string;
497
- };
498
- };
499
- globPatterns: {
500
- description: string;
501
- default: string[];
502
- type: string;
503
- items: {
504
- type: string;
505
- };
506
- };
507
- globStrict: {
508
- description: string;
509
- default: boolean;
510
- type: string;
511
- };
512
- templatedURLs: {
513
- description: string;
514
- type: string;
515
- additionalProperties: {
516
- anyOf: ({
517
- type: string;
518
- items: {
519
- type: string;
520
- };
521
- } | {
522
- type: string;
523
- items?: undefined;
524
- })[];
525
- };
526
- };
527
- injectionPoint: {
528
- description: string;
529
- default: string;
530
- type: string;
531
- };
532
- swSrc: {
533
- description: string;
534
- type: string;
535
- };
536
- swDest: {
537
- description: string;
538
- type: string;
539
- };
540
- globDirectory: {
541
- description: string;
542
- type: string;
543
- };
544
- disablePrecacheManifest: {
545
- description: string;
546
- default: boolean;
547
- type: string;
548
- };
549
- };
550
- required: string[];
551
- definitions: {
552
- ManifestEntry: {
553
- type: string;
554
- properties: {
555
- integrity: {
556
- type: string;
557
- };
558
- revision: {
559
- type: string[];
560
- };
561
- url: {
562
- type: string;
563
- };
564
- };
565
- additionalProperties: boolean;
566
- required: string[];
567
- };
568
- RegExp: {
569
- type: string;
570
- properties: {
571
- source: {
572
- type: string;
573
- };
574
- global: {
575
- type: string;
576
- };
577
- ignoreCase: {
578
- type: string;
579
- };
580
- multiline: {
581
- type: string;
582
- };
583
- lastIndex: {
584
- type: string;
585
- };
586
- flags: {
587
- type: string;
588
- };
589
- sticky: {
590
- type: string;
591
- };
592
- unicode: {
593
- type: string;
594
- };
595
- dotAll: {
596
- type: string;
597
- };
598
- };
599
- additionalProperties: boolean;
600
- required: string[];
601
- };
602
- };
603
- $schema: string;
604
- };
605
- };