@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
package/dist/index.js DELETED
@@ -1,190 +0,0 @@
1
- import crypto from 'node:crypto';
2
- import fs from 'node:fs';
3
- import path from 'node:path';
4
- import { rebasePath, getFileManifestEntries } from '@serwist/build';
5
- import { validationErrorMap, SerwistConfigError } from '@serwist/build/schema';
6
- import { browserslistToEsbuild } from '@serwist/utils';
7
- import browserslist from 'browserslist';
8
- import { cyan, dim, yellow } from 'kolorist';
9
- import { MODERN_BROWSERSLIST_TARGET } from 'next/constants.js';
10
- import { NextResponse } from 'next/server.js';
11
- import { z } from 'zod';
12
- import { i as injectManifestOptions, l as logger } from './chunks/index.schema.js';
13
- import 'semver';
14
- import 'node:module';
15
-
16
- let esbuildWasm = null;
17
- let esbuildNative = null;
18
- const logSerwistResult = (filePath, buildResult)=>{
19
- const { count, size, warnings } = buildResult;
20
- const hasWarnings = warnings && warnings.length > 0;
21
- if (filePath === "sw.js" && (hasWarnings || count > 0)) {
22
- logger[hasWarnings ? "warn" : "event"](`${cyan(count)} precache entries ${dim(`(${(size / 1024).toFixed(2)} KiB)`)}${hasWarnings ? `\n${yellow([
23
- "⚠ warnings",
24
- ...warnings.map((w)=>` ${w}`),
25
- ""
26
- ].join("\n"))}` : ""}`);
27
- }
28
- };
29
- const validateGetManifestOptions = async (input)=>{
30
- const result = await injectManifestOptions.spa(input, {
31
- error: validationErrorMap
32
- });
33
- if (!result.success) {
34
- throw new SerwistConfigError({
35
- moduleName: "@serwist/turbopack",
36
- message: z.prettifyError(result.error)
37
- });
38
- }
39
- return result.data;
40
- };
41
- const isDev = process.env.NODE_ENV === "development";
42
- const contentTypeMap = {
43
- ".js": "application/javascript",
44
- ".map": "application/json; charset=UTF-8"
45
- };
46
- const createSerwistRoute = (options)=>{
47
- const dynamic = "force-static", dynamicParams = false, revalidate = false;
48
- const validation = validateGetManifestOptions(options).then((config)=>{
49
- return {
50
- ...config,
51
- disablePrecacheManifest: isDev,
52
- additionalPrecacheEntries: isDev ? [] : config.additionalPrecacheEntries,
53
- globIgnores: [
54
- ...config.globIgnores,
55
- rebasePath({
56
- file: config.swSrc,
57
- baseDirectory: config.globDirectory
58
- })
59
- ],
60
- manifestTransforms: [
61
- ...config.manifestTransforms ?? [],
62
- async (manifestEntries)=>{
63
- const manifest = manifestEntries.map((m)=>{
64
- if (m.url.startsWith(config.nextConfig.distDir)) {
65
- m.url = `${config.nextConfig.assetPrefix}/_next/${m.url.slice(config.nextConfig.distDir.length)}`;
66
- }
67
- if (m.url.startsWith("public/")) {
68
- m.url = path.posix.join(config.nextConfig.basePath, m.url.slice(7));
69
- }
70
- return m;
71
- });
72
- return {
73
- manifest,
74
- warnings: []
75
- };
76
- }
77
- ]
78
- };
79
- });
80
- let lastHash = null;
81
- let map = null;
82
- const loadMap = async (filePath)=>{
83
- const config = await validation;
84
- const { count, size, manifestEntries, warnings } = await getFileManifestEntries(config);
85
- const injectionPoint = config.injectionPoint || "";
86
- const manifestString = manifestEntries === undefined ? "undefined" : JSON.stringify(manifestEntries, null, 2);
87
- const log = (type, ...message)=>{
88
- if (filePath === "sw.js") {
89
- logger[type](...message);
90
- }
91
- };
92
- let esbuild;
93
- if (config.useNativeEsbuild) {
94
- log("info", "Using esbuild to bundle the service worker.");
95
- if (!esbuildNative) esbuildNative = import(/* webpackIgnore: true */ 'esbuild');
96
- esbuild = await esbuildNative;
97
- } else {
98
- log("info", "Using esbuild-wasm to bundle the service worker.");
99
- if (!esbuildWasm) esbuildWasm = import(/* webpackIgnore: true */ 'esbuild-wasm');
100
- esbuild = await esbuildWasm;
101
- }
102
- logSerwistResult(filePath, {
103
- count,
104
- size,
105
- warnings
106
- });
107
- const result = await esbuild.build({
108
- sourcemap: true,
109
- format: "esm",
110
- treeShaking: true,
111
- minify: !isDev,
112
- bundle: true,
113
- ...config.esbuildOptions,
114
- target: config.esbuildOptions?.target ?? browserslistToEsbuild(browserslist, config.cwd, MODERN_BROWSERSLIST_TARGET),
115
- platform: "browser",
116
- define: {
117
- ...config.esbuildOptions.define,
118
- ...injectionPoint ? {
119
- [injectionPoint]: manifestString
120
- } : {}
121
- },
122
- outdir: config.cwd,
123
- write: false,
124
- entryNames: "[name]",
125
- assetNames: "[name]-[hash]",
126
- chunkNames: "[name]-[hash]",
127
- entryPoints: [
128
- {
129
- in: config.swSrc,
130
- out: "sw"
131
- }
132
- ]
133
- });
134
- if (result.errors.length) {
135
- console.error("Failed to build the service worker.", result.errors);
136
- throw new Error();
137
- }
138
- if (result.warnings.length) {
139
- console.warn(result.warnings);
140
- }
141
- return new Map(result.outputFiles.map((e)=>[
142
- e.path,
143
- e.text
144
- ]));
145
- };
146
- const generateStaticParams = async ()=>{
147
- const config = await validation;
148
- if (!map) map = await loadMap("root");
149
- return [
150
- ...map.keys()
151
- ].map((e)=>({
152
- path: path.relative(config.cwd, e)
153
- }));
154
- };
155
- const GET = async (_, { params })=>{
156
- const { path: filePath } = await params;
157
- const config = await validation;
158
- if (isDev && config.rebuildOnChange) {
159
- const swContent = fs.readFileSync(config.swSrc, "utf-8");
160
- const currentHash = crypto.createHash("sha256").update(swContent).digest("hex");
161
- if (!map || lastHash !== currentHash) {
162
- map = await loadMap(filePath);
163
- lastHash = currentHash;
164
- }
165
- } else if (!map) map = await loadMap(filePath);
166
- return new NextResponse(map.get(path.join(config.cwd, filePath)), {
167
- headers: {
168
- "Content-Type": contentTypeMap[path.extname(filePath)] || "text/plain",
169
- "Service-Worker-Allowed": "/"
170
- }
171
- });
172
- };
173
- return {
174
- dynamic,
175
- dynamicParams,
176
- revalidate,
177
- generateStaticParams,
178
- GET
179
- };
180
- };
181
- const withSerwist = (nextConfig = {})=>({
182
- ...nextConfig,
183
- serverExternalPackages: [
184
- ...nextConfig.serverExternalPackages ?? [],
185
- "esbuild",
186
- "esbuild-wasm"
187
- ]
188
- });
189
-
190
- export { createSerwistRoute, withSerwist };
@@ -1,25 +0,0 @@
1
- import { Serwist } from "@serwist/window";
2
- import { type ReactNode } from "react";
3
- import { useSerwist } from "./lib/context.js";
4
- export interface SerwistProviderProps {
5
- swUrl: string;
6
- disable?: boolean;
7
- register?: boolean;
8
- cacheOnNavigation?: boolean;
9
- reloadOnOnline?: boolean;
10
- options?: RegistrationOptions;
11
- children?: ReactNode;
12
- }
13
- declare global {
14
- interface Window {
15
- serwist: Serwist;
16
- }
17
- }
18
- /**
19
- * `@serwist/window` provider for Next.js apps.
20
- * @param options
21
- * @returns
22
- */
23
- export declare function SerwistProvider({ swUrl, disable, register, cacheOnNavigation, reloadOnOnline, options, children, }: SerwistProviderProps): import("react").JSX.Element;
24
- export { useSerwist };
25
- //# sourceMappingURL=index.react.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.react.d.ts","sourceRoot":"","sources":["../src/index.react.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAkB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9D,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,OAAO,EAAE,OAAO,CAAC;KAClB;CACF;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,OAAe,EACf,QAAe,EACf,iBAAwB,EACxB,cAAqB,EACrB,OAAO,EACP,QAAQ,GACT,EAAE,oBAAoB,+BAuDtB;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1,88 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { Serwist } from '@serwist/window';
3
- import { isCurrentPageOutOfScope } from '@serwist/window/internal';
4
- import { createContext, useContext, useState, useEffect } from 'react';
5
-
6
- const SerwistContext = createContext(null);
7
- const useSerwist = ()=>{
8
- const context = useContext(SerwistContext);
9
- if (!context) {
10
- throw new Error("[useSerwist]: 'SerwistContext' is not available.");
11
- }
12
- return context;
13
- };
14
-
15
- function SerwistProvider({ swUrl, disable = false, register = true, cacheOnNavigation = true, reloadOnOnline = true, options, children }) {
16
- const [serwist] = useState(()=>{
17
- if (typeof window === "undefined") return null;
18
- if (disable) return null;
19
- const scope = options?.scope || "/";
20
- if (!(window.serwist && window.serwist instanceof Serwist) && "serviceWorker" in navigator) {
21
- window.serwist = new Serwist(swUrl, {
22
- ...options,
23
- scope,
24
- type: options?.type || "module"
25
- });
26
- if (register && !isCurrentPageOutOfScope(scope)) {
27
- void window.serwist.register();
28
- }
29
- }
30
- return window.serwist ?? null;
31
- });
32
- useEffect(()=>{
33
- const cacheUrls = async (url)=>{
34
- if (!window.navigator.onLine || !url) {
35
- return;
36
- }
37
- serwist?.messageSW({
38
- type: "CACHE_URLS",
39
- payload: {
40
- urlsToCache: [
41
- url
42
- ]
43
- }
44
- });
45
- };
46
- const cacheCurrentPathname = ()=>cacheUrls(window.location.pathname);
47
- const pushState = history.pushState;
48
- const replaceState = history.replaceState;
49
- if (cacheOnNavigation) {
50
- history.pushState = (...args)=>{
51
- pushState.apply(history, args);
52
- cacheUrls(args[2]);
53
- };
54
- history.replaceState = (...args)=>{
55
- replaceState.apply(history, args);
56
- cacheUrls(args[2]);
57
- };
58
- window.addEventListener("online", cacheCurrentPathname);
59
- }
60
- return ()=>{
61
- history.pushState = pushState;
62
- history.replaceState = replaceState;
63
- window.removeEventListener("online", cacheCurrentPathname);
64
- };
65
- }, [
66
- serwist,
67
- cacheOnNavigation
68
- ]);
69
- useEffect(()=>{
70
- const reload = ()=>location.reload();
71
- if (reloadOnOnline) {
72
- window.addEventListener("online", reload);
73
- }
74
- return ()=>{
75
- window.removeEventListener("online", reload);
76
- };
77
- }, [
78
- reloadOnOnline
79
- ]);
80
- return jsx(SerwistContext.Provider, {
81
- value: {
82
- serwist
83
- },
84
- children: children
85
- });
86
- }
87
-
88
- export { SerwistProvider, useSerwist };
@@ -1,301 +0,0 @@
1
- import z from "zod";
2
- export declare const turboPartial: z.ZodObject<{
3
- cwd: z.ZodPrefault<z.ZodString>;
4
- nextConfig: z.ZodOptional<z.ZodObject<{
5
- assetPrefix: z.ZodOptional<z.ZodString>;
6
- basePath: z.ZodOptional<z.ZodString>;
7
- distDir: z.ZodOptional<z.ZodString>;
8
- }, z.z.core.$strip>>;
9
- useNativeEsbuild: z.ZodPrefault<z.ZodBoolean>;
10
- rebuildOnChange: z.ZodPrefault<z.ZodBoolean>;
11
- esbuildOptions: z.ZodPrefault<z.ZodRecord<z.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.z.core.$partial, z.ZodAny>>;
12
- }, z.z.core.$strict>;
13
- export declare const injectManifestOptions: z.ZodPipe<z.ZodObject<{
14
- cwd: z.ZodPrefault<z.ZodString>;
15
- useNativeEsbuild: z.ZodPrefault<z.ZodBoolean>;
16
- rebuildOnChange: z.ZodPrefault<z.ZodBoolean>;
17
- esbuildOptions: z.ZodPrefault<z.ZodRecord<z.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.z.core.$partial, z.ZodAny>>;
18
- nextConfig: z.ZodOptional<z.ZodObject<{
19
- assetPrefix: z.ZodOptional<z.ZodString>;
20
- basePath: z.ZodOptional<z.ZodString>;
21
- distDir: z.ZodOptional<z.ZodString>;
22
- }, z.z.core.$strip>>;
23
- additionalPrecacheEntries: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
24
- integrity: z.ZodOptional<z.ZodString>;
25
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
- url: z.ZodString;
27
- }, z.z.core.$strict>]>>>;
28
- dontCacheBustURLsMatching: z.ZodOptional<z.ZodCustom<RegExp, RegExp>>;
29
- manifestTransforms: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodCustom<z.z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodArray<z.ZodObject<{
30
- size: z.ZodNumber;
31
- integrity: z.ZodOptional<z.ZodString>;
32
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
- url: z.ZodString;
34
- }, z.z.core.$strip>>, z.ZodOptional<z.ZodUnknown>], null>, z.ZodObject<{
35
- manifest: z.ZodArray<z.ZodObject<{
36
- size: z.ZodNumber;
37
- integrity: z.ZodOptional<z.ZodString>;
38
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
39
- url: z.ZodString;
40
- }, z.z.core.$strip>>;
41
- warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
42
- }, z.z.core.$strict>>, z.z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodArray<z.ZodObject<{
43
- size: z.ZodNumber;
44
- integrity: z.ZodOptional<z.ZodString>;
45
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
46
- url: z.ZodString;
47
- }, z.z.core.$strip>>, z.ZodOptional<z.ZodUnknown>], null>, z.ZodObject<{
48
- manifest: z.ZodArray<z.ZodObject<{
49
- size: z.ZodNumber;
50
- integrity: z.ZodOptional<z.ZodString>;
51
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
- url: z.ZodString;
53
- }, z.z.core.$strip>>;
54
- warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
55
- }, z.z.core.$strict>>>, z.ZodTransform<z.z.core.$InferOuterFunctionTypeAsync<z.ZodTuple<[z.ZodArray<z.ZodObject<{
56
- size: z.ZodNumber;
57
- integrity: z.ZodOptional<z.ZodString>;
58
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
59
- url: z.ZodString;
60
- }, z.z.core.$strip>>, z.ZodOptional<z.ZodUnknown>], null>, z.ZodObject<{
61
- manifest: z.ZodArray<z.ZodObject<{
62
- size: z.ZodNumber;
63
- integrity: z.ZodOptional<z.ZodString>;
64
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
65
- url: z.ZodString;
66
- }, z.z.core.$strip>>;
67
- warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
68
- }, z.z.core.$strict>>, z.z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodArray<z.ZodObject<{
69
- size: z.ZodNumber;
70
- integrity: z.ZodOptional<z.ZodString>;
71
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
72
- url: z.ZodString;
73
- }, z.z.core.$strip>>, z.ZodOptional<z.ZodUnknown>], null>, z.ZodObject<{
74
- manifest: z.ZodArray<z.ZodObject<{
75
- size: z.ZodNumber;
76
- integrity: z.ZodOptional<z.ZodString>;
77
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
78
- url: z.ZodString;
79
- }, z.z.core.$strip>>;
80
- warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
81
- }, z.z.core.$strict>>>>>>;
82
- maximumFileSizeToCacheInBytes: z.ZodDefault<z.ZodNumber>;
83
- modifyURLPrefix: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
84
- globFollow: z.ZodDefault<z.ZodBoolean>;
85
- globIgnores: z.ZodDefault<z.ZodArray<z.ZodString>>;
86
- globPatterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
87
- globStrict: z.ZodDefault<z.ZodBoolean>;
88
- templatedURLs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
89
- injectionPoint: z.ZodDefault<z.ZodString>;
90
- swSrc: z.ZodString;
91
- globDirectory: z.ZodOptional<z.ZodString>;
92
- }, z.z.core.$strict>, z.ZodTransform<{
93
- swSrc: string;
94
- globPatterns: string[];
95
- globDirectory: string;
96
- dontCacheBustURLsMatching: RegExp;
97
- nextConfig: {
98
- distDir: string;
99
- basePath: string;
100
- assetPrefix: string;
101
- allowedDevOrigins: string[];
102
- exportPathMap: (defaultMap: import("next/dist/server/config-shared.js").ExportPathMap, ctx: {
103
- dev: boolean;
104
- dir: string;
105
- outDir: string | null;
106
- distDir: string;
107
- buildId: string;
108
- }) => Promise<import("next/dist/server/config-shared.js").ExportPathMap> | import("next/dist/server/config-shared.js").ExportPathMap;
109
- i18n: import("next/dist/server/config-shared.js").I18NConfig | null;
110
- typescript: import("next/dist/server/config-shared.js").TypeScriptConfig;
111
- typedRoutes: boolean;
112
- headers: () => Promise<import("next/dist/lib/load-custom-routes.js").Header[]> | import("next/dist/lib/load-custom-routes.js").Header[];
113
- rewrites: () => Promise<import("next/dist/lib/load-custom-routes.js").Rewrite[] | {
114
- beforeFiles?: import("next/dist/lib/load-custom-routes.js").Rewrite[];
115
- afterFiles?: import("next/dist/lib/load-custom-routes.js").Rewrite[];
116
- fallback?: import("next/dist/lib/load-custom-routes.js").Rewrite[];
117
- }> | import("next/dist/lib/load-custom-routes.js").Rewrite[] | {
118
- beforeFiles?: import("next/dist/lib/load-custom-routes.js").Rewrite[];
119
- afterFiles?: import("next/dist/lib/load-custom-routes.js").Rewrite[];
120
- fallback?: import("next/dist/lib/load-custom-routes.js").Rewrite[];
121
- };
122
- redirects: () => Promise<import("next/dist/lib/load-custom-routes.js").Redirect[]> | import("next/dist/lib/load-custom-routes.js").Redirect[];
123
- excludeDefaultMomentLocales: boolean;
124
- webpack: import("next/dist/server/config-shared.js").NextJsWebpackConfig | null;
125
- trailingSlash: boolean;
126
- env: Record<string, string | undefined>;
127
- cleanDistDir: boolean;
128
- cacheHandler: string;
129
- cacheHandlers: {
130
- default?: string;
131
- remote?: string;
132
- static?: string;
133
- [handlerName: string]: string | undefined;
134
- };
135
- cacheMaxMemorySize: number;
136
- useFileSystemPublicRoutes: boolean;
137
- generateBuildId: () => string | null | Promise<string | null>;
138
- generateEtags: boolean;
139
- pageExtensions: string[];
140
- compress: boolean;
141
- poweredByHeader: boolean;
142
- images: Partial<import("next/dist/shared/lib/image-config.js").ImageConfigComplete> & Required<import("next/dist/shared/lib/image-config.js").ImageConfigComplete>;
143
- devIndicators: false | {
144
- position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
145
- };
146
- onDemandEntries: {
147
- maxInactiveAge?: number;
148
- pagesBufferLength?: number;
149
- };
150
- deploymentId: string;
151
- sassOptions: {
152
- implementation?: string;
153
- [key: string]: any;
154
- };
155
- productionBrowserSourceMaps: boolean;
156
- reactCompiler: boolean | import("next/dist/server/config-shared.js").ReactCompilerOptions;
157
- reactProductionProfiling: boolean;
158
- reactStrictMode: boolean | null;
159
- reactMaxHeadersLength: number;
160
- httpAgentOptions: {
161
- keepAlive?: boolean;
162
- };
163
- staticPageGenerationTimeout: number;
164
- crossOrigin: "anonymous" | "use-credentials";
165
- compiler: {
166
- reactRemoveProperties?: boolean | {
167
- properties?: string[];
168
- };
169
- relay?: {
170
- src: string;
171
- artifactDirectory?: string;
172
- language?: "typescript" | "javascript" | "flow";
173
- eagerEsModules?: boolean;
174
- };
175
- removeConsole?: boolean | {
176
- exclude?: string[];
177
- };
178
- styledComponents?: boolean | import("next/dist/server/config-shared.js").StyledComponentsConfig;
179
- emotion?: boolean | import("next/dist/server/config-shared.js").EmotionConfig;
180
- styledJsx?: boolean | {
181
- useLightningcss?: boolean;
182
- };
183
- define?: Record<string, string>;
184
- defineServer?: Record<string, string>;
185
- runAfterProductionCompile?: (metadata: {
186
- projectDir: string;
187
- distDir: string;
188
- }) => Promise<void>;
189
- };
190
- output: "standalone" | "export";
191
- transpilePackages: string[];
192
- turbopack: import("next/dist/server/config-shared.js").TurbopackOptions;
193
- skipMiddlewareUrlNormalize: boolean;
194
- skipProxyUrlNormalize: boolean;
195
- skipTrailingSlashRedirect: boolean;
196
- modularizeImports: Record<string, {
197
- transform: string | Record<string, string>;
198
- preventFullImport?: boolean;
199
- skipDefaultConversion?: boolean;
200
- }>;
201
- logging: import("next/dist/server/config-shared.js").LoggingConfig | false;
202
- enablePrerenderSourceMaps: boolean;
203
- cacheComponents: boolean;
204
- cacheLife: {
205
- [profile: string]: {
206
- stale?: number;
207
- revalidate?: number;
208
- expire?: number;
209
- };
210
- };
211
- expireTime: number;
212
- experimental: import("next/dist/server/config-shared.js").ExperimentalConfig;
213
- bundlePagesRouterDependencies: boolean;
214
- serverExternalPackages: string[];
215
- outputFileTracingRoot: string;
216
- outputFileTracingExcludes: Record<string, string[]>;
217
- outputFileTracingIncludes: Record<string, string[]>;
218
- watchOptions: {
219
- pollIntervalMs?: number;
220
- };
221
- htmlLimitedBots: RegExp & string;
222
- configFile: string | undefined;
223
- configFileName: string;
224
- distDirRoot: string;
225
- } | {
226
- distDir: string;
227
- basePath: string;
228
- assetPrefix: string;
229
- };
230
- cwd: string;
231
- useNativeEsbuild: boolean;
232
- rebuildOnChange: boolean;
233
- 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>>;
234
- maximumFileSizeToCacheInBytes: number;
235
- globFollow: boolean;
236
- globIgnores: string[];
237
- globStrict: boolean;
238
- injectionPoint: string;
239
- additionalPrecacheEntries?: (string | {
240
- url: string;
241
- integrity?: string | undefined;
242
- revision?: string | null | undefined;
243
- })[] | undefined;
244
- manifestTransforms?: z.z.core.$InferOuterFunctionTypeAsync<z.ZodTuple<[z.ZodArray<z.ZodObject<{
245
- size: z.ZodNumber;
246
- integrity: z.ZodOptional<z.ZodString>;
247
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
248
- url: z.ZodString;
249
- }, z.z.core.$strip>>, z.ZodOptional<z.ZodUnknown>], null>, z.ZodObject<{
250
- manifest: z.ZodArray<z.ZodObject<{
251
- size: z.ZodNumber;
252
- integrity: z.ZodOptional<z.ZodString>;
253
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
254
- url: z.ZodString;
255
- }, z.z.core.$strip>>;
256
- warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
257
- }, z.z.core.$strict>>[] | undefined;
258
- modifyURLPrefix?: Record<string, string> | undefined;
259
- templatedURLs?: Record<string, string | string[]> | undefined;
260
- }, {
261
- cwd: string;
262
- useNativeEsbuild: boolean;
263
- rebuildOnChange: boolean;
264
- 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>>;
265
- maximumFileSizeToCacheInBytes: number;
266
- globFollow: boolean;
267
- globIgnores: string[];
268
- globStrict: boolean;
269
- injectionPoint: string;
270
- swSrc: string;
271
- nextConfig?: {
272
- assetPrefix?: string | undefined;
273
- basePath?: string | undefined;
274
- distDir?: string | undefined;
275
- } | undefined;
276
- additionalPrecacheEntries?: (string | {
277
- url: string;
278
- integrity?: string | undefined;
279
- revision?: string | null | undefined;
280
- })[] | undefined;
281
- dontCacheBustURLsMatching?: RegExp | undefined;
282
- manifestTransforms?: z.z.core.$InferOuterFunctionTypeAsync<z.ZodTuple<[z.ZodArray<z.ZodObject<{
283
- size: z.ZodNumber;
284
- integrity: z.ZodOptional<z.ZodString>;
285
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
286
- url: z.ZodString;
287
- }, z.z.core.$strip>>, z.ZodOptional<z.ZodUnknown>], null>, z.ZodObject<{
288
- manifest: z.ZodArray<z.ZodObject<{
289
- size: z.ZodNumber;
290
- integrity: z.ZodOptional<z.ZodString>;
291
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
292
- url: z.ZodString;
293
- }, z.z.core.$strip>>;
294
- warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
295
- }, z.z.core.$strict>>[] | undefined;
296
- modifyURLPrefix?: Record<string, string> | undefined;
297
- globPatterns?: string[] | undefined;
298
- templatedURLs?: Record<string, string | string[]> | undefined;
299
- globDirectory?: string | undefined;
300
- }>>;
301
- //# sourceMappingURL=index.schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.schema.d.ts","sourceRoot":"","sources":["../src/index.schema.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,KAAK,CAAC;AAMpB,eAAO,MAAM,YAAY;;;;;;;;;;oBAYvB,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA8C6o0B,CAAC;sBAA+B,CAAC;oBAA6B,CAAC;;uBAAuD,CAAC;sBAA+B,CAAC;oBAA6B,CAAC;;;;;;;;;;mBAA+5E,CAAC;kBAAwB,CAAC;kBAAwB,CAAC;;;;;;;;;;;;oBAAo9D,CAAC;;;0BAAie,CAAC;6BAA4H,CAAC;;;;0BAAkiB,CAAC;;;;;;;;;qBAA4+C,CAAC;;;;;iCAA+sB,CAAC;0BAAoC,CAAC;;iBAAoC,CAAC;;iCAA0D,CAAC;wBAA8B,CAAC;8BAAkE,CAAC;;yBAA2C,CAAC;uBAAiC,CAAC;;4BAA+C,CAAC;mBAAmD,CAAC;qBAA4C,CAAC;+BAAyC,CAAC;;kBAA6L,CAAC;wBAAsO,CAAC;qCAA2R,CAAC;;;;;;;;;;;;;6BAAm0D,CAAC;iCAAwC,CAAC;;;;;;;qBAAowB,CAAC;0BAAgC,CAAC;sBAA4B,CAAC;;;;;;;;;;;0BAA21C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GANnwuC,CAAC"}
@@ -1,8 +0,0 @@
1
- import 'node:path';
2
- import '@serwist/build/schema';
3
- import 'semver';
4
- import 'zod';
5
- export { i as injectManifestOptions, t as turboPartial } from './chunks/index.schema.js';
6
- import 'node:module';
7
- import 'kolorist';
8
- import 'next/constants.js';
@@ -1,14 +0,0 @@
1
- import type { RuntimeCaching } from "serwist";
2
- export declare const PAGES_CACHE_NAME: {
3
- readonly rscPrefetch: "pages-rsc-prefetch";
4
- readonly rsc: "pages-rsc";
5
- readonly html: "pages";
6
- };
7
- /**
8
- * The default, recommended list of caching strategies for applications
9
- * built with Next.js.
10
- *
11
- * @see https://serwist.pages.dev/docs/next/worker-exports#default-cache
12
- */
13
- export declare const defaultCache: RuntimeCaching[];
14
- //# sourceMappingURL=index.worker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.worker.d.ts","sourceRoot":"","sources":["../src/index.worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,EAkQlC,CAAC"}