@serwist/vite 9.0.14 → 9.1.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 +40 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -5
- package/dist/lib/api.d.ts.map +1 -1
- package/dist/lib/context.d.ts.map +1 -1
- package/dist/lib/log.d.ts.map +1 -1
- package/dist/lib/modules.d.ts.map +1 -1
- package/dist/lib/options.d.ts.map +1 -1
- package/dist/lib/schema.d.ts +89 -334
- package/dist/lib/schema.d.ts.map +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/validator.d.ts.map +1 -1
- package/dist/plugins/build.d.ts.map +1 -1
- package/dist/plugins/dev.d.ts.map +1 -1
- package/dist/plugins/main.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/lib/log.ts +2 -2
- package/src/lib/modules.ts +1 -1
- package/src/lib/schema.ts +34 -11
- package/src/lib/validator.ts +3 -2
package/dist/chunks/schema.js
CHANGED
|
@@ -1,25 +1,42 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fn, asyncFn, requiredGlobDirectoryPartial, requiredSwDestPartial, injectPartial, globPartial, basePartial } from '@serwist/build/schema';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
const hooks = z.object({
|
|
5
|
-
beforeBuildServiceWorker: z.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
beforeBuildServiceWorker: z.union([
|
|
6
|
+
fn({
|
|
7
|
+
input: [
|
|
8
|
+
z.any()
|
|
9
|
+
],
|
|
10
|
+
output: z.void()
|
|
11
|
+
}),
|
|
12
|
+
asyncFn({
|
|
13
|
+
input: [
|
|
14
|
+
z.any()
|
|
15
|
+
],
|
|
16
|
+
output: z.void()
|
|
17
|
+
})
|
|
18
|
+
]).optional(),
|
|
11
19
|
closeBundleOrder: z.union([
|
|
12
20
|
z.literal("pre"),
|
|
13
21
|
z.literal("post"),
|
|
14
22
|
z.null()
|
|
15
23
|
]).optional(),
|
|
16
|
-
configureOptions: z.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
configureOptions: z.union([
|
|
25
|
+
fn({
|
|
26
|
+
input: [
|
|
27
|
+
z.any(),
|
|
28
|
+
z.any()
|
|
29
|
+
],
|
|
30
|
+
output: z.void()
|
|
31
|
+
}),
|
|
32
|
+
asyncFn({
|
|
33
|
+
input: [
|
|
34
|
+
z.any(),
|
|
35
|
+
z.any()
|
|
36
|
+
],
|
|
37
|
+
output: z.void()
|
|
38
|
+
})
|
|
39
|
+
]).optional()
|
|
23
40
|
});
|
|
24
41
|
const devOptions = z.object({
|
|
25
42
|
bundle: z.boolean().default(true),
|
|
@@ -49,8 +66,15 @@ const injectManifestPartial = z.object({
|
|
|
49
66
|
z.literal("iife")
|
|
50
67
|
]).default("es"),
|
|
51
68
|
rollupOptions: z.record(z.string(), z.any()).default({}),
|
|
52
|
-
devOptions: devOptions.
|
|
69
|
+
devOptions: devOptions.prefault({})
|
|
70
|
+
});
|
|
71
|
+
const injectManifestOptions = z.strictObject({
|
|
72
|
+
...basePartial.shape,
|
|
73
|
+
...globPartial.shape,
|
|
74
|
+
...injectPartial.shape,
|
|
75
|
+
...requiredSwDestPartial.shape,
|
|
76
|
+
...requiredGlobDirectoryPartial.shape,
|
|
77
|
+
...injectManifestPartial.shape
|
|
53
78
|
});
|
|
54
|
-
const injectManifestOptions = basePartial.merge(globPartial).merge(injectPartial).merge(requiredSwDestPartial).merge(requiredGlobDirectoryPartial).merge(injectManifestPartial).strict("Do not pass invalid properties to InjectManifestOptions!");
|
|
55
79
|
|
|
56
80
|
export { devOptions, hooks, injectManifestOptions, injectManifestPartial };
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAyB,EAAE,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACzI,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAyB,EAAE,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACzI,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAI,aAAa,aAAa,KAAG,MAAM,EAI1D,CAAC;AAGF,OAAO,EAAE,WAAW,IAAI,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,IAAI,GAAG,EAAE,UAAU,IAAI,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,6BAA6B,EAAE,CAAC;AACnJ,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,10 +4,13 @@ import fs from 'node:fs/promises';
|
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import fs$1 from 'node:fs';
|
|
6
6
|
import { validationErrorMap, SerwistConfigError } from '@serwist/build/schema';
|
|
7
|
+
import { z } from 'zod';
|
|
7
8
|
import { normalizePath } from 'vite';
|
|
8
9
|
import process from 'node:process';
|
|
9
10
|
|
|
10
|
-
var version = "9.0
|
|
11
|
+
var version = "9.1.0";
|
|
12
|
+
var packageJson = {
|
|
13
|
+
version: version};
|
|
11
14
|
|
|
12
15
|
const logSerwistResult = (buildResult, viteOptions)=>{
|
|
13
16
|
const { logLevel = "info" } = viteOptions;
|
|
@@ -16,7 +19,7 @@ const logSerwistResult = (buildResult, viteOptions)=>{
|
|
|
16
19
|
if (logLevel === "info") {
|
|
17
20
|
console.info([
|
|
18
21
|
"",
|
|
19
|
-
`${cyan(`@serwist/vite v${version}`)} ${green("files generated.")}`,
|
|
22
|
+
`${cyan(`@serwist/vite v${packageJson.version}`)} ${green("files generated.")}`,
|
|
20
23
|
`${green("✓")} ${count} precache entries ${dim(`(${(size / 1024).toFixed(2)} KiB)`)}`,
|
|
21
24
|
warnings && warnings.length > 0 ? yellow([
|
|
22
25
|
"⚠ warnings",
|
|
@@ -49,7 +52,7 @@ const injectManifest = async (options)=>{
|
|
|
49
52
|
const generateServiceWorker = async (ctx)=>{
|
|
50
53
|
const { plugins, rollupOptions, rollupFormat } = ctx.options;
|
|
51
54
|
const parsedSwDest = path.parse(ctx.options.injectManifest.swDest);
|
|
52
|
-
let injectManifestResult
|
|
55
|
+
let injectManifestResult;
|
|
53
56
|
if (ctx.options.injectManifest.injectionPoint) {
|
|
54
57
|
await ctx.options.integration?.beforeBuildServiceWorker?.(ctx.options);
|
|
55
58
|
injectManifestResult = await injectManifest(ctx.options.injectManifest);
|
|
@@ -232,12 +235,12 @@ const toFs = (str)=>{
|
|
|
232
235
|
|
|
233
236
|
const validateInjectManifestOptions = async (input)=>{
|
|
234
237
|
const result = await (await import('./chunks/schema.js')).injectManifestOptions.spa(input, {
|
|
235
|
-
|
|
238
|
+
error: validationErrorMap
|
|
236
239
|
});
|
|
237
240
|
if (!result.success) {
|
|
238
241
|
throw new SerwistConfigError({
|
|
239
242
|
moduleName: "@serwist/vite",
|
|
240
|
-
message:
|
|
243
|
+
message: z.prettifyError(result.error)
|
|
241
244
|
});
|
|
242
245
|
}
|
|
243
246
|
return result.data;
|
package/dist/lib/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,KAAK,EAA6B,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5E,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,KAAK,EAA6B,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5E,eAAO,MAAM,SAAS,GAAI,KAAK,kBAAkB,KAAG,cA8BnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/lib/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAE3C,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEvE,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,UAAU,EAAE,cAAc,CAAC;IAC3B;;OAEG;IACH,WAAW,EAAE,aAAa,CAAC;IAC3B;;;;;OAKG;IACH,OAAO,EAAE,qBAAqB,CAAC;IAC/B,iBAAiB,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB,8CAA8C;IAC9C,SAAS,EAAE,qBAAqB,GAAG,SAAS,CAAC;CAC9C;AAED,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/lib/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAE3C,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEvE,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,UAAU,EAAE,cAAc,CAAC;IAC3B;;OAEG;IACH,WAAW,EAAE,aAAa,CAAC;IAC3B;;;;;OAKG;IACH,OAAO,EAAE,qBAAqB,CAAC;IAC/B,iBAAiB,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB,8CAA8C;IAC9C,SAAS,EAAE,qBAAqB,GAAG,SAAS,CAAC;CAC9C;AAED,eAAO,MAAM,aAAa,GAAI,aAAa,aAAa,EAAE,WAAW,qBAAqB,GAAG,SAAS,KAAG,kBASxG,CAAC"}
|
package/dist/lib/log.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/lib/log.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAI3C,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/lib/log.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAI3C,eAAO,MAAM,gBAAgB,GAAI,aAAa,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC,EAAE,aAAa,cAAc,SAkB1H,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/lib/modules.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,OAAO,YAAY,CASpE,CAAC;AAEF,UAAU,WAAY,SAAQ,YAAY,CAAC,iBAAiB;IAC1D,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/lib/modules.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,OAAO,YAAY,CASpE,CAAC;AAEF,UAAU,WAAY,SAAQ,YAAY,CAAC,iBAAiB;IAC1D,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,cAAc,GAAU,SAAS,YAAY,CAAC,0BAA0B,KAAG,OAAO,CAAC,WAAW,CAW1G,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAU,KAAK,kBAAkB,qCAwIlE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/lib/options.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAE3C,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAwBvE,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/lib/options.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAE3C,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAwBvE,eAAO,MAAM,cAAc,GAAU,SAAS,aAAa,EAAE,YAAY,cAAc,KAAG,OAAO,CAAC,qBAAqB,CA8CtH,CAAC"}
|
package/dist/lib/schema.d.ts
CHANGED
|
@@ -1,367 +1,122 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const hooks: z.ZodObject<{
|
|
3
|
-
beforeBuildServiceWorker: z.ZodOptional<z.
|
|
4
|
-
closeBundleOrder: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"pre">, z.ZodLiteral<"post">, z.ZodNull]>>;
|
|
5
|
-
configureOptions: z.ZodOptional<z.
|
|
6
|
-
},
|
|
7
|
-
beforeBuildServiceWorker?: ((args_0: any) => void | Promise<void>) | undefined;
|
|
8
|
-
closeBundleOrder?: "pre" | "post" | null | undefined;
|
|
9
|
-
configureOptions?: ((args_0: any, args_1: any) => void | Promise<void>) | undefined;
|
|
10
|
-
}, {
|
|
11
|
-
beforeBuildServiceWorker?: ((args_0: any) => void | Promise<void>) | undefined;
|
|
12
|
-
closeBundleOrder?: "pre" | "post" | null | undefined;
|
|
13
|
-
configureOptions?: ((args_0: any, args_1: any) => void | Promise<void>) | undefined;
|
|
14
|
-
}>;
|
|
3
|
+
beforeBuildServiceWorker: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>>, z.ZodTransform<(args_0: any) => void, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>>>, z.ZodPipe<z.ZodCustom<z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>, z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>>, z.ZodTransform<z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>, z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>>>]>>;
|
|
4
|
+
closeBundleOrder: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"pre">, z.ZodLiteral<"post">, z.ZodNull]>>;
|
|
5
|
+
configureOptions: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>>, z.ZodTransform<(args_0: any, args_1: any) => void, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>>>, z.ZodPipe<z.ZodCustom<z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>, z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>>, z.ZodTransform<z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>, z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>>>]>>;
|
|
6
|
+
}, z.core.$strip>;
|
|
15
7
|
export declare const devOptions: z.ZodObject<{
|
|
16
8
|
bundle: z.ZodDefault<z.ZodBoolean>;
|
|
17
|
-
minify: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"terser">, z.ZodLiteral<"esbuild">]>>;
|
|
18
|
-
},
|
|
19
|
-
bundle: boolean;
|
|
20
|
-
minify: boolean | "terser" | "esbuild";
|
|
21
|
-
}, {
|
|
22
|
-
bundle?: boolean | undefined;
|
|
23
|
-
minify?: boolean | "terser" | "esbuild" | undefined;
|
|
24
|
-
}>;
|
|
9
|
+
minify: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"terser">, z.ZodLiteral<"esbuild">]>>;
|
|
10
|
+
}, z.core.$strip>;
|
|
25
11
|
export declare const injectManifestPartial: z.ZodObject<{
|
|
26
|
-
mode: z.ZodUnion<[z.ZodLiteral<"development">, z.ZodLiteral<"production">]>;
|
|
27
|
-
type: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"classic">, z.ZodLiteral<"module">]>>;
|
|
12
|
+
mode: z.ZodUnion<readonly [z.ZodLiteral<"development">, z.ZodLiteral<"production">]>;
|
|
13
|
+
type: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"classic">, z.ZodLiteral<"module">]>>;
|
|
28
14
|
scope: z.ZodString;
|
|
29
15
|
base: z.ZodString;
|
|
30
16
|
disable: z.ZodDefault<z.ZodBoolean>;
|
|
31
17
|
integration: z.ZodDefault<z.ZodObject<{
|
|
32
|
-
beforeBuildServiceWorker: z.ZodOptional<z.
|
|
33
|
-
closeBundleOrder: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"pre">, z.ZodLiteral<"post">, z.ZodNull]>>;
|
|
34
|
-
configureOptions: z.ZodOptional<z.
|
|
35
|
-
},
|
|
36
|
-
beforeBuildServiceWorker?: ((args_0: any) => void | Promise<void>) | undefined;
|
|
37
|
-
closeBundleOrder?: "pre" | "post" | null | undefined;
|
|
38
|
-
configureOptions?: ((args_0: any, args_1: any) => void | Promise<void>) | undefined;
|
|
39
|
-
}, {
|
|
40
|
-
beforeBuildServiceWorker?: ((args_0: any) => void | Promise<void>) | undefined;
|
|
41
|
-
closeBundleOrder?: "pre" | "post" | null | undefined;
|
|
42
|
-
configureOptions?: ((args_0: any, args_1: any) => void | Promise<void>) | undefined;
|
|
43
|
-
}>>;
|
|
18
|
+
beforeBuildServiceWorker: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>>, z.ZodTransform<(args_0: any) => void, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>>>, z.ZodPipe<z.ZodCustom<z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>, z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>>, z.ZodTransform<z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>, z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>>>]>>;
|
|
19
|
+
closeBundleOrder: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"pre">, z.ZodLiteral<"post">, z.ZodNull]>>;
|
|
20
|
+
configureOptions: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>>, z.ZodTransform<(args_0: any, args_1: any) => void, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>>>, z.ZodPipe<z.ZodCustom<z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>, z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>>, z.ZodTransform<z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>, z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>>>]>>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
44
22
|
swUrl: z.ZodDefault<z.ZodString>;
|
|
45
|
-
plugins: z.ZodDefault<z.ZodArray<z.ZodAny
|
|
46
|
-
rollupFormat: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"es">, z.ZodLiteral<"iife">]>>;
|
|
23
|
+
plugins: z.ZodDefault<z.ZodArray<z.ZodAny>>;
|
|
24
|
+
rollupFormat: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"es">, z.ZodLiteral<"iife">]>>;
|
|
47
25
|
rollupOptions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
48
|
-
devOptions: z.
|
|
26
|
+
devOptions: z.ZodPrefault<z.ZodObject<{
|
|
49
27
|
bundle: z.ZodDefault<z.ZodBoolean>;
|
|
50
|
-
minify: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"terser">, z.ZodLiteral<"esbuild">]>>;
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
minify: boolean | "terser" | "esbuild";
|
|
54
|
-
}, {
|
|
55
|
-
bundle?: boolean | undefined;
|
|
56
|
-
minify?: boolean | "terser" | "esbuild" | undefined;
|
|
57
|
-
}>>;
|
|
58
|
-
}, "strip", z.ZodTypeAny, {
|
|
59
|
-
type: "classic" | "module";
|
|
60
|
-
mode: "development" | "production";
|
|
61
|
-
scope: string;
|
|
62
|
-
base: string;
|
|
63
|
-
disable: boolean;
|
|
64
|
-
integration: {
|
|
65
|
-
beforeBuildServiceWorker?: ((args_0: any) => void | Promise<void>) | undefined;
|
|
66
|
-
closeBundleOrder?: "pre" | "post" | null | undefined;
|
|
67
|
-
configureOptions?: ((args_0: any, args_1: any) => void | Promise<void>) | undefined;
|
|
68
|
-
};
|
|
69
|
-
swUrl: string;
|
|
70
|
-
plugins: any[];
|
|
71
|
-
rollupFormat: "es" | "iife";
|
|
72
|
-
rollupOptions: Record<string, any>;
|
|
73
|
-
devOptions: {
|
|
74
|
-
bundle: boolean;
|
|
75
|
-
minify: boolean | "terser" | "esbuild";
|
|
76
|
-
};
|
|
77
|
-
}, {
|
|
78
|
-
mode: "development" | "production";
|
|
79
|
-
scope: string;
|
|
80
|
-
base: string;
|
|
81
|
-
type?: "classic" | "module" | undefined;
|
|
82
|
-
disable?: boolean | undefined;
|
|
83
|
-
integration?: {
|
|
84
|
-
beforeBuildServiceWorker?: ((args_0: any) => void | Promise<void>) | undefined;
|
|
85
|
-
closeBundleOrder?: "pre" | "post" | null | undefined;
|
|
86
|
-
configureOptions?: ((args_0: any, args_1: any) => void | Promise<void>) | undefined;
|
|
87
|
-
} | undefined;
|
|
88
|
-
swUrl?: string | undefined;
|
|
89
|
-
plugins?: any[] | undefined;
|
|
90
|
-
rollupFormat?: "es" | "iife" | undefined;
|
|
91
|
-
rollupOptions?: Record<string, any> | undefined;
|
|
92
|
-
devOptions?: {
|
|
93
|
-
bundle?: boolean | undefined;
|
|
94
|
-
minify?: boolean | "terser" | "esbuild" | undefined;
|
|
95
|
-
} | undefined;
|
|
96
|
-
}>;
|
|
28
|
+
minify: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"terser">, z.ZodLiteral<"esbuild">]>>;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
}, z.core.$strip>;
|
|
97
31
|
export declare const injectManifestOptions: z.ZodObject<{
|
|
98
|
-
|
|
32
|
+
mode: z.ZodUnion<readonly [z.ZodLiteral<"development">, z.ZodLiteral<"production">]>;
|
|
33
|
+
type: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"classic">, z.ZodLiteral<"module">]>>;
|
|
34
|
+
scope: z.ZodString;
|
|
35
|
+
base: z.ZodString;
|
|
36
|
+
disable: z.ZodDefault<z.ZodBoolean>;
|
|
37
|
+
integration: z.ZodDefault<z.ZodObject<{
|
|
38
|
+
beforeBuildServiceWorker: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>>, z.ZodTransform<(args_0: any) => void, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>>>, z.ZodPipe<z.ZodCustom<z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>, z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>>, z.ZodTransform<z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>, z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny], null>, z.ZodVoid>>>]>>;
|
|
39
|
+
closeBundleOrder: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"pre">, z.ZodLiteral<"post">, z.ZodNull]>>;
|
|
40
|
+
configureOptions: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>>, z.ZodTransform<(args_0: any, args_1: any) => void, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>>>, z.ZodPipe<z.ZodCustom<z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>, z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>>, z.ZodTransform<z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>, z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodVoid>>>]>>;
|
|
41
|
+
}, z.core.$strip>>;
|
|
42
|
+
swUrl: z.ZodDefault<z.ZodString>;
|
|
43
|
+
plugins: z.ZodDefault<z.ZodArray<z.ZodAny>>;
|
|
44
|
+
rollupFormat: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"es">, z.ZodLiteral<"iife">]>>;
|
|
45
|
+
rollupOptions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
46
|
+
devOptions: z.ZodPrefault<z.ZodObject<{
|
|
47
|
+
bundle: z.ZodDefault<z.ZodBoolean>;
|
|
48
|
+
minify: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"terser">, z.ZodLiteral<"esbuild">]>>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
globDirectory: z.ZodString;
|
|
51
|
+
swDest: z.ZodString;
|
|
52
|
+
injectionPoint: z.ZodDefault<z.ZodString>;
|
|
53
|
+
swSrc: z.ZodString;
|
|
54
|
+
globFollow: z.ZodDefault<z.ZodBoolean>;
|
|
55
|
+
globIgnores: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
56
|
+
globPatterns: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
57
|
+
globStrict: z.ZodDefault<z.ZodBoolean>;
|
|
58
|
+
templatedURLs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
59
|
+
additionalPrecacheEntries: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
99
60
|
integrity: z.ZodOptional<z.ZodString>;
|
|
100
61
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
101
62
|
url: z.ZodString;
|
|
102
|
-
},
|
|
103
|
-
url: string;
|
|
104
|
-
integrity?: string | undefined;
|
|
105
|
-
revision?: string | null | undefined;
|
|
106
|
-
}, {
|
|
107
|
-
url: string;
|
|
108
|
-
integrity?: string | undefined;
|
|
109
|
-
revision?: string | null | undefined;
|
|
110
|
-
}>]>, "many">>;
|
|
63
|
+
}, z.core.$strict>]>>>;
|
|
111
64
|
disablePrecacheManifest: z.ZodDefault<z.ZodBoolean>;
|
|
112
|
-
dontCacheBustURLsMatching: z.ZodOptional<z.
|
|
113
|
-
manifestTransforms: z.ZodOptional<z.ZodArray<z.
|
|
65
|
+
dontCacheBustURLsMatching: z.ZodOptional<z.ZodCustom<RegExp, RegExp>>;
|
|
66
|
+
manifestTransforms: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodCustom<z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodArray<z.ZodObject<{
|
|
67
|
+
size: z.ZodNumber;
|
|
114
68
|
integrity: z.ZodOptional<z.ZodString>;
|
|
115
69
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
116
70
|
url: z.ZodString;
|
|
117
|
-
}
|
|
118
|
-
size: z.ZodNumber;
|
|
119
|
-
}, "strip", z.ZodTypeAny, {
|
|
120
|
-
url: string;
|
|
121
|
-
size: number;
|
|
122
|
-
integrity?: string | undefined;
|
|
123
|
-
revision?: string | null | undefined;
|
|
124
|
-
}, {
|
|
125
|
-
url: string;
|
|
126
|
-
size: number;
|
|
127
|
-
integrity?: string | undefined;
|
|
128
|
-
revision?: string | null | undefined;
|
|
129
|
-
}>, "many">, z.ZodOptional<z.ZodUnknown>], null>, z.ZodUnion<[z.ZodPromise<z.ZodObject<{
|
|
71
|
+
}, z.core.$strip>>, z.ZodOptional<z.ZodUnknown>], null>, z.ZodObject<{
|
|
130
72
|
manifest: z.ZodArray<z.ZodObject<{
|
|
73
|
+
size: z.ZodNumber;
|
|
131
74
|
integrity: z.ZodOptional<z.ZodString>;
|
|
132
75
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
133
76
|
url: z.ZodString;
|
|
134
|
-
}
|
|
77
|
+
}, z.core.$strip>>;
|
|
78
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
79
|
+
}, z.core.$strict>>, z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodArray<z.ZodObject<{
|
|
80
|
+
size: z.ZodNumber;
|
|
81
|
+
integrity: z.ZodOptional<z.ZodString>;
|
|
82
|
+
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
83
|
+
url: z.ZodString;
|
|
84
|
+
}, z.core.$strip>>, z.ZodOptional<z.ZodUnknown>], null>, z.ZodObject<{
|
|
85
|
+
manifest: z.ZodArray<z.ZodObject<{
|
|
135
86
|
size: z.ZodNumber;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
148
|
-
}, "strict", z.ZodTypeAny, {
|
|
149
|
-
manifest: {
|
|
150
|
-
url: string;
|
|
151
|
-
size: number;
|
|
152
|
-
integrity?: string | undefined;
|
|
153
|
-
revision?: string | null | undefined;
|
|
154
|
-
}[];
|
|
155
|
-
warnings?: string[] | undefined;
|
|
156
|
-
}, {
|
|
157
|
-
manifest: {
|
|
158
|
-
url: string;
|
|
159
|
-
size: number;
|
|
160
|
-
integrity?: string | undefined;
|
|
161
|
-
revision?: string | null | undefined;
|
|
162
|
-
}[];
|
|
163
|
-
warnings?: string[] | undefined;
|
|
164
|
-
}>>, z.ZodObject<{
|
|
87
|
+
integrity: z.ZodOptional<z.ZodString>;
|
|
88
|
+
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
89
|
+
url: z.ZodString;
|
|
90
|
+
}, z.core.$strip>>;
|
|
91
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
92
|
+
}, z.core.$strict>>>, z.ZodTransform<z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodArray<z.ZodObject<{
|
|
93
|
+
size: z.ZodNumber;
|
|
94
|
+
integrity: z.ZodOptional<z.ZodString>;
|
|
95
|
+
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
96
|
+
url: z.ZodString;
|
|
97
|
+
}, z.core.$strip>>, z.ZodOptional<z.ZodUnknown>], null>, z.ZodObject<{
|
|
165
98
|
manifest: z.ZodArray<z.ZodObject<{
|
|
99
|
+
size: z.ZodNumber;
|
|
166
100
|
integrity: z.ZodOptional<z.ZodString>;
|
|
167
101
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
168
102
|
url: z.ZodString;
|
|
169
|
-
}
|
|
103
|
+
}, z.core.$strip>>;
|
|
104
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
105
|
+
}, z.core.$strict>>, z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodArray<z.ZodObject<{
|
|
106
|
+
size: z.ZodNumber;
|
|
107
|
+
integrity: z.ZodOptional<z.ZodString>;
|
|
108
|
+
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
109
|
+
url: z.ZodString;
|
|
110
|
+
}, z.core.$strip>>, z.ZodOptional<z.ZodUnknown>], null>, z.ZodObject<{
|
|
111
|
+
manifest: z.ZodArray<z.ZodObject<{
|
|
170
112
|
size: z.ZodNumber;
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
url: string;
|
|
178
|
-
size: number;
|
|
179
|
-
integrity?: string | undefined;
|
|
180
|
-
revision?: string | null | undefined;
|
|
181
|
-
}>, "many">;
|
|
182
|
-
warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
183
|
-
}, "strict", z.ZodTypeAny, {
|
|
184
|
-
manifest: {
|
|
185
|
-
url: string;
|
|
186
|
-
size: number;
|
|
187
|
-
integrity?: string | undefined;
|
|
188
|
-
revision?: string | null | undefined;
|
|
189
|
-
}[];
|
|
190
|
-
warnings?: string[] | undefined;
|
|
191
|
-
}, {
|
|
192
|
-
manifest: {
|
|
193
|
-
url: string;
|
|
194
|
-
size: number;
|
|
195
|
-
integrity?: string | undefined;
|
|
196
|
-
revision?: string | null | undefined;
|
|
197
|
-
}[];
|
|
198
|
-
warnings?: string[] | undefined;
|
|
199
|
-
}>]>>, "many">>;
|
|
113
|
+
integrity: z.ZodOptional<z.ZodString>;
|
|
114
|
+
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
115
|
+
url: z.ZodString;
|
|
116
|
+
}, z.core.$strip>>;
|
|
117
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
118
|
+
}, z.core.$strict>>>>>>;
|
|
200
119
|
maximumFileSizeToCacheInBytes: z.ZodDefault<z.ZodNumber>;
|
|
201
120
|
modifyURLPrefix: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
202
|
-
}
|
|
203
|
-
globFollow: z.ZodDefault<z.ZodBoolean>;
|
|
204
|
-
globIgnores: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
205
|
-
globPatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
206
|
-
globStrict: z.ZodDefault<z.ZodBoolean>;
|
|
207
|
-
templatedURLs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
|
|
208
|
-
} & {
|
|
209
|
-
injectionPoint: z.ZodDefault<z.ZodString>;
|
|
210
|
-
swSrc: z.ZodString;
|
|
211
|
-
} & {
|
|
212
|
-
swDest: z.ZodString;
|
|
213
|
-
} & {
|
|
214
|
-
globDirectory: z.ZodString;
|
|
215
|
-
} & {
|
|
216
|
-
mode: z.ZodUnion<[z.ZodLiteral<"development">, z.ZodLiteral<"production">]>;
|
|
217
|
-
type: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"classic">, z.ZodLiteral<"module">]>>;
|
|
218
|
-
scope: z.ZodString;
|
|
219
|
-
base: z.ZodString;
|
|
220
|
-
disable: z.ZodDefault<z.ZodBoolean>;
|
|
221
|
-
integration: z.ZodDefault<z.ZodObject<{
|
|
222
|
-
beforeBuildServiceWorker: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny], null>, z.ZodUnion<[z.ZodPromise<z.ZodVoid>, z.ZodVoid]>>>;
|
|
223
|
-
closeBundleOrder: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"pre">, z.ZodLiteral<"post">, z.ZodNull]>>;
|
|
224
|
-
configureOptions: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodAny], null>, z.ZodUnion<[z.ZodPromise<z.ZodVoid>, z.ZodVoid]>>>;
|
|
225
|
-
}, "strip", z.ZodTypeAny, {
|
|
226
|
-
beforeBuildServiceWorker?: ((args_0: any) => void | Promise<void>) | undefined;
|
|
227
|
-
closeBundleOrder?: "pre" | "post" | null | undefined;
|
|
228
|
-
configureOptions?: ((args_0: any, args_1: any) => void | Promise<void>) | undefined;
|
|
229
|
-
}, {
|
|
230
|
-
beforeBuildServiceWorker?: ((args_0: any) => void | Promise<void>) | undefined;
|
|
231
|
-
closeBundleOrder?: "pre" | "post" | null | undefined;
|
|
232
|
-
configureOptions?: ((args_0: any, args_1: any) => void | Promise<void>) | undefined;
|
|
233
|
-
}>>;
|
|
234
|
-
swUrl: z.ZodDefault<z.ZodString>;
|
|
235
|
-
plugins: z.ZodDefault<z.ZodArray<z.ZodAny, "many">>;
|
|
236
|
-
rollupFormat: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"es">, z.ZodLiteral<"iife">]>>;
|
|
237
|
-
rollupOptions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
238
|
-
devOptions: z.ZodDefault<z.ZodObject<{
|
|
239
|
-
bundle: z.ZodDefault<z.ZodBoolean>;
|
|
240
|
-
minify: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"terser">, z.ZodLiteral<"esbuild">]>>;
|
|
241
|
-
}, "strip", z.ZodTypeAny, {
|
|
242
|
-
bundle: boolean;
|
|
243
|
-
minify: boolean | "terser" | "esbuild";
|
|
244
|
-
}, {
|
|
245
|
-
bundle?: boolean | undefined;
|
|
246
|
-
minify?: boolean | "terser" | "esbuild" | undefined;
|
|
247
|
-
}>>;
|
|
248
|
-
}, "strict", z.ZodTypeAny, {
|
|
249
|
-
type: "classic" | "module";
|
|
250
|
-
mode: "development" | "production";
|
|
251
|
-
scope: string;
|
|
252
|
-
base: string;
|
|
253
|
-
disable: boolean;
|
|
254
|
-
integration: {
|
|
255
|
-
beforeBuildServiceWorker?: ((args_0: any) => void | Promise<void>) | undefined;
|
|
256
|
-
closeBundleOrder?: "pre" | "post" | null | undefined;
|
|
257
|
-
configureOptions?: ((args_0: any, args_1: any) => void | Promise<void>) | undefined;
|
|
258
|
-
};
|
|
259
|
-
swUrl: string;
|
|
260
|
-
plugins: any[];
|
|
261
|
-
rollupFormat: "es" | "iife";
|
|
262
|
-
rollupOptions: Record<string, any>;
|
|
263
|
-
devOptions: {
|
|
264
|
-
bundle: boolean;
|
|
265
|
-
minify: boolean | "terser" | "esbuild";
|
|
266
|
-
};
|
|
267
|
-
disablePrecacheManifest: boolean;
|
|
268
|
-
maximumFileSizeToCacheInBytes: number;
|
|
269
|
-
globFollow: boolean;
|
|
270
|
-
globIgnores: string[];
|
|
271
|
-
globPatterns: string[];
|
|
272
|
-
globStrict: boolean;
|
|
273
|
-
injectionPoint: string;
|
|
274
|
-
swSrc: string;
|
|
275
|
-
swDest: string;
|
|
276
|
-
globDirectory: string;
|
|
277
|
-
additionalPrecacheEntries?: (string | {
|
|
278
|
-
url: string;
|
|
279
|
-
integrity?: string | undefined;
|
|
280
|
-
revision?: string | null | undefined;
|
|
281
|
-
})[] | undefined;
|
|
282
|
-
dontCacheBustURLsMatching?: RegExp | undefined;
|
|
283
|
-
manifestTransforms?: ((args_0: {
|
|
284
|
-
url: string;
|
|
285
|
-
size: number;
|
|
286
|
-
integrity?: string | undefined;
|
|
287
|
-
revision?: string | null | undefined;
|
|
288
|
-
}[], args_1: unknown) => {
|
|
289
|
-
manifest: {
|
|
290
|
-
url: string;
|
|
291
|
-
size: number;
|
|
292
|
-
integrity?: string | undefined;
|
|
293
|
-
revision?: string | null | undefined;
|
|
294
|
-
}[];
|
|
295
|
-
warnings?: string[] | undefined;
|
|
296
|
-
} | Promise<{
|
|
297
|
-
manifest: {
|
|
298
|
-
url: string;
|
|
299
|
-
size: number;
|
|
300
|
-
integrity?: string | undefined;
|
|
301
|
-
revision?: string | null | undefined;
|
|
302
|
-
}[];
|
|
303
|
-
warnings?: string[] | undefined;
|
|
304
|
-
}>)[] | undefined;
|
|
305
|
-
modifyURLPrefix?: Record<string, string> | undefined;
|
|
306
|
-
templatedURLs?: Record<string, string | string[]> | undefined;
|
|
307
|
-
}, {
|
|
308
|
-
mode: "development" | "production";
|
|
309
|
-
scope: string;
|
|
310
|
-
base: string;
|
|
311
|
-
swSrc: string;
|
|
312
|
-
swDest: string;
|
|
313
|
-
globDirectory: string;
|
|
314
|
-
type?: "classic" | "module" | undefined;
|
|
315
|
-
disable?: boolean | undefined;
|
|
316
|
-
integration?: {
|
|
317
|
-
beforeBuildServiceWorker?: ((args_0: any) => void | Promise<void>) | undefined;
|
|
318
|
-
closeBundleOrder?: "pre" | "post" | null | undefined;
|
|
319
|
-
configureOptions?: ((args_0: any, args_1: any) => void | Promise<void>) | undefined;
|
|
320
|
-
} | undefined;
|
|
321
|
-
swUrl?: string | undefined;
|
|
322
|
-
plugins?: any[] | undefined;
|
|
323
|
-
rollupFormat?: "es" | "iife" | undefined;
|
|
324
|
-
rollupOptions?: Record<string, any> | undefined;
|
|
325
|
-
devOptions?: {
|
|
326
|
-
bundle?: boolean | undefined;
|
|
327
|
-
minify?: boolean | "terser" | "esbuild" | undefined;
|
|
328
|
-
} | undefined;
|
|
329
|
-
additionalPrecacheEntries?: (string | {
|
|
330
|
-
url: string;
|
|
331
|
-
integrity?: string | undefined;
|
|
332
|
-
revision?: string | null | undefined;
|
|
333
|
-
})[] | undefined;
|
|
334
|
-
disablePrecacheManifest?: boolean | undefined;
|
|
335
|
-
dontCacheBustURLsMatching?: RegExp | undefined;
|
|
336
|
-
manifestTransforms?: ((args_0: {
|
|
337
|
-
url: string;
|
|
338
|
-
size: number;
|
|
339
|
-
integrity?: string | undefined;
|
|
340
|
-
revision?: string | null | undefined;
|
|
341
|
-
}[], args_1: unknown) => {
|
|
342
|
-
manifest: {
|
|
343
|
-
url: string;
|
|
344
|
-
size: number;
|
|
345
|
-
integrity?: string | undefined;
|
|
346
|
-
revision?: string | null | undefined;
|
|
347
|
-
}[];
|
|
348
|
-
warnings?: string[] | undefined;
|
|
349
|
-
} | Promise<{
|
|
350
|
-
manifest: {
|
|
351
|
-
url: string;
|
|
352
|
-
size: number;
|
|
353
|
-
integrity?: string | undefined;
|
|
354
|
-
revision?: string | null | undefined;
|
|
355
|
-
}[];
|
|
356
|
-
warnings?: string[] | undefined;
|
|
357
|
-
}>)[] | undefined;
|
|
358
|
-
maximumFileSizeToCacheInBytes?: number | undefined;
|
|
359
|
-
modifyURLPrefix?: Record<string, string> | undefined;
|
|
360
|
-
globFollow?: boolean | undefined;
|
|
361
|
-
globIgnores?: string[] | undefined;
|
|
362
|
-
globPatterns?: string[] | undefined;
|
|
363
|
-
globStrict?: boolean | undefined;
|
|
364
|
-
templatedURLs?: Record<string, string | string[]> | undefined;
|
|
365
|
-
injectionPoint?: string | undefined;
|
|
366
|
-
}>;
|
|
121
|
+
}, z.core.$strict>;
|
|
367
122
|
//# sourceMappingURL=schema.d.ts.map
|
package/dist/lib/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/lib/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/lib/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,KAAK;;;;iBA0BhB,CAAC;AAEH,eAAO,MAAM,UAAU;;;iBAGrB,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;iBAYhC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAOhC,CAAC"}
|
package/dist/lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,GAAI,KAAK,MAAM,WAEhC,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,WAG3C,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,4BAErC,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,WAEzC,CAAC;AAIF;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,MAAM,GAAG,IAqBrD,CAAC;AAIF;;;;;;;GAOG;AACH,eAAO,MAAM,IAAI,GAAI,KAAK,MAAM,WAI/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/lib/validator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/lib/validator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAEhE,eAAO,MAAM,6BAA6B,GAAU,OAAO,OAAO,KAAG,OAAO,CAAC,6BAA6B,CAMzG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/plugins/build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/plugins/build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,KAAK,kBAAkB,EAAE,KAAK,cAAc,KAC9D,MAiBT,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/plugins/dev.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,MAAM,EAAiB,MAAM,MAAM,CAAC;AAElD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAStD;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/plugins/dev.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,MAAM,EAAiB,MAAM,MAAM,CAAC;AAElD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAStD;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAI,KAAK,kBAAkB,EAAE,KAAK,cAAc,KAAG,MAsCxE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/plugins/main.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,MAAM,CAAC;AAG/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/plugins/main.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,MAAM,CAAC;AAG/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,kBAAkB,EAAE,KAAK,cAAc,KAC7D,MAqCT,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serwist/vite",
|
|
3
|
-
"version": "9.0
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A module that integrates Serwist into your Vite application.",
|
|
6
6
|
"files": [
|
|
@@ -74,19 +74,19 @@
|
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"glob": "10.4.5",
|
|
76
76
|
"kolorist": "1.8.0",
|
|
77
|
-
"zod": "
|
|
78
|
-
"@serwist/build": "9.0
|
|
79
|
-
"serwist": "9.0
|
|
77
|
+
"zod": "4.0.5",
|
|
78
|
+
"@serwist/build": "9.1.0",
|
|
79
|
+
"serwist": "9.1.0"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@types/node": "
|
|
83
|
-
"rollup": "4.
|
|
84
|
-
"typescript": "5.
|
|
85
|
-
"vite": "
|
|
86
|
-
"@serwist/configs": "9.0
|
|
87
|
-
"serwist": "9.0
|
|
88
|
-
"@serwist/utils": "9.0
|
|
89
|
-
"@serwist/window": "9.0
|
|
82
|
+
"@types/node": "24.0.14",
|
|
83
|
+
"rollup": "4.45.1",
|
|
84
|
+
"typescript": "5.8.3",
|
|
85
|
+
"vite": "7.0.4",
|
|
86
|
+
"@serwist/configs": "9.1.0",
|
|
87
|
+
"serwist": "9.1.0",
|
|
88
|
+
"@serwist/utils": "9.1.0",
|
|
89
|
+
"@serwist/window": "9.1.0"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"typescript": ">=5.0.0",
|
package/src/lib/log.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { BuildResult } from "@serwist/build";
|
|
|
2
2
|
import { cyan, dim, green, yellow } from "kolorist";
|
|
3
3
|
import type { ResolvedConfig } from "vite";
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import packageJson from "../../package.json" with { type: "json" };
|
|
6
6
|
|
|
7
7
|
export const logSerwistResult = (buildResult: Pick<BuildResult, "count" | "size" | "warnings">, viteOptions: ResolvedConfig) => {
|
|
8
8
|
const { logLevel = "info" } = viteOptions;
|
|
@@ -15,7 +15,7 @@ export const logSerwistResult = (buildResult: Pick<BuildResult, "count" | "size"
|
|
|
15
15
|
console.info(
|
|
16
16
|
[
|
|
17
17
|
"",
|
|
18
|
-
`${cyan(`@serwist/vite v${version}`)} ${green("files generated.")}`,
|
|
18
|
+
`${cyan(`@serwist/vite v${packageJson.version}`)} ${green("files generated.")}`,
|
|
19
19
|
`${green("✓")} ${count} precache entries ${dim(`(${(size / 1024).toFixed(2)} KiB)`)}`,
|
|
20
20
|
// log build warning
|
|
21
21
|
warnings && warnings.length > 0 ? yellow(["⚠ warnings", ...warnings.map((w) => ` ${w}`), ""].join("\n")) : "",
|
package/src/lib/modules.ts
CHANGED
|
@@ -39,7 +39,7 @@ export const generateServiceWorker = async (ctx: SerwistViteContext) => {
|
|
|
39
39
|
|
|
40
40
|
const parsedSwDest = path.parse(ctx.options.injectManifest.swDest);
|
|
41
41
|
|
|
42
|
-
let injectManifestResult: BuildResult | undefined
|
|
42
|
+
let injectManifestResult: BuildResult | undefined;
|
|
43
43
|
|
|
44
44
|
if (ctx.options.injectManifest.injectionPoint) {
|
|
45
45
|
await ctx.options.integration?.beforeBuildServiceWorker?.(ctx.options);
|
package/src/lib/schema.ts
CHANGED
|
@@ -1,10 +1,32 @@
|
|
|
1
|
-
import { basePartial, globPartial, injectPartial, requiredGlobDirectoryPartial, requiredSwDestPartial } from "@serwist/build/schema";
|
|
1
|
+
import { fn, basePartial, globPartial, injectPartial, requiredGlobDirectoryPartial, requiredSwDestPartial, asyncFn } from "@serwist/build/schema";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
export const hooks = z.object({
|
|
5
|
-
beforeBuildServiceWorker: z
|
|
5
|
+
beforeBuildServiceWorker: z
|
|
6
|
+
.union([
|
|
7
|
+
fn({
|
|
8
|
+
input: [z.any()],
|
|
9
|
+
output: z.void(),
|
|
10
|
+
}),
|
|
11
|
+
asyncFn({
|
|
12
|
+
input: [z.any()],
|
|
13
|
+
output: z.void(),
|
|
14
|
+
}),
|
|
15
|
+
])
|
|
16
|
+
.optional(),
|
|
6
17
|
closeBundleOrder: z.union([z.literal("pre"), z.literal("post"), z.null()]).optional(),
|
|
7
|
-
configureOptions: z
|
|
18
|
+
configureOptions: z
|
|
19
|
+
.union([
|
|
20
|
+
fn({
|
|
21
|
+
input: [z.any(), z.any()],
|
|
22
|
+
output: z.void(),
|
|
23
|
+
}),
|
|
24
|
+
asyncFn({
|
|
25
|
+
input: [z.any(), z.any()],
|
|
26
|
+
output: z.void(),
|
|
27
|
+
}),
|
|
28
|
+
])
|
|
29
|
+
.optional(),
|
|
8
30
|
});
|
|
9
31
|
|
|
10
32
|
export const devOptions = z.object({
|
|
@@ -23,13 +45,14 @@ export const injectManifestPartial = z.object({
|
|
|
23
45
|
plugins: z.array(z.any()).default([]),
|
|
24
46
|
rollupFormat: z.union([z.literal("es"), z.literal("iife")]).default("es"),
|
|
25
47
|
rollupOptions: z.record(z.string(), z.any()).default({}),
|
|
26
|
-
devOptions: devOptions.
|
|
48
|
+
devOptions: devOptions.prefault({}),
|
|
27
49
|
});
|
|
28
50
|
|
|
29
|
-
export const injectManifestOptions =
|
|
30
|
-
.
|
|
31
|
-
.
|
|
32
|
-
.
|
|
33
|
-
.
|
|
34
|
-
.
|
|
35
|
-
.
|
|
51
|
+
export const injectManifestOptions = z.strictObject({
|
|
52
|
+
...basePartial.shape,
|
|
53
|
+
...globPartial.shape,
|
|
54
|
+
...injectPartial.shape,
|
|
55
|
+
...requiredSwDestPartial.shape,
|
|
56
|
+
...requiredGlobDirectoryPartial.shape,
|
|
57
|
+
...injectManifestPartial.shape,
|
|
58
|
+
});
|
package/src/lib/validator.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { SerwistConfigError, validationErrorMap } from "@serwist/build/schema";
|
|
2
|
+
import { z } from "zod";
|
|
2
3
|
import type { InjectManifestOptionsComplete } from "./types.js";
|
|
3
4
|
|
|
4
5
|
export const validateInjectManifestOptions = async (input: unknown): Promise<InjectManifestOptionsComplete> => {
|
|
5
|
-
const result = await (await import("./schema.js")).injectManifestOptions.spa(input, {
|
|
6
|
+
const result = await (await import("./schema.js")).injectManifestOptions.spa(input, { error: validationErrorMap });
|
|
6
7
|
if (!result.success) {
|
|
7
|
-
throw new SerwistConfigError({ moduleName: "@serwist/vite", message:
|
|
8
|
+
throw new SerwistConfigError({ moduleName: "@serwist/vite", message: z.prettifyError(result.error) });
|
|
8
9
|
}
|
|
9
10
|
return result.data;
|
|
10
11
|
};
|