@serwist/turbopack 9.5.0 → 9.5.1
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 +7 -6
- package/dist/index.schema.d.ts +2 -2
- package/dist/index.schema.js +1 -1
- package/package.json +15 -15
- package/src/index.schema.ts +1 -1
- package/src/index.ts +5 -4
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C,OAAO,KAAK,EAAE,qBAAqB,EAAiC,MAAM,YAAY,CAAC;AAuCvF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,qBAAqB;;;;;;;aAoFzC,OAAO,cAAc;QAAE,MAAM,EAAE,OAAO,CAAC;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE;CAajF,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { rebasePath, getFileManifestEntries } from '@serwist/build';
|
|
3
3
|
import { validationErrorMap, SerwistConfigError } from '@serwist/build/schema';
|
|
4
|
+
import { toUnix } from '@serwist/utils';
|
|
4
5
|
import { green, bold, white, yellow, red, cyan, dim } from 'kolorist';
|
|
5
6
|
import { NextResponse } from 'next/server.js';
|
|
6
7
|
import { z } from 'zod';
|
|
@@ -154,14 +155,14 @@ const createSerwistRoute = (options)=>{
|
|
|
154
155
|
[injectionPoint]: manifestString
|
|
155
156
|
} : {}
|
|
156
157
|
},
|
|
157
|
-
outdir: config.cwd,
|
|
158
|
+
outdir: toUnix(config.cwd),
|
|
158
159
|
write: false,
|
|
159
160
|
entryNames: "[name]",
|
|
160
161
|
assetNames: "[name]-[hash]",
|
|
161
162
|
chunkNames: "[name]-[hash]",
|
|
162
163
|
entryPoints: [
|
|
163
164
|
{
|
|
164
|
-
in: config.swSrc,
|
|
165
|
+
in: toUnix(config.swSrc),
|
|
165
166
|
out: "sw"
|
|
166
167
|
}
|
|
167
168
|
]
|
|
@@ -182,10 +183,10 @@ const createSerwistRoute = (options)=>{
|
|
|
182
183
|
const config = await validation;
|
|
183
184
|
if (!map) map = await loadMap("root");
|
|
184
185
|
return [
|
|
185
|
-
...map.keys()
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
186
|
+
...map.keys()
|
|
187
|
+
].map((e)=>({
|
|
188
|
+
path: path.relative(config.cwd, e)
|
|
189
|
+
}));
|
|
189
190
|
};
|
|
190
191
|
const GET = async (_, { params })=>{
|
|
191
192
|
const { path: filePath } = await params;
|
package/dist/index.schema.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const turboPartial: z.ZodObject<{
|
|
|
5
5
|
assetPrefix: z.ZodOptional<z.ZodString>;
|
|
6
6
|
basePath: z.ZodPrefault<z.ZodString>;
|
|
7
7
|
distDir: z.ZodPrefault<z.ZodString>;
|
|
8
|
-
}, z.z.core.$
|
|
8
|
+
}, z.z.core.$strip>;
|
|
9
9
|
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>>;
|
|
10
10
|
}, z.z.core.$strict>;
|
|
11
11
|
export declare const injectManifestOptions: z.ZodPipe<z.ZodObject<{
|
|
@@ -15,7 +15,7 @@ export declare const injectManifestOptions: z.ZodPipe<z.ZodObject<{
|
|
|
15
15
|
assetPrefix: z.ZodOptional<z.ZodString>;
|
|
16
16
|
basePath: z.ZodPrefault<z.ZodString>;
|
|
17
17
|
distDir: z.ZodPrefault<z.ZodString>;
|
|
18
|
-
}, z.z.core.$
|
|
18
|
+
}, z.z.core.$strip>;
|
|
19
19
|
additionalPrecacheEntries: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
20
20
|
integrity: z.ZodOptional<z.ZodString>;
|
|
21
21
|
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
package/dist/index.schema.js
CHANGED
|
@@ -67,7 +67,7 @@ const generateGlobPatterns = (distDir)=>[
|
|
|
67
67
|
|
|
68
68
|
const turboPartial = z.strictObject({
|
|
69
69
|
cwd: z.string().prefault(process.cwd()),
|
|
70
|
-
nextConfig: z.
|
|
70
|
+
nextConfig: z.object({
|
|
71
71
|
assetPrefix: z.string().optional(),
|
|
72
72
|
basePath: z.string().prefault("/"),
|
|
73
73
|
distDir: z.string().prefault(".next")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serwist/turbopack",
|
|
3
|
-
"version": "9.5.
|
|
3
|
+
"version": "9.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "A module that integrates Serwist into your Next.js / Turbopack application.",
|
|
@@ -63,27 +63,27 @@
|
|
|
63
63
|
"./package.json": "./package.json"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@swc/core": "1.15.
|
|
66
|
+
"@swc/core": "1.15.11",
|
|
67
67
|
"kolorist": "1.8.0",
|
|
68
68
|
"semver": "7.7.3",
|
|
69
|
-
"zod": "4.3.
|
|
70
|
-
"@serwist/
|
|
71
|
-
"@serwist/
|
|
72
|
-
"serwist": "9.5.
|
|
73
|
-
"@serwist/
|
|
69
|
+
"zod": "4.3.6",
|
|
70
|
+
"@serwist/utils": "9.5.1",
|
|
71
|
+
"@serwist/window": "9.5.1",
|
|
72
|
+
"serwist": "9.5.1",
|
|
73
|
+
"@serwist/build": "9.5.1"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@types/node": "25.0
|
|
77
|
-
"@types/react": "19.2.
|
|
76
|
+
"@types/node": "25.1.0",
|
|
77
|
+
"@types/react": "19.2.10",
|
|
78
78
|
"@types/semver": "7.7.1",
|
|
79
79
|
"esbuild-wasm": "0.27.2",
|
|
80
|
-
"next": "16.1.
|
|
81
|
-
"react": "19.2.
|
|
82
|
-
"react-dom": "19.2.
|
|
83
|
-
"rollup": "4.
|
|
84
|
-
"type-fest": "5.
|
|
80
|
+
"next": "16.1.6",
|
|
81
|
+
"react": "19.2.4",
|
|
82
|
+
"react-dom": "19.2.4",
|
|
83
|
+
"rollup": "4.57.0",
|
|
84
|
+
"type-fest": "5.4.2",
|
|
85
85
|
"typescript": "5.9.3",
|
|
86
|
-
"@serwist/configs": "9.5.
|
|
86
|
+
"@serwist/configs": "9.5.1"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
89
|
"esbuild-wasm": ">=0.25.0 <1.0.0",
|
package/src/index.schema.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { InjectManifestOptions, InjectManifestOptionsComplete, TurboPartial
|
|
|
7
7
|
|
|
8
8
|
export const turboPartial = z.strictObject({
|
|
9
9
|
cwd: z.string().prefault(process.cwd()),
|
|
10
|
-
nextConfig: z.
|
|
10
|
+
nextConfig: z.object({
|
|
11
11
|
assetPrefix: z.string().optional(),
|
|
12
12
|
basePath: z.string().prefault("/"),
|
|
13
13
|
distDir: z.string().prefault(".next"),
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { type BuildResult, getFileManifestEntries, rebasePath } from "@serwist/build";
|
|
6
6
|
import { SerwistConfigError, validationErrorMap } from "@serwist/build/schema";
|
|
7
|
+
import { toUnix } from "@serwist/utils";
|
|
7
8
|
import { cyan, dim, yellow } from "kolorist";
|
|
8
9
|
import { NextResponse } from "next/server.js";
|
|
9
10
|
import { z } from "zod";
|
|
@@ -11,7 +12,7 @@ import { injectManifestOptions } from "./index.schema.js";
|
|
|
11
12
|
import { logger } from "./lib/index.js";
|
|
12
13
|
import type { InjectManifestOptions, InjectManifestOptionsComplete } from "./types.js";
|
|
13
14
|
|
|
14
|
-
// TODO(
|
|
15
|
+
// TODO(workaround): `esbuild` doesn't load when in Turbopack production
|
|
15
16
|
const esbuild = import("esbuild-wasm");
|
|
16
17
|
|
|
17
18
|
const logSerwistResult = (filePath: string, buildResult: Pick<BuildResult, "count" | "size" | "warnings">) => {
|
|
@@ -112,7 +113,7 @@ export const createSerwistRoute = (options: InjectManifestOptions) => {
|
|
|
112
113
|
...config.esbuildOptions.define,
|
|
113
114
|
...(injectionPoint ? { [injectionPoint]: manifestString } : {}),
|
|
114
115
|
},
|
|
115
|
-
outdir: config.cwd,
|
|
116
|
+
outdir: toUnix(config.cwd),
|
|
116
117
|
write: false,
|
|
117
118
|
entryNames: "[name]",
|
|
118
119
|
// Asset and chunk names must be at the top, as our path is `/serwist/[path]`,
|
|
@@ -120,7 +121,7 @@ export const createSerwistRoute = (options: InjectManifestOptions) => {
|
|
|
120
121
|
// than one level.
|
|
121
122
|
assetNames: "[name]-[hash]",
|
|
122
123
|
chunkNames: "[name]-[hash]",
|
|
123
|
-
entryPoints: [{ in: config.swSrc, out: "sw" }],
|
|
124
|
+
entryPoints: [{ in: toUnix(config.swSrc), out: "sw" }],
|
|
124
125
|
});
|
|
125
126
|
if (result.errors.length) {
|
|
126
127
|
console.error("Failed to build the service worker.", result.errors);
|
|
@@ -134,7 +135,7 @@ export const createSerwistRoute = (options: InjectManifestOptions) => {
|
|
|
134
135
|
const generateStaticParams = async () => {
|
|
135
136
|
const config = await validation;
|
|
136
137
|
if (!map) map = await loadMap("root");
|
|
137
|
-
return [...map.keys().map((e) => ({ path: path.relative(config.cwd, e) }))
|
|
138
|
+
return [...map.keys()].map((e) => ({ path: path.relative(config.cwd, e) }));
|
|
138
139
|
};
|
|
139
140
|
const GET = async (_: Request, { params }: { params: Promise<{ path: string }> }) => {
|
|
140
141
|
// TODO: obviously, files get stale in development when we pull this off.
|