@serwist/build 8.0.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.
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/get-manifest.d.ts +19 -0
- package/dist/get-manifest.d.ts.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1295 -0
- package/dist/index.old.cjs +1303 -0
- package/dist/inject-manifest.d.ts +29 -0
- package/dist/inject-manifest.d.ts.map +1 -0
- package/dist/lib/.swcrc.d.ts +7 -0
- package/dist/lib/.swcrc.d.ts.map +1 -0
- package/dist/lib/additional-precache-entries-transform.d.ts +14 -0
- package/dist/lib/additional-precache-entries-transform.d.ts.map +1 -0
- package/dist/lib/bundle.d.ts +12 -0
- package/dist/lib/bundle.d.ts.map +1 -0
- package/dist/lib/cdn-utils.d.ts +2 -0
- package/dist/lib/cdn-utils.d.ts.map +1 -0
- package/dist/lib/copy-serwist-libraries.d.ts +17 -0
- package/dist/lib/copy-serwist-libraries.d.ts.map +1 -0
- package/dist/lib/errors.d.ts +52 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/escape-regexp.d.ts +2 -0
- package/dist/lib/escape-regexp.d.ts.map +1 -0
- package/dist/lib/get-composite-details.d.ts +3 -0
- package/dist/lib/get-composite-details.d.ts.map +1 -0
- package/dist/lib/get-file-details.d.ts +15 -0
- package/dist/lib/get-file-details.d.ts.map +1 -0
- package/dist/lib/get-file-hash.d.ts +2 -0
- package/dist/lib/get-file-hash.d.ts.map +1 -0
- package/dist/lib/get-file-manifest-entries.d.ts +3 -0
- package/dist/lib/get-file-manifest-entries.d.ts.map +1 -0
- package/dist/lib/get-file-size.d.ts +2 -0
- package/dist/lib/get-file-size.d.ts.map +1 -0
- package/dist/lib/get-source-map-url.d.ts +2 -0
- package/dist/lib/get-source-map-url.d.ts.map +1 -0
- package/dist/lib/get-string-details.d.ts +3 -0
- package/dist/lib/get-string-details.d.ts.map +1 -0
- package/dist/lib/get-string-hash.d.ts +4 -0
- package/dist/lib/get-string-hash.d.ts.map +1 -0
- package/dist/lib/maximum-size-transform.d.ts +3 -0
- package/dist/lib/maximum-size-transform.d.ts.map +1 -0
- package/dist/lib/modify-url-prefix-transform.d.ts +5 -0
- package/dist/lib/modify-url-prefix-transform.d.ts.map +1 -0
- package/dist/lib/no-revision-for-urls-matching-transform.d.ts +3 -0
- package/dist/lib/no-revision-for-urls-matching-transform.d.ts.map +1 -0
- package/dist/lib/rebase-path.d.ts +5 -0
- package/dist/lib/rebase-path.d.ts.map +1 -0
- package/dist/lib/replace-and-update-source-map.d.ts +42 -0
- package/dist/lib/replace-and-update-source-map.d.ts.map +1 -0
- package/dist/lib/stringify-without-comments.d.ts +4 -0
- package/dist/lib/stringify-without-comments.d.ts.map +1 -0
- package/dist/lib/transform-manifest.d.ts +61 -0
- package/dist/lib/transform-manifest.d.ts.map +1 -0
- package/dist/lib/translate-url-to-sourcemap-paths.d.ts +6 -0
- package/dist/lib/translate-url-to-sourcemap-paths.d.ts.map +1 -0
- package/dist/lib/validate-options.d.ts +8 -0
- package/dist/lib/validate-options.d.ts.map +1 -0
- package/dist/schema/index.d.ts +444 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/types.d.ts +530 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +89 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
import type { QueueOptions } from "@serwist/background-sync";
|
|
2
|
+
import type { BroadcastCacheUpdateOptions } from "@serwist/broadcast-update";
|
|
3
|
+
import type { CacheableResponseOptions } from "@serwist/cacheable-response";
|
|
4
|
+
import type { RouteHandler, RouteMatchCallback, SerwistPlugin } from "@serwist/core";
|
|
5
|
+
import type { ExpirationPluginOptions } from "@serwist/expiration";
|
|
6
|
+
import type { GoogleAnalyticsInitializeOptions } from "@serwist/google-analytics/initialize";
|
|
7
|
+
import type { PrecacheRouteOptions } from "@serwist/precaching";
|
|
8
|
+
import type { HTTPMethod } from "@serwist/routing";
|
|
9
|
+
import type { PackageJson } from "type-fest";
|
|
10
|
+
export interface ManifestEntry {
|
|
11
|
+
integrity?: string;
|
|
12
|
+
revision: string | null;
|
|
13
|
+
url: string;
|
|
14
|
+
}
|
|
15
|
+
export type StrategyName = "CacheFirst" | "CacheOnly" | "NetworkFirst" | "NetworkOnly" | "StaleWhileRevalidate";
|
|
16
|
+
export interface RuntimeCaching {
|
|
17
|
+
/**
|
|
18
|
+
* This determines how the runtime route will generate a response.
|
|
19
|
+
* To use one of the built-in `@serwist/strategies`, provide its name,
|
|
20
|
+
* like `'NetworkFirst'`.
|
|
21
|
+
* Alternatively, this can be a `@serwist/core.RouteHandler` callback
|
|
22
|
+
* function with custom response logic.
|
|
23
|
+
*/
|
|
24
|
+
handler: RouteHandler | StrategyName;
|
|
25
|
+
/**
|
|
26
|
+
* The HTTP method to match against. The default value of `'GET'` is normally
|
|
27
|
+
* sufficient, unless you explicitly need to match `'POST'`, `'PUT'`, or
|
|
28
|
+
* another type of request.
|
|
29
|
+
* @default "GET"
|
|
30
|
+
*/
|
|
31
|
+
method?: HTTPMethod;
|
|
32
|
+
options?: {
|
|
33
|
+
/**
|
|
34
|
+
* Configuring this will add a
|
|
35
|
+
* `@serwist/background-sync.BackgroundSyncPlugin` instance to the
|
|
36
|
+
* `@serwist/strategies` configured in `handler`.
|
|
37
|
+
*/
|
|
38
|
+
backgroundSync?: {
|
|
39
|
+
name: string;
|
|
40
|
+
options?: QueueOptions;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Configuring this will add a
|
|
44
|
+
* `@serwist/broadcast-update.BroadcastUpdatePlugin` instance to the
|
|
45
|
+
* `@serwist/strategies` configured in `handler`.
|
|
46
|
+
*/
|
|
47
|
+
broadcastUpdate?: {
|
|
48
|
+
channelName?: string;
|
|
49
|
+
options: BroadcastCacheUpdateOptions;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Configuring this will add a
|
|
53
|
+
* `@serwist/cacheable-response.CacheableResponsePlugin` instance to
|
|
54
|
+
* the `@serwist/strategies` configured in `handler`.
|
|
55
|
+
*/
|
|
56
|
+
cacheableResponse?: CacheableResponseOptions;
|
|
57
|
+
/**
|
|
58
|
+
* If provided, this will set the `cacheName` property of the
|
|
59
|
+
* `@serwist/strategies` configured in `handler`.
|
|
60
|
+
*/
|
|
61
|
+
cacheName?: string | null;
|
|
62
|
+
/**
|
|
63
|
+
* Configuring this will add a
|
|
64
|
+
* `@serwist/expiration.ExpirationPlugin` instance to
|
|
65
|
+
* the `@serwist/strategies` configured in `handler`.
|
|
66
|
+
*/
|
|
67
|
+
expiration?: ExpirationPluginOptions;
|
|
68
|
+
/**
|
|
69
|
+
* If provided, this will set the `networkTimeoutSeconds` property of the
|
|
70
|
+
* `@serwist/strategies` configured in `handler`. Note that only
|
|
71
|
+
* `'NetworkFirst'` and `'NetworkOnly'` support `networkTimeoutSeconds`.
|
|
72
|
+
*/
|
|
73
|
+
networkTimeoutSeconds?: number;
|
|
74
|
+
/**
|
|
75
|
+
* Configuring this allows the use of one or more Serwist plugins that
|
|
76
|
+
* don't have "shortcut" options (like `expiration` for
|
|
77
|
+
* `@serwist/expiration.ExpirationPlugin`). The plugins provided here
|
|
78
|
+
* will be added to the `@serwist/strategies` configured in `handler`.
|
|
79
|
+
*/
|
|
80
|
+
plugins?: Array<SerwistPlugin>;
|
|
81
|
+
/**
|
|
82
|
+
* Configuring this will add a
|
|
83
|
+
* `@serwist/precaching.PrecacheFallbackPlugin` instance to
|
|
84
|
+
* the `@serwist/strategies` configured in `handler`.
|
|
85
|
+
*/
|
|
86
|
+
precacheFallback?: {
|
|
87
|
+
fallbackURL: string;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Enabling this will add a
|
|
91
|
+
* `@serwist/range-requests.RangeRequestsPlugin` instance to
|
|
92
|
+
* the `@serwist/strategies` configured in `handler`.
|
|
93
|
+
*/
|
|
94
|
+
rangeRequests?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Configuring this will pass along the `fetchOptions` value to
|
|
97
|
+
* the `@serwist/strategies` configured in `handler`.
|
|
98
|
+
*/
|
|
99
|
+
fetchOptions?: RequestInit;
|
|
100
|
+
/**
|
|
101
|
+
* Configuring this will pass along the `matchOptions` value to
|
|
102
|
+
* the `@serwist/strategies` configured in `handler`.
|
|
103
|
+
*/
|
|
104
|
+
matchOptions?: CacheQueryOptions;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* This match criteria determines whether the configured handler will
|
|
108
|
+
* generate a response for any requests that don't match one of the precached
|
|
109
|
+
* URLs. If multiple `RuntimeCaching` routes are defined, then the first one
|
|
110
|
+
* whose `urlPattern` matches will be the one that responds.
|
|
111
|
+
*
|
|
112
|
+
* This value directly maps to the first parameter passed to
|
|
113
|
+
* `@serwist/routing.registerRoute`. It's recommended to use a
|
|
114
|
+
* `@serwist/core.RouteMatchCallback` function for greatest flexibility.
|
|
115
|
+
*/
|
|
116
|
+
urlPattern: RegExp | string | RouteMatchCallback;
|
|
117
|
+
}
|
|
118
|
+
export interface ManifestTransformResult {
|
|
119
|
+
manifest: Array<ManifestEntry & {
|
|
120
|
+
size: number;
|
|
121
|
+
}>;
|
|
122
|
+
warnings?: Array<string>;
|
|
123
|
+
}
|
|
124
|
+
export type ManifestTransform = (manifestEntries: Array<ManifestEntry & {
|
|
125
|
+
size: number;
|
|
126
|
+
}>, compilation?: unknown) => Promise<ManifestTransformResult> | ManifestTransformResult;
|
|
127
|
+
export interface BasePartial {
|
|
128
|
+
/**
|
|
129
|
+
* A list of entries to be precached, in addition to any entries that are
|
|
130
|
+
* generated as part of the build configuration.
|
|
131
|
+
*/
|
|
132
|
+
additionalPrecacheEntries?: Array<string | ManifestEntry>;
|
|
133
|
+
/**
|
|
134
|
+
* Assets that match this will be assumed to be uniquely versioned via their
|
|
135
|
+
* URL, and exempted from the normal HTTP cache-busting that's done when
|
|
136
|
+
* populating the precache. While not required, it's recommended that if your
|
|
137
|
+
* existing build process already inserts a `[hash]` value into each filename,
|
|
138
|
+
* you provide a RegExp that will detect that, as it will reduce the bandwidth
|
|
139
|
+
* consumed when precaching.
|
|
140
|
+
*/
|
|
141
|
+
dontCacheBustURLsMatching?: RegExp;
|
|
142
|
+
/**
|
|
143
|
+
* One or more functions which will be applied sequentially against the
|
|
144
|
+
* generated manifest. If `modifyURLPrefix` or `dontCacheBustURLsMatching` are
|
|
145
|
+
* also specified, their corresponding transformations will be applied first.
|
|
146
|
+
*/
|
|
147
|
+
manifestTransforms?: Array<ManifestTransform>;
|
|
148
|
+
/**
|
|
149
|
+
* This value can be used to determine the maximum size of files that will be
|
|
150
|
+
* precached. This prevents you from inadvertently precaching very large files
|
|
151
|
+
* that might have accidentally matched one of your patterns.
|
|
152
|
+
* @default 2097152
|
|
153
|
+
*/
|
|
154
|
+
maximumFileSizeToCacheInBytes?: number;
|
|
155
|
+
/**
|
|
156
|
+
* An object mapping string prefixes to replacement string values. This can be
|
|
157
|
+
* used to, e.g., remove or add a path prefix from a manifest entry if your
|
|
158
|
+
* web hosting setup doesn't match your local filesystem setup. As an
|
|
159
|
+
* alternative with more flexibility, you can use the `manifestTransforms`
|
|
160
|
+
* option and provide a function that modifies the entries in the manifest
|
|
161
|
+
* using whatever logic you provide.
|
|
162
|
+
*
|
|
163
|
+
* Example usage:
|
|
164
|
+
*
|
|
165
|
+
* ```
|
|
166
|
+
* // Replace a '/dist/' prefix with '/', and also prepend
|
|
167
|
+
* // '/static' to every URL.
|
|
168
|
+
* modifyURLPrefix: {
|
|
169
|
+
* '/dist/': '/',
|
|
170
|
+
* '': '/static',
|
|
171
|
+
* }
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
modifyURLPrefix?: {
|
|
175
|
+
[key: string]: string;
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
export interface GeneratePartial {
|
|
179
|
+
/**
|
|
180
|
+
* The [targets](https://babeljs.io/docs/en/babel-preset-env#targets) to pass
|
|
181
|
+
* to `babel-preset-env` when transpiling the service worker bundle.
|
|
182
|
+
* @default ["chrome >= 56"]
|
|
183
|
+
*/
|
|
184
|
+
babelPresetEnvTargets?: Array<string>;
|
|
185
|
+
/**
|
|
186
|
+
* An optional ID to be prepended to cache names. This is primarily useful for
|
|
187
|
+
* local development where multiple sites may be served from the same
|
|
188
|
+
* `http://localhost:port` origin.
|
|
189
|
+
*/
|
|
190
|
+
cacheId?: string | null;
|
|
191
|
+
/**
|
|
192
|
+
* Whether or not Serwist should attempt to identify and delete any precaches
|
|
193
|
+
* created by older, incompatible versions.
|
|
194
|
+
* @default false
|
|
195
|
+
*/
|
|
196
|
+
cleanupOutdatedCaches?: boolean;
|
|
197
|
+
/**
|
|
198
|
+
* Whether or not the service worker should [start controlling](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#clientsclaim)
|
|
199
|
+
* any existing clients as soon as it activates.
|
|
200
|
+
* @default false
|
|
201
|
+
*/
|
|
202
|
+
clientsClaim?: boolean;
|
|
203
|
+
/**
|
|
204
|
+
* If a navigation request for a URL ending in `/` fails to match a precached
|
|
205
|
+
* URL, this value will be appended to the URL and that will be checked for a
|
|
206
|
+
* precache match. This should be set to what your web server is using for its
|
|
207
|
+
* directory index.
|
|
208
|
+
*/
|
|
209
|
+
directoryIndex?: string | null;
|
|
210
|
+
/**
|
|
211
|
+
* @default false
|
|
212
|
+
*/
|
|
213
|
+
disableDevLogs?: boolean;
|
|
214
|
+
/**
|
|
215
|
+
* Any search parameter names that match against one of the RegExp in this
|
|
216
|
+
* array will be removed before looking for a precache match. This is useful
|
|
217
|
+
* if your users might request URLs that contain, for example, URL parameters
|
|
218
|
+
* used to track the source of the traffic. If not provided, the default value
|
|
219
|
+
* is `[/^utm_/, /^fbclid$/]`.
|
|
220
|
+
*
|
|
221
|
+
*/
|
|
222
|
+
ignoreURLParametersMatching?: Array<RegExp>;
|
|
223
|
+
/**
|
|
224
|
+
* A list of JavaScript files that should be passed to
|
|
225
|
+
* [`importScripts()`](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts)
|
|
226
|
+
* inside the generated service worker file. This is useful when you want to
|
|
227
|
+
* let Serwist create your top-level service worker file, but want to include
|
|
228
|
+
* some additional code, such as a push event listener.
|
|
229
|
+
*/
|
|
230
|
+
importScripts?: Array<string>;
|
|
231
|
+
/**
|
|
232
|
+
* If set to 'production', then an optimized service worker bundle that
|
|
233
|
+
* excludes debugging info will be produced. If not explicitly configured
|
|
234
|
+
* here, the `process.env.NODE_ENV` value will be used, and failing that, it
|
|
235
|
+
* will fall back to `'production'`.
|
|
236
|
+
* @default "production"
|
|
237
|
+
*/
|
|
238
|
+
mode?: string | null;
|
|
239
|
+
/**
|
|
240
|
+
* If specified, all
|
|
241
|
+
* [navigation requests](https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests)
|
|
242
|
+
* for URLs that aren't precached will be fulfilled with the HTML at the URL
|
|
243
|
+
* provided. You must pass in the URL of an HTML document that is listed in
|
|
244
|
+
* your precache manifest. This is meant to be used in a Single Page App
|
|
245
|
+
* scenario, in which you want all navigations to use common
|
|
246
|
+
* [App Shell HTML](https://developers.google.com/web/fundamentals/architecture/app-shell).
|
|
247
|
+
* @default null
|
|
248
|
+
*/
|
|
249
|
+
navigateFallback?: string | null;
|
|
250
|
+
/**
|
|
251
|
+
* An optional array of regular expressions that restricts which URLs the
|
|
252
|
+
* configured `navigateFallback` behavior applies to. This is useful if only a
|
|
253
|
+
* subset of your site's URLs should be treated as being part of a
|
|
254
|
+
* [Single Page App](https://en.wikipedia.org/wiki/Single-page_application).
|
|
255
|
+
* If both `navigateFallbackDenylist` and `navigateFallbackAllowlist` are
|
|
256
|
+
* configured, the denylist takes precedent.
|
|
257
|
+
*
|
|
258
|
+
* *Note*: These RegExps may be evaluated against every destination URL during
|
|
259
|
+
* a navigation. Avoid using
|
|
260
|
+
* [complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),
|
|
261
|
+
* or else your users may see delays when navigating your site.
|
|
262
|
+
*/
|
|
263
|
+
navigateFallbackAllowlist?: Array<RegExp>;
|
|
264
|
+
/**
|
|
265
|
+
* An optional array of regular expressions that restricts which URLs the
|
|
266
|
+
* configured `navigateFallback` behavior applies to. This is useful if only a
|
|
267
|
+
* subset of your site's URLs should be treated as being part of a
|
|
268
|
+
* [Single Page App](https://en.wikipedia.org/wiki/Single-page_application).
|
|
269
|
+
* If both `navigateFallbackDenylist` and `navigateFallbackAllowlist` are
|
|
270
|
+
* configured, the denylist takes precedence.
|
|
271
|
+
*
|
|
272
|
+
* *Note*: These RegExps may be evaluated against every destination URL during
|
|
273
|
+
* a navigation. Avoid using
|
|
274
|
+
* [complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077),
|
|
275
|
+
* or else your users may see delays when navigating your site.
|
|
276
|
+
*/
|
|
277
|
+
navigateFallbackDenylist?: Array<RegExp>;
|
|
278
|
+
/**
|
|
279
|
+
* Whether or not to enable
|
|
280
|
+
* [navigation preload](https://developers.google.com/web/tools/workbox/modules/workbox-navigation-preload)
|
|
281
|
+
* in the generated service worker. When set to true, you must also use
|
|
282
|
+
* `runtimeCaching` to set up an appropriate response strategy that will match
|
|
283
|
+
* navigation requests, and make use of the preloaded response.
|
|
284
|
+
* @default false
|
|
285
|
+
*/
|
|
286
|
+
navigationPreload?: boolean;
|
|
287
|
+
/**
|
|
288
|
+
* Controls whether or not to include support for
|
|
289
|
+
* [offline Google Analytics](https://developers.google.com/web/tools/workbox/guides/enable-offline-analytics).
|
|
290
|
+
* When `true`, the call to `workbox-google-analytics`'s `initialize()` will
|
|
291
|
+
* be added to your generated service worker. When set to an `Object`, that
|
|
292
|
+
* object will be passed in to the `initialize()` call, allowing you to
|
|
293
|
+
* customize the behavior.
|
|
294
|
+
* @default false
|
|
295
|
+
*/
|
|
296
|
+
offlineGoogleAnalytics?: boolean | GoogleAnalyticsInitializeOptions;
|
|
297
|
+
/**
|
|
298
|
+
* When using Serwist's build tools to generate your service worker, you can
|
|
299
|
+
* specify one or more runtime caching configurations. These are then
|
|
300
|
+
* translated to `@serwist/routing.registerRoute` calls using the match
|
|
301
|
+
* and handler configuration you define.
|
|
302
|
+
*
|
|
303
|
+
* For all of the options, see the `@serwist/build.RuntimeCaching`
|
|
304
|
+
* documentation. The example below shows a typical configuration, with two
|
|
305
|
+
* runtime routes defined:
|
|
306
|
+
*
|
|
307
|
+
* @example
|
|
308
|
+
* runtimeCaching: [{
|
|
309
|
+
* urlPattern: ({url}) => url.origin === 'https://api.example.com',
|
|
310
|
+
* handler: 'NetworkFirst',
|
|
311
|
+
* options: {
|
|
312
|
+
* cacheName: 'api-cache',
|
|
313
|
+
* },
|
|
314
|
+
* }, {
|
|
315
|
+
* urlPattern: ({request}) => request.destination === 'image',
|
|
316
|
+
* handler: 'StaleWhileRevalidate',
|
|
317
|
+
* options: {
|
|
318
|
+
* cacheName: 'images-cache',
|
|
319
|
+
* expiration: {
|
|
320
|
+
* maxEntries: 10,
|
|
321
|
+
* },
|
|
322
|
+
* },
|
|
323
|
+
* }]
|
|
324
|
+
*/
|
|
325
|
+
runtimeCaching?: Array<RuntimeCaching>;
|
|
326
|
+
/**
|
|
327
|
+
* Whether to add an unconditional call to [`skipWaiting()`](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#skip_the_waiting_phase)
|
|
328
|
+
* to the generated service worker. If `false`, then a `message` listener will
|
|
329
|
+
* be added instead, allowing client pages to trigger `skipWaiting()` by
|
|
330
|
+
* calling `postMessage({type: 'SKIP_WAITING'})` on a waiting service worker.
|
|
331
|
+
* @default false
|
|
332
|
+
*/
|
|
333
|
+
skipWaiting?: boolean;
|
|
334
|
+
/**
|
|
335
|
+
* Whether to create a sourcemap for the generated service worker files.
|
|
336
|
+
* @default true
|
|
337
|
+
*/
|
|
338
|
+
sourcemap?: boolean;
|
|
339
|
+
}
|
|
340
|
+
export interface RequiredGlobDirectoryPartial {
|
|
341
|
+
/**
|
|
342
|
+
* The local directory you wish to match `globPatterns` against. The path is
|
|
343
|
+
* relative to the current directory.
|
|
344
|
+
*/
|
|
345
|
+
globDirectory: string;
|
|
346
|
+
}
|
|
347
|
+
export interface OptionalGlobDirectoryPartial {
|
|
348
|
+
/**
|
|
349
|
+
* The local directory you wish to match `globPatterns` against. The path is
|
|
350
|
+
* relative to the current directory.
|
|
351
|
+
*/
|
|
352
|
+
globDirectory?: string;
|
|
353
|
+
}
|
|
354
|
+
export interface GlobPartial {
|
|
355
|
+
/**
|
|
356
|
+
* Determines whether or not symlinks are followed when generating the
|
|
357
|
+
* precache manifest. For more information, see the definition of `follow` in
|
|
358
|
+
* the `glob` [documentation](https://github.com/isaacs/node-glob#options).
|
|
359
|
+
* @default true
|
|
360
|
+
*/
|
|
361
|
+
globFollow?: boolean;
|
|
362
|
+
/**
|
|
363
|
+
* A set of patterns matching files to always exclude when generating the
|
|
364
|
+
* precache manifest. For more information, see the definition of `ignore` in
|
|
365
|
+
* the `glob` [documentation](https://github.com/isaacs/node-glob#options).
|
|
366
|
+
* @default ["**\/node_modules\/**\/*"]
|
|
367
|
+
*/
|
|
368
|
+
globIgnores?: Array<string>;
|
|
369
|
+
/**
|
|
370
|
+
* Files matching any of these patterns will be included in the precache
|
|
371
|
+
* manifest. For more information, see the
|
|
372
|
+
* [`glob` primer](https://github.com/isaacs/node-glob#glob-primer).
|
|
373
|
+
* @default ["**\/*.{js,css,html}"]
|
|
374
|
+
*/
|
|
375
|
+
globPatterns?: Array<string>;
|
|
376
|
+
/**
|
|
377
|
+
* If true, an error reading a directory when generating a precache manifest
|
|
378
|
+
* will cause the build to fail. If false, the problematic directory will be
|
|
379
|
+
* skipped. For more information, see the definition of `strict` in the `glob`
|
|
380
|
+
* [documentation](https://github.com/isaacs/node-glob#options).
|
|
381
|
+
* @default true
|
|
382
|
+
*/
|
|
383
|
+
globStrict?: boolean;
|
|
384
|
+
/**
|
|
385
|
+
* If a URL is rendered based on some server-side logic, its contents may
|
|
386
|
+
* depend on multiple files or on some other unique string value. The keys in
|
|
387
|
+
* this object are server-rendered URLs. If the values are an array of
|
|
388
|
+
* strings, they will be interpreted as `glob` patterns, and the contents of
|
|
389
|
+
* any files matching the patterns will be used to uniquely version the URL.
|
|
390
|
+
* If used with a single string, it will be interpreted as unique versioning
|
|
391
|
+
* information that you've generated for a given URL.
|
|
392
|
+
*/
|
|
393
|
+
templatedURLs?: {
|
|
394
|
+
[key: string]: string | Array<string>;
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
export interface InjectPartial {
|
|
398
|
+
/**
|
|
399
|
+
* The string to find inside of the `swSrc` file. Once found, it will be
|
|
400
|
+
* replaced by the generated precache manifest.
|
|
401
|
+
* @default "self.__SW_MANIFEST"
|
|
402
|
+
*/
|
|
403
|
+
injectionPoint?: string;
|
|
404
|
+
/**
|
|
405
|
+
* The path to the service worker file that will be read during
|
|
406
|
+
* the build process, relative to the current working directory.
|
|
407
|
+
*/
|
|
408
|
+
swSrc: string;
|
|
409
|
+
}
|
|
410
|
+
export interface WebpackPartial {
|
|
411
|
+
/**
|
|
412
|
+
* One or more chunk names whose corresponding output files should be included
|
|
413
|
+
* in the precache manifest.
|
|
414
|
+
*/
|
|
415
|
+
chunks?: Array<string>;
|
|
416
|
+
/**
|
|
417
|
+
* One or more specifiers used to exclude assets from the precache manifest.
|
|
418
|
+
* This is interpreted following
|
|
419
|
+
* [the same rules](https://webpack.js.org/configuration/module/#condition)
|
|
420
|
+
* as `webpack`'s standard `exclude` option.
|
|
421
|
+
* If not provided, the default value is `[/\.map$/, /^manifest.*\.js$]`.
|
|
422
|
+
*/
|
|
423
|
+
exclude?: Array<string | RegExp | ((arg0: any) => boolean)>;
|
|
424
|
+
/**
|
|
425
|
+
* One or more chunk names whose corresponding output files should be excluded
|
|
426
|
+
* from the precache manifest.
|
|
427
|
+
*/
|
|
428
|
+
excludeChunks?: Array<string>;
|
|
429
|
+
/**
|
|
430
|
+
* One or more specifiers used to include assets in the precache manifest.
|
|
431
|
+
* This is interpreted following
|
|
432
|
+
* [the same rules](https://webpack.js.org/configuration/module/#condition)
|
|
433
|
+
* as `webpack`'s standard `include` option.
|
|
434
|
+
*/
|
|
435
|
+
include?: Array<string | RegExp | ((arg0: any) => boolean)>;
|
|
436
|
+
/**
|
|
437
|
+
* If set to 'production', then an optimized service worker bundle that
|
|
438
|
+
* excludes debugging info will be produced. If not explicitly configured
|
|
439
|
+
* here, the `mode` value configured in the current `webpack` compilation
|
|
440
|
+
* will be used.
|
|
441
|
+
*/
|
|
442
|
+
mode?: string | null;
|
|
443
|
+
}
|
|
444
|
+
export interface RequiredSWDestPartial {
|
|
445
|
+
/**
|
|
446
|
+
* The path and filename of the service worker file that will be created by
|
|
447
|
+
* the build process, relative to the current working directory. It must end
|
|
448
|
+
* in '.js'.
|
|
449
|
+
*/
|
|
450
|
+
swDest: string;
|
|
451
|
+
}
|
|
452
|
+
export interface WebpackInjectManifestPartial {
|
|
453
|
+
/**
|
|
454
|
+
* When `true` (the default), the `swSrc` file will be compiled by `webpack`.
|
|
455
|
+
* When `false`, compilation will not occur (and `webpackCompilationPlugins`
|
|
456
|
+
* can't be used.) Set to `false` if you want to inject the manifest into,
|
|
457
|
+
* e.g., a JSON file.
|
|
458
|
+
* @default true
|
|
459
|
+
*/
|
|
460
|
+
compileSrc?: boolean;
|
|
461
|
+
/**
|
|
462
|
+
* The asset path of the service worker file that will be created by this
|
|
463
|
+
* plugin. If omitted, the path will be based on `swSrc` (not applicable for
|
|
464
|
+
* `@serwist/next`, which requires this value to always be defined).
|
|
465
|
+
*/
|
|
466
|
+
swDest?: string;
|
|
467
|
+
/**
|
|
468
|
+
* Optional `webpack` plugins that will be used when compiling the `swSrc`
|
|
469
|
+
* input file. Only valid if `compileSrc` is `true`.
|
|
470
|
+
*/
|
|
471
|
+
webpackCompilationPlugins?: Array<any>;
|
|
472
|
+
/**
|
|
473
|
+
* Whether the precache manifest should be set to `undefined`.
|
|
474
|
+
* @default false
|
|
475
|
+
*/
|
|
476
|
+
disablePrecacheManifest?: boolean;
|
|
477
|
+
}
|
|
478
|
+
export type GetManifestOptions = BasePartial & GlobPartial & RequiredGlobDirectoryPartial;
|
|
479
|
+
export type InjectManifestOptions = BasePartial & GlobPartial & InjectPartial & RequiredSWDestPartial & RequiredGlobDirectoryPartial;
|
|
480
|
+
export type WebpackInjectManifestOptions = BasePartial & WebpackPartial & InjectPartial & WebpackInjectManifestPartial;
|
|
481
|
+
export interface GetManifestResult {
|
|
482
|
+
count: number;
|
|
483
|
+
manifestEntries: Array<ManifestEntry>;
|
|
484
|
+
size: number;
|
|
485
|
+
warnings: Array<string>;
|
|
486
|
+
}
|
|
487
|
+
export type BuildResult = Omit<GetManifestResult, "manifestEntries"> & {
|
|
488
|
+
filePaths: Array<string>;
|
|
489
|
+
};
|
|
490
|
+
/**
|
|
491
|
+
* @private
|
|
492
|
+
*/
|
|
493
|
+
export interface FileDetails {
|
|
494
|
+
file: string;
|
|
495
|
+
hash: string;
|
|
496
|
+
size: number;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* @private
|
|
500
|
+
*/
|
|
501
|
+
export type BuildType = "dev" | "prod";
|
|
502
|
+
/**
|
|
503
|
+
* @private
|
|
504
|
+
*/
|
|
505
|
+
export type SerwistPackageJSON = PackageJson;
|
|
506
|
+
/**
|
|
507
|
+
* @private
|
|
508
|
+
*/
|
|
509
|
+
export type MethodNames = "GetManifest" | "InjectManifest" | "WebpackInjectManifest";
|
|
510
|
+
/**
|
|
511
|
+
* @private
|
|
512
|
+
*/
|
|
513
|
+
export interface SerwistSWTemplateOptions {
|
|
514
|
+
shouldSkipWaiting: boolean;
|
|
515
|
+
scriptsToImport?: string[];
|
|
516
|
+
navigationPreload: boolean;
|
|
517
|
+
cacheId: string | undefined;
|
|
518
|
+
shouldClientsClaim: boolean;
|
|
519
|
+
shouldRunPrecacheAndRoute: boolean;
|
|
520
|
+
manifestEntries: ManifestEntry[];
|
|
521
|
+
precacheOptions: PrecacheRouteOptions;
|
|
522
|
+
shouldCleanupOutdatedCaches: boolean;
|
|
523
|
+
navigateFallback: string | undefined;
|
|
524
|
+
navigateFallbackAllowlist: RegExp[];
|
|
525
|
+
navigateFallbackDenylist: RegExp[];
|
|
526
|
+
offlineAnalyticsConfig?: boolean | GoogleAnalyticsInitializeOptions;
|
|
527
|
+
disableDevLogs: boolean;
|
|
528
|
+
runtimeCaching: RuntimeCaching[];
|
|
529
|
+
}
|
|
530
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sCAAsC,CAAC;AAC7F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,WAAW,GAAG,cAAc,GAAG,aAAa,GAAG,sBAAsB,CAAC;AAEhH,MAAM,WAAW,cAA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,MAAM,WAAW,GAAG,IAAI,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,GAAG;IACrE,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,gBAAgB,GAAG,uBAAuB,CAAC;AAErF;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,yBAAyB,EAAE,OAAO,CAAC;IACnC,eAAe,EAAE,aAAa,EAAE,CAAC;IACjC,eAAe,EAAE,oBAAoB,CAAC;IACtC,2BAA2B,EAAE,OAAO,CAAC;IACrC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,yBAAyB,EAAE,MAAM,EAAE,CAAC;IACpC,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,sBAAsB,CAAC,EAAE,OAAO,GAAG,gCAAgC,CAAC;IACpE,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,cAAc,EAAE,CAAC;CAClC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@serwist/build",
|
|
3
|
+
"version": "8.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "A module that integrates into your build process, helping you generate a manifest of local files that should be precached.",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"!dist/**/dts"
|
|
9
|
+
],
|
|
10
|
+
"keywords": [
|
|
11
|
+
"serwist",
|
|
12
|
+
"serwistjs",
|
|
13
|
+
"service worker",
|
|
14
|
+
"caching",
|
|
15
|
+
"fetch requests",
|
|
16
|
+
"offline",
|
|
17
|
+
"file manifest"
|
|
18
|
+
],
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=16.0.0"
|
|
21
|
+
},
|
|
22
|
+
"author": "Google's Web DevRel Team, Serwist's Team",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"repository": "serwist/serwist",
|
|
25
|
+
"bugs": "https://github.com/serwist/serwist/issues",
|
|
26
|
+
"homepage": "https://ducanh-next-pwa.vercel.app",
|
|
27
|
+
"module": "./dist/index.js",
|
|
28
|
+
"main": "./dist/index.old.cjs",
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"import": "./dist/index.js",
|
|
33
|
+
"require": "./dist/index.old.cjs",
|
|
34
|
+
"types": "./dist/index.d.ts"
|
|
35
|
+
},
|
|
36
|
+
"./package.json": "./package.json"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@apideck/better-ajv-errors": "0.3.6",
|
|
40
|
+
"@babel/core": "7.23.2",
|
|
41
|
+
"@babel/preset-env": "7.23.2",
|
|
42
|
+
"@babel/runtime": "7.23.2",
|
|
43
|
+
"@rollup/plugin-commonjs": "25.0.7",
|
|
44
|
+
"@rollup/plugin-node-resolve": "15.2.3",
|
|
45
|
+
"@rollup/plugin-replace": "5.0.4",
|
|
46
|
+
"@rollup/plugin-swc": "0.2.1",
|
|
47
|
+
"@swc/core": "1.3.93",
|
|
48
|
+
"ajv": "8.12.0",
|
|
49
|
+
"common-tags": "1.8.2",
|
|
50
|
+
"devalue": "4.3.2",
|
|
51
|
+
"fast-json-stable-stringify": "2.1.0",
|
|
52
|
+
"fs-extra": "11.1.1",
|
|
53
|
+
"fsevents": "2.3.3",
|
|
54
|
+
"glob": "10.3.10",
|
|
55
|
+
"lodash": "4.17.21",
|
|
56
|
+
"pretty-bytes": "6.1.1",
|
|
57
|
+
"rollup": "3.28.1",
|
|
58
|
+
"source-map": "0.8.0-beta.0",
|
|
59
|
+
"stringify-object": "5.0.0",
|
|
60
|
+
"strip-comments": "2.0.1",
|
|
61
|
+
"tempy": "3.1.0",
|
|
62
|
+
"upath": "2.0.1",
|
|
63
|
+
"@serwist/background-sync": "8.0.0",
|
|
64
|
+
"@serwist/broadcast-update": "8.0.0",
|
|
65
|
+
"@serwist/cacheable-response": "8.0.0",
|
|
66
|
+
"@serwist/core": "8.0.0",
|
|
67
|
+
"@serwist/expiration": "8.0.0",
|
|
68
|
+
"@serwist/google-analytics": "8.0.0",
|
|
69
|
+
"@serwist/precaching": "8.0.0",
|
|
70
|
+
"@serwist/routing": "8.0.0"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@types/babel__preset-env": "7.9.4",
|
|
74
|
+
"@types/common-tags": "1.8.3",
|
|
75
|
+
"@types/fs-extra": "11.0.2",
|
|
76
|
+
"@types/lodash": "4.14.200",
|
|
77
|
+
"@types/node": "20.8.7",
|
|
78
|
+
"@types/stringify-object": "4.0.3",
|
|
79
|
+
"@types/strip-comments": "2.0.3",
|
|
80
|
+
"@types/surma__rollup-plugin-off-main-thread": "2.2.2",
|
|
81
|
+
"type-fest": "4.4.0",
|
|
82
|
+
"@serwist/constants": "8.0.0"
|
|
83
|
+
},
|
|
84
|
+
"scripts": {
|
|
85
|
+
"build": "rimraf dist && cross-env NODE_OPTIONS='--max-old-space-size=4096' NODE_ENV=production rollup --config rollup.config.js",
|
|
86
|
+
"lint": "eslint src --ext ts,tsx,js,jsx,cjs,mjs",
|
|
87
|
+
"typecheck": "tsc"
|
|
88
|
+
}
|
|
89
|
+
}
|