next 15.2.2-canary.5 → 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
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-canary.
|
82
|
+
}).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.2.2-canary.7"}`, '-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,28 +1,8 @@
|
|
1
|
-
import type { CustomRoutes } from '../lib/load-custom-routes';
|
2
1
|
import type { TurbopackManifestLoader } from '../shared/lib/turbopack/manifest-loader';
|
3
|
-
import type {
|
4
|
-
|
5
|
-
export declare function
|
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, }: {
|
2
|
+
import type { Entrypoints, PageRoute, AppRoute, RawEntrypoints } from './swc/types';
|
3
|
+
export declare function rawEntrypointsToEntrypoints(entrypointsOp: RawEntrypoints): Promise<Entrypoints>;
|
4
|
+
export declare function handleRouteType({ page, route, manifestLoader, }: {
|
21
5
|
page: string;
|
22
6
|
route: PageRoute | AppRoute;
|
23
|
-
currentEntryIssues: EntryIssuesMap;
|
24
|
-
entrypoints: Entrypoints;
|
25
7
|
manifestLoader: TurbopackManifestLoader;
|
26
|
-
productionRewrites: CustomRoutes['rewrites'] | undefined;
|
27
|
-
logErrors: boolean;
|
28
8
|
}): Promise<void>;
|
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
4
4
|
});
|
5
5
|
0 && (module.exports = {
|
6
|
-
|
7
|
-
|
8
|
-
handleRouteType: null
|
6
|
+
handleRouteType: null,
|
7
|
+
rawEntrypointsToEntrypoints: null
|
9
8
|
});
|
10
9
|
function _export(target, all) {
|
11
10
|
for(var name in all)Object.defineProperty(target, name, {
|
@@ -14,19 +13,15 @@ function _export(target, all) {
|
|
14
13
|
});
|
15
14
|
}
|
16
15
|
_export(exports, {
|
17
|
-
handleEntrypoints: function() {
|
18
|
-
return handleEntrypoints;
|
19
|
-
},
|
20
|
-
handlePagesErrorRoute: function() {
|
21
|
-
return handlePagesErrorRoute;
|
22
|
-
},
|
23
16
|
handleRouteType: function() {
|
24
17
|
return handleRouteType;
|
18
|
+
},
|
19
|
+
rawEntrypointsToEntrypoints: function() {
|
20
|
+
return rawEntrypointsToEntrypoints;
|
25
21
|
}
|
26
22
|
});
|
27
|
-
const _log = /*#__PURE__*/ _interop_require_wildcard(require("./output/log"));
|
28
23
|
const _entrykey = require("../shared/lib/turbopack/entry-key");
|
29
|
-
const
|
24
|
+
const _log = /*#__PURE__*/ _interop_require_wildcard(require("./output/log"));
|
30
25
|
function _getRequireWildcardCache(nodeInterop) {
|
31
26
|
if (typeof WeakMap !== "function") return null;
|
32
27
|
var cacheBabelInterop = new WeakMap();
|
@@ -68,32 +63,28 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
68
63
|
}
|
69
64
|
return newObj;
|
70
65
|
}
|
71
|
-
async function
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
currentEntrypoints.global.instrumentation = entrypoints.instrumentation;
|
76
|
-
currentEntrypoints.page.clear();
|
77
|
-
currentEntrypoints.app.clear();
|
78
|
-
for (const [pathname, route] of entrypoints.routes){
|
66
|
+
async function rawEntrypointsToEntrypoints(entrypointsOp) {
|
67
|
+
const page = new Map();
|
68
|
+
const app = new Map();
|
69
|
+
for (const [pathname, route] of entrypointsOp.routes){
|
79
70
|
switch(route.type){
|
80
71
|
case 'page':
|
81
72
|
case 'page-api':
|
82
|
-
|
73
|
+
page.set(pathname, route);
|
83
74
|
break;
|
84
75
|
case 'app-page':
|
85
76
|
{
|
86
|
-
route.pages
|
87
|
-
|
77
|
+
for (const p of route.pages){
|
78
|
+
app.set(p.originalName, {
|
88
79
|
type: 'app-page',
|
89
|
-
...
|
80
|
+
...p
|
90
81
|
});
|
91
|
-
}
|
82
|
+
}
|
92
83
|
break;
|
93
84
|
}
|
94
85
|
case 'app-route':
|
95
86
|
{
|
96
|
-
|
87
|
+
app.set(route.originalName, route);
|
97
88
|
break;
|
98
89
|
}
|
99
90
|
default:
|
@@ -101,99 +92,28 @@ async function handleEntrypoints({ entrypoints, currentEntrypoints, currentEntry
|
|
101
92
|
break;
|
102
93
|
}
|
103
94
|
}
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
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
|
-
}
|
141
|
-
}
|
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
|
-
});
|
95
|
+
return {
|
96
|
+
global: {
|
97
|
+
app: entrypointsOp.pagesAppEndpoint,
|
98
|
+
document: entrypointsOp.pagesDocumentEndpoint,
|
99
|
+
error: entrypointsOp.pagesErrorEndpoint,
|
100
|
+
instrumentation: entrypointsOp.instrumentation,
|
101
|
+
middleware: entrypointsOp.middleware
|
102
|
+
},
|
103
|
+
page,
|
104
|
+
app
|
105
|
+
};
|
170
106
|
}
|
171
|
-
async function handleRouteType({ page, route,
|
107
|
+
async function handleRouteType({ page, route, manifestLoader }) {
|
172
108
|
const shouldCreateWebpackStats = process.env.TURBOPACK_STATS != null;
|
173
109
|
switch(route.type){
|
174
110
|
case 'page':
|
175
111
|
{
|
176
112
|
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;
|
192
113
|
await manifestLoader.loadBuildManifest(page);
|
193
114
|
await manifestLoader.loadPagesManifest(page);
|
194
|
-
|
195
|
-
|
196
|
-
} else {
|
115
|
+
const middlewareManifestWritten = await manifestLoader.loadMiddlewareManifest(page, 'pages');
|
116
|
+
if (!middlewareManifestWritten) {
|
197
117
|
manifestLoader.deleteMiddlewareManifest(serverKey);
|
198
118
|
}
|
199
119
|
await manifestLoader.loadFontManifest('/_app', 'pages');
|
@@ -201,41 +121,23 @@ async function handleRouteType({ page, route, currentEntryIssues, entrypoints, m
|
|
201
121
|
if (shouldCreateWebpackStats) {
|
202
122
|
await manifestLoader.loadWebpackStats(page, 'pages');
|
203
123
|
}
|
204
|
-
await manifestLoader.writeManifests({
|
205
|
-
devRewrites: undefined,
|
206
|
-
productionRewrites,
|
207
|
-
entrypoints
|
208
|
-
});
|
209
|
-
(0, _utils.processIssues)(currentEntryIssues, serverKey, writtenEndpoint, false, logErrors);
|
210
124
|
break;
|
211
125
|
}
|
212
126
|
case 'page-api':
|
213
127
|
{
|
214
128
|
const key = (0, _entrykey.getEntryKey)('pages', 'server', page);
|
215
|
-
const writtenEndpoint = await route.endpoint.writeToDisk();
|
216
|
-
const type = writtenEndpoint.type;
|
217
129
|
await manifestLoader.loadPagesManifest(page);
|
218
|
-
|
219
|
-
|
220
|
-
} else {
|
130
|
+
const middlewareManifestWritten = await manifestLoader.loadMiddlewareManifest(page, 'pages');
|
131
|
+
if (!middlewareManifestWritten) {
|
221
132
|
manifestLoader.deleteMiddlewareManifest(key);
|
222
133
|
}
|
223
|
-
await manifestLoader.writeManifests({
|
224
|
-
devRewrites: undefined,
|
225
|
-
productionRewrites,
|
226
|
-
entrypoints
|
227
|
-
});
|
228
|
-
(0, _utils.processIssues)(currentEntryIssues, key, writtenEndpoint, true, logErrors);
|
229
134
|
break;
|
230
135
|
}
|
231
136
|
case 'app-page':
|
232
137
|
{
|
233
138
|
const key = (0, _entrykey.getEntryKey)('app', 'server', page);
|
234
|
-
const
|
235
|
-
|
236
|
-
if (type === 'edge') {
|
237
|
-
await manifestLoader.loadMiddlewareManifest(page, 'app');
|
238
|
-
} else {
|
139
|
+
const middlewareManifestWritten = await manifestLoader.loadMiddlewareManifest(page, 'app');
|
140
|
+
if (!middlewareManifestWritten) {
|
239
141
|
manifestLoader.deleteMiddlewareManifest(key);
|
240
142
|
}
|
241
143
|
await manifestLoader.loadAppBuildManifest(page);
|
@@ -246,31 +148,16 @@ async function handleRouteType({ page, route, currentEntryIssues, entrypoints, m
|
|
246
148
|
if (shouldCreateWebpackStats) {
|
247
149
|
await manifestLoader.loadWebpackStats(page, 'app');
|
248
150
|
}
|
249
|
-
await manifestLoader.writeManifests({
|
250
|
-
devRewrites: undefined,
|
251
|
-
productionRewrites,
|
252
|
-
entrypoints
|
253
|
-
});
|
254
|
-
(0, _utils.processIssues)(currentEntryIssues, key, writtenEndpoint, false, logErrors);
|
255
151
|
break;
|
256
152
|
}
|
257
153
|
case 'app-route':
|
258
154
|
{
|
259
155
|
const key = (0, _entrykey.getEntryKey)('app', 'server', page);
|
260
|
-
const writtenEndpoint = await route.endpoint.writeToDisk();
|
261
|
-
const type = writtenEndpoint.type;
|
262
156
|
await manifestLoader.loadAppPathsManifest(page);
|
263
|
-
|
264
|
-
|
265
|
-
} else {
|
157
|
+
const middlewareManifestWritten = await manifestLoader.loadMiddlewareManifest(page, 'app');
|
158
|
+
if (!middlewareManifestWritten) {
|
266
159
|
manifestLoader.deleteMiddlewareManifest(key);
|
267
160
|
}
|
268
|
-
await manifestLoader.writeManifests({
|
269
|
-
devRewrites: undefined,
|
270
|
-
productionRewrites,
|
271
|
-
entrypoints
|
272
|
-
});
|
273
|
-
(0, _utils.processIssues)(currentEntryIssues, key, writtenEndpoint, true, logErrors);
|
274
161
|
break;
|
275
162
|
}
|
276
163
|
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":["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,IAAI,CAACM,GAAG,CAACJ,UAAUC;gBACtC;YACF,KAAK;gBAAY;oBACfA,MAAMI,KAAK,CAACC,OAAO,CAAC,CAACR;wBACnBb,mBAAmBM,GAAG,CAACa,GAAG,CAACN,KAAKS,YAAY,EAAE;4BAC5CJ,MAAM;4BACN,GAAGL,IAAI;wBACT;oBACF;oBACA;gBACF;YACA,KAAK;gBAAa;oBAChBb,mBAAmBM,GAAG,CAACa,GAAG,CAACH,MAAMM,YAAY,EAAEN;oBAC/C;gBACF;YACA;gBACEO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C,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"}
|
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;YACF,KAAK;gBAAY;oBACf,KAAK,MAAMI,KAAKJ,MAAMK,KAAK,CAAE;wBAC3BP,IAAIK,GAAG,CAACC,EAAEE,YAAY,EAAE;4BACtBJ,MAAM;4BACN,GAAGE,CAAC;wBACN;oBACF;oBACA;gBACF;YACA,K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eW,wBAAwB,CAACG;gBAC1C;gBAEA;YACF;QACA,KAAK;YAAY;gBACf,MAAMA,MAAMR,IAAAA,qBAAW,EAAC,OAAO,UAAU3B;gBAEzC,MAAM8B,4BACJ,MAAMT,eAAeU,sBAAsB,CAAC/B,MAAM;gBACpD,IAAI,CAAC8B,2BAA2B;oBAC9BT,eAAeW,wBAAwB,CAACG;gBAC1C;gBAEA,MAAMd,eAAee,oBAAoB,CAACpC;gBAC1C,MAAMqB,eAAeO,iBAAiB,CAAC5B,MAAM;gBAC7C,MAAMqB,eAAegB,oBAAoB,CAACrC;gBAC1C,MAAMqB,eAAeiB,kBAAkB,CAACtC;gBACxC,MAAMqB,eAAeY,gBAAgB,CAACjC,MAAM;gBAE5C,IAAIsB,0BAA0B;oBAC5B,MAAMD,eAAea,gBAAgB,CAAClC,MAAM;gBAC9C;gBAEA;YACF;QACA,KAAK;YAAa;gBAChB,MAAMmC,MAAMR,IAAAA,qBAAW,EAAC,OAAO,UAAU3B;gBAEzC,MAAMqB,eAAegB,oBAAoB,CAACrC;gBAE1C,MAAM8B,4BACJ,MAAMT,eAAeU,sBAAsB,CAAC/B,MAAM;gBAEpD,IAAI,CAAC8B,2BAA2B;oBAC9BT,eAAeW,wBAAwB,CAACG;gBAC1C;gBAEA;YACF;QACA;YAAS;gBACP,MAAM,qBAAkE,CAAlE,IAAII,MAAM,CAAC,mBAAmB,EAAE,AAACnC,MAAcE,IAAI,CAAC,KAAK,EAAEN,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-canary.
|
367
|
+
version: "15.2.2-canary.7"
|
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-canary.
|
726
|
+
await (0, _builddiagnostics.recordFrameworkVersion)("15.2.2-canary.7");
|
727
727
|
await (0, _builddiagnostics.updateBuildDiagnostics)({
|
728
728
|
buildStage: 'start'
|
729
729
|
});
|
@@ -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
|
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-canary.
|
122
|
+
const nextVersion = "15.2.2-canary.7";
|
123
123
|
const ArchName = (0, _os.arch)();
|
124
124
|
const PlatformName = (0, _os.platform)();
|
125
125
|
function infoLog(...args) {
|
@@ -516,77 +516,17 @@ 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
|
+
}
|
519
525
|
entrypointsSubscribe() {
|
520
526
|
const subscription = subscribe(false, async (callback)=>binding.projectEntrypointsSubscribe(this._nativeProject, callback));
|
521
527
|
return async function*() {
|
522
528
|
for await (const entrypoints of subscription){
|
523
|
-
|
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
|
-
};
|
529
|
+
yield napiEntrypointsToRawEntrypoints(entrypoints);
|
590
530
|
}
|
591
531
|
}();
|
592
532
|
}
|
@@ -749,6 +689,75 @@ function bindingToApi(binding, _wasm) {
|
|
749
689
|
}
|
750
690
|
}
|
751
691
|
}
|
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
|
+
}
|
752
761
|
return async function createProject(options, turboEngineOptions) {
|
753
762
|
return new ProjectImpl(await binding.projectNew(await rustifyProjectOptions(options), turboEngineOptions || {}));
|
754
763
|
};
|