@serwist/turbopack 9.5.7 → 9.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/chunks/index.schema-RVDaKxz4.js +189 -0
  2. package/dist/chunks/index.schema-RVDaKxz4.js.map +1 -0
  3. package/dist/index.d.mts +96 -0
  4. package/dist/index.d.mts.map +1 -0
  5. package/dist/index.mjs +166 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/dist/index.react.d.mts +42 -0
  8. package/dist/index.react.d.mts.map +1 -0
  9. package/dist/index.react.mjs +136 -0
  10. package/dist/index.react.mjs.map +1 -0
  11. package/dist/index.schema.d.mts +311 -0
  12. package/dist/index.schema.d.mts.map +1 -0
  13. package/dist/index.schema.mjs +2 -0
  14. package/dist/index.worker.d.mts +18 -0
  15. package/dist/index.worker.d.mts.map +1 -0
  16. package/dist/index.worker.mjs +227 -0
  17. package/dist/index.worker.mjs.map +1 -0
  18. package/package.json +34 -32
  19. package/dist/chunks/index.schema.js +0 -185
  20. package/dist/index.d.ts +0 -22
  21. package/dist/index.d.ts.map +0 -1
  22. package/dist/index.js +0 -190
  23. package/dist/index.react.d.ts +0 -25
  24. package/dist/index.react.d.ts.map +0 -1
  25. package/dist/index.react.js +0 -88
  26. package/dist/index.schema.d.ts +0 -301
  27. package/dist/index.schema.d.ts.map +0 -1
  28. package/dist/index.schema.js +0 -8
  29. package/dist/index.worker.d.ts +0 -14
  30. package/dist/index.worker.d.ts.map +0 -1
  31. package/dist/index.worker.js +0 -261
  32. package/dist/lib/constants.d.ts +0 -2
  33. package/dist/lib/constants.d.ts.map +0 -1
  34. package/dist/lib/context.d.ts +0 -7
  35. package/dist/lib/context.d.ts.map +0 -1
  36. package/dist/lib/index.d.ts +0 -3
  37. package/dist/lib/index.d.ts.map +0 -1
  38. package/dist/lib/logger.d.ts +0 -8
  39. package/dist/lib/logger.d.ts.map +0 -1
  40. package/dist/lib/utils.d.ts +0 -3
  41. package/dist/lib/utils.d.ts.map +0 -1
  42. package/dist/types.d.ts +0 -72
  43. package/dist/types.d.ts.map +0 -1
