next 15.2.2-canary.6 → 15.2.2-canary.7
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.
Potentially problematic release.
This version of next might be problematic. Click here for more details.
- package/dist/bin/next +1 -1
- package/dist/build/handle-entrypoints.d.ts +3 -23
- package/dist/build/handle-entrypoints.js +36 -149
- package/dist/build/handle-entrypoints.js.map +1 -1
- package/dist/build/index.js +2 -2
- package/dist/build/swc/generated-native.d.ts +4 -0
- package/dist/build/swc/index.js +77 -68
- package/dist/build/swc/index.js.map +1 -1
- package/dist/build/swc/types.d.ts +1 -0
- package/dist/build/turbopack-build/impl.js +33 -160
- package/dist/build/turbopack-build/impl.js.map +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/components/react-dev-overlay/ui/components/errors/dev-tools-indicator/next-logo.js +3 -5
- package/dist/client/components/react-dev-overlay/ui/components/errors/dev-tools-indicator/next-logo.js.map +1 -1
- package/dist/client/components/react-dev-overlay/ui/components/errors/error-overlay-layout/error-overlay-layout.d.ts +1 -1
- package/dist/client/components/react-dev-overlay/ui/components/errors/error-overlay-nav/error-overlay-nav.d.ts +1 -1
- package/dist/client/components/react-dev-overlay/ui/components/errors/error-overlay-nav/error-overlay-nav.js +1 -1
- package/dist/client/components/react-dev-overlay/ui/components/errors/error-overlay-nav/error-overlay-nav.js.map +1 -1
- package/dist/client/components/react-dev-overlay/ui/styles/base.js +1 -1
- package/dist/client/components/react-dev-overlay/ui/styles/base.js.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js +2 -2
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/app-page.runtime.dev.js +2 -2
- package/dist/compiled/next-server/app-page.runtime.dev.js.map +1 -1
- package/dist/esm/build/handle-entrypoints.js +31 -140
- package/dist/esm/build/handle-entrypoints.js.map +1 -1
- package/dist/esm/build/index.js +2 -2
- package/dist/esm/build/swc/generated-native.d.ts +4 -0
- package/dist/esm/build/swc/index.js +77 -68
- package/dist/esm/build/swc/index.js.map +1 -1
- package/dist/esm/build/swc/types.js.map +1 -1
- package/dist/esm/build/turbopack-build/impl.js +34 -120
- package/dist/esm/build/turbopack-build/impl.js.map +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/ui/components/errors/dev-tools-indicator/next-logo.js +3 -5
- package/dist/esm/client/components/react-dev-overlay/ui/components/errors/dev-tools-indicator/next-logo.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/ui/components/errors/error-overlay-nav/error-overlay-nav.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/ui/components/errors/error-overlay-nav/error-overlay-nav.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/ui/styles/base.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/ui/styles/base.js.map +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/shared/lib/canary-only.js +1 -1
- package/dist/esm/shared/lib/get-img-props.js +11 -1
- package/dist/esm/shared/lib/get-img-props.js.map +1 -1
- package/dist/esm/shared/lib/turbopack/manifest-loader.js +24 -14
- package/dist/esm/shared/lib/turbopack/manifest-loader.js.map +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/shared/lib/canary-only.js +1 -1
- package/dist/shared/lib/get-img-props.d.ts +2 -1
- package/dist/shared/lib/get-img-props.js +11 -1
- package/dist/shared/lib/get-img-props.js.map +1 -1
- package/dist/shared/lib/turbopack/manifest-loader.d.ts +4 -1
- package/dist/shared/lib/turbopack/manifest-loader.js +24 -14
- package/dist/shared/lib/turbopack/manifest-loader.js.map +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/build.d.ts +2 -1
- package/dist/telemetry/events/build.js +2 -1
- package/dist/telemetry/events/build.js.map +1 -1
- package/dist/telemetry/events/session-stopped.d.ts +2 -1
- package/dist/telemetry/events/session-stopped.js +4 -3
- package/dist/telemetry/events/session-stopped.js.map +1 -1
- package/dist/telemetry/events/version.d.ts +2 -1
- package/dist/telemetry/events/version.js +3 -2
- package/dist/telemetry/events/version.js.map +1 -1
- package/package.json +15 -15
@@ -1,32 +1,27 @@
|
|
1
|
-
import * as Log from './output/log';
|
2
1
|
import { getEntryKey } from '../shared/lib/turbopack/entry-key';
|
3
|
-
import
|
4
|
-
export async function
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
currentEntrypoints.global.instrumentation = entrypoints.instrumentation;
|
9
|
-
currentEntrypoints.page.clear();
|
10
|
-
currentEntrypoints.app.clear();
|
11
|
-
for (const [pathname, route] of entrypoints.routes){
|
2
|
+
import * as Log from './output/log';
|
3
|
+
export async function rawEntrypointsToEntrypoints(entrypointsOp) {
|
4
|
+
const page = new Map();
|
5
|
+
const app = new Map();
|
6
|
+
for (const [pathname, route] of entrypointsOp.routes){
|
12
7
|
switch(route.type){
|
13
8
|
case 'page':
|
14
9
|
case 'page-api':
|
15
|
-
|
10
|
+
page.set(pathname, route);
|
16
11
|
break;
|
17
12
|
case 'app-page':
|
18
13
|
{
|
19
|
-
route.pages
|
20
|
-
|
14
|
+
for (const p of route.pages){
|
15
|
+
app.set(p.originalName, {
|
21
16
|
type: 'app-page',
|
22
|
-
...
|
17
|
+
...p
|
23
18
|
});
|
24
|
-
}
|
19
|
+
}
|
25
20
|
break;
|
26
21
|
}
|
27
22
|
case 'app-route':
|
28
23
|
{
|
29
|
-
|
24
|
+
app.set(route.originalName, route);
|
30
25
|
break;
|
31
26
|
}
|
32
27
|
default:
|
@@ -34,99 +29,28 @@ export async function handleEntrypoints({ entrypoints, currentEntrypoints, curre
|
|
34
29
|
break;
|
35
30
|
}
|
36
31
|
}
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
const processInstrumentation = async (name, prop)=>{
|
49
|
-
const key = getEntryKey('root', 'server', name);
|
50
|
-
const writtenEndpoint = await instrumentation[prop].writeToDisk();
|
51
|
-
processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors);
|
52
|
-
};
|
53
|
-
await processInstrumentation('instrumentation.nodeJs', 'nodeJs');
|
54
|
-
await processInstrumentation('instrumentation.edge', 'edge');
|
55
|
-
await manifestLoader.loadMiddlewareManifest('instrumentation', 'instrumentation');
|
56
|
-
await manifestLoader.writeManifests({
|
57
|
-
devRewrites: undefined,
|
58
|
-
productionRewrites,
|
59
|
-
entrypoints: currentEntrypoints
|
60
|
-
});
|
61
|
-
}
|
62
|
-
if (middleware) {
|
63
|
-
const key = getEntryKey('root', 'server', 'middleware');
|
64
|
-
const endpoint = middleware.endpoint;
|
65
|
-
async function processMiddleware() {
|
66
|
-
const writtenEndpoint = await endpoint.writeToDisk();
|
67
|
-
processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors);
|
68
|
-
await manifestLoader.loadMiddlewareManifest('middleware', 'middleware');
|
69
|
-
}
|
70
|
-
await processMiddleware();
|
71
|
-
} else {
|
72
|
-
manifestLoader.deleteMiddlewareManifest(getEntryKey('root', 'server', 'middleware'));
|
73
|
-
}
|
74
|
-
}
|
75
|
-
export async function handlePagesErrorRoute({ currentEntryIssues, entrypoints, manifestLoader, productionRewrites, logErrors }) {
|
76
|
-
if (entrypoints.global.app) {
|
77
|
-
const key = getEntryKey('pages', 'server', '_app');
|
78
|
-
const writtenEndpoint = await entrypoints.global.app.writeToDisk();
|
79
|
-
processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors);
|
80
|
-
}
|
81
|
-
await manifestLoader.loadBuildManifest('_app');
|
82
|
-
await manifestLoader.loadPagesManifest('_app');
|
83
|
-
await manifestLoader.loadFontManifest('_app');
|
84
|
-
if (entrypoints.global.document) {
|
85
|
-
const key = getEntryKey('pages', 'server', '_document');
|
86
|
-
const writtenEndpoint = await entrypoints.global.document.writeToDisk();
|
87
|
-
processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors);
|
88
|
-
}
|
89
|
-
await manifestLoader.loadPagesManifest('_document');
|
90
|
-
if (entrypoints.global.error) {
|
91
|
-
const key = getEntryKey('pages', 'server', '_error');
|
92
|
-
const writtenEndpoint = await entrypoints.global.error.writeToDisk();
|
93
|
-
processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors);
|
94
|
-
}
|
95
|
-
await manifestLoader.loadBuildManifest('_error');
|
96
|
-
await manifestLoader.loadPagesManifest('_error');
|
97
|
-
await manifestLoader.loadFontManifest('_error');
|
98
|
-
await manifestLoader.writeManifests({
|
99
|
-
devRewrites: undefined,
|
100
|
-
productionRewrites,
|
101
|
-
entrypoints
|
102
|
-
});
|
32
|
+
return {
|
33
|
+
global: {
|
34
|
+
app: entrypointsOp.pagesAppEndpoint,
|
35
|
+
document: entrypointsOp.pagesDocumentEndpoint,
|
36
|
+
error: entrypointsOp.pagesErrorEndpoint,
|
37
|
+
instrumentation: entrypointsOp.instrumentation,
|
38
|
+
middleware: entrypointsOp.middleware
|
39
|
+
},
|
40
|
+
page,
|
41
|
+
app
|
42
|
+
};
|
103
43
|
}
|
104
|
-
export async function handleRouteType({ page, route,
|
44
|
+
export async function handleRouteType({ page, route, manifestLoader }) {
|
105
45
|
const shouldCreateWebpackStats = process.env.TURBOPACK_STATS != null;
|
106
46
|
switch(route.type){
|
107
47
|
case 'page':
|
108
48
|
{
|
109
49
|
const serverKey = getEntryKey('pages', 'server', page);
|
110
|
-
if (entrypoints.global.app) {
|
111
|
-
const key = getEntryKey('pages', 'server', '_app');
|
112
|
-
const writtenEndpoint = await entrypoints.global.app.writeToDisk();
|
113
|
-
processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors);
|
114
|
-
}
|
115
|
-
await manifestLoader.loadBuildManifest('_app');
|
116
|
-
await manifestLoader.loadPagesManifest('_app');
|
117
|
-
if (entrypoints.global.document) {
|
118
|
-
const key = getEntryKey('pages', 'server', '_document');
|
119
|
-
const writtenEndpoint = await entrypoints.global.document.writeToDisk();
|
120
|
-
processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors);
|
121
|
-
}
|
122
|
-
await manifestLoader.loadPagesManifest('_document');
|
123
|
-
const writtenEndpoint = await route.htmlEndpoint.writeToDisk();
|
124
|
-
const type = writtenEndpoint == null ? void 0 : writtenEndpoint.type;
|
125
50
|
await manifestLoader.loadBuildManifest(page);
|
126
51
|
await manifestLoader.loadPagesManifest(page);
|
127
|
-
|
128
|
-
|
129
|
-
} else {
|
52
|
+
const middlewareManifestWritten = await manifestLoader.loadMiddlewareManifest(page, 'pages');
|
53
|
+
if (!middlewareManifestWritten) {
|
130
54
|
manifestLoader.deleteMiddlewareManifest(serverKey);
|
131
55
|
}
|
132
56
|
await manifestLoader.loadFontManifest('/_app', 'pages');
|
@@ -134,41 +58,23 @@ export async function handleRouteType({ page, route, currentEntryIssues, entrypo
|
|
134
58
|
if (shouldCreateWebpackStats) {
|
135
59
|
await manifestLoader.loadWebpackStats(page, 'pages');
|
136
60
|
}
|
137
|
-
await manifestLoader.writeManifests({
|
138
|
-
devRewrites: undefined,
|
139
|
-
productionRewrites,
|
140
|
-
entrypoints
|
141
|
-
});
|
142
|
-
processIssues(currentEntryIssues, serverKey, writtenEndpoint, false, logErrors);
|
143
61
|
break;
|
144
62
|
}
|
145
63
|
case 'page-api':
|
146
64
|
{
|
147
65
|
const key = getEntryKey('pages', 'server', page);
|
148
|
-
const writtenEndpoint = await route.endpoint.writeToDisk();
|
149
|
-
const type = writtenEndpoint.type;
|
150
66
|
await manifestLoader.loadPagesManifest(page);
|
151
|
-
|
152
|
-
|
153
|
-
} else {
|
67
|
+
const middlewareManifestWritten = await manifestLoader.loadMiddlewareManifest(page, 'pages');
|
68
|
+
if (!middlewareManifestWritten) {
|
154
69
|
manifestLoader.deleteMiddlewareManifest(key);
|
155
70
|
}
|
156
|
-
await manifestLoader.writeManifests({
|
157
|
-
devRewrites: undefined,
|
158
|
-
productionRewrites,
|
159
|
-
entrypoints
|
160
|
-
});
|
161
|
-
processIssues(currentEntryIssues, key, writtenEndpoint, true, logErrors);
|
162
71
|
break;
|
163
72
|
}
|
164
73
|
case 'app-page':
|
165
74
|
{
|
166
75
|
const key = getEntryKey('app', 'server', page);
|
167
|
-
const
|
168
|
-
|
169
|
-
if (type === 'edge') {
|
170
|
-
await manifestLoader.loadMiddlewareManifest(page, 'app');
|
171
|
-
} else {
|
76
|
+
const middlewareManifestWritten = await manifestLoader.loadMiddlewareManifest(page, 'app');
|
77
|
+
if (!middlewareManifestWritten) {
|
172
78
|
manifestLoader.deleteMiddlewareManifest(key);
|
173
79
|
}
|
174
80
|
await manifestLoader.loadAppBuildManifest(page);
|
@@ -179,31 +85,16 @@ export async function handleRouteType({ page, route, currentEntryIssues, entrypo
|
|
179
85
|
if (shouldCreateWebpackStats) {
|
180
86
|
await manifestLoader.loadWebpackStats(page, 'app');
|
181
87
|
}
|
182
|
-
await manifestLoader.writeManifests({
|
183
|
-
devRewrites: undefined,
|
184
|
-
productionRewrites,
|
185
|
-
entrypoints
|
186
|
-
});
|
187
|
-
processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors);
|
188
88
|
break;
|
189
89
|
}
|
190
90
|
case 'app-route':
|
191
91
|
{
|
192
92
|
const key = getEntryKey('app', 'server', page);
|
193
|
-
const writtenEndpoint = await route.endpoint.writeToDisk();
|
194
|
-
const type = writtenEndpoint.type;
|
195
93
|
await manifestLoader.loadAppPathsManifest(page);
|
196
|
-
|
197
|
-
|
198
|
-
} else {
|
94
|
+
const middlewareManifestWritten = await manifestLoader.loadMiddlewareManifest(page, 'app');
|
95
|
+
if (!middlewareManifestWritten) {
|
199
96
|
manifestLoader.deleteMiddlewareManifest(key);
|
200
97
|
}
|
201
|
-
await manifestLoader.writeManifests({
|
202
|
-
devRewrites: undefined,
|
203
|
-
productionRewrites,
|
204
|
-
entrypoints
|
205
|
-
});
|
206
|
-
processIssues(currentEntryIssues, key, writtenEndpoint, true, logErrors);
|
207
98
|
break;
|
208
99
|
}
|
209
100
|
default:
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/build/handle-entrypoints.ts"],"sourcesContent":["import type { CustomRoutes } from '../lib/load-custom-routes'\nimport type { TurbopackManifestLoader } from '../shared/lib/turbopack/manifest-loader'\nimport type {\n TurbopackResult,\n RawEntrypoints,\n Entrypoints,\n PageRoute,\n AppRoute,\n} from './swc/types'\nimport * as Log from './output/log'\nimport { getEntryKey } from '../shared/lib/turbopack/entry-key'\nimport {\n processIssues,\n type EntryIssuesMap,\n} from '../shared/lib/turbopack/utils'\n\nexport async function handleEntrypoints({\n entrypoints,\n currentEntrypoints,\n currentEntryIssues,\n manifestLoader,\n productionRewrites,\n logErrors,\n}: {\n entrypoints: TurbopackResult<RawEntrypoints>\n currentEntrypoints: Entrypoints\n currentEntryIssues: EntryIssuesMap\n manifestLoader: TurbopackManifestLoader\n productionRewrites: CustomRoutes['rewrites'] | undefined\n logErrors: boolean\n}) {\n currentEntrypoints.global.app = entrypoints.pagesAppEndpoint\n currentEntrypoints.global.document = entrypoints.pagesDocumentEndpoint\n currentEntrypoints.global.error = entrypoints.pagesErrorEndpoint\n\n currentEntrypoints.global.instrumentation = entrypoints.instrumentation\n\n currentEntrypoints.page.clear()\n currentEntrypoints.app.clear()\n\n for (const [pathname, route] of entrypoints.routes) {\n switch (route.type) {\n case 'page':\n case 'page-api':\n currentEntrypoints.page.set(pathname, route)\n break\n case 'app-page': {\n route.pages.forEach((page) => {\n currentEntrypoints.app.set(page.originalName, {\n type: 'app-page',\n ...page,\n })\n })\n break\n }\n case 'app-route': {\n currentEntrypoints.app.set(route.originalName, route)\n break\n }\n default:\n Log.info(`skipping ${pathname} (${route.type})`)\n break\n }\n }\n\n const { middleware, instrumentation } = entrypoints\n\n // We check for explicit true/false, since it's initialized to\n // undefined during the first loop (middlewareChanges event is\n // unnecessary during the first serve)\n if (currentEntrypoints.global.middleware && !middleware) {\n const key = getEntryKey('root', 'server', 'middleware')\n // Went from middleware to no middleware\n currentEntryIssues.delete(key)\n }\n\n currentEntrypoints.global.middleware = middleware\n\n if (instrumentation) {\n const processInstrumentation = async (\n name: string,\n prop: 'nodeJs' | 'edge'\n ) => {\n const key = getEntryKey('root', 'server', name)\n\n const writtenEndpoint = await instrumentation[prop].writeToDisk()\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await processInstrumentation('instrumentation.nodeJs', 'nodeJs')\n await processInstrumentation('instrumentation.edge', 'edge')\n await manifestLoader.loadMiddlewareManifest(\n 'instrumentation',\n 'instrumentation'\n )\n await manifestLoader.writeManifests({\n devRewrites: undefined,\n productionRewrites,\n entrypoints: currentEntrypoints,\n })\n }\n\n if (middleware) {\n const key = getEntryKey('root', 'server', 'middleware')\n\n const endpoint = middleware.endpoint\n\n async function processMiddleware() {\n const writtenEndpoint = await endpoint.writeToDisk()\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n await manifestLoader.loadMiddlewareManifest('middleware', 'middleware')\n }\n await processMiddleware()\n } else {\n manifestLoader.deleteMiddlewareManifest(\n getEntryKey('root', 'server', 'middleware')\n )\n }\n}\n\nexport async function handlePagesErrorRoute({\n currentEntryIssues,\n entrypoints,\n manifestLoader,\n productionRewrites,\n logErrors,\n}: {\n currentEntryIssues: EntryIssuesMap\n entrypoints: Entrypoints\n manifestLoader: TurbopackManifestLoader\n productionRewrites: CustomRoutes['rewrites'] | undefined\n logErrors: boolean\n}) {\n if (entrypoints.global.app) {\n const key = getEntryKey('pages', 'server', '_app')\n const writtenEndpoint = await entrypoints.global.app.writeToDisk()\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await manifestLoader.loadBuildManifest('_app')\n await manifestLoader.loadPagesManifest('_app')\n await manifestLoader.loadFontManifest('_app')\n\n if (entrypoints.global.document) {\n const key = getEntryKey('pages', 'server', '_document')\n const writtenEndpoint = await entrypoints.global.document.writeToDisk()\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await manifestLoader.loadPagesManifest('_document')\n\n if (entrypoints.global.error) {\n const key = getEntryKey('pages', 'server', '_error')\n const writtenEndpoint = await entrypoints.global.error.writeToDisk()\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n\n await manifestLoader.loadBuildManifest('_error')\n await manifestLoader.loadPagesManifest('_error')\n await manifestLoader.loadFontManifest('_error')\n\n await manifestLoader.writeManifests({\n devRewrites: undefined,\n productionRewrites,\n entrypoints,\n })\n}\n\nexport async function handleRouteType({\n page,\n route,\n currentEntryIssues,\n entrypoints,\n manifestLoader,\n productionRewrites,\n logErrors,\n}: {\n page: string\n route: PageRoute | AppRoute\n\n currentEntryIssues: EntryIssuesMap\n entrypoints: Entrypoints\n manifestLoader: TurbopackManifestLoader\n productionRewrites: CustomRoutes['rewrites'] | undefined\n logErrors: boolean\n}) {\n const shouldCreateWebpackStats = process.env.TURBOPACK_STATS != null\n\n switch (route.type) {\n case 'page': {\n const serverKey = getEntryKey('pages', 'server', page)\n\n if (entrypoints.global.app) {\n const key = getEntryKey('pages', 'server', '_app')\n\n const writtenEndpoint = await entrypoints.global.app.writeToDisk()\n processIssues(\n currentEntryIssues,\n key,\n writtenEndpoint,\n false,\n logErrors\n )\n }\n await manifestLoader.loadBuildManifest('_app')\n await manifestLoader.loadPagesManifest('_app')\n\n if (entrypoints.global.document) {\n const key = getEntryKey('pages', 'server', '_document')\n\n const writtenEndpoint = await entrypoints.global.document.writeToDisk()\n processIssues(\n currentEntryIssues,\n key,\n writtenEndpoint,\n false,\n logErrors\n )\n }\n await manifestLoader.loadPagesManifest('_document')\n\n const writtenEndpoint = await route.htmlEndpoint.writeToDisk()\n\n const type = writtenEndpoint?.type\n\n await manifestLoader.loadBuildManifest(page)\n await manifestLoader.loadPagesManifest(page)\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'pages')\n } else {\n manifestLoader.deleteMiddlewareManifest(serverKey)\n }\n await manifestLoader.loadFontManifest('/_app', 'pages')\n await manifestLoader.loadFontManifest(page, 'pages')\n\n if (shouldCreateWebpackStats) {\n await manifestLoader.loadWebpackStats(page, 'pages')\n }\n\n await manifestLoader.writeManifests({\n devRewrites: undefined,\n productionRewrites,\n entrypoints,\n })\n\n processIssues(\n currentEntryIssues,\n serverKey,\n writtenEndpoint,\n false,\n logErrors\n )\n\n break\n }\n case 'page-api': {\n const key = getEntryKey('pages', 'server', page)\n\n const writtenEndpoint = await route.endpoint.writeToDisk()\n\n const type = writtenEndpoint.type\n\n await manifestLoader.loadPagesManifest(page)\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'pages')\n } else {\n manifestLoader.deleteMiddlewareManifest(key)\n }\n\n await manifestLoader.writeManifests({\n devRewrites: undefined,\n productionRewrites,\n entrypoints,\n })\n\n processIssues(currentEntryIssues, key, writtenEndpoint, true, logErrors)\n\n break\n }\n case 'app-page': {\n const key = getEntryKey('app', 'server', page)\n const writtenEndpoint = await route.htmlEndpoint.writeToDisk()\n const type = writtenEndpoint.type\n\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'app')\n } else {\n manifestLoader.deleteMiddlewareManifest(key)\n }\n\n await manifestLoader.loadAppBuildManifest(page)\n await manifestLoader.loadBuildManifest(page, 'app')\n await manifestLoader.loadAppPathsManifest(page)\n await manifestLoader.loadActionManifest(page)\n await manifestLoader.loadFontManifest(page, 'app')\n\n if (shouldCreateWebpackStats) {\n await manifestLoader.loadWebpackStats(page, 'app')\n }\n\n await manifestLoader.writeManifests({\n devRewrites: undefined,\n productionRewrites,\n entrypoints,\n })\n\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n\n break\n }\n case 'app-route': {\n const key = getEntryKey('app', 'server', page)\n const writtenEndpoint = await route.endpoint.writeToDisk()\n const type = writtenEndpoint.type\n\n await manifestLoader.loadAppPathsManifest(page)\n\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'app')\n } else {\n manifestLoader.deleteMiddlewareManifest(key)\n }\n\n await manifestLoader.writeManifests({\n devRewrites: undefined,\n productionRewrites,\n entrypoints,\n })\n processIssues(currentEntryIssues, key, writtenEndpoint, true, logErrors)\n\n break\n }\n default: {\n throw new Error(`unknown route type ${(route as any).type} for ${page}`)\n }\n }\n}\n"],"names":["Log","getEntryKey","processIssues","handleEntrypoints","entrypoints","currentEntrypoints","currentEntryIssues","manifestLoader","productionRewrites","logErrors","global","app","pagesAppEndpoint","document","pagesDocumentEndpoint","error","pagesErrorEndpoint","instrumentation","page","clear","pathname","route","routes","type","set","pages","forEach","originalName","info","middleware","key","delete","processInstrumentation","name","prop","writtenEndpoint","writeToDisk","loadMiddlewareManifest","writeManifests","devRewrites","undefined","endpoint","processMiddleware","deleteMiddlewareManifest","handlePagesErrorRoute","loadBuildManifest","loadPagesManifest","loadFontManifest","handleRouteType","shouldCreateWebpackStats","process","env","TURBOPACK_STATS","serverKey","htmlEndpoint","loadWebpackStats","loadAppBuildManifest","loadAppPathsManifest","loadActionManifest","Error"],"mappings":"AASA,YAAYA,SAAS,eAAc;AACnC,SAASC,WAAW,QAAQ,oCAAmC;AAC/D,SACEC,aAAa,QAER,gCAA+B;AAEtC,OAAO,eAAeC,kBAAkB,EACtCC,WAAW,EACXC,kBAAkB,EAClBC,kBAAkB,EAClBC,cAAc,EACdC,kBAAkB,EAClBC,SAAS,EAQV;IACCJ,mBAAmBK,MAAM,CAACC,GAAG,GAAGP,YAAYQ,gBAAgB;IAC5DP,mBAAmBK,MAAM,CAACG,QAAQ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":["../../src/build/handle-entrypoints.ts"],"sourcesContent":["import type { TurbopackManifestLoader } from '../shared/lib/turbopack/manifest-loader'\nimport type {\n Entrypoints,\n PageRoute,\n AppRoute,\n RawEntrypoints,\n} from './swc/types'\nimport { getEntryKey } from '../shared/lib/turbopack/entry-key'\nimport * as Log from './output/log'\n\nexport async function rawEntrypointsToEntrypoints(\n entrypointsOp: RawEntrypoints\n): Promise<Entrypoints> {\n const page = new Map()\n const app = new Map()\n\n for (const [pathname, route] of entrypointsOp.routes) {\n switch (route.type) {\n case 'page':\n case 'page-api':\n page.set(pathname, route)\n break\n case 'app-page': {\n for (const p of route.pages) {\n app.set(p.originalName, {\n type: 'app-page',\n ...p,\n })\n }\n break\n }\n case 'app-route': {\n app.set(route.originalName, route)\n break\n }\n default:\n Log.info(`skipping ${pathname} (${route.type})`)\n break\n }\n }\n\n return {\n global: {\n app: entrypointsOp.pagesAppEndpoint,\n document: entrypointsOp.pagesDocumentEndpoint,\n error: entrypointsOp.pagesErrorEndpoint,\n instrumentation: entrypointsOp.instrumentation,\n middleware: entrypointsOp.middleware,\n },\n page,\n app,\n }\n}\n\nexport async function handleRouteType({\n page,\n route,\n manifestLoader,\n}: {\n page: string\n route: PageRoute | AppRoute\n manifestLoader: TurbopackManifestLoader\n}) {\n const shouldCreateWebpackStats = process.env.TURBOPACK_STATS != null\n\n switch (route.type) {\n case 'page': {\n const serverKey = getEntryKey('pages', 'server', page)\n\n await manifestLoader.loadBuildManifest(page)\n await manifestLoader.loadPagesManifest(page)\n\n const middlewareManifestWritten =\n await manifestLoader.loadMiddlewareManifest(page, 'pages')\n if (!middlewareManifestWritten) {\n manifestLoader.deleteMiddlewareManifest(serverKey)\n }\n\n await manifestLoader.loadFontManifest('/_app', 'pages')\n await manifestLoader.loadFontManifest(page, 'pages')\n\n if (shouldCreateWebpackStats) {\n await manifestLoader.loadWebpackStats(page, 'pages')\n }\n\n break\n }\n case 'page-api': {\n const key = getEntryKey('pages', 'server', page)\n\n await manifestLoader.loadPagesManifest(page)\n const middlewareManifestWritten =\n await manifestLoader.loadMiddlewareManifest(page, 'pages')\n if (!middlewareManifestWritten) {\n manifestLoader.deleteMiddlewareManifest(key)\n }\n\n break\n }\n case 'app-page': {\n const key = getEntryKey('app', 'server', page)\n\n const middlewareManifestWritten =\n await manifestLoader.loadMiddlewareManifest(page, 'app')\n if (!middlewareManifestWritten) {\n manifestLoader.deleteMiddlewareManifest(key)\n }\n\n await manifestLoader.loadAppBuildManifest(page)\n await manifestLoader.loadBuildManifest(page, 'app')\n await manifestLoader.loadAppPathsManifest(page)\n await manifestLoader.loadActionManifest(page)\n await manifestLoader.loadFontManifest(page, 'app')\n\n if (shouldCreateWebpackStats) {\n await manifestLoader.loadWebpackStats(page, 'app')\n }\n\n break\n }\n case 'app-route': {\n const key = getEntryKey('app', 'server', page)\n\n await manifestLoader.loadAppPathsManifest(page)\n\n const middlewareManifestWritten =\n await manifestLoader.loadMiddlewareManifest(page, 'app')\n\n if (!middlewareManifestWritten) {\n manifestLoader.deleteMiddlewareManifest(key)\n }\n\n break\n }\n default: {\n throw new Error(`unknown route type ${(route as any).type} for ${page}`)\n }\n }\n}\n"],"names":["getEntryKey","Log","rawEntrypointsToEntrypoints","entrypointsOp","page","Map","app","pathname","route","routes","type","set","p","pages","originalName","info","global","pagesAppEndpoint","document","pagesDocumentEndpoint","error","pagesErrorEndpoint","instrumentation","middleware","handleRouteType","manifestLoader","shouldCreateWebpackStats","process","env","TURBOPACK_STATS","serverKey","loadBuildManifest","loadPagesManifest","middlewareManifestWritten","loadMiddlewareManifest","deleteMiddlewareManifest","loadFontManifest","loadWebpackStats","key","loadAppBuildManifest","loadAppPathsManifest","loadActionManifest","Error"],"mappings":"AAOA,SAASA,WAAW,QAAQ,oCAAmC;AAC/D,YAAYC,SAAS,eAAc;AAEnC,OAAO,eAAeC,4BACpBC,aAA6B;IAE7B,MAAMC,OAAO,IAAIC;IACjB,MAAMC,MAAM,IAAID;IAEhB,KAAK,MAAM,C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"}
|
package/dist/esm/build/index.js
CHANGED
@@ -296,7 +296,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
296
296
|
const nextBuildSpan = trace('next-build', undefined, {
|
297
297
|
buildMode: experimentalBuildMode,
|
298
298
|
isTurboBuild: String(turboNextBuild),
|
299
|
-
version: "15.2.2-canary.
|
299
|
+
version: "15.2.2-canary.7"
|
300
300
|
});
|
301
301
|
NextBuildContext.nextBuildSpan = nextBuildSpan;
|
302
302
|
NextBuildContext.dir = dir;
|
@@ -655,7 +655,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
655
655
|
// Files outside of the distDir can be "type": "module"
|
656
656
|
await writeFileUtf8(path.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
657
657
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
658
|
-
await recordFrameworkVersion("15.2.2-canary.
|
658
|
+
await recordFrameworkVersion("15.2.2-canary.7");
|
659
659
|
await updateBuildDiagnostics({
|
660
660
|
buildStage: 'start'
|
661
661
|
});
|
@@ -254,6 +254,10 @@ export interface NapiEntrypoints {
|
|
254
254
|
pagesAppEndpoint: ExternalObject<ExternalEndpoint>
|
255
255
|
pagesErrorEndpoint: ExternalObject<ExternalEndpoint>
|
256
256
|
}
|
257
|
+
export declare function projectWriteAllEntrypointsToDisk(
|
258
|
+
project: { __napiType: 'Project' },
|
259
|
+
appDirOnly: boolean
|
260
|
+
): Promise<TurbopackResult>
|
257
261
|
export declare function projectEntrypointsSubscribe(
|
258
262
|
project: { __napiType: 'Project' },
|
259
263
|
func: (...args: any[]) => any
|
@@ -11,7 +11,7 @@ import { isDeepStrictEqual } from 'util';
|
|
11
11
|
import { getDefineEnv } from '../webpack/plugins/define-env-plugin';
|
12
12
|
import { getReactCompilerLoader } from '../get-babel-loader-config';
|
13
13
|
import { TurbopackInternalError } from '../../shared/lib/turbopack/utils';
|
14
|
-
const nextVersion = "15.2.2-canary.
|
14
|
+
const nextVersion = "15.2.2-canary.7";
|
15
15
|
const ArchName = arch();
|
16
16
|
const PlatformName = platform();
|
17
17
|
function infoLog(...args) {
|
@@ -410,77 +410,17 @@ function bindingToApi(binding, _wasm) {
|
|
410
410
|
async update(options) {
|
411
411
|
await withErrorCause(async ()=>binding.projectUpdate(this._nativeProject, await rustifyPartialProjectOptions(options)));
|
412
412
|
}
|
413
|
+
async writeAllEntrypointsToDisk(appDirOnly) {
|
414
|
+
return await withErrorCause(async ()=>{
|
415
|
+
const napiEndpoints = await binding.projectWriteAllEntrypointsToDisk(this._nativeProject, appDirOnly);
|
416
|
+
return napiEntrypointsToRawEntrypoints(napiEndpoints);
|
417
|
+
});
|
418
|
+
}
|
413
419
|
entrypointsSubscribe() {
|
414
420
|
const subscription = subscribe(false, async (callback)=>binding.projectEntrypointsSubscribe(this._nativeProject, callback));
|
415
421
|
return async function*() {
|
416
422
|
for await (const entrypoints of subscription){
|
417
|
-
|
418
|
-
for (const { pathname, ...nativeRoute } of entrypoints.routes){
|
419
|
-
let route;
|
420
|
-
const routeType = nativeRoute.type;
|
421
|
-
switch(routeType){
|
422
|
-
case 'page':
|
423
|
-
route = {
|
424
|
-
type: 'page',
|
425
|
-
htmlEndpoint: new EndpointImpl(nativeRoute.htmlEndpoint),
|
426
|
-
dataEndpoint: new EndpointImpl(nativeRoute.dataEndpoint)
|
427
|
-
};
|
428
|
-
break;
|
429
|
-
case 'page-api':
|
430
|
-
route = {
|
431
|
-
type: 'page-api',
|
432
|
-
endpoint: new EndpointImpl(nativeRoute.endpoint)
|
433
|
-
};
|
434
|
-
break;
|
435
|
-
case 'app-page':
|
436
|
-
route = {
|
437
|
-
type: 'app-page',
|
438
|
-
pages: nativeRoute.pages.map((page)=>({
|
439
|
-
originalName: page.originalName,
|
440
|
-
htmlEndpoint: new EndpointImpl(page.htmlEndpoint),
|
441
|
-
rscEndpoint: new EndpointImpl(page.rscEndpoint)
|
442
|
-
}))
|
443
|
-
};
|
444
|
-
break;
|
445
|
-
case 'app-route':
|
446
|
-
route = {
|
447
|
-
type: 'app-route',
|
448
|
-
originalName: nativeRoute.originalName,
|
449
|
-
endpoint: new EndpointImpl(nativeRoute.endpoint)
|
450
|
-
};
|
451
|
-
break;
|
452
|
-
case 'conflict':
|
453
|
-
route = {
|
454
|
-
type: 'conflict'
|
455
|
-
};
|
456
|
-
break;
|
457
|
-
default:
|
458
|
-
const _exhaustiveCheck = routeType;
|
459
|
-
invariant(nativeRoute, ()=>`Unknown route type: ${_exhaustiveCheck}`);
|
460
|
-
}
|
461
|
-
routes.set(pathname, route);
|
462
|
-
}
|
463
|
-
const napiMiddlewareToMiddleware = (middleware)=>({
|
464
|
-
endpoint: new EndpointImpl(middleware.endpoint),
|
465
|
-
runtime: middleware.runtime,
|
466
|
-
matcher: middleware.matcher
|
467
|
-
});
|
468
|
-
const middleware = entrypoints.middleware ? napiMiddlewareToMiddleware(entrypoints.middleware) : undefined;
|
469
|
-
const napiInstrumentationToInstrumentation = (instrumentation)=>({
|
470
|
-
nodeJs: new EndpointImpl(instrumentation.nodeJs),
|
471
|
-
edge: new EndpointImpl(instrumentation.edge)
|
472
|
-
});
|
473
|
-
const instrumentation = entrypoints.instrumentation ? napiInstrumentationToInstrumentation(entrypoints.instrumentation) : undefined;
|
474
|
-
yield {
|
475
|
-
routes,
|
476
|
-
middleware,
|
477
|
-
instrumentation,
|
478
|
-
pagesDocumentEndpoint: new EndpointImpl(entrypoints.pagesDocumentEndpoint),
|
479
|
-
pagesAppEndpoint: new EndpointImpl(entrypoints.pagesAppEndpoint),
|
480
|
-
pagesErrorEndpoint: new EndpointImpl(entrypoints.pagesErrorEndpoint),
|
481
|
-
issues: entrypoints.issues,
|
482
|
-
diagnostics: entrypoints.diagnostics
|
483
|
-
};
|
423
|
+
yield napiEntrypointsToRawEntrypoints(entrypoints);
|
484
424
|
}
|
485
425
|
}();
|
486
426
|
}
|
@@ -643,6 +583,75 @@ function bindingToApi(binding, _wasm) {
|
|
643
583
|
}
|
644
584
|
}
|
645
585
|
}
|
586
|
+
function napiEntrypointsToRawEntrypoints(entrypoints) {
|
587
|
+
const routes = new Map();
|
588
|
+
for (const { pathname, ...nativeRoute } of entrypoints.routes){
|
589
|
+
let route;
|
590
|
+
const routeType = nativeRoute.type;
|
591
|
+
switch(routeType){
|
592
|
+
case 'page':
|
593
|
+
route = {
|
594
|
+
type: 'page',
|
595
|
+
htmlEndpoint: new EndpointImpl(nativeRoute.htmlEndpoint),
|
596
|
+
dataEndpoint: new EndpointImpl(nativeRoute.dataEndpoint)
|
597
|
+
};
|
598
|
+
break;
|
599
|
+
case 'page-api':
|
600
|
+
route = {
|
601
|
+
type: 'page-api',
|
602
|
+
endpoint: new EndpointImpl(nativeRoute.endpoint)
|
603
|
+
};
|
604
|
+
break;
|
605
|
+
case 'app-page':
|
606
|
+
route = {
|
607
|
+
type: 'app-page',
|
608
|
+
pages: nativeRoute.pages.map((page)=>({
|
609
|
+
originalName: page.originalName,
|
610
|
+
htmlEndpoint: new EndpointImpl(page.htmlEndpoint),
|
611
|
+
rscEndpoint: new EndpointImpl(page.rscEndpoint)
|
612
|
+
}))
|
613
|
+
};
|
614
|
+
break;
|
615
|
+
case 'app-route':
|
616
|
+
route = {
|
617
|
+
type: 'app-route',
|
618
|
+
originalName: nativeRoute.originalName,
|
619
|
+
endpoint: new EndpointImpl(nativeRoute.endpoint)
|
620
|
+
};
|
621
|
+
break;
|
622
|
+
case 'conflict':
|
623
|
+
route = {
|
624
|
+
type: 'conflict'
|
625
|
+
};
|
626
|
+
break;
|
627
|
+
default:
|
628
|
+
const _exhaustiveCheck = routeType;
|
629
|
+
invariant(nativeRoute, ()=>`Unknown route type: ${_exhaustiveCheck}`);
|
630
|
+
}
|
631
|
+
routes.set(pathname, route);
|
632
|
+
}
|
633
|
+
const napiMiddlewareToMiddleware = (middleware)=>({
|
634
|
+
endpoint: new EndpointImpl(middleware.endpoint),
|
635
|
+
runtime: middleware.runtime,
|
636
|
+
matcher: middleware.matcher
|
637
|
+
});
|
638
|
+
const middleware = entrypoints.middleware ? napiMiddlewareToMiddleware(entrypoints.middleware) : undefined;
|
639
|
+
const napiInstrumentationToInstrumentation = (instrumentation)=>({
|
640
|
+
nodeJs: new EndpointImpl(instrumentation.nodeJs),
|
641
|
+
edge: new EndpointImpl(instrumentation.edge)
|
642
|
+
});
|
643
|
+
const instrumentation = entrypoints.instrumentation ? napiInstrumentationToInstrumentation(entrypoints.instrumentation) : undefined;
|
644
|
+
return {
|
645
|
+
routes,
|
646
|
+
middleware,
|
647
|
+
instrumentation,
|
648
|
+
pagesDocumentEndpoint: new EndpointImpl(entrypoints.pagesDocumentEndpoint),
|
649
|
+
pagesAppEndpoint: new EndpointImpl(entrypoints.pagesAppEndpoint),
|
650
|
+
pagesErrorEndpoint: new EndpointImpl(entrypoints.pagesErrorEndpoint),
|
651
|
+
issues: entrypoints.issues,
|
652
|
+
diagnostics: entrypoints.diagnostics
|
653
|
+
};
|
654
|
+
}
|
646
655
|
return async function createProject(options, turboEngineOptions) {
|
647
656
|
return new ProjectImpl(await binding.projectNew(await rustifyProjectOptions(options), turboEngineOptions || {}));
|
648
657
|
};
|