@serwist/next 9.0.0-preview.8 → 9.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/dist/chunks/schema.js +20 -0
- package/dist/index.d.ts +10 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -36
- package/dist/index.schema.d.ts +3 -0
- package/dist/index.schema.d.ts.map +1 -0
- package/dist/index.schema.js +4 -0
- package/dist/index.worker.js +28 -17
- package/dist/lib/find-first-truthy.d.ts.map +1 -0
- package/dist/lib/get-content-hash.d.ts.map +1 -0
- package/dist/lib/get-file-hash.d.ts.map +1 -0
- package/dist/lib/get-package-version.d.ts.map +1 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/load-tsconfig.d.ts.map +1 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/schema.d.ts +240 -0
- package/dist/lib/schema.d.ts.map +1 -0
- package/dist/lib/types.d.ts +95 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/validator.d.ts +3 -0
- package/dist/lib/validator.d.ts.map +1 -0
- package/dist/worker/defaultCache.d.ts +8 -14
- package/dist/worker/defaultCache.d.ts.map +1 -1
- package/package.json +24 -26
- package/src/index.schema.ts +3 -0
- package/src/index.ts +37 -41
- package/src/lib/schema.ts +21 -0
- package/src/lib/types.ts +104 -0
- package/src/lib/validator.ts +13 -0
- package/src/worker/defaultCache.ts +264 -241
- package/dist/utils/find-first-truthy.d.ts.map +0 -1
- package/dist/utils/get-content-hash.d.ts.map +0 -1
- package/dist/utils/get-file-hash.d.ts.map +0 -1
- package/dist/utils/get-package-version.d.ts.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/load-tsconfig.d.ts.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- /package/dist/{utils → lib}/find-first-truthy.d.ts +0 -0
- /package/dist/{utils → lib}/get-content-hash.d.ts +0 -0
- /package/dist/{utils → lib}/get-file-hash.d.ts +0 -0
- /package/dist/{utils → lib}/get-package-version.d.ts +0 -0
- /package/dist/{utils → lib}/index.d.ts +0 -0
- /package/dist/{utils → lib}/load-tsconfig.d.ts +0 -0
- /package/dist/{utils → lib}/logger.d.ts +0 -0
- /package/src/{utils → lib}/find-first-truthy.ts +0 -0
- /package/src/{utils → lib}/get-content-hash.ts +0 -0
- /package/src/{utils → lib}/get-file-hash.ts +0 -0
- /package/src/{utils → lib}/get-package-version.ts +0 -0
- /package/src/{utils → lib}/index.ts +0 -0
- /package/src/{utils → lib}/load-tsconfig.ts +0 -0
- /package/src/{utils → lib}/logger.ts +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { requiredSwDestPartial } from '@serwist/build/schema';
|
|
2
|
+
import { injectManifestOptions as injectManifestOptions$1 } from '@serwist/webpack-plugin/schema';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
const injectPartial = z.object({
|
|
6
|
+
cacheOnNavigation: z.boolean().default(false),
|
|
7
|
+
disable: z.boolean().default(false),
|
|
8
|
+
register: z.boolean().default(true),
|
|
9
|
+
reloadOnOnline: z.boolean().default(true),
|
|
10
|
+
scope: z.string().optional(),
|
|
11
|
+
swUrl: z.string().default("/sw.js"),
|
|
12
|
+
globPublicPatterns: z.array(z.string()).default([
|
|
13
|
+
"**/*"
|
|
14
|
+
])
|
|
15
|
+
}).strict("Do not pass invalid properties to NextInjectManifestPartial!");
|
|
16
|
+
const injectManifestOptions = injectManifestOptions$1.merge(requiredSwDestPartial).merge(injectPartial).omit({
|
|
17
|
+
disablePrecacheManifest: true
|
|
18
|
+
}).strict("Do not pass invalid properties to NextInjectManifestOptions!");
|
|
19
|
+
|
|
20
|
+
export { injectManifestOptions as a, injectPartial as i };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import type { NextInjectManifestOptions } from "@serwist/build";
|
|
2
1
|
import type { NextConfig } from "next";
|
|
3
|
-
|
|
2
|
+
import type { InjectManifestOptions, InjectManifestOptionsComplete } from "./lib/types.js";
|
|
3
|
+
import { validateInjectManifestOptions } from "./lib/validator.js";
|
|
4
|
+
/**
|
|
5
|
+
* Integrates Serwist into your Next.js app.
|
|
6
|
+
* @param userOptions
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
declare const withSerwistInit: (userOptions: InjectManifestOptions) => ((nextConfig?: NextConfig) => NextConfig);
|
|
4
10
|
export default withSerwistInit;
|
|
5
|
-
export
|
|
11
|
+
export { validateInjectManifestOptions };
|
|
12
|
+
export type { InjectManifestOptions as PluginOptions, InjectManifestOptionsComplete as PluginOptionsComplete };
|
|
6
13
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAIvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAInE;;;;GAIG;AACH,QAAA,MAAM,eAAe,gBAAiB,qBAAqB,KAAG,CAAC,CAAC,UAAU,CAAC,EAAE,UAAU,KAAK,UAAU,CAoNrG,CAAC;AAEF,eAAe,eAAe,CAAC;AAC/B,OAAO,EAAE,6BAA6B,EAAE,CAAC;AACzC,YAAY,EAAE,qBAAqB,IAAI,aAAa,EAAE,6BAA6B,IAAI,qBAAqB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
1
2
|
import path from 'node:path';
|
|
2
3
|
import { fileURLToPath } from 'node:url';
|
|
3
|
-
import { validateNextInjectManifestOptions } from '@serwist/build/next';
|
|
4
4
|
import { InjectManifest } from '@serwist/webpack-plugin';
|
|
5
5
|
import { ChildCompilationPlugin, relativeToOutputPath } from '@serwist/webpack-plugin/internal';
|
|
6
|
-
import {
|
|
7
|
-
import fg from 'fast-glob';
|
|
6
|
+
import { globSync } from 'glob';
|
|
8
7
|
import crypto from 'node:crypto';
|
|
9
|
-
import fs from 'node:fs';
|
|
10
8
|
import { createRequire } from 'node:module';
|
|
11
9
|
import chalk from 'chalk';
|
|
10
|
+
import { validationErrorMap, SerwistConfigError } from '@serwist/build/schema';
|
|
11
|
+
import { a as injectManifestOptions } from './chunks/schema.js';
|
|
12
|
+
import '@serwist/webpack-plugin/schema';
|
|
13
|
+
import 'zod';
|
|
12
14
|
|
|
13
15
|
const findFirstTruthy = (arr, fn)=>{
|
|
14
16
|
for (const i of arr){
|
|
@@ -83,8 +85,21 @@ const event = (...message)=>{
|
|
|
83
85
|
prefixedLog("event", ...message);
|
|
84
86
|
};
|
|
85
87
|
|
|
88
|
+
const validateInjectManifestOptions = (input)=>{
|
|
89
|
+
const result = injectManifestOptions.safeParse(input, {
|
|
90
|
+
errorMap: validationErrorMap
|
|
91
|
+
});
|
|
92
|
+
if (!result.success) {
|
|
93
|
+
throw new SerwistConfigError({
|
|
94
|
+
moduleName: "@serwist/next",
|
|
95
|
+
message: JSON.stringify(result.error.format(), null, 2)
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return result.data;
|
|
99
|
+
};
|
|
100
|
+
|
|
86
101
|
const __dirname = fileURLToPath(new URL(".", import.meta.url));
|
|
87
|
-
const withSerwistInit = (
|
|
102
|
+
const withSerwistInit = (userOptions)=>{
|
|
88
103
|
return (nextConfig = {})=>({
|
|
89
104
|
...nextConfig,
|
|
90
105
|
webpack (config, options) {
|
|
@@ -92,7 +107,7 @@ const withSerwistInit = (pluginOptions)=>{
|
|
|
92
107
|
const { dev } = options;
|
|
93
108
|
const basePath = options.config.basePath || "/";
|
|
94
109
|
const tsConfigJson = loadTSConfig(options.dir, nextConfig?.typescript?.tsconfigPath);
|
|
95
|
-
const { cacheOnNavigation, disable, scope = basePath, swUrl, register, reloadOnOnline, globPublicPatterns, ...buildOptions } =
|
|
110
|
+
const { cacheOnNavigation, disable, scope = basePath, swUrl, register, reloadOnOnline, globPublicPatterns, ...buildOptions } = validateInjectManifestOptions(userOptions);
|
|
96
111
|
if (typeof nextConfig.webpack === "function") {
|
|
97
112
|
config = nextConfig.webpack(config, options);
|
|
98
113
|
}
|
|
@@ -103,7 +118,6 @@ const withSerwistInit = (pluginOptions)=>{
|
|
|
103
118
|
if (!config.plugins) {
|
|
104
119
|
config.plugins = [];
|
|
105
120
|
}
|
|
106
|
-
event(`Compiling for ${options.isServer ? "server" : "client (static)"}...`);
|
|
107
121
|
const _sw = path.posix.join(basePath, swUrl);
|
|
108
122
|
const _scope = path.posix.join(scope, "/");
|
|
109
123
|
config.plugins.push(new webpack.DefinePlugin({
|
|
@@ -141,10 +155,9 @@ const withSerwistInit = (pluginOptions)=>{
|
|
|
141
155
|
};
|
|
142
156
|
if (!options.isServer) {
|
|
143
157
|
if (!register) {
|
|
144
|
-
info("
|
|
145
|
-
info(" window.serwist.register()");
|
|
158
|
+
info("The service worker will not be automatically registered, please call 'window.serwist.register()' in 'componentDidMount' or 'useEffect'.");
|
|
146
159
|
if (!tsConfigJson?.compilerOptions?.types?.includes("@serwist/next/typings")) {
|
|
147
|
-
info("You may also want to add @serwist/next/typings to
|
|
160
|
+
info("You may also want to add '@serwist/next/typings' to your TypeScript/JavaScript configuration file at 'compilerOptions.types'.");
|
|
148
161
|
}
|
|
149
162
|
}
|
|
150
163
|
const { swSrc: userSwSrc, swDest: userSwDest, additionalPrecacheEntries, exclude, manifestTransforms = [], ...otherBuildOptions } = buildOptions;
|
|
@@ -157,7 +170,24 @@ const withSerwistInit = (pluginOptions)=>{
|
|
|
157
170
|
swDest = path.join(options.dir, swDest);
|
|
158
171
|
}
|
|
159
172
|
const publicDir = path.resolve(options.dir, "public");
|
|
160
|
-
const destDir = path.
|
|
173
|
+
const { dir: destDir, base: destBase } = path.parse(swDest);
|
|
174
|
+
const cleanUpList = globSync([
|
|
175
|
+
"swe-worker-*.js",
|
|
176
|
+
"swe-worker-*.js.map",
|
|
177
|
+
destBase,
|
|
178
|
+
`${destBase}.map`
|
|
179
|
+
], {
|
|
180
|
+
absolute: true,
|
|
181
|
+
nodir: true,
|
|
182
|
+
cwd: destDir
|
|
183
|
+
});
|
|
184
|
+
for (const file of cleanUpList){
|
|
185
|
+
fs.rm(file, {
|
|
186
|
+
force: true
|
|
187
|
+
}, (err)=>{
|
|
188
|
+
if (err) throw err;
|
|
189
|
+
});
|
|
190
|
+
}
|
|
161
191
|
const shouldBuildSWEntryWorker = cacheOnNavigation;
|
|
162
192
|
let swEntryPublicPath = undefined;
|
|
163
193
|
let swEntryWorkerDest = undefined;
|
|
@@ -174,32 +204,17 @@ const withSerwistInit = (pluginOptions)=>{
|
|
|
174
204
|
config.plugins.push(new webpack.DefinePlugin({
|
|
175
205
|
"self.__SERWIST_SW_ENTRY.swEntryWorker": swEntryPublicPath && `'${swEntryPublicPath}'`
|
|
176
206
|
}));
|
|
177
|
-
|
|
178
|
-
info(` URL: ${_sw}`);
|
|
179
|
-
info(` Scope: ${_scope}`);
|
|
180
|
-
config.plugins.push(new CleanWebpackPlugin({
|
|
181
|
-
cleanOnceBeforeBuildPatterns: [
|
|
182
|
-
path.join(destDir, "swe-worker-*.js"),
|
|
183
|
-
path.join(destDir, "swe-worker-*.js.map"),
|
|
184
|
-
swDest
|
|
185
|
-
]
|
|
186
|
-
}));
|
|
207
|
+
event(`Bundling the service worker script with the URL '${_sw}' and the scope '${_scope}'...`);
|
|
187
208
|
let resolvedManifestEntries = additionalPrecacheEntries;
|
|
188
209
|
if (!resolvedManifestEntries) {
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
"!swe-worker-*.js",
|
|
198
|
-
"!swe-worker-*.js.map",
|
|
199
|
-
`!${swDestFileName.replace(/^\/+/, "")}`,
|
|
200
|
-
`!${swDestFileName.replace(/^\/+/, "")}.map`
|
|
201
|
-
], {
|
|
202
|
-
cwd: publicDir
|
|
210
|
+
const publicScan = globSync(globPublicPatterns, {
|
|
211
|
+
nodir: true,
|
|
212
|
+
cwd: publicDir,
|
|
213
|
+
ignore: [
|
|
214
|
+
"swe-worker-*.js",
|
|
215
|
+
destBase,
|
|
216
|
+
`${destBase}.map`
|
|
217
|
+
]
|
|
203
218
|
});
|
|
204
219
|
resolvedManifestEntries = publicScan.map((f)=>({
|
|
205
220
|
url: path.posix.join(basePath, f),
|
|
@@ -247,4 +262,4 @@ const withSerwistInit = (pluginOptions)=>{
|
|
|
247
262
|
});
|
|
248
263
|
};
|
|
249
264
|
|
|
250
|
-
export { withSerwistInit as default };
|
|
265
|
+
export { withSerwistInit as default, validateInjectManifestOptions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.schema.d.ts","sourceRoot":"","sources":["../src/index.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,CAAC"}
|
package/dist/index.worker.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { ExpirationPlugin } from '
|
|
2
|
-
import { RangeRequestsPlugin } from '@serwist/range-requests';
|
|
3
|
-
import { CacheFirst, StaleWhileRevalidate, NetworkFirst } from '@serwist/strategies';
|
|
1
|
+
import { CacheFirst, ExpirationPlugin, StaleWhileRevalidate, RangeRequestsPlugin, NetworkFirst } from 'serwist';
|
|
4
2
|
|
|
5
3
|
const PAGES_CACHE_NAME = {
|
|
6
4
|
rscPrefetch: "pages-rsc-prefetch",
|
|
@@ -8,7 +6,7 @@ const PAGES_CACHE_NAME = {
|
|
|
8
6
|
html: "pages"
|
|
9
7
|
};
|
|
10
8
|
|
|
11
|
-
const defaultCache = [
|
|
9
|
+
const defaultCache = process.env.NODE_ENV !== "production" ? [] : [
|
|
12
10
|
{
|
|
13
11
|
matcher: /^https:\/\/fonts\.(?:gstatic)\.com\/.*/i,
|
|
14
12
|
handler: new CacheFirst({
|
|
@@ -16,7 +14,8 @@ const defaultCache = [
|
|
|
16
14
|
plugins: [
|
|
17
15
|
new ExpirationPlugin({
|
|
18
16
|
maxEntries: 4,
|
|
19
|
-
maxAgeSeconds: 365 * 24 * 60 * 60
|
|
17
|
+
maxAgeSeconds: 365 * 24 * 60 * 60,
|
|
18
|
+
maxAgeFrom: "last-used"
|
|
20
19
|
})
|
|
21
20
|
]
|
|
22
21
|
})
|
|
@@ -28,7 +27,8 @@ const defaultCache = [
|
|
|
28
27
|
plugins: [
|
|
29
28
|
new ExpirationPlugin({
|
|
30
29
|
maxEntries: 4,
|
|
31
|
-
maxAgeSeconds: 7 * 24 * 60 * 60
|
|
30
|
+
maxAgeSeconds: 7 * 24 * 60 * 60,
|
|
31
|
+
maxAgeFrom: "last-used"
|
|
32
32
|
})
|
|
33
33
|
]
|
|
34
34
|
})
|
|
@@ -40,7 +40,8 @@ const defaultCache = [
|
|
|
40
40
|
plugins: [
|
|
41
41
|
new ExpirationPlugin({
|
|
42
42
|
maxEntries: 4,
|
|
43
|
-
maxAgeSeconds: 7 * 24 * 60 * 60
|
|
43
|
+
maxAgeSeconds: 7 * 24 * 60 * 60,
|
|
44
|
+
maxAgeFrom: "last-used"
|
|
44
45
|
})
|
|
45
46
|
]
|
|
46
47
|
})
|
|
@@ -52,7 +53,8 @@ const defaultCache = [
|
|
|
52
53
|
plugins: [
|
|
53
54
|
new ExpirationPlugin({
|
|
54
55
|
maxEntries: 64,
|
|
55
|
-
maxAgeSeconds: 30 * 24 * 60 * 60
|
|
56
|
+
maxAgeSeconds: 30 * 24 * 60 * 60,
|
|
57
|
+
maxAgeFrom: "last-used"
|
|
56
58
|
})
|
|
57
59
|
]
|
|
58
60
|
})
|
|
@@ -64,7 +66,8 @@ const defaultCache = [
|
|
|
64
66
|
plugins: [
|
|
65
67
|
new ExpirationPlugin({
|
|
66
68
|
maxEntries: 64,
|
|
67
|
-
maxAgeSeconds: 24 * 60 * 60
|
|
69
|
+
maxAgeSeconds: 24 * 60 * 60,
|
|
70
|
+
maxAgeFrom: "last-used"
|
|
68
71
|
})
|
|
69
72
|
]
|
|
70
73
|
})
|
|
@@ -76,7 +79,8 @@ const defaultCache = [
|
|
|
76
79
|
plugins: [
|
|
77
80
|
new ExpirationPlugin({
|
|
78
81
|
maxEntries: 64,
|
|
79
|
-
maxAgeSeconds: 24 * 60 * 60
|
|
82
|
+
maxAgeSeconds: 24 * 60 * 60,
|
|
83
|
+
maxAgeFrom: "last-used"
|
|
80
84
|
})
|
|
81
85
|
]
|
|
82
86
|
})
|
|
@@ -88,7 +92,8 @@ const defaultCache = [
|
|
|
88
92
|
plugins: [
|
|
89
93
|
new ExpirationPlugin({
|
|
90
94
|
maxEntries: 32,
|
|
91
|
-
maxAgeSeconds: 24 * 60 * 60
|
|
95
|
+
maxAgeSeconds: 24 * 60 * 60,
|
|
96
|
+
maxAgeFrom: "last-used"
|
|
92
97
|
}),
|
|
93
98
|
new RangeRequestsPlugin()
|
|
94
99
|
]
|
|
@@ -101,7 +106,8 @@ const defaultCache = [
|
|
|
101
106
|
plugins: [
|
|
102
107
|
new ExpirationPlugin({
|
|
103
108
|
maxEntries: 32,
|
|
104
|
-
maxAgeSeconds: 24 * 60 * 60
|
|
109
|
+
maxAgeSeconds: 24 * 60 * 60,
|
|
110
|
+
maxAgeFrom: "last-used"
|
|
105
111
|
}),
|
|
106
112
|
new RangeRequestsPlugin()
|
|
107
113
|
]
|
|
@@ -114,7 +120,8 @@ const defaultCache = [
|
|
|
114
120
|
plugins: [
|
|
115
121
|
new ExpirationPlugin({
|
|
116
122
|
maxEntries: 48,
|
|
117
|
-
maxAgeSeconds: 24 * 60 * 60
|
|
123
|
+
maxAgeSeconds: 24 * 60 * 60,
|
|
124
|
+
maxAgeFrom: "last-used"
|
|
118
125
|
})
|
|
119
126
|
]
|
|
120
127
|
})
|
|
@@ -126,7 +133,8 @@ const defaultCache = [
|
|
|
126
133
|
plugins: [
|
|
127
134
|
new ExpirationPlugin({
|
|
128
135
|
maxEntries: 32,
|
|
129
|
-
maxAgeSeconds: 24 * 60 * 60
|
|
136
|
+
maxAgeSeconds: 24 * 60 * 60,
|
|
137
|
+
maxAgeFrom: "last-used"
|
|
130
138
|
})
|
|
131
139
|
]
|
|
132
140
|
})
|
|
@@ -138,7 +146,8 @@ const defaultCache = [
|
|
|
138
146
|
plugins: [
|
|
139
147
|
new ExpirationPlugin({
|
|
140
148
|
maxEntries: 32,
|
|
141
|
-
maxAgeSeconds: 24 * 60 * 60
|
|
149
|
+
maxAgeSeconds: 24 * 60 * 60,
|
|
150
|
+
maxAgeFrom: "last-used"
|
|
142
151
|
})
|
|
143
152
|
]
|
|
144
153
|
})
|
|
@@ -150,7 +159,8 @@ const defaultCache = [
|
|
|
150
159
|
plugins: [
|
|
151
160
|
new ExpirationPlugin({
|
|
152
161
|
maxEntries: 32,
|
|
153
|
-
maxAgeSeconds: 24 * 60 * 60
|
|
162
|
+
maxAgeSeconds: 24 * 60 * 60,
|
|
163
|
+
maxAgeFrom: "last-used"
|
|
154
164
|
})
|
|
155
165
|
]
|
|
156
166
|
})
|
|
@@ -171,7 +181,8 @@ const defaultCache = [
|
|
|
171
181
|
plugins: [
|
|
172
182
|
new ExpirationPlugin({
|
|
173
183
|
maxEntries: 16,
|
|
174
|
-
maxAgeSeconds: 24 * 60 * 60
|
|
184
|
+
maxAgeSeconds: 24 * 60 * 60,
|
|
185
|
+
maxAgeFrom: "last-used"
|
|
175
186
|
})
|
|
176
187
|
],
|
|
177
188
|
networkTimeoutSeconds: 10
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-first-truthy.d.ts","sourceRoot":"","sources":["../../src/lib/find-first-truthy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,eAAe,cAAe,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,+BAQhE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-content-hash.d.ts","sourceRoot":"","sources":["../../src/lib/get-content-hash.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAI9B,eAAO,MAAM,cAAc,SAAU,GAAG,oBAAoB,SAAS,OAAO,WAK3E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-file-hash.d.ts","sourceRoot":"","sources":["../../src/lib/get-file-hash.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,eAAO,MAAM,WAAW,SAAU,GAAG,oBAAoB,WAAyE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-package-version.d.ts","sourceRoot":"","sources":["../../src/lib/get-package-version.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,gBAAiB,MAAM,KAAG,MAAM,GAAG,SAMhE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-tsconfig.d.ts","sourceRoot":"","sources":["../../src/lib/load-tsconfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,IAAI,YAAY,EAAE,MAAM,WAAW,CAAC;AAI9D,eAAO,MAAM,YAAY,YAAa,MAAM,wBAAwB,MAAM,GAAG,SAAS,KAAG,YAAY,GAAG,SAmBvG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AAsCA,eAAO,MAAM,IAAI,eAAgB,GAAG,EAAE,SAErC,CAAC;AAEF,eAAO,MAAM,KAAK,eAAgB,GAAG,EAAE,SAEtC,CAAC;AAEF,eAAO,MAAM,IAAI,eAAgB,GAAG,EAAE,SAErC,CAAC;AAEF,eAAO,MAAM,IAAI,eAAgB,GAAG,EAAE,SAErC,CAAC;AAEF,eAAO,MAAM,KAAK,eAAgB,GAAG,EAAE,SAEtC,CAAC"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const injectPartial: z.ZodObject<{
|
|
3
|
+
cacheOnNavigation: z.ZodDefault<z.ZodBoolean>;
|
|
4
|
+
disable: z.ZodDefault<z.ZodBoolean>;
|
|
5
|
+
register: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
+
reloadOnOnline: z.ZodDefault<z.ZodBoolean>;
|
|
7
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
8
|
+
swUrl: z.ZodDefault<z.ZodString>;
|
|
9
|
+
globPublicPatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
10
|
+
}, "strict", z.ZodTypeAny, {
|
|
11
|
+
cacheOnNavigation: boolean;
|
|
12
|
+
disable: boolean;
|
|
13
|
+
register: boolean;
|
|
14
|
+
reloadOnOnline: boolean;
|
|
15
|
+
swUrl: string;
|
|
16
|
+
globPublicPatterns: string[];
|
|
17
|
+
scope?: string | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
cacheOnNavigation?: boolean | undefined;
|
|
20
|
+
disable?: boolean | undefined;
|
|
21
|
+
register?: boolean | undefined;
|
|
22
|
+
reloadOnOnline?: boolean | undefined;
|
|
23
|
+
scope?: string | undefined;
|
|
24
|
+
swUrl?: string | undefined;
|
|
25
|
+
globPublicPatterns?: string[] | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const injectManifestOptions: z.ZodObject<Omit<{
|
|
28
|
+
chunks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
29
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodFunction<z.ZodTuple<[z.ZodAny], null>, z.ZodBoolean>]>, "many">>;
|
|
30
|
+
excludeChunks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
31
|
+
include: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodFunction<z.ZodTuple<[z.ZodAny], null>, z.ZodBoolean>]>, "many">>;
|
|
32
|
+
additionalPrecacheEntries: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
33
|
+
integrity: z.ZodOptional<z.ZodString>;
|
|
34
|
+
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
|
+
url: z.ZodString;
|
|
36
|
+
}, "strict", z.ZodTypeAny, {
|
|
37
|
+
url: string;
|
|
38
|
+
integrity?: string | undefined;
|
|
39
|
+
revision?: string | null | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
url: string;
|
|
42
|
+
integrity?: string | undefined;
|
|
43
|
+
revision?: string | null | undefined;
|
|
44
|
+
}>]>, "many">>;
|
|
45
|
+
disablePrecacheManifest: z.ZodDefault<z.ZodBoolean>;
|
|
46
|
+
dontCacheBustURLsMatching: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
47
|
+
manifestTransforms: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodObject<{
|
|
48
|
+
integrity: z.ZodOptional<z.ZodString>;
|
|
49
|
+
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
|
+
url: z.ZodString;
|
|
51
|
+
size: z.ZodNumber;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
url: string;
|
|
54
|
+
size: number;
|
|
55
|
+
integrity?: string | undefined;
|
|
56
|
+
revision?: string | null | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
url: string;
|
|
59
|
+
size: number;
|
|
60
|
+
integrity?: string | undefined;
|
|
61
|
+
revision?: string | null | undefined;
|
|
62
|
+
}>, "many">, z.ZodOptional<z.ZodUnknown>], null>, z.ZodUnion<[z.ZodPromise<z.ZodObject<{
|
|
63
|
+
manifest: z.ZodArray<z.ZodObject<{
|
|
64
|
+
integrity: z.ZodOptional<z.ZodString>;
|
|
65
|
+
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
|
+
url: z.ZodString;
|
|
67
|
+
size: z.ZodNumber;
|
|
68
|
+
}, "strip", z.ZodTypeAny, {
|
|
69
|
+
url: string;
|
|
70
|
+
size: number;
|
|
71
|
+
integrity?: string | undefined;
|
|
72
|
+
revision?: string | null | undefined;
|
|
73
|
+
}, {
|
|
74
|
+
url: string;
|
|
75
|
+
size: number;
|
|
76
|
+
integrity?: string | undefined;
|
|
77
|
+
revision?: string | null | undefined;
|
|
78
|
+
}>, "many">;
|
|
79
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
80
|
+
}, "strict", z.ZodTypeAny, {
|
|
81
|
+
manifest: {
|
|
82
|
+
url: string;
|
|
83
|
+
size: number;
|
|
84
|
+
integrity?: string | undefined;
|
|
85
|
+
revision?: string | null | undefined;
|
|
86
|
+
}[];
|
|
87
|
+
warnings?: string[] | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
manifest: {
|
|
90
|
+
url: string;
|
|
91
|
+
size: number;
|
|
92
|
+
integrity?: string | undefined;
|
|
93
|
+
revision?: string | null | undefined;
|
|
94
|
+
}[];
|
|
95
|
+
warnings?: string[] | undefined;
|
|
96
|
+
}>>, z.ZodObject<{
|
|
97
|
+
manifest: z.ZodArray<z.ZodObject<{
|
|
98
|
+
integrity: z.ZodOptional<z.ZodString>;
|
|
99
|
+
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
100
|
+
url: z.ZodString;
|
|
101
|
+
size: z.ZodNumber;
|
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
url: string;
|
|
104
|
+
size: number;
|
|
105
|
+
integrity?: string | undefined;
|
|
106
|
+
revision?: string | null | undefined;
|
|
107
|
+
}, {
|
|
108
|
+
url: string;
|
|
109
|
+
size: number;
|
|
110
|
+
integrity?: string | undefined;
|
|
111
|
+
revision?: string | null | undefined;
|
|
112
|
+
}>, "many">;
|
|
113
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
114
|
+
}, "strict", z.ZodTypeAny, {
|
|
115
|
+
manifest: {
|
|
116
|
+
url: string;
|
|
117
|
+
size: number;
|
|
118
|
+
integrity?: string | undefined;
|
|
119
|
+
revision?: string | null | undefined;
|
|
120
|
+
}[];
|
|
121
|
+
warnings?: string[] | undefined;
|
|
122
|
+
}, {
|
|
123
|
+
manifest: {
|
|
124
|
+
url: string;
|
|
125
|
+
size: number;
|
|
126
|
+
integrity?: string | undefined;
|
|
127
|
+
revision?: string | null | undefined;
|
|
128
|
+
}[];
|
|
129
|
+
warnings?: string[] | undefined;
|
|
130
|
+
}>]>>, "many">>;
|
|
131
|
+
maximumFileSizeToCacheInBytes: z.ZodDefault<z.ZodNumber>;
|
|
132
|
+
modifyURLPrefix: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
133
|
+
injectionPoint: z.ZodDefault<z.ZodString>;
|
|
134
|
+
swSrc: z.ZodString;
|
|
135
|
+
compileSrc: z.ZodDefault<z.ZodBoolean>;
|
|
136
|
+
swDest: z.ZodString;
|
|
137
|
+
webpackCompilationPlugins: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
138
|
+
cacheOnNavigation: z.ZodDefault<z.ZodBoolean>;
|
|
139
|
+
disable: z.ZodDefault<z.ZodBoolean>;
|
|
140
|
+
register: z.ZodDefault<z.ZodBoolean>;
|
|
141
|
+
reloadOnOnline: z.ZodDefault<z.ZodBoolean>;
|
|
142
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
143
|
+
swUrl: z.ZodDefault<z.ZodString>;
|
|
144
|
+
globPublicPatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
145
|
+
}, "disablePrecacheManifest">, "strict", z.ZodTypeAny, {
|
|
146
|
+
cacheOnNavigation: boolean;
|
|
147
|
+
disable: boolean;
|
|
148
|
+
register: boolean;
|
|
149
|
+
reloadOnOnline: boolean;
|
|
150
|
+
swUrl: string;
|
|
151
|
+
globPublicPatterns: string[];
|
|
152
|
+
exclude: (string | RegExp | ((args_0: any) => boolean))[];
|
|
153
|
+
maximumFileSizeToCacheInBytes: number;
|
|
154
|
+
injectionPoint: string;
|
|
155
|
+
swSrc: string;
|
|
156
|
+
compileSrc: boolean;
|
|
157
|
+
swDest: string;
|
|
158
|
+
scope?: string | undefined;
|
|
159
|
+
chunks?: string[] | undefined;
|
|
160
|
+
excludeChunks?: string[] | undefined;
|
|
161
|
+
include?: (string | RegExp | ((args_0: any) => boolean))[] | undefined;
|
|
162
|
+
additionalPrecacheEntries?: (string | {
|
|
163
|
+
url: string;
|
|
164
|
+
integrity?: string | undefined;
|
|
165
|
+
revision?: string | null | undefined;
|
|
166
|
+
})[] | undefined;
|
|
167
|
+
dontCacheBustURLsMatching?: RegExp | undefined;
|
|
168
|
+
manifestTransforms?: ((args_0: {
|
|
169
|
+
url: string;
|
|
170
|
+
size: number;
|
|
171
|
+
integrity?: string | undefined;
|
|
172
|
+
revision?: string | null | undefined;
|
|
173
|
+
}[], args_1: unknown) => {
|
|
174
|
+
manifest: {
|
|
175
|
+
url: string;
|
|
176
|
+
size: number;
|
|
177
|
+
integrity?: string | undefined;
|
|
178
|
+
revision?: string | null | undefined;
|
|
179
|
+
}[];
|
|
180
|
+
warnings?: string[] | undefined;
|
|
181
|
+
} | Promise<{
|
|
182
|
+
manifest: {
|
|
183
|
+
url: string;
|
|
184
|
+
size: number;
|
|
185
|
+
integrity?: string | undefined;
|
|
186
|
+
revision?: string | null | undefined;
|
|
187
|
+
}[];
|
|
188
|
+
warnings?: string[] | undefined;
|
|
189
|
+
}>)[] | undefined;
|
|
190
|
+
modifyURLPrefix?: Record<string, string> | undefined;
|
|
191
|
+
webpackCompilationPlugins?: any[] | undefined;
|
|
192
|
+
}, {
|
|
193
|
+
swSrc: string;
|
|
194
|
+
swDest: string;
|
|
195
|
+
cacheOnNavigation?: boolean | undefined;
|
|
196
|
+
disable?: boolean | undefined;
|
|
197
|
+
register?: boolean | undefined;
|
|
198
|
+
reloadOnOnline?: boolean | undefined;
|
|
199
|
+
scope?: string | undefined;
|
|
200
|
+
swUrl?: string | undefined;
|
|
201
|
+
globPublicPatterns?: string[] | undefined;
|
|
202
|
+
chunks?: string[] | undefined;
|
|
203
|
+
exclude?: (string | RegExp | ((args_0: any) => boolean))[] | undefined;
|
|
204
|
+
excludeChunks?: string[] | undefined;
|
|
205
|
+
include?: (string | RegExp | ((args_0: any) => boolean))[] | undefined;
|
|
206
|
+
additionalPrecacheEntries?: (string | {
|
|
207
|
+
url: string;
|
|
208
|
+
integrity?: string | undefined;
|
|
209
|
+
revision?: string | null | undefined;
|
|
210
|
+
})[] | undefined;
|
|
211
|
+
dontCacheBustURLsMatching?: RegExp | undefined;
|
|
212
|
+
manifestTransforms?: ((args_0: {
|
|
213
|
+
url: string;
|
|
214
|
+
size: number;
|
|
215
|
+
integrity?: string | undefined;
|
|
216
|
+
revision?: string | null | undefined;
|
|
217
|
+
}[], args_1: unknown) => {
|
|
218
|
+
manifest: {
|
|
219
|
+
url: string;
|
|
220
|
+
size: number;
|
|
221
|
+
integrity?: string | undefined;
|
|
222
|
+
revision?: string | null | undefined;
|
|
223
|
+
}[];
|
|
224
|
+
warnings?: string[] | undefined;
|
|
225
|
+
} | Promise<{
|
|
226
|
+
manifest: {
|
|
227
|
+
url: string;
|
|
228
|
+
size: number;
|
|
229
|
+
integrity?: string | undefined;
|
|
230
|
+
revision?: string | null | undefined;
|
|
231
|
+
}[];
|
|
232
|
+
warnings?: string[] | undefined;
|
|
233
|
+
}>)[] | undefined;
|
|
234
|
+
maximumFileSizeToCacheInBytes?: number | undefined;
|
|
235
|
+
modifyURLPrefix?: Record<string, string> | undefined;
|
|
236
|
+
injectionPoint?: string | undefined;
|
|
237
|
+
compileSrc?: boolean | undefined;
|
|
238
|
+
webpackCompilationPlugins?: any[] | undefined;
|
|
239
|
+
}>;
|
|
240
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/lib/schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;EAU+C,CAAC;AAE1E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIuC,CAAC"}
|