@@ -0,0 +1,136 @@
1
+ import { c } from "react/compiler-runtime";
2
+ import { Serwist } from "@serwist/window";
3
+ import { isCurrentPageOutOfScope } from "@serwist/window/internal";
4
+ import { createContext, useContext, useEffect, useState } from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ //#region src/lib/context.ts
7
+ const SerwistContext = createContext(null);
8
+ const useSerwist = () => {
9
+ const context = useContext(SerwistContext);
10
+ if (!context) throw new Error("[useSerwist]: 'SerwistContext' is not available.");
11
+ return context;
12
+ };
13
+ //#endregion
14
+ //#region src/index.react.tsx
15
+ /**
16
+ * `@serwist/window` provider for Next.js apps.
17
+ * @param options
18
+ * @returns
19
+ */
20
+ function SerwistProvider(t0) {
21
+ const $ = c(17);
22
+ const { swUrl, disable: t1, register: t2, cacheOnNavigation: t3, reloadOnOnline: t4, options, children } = t0;
23
+ const disable = t1 === void 0 ? false : t1;
24
+ const register = t2 === void 0 ? true : t2;
25
+ const cacheOnNavigation = t3 === void 0 ? true : t3;
26
+ const reloadOnOnline = t4 === void 0 ? true : t4;
27
+ let t5;
28
+ if ($[0] !== disable || $[1] !== options || $[2] !== register || $[3] !== swUrl) {
29
+ t5 = () => {
30
+ if (typeof window === "undefined") return null;
31
+ if (disable) return null;
32
+ const scope = options?.scope || "/";
33
+ if (!(window.serwist && window.serwist instanceof Serwist) && "serviceWorker" in navigator) {
34
+ window.serwist = new Serwist(swUrl, {
35
+ ...options,
36
+ scope,
37
+ type: options?.type || "module"
38
+ });
39
+ if (register && !isCurrentPageOutOfScope(scope)) window.serwist.register();
40
+ }
41
+ return window.serwist ?? null;
42
+ };
43
+ $[0] = disable;
44
+ $[1] = options;
45
+ $[2] = register;
46
+ $[3] = swUrl;
47
+ $[4] = t5;
48
+ } else t5 = $[4];
49
+ const [serwist] = useState(t5);
50
+ let t6;
51
+ let t7;
52
+ if ($[5] !== cacheOnNavigation || $[6] !== serwist) {
53
+ t6 = () => {
54
+ const cacheUrls = async (url) => {
55
+ if (!window.navigator.onLine || !url) return;
56
+ serwist?.messageSW({
57
+ type: "CACHE_URLS",
58
+ payload: { urlsToCache: [url] }
59
+ });
60
+ };
61
+ const cacheCurrentPathname = () => cacheUrls(window.location.pathname);
62
+ const pushState = history.pushState;
63
+ const replaceState = history.replaceState;
64
+ if (cacheOnNavigation) {
65
+ history.pushState = (...t8) => {
66
+ const args = t8;
67
+ pushState.apply(history, args);
68
+ cacheUrls(args[2]);
69
+ };
70
+ history.replaceState = (...t9) => {
71
+ const args_0 = t9;
72
+ replaceState.apply(history, args_0);
73
+ cacheUrls(args_0[2]);
74
+ };
75
+ window.addEventListener("online", cacheCurrentPathname);
76
+ }
77
+ return () => {
78
+ history.pushState = pushState;
79
+ history.replaceState = replaceState;
80
+ window.removeEventListener("online", cacheCurrentPathname);
81
+ };
82
+ };
83
+ t7 = [serwist, cacheOnNavigation];
84
+ $[5] = cacheOnNavigation;
85
+ $[6] = serwist;
86
+ $[7] = t6;
87
+ $[8] = t7;
88
+ } else {
89
+ t6 = $[7];
90
+ t7 = $[8];
91
+ }
92
+ useEffect(t6, t7);
93
+ let t8;
94
+ let t9;
95
+ if ($[9] !== reloadOnOnline) {
96
+ t8 = () => {
97
+ const reload = _temp;
98
+ if (reloadOnOnline) window.addEventListener("online", reload);
99
+ return () => {
100
+ window.removeEventListener("online", reload);
101
+ };
102
+ };
103
+ t9 = [reloadOnOnline];
104
+ $[9] = reloadOnOnline;
105
+ $[10] = t8;
106
+ $[11] = t9;
107
+ } else {
108
+ t8 = $[10];
109
+ t9 = $[11];
110
+ }
111
+ useEffect(t8, t9);
112
+ let t10;
113
+ if ($[12] !== serwist) {
114
+ t10 = { serwist };
115
+ $[12] = serwist;
116
+ $[13] = t10;
117
+ } else t10 = $[13];
118
+ let t11;
119
+ if ($[14] !== children || $[15] !== t10) {
120
+ t11 = /* @__PURE__ */ jsx(SerwistContext.Provider, {
121
+ value: t10,
122
+ children
123
+ });
124
+ $[14] = children;
125
+ $[15] = t10;
126
+ $[16] = t11;
127
+ } else t11 = $[16];
128
+ return t11;
129
+ }
130
+ function _temp() {
131
+ return location.reload();
132
+ }
133
+ //#endregion
134
+ export { SerwistProvider, useSerwist };
135
+
136
+ //# sourceMappingURL=index.react.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.react.mjs","names":["Serwist","createContext","useContext","SerwistContextValues","serwist","SerwistContext","useSerwist","context","Error","Serwist","isCurrentPageOutOfScope","ReactNode","useEffect","useState","SerwistContext","useSerwist","SerwistProviderProps","swUrl","disable","register","cacheOnNavigation","reloadOnOnline","options","RegistrationOptions","children","global","Window","serwist","SerwistProvider","t0","$","_c","t1","t2","t3","t4","undefined","t5","window","scope","navigator","type","t6","t7","cacheUrls","url","onLine","messageSW","payload","urlsToCache","cacheCurrentPathname","location","pathname","pushState","history","replaceState","t8","args","apply","t9","args_0","addEventListener","removeEventListener","reload","_temp","t10","t11"],"sources":["../src/lib/context.ts","../src/index.react.tsx"],"sourcesContent":["import type { Serwist } from \"@serwist/window\";\nimport { createContext, useContext } from \"react\";\n\nexport interface SerwistContextValues {\n serwist: Serwist | null;\n}\n\nexport const SerwistContext = createContext<SerwistContextValues>(null!);\n\nexport const useSerwist = () => {\n const context = useContext(SerwistContext);\n if (!context) {\n throw new Error(\"[useSerwist]: 'SerwistContext' is not available.\");\n }\n return context;\n};\n","import { Serwist } from \"@serwist/window\";\nimport { isCurrentPageOutOfScope } from \"@serwist/window/internal\";\nimport { type ReactNode, useEffect, useState } from \"react\";\nimport { SerwistContext, useSerwist } from \"./lib/context.js\";\n\nexport interface SerwistProviderProps {\n swUrl: string;\n disable?: boolean;\n register?: boolean;\n cacheOnNavigation?: boolean;\n reloadOnOnline?: boolean;\n options?: RegistrationOptions;\n children?: ReactNode;\n}\n\ndeclare global {\n interface Window {\n serwist: Serwist;\n }\n}\n\n/**\n * `@serwist/window` provider for Next.js apps.\n * @param options\n * @returns\n */\nexport function SerwistProvider({\n swUrl,\n disable = false,\n register = true,\n cacheOnNavigation = true,\n reloadOnOnline = true,\n options,\n children,\n}: SerwistProviderProps) {\n const [serwist] = useState(() => {\n if (typeof window === \"undefined\") return null;\n if (disable) return null;\n const scope = options?.scope || \"/\";\n if (!(window.serwist && window.serwist instanceof Serwist) && \"serviceWorker\" in navigator) {\n window.serwist = new Serwist(swUrl, { ...options, scope, type: options?.type || \"module\" });\n if (register && !isCurrentPageOutOfScope(scope)) {\n void window.serwist.register();\n }\n }\n return window.serwist ?? null;\n });\n useEffect(() => {\n const cacheUrls = async (url?: string | URL | null | undefined) => {\n if (!window.navigator.onLine || !url) {\n return;\n }\n serwist?.messageSW({\n type: \"CACHE_URLS\",\n payload: { urlsToCache: [url] },\n });\n };\n const cacheCurrentPathname = () => cacheUrls(window.location.pathname);\n const pushState = history.pushState;\n const replaceState = history.replaceState;\n\n if (cacheOnNavigation) {\n history.pushState = (...args) => {\n pushState.apply(history, args);\n cacheUrls(args[2]);\n };\n history.replaceState = (...args) => {\n replaceState.apply(history, args);\n cacheUrls(args[2]);\n };\n window.addEventListener(\"online\", cacheCurrentPathname);\n }\n\n return () => {\n history.pushState = pushState;\n history.replaceState = replaceState;\n window.removeEventListener(\"online\", cacheCurrentPathname);\n };\n }, [serwist, cacheOnNavigation]);\n useEffect(() => {\n const reload = () => location.reload();\n if (reloadOnOnline) {\n window.addEventListener(\"online\", reload);\n }\n return () => {\n window.removeEventListener(\"online\", reload);\n };\n }, [reloadOnOnline]);\n return <SerwistContext.Provider value={{ serwist }}>{children}</SerwistContext.Provider>;\n}\n\nexport { useSerwist };\n"],"mappings":";;;;;;AAOA,MAAaK,iBAAiBJ,cAAoC,KAAM;AAExE,MAAaK,mBAAa;CACxB,MAAAC,UAAgBL,WAAWG,eAAe;AAC1C,KAAI,CAACE,QACH,OAAM,IAAIC,MAAM,mDAAmD;AACpE,QACMD;;;;;;;;;ACYT,SAAOqB,gBAAAC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A,MAAAH;AAAAG,IAAA,MAAAmC;OAAAA,OAAAnC,EAAA;CAAA,IAAAoC;AAAA,KAAApC,EAAA,QAAAN,YAAAM,EAAA,QAAAmC,KAAA;AAA3CC,QAAA,oBAAA,eAAA,UAAA;GAAgC,OAAAD;GAAczC;GAAmC,CAAA;AAAAM,IAAA,MAAAN;AAAAM,IAAA,MAAAmC;AAAAnC,IAAA,MAAAoC;OAAAA,OAAApC,EAAA;AAAA,QAAjFoC;;AA9DF,SAAAF,QAAA;AAAA,QAsDkBb,SAAQY,QAAS"}
@@ -0,0 +1,311 @@
1
+ import z$1 from "zod";
2
+ import * as _$next_dist_server_config_shared_js0 from "next/dist/server/config-shared.js";
3
+ import * as _$next_dist_lib_load_custom_routes_js0 from "next/dist/lib/load-custom-routes.js";
4
+ import * as _$next_dist_shared_lib_image_config_js0 from "next/dist/shared/lib/image-config.js";
5
+
6
+ //#region src/index.schema.d.ts
7
+ declare const turboPartial: z$1.ZodObject<{
8
+ cwd: z$1.ZodPrefault<z$1.ZodString>;
9
+ nextConfig: z$1.ZodOptional<z$1.ZodObject<{
10
+ assetPrefix: z$1.ZodOptional<z$1.ZodString>;
11
+ basePath: z$1.ZodOptional<z$1.ZodString>;
12
+ distDir: z$1.ZodOptional<z$1.ZodString>;
13
+ }, z$1.z.core.$strip>>;
14
+ useNativeEsbuild: z$1.ZodPrefault<z$1.ZodBoolean>;
15
+ rebuildOnChange: z$1.ZodPrefault<z$1.ZodBoolean>;
16
+ esbuildOptions: z$1.ZodPrefault<z$1.ZodRecord<z$1.ZodLiteral<"bundle" | "splitting" | "preserveSymlinks" | "external" | "packages" | "alias" | "loader" | "resolveExtensions" | "mainFields" | "conditions" | "allowOverwrite" | "tsconfig" | "outExtension" | "publicPath" | "inject" | "banner" | "footer" | "plugins" | "sourcemap" | "legalComments" | "sourceRoot" | "sourcesContent" | "format" | "globalName" | "target" | "supported" | "mangleProps" | "reserveProps" | "mangleQuoted" | "mangleCache" | "drop" | "dropLabels" | "minify" | "minifyWhitespace" | "minifyIdentifiers" | "minifySyntax" | "lineLimit" | "charset" | "treeShaking" | "ignoreAnnotations" | "jsx" | "jsxFactory" | "jsxFragment" | "jsxImportSource" | "jsxDev" | "jsxSideEffects" | "define" | "pure" | "keepNames" | "absPaths" | "color" | "logLevel" | "logLimit" | "logOverride" | "tsconfigRaw"> & z$1.z.core.$partial, z$1.ZodAny>>;
17
+ }, z$1.z.core.$strict>;
18
+ declare const injectManifestOptions: z$1.ZodPipe<z$1.ZodObject<{
19
+ additionalPrecacheEntries: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
20
+ integrity: z$1.ZodOptional<z$1.ZodString>;
21
+ revision: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
22
+ url: z$1.ZodString;
23
+ }, z$1.z.core.$strict>]>>>;
24
+ dontCacheBustURLsMatching: z$1.ZodOptional<z$1.ZodCustom<RegExp, RegExp>>;
25
+ manifestTransforms: z$1.ZodOptional<z$1.ZodArray<z$1.ZodPipe<z$1.ZodCustom<z$1.z.core.$InferInnerFunctionTypeAsync<z$1.ZodTuple<[z$1.ZodArray<z$1.ZodObject<{
26
+ size: z$1.ZodNumber;
27
+ integrity: z$1.ZodOptional<z$1.ZodString>;
28
+ revision: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
29
+ url: z$1.ZodString;
30
+ }, z$1.z.core.$strip>>, z$1.ZodOptional<z$1.ZodUnknown>], null>, z$1.ZodObject<{
31
+ manifest: z$1.ZodArray<z$1.ZodObject<{
32
+ size: z$1.ZodNumber;
33
+ integrity: z$1.ZodOptional<z$1.ZodString>;
34
+ revision: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
35
+ url: z$1.ZodString;
36
+ }, z$1.z.core.$strip>>;
37
+ warnings: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
38
+ }, z$1.z.core.$strict>>, z$1.z.core.$InferInnerFunctionTypeAsync<z$1.ZodTuple<[z$1.ZodArray<z$1.ZodObject<{
39
+ size: z$1.ZodNumber;
40
+ integrity: z$1.ZodOptional<z$1.ZodString>;
41
+ revision: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
42
+ url: z$1.ZodString;
43
+ }, z$1.z.core.$strip>>, z$1.ZodOptional<z$1.ZodUnknown>], null>, z$1.ZodObject<{
44
+ manifest: z$1.ZodArray<z$1.ZodObject<{
45
+ size: z$1.ZodNumber;
46
+ integrity: z$1.ZodOptional<z$1.ZodString>;
47
+ revision: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
48
+ url: z$1.ZodString;
49
+ }, z$1.z.core.$strip>>;
50
+ warnings: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
51
+ }, z$1.z.core.$strict>>>, z$1.ZodTransform<z$1.z.core.$InferOuterFunctionTypeAsync<z$1.ZodTuple<[z$1.ZodArray<z$1.ZodObject<{
52
+ size: z$1.ZodNumber;
53
+ integrity: z$1.ZodOptional<z$1.ZodString>;
54
+ revision: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
55
+ url: z$1.ZodString;
56
+ }, z$1.z.core.$strip>>, z$1.ZodOptional<z$1.ZodUnknown>], null>, z$1.ZodObject<{
57
+ manifest: z$1.ZodArray<z$1.ZodObject<{
58
+ size: z$1.ZodNumber;
59
+ integrity: z$1.ZodOptional<z$1.ZodString>;
60
+ revision: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
61
+ url: z$1.ZodString;
62
+ }, z$1.z.core.$strip>>;
63
+ warnings: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
64
+ }, z$1.z.core.$strict>>, z$1.z.core.$InferInnerFunctionTypeAsync<z$1.ZodTuple<[z$1.ZodArray<z$1.ZodObject<{
65
+ size: z$1.ZodNumber;
66
+ integrity: z$1.ZodOptional<z$1.ZodString>;
67
+ revision: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
68
+ url: z$1.ZodString;
69
+ }, z$1.z.core.$strip>>, z$1.ZodOptional<z$1.ZodUnknown>], null>, z$1.ZodObject<{
70
+ manifest: z$1.ZodArray<z$1.ZodObject<{
71
+ size: z$1.ZodNumber;
72
+ integrity: z$1.ZodOptional<z$1.ZodString>;
73
+ revision: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
74
+ url: z$1.ZodString;
75
+ }, z$1.z.core.$strip>>;
76
+ warnings: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
77
+ }, z$1.z.core.$strict>>>>>>;
78
+ maximumFileSizeToCacheInBytes: z$1.ZodDefault<z$1.ZodNumber>;
79
+ modifyURLPrefix: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
80
+ globFollow: z$1.ZodDefault<z$1.ZodBoolean>;
81
+ globIgnores: z$1.ZodDefault<z$1.ZodArray<z$1.ZodString>>;
82
+ globPatterns: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
83
+ globStrict: z$1.ZodDefault<z$1.ZodBoolean>;
84
+ templatedURLs: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodArray<z$1.ZodString>]>>>;
85
+ injectionPoint: z$1.ZodDefault<z$1.ZodString>;
86
+ swSrc: z$1.ZodString;
87
+ globDirectory: z$1.ZodOptional<z$1.ZodString>;
88
+ cwd: z$1.ZodPrefault<z$1.ZodString>;
89
+ nextConfig: z$1.ZodOptional<z$1.ZodObject<{
90
+ assetPrefix: z$1.ZodOptional<z$1.ZodString>;
91
+ basePath: z$1.ZodOptional<z$1.ZodString>;
92
+ distDir: z$1.ZodOptional<z$1.ZodString>;
93
+ }, z$1.z.core.$strip>>;
94
+ useNativeEsbuild: z$1.ZodPrefault<z$1.ZodBoolean>;
95
+ rebuildOnChange: z$1.ZodPrefault<z$1.ZodBoolean>;
96
+ esbuildOptions: z$1.ZodPrefault<z$1.ZodRecord<z$1.ZodLiteral<"bundle" | "splitting" | "preserveSymlinks" | "external" | "packages" | "alias" | "loader" | "resolveExtensions" | "mainFields" | "conditions" | "allowOverwrite" | "tsconfig" | "outExtension" | "publicPath" | "inject" | "banner" | "footer" | "plugins" | "sourcemap" | "legalComments" | "sourceRoot" | "sourcesContent" | "format" | "globalName" | "target" | "supported" | "mangleProps" | "reserveProps" | "mangleQuoted" | "mangleCache" | "drop" | "dropLabels" | "minify" | "minifyWhitespace" | "minifyIdentifiers" | "minifySyntax" | "lineLimit" | "charset" | "treeShaking" | "ignoreAnnotations" | "jsx" | "jsxFactory" | "jsxFragment" | "jsxImportSource" | "jsxDev" | "jsxSideEffects" | "define" | "pure" | "keepNames" | "absPaths" | "color" | "logLevel" | "logLimit" | "logOverride" | "tsconfigRaw"> & z$1.z.core.$partial, z$1.ZodAny>>;
97
+ }, z$1.z.core.$strict>, z$1.ZodTransform<{
98
+ swSrc: string;
99
+ globPatterns: string[];
100
+ globDirectory: string;
101
+ dontCacheBustURLsMatching: RegExp;
102
+ nextConfig: {
103
+ distDir: string;
104
+ basePath: string;
105
+ assetPrefix: string;
106
+ output: "standalone" | "export";
107
+ allowedDevOrigins: string[];
108
+ exportPathMap: (defaultMap: _$next_dist_server_config_shared_js0.ExportPathMap, ctx: {
109
+ dev: boolean;
110
+ dir: string;
111
+ outDir: string | null;
112
+ distDir: string;
113
+ buildId: string;
114
+ }) => Promise<_$next_dist_server_config_shared_js0.ExportPathMap> | _$next_dist_server_config_shared_js0.ExportPathMap;
115
+ i18n: _$next_dist_server_config_shared_js0.I18NConfig | null;
116
+ typescript: _$next_dist_server_config_shared_js0.TypeScriptConfig;
117
+ typedRoutes: boolean;
118
+ headers: () => Promise<_$next_dist_lib_load_custom_routes_js0.Header[]> | _$next_dist_lib_load_custom_routes_js0.Header[];
119
+ rewrites: () => Promise<_$next_dist_lib_load_custom_routes_js0.Rewrite[] | {
120
+ beforeFiles?: _$next_dist_lib_load_custom_routes_js0.Rewrite[];
121
+ afterFiles?: _$next_dist_lib_load_custom_routes_js0.Rewrite[];
122
+ fallback?: _$next_dist_lib_load_custom_routes_js0.Rewrite[];
123
+ }> | _$next_dist_lib_load_custom_routes_js0.Rewrite[] | {
124
+ beforeFiles?: _$next_dist_lib_load_custom_routes_js0.Rewrite[];
125
+ afterFiles?: _$next_dist_lib_load_custom_routes_js0.Rewrite[];
126
+ fallback?: _$next_dist_lib_load_custom_routes_js0.Rewrite[];
127
+ };
128
+ redirects: () => Promise<_$next_dist_lib_load_custom_routes_js0.Redirect[]> | _$next_dist_lib_load_custom_routes_js0.Redirect[];
129
+ excludeDefaultMomentLocales: boolean;
130
+ webpack: _$next_dist_server_config_shared_js0.NextJsWebpackConfig | null;
131
+ trailingSlash: boolean;
132
+ env: Record<string, string | undefined>;
133
+ cleanDistDir: boolean;
134
+ cacheHandler: string;
135
+ adapterPath: string;
136
+ cacheHandlers: {
137
+ default?: string;
138
+ remote?: string;
139
+ static?: string;
140
+ [handlerName: string]: string | undefined;
141
+ };
142
+ cacheMaxMemorySize: number;
143
+ useFileSystemPublicRoutes: boolean;
144
+ generateBuildId: () => string | null | Promise<string | null>;
145
+ generateEtags: boolean;
146
+ pageExtensions: string[];
147
+ compress: boolean;
148
+ poweredByHeader: boolean;
149
+ images: Partial<_$next_dist_shared_lib_image_config_js0.ImageConfigComplete> & Required<_$next_dist_shared_lib_image_config_js0.ImageConfigComplete>;
150
+ devIndicators: false | {
151
+ position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
152
+ };
153
+ onDemandEntries: {
154
+ maxInactiveAge?: number;
155
+ pagesBufferLength?: number;
156
+ };
157
+ deploymentId: string;
158
+ sassOptions: {
159
+ implementation?: string;
160
+ [key: string]: any;
161
+ };
162
+ productionBrowserSourceMaps: boolean;
163
+ reactCompiler: boolean | _$next_dist_server_config_shared_js0.ReactCompilerOptions;
164
+ reactProductionProfiling: boolean;
165
+ reactStrictMode: boolean | null;
166
+ reactMaxHeadersLength: number;
167
+ httpAgentOptions: {
168
+ keepAlive?: boolean;
169
+ };
170
+ staticPageGenerationTimeout: number;
171
+ crossOrigin: "anonymous" | "use-credentials";
172
+ compiler: {
173
+ reactRemoveProperties?: boolean | {
174
+ properties?: string[];
175
+ };
176
+ relay?: {
177
+ src: string;
178
+ artifactDirectory?: string;
179
+ language?: "typescript" | "javascript" | "flow";
180
+ eagerEsModules?: boolean;
181
+ };
182
+ removeConsole?: boolean | {
183
+ exclude?: string[];
184
+ };
185
+ styledComponents?: boolean | _$next_dist_server_config_shared_js0.StyledComponentsConfig;
186
+ emotion?: boolean | _$next_dist_server_config_shared_js0.EmotionConfig;
187
+ styledJsx?: boolean | {
188
+ useLightningcss?: boolean;
189
+ };
190
+ define?: Record<string, string | number | boolean>;
191
+ defineServer?: Record<string, string | number | boolean>;
192
+ runAfterProductionCompile?: (metadata: {
193
+ projectDir: string;
194
+ distDir: string;
195
+ }) => Promise<void>;
196
+ };
197
+ transpilePackages: string[];
198
+ turbopack: _$next_dist_server_config_shared_js0.TurbopackOptions;
199
+ skipMiddlewareUrlNormalize: boolean;
200
+ skipProxyUrlNormalize: boolean;
201
+ skipTrailingSlashRedirect: boolean;
202
+ modularizeImports: Record<string, {
203
+ transform: string | Record<string, string>;
204
+ preventFullImport?: boolean;
205
+ skipDefaultConversion?: boolean;
206
+ }>;
207
+ logging: _$next_dist_server_config_shared_js0.LoggingConfig | false;
208
+ enablePrerenderSourceMaps: boolean;
209
+ cacheComponents: boolean;
210
+ cacheLife: {
211
+ [profile: string]: {
212
+ stale?: number;
213
+ revalidate?: number;
214
+ expire?: number;
215
+ };
216
+ };
217
+ expireTime: number;
218
+ experimental: _$next_dist_server_config_shared_js0.ExperimentalConfig & {
219
+ prefetchInlining?: _$next_dist_server_config_shared_js0.PrefetchInliningConfig;
220
+ };
221
+ bundlePagesRouterDependencies: boolean;
222
+ serverExternalPackages: string[];
223
+ outputFileTracingRoot: string;
224
+ outputFileTracingExcludes: Record<string, string[]>;
225
+ outputFileTracingIncludes: Record<string, string[]>;
226
+ watchOptions: {
227
+ pollIntervalMs?: number;
228
+ };
229
+ htmlLimitedBots: RegExp & string;
230
+ configFile: string | undefined;
231
+ configFileName: string;
232
+ distDirRoot: string;
233
+ } | {
234
+ distDir: string;
235
+ basePath: string;
236
+ assetPrefix: string;
237
+ };
238
+ maximumFileSizeToCacheInBytes: number;
239
+ globFollow: boolean;
240
+ globIgnores: string[];
241
+ globStrict: boolean;
242
+ injectionPoint: string;
243
+ cwd: string;
244
+ useNativeEsbuild: boolean;
245
+ rebuildOnChange: boolean;
246
+ esbuildOptions: Partial<Record<"bundle" | "splitting" | "preserveSymlinks" | "external" | "packages" | "alias" | "loader" | "resolveExtensions" | "mainFields" | "conditions" | "allowOverwrite" | "tsconfig" | "outExtension" | "publicPath" | "inject" | "banner" | "footer" | "plugins" | "sourcemap" | "legalComments" | "sourceRoot" | "sourcesContent" | "format" | "globalName" | "target" | "supported" | "mangleProps" | "reserveProps" | "mangleQuoted" | "mangleCache" | "drop" | "dropLabels" | "minify" | "minifyWhitespace" | "minifyIdentifiers" | "minifySyntax" | "lineLimit" | "charset" | "treeShaking" | "ignoreAnnotations" | "jsx" | "jsxFactory" | "jsxFragment" | "jsxImportSource" | "jsxDev" | "jsxSideEffects" | "define" | "pure" | "keepNames" | "absPaths" | "color" | "logLevel" | "logLimit" | "logOverride" | "tsconfigRaw", any>>;
247
+ additionalPrecacheEntries?: (string | {
248
+ url: string;
249
+ integrity?: string | undefined;
250
+ revision?: string | null | undefined;
251
+ })[] | undefined;
252
+ manifestTransforms?: z$1.z.core.$InferOuterFunctionTypeAsync<z$1.ZodTuple<[z$1.ZodArray<z$1.ZodObject<{
253
+ size: z$1.ZodNumber;
254
+ integrity: z$1.ZodOptional<z$1.ZodString>;
255
+ revision: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
256
+ url: z$1.ZodString;
257
+ }, z$1.z.core.$strip>>, z$1.ZodOptional<z$1.ZodUnknown>], null>, z$1.ZodObject<{
258
+ manifest: z$1.ZodArray<z$1.ZodObject<{
259
+ size: z$1.ZodNumber;
260
+ integrity: z$1.ZodOptional<z$1.ZodString>;
261
+ revision: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
262
+ url: z$1.ZodString;
263
+ }, z$1.z.core.$strip>>;
264
+ warnings: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
265
+ }, z$1.z.core.$strict>>[] | undefined;
266
+ modifyURLPrefix?: Record<string, string> | undefined;
267
+ templatedURLs?: Record<string, string | string[]> | undefined;
268
+ }, {
269
+ maximumFileSizeToCacheInBytes: number;
270
+ globFollow: boolean;
271
+ globIgnores: string[];
272
+ globStrict: boolean;
273
+ injectionPoint: string;
274
+ swSrc: string;
275
+ cwd: string;
276
+ useNativeEsbuild: boolean;
277
+ rebuildOnChange: boolean;
278
+ esbuildOptions: Partial<Record<"bundle" | "splitting" | "preserveSymlinks" | "external" | "packages" | "alias" | "loader" | "resolveExtensions" | "mainFields" | "conditions" | "allowOverwrite" | "tsconfig" | "outExtension" | "publicPath" | "inject" | "banner" | "footer" | "plugins" | "sourcemap" | "legalComments" | "sourceRoot" | "sourcesContent" | "format" | "globalName" | "target" | "supported" | "mangleProps" | "reserveProps" | "mangleQuoted" | "mangleCache" | "drop" | "dropLabels" | "minify" | "minifyWhitespace" | "minifyIdentifiers" | "minifySyntax" | "lineLimit" | "charset" | "treeShaking" | "ignoreAnnotations" | "jsx" | "jsxFactory" | "jsxFragment" | "jsxImportSource" | "jsxDev" | "jsxSideEffects" | "define" | "pure" | "keepNames" | "absPaths" | "color" | "logLevel" | "logLimit" | "logOverride" | "tsconfigRaw", any>>;
279
+ additionalPrecacheEntries?: (string | {
280
+ url: string;
281
+ integrity?: string | undefined;
282
+ revision?: string | null | undefined;
283
+ })[] | undefined;
284
+ dontCacheBustURLsMatching?: RegExp | undefined;
285
+ manifestTransforms?: z$1.z.core.$InferOuterFunctionTypeAsync<z$1.ZodTuple<[z$1.ZodArray<z$1.ZodObject<{
286
+ size: z$1.ZodNumber;
287
+ integrity: z$1.ZodOptional<z$1.ZodString>;
288
+ revision: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
289
+ url: z$1.ZodString;
290
+ }, z$1.z.core.$strip>>, z$1.ZodOptional<z$1.ZodUnknown>], null>, z$1.ZodObject<{
291
+ manifest: z$1.ZodArray<z$1.ZodObject<{
292
+ size: z$1.ZodNumber;
293
+ integrity: z$1.ZodOptional<z$1.ZodString>;
294
+ revision: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
295
+ url: z$1.ZodString;
296
+ }, z$1.z.core.$strip>>;
297
+ warnings: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
298
+ }, z$1.z.core.$strict>>[] | undefined;
299
+ modifyURLPrefix?: Record<string, string> | undefined;
300
+ globPatterns?: string[] | undefined;
301
+ templatedURLs?: Record<string, string | string[]> | undefined;
302
+ globDirectory?: string | undefined;
303
+ nextConfig?: {
304
+ assetPrefix?: string | undefined;
305
+ basePath?: string | undefined;
306
+ distDir?: string | undefined;
307
+ } | undefined;
308
+ }>>;
309
+ //#endregion
310
+ export { injectManifestOptions, turboPartial };
311
+ //# sourceMappingURL=index.schema.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.schema.d.mts","names":[],"sources":["../src/index.schema.ts"],"mappings":";;;;;;cASa,YAAA,EAAY,GAAA,CAAA,SAAA;;;;;;;;;;;cAcZ,qBAAA,EAAqB,GAAA,CAAA,OAAA,CAAA,GAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2DA8Cq3gC,OAAA;mBAAA,sCAAA,CAAgC,OAAA;iBAAA,sCAAA,CAA8B,OAAA;IAAA;2DAAwD,OAAA;mBAAA,sCAAA,CAAgC,OAAA;iBAAA,sCAAA,CAA8B,OAAA;IAAA;6BAAA,sCAAA,CAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wEAA0wQ,sBAAA;0BAAA,oCAAA,CAAoD,aAAA;;;;eAAqR,MAAA;qBAA0P,MAAA;mCAA+S,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAvClrzC,sBAAA;IAAA"}
@@ -0,0 +1,2 @@
1
+ import { n as turboPartial, t as injectManifestOptions } from "./chunks/index.schema-RVDaKxz4.js";
2
+ export { injectManifestOptions, turboPartial };
@@ -0,0 +1,18 @@
1
+ import { RuntimeCaching } from "serwist";
2
+
3
+ //#region src/index.worker.d.ts
4
+ declare const PAGES_CACHE_NAME: {
5
+ readonly rscPrefetch: "pages-rsc-prefetch";
6
+ readonly rsc: "pages-rsc";
7
+ readonly html: "pages";
8
+ };
9
+ /**
10
+ * The default, recommended list of caching strategies for applications
11
+ * built with Next.js.
12
+ *
13
+ * @see https://serwist.pages.dev/docs/next/worker-exports#default-cache
14
+ */
15
+ declare const defaultCache: RuntimeCaching[];
16
+ //#endregion
17
+ export { PAGES_CACHE_NAME, defaultCache };
18
+ //# sourceMappingURL=index.worker.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.worker.d.mts","names":[],"sources":["../src/index.worker.ts"],"mappings":";;;cAGa,gBAAA;EAAA;;;;;;;;;;cAYA,YAAA,EAAc,cAAA"}