@serwist/next 10.0.0-preview.1 → 10.0.0-preview.2
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/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/lib/find-first-truthy.d.ts.map +1 -1
- package/dist/lib/get-content-hash.d.ts.map +1 -1
- package/dist/lib/get-file-hash.d.ts.map +1 -1
- package/dist/lib/get-package-version.d.ts.map +1 -1
- package/dist/lib/load-tsconfig.d.ts.map +1 -1
- package/dist/lib/logger.d.ts.map +1 -1
- package/dist/lib/schema.d.ts +14 -20
- package/dist/lib/schema.d.ts.map +1 -1
- package/dist/lib/validator.d.ts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/package.json +19 -18
- package/src/index.ts +10 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAIvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAIvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAMnE;;;;GAIG;AACH,QAAA,MAAM,eAAe,GAAI,aAAa,qBAAqB,KAAG,CAAC,CAAC,UAAU,CAAC,EAAE,UAAU,KAAK,UAAU,CA8NrG,CAAC;AAEF,eAAe,eAAe,CAAC;AAC/B,OAAO,EAAE,6BAA6B,EAAE,CAAC;AACzC,YAAY,EAAE,qBAAqB,IAAI,aAAa,EAAE,6BAA6B,IAAI,qBAAqB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -98,7 +98,12 @@ const validateInjectManifestOptions = (input)=>{
|
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
const dirname = "__dirname" in globalThis ? __dirname : fileURLToPath(new URL(".", import.meta.url));
|
|
101
|
+
let warnedTurbopack = false;
|
|
101
102
|
const withSerwistInit = (userOptions)=>{
|
|
103
|
+
if (!warnedTurbopack && process.env.TURBOPACK && !userOptions.disable && !process.env.SERWIST_SUPPRESS_TURBOPACK_WARNING) {
|
|
104
|
+
warnedTurbopack = true;
|
|
105
|
+
console.warn(`[@serwist/next] WARNING: You are using '@serwist/next' with \`next dev --turbopack\`, but Serwist doesn't support Turbopack at the moment. It is recommended that you set \`disable\` to \`process.env.NODE_ENV !== \"production\"\`. Follow https://github.com/serwist/serwist/issues/54 for progress on Serwist + Turbopack. You can also suppress this warning by setting SERWIST_SUPPRESS_TURBOPACK_WARNING=1.`);
|
|
106
|
+
}
|
|
102
107
|
return (nextConfig = {})=>({
|
|
103
108
|
...nextConfig,
|
|
104
109
|
webpack (config, options) {
|
|
@@ -244,7 +249,7 @@ const withSerwistInit = (userOptions)=>{
|
|
|
244
249
|
if (m.url.startsWith(publicFilesPrefix)) {
|
|
245
250
|
m.url = path.posix.join(basePath, m.url.replace(publicFilesPrefix, ""));
|
|
246
251
|
}
|
|
247
|
-
m.url = m.url.replace(/\[/g, "%5B").replace(/\]/g, "%5D");
|
|
252
|
+
m.url = m.url.replace(/\[/g, "%5B").replace(/\]/g, "%5D").replace(/@/g, "%40");
|
|
248
253
|
return m;
|
|
249
254
|
});
|
|
250
255
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-first-truthy.d.ts","sourceRoot":"","sources":["../../src/lib/find-first-truthy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"find-first-truthy.d.ts","sourceRoot":"","sources":["../../src/lib/find-first-truthy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,+BAQhE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-content-hash.d.ts","sourceRoot":"","sources":["../../src/lib/get-content-hash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAI9B,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"get-content-hash.d.ts","sourceRoot":"","sources":["../../src/lib/get-content-hash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAI9B,eAAO,MAAM,cAAc,GAAI,MAAM,EAAE,CAAC,oBAAoB,EAAE,OAAO,OAAO,WAK3E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-file-hash.d.ts","sourceRoot":"","sources":["../../src/lib/get-file-hash.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"get-file-hash.d.ts","sourceRoot":"","sources":["../../src/lib/get-file-hash.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,eAAO,MAAM,WAAW,GAAI,MAAM,EAAE,CAAC,oBAAoB,WAAyE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-package-version.d.ts","sourceRoot":"","sources":["../../src/lib/get-package-version.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"get-package-version.d.ts","sourceRoot":"","sources":["../../src/lib/get-package-version.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,aAAa,MAAM,KAAG,MAAM,GAAG,SAMhE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-tsconfig.d.ts","sourceRoot":"","sources":["../../src/lib/load-tsconfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,IAAI,YAAY,EAAE,MAAM,WAAW,CAAC;AAI9D,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"load-tsconfig.d.ts","sourceRoot":"","sources":["../../src/lib/load-tsconfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,IAAI,YAAY,EAAE,MAAM,WAAW,CAAC;AAI9D,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,EAAE,sBAAsB,MAAM,GAAG,SAAS,KAAG,YAAY,GAAG,SAevG,CAAC"}
|
package/dist/lib/logger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AAsCA,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AAsCA,eAAO,MAAM,IAAI,GAAI,GAAG,SAAS,GAAG,EAAE,SAErC,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,GAAG,SAAS,GAAG,EAAE,SAEtC,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,GAAG,SAAS,GAAG,EAAE,SAErC,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,GAAG,SAAS,GAAG,EAAE,SAErC,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,GAAG,SAAS,GAAG,EAAE,SAEtC,CAAC"}
|
package/dist/lib/schema.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare const injectPartial: z.ZodObject<{
|
|
|
24
24
|
swUrl?: string | undefined;
|
|
25
25
|
globPublicPatterns?: string[] | undefined;
|
|
26
26
|
}>;
|
|
27
|
-
export declare const injectManifestOptions: z.ZodObject<Omit<
|
|
27
|
+
export declare const injectManifestOptions: z.ZodObject<Omit<{
|
|
28
28
|
additionalPrecacheEntries: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
29
29
|
integrity: z.ZodOptional<z.ZodString>;
|
|
30
30
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -40,13 +40,13 @@ export declare const injectManifestOptions: z.ZodObject<Omit<z.objectUtil.extend
|
|
|
40
40
|
}>]>, "many">>;
|
|
41
41
|
disablePrecacheManifest: z.ZodDefault<z.ZodBoolean>;
|
|
42
42
|
dontCacheBustURLsMatching: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
43
|
-
manifestTransforms: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodObject<
|
|
43
|
+
manifestTransforms: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodObject<{
|
|
44
44
|
integrity: z.ZodOptional<z.ZodString>;
|
|
45
45
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
46
46
|
url: z.ZodString;
|
|
47
|
-
}
|
|
47
|
+
} & {
|
|
48
48
|
size: z.ZodNumber;
|
|
49
|
-
}
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
50
|
url: string;
|
|
51
51
|
size: number;
|
|
52
52
|
integrity?: string | undefined;
|
|
@@ -57,13 +57,13 @@ export declare const injectManifestOptions: z.ZodObject<Omit<z.objectUtil.extend
|
|
|
57
57
|
integrity?: string | undefined;
|
|
58
58
|
revision?: string | null | undefined;
|
|
59
59
|
}>, "many">, z.ZodOptional<z.ZodUnknown>], null>, z.ZodUnion<[z.ZodPromise<z.ZodObject<{
|
|
60
|
-
manifest: z.ZodArray<z.ZodObject<
|
|
60
|
+
manifest: z.ZodArray<z.ZodObject<{
|
|
61
61
|
integrity: z.ZodOptional<z.ZodString>;
|
|
62
62
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
63
63
|
url: z.ZodString;
|
|
64
|
-
}
|
|
64
|
+
} & {
|
|
65
65
|
size: z.ZodNumber;
|
|
66
|
-
}
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
67
|
url: string;
|
|
68
68
|
size: number;
|
|
69
69
|
integrity?: string | undefined;
|
|
@@ -92,13 +92,13 @@ export declare const injectManifestOptions: z.ZodObject<Omit<z.objectUtil.extend
|
|
|
92
92
|
}[];
|
|
93
93
|
warnings?: string[] | undefined;
|
|
94
94
|
}>>, z.ZodObject<{
|
|
95
|
-
manifest: z.ZodArray<z.ZodObject<
|
|
95
|
+
manifest: z.ZodArray<z.ZodObject<{
|
|
96
96
|
integrity: z.ZodOptional<z.ZodString>;
|
|
97
97
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
98
98
|
url: z.ZodString;
|
|
99
|
-
}
|
|
99
|
+
} & {
|
|
100
100
|
size: z.ZodNumber;
|
|
101
|
-
}
|
|
101
|
+
}, "strip", z.ZodTypeAny, {
|
|
102
102
|
url: string;
|
|
103
103
|
size: number;
|
|
104
104
|
integrity?: string | undefined;
|
|
@@ -129,23 +129,17 @@ export declare const injectManifestOptions: z.ZodObject<Omit<z.objectUtil.extend
|
|
|
129
129
|
}>]>>, "many">>;
|
|
130
130
|
maximumFileSizeToCacheInBytes: z.ZodDefault<z.ZodNumber>;
|
|
131
131
|
modifyURLPrefix: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
132
|
-
}, {
|
|
133
132
|
chunks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
134
133
|
exclude: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodFunction<z.ZodTuple<[z.ZodAny], null>, z.ZodBoolean>]>, "many">>;
|
|
135
134
|
excludeChunks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
136
135
|
include: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodFunction<z.ZodTuple<[z.ZodAny], null>, z.ZodBoolean>]>, "many">>;
|
|
137
|
-
}>, {
|
|
138
136
|
injectionPoint: z.ZodDefault<z.ZodString>;
|
|
139
137
|
swSrc: z.ZodString;
|
|
140
|
-
}>, {
|
|
141
|
-
swDest: z.ZodOptional<z.ZodString>;
|
|
142
|
-
}>, {
|
|
143
138
|
compileSrc: z.ZodDefault<z.ZodBoolean>;
|
|
144
|
-
swDest: z.ZodOptional<z.ZodString>;
|
|
145
139
|
webpackCompilationPlugins: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
146
|
-
}
|
|
140
|
+
} & {
|
|
147
141
|
swDest: z.ZodString;
|
|
148
|
-
}
|
|
142
|
+
} & {
|
|
149
143
|
cacheOnNavigation: z.ZodDefault<z.ZodBoolean>;
|
|
150
144
|
disable: z.ZodDefault<z.ZodBoolean>;
|
|
151
145
|
register: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -153,7 +147,7 @@ export declare const injectManifestOptions: z.ZodObject<Omit<z.objectUtil.extend
|
|
|
153
147
|
scope: z.ZodOptional<z.ZodString>;
|
|
154
148
|
swUrl: z.ZodDefault<z.ZodString>;
|
|
155
149
|
globPublicPatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
156
|
-
}
|
|
150
|
+
}, "disablePrecacheManifest">, "strict", z.ZodTypeAny, {
|
|
157
151
|
cacheOnNavigation: boolean;
|
|
158
152
|
disable: boolean;
|
|
159
153
|
register: boolean;
|
|
@@ -164,8 +158,8 @@ export declare const injectManifestOptions: z.ZodObject<Omit<z.objectUtil.extend
|
|
|
164
158
|
exclude: (string | RegExp | ((args_0: any) => boolean))[];
|
|
165
159
|
injectionPoint: string;
|
|
166
160
|
swSrc: string;
|
|
167
|
-
swDest: string;
|
|
168
161
|
compileSrc: boolean;
|
|
162
|
+
swDest: string;
|
|
169
163
|
scope?: string | undefined;
|
|
170
164
|
additionalPrecacheEntries?: (string | {
|
|
171
165
|
url: string;
|
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":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;EAU+C,CAAC;AAE1E,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/lib/schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;EAU+C,CAAC;AAE1E,eAAO,MAAM,qBAAqB;;;;;;;iBAKm8B,CAAC;gBAAsC,CAAC;;;iBAA4E,CAAC;gBAAsC,CAAC;;;;;;;;;;;;;iBAA4iB,CAAC;gBAAsC,CAAC;;;;iBAAkG,CAAC;gBAAsC,CAAC;;;;;;;;;;;qBAAgd,CAAC;oBAA0C,CAAC;;;;qBAAkH,CAAC;oBAA0C,CAAC;;;;;;;qBAAiP,CAAC;oBAA0C,CAAC;;gBAA0D,CAAC;;;;;qBAA6H,CAAC;oBAA0C,CAAC;;gBAA0D,CAAC;;;;;;;;;;;qBAAqY,CAAC;oBAA0C,CAAC;;;;qBAAkH,CAAC;oBAA0C,CAAC;;;;;;;qBAAiP,CAAC;oBAA0C,CAAC;;gBAA0D,CAAC;;;;;qBAA6H,CAAC;oBAA0C,CAAC;;gBAA0D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3U,CAAC;oBAA0C,CAAC;;;;;;;qBAAvrC,CAAC;oBAA0C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAm0C,CAAC;oBAA0C,CAAC;;;;;;;qBAAvrC,CAAC;oBAA0C,CAAC;;;;;;;;;;;;;EADj7F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,GAAI,OAAO,OAAO,KAAG,6BAQ9D,CAAC"}
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,eAAO,MAAM,WAAW,GAAI,MAAM,EAAE,CAAC,oBAAoB,WAAyE,CAAC;AAEnI,eAAO,MAAM,cAAc,GAAI,MAAM,EAAE,CAAC,oBAAoB,EAAE,OAAO,OAAO,WAK3E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serwist/next",
|
|
3
|
-
"version": "10.0.0-preview.
|
|
3
|
+
"version": "10.0.0-preview.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A module that integrates Serwist into your Next.js application.",
|
|
6
6
|
"files": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"pwa"
|
|
22
22
|
],
|
|
23
23
|
"engines": {
|
|
24
|
-
"node": ">=
|
|
24
|
+
"node": ">=20.0.0"
|
|
25
25
|
},
|
|
26
26
|
"author": "Serwist <ducanh2912.rusty@gmail.com> (https://serwist.pages.dev/)",
|
|
27
27
|
"license": "MIT",
|
|
@@ -63,24 +63,24 @@
|
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"chalk": "5.4.1",
|
|
66
|
-
"glob": "
|
|
67
|
-
"zod": "3.24.
|
|
68
|
-
"@serwist/build": "10.0.0-preview.
|
|
69
|
-
"@serwist/utils": "10.0.0-preview.
|
|
70
|
-
"@serwist/webpack-plugin": "10.0.0-preview.
|
|
71
|
-
"@serwist/window": "10.0.0-preview.
|
|
72
|
-
"serwist": "10.0.0-preview.
|
|
66
|
+
"glob": "11.0.1",
|
|
67
|
+
"zod": "3.24.3",
|
|
68
|
+
"@serwist/build": "10.0.0-preview.2",
|
|
69
|
+
"@serwist/utils": "10.0.0-preview.2",
|
|
70
|
+
"@serwist/webpack-plugin": "10.0.0-preview.2",
|
|
71
|
+
"@serwist/window": "10.0.0-preview.2",
|
|
72
|
+
"serwist": "10.0.0-preview.2"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@types/node": "22.
|
|
76
|
-
"next": "15.1
|
|
77
|
-
"react": "19.
|
|
78
|
-
"react-dom": "19.
|
|
79
|
-
"rollup": "4.
|
|
80
|
-
"type-fest": "4.
|
|
81
|
-
"typescript": "5.
|
|
82
|
-
"webpack": "5.
|
|
83
|
-
"@serwist/configs": "10.0.0-preview.
|
|
75
|
+
"@types/node": "22.14.1",
|
|
76
|
+
"next": "15.3.1",
|
|
77
|
+
"react": "19.1.0",
|
|
78
|
+
"react-dom": "19.1.0",
|
|
79
|
+
"rollup": "4.40.0",
|
|
80
|
+
"type-fest": "4.40.0",
|
|
81
|
+
"typescript": "5.8.3",
|
|
82
|
+
"webpack": "5.99.6",
|
|
83
|
+
"@serwist/configs": "10.0.0-preview.2"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"next": ">=14.0.0",
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"build": "rimraf dist && NODE_ENV=production rollup --config rollup.config.js",
|
|
96
96
|
"dev": "rollup --config rollup.config.js --watch",
|
|
97
97
|
"lint": "biome lint ./src",
|
|
98
|
+
"qcheck": "biome check ./src",
|
|
98
99
|
"typecheck": "tsc"
|
|
99
100
|
}
|
|
100
101
|
}
|
package/src/index.ts
CHANGED
|
@@ -13,12 +13,20 @@ import { validateInjectManifestOptions } from "./lib/validator.js";
|
|
|
13
13
|
|
|
14
14
|
const dirname = "__dirname" in globalThis ? __dirname : fileURLToPath(new URL(".", import.meta.url));
|
|
15
15
|
|
|
16
|
+
let warnedTurbopack = false;
|
|
17
|
+
|
|
16
18
|
/**
|
|
17
19
|
* Integrates Serwist into your Next.js app.
|
|
18
20
|
* @param userOptions
|
|
19
21
|
* @returns
|
|
20
22
|
*/
|
|
21
23
|
const withSerwistInit = (userOptions: InjectManifestOptions): ((nextConfig?: NextConfig) => NextConfig) => {
|
|
24
|
+
if (!warnedTurbopack && process.env.TURBOPACK && !userOptions.disable && !process.env.SERWIST_SUPPRESS_TURBOPACK_WARNING) {
|
|
25
|
+
warnedTurbopack = true;
|
|
26
|
+
console.warn(
|
|
27
|
+
`[@serwist/next] WARNING: You are using '@serwist/next' with \`next dev --turbopack\`, but Serwist doesn't support Turbopack at the moment. It is recommended that you set \`disable\` to \`process.env.NODE_ENV !== \"production\"\`. Follow https://github.com/serwist/serwist/issues/54 for progress on Serwist + Turbopack. You can also suppress this warning by setting SERWIST_SUPPRESS_TURBOPACK_WARNING=1.`,
|
|
28
|
+
);
|
|
29
|
+
}
|
|
22
30
|
return (nextConfig = {}) => ({
|
|
23
31
|
...nextConfig,
|
|
24
32
|
webpack(config: Configuration, options) {
|
|
@@ -204,6 +212,7 @@ const withSerwistInit = (userOptions: InjectManifestOptions): ((nextConfig?: Nex
|
|
|
204
212
|
},
|
|
205
213
|
],
|
|
206
214
|
manifestTransforms: [
|
|
215
|
+
// TODO(ducanhgh): move this spread to below our transform function?
|
|
207
216
|
...manifestTransforms,
|
|
208
217
|
async (manifestEntries, compilation) => {
|
|
209
218
|
// This path always uses forward slashes, so it is safe to use it in the following string replace.
|
|
@@ -219,7 +228,7 @@ const withSerwistInit = (userOptions: InjectManifestOptions): ((nextConfig?: Nex
|
|
|
219
228
|
if (m.url.startsWith(publicFilesPrefix)) {
|
|
220
229
|
m.url = path.posix.join(basePath, m.url.replace(publicFilesPrefix, ""));
|
|
221
230
|
}
|
|
222
|
-
m.url = m.url.replace(/\[/g, "%5B").replace(/\]/g, "%5D");
|
|
231
|
+
m.url = m.url.replace(/\[/g, "%5B").replace(/\]/g, "%5D").replace(/@/g, "%40");
|
|
223
232
|
return m;
|
|
224
233
|
});
|
|
225
234
|
return { manifest, warnings: [] };
|