next 15.2.2-canary.7 → 15.2.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/bin/next +1 -1
- package/dist/build/handle-entrypoints.d.ts +23 -3
- package/dist/build/handle-entrypoints.js +149 -36
- package/dist/build/handle-entrypoints.js.map +1 -1
- package/dist/build/index.js +2 -2
- package/dist/build/swc/generated-native.d.ts +0 -4
- package/dist/build/swc/index.js +68 -77
- package/dist/build/swc/index.js.map +1 -1
- package/dist/build/swc/types.d.ts +0 -1
- package/dist/build/turbopack-build/impl.js +160 -33
- 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 +5 -3
- 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 +140 -31
- 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 +0 -4
- package/dist/esm/build/swc/index.js +68 -77
- 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 +120 -34
- 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 +5 -3
- 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 +1 -11
- package/dist/esm/shared/lib/get-img-props.js.map +1 -1
- package/dist/esm/shared/lib/turbopack/manifest-loader.js +14 -24
- 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 +1 -2
- package/dist/shared/lib/get-img-props.js +1 -11
- package/dist/shared/lib/get-img-props.js.map +1 -1
- package/dist/shared/lib/turbopack/manifest-loader.d.ts +1 -4
- package/dist/shared/lib/turbopack/manifest-loader.js +14 -24
- 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 +1 -2
- package/dist/telemetry/events/build.js +1 -2
- package/dist/telemetry/events/build.js.map +1 -1
- package/dist/telemetry/events/session-stopped.d.ts +1 -2
- package/dist/telemetry/events/session-stopped.js +3 -4
- package/dist/telemetry/events/session-stopped.js.map +1 -1
- package/dist/telemetry/events/version.d.ts +1 -2
- package/dist/telemetry/events/version.js +2 -3
- package/dist/telemetry/events/version.js.map +1 -1
- package/package.json +15 -15
package/dist/bin/next
CHANGED
@@ -79,7 +79,7 @@ const program = new NextRootCommand();
|
|
79
79
|
program.name('next').description('The Next.js CLI allows you to develop, build, start your application, and more.').configureHelp({
|
80
80
|
formatHelp: (cmd, helper)=>(0, _formatclihelpoutput.formatCliHelpOutput)(cmd, helper),
|
81
81
|
subcommandTerm: (cmd)=>`${cmd.name()} ${cmd.usage()}`
|
82
|
-
}).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.2.2
|
82
|
+
}).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.2.2"}`, '-v, --version', 'Outputs the Next.js version.');
|
83
83
|
program.command('build').description('Creates an optimized production build of your application. The output displays information about each route.').argument('[directory]', `A directory on which to build the application. ${(0, _picocolors.italic)('If no directory is provided, the current directory will be used.')}`).option('-d, --debug', 'Enables a more verbose build output.').option('--no-lint', 'Disables linting.').option('--no-mangling', 'Disables mangling.').option('--profile', 'Enables production profiling for React.').option('--experimental-app-only', 'Builds only App Router routes.').addOption(new _commander.Option('--experimental-turbo').hideHelp()).addOption(new _commander.Option('--experimental-build-mode [mode]', 'Uses an experimental build mode.').choices([
|
84
84
|
'compile',
|
85
85
|
'generate'
|
@@ -1,8 +1,28 @@
|
|
1
|
+
import type { CustomRoutes } from '../lib/load-custom-routes';
|
1
2
|
import type { TurbopackManifestLoader } from '../shared/lib/turbopack/manifest-loader';
|
2
|
-
import type { Entrypoints, PageRoute, AppRoute
|
3
|
-
|
4
|
-
export declare function
|
3
|
+
import type { TurbopackResult, RawEntrypoints, Entrypoints, PageRoute, AppRoute } from './swc/types';
|
4
|
+
import { type EntryIssuesMap } from '../shared/lib/turbopack/utils';
|
5
|
+
export declare function handleEntrypoints({ entrypoints, currentEntrypoints, currentEntryIssues, manifestLoader, productionRewrites, logErrors, }: {
|
6
|
+
entrypoints: TurbopackResult<RawEntrypoints>;
|
7
|
+
currentEntrypoints: Entrypoints;
|
8
|
+
currentEntryIssues: EntryIssuesMap;
|
9
|
+
manifestLoader: TurbopackManifestLoader;
|
10
|
+
productionRewrites: CustomRoutes['rewrites'] | undefined;
|
11
|
+
logErrors: boolean;
|
12
|
+
}): Promise<void>;
|
13
|
+
export declare function handlePagesErrorRoute({ currentEntryIssues, entrypoints, manifestLoader, productionRewrites, logErrors, }: {
|
14
|
+
currentEntryIssues: EntryIssuesMap;
|
15
|
+
entrypoints: Entrypoints;
|
16
|
+
manifestLoader: TurbopackManifestLoader;
|
17
|
+
productionRewrites: CustomRoutes['rewrites'] | undefined;
|
18
|
+
logErrors: boolean;
|
19
|
+
}): Promise<void>;
|
20
|
+
export declare function handleRouteType({ page, route, currentEntryIssues, entrypoints, manifestLoader, productionRewrites, logErrors, }: {
|
5
21
|
page: string;
|
6
22
|
route: PageRoute | AppRoute;
|
23
|
+
currentEntryIssues: EntryIssuesMap;
|
24
|
+
entrypoints: Entrypoints;
|
7
25
|
manifestLoader: TurbopackManifestLoader;
|
26
|
+
productionRewrites: CustomRoutes['rewrites'] | undefined;
|
27
|
+
logErrors: boolean;
|
8
28
|
}): Promise<void>;
|
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
4
4
|
});
|
5
5
|
0 && (module.exports = {
|
6
|
-
|
7
|
-
|
6
|
+
handleEntrypoints: null,
|
7
|
+
handlePagesErrorRoute: null,
|
8
|
+
handleRouteType: null
|
8
9
|
});
|
9
10
|
function _export(target, all) {
|
10
11
|
for(var name in all)Object.defineProperty(target, name, {
|
@@ -13,15 +14,19 @@ function _export(target, all) {
|
|
13
14
|
});
|
14
15
|
}
|
15
16
|
_export(exports, {
|
17
|
+
handleEntrypoints: function() {
|
18
|
+
return handleEntrypoints;
|
19
|
+
},
|
20
|
+
handlePagesErrorRoute: function() {
|
21
|
+
return handlePagesErrorRoute;
|
22
|
+
},
|
16
23
|
handleRouteType: function() {
|
17
24
|
return handleRouteType;
|
18
|
-
},
|
19
|
-
rawEntrypointsToEntrypoints: function() {
|
20
|
-
return rawEntrypointsToEntrypoints;
|
21
25
|
}
|
22
26
|
});
|
23
|
-
const _entrykey = require("../shared/lib/turbopack/entry-key");
|
24
27
|
const _log = /*#__PURE__*/ _interop_require_wildcard(require("./output/log"));
|
28
|
+
const _entrykey = require("../shared/lib/turbopack/entry-key");
|
29
|
+
const _utils = require("../shared/lib/turbopack/utils");
|
25
30
|
function _getRequireWildcardCache(nodeInterop) {
|
26
31
|
if (typeof WeakMap !== "function") return null;
|
27
32
|
var cacheBabelInterop = new WeakMap();
|
@@ -63,28 +68,32 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
63
68
|
}
|
64
69
|
return newObj;
|
65
70
|
}
|
66
|
-
async function
|
67
|
-
|
68
|
-
|
69
|
-
|
71
|
+
async function handleEntrypoints({ entrypoints, currentEntrypoints, currentEntryIssues, manifestLoader, productionRewrites, logErrors }) {
|
72
|
+
currentEntrypoints.global.app = entrypoints.pagesAppEndpoint;
|
73
|
+
currentEntrypoints.global.document = entrypoints.pagesDocumentEndpoint;
|
74
|
+
currentEntrypoints.global.error = entrypoints.pagesErrorEndpoint;
|
75
|
+
currentEntrypoints.global.instrumentation = entrypoints.instrumentation;
|
76
|
+
currentEntrypoints.page.clear();
|
77
|
+
currentEntrypoints.app.clear();
|
78
|
+
for (const [pathname, route] of entrypoints.routes){
|
70
79
|
switch(route.type){
|
71
80
|
case 'page':
|
72
81
|
case 'page-api':
|
73
|
-
page.set(pathname, route);
|
82
|
+
currentEntrypoints.page.set(pathname, route);
|
74
83
|
break;
|
75
84
|
case 'app-page':
|
76
85
|
{
|
77
|
-
|
78
|
-
app.set(
|
86
|
+
route.pages.forEach((page)=>{
|
87
|
+
currentEntrypoints.app.set(page.originalName, {
|
79
88
|
type: 'app-page',
|
80
|
-
...
|
89
|
+
...page
|
81
90
|
});
|
82
|
-
}
|
91
|
+
});
|
83
92
|
break;
|
84
93
|
}
|
85
94
|
case 'app-route':
|
86
95
|
{
|
87
|
-
app.set(route.originalName, route);
|
96
|
+
currentEntrypoints.app.set(route.originalName, route);
|
88
97
|
break;
|
89
98
|
}
|
90
99
|
default:
|
@@ -92,28 +101,99 @@ async function rawEntrypointsToEntrypoints(entrypointsOp) {
|
|
92
101
|
break;
|
93
102
|
}
|
94
103
|
}
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
104
|
+
const { middleware, instrumentation } = entrypoints;
|
105
|
+
// We check for explicit true/false, since it's initialized to
|
106
|
+
// undefined during the first loop (middlewareChanges event is
|
107
|
+
// unnecessary during the first serve)
|
108
|
+
if (currentEntrypoints.global.middleware && !middleware) {
|
109
|
+
const key = (0, _entrykey.getEntryKey)('root', 'server', 'middleware');
|
110
|
+
// Went from middleware to no middleware
|
111
|
+
currentEntryIssues.delete(key);
|
112
|
+
}
|
113
|
+
currentEntrypoints.global.middleware = middleware;
|
114
|
+
if (instrumentation) {
|
115
|
+
const processInstrumentation = async (name, prop)=>{
|
116
|
+
const key = (0, _entrykey.getEntryKey)('root', 'server', name);
|
117
|
+
const writtenEndpoint = await instrumentation[prop].writeToDisk();
|
118
|
+
(0, _utils.processIssues)(currentEntryIssues, key, writtenEndpoint, false, logErrors);
|
119
|
+
};
|
120
|
+
await processInstrumentation('instrumentation.nodeJs', 'nodeJs');
|
121
|
+
await processInstrumentation('instrumentation.edge', 'edge');
|
122
|
+
await manifestLoader.loadMiddlewareManifest('instrumentation', 'instrumentation');
|
123
|
+
await manifestLoader.writeManifests({
|
124
|
+
devRewrites: undefined,
|
125
|
+
productionRewrites,
|
126
|
+
entrypoints: currentEntrypoints
|
127
|
+
});
|
128
|
+
}
|
129
|
+
if (middleware) {
|
130
|
+
const key = (0, _entrykey.getEntryKey)('root', 'server', 'middleware');
|
131
|
+
const endpoint = middleware.endpoint;
|
132
|
+
async function processMiddleware() {
|
133
|
+
const writtenEndpoint = await endpoint.writeToDisk();
|
134
|
+
(0, _utils.processIssues)(currentEntryIssues, key, writtenEndpoint, false, logErrors);
|
135
|
+
await manifestLoader.loadMiddlewareManifest('middleware', 'middleware');
|
136
|
+
}
|
137
|
+
await processMiddleware();
|
138
|
+
} else {
|
139
|
+
manifestLoader.deleteMiddlewareManifest((0, _entrykey.getEntryKey)('root', 'server', 'middleware'));
|
140
|
+
}
|
106
141
|
}
|
107
|
-
async function
|
142
|
+
async function handlePagesErrorRoute({ currentEntryIssues, entrypoints, manifestLoader, productionRewrites, logErrors }) {
|
143
|
+
if (entrypoints.global.app) {
|
144
|
+
const key = (0, _entrykey.getEntryKey)('pages', 'server', '_app');
|
145
|
+
const writtenEndpoint = await entrypoints.global.app.writeToDisk();
|
146
|
+
(0, _utils.processIssues)(currentEntryIssues, key, writtenEndpoint, false, logErrors);
|
147
|
+
}
|
148
|
+
await manifestLoader.loadBuildManifest('_app');
|
149
|
+
await manifestLoader.loadPagesManifest('_app');
|
150
|
+
await manifestLoader.loadFontManifest('_app');
|
151
|
+
if (entrypoints.global.document) {
|
152
|
+
const key = (0, _entrykey.getEntryKey)('pages', 'server', '_document');
|
153
|
+
const writtenEndpoint = await entrypoints.global.document.writeToDisk();
|
154
|
+
(0, _utils.processIssues)(currentEntryIssues, key, writtenEndpoint, false, logErrors);
|
155
|
+
}
|
156
|
+
await manifestLoader.loadPagesManifest('_document');
|
157
|
+
if (entrypoints.global.error) {
|
158
|
+
const key = (0, _entrykey.getEntryKey)('pages', 'server', '_error');
|
159
|
+
const writtenEndpoint = await entrypoints.global.error.writeToDisk();
|
160
|
+
(0, _utils.processIssues)(currentEntryIssues, key, writtenEndpoint, false, logErrors);
|
161
|
+
}
|
162
|
+
await manifestLoader.loadBuildManifest('_error');
|
163
|
+
await manifestLoader.loadPagesManifest('_error');
|
164
|
+
await manifestLoader.loadFontManifest('_error');
|
165
|
+
await manifestLoader.writeManifests({
|
166
|
+
devRewrites: undefined,
|
167
|
+
productionRewrites,
|
168
|
+
entrypoints
|
169
|
+
});
|
170
|
+
}
|
171
|
+
async function handleRouteType({ page, route, currentEntryIssues, entrypoints, manifestLoader, productionRewrites, logErrors }) {
|
108
172
|
const shouldCreateWebpackStats = process.env.TURBOPACK_STATS != null;
|
109
173
|
switch(route.type){
|
110
174
|
case 'page':
|
111
175
|
{
|
112
176
|
const serverKey = (0, _entrykey.getEntryKey)('pages', 'server', page);
|
177
|
+
if (entrypoints.global.app) {
|
178
|
+
const key = (0, _entrykey.getEntryKey)('pages', 'server', '_app');
|
179
|
+
const writtenEndpoint = await entrypoints.global.app.writeToDisk();
|
180
|
+
(0, _utils.processIssues)(currentEntryIssues, key, writtenEndpoint, false, logErrors);
|
181
|
+
}
|
182
|
+
await manifestLoader.loadBuildManifest('_app');
|
183
|
+
await manifestLoader.loadPagesManifest('_app');
|
184
|
+
if (entrypoints.global.document) {
|
185
|
+
const key = (0, _entrykey.getEntryKey)('pages', 'server', '_document');
|
186
|
+
const writtenEndpoint = await entrypoints.global.document.writeToDisk();
|
187
|
+
(0, _utils.processIssues)(currentEntryIssues, key, writtenEndpoint, false, logErrors);
|
188
|
+
}
|
189
|
+
await manifestLoader.loadPagesManifest('_document');
|
190
|
+
const writtenEndpoint = await route.htmlEndpoint.writeToDisk();
|
191
|
+
const type = writtenEndpoint == null ? void 0 : writtenEndpoint.type;
|
113
192
|
await manifestLoader.loadBuildManifest(page);
|
114
193
|
await manifestLoader.loadPagesManifest(page);
|
115
|
-
|
116
|
-
|
194
|
+
if (type === 'edge') {
|
195
|
+
await manifestLoader.loadMiddlewareManifest(page, 'pages');
|
196
|
+
} else {
|
117
197
|
manifestLoader.deleteMiddlewareManifest(serverKey);
|
118
198
|
}
|
119
199
|
await manifestLoader.loadFontManifest('/_app', 'pages');
|
@@ -121,23 +201,41 @@ async function handleRouteType({ page, route, manifestLoader }) {
|
|
121
201
|
if (shouldCreateWebpackStats) {
|
122
202
|
await manifestLoader.loadWebpackStats(page, 'pages');
|
123
203
|
}
|
204
|
+
await manifestLoader.writeManifests({
|
205
|
+
devRewrites: undefined,
|
206
|
+
productionRewrites,
|
207
|
+
entrypoints
|
208
|
+
});
|
209
|
+
(0, _utils.processIssues)(currentEntryIssues, serverKey, writtenEndpoint, false, logErrors);
|
124
210
|
break;
|
125
211
|
}
|
126
212
|
case 'page-api':
|
127
213
|
{
|
128
214
|
const key = (0, _entrykey.getEntryKey)('pages', 'server', page);
|
215
|
+
const writtenEndpoint = await route.endpoint.writeToDisk();
|
216
|
+
const type = writtenEndpoint.type;
|
129
217
|
await manifestLoader.loadPagesManifest(page);
|
130
|
-
|
131
|
-
|
218
|
+
if (type === 'edge') {
|
219
|
+
await manifestLoader.loadMiddlewareManifest(page, 'pages');
|
220
|
+
} else {
|
132
221
|
manifestLoader.deleteMiddlewareManifest(key);
|
133
222
|
}
|
223
|
+
await manifestLoader.writeManifests({
|
224
|
+
devRewrites: undefined,
|
225
|
+
productionRewrites,
|
226
|
+
entrypoints
|
227
|
+
});
|
228
|
+
(0, _utils.processIssues)(currentEntryIssues, key, writtenEndpoint, true, logErrors);
|
134
229
|
break;
|
135
230
|
}
|
136
231
|
case 'app-page':
|
137
232
|
{
|
138
233
|
const key = (0, _entrykey.getEntryKey)('app', 'server', page);
|
139
|
-
const
|
140
|
-
|
234
|
+
const writtenEndpoint = await route.htmlEndpoint.writeToDisk();
|
235
|
+
const type = writtenEndpoint.type;
|
236
|
+
if (type === 'edge') {
|
237
|
+
await manifestLoader.loadMiddlewareManifest(page, 'app');
|
238
|
+
} else {
|
141
239
|
manifestLoader.deleteMiddlewareManifest(key);
|
142
240
|
}
|
143
241
|
await manifestLoader.loadAppBuildManifest(page);
|
@@ -148,16 +246,31 @@ async function handleRouteType({ page, route, manifestLoader }) {
|
|
148
246
|
if (shouldCreateWebpackStats) {
|
149
247
|
await manifestLoader.loadWebpackStats(page, 'app');
|
150
248
|
}
|
249
|
+
await manifestLoader.writeManifests({
|
250
|
+
devRewrites: undefined,
|
251
|
+
productionRewrites,
|
252
|
+
entrypoints
|
253
|
+
});
|
254
|
+
(0, _utils.processIssues)(currentEntryIssues, key, writtenEndpoint, false, logErrors);
|
151
255
|
break;
|
152
256
|
}
|
153
257
|
case 'app-route':
|
154
258
|
{
|
155
259
|
const key = (0, _entrykey.getEntryKey)('app', 'server', page);
|
260
|
+
const writtenEndpoint = await route.endpoint.writeToDisk();
|
261
|
+
const type = writtenEndpoint.type;
|
156
262
|
await manifestLoader.loadAppPathsManifest(page);
|
157
|
-
|
158
|
-
|
263
|
+
if (type === 'edge') {
|
264
|
+
await manifestLoader.loadMiddlewareManifest(page, 'app');
|
265
|
+
} else {
|
159
266
|
manifestLoader.deleteMiddlewareManifest(key);
|
160
267
|
}
|
268
|
+
await manifestLoader.writeManifests({
|
269
|
+
devRewrites: undefined,
|
270
|
+
productionRewrites,
|
271
|
+
entrypoints
|
272
|
+
});
|
273
|
+
(0, _utils.processIssues)(currentEntryIssues, key, writtenEndpoint, true, logErrors);
|
161
274
|
break;
|
162
275
|
}
|
163
276
|
default:
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../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":["handleRouteType","rawEntrypointsToEntrypoints","entrypointsOp","page","Map","app","pathname","route","routes","type","set","p","pages","originalName","Log","info","global","pagesAppEndpoint","document","pagesDocumentEndpoint","error","pagesErrorEndpoint","instrumentation","middleware","manifestLoader","shouldCreateWebpackStats","process","env","TURBOPACK_STATS","serverKey","getEntryKey","loadBuildManifest","loadPagesManifest","middlewareManifestWritten","loadMiddlewareManifest","deleteMiddlewareManifest","loadFontManifest","loadWebpackStats","key","loadAppBuildManifest","loadAppPathsManifest","loadActionManifest","Error"],"mappings":";;;;;;;;;;;;;;;IAsDsBA,eAAe;eAAfA;;IA5CAC,2BAA2B;eAA3BA;;;0BAHM;6DACP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,eAAeA,4BACpBC,aAA6B;IAE7B,MAAMC,OAAO,IAAIC;IACjB,MAAMC,MAAM,IAAID;IAEhB,KAAK,MAAM,CAACE,UAAUC,MAAM,IAAIL,cAAcM,MAAM,CAAE;QACpD,OAAQD,MAAME,IAAI;YAChB,KAAK;YACL,KAAK;gBACHN,KAAKO,GAAG,CAACJ,UAAUC;gBACnB;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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":["handleEntrypoints","handlePagesErrorRoute","handleRouteType","entrypoints","currentEntrypoints","currentEntryIssues","manifestLoader","productionRewrites","logErrors","global","app","pagesAppEndpoint","document","pagesDocumentEndpoint","error","pagesErrorEndpoint","instrumentation","page","clear","pathname","route","routes","type","set","pages","forEach","originalName","Log","info","middleware","key","getEntryKey","delete","processInstrumentation","name","prop","writtenEndpoint","writeToDisk","processIssues","loadMiddlewareManifest","writeManifests","devRewrites","undefined","endpoint","processMiddleware","deleteMiddlewareManifest","loadBuildManifest","loadPagesManifest","loadFontManifest","shouldCreateWebpackStats","process","env","TURBOPACK_STATS","serverKey","htmlEndpoint","loadWebpackStats","loadAppBuildManifest","loadAppPathsManifest","loadActionManifest","Error"],"mappings":";;;;;;;;;;;;;;;;IAgBsBA,iBAAiB;eAAjBA;;IAuGAC,qBAAqB;eAArBA;;IA8CAC,eAAe;eAAfA;;;6DA5JD;0BACO;uBAIrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,eAAeF,kBAAkB,EACtCG,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,GAAGT,YAAYU,qBAAqB;IACtET,mBAAmBK,MAAM,CAACK,KAAK,GAAGX,YAAYY,kBAAkB;IAEhEX,mBAAmBK,MAAM,CAACO,eAAe,GAAGb,YAAYa,eAAe;IAEvEZ,mBAAmBa,IAAI,CAACC,KAAK;IAC7Bd,mBAAmBM,GAAG,CAACQ,KAAK;IAE5B,KAAK,MAAM,CAACC,UAAUC,MAAM,IAAIjB,YAAYkB,MAAM,CAAE;QAClD,OAAQD,MAAME,IAAI;YAChB,KAAK;YACL,KAAK;gBACHlB,mBAAmBa,I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AAM;gBACpD,OAAO;oBACLX,eAAeuC,wBAAwB,CAACf;gBAC1C;gBAEA,MAAMxB,eAAekD,oBAAoB,CAACvC;gBAC1C,MAAMX,eAAewC,iBAAiB,CAAC7B,MAAM;gBAC7C,MAAMX,eAAemD,oBAAoB,CAACxC;gBAC1C,MAAMX,eAAeoD,kBAAkB,CAACzC;gBACxC,MAAMX,eAAe0C,gBAAgB,CAAC/B,MAAM;gBAE5C,IAAIgC,0BAA0B;oBAC5B,MAAM3C,eAAeiD,gBAAgB,CAACtC,MAAM;gBAC9C;gBAEA,MAAMX,eAAekC,cAAc,CAAC;oBAClCC,aAAaC;oBACbnC;oBACAJ;gBACF;gBAEAmC,IAAAA,oBAAa,EAACjC,oBAAoByB,KAAKM,iBAAiB,OAAO5B;gBAE/D;YACF;QACA,KAAK;YAAa;gBAChB,MAAMsB,MAAMC,IAAAA,qBAAW,EAAC,OAAO,UAAUd;gBACzC,MAAMmB,kBAAkB,MAAMhB,MAAMuB,QAAQ,CAACN,WAAW;gBACxD,MAAMf,OAAOc,gBAAgBd,IAAI;gBAEjC,MAAMhB,eAAemD,oBAAoB,CAACxC;gBAE1C,IAAIK,SAAS,QAAQ;oBACnB,MAAMhB,eAAeiC,sBAAsB,CAACtB,MAAM;gBACpD,OAAO;oBACLX,eAAeuC,wBAAwB,CAACf;gBAC1C;gBAEA,MAAMxB,eAAekC,cAAc,CAAC;oBAClCC,aAAaC;oBACbnC;oBACAJ;gBACF;gBACAmC,IAAAA,oBAAa,EAACjC,oBAAoByB,KAAKM,iBAAiB,MAAM5B;gBAE9D;YACF;QACA;YAAS;gBACP,MAAM,qBAAkE,CAAlE,IAAImD,MAAM,CAAC,mBAAmB,EAAE,AAACvC,MAAcE,IAAI,CAAC,KAAK,EAAEL,MAAM,GAAjE,qBAAA;2BAAA;gCAAA;kCAAA;gBAAiE;YACzE;IACF;AACF"}
|
package/dist/build/index.js
CHANGED
@@ -364,7 +364,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
364
364
|
const nextBuildSpan = (0, _trace.trace)('next-build', undefined, {
|
365
365
|
buildMode: experimentalBuildMode,
|
366
366
|
isTurboBuild: String(turboNextBuild),
|
367
|
-
version: "15.2.2
|
367
|
+
version: "15.2.2"
|
368
368
|
});
|
369
369
|
_buildcontext.NextBuildContext.nextBuildSpan = nextBuildSpan;
|
370
370
|
_buildcontext.NextBuildContext.dir = dir;
|
@@ -723,7 +723,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
723
723
|
// Files outside of the distDir can be "type": "module"
|
724
724
|
await writeFileUtf8(_path.default.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
725
725
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
726
|
-
await (0, _builddiagnostics.recordFrameworkVersion)("15.2.2
|
726
|
+
await (0, _builddiagnostics.recordFrameworkVersion)("15.2.2");
|
727
727
|
await (0, _builddiagnostics.updateBuildDiagnostics)({
|
728
728
|
buildStage: 'start'
|
729
729
|
});
|
@@ -254,10 +254,6 @@ 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>
|
261
257
|
export declare function projectEntrypointsSubscribe(
|
262
258
|
project: { __napiType: 'Project' },
|
263
259
|
func: (...args: any[]) => any
|
package/dist/build/swc/index.js
CHANGED
@@ -119,7 +119,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
119
119
|
}
|
120
120
|
return newObj;
|
121
121
|
}
|
122
|
-
const nextVersion = "15.2.2
|
122
|
+
const nextVersion = "15.2.2";
|
123
123
|
const ArchName = (0, _os.arch)();
|
124
124
|
const PlatformName = (0, _os.platform)();
|
125
125
|
function infoLog(...args) {
|
@@ -516,17 +516,77 @@ function bindingToApi(binding, _wasm) {
|
|
516
516
|
async update(options) {
|
517
517
|
await withErrorCause(async ()=>binding.projectUpdate(this._nativeProject, await rustifyPartialProjectOptions(options)));
|
518
518
|
}
|
519
|
-
async writeAllEntrypointsToDisk(appDirOnly) {
|
520
|
-
return await withErrorCause(async ()=>{
|
521
|
-
const napiEndpoints = await binding.projectWriteAllEntrypointsToDisk(this._nativeProject, appDirOnly);
|
522
|
-
return napiEntrypointsToRawEntrypoints(napiEndpoints);
|
523
|
-
});
|
524
|
-
}
|
525
519
|
entrypointsSubscribe() {
|
526
520
|
const subscription = subscribe(false, async (callback)=>binding.projectEntrypointsSubscribe(this._nativeProject, callback));
|
527
521
|
return async function*() {
|
528
522
|
for await (const entrypoints of subscription){
|
529
|
-
|
523
|
+
const routes = new Map();
|
524
|
+
for (const { pathname, ...nativeRoute } of entrypoints.routes){
|
525
|
+
let route;
|
526
|
+
const routeType = nativeRoute.type;
|
527
|
+
switch(routeType){
|
528
|
+
case 'page':
|
529
|
+
route = {
|
530
|
+
type: 'page',
|
531
|
+
htmlEndpoint: new EndpointImpl(nativeRoute.htmlEndpoint),
|
532
|
+
dataEndpoint: new EndpointImpl(nativeRoute.dataEndpoint)
|
533
|
+
};
|
534
|
+
break;
|
535
|
+
case 'page-api':
|
536
|
+
route = {
|
537
|
+
type: 'page-api',
|
538
|
+
endpoint: new EndpointImpl(nativeRoute.endpoint)
|
539
|
+
};
|
540
|
+
break;
|
541
|
+
case 'app-page':
|
542
|
+
route = {
|
543
|
+
type: 'app-page',
|
544
|
+
pages: nativeRoute.pages.map((page)=>({
|
545
|
+
originalName: page.originalName,
|
546
|
+
htmlEndpoint: new EndpointImpl(page.htmlEndpoint),
|
547
|
+
rscEndpoint: new EndpointImpl(page.rscEndpoint)
|
548
|
+
}))
|
549
|
+
};
|
550
|
+
break;
|
551
|
+
case 'app-route':
|
552
|
+
route = {
|
553
|
+
type: 'app-route',
|
554
|
+
originalName: nativeRoute.originalName,
|
555
|
+
endpoint: new EndpointImpl(nativeRoute.endpoint)
|
556
|
+
};
|
557
|
+
break;
|
558
|
+
case 'conflict':
|
559
|
+
route = {
|
560
|
+
type: 'conflict'
|
561
|
+
};
|
562
|
+
break;
|
563
|
+
default:
|
564
|
+
const _exhaustiveCheck = routeType;
|
565
|
+
invariant(nativeRoute, ()=>`Unknown route type: ${_exhaustiveCheck}`);
|
566
|
+
}
|
567
|
+
routes.set(pathname, route);
|
568
|
+
}
|
569
|
+
const napiMiddlewareToMiddleware = (middleware)=>({
|
570
|
+
endpoint: new EndpointImpl(middleware.endpoint),
|
571
|
+
runtime: middleware.runtime,
|
572
|
+
matcher: middleware.matcher
|
573
|
+
});
|
574
|
+
const middleware = entrypoints.middleware ? napiMiddlewareToMiddleware(entrypoints.middleware) : undefined;
|
575
|
+
const napiInstrumentationToInstrumentation = (instrumentation)=>({
|
576
|
+
nodeJs: new EndpointImpl(instrumentation.nodeJs),
|
577
|
+
edge: new EndpointImpl(instrumentation.edge)
|
578
|
+
});
|
579
|
+
const instrumentation = entrypoints.instrumentation ? napiInstrumentationToInstrumentation(entrypoints.instrumentation) : undefined;
|
580
|
+
yield {
|
581
|
+
routes,
|
582
|
+
middleware,
|
583
|
+
instrumentation,
|
584
|
+
pagesDocumentEndpoint: new EndpointImpl(entrypoints.pagesDocumentEndpoint),
|
585
|
+
pagesAppEndpoint: new EndpointImpl(entrypoints.pagesAppEndpoint),
|
586
|
+
pagesErrorEndpoint: new EndpointImpl(entrypoints.pagesErrorEndpoint),
|
587
|
+
issues: entrypoints.issues,
|
588
|
+
diagnostics: entrypoints.diagnostics
|
589
|
+
};
|
530
590
|
}
|
531
591
|
}();
|
532
592
|
}
|
@@ -689,75 +749,6 @@ function bindingToApi(binding, _wasm) {
|
|
689
749
|
}
|
690
750
|
}
|
691
751
|
}
|
692
|
-
function napiEntrypointsToRawEntrypoints(entrypoints) {
|
693
|
-
const routes = new Map();
|
694
|
-
for (const { pathname, ...nativeRoute } of entrypoints.routes){
|
695
|
-
let route;
|
696
|
-
const routeType = nativeRoute.type;
|
697
|
-
switch(routeType){
|
698
|
-
case 'page':
|
699
|
-
route = {
|
700
|
-
type: 'page',
|
701
|
-
htmlEndpoint: new EndpointImpl(nativeRoute.htmlEndpoint),
|
702
|
-
dataEndpoint: new EndpointImpl(nativeRoute.dataEndpoint)
|
703
|
-
};
|
704
|
-
break;
|
705
|
-
case 'page-api':
|
706
|
-
route = {
|
707
|
-
type: 'page-api',
|
708
|
-
endpoint: new EndpointImpl(nativeRoute.endpoint)
|
709
|
-
};
|
710
|
-
break;
|
711
|
-
case 'app-page':
|
712
|
-
route = {
|
713
|
-
type: 'app-page',
|
714
|
-
pages: nativeRoute.pages.map((page)=>({
|
715
|
-
originalName: page.originalName,
|
716
|
-
htmlEndpoint: new EndpointImpl(page.htmlEndpoint),
|
717
|
-
rscEndpoint: new EndpointImpl(page.rscEndpoint)
|
718
|
-
}))
|
719
|
-
};
|
720
|
-
break;
|
721
|
-
case 'app-route':
|
722
|
-
route = {
|
723
|
-
type: 'app-route',
|
724
|
-
originalName: nativeRoute.originalName,
|
725
|
-
endpoint: new EndpointImpl(nativeRoute.endpoint)
|
726
|
-
};
|
727
|
-
break;
|
728
|
-
case 'conflict':
|
729
|
-
route = {
|
730
|
-
type: 'conflict'
|
731
|
-
};
|
732
|
-
break;
|
733
|
-
default:
|
734
|
-
const _exhaustiveCheck = routeType;
|
735
|
-
invariant(nativeRoute, ()=>`Unknown route type: ${_exhaustiveCheck}`);
|
736
|
-
}
|
737
|
-
routes.set(pathname, route);
|
738
|
-
}
|
739
|
-
const napiMiddlewareToMiddleware = (middleware)=>({
|
740
|
-
endpoint: new EndpointImpl(middleware.endpoint),
|
741
|
-
runtime: middleware.runtime,
|
742
|
-
matcher: middleware.matcher
|
743
|
-
});
|
744
|
-
const middleware = entrypoints.middleware ? napiMiddlewareToMiddleware(entrypoints.middleware) : undefined;
|
745
|
-
const napiInstrumentationToInstrumentation = (instrumentation)=>({
|
746
|
-
nodeJs: new EndpointImpl(instrumentation.nodeJs),
|
747
|
-
edge: new EndpointImpl(instrumentation.edge)
|
748
|
-
});
|
749
|
-
const instrumentation = entrypoints.instrumentation ? napiInstrumentationToInstrumentation(entrypoints.instrumentation) : undefined;
|
750
|
-
return {
|
751
|
-
routes,
|
752
|
-
middleware,
|
753
|
-
instrumentation,
|
754
|
-
pagesDocumentEndpoint: new EndpointImpl(entrypoints.pagesDocumentEndpoint),
|
755
|
-
pagesAppEndpoint: new EndpointImpl(entrypoints.pagesAppEndpoint),
|
756
|
-
pagesErrorEndpoint: new EndpointImpl(entrypoints.pagesErrorEndpoint),
|
757
|
-
issues: entrypoints.issues,
|
758
|
-
diagnostics: entrypoints.diagnostics
|
759
|
-
};
|
760
|
-
}
|
761
752
|
return async function createProject(options, turboEngineOptions) {
|
762
753
|
return new ProjectImpl(await binding.projectNew(await rustifyProjectOptions(options), turboEngineOptions || {}));
|
763
754
|
};
|