@netlify/plugin-nextjs 5.1.2 → 5.2.0
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/build/advanced-api-routes.js +121 -4
- package/dist/build/cache.js +25 -4
- package/dist/build/content/prerendered.js +234 -8
- package/dist/build/content/server.js +259 -14
- package/dist/build/content/static.js +96 -11
- package/dist/build/functions/edge.js +511 -5
- package/dist/build/functions/server.js +131 -12
- package/dist/build/image-cdn.js +1626 -3
- package/dist/build/plugin-context.js +236 -5
- package/dist/build/templates/handler-monorepo.tmpl.js +3 -0
- package/dist/build/templates/handler.tmpl.js +3 -0
- package/dist/build/verification.js +81 -8
- package/dist/esm-chunks/{package-RVJOBSMH.js → package-ZBRSUKN7.js} +5 -5
- package/dist/index.js +25 -36
- package/dist/run/config.js +25 -6
- package/dist/run/constants.js +7 -5
- package/dist/run/handlers/cache.cjs +6 -567
- package/dist/run/handlers/request-context.cjs +8 -1
- package/dist/run/handlers/server.js +20 -22
- package/dist/run/handlers/tracing.js +1 -1
- package/dist/run/headers.js +198 -8
- package/dist/run/next.cjs +49 -567
- package/dist/{esm-chunks/chunk-PMRBBOBY.js → run/regional-blob-store.cjs} +117 -263
- package/dist/run/revalidate.js +17 -3
- package/dist/run/systemlog.js +94 -3
- package/dist/shared/blobkey.js +15 -3
- package/package.json +1 -1
- package/dist/esm-chunks/chunk-3SUDZQ7L.js +0 -40
- package/dist/esm-chunks/chunk-4BNHE6TP.js +0 -278
- package/dist/esm-chunks/chunk-72ZI2IVI.js +0 -36
- package/dist/esm-chunks/chunk-BG455SFE.js +0 -133
- package/dist/esm-chunks/chunk-HESS57SH.js +0 -127
- package/dist/esm-chunks/chunk-HYBEXB2Z.js +0 -105
- package/dist/esm-chunks/chunk-K7BTUM7O.js +0 -97
- package/dist/esm-chunks/chunk-L6OM53B6.js +0 -238
- package/dist/esm-chunks/chunk-MCEOSJH6.js +0 -1637
- package/dist/esm-chunks/chunk-MRD3XSKD.js +0 -248
- package/dist/esm-chunks/chunk-RL4K4CVH.js +0 -27
- package/dist/esm-chunks/chunk-TYCYFZ22.js +0 -25
- package/dist/esm-chunks/chunk-UTQSBE5O.js +0 -524
- package/dist/esm-chunks/chunk-UYKENJEU.js +0 -19
- package/dist/esm-chunks/chunk-V2T6NUOM.js +0 -113
|
@@ -4,12 +4,243 @@
|
|
|
4
4
|
return createRequire(import.meta.url);
|
|
5
5
|
})();
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
EDGE_HANDLER_NAME,
|
|
9
|
-
PluginContext,
|
|
10
|
-
SERVER_HANDLER_NAME
|
|
11
|
-
} from "../esm-chunks/chunk-L6OM53B6.js";
|
|
12
7
|
import "../esm-chunks/chunk-5JVNISGM.js";
|
|
8
|
+
|
|
9
|
+
// src/build/plugin-context.ts
|
|
10
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
11
|
+
import { readFile } from "node:fs/promises";
|
|
12
|
+
import { join, relative, resolve } from "node:path";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
14
|
+
var MODULE_DIR = fileURLToPath(new URL(".", import.meta.url));
|
|
15
|
+
var PLUGIN_DIR = join(MODULE_DIR, "../..");
|
|
16
|
+
var DEFAULT_PUBLISH_DIR = ".next";
|
|
17
|
+
var SERVER_HANDLER_NAME = "___netlify-server-handler";
|
|
18
|
+
var EDGE_HANDLER_NAME = "___netlify-edge-handler";
|
|
19
|
+
var PluginContext = class {
|
|
20
|
+
utils;
|
|
21
|
+
netlifyConfig;
|
|
22
|
+
pluginName;
|
|
23
|
+
pluginVersion;
|
|
24
|
+
constants;
|
|
25
|
+
packageJSON;
|
|
26
|
+
/** Absolute path of the next runtime plugin directory */
|
|
27
|
+
pluginDir = PLUGIN_DIR;
|
|
28
|
+
get relPublishDir() {
|
|
29
|
+
return this.constants.PUBLISH_DIR ?? join(this.constants.PACKAGE_PATH || "", DEFAULT_PUBLISH_DIR);
|
|
30
|
+
}
|
|
31
|
+
/** Temporary directory for stashing the build output */
|
|
32
|
+
get tempPublishDir() {
|
|
33
|
+
return this.resolveFromPackagePath(".netlify/.next");
|
|
34
|
+
}
|
|
35
|
+
/** Absolute path of the publish directory */
|
|
36
|
+
get publishDir() {
|
|
37
|
+
return resolve(this.relPublishDir);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Relative package path in non monorepo setups this is an empty string
|
|
41
|
+
* This path is provided by Next.js RequiredServerFiles manifest
|
|
42
|
+
* @example ''
|
|
43
|
+
* @example 'apps/my-app'
|
|
44
|
+
*/
|
|
45
|
+
get relativeAppDir() {
|
|
46
|
+
return this.requiredServerFiles.relativeAppDir ?? "";
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The working directory inside the lambda that is used for monorepos to execute the serverless function
|
|
50
|
+
*/
|
|
51
|
+
get lambdaWorkingDirectory() {
|
|
52
|
+
return join("/var/task", this.distDirParent);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Retrieves the root of the `.next/standalone` directory
|
|
56
|
+
*/
|
|
57
|
+
get standaloneRootDir() {
|
|
58
|
+
return join(this.publishDir, "standalone");
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The resolved relative next dist directory defaults to `.next`,
|
|
62
|
+
* but can be configured through the next.config.js. For monorepos this will include the packagePath
|
|
63
|
+
* If we need just the plain dist dir use the `nextDistDir`
|
|
64
|
+
*/
|
|
65
|
+
get distDir() {
|
|
66
|
+
const dir = this.buildConfig.distDir ?? DEFAULT_PUBLISH_DIR;
|
|
67
|
+
return relative(process.cwd(), resolve(this.relativeAppDir, dir));
|
|
68
|
+
}
|
|
69
|
+
/** Represents the parent directory of the .next folder or custom distDir */
|
|
70
|
+
get distDirParent() {
|
|
71
|
+
return join(this.distDir, "..");
|
|
72
|
+
}
|
|
73
|
+
/** The `.next` folder or what the custom dist dir is set to */
|
|
74
|
+
get nextDistDir() {
|
|
75
|
+
return relative(this.distDirParent, this.distDir);
|
|
76
|
+
}
|
|
77
|
+
/** Retrieves the `.next/standalone/` directory monorepo aware */
|
|
78
|
+
get standaloneDir() {
|
|
79
|
+
return join(this.standaloneRootDir, this.distDirParent);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Absolute path of the directory that is published and deployed to the Netlify CDN
|
|
83
|
+
* Will be swapped with the publish directory
|
|
84
|
+
* `.netlify/static`
|
|
85
|
+
*/
|
|
86
|
+
get staticDir() {
|
|
87
|
+
return this.resolveFromPackagePath(".netlify/static");
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Absolute path of the directory that will be deployed to the blob store
|
|
91
|
+
* region aware: `.netlify/deploy/v1/blobs/deploy`
|
|
92
|
+
* default: `.netlify/blobs/deploy`
|
|
93
|
+
*/
|
|
94
|
+
get blobDir() {
|
|
95
|
+
if (this.useRegionalBlobs) {
|
|
96
|
+
return this.resolveFromPackagePath(".netlify/deploy/v1/blobs/deploy");
|
|
97
|
+
}
|
|
98
|
+
return this.resolveFromPackagePath(".netlify/blobs/deploy");
|
|
99
|
+
}
|
|
100
|
+
get buildVersion() {
|
|
101
|
+
return this.constants.NETLIFY_BUILD_VERSION || "v0.0.0";
|
|
102
|
+
}
|
|
103
|
+
get useRegionalBlobs() {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Absolute path of the directory containing the files for the serverless lambda function
|
|
108
|
+
* `.netlify/functions-internal`
|
|
109
|
+
*/
|
|
110
|
+
get serverFunctionsDir() {
|
|
111
|
+
return this.resolveFromPackagePath(".netlify/functions-internal");
|
|
112
|
+
}
|
|
113
|
+
/** Absolute path of the server handler */
|
|
114
|
+
get serverHandlerRootDir() {
|
|
115
|
+
return join(this.serverFunctionsDir, SERVER_HANDLER_NAME);
|
|
116
|
+
}
|
|
117
|
+
get serverHandlerDir() {
|
|
118
|
+
if (this.relativeAppDir.length === 0) {
|
|
119
|
+
return this.serverHandlerRootDir;
|
|
120
|
+
}
|
|
121
|
+
return join(this.serverHandlerRootDir, this.distDirParent);
|
|
122
|
+
}
|
|
123
|
+
get nextServerHandler() {
|
|
124
|
+
if (this.relativeAppDir.length !== 0) {
|
|
125
|
+
return join(this.lambdaWorkingDirectory, ".netlify/dist/run/handlers/server.js");
|
|
126
|
+
}
|
|
127
|
+
return "./.netlify/dist/run/handlers/server.js";
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Absolute path of the directory containing the files for deno edge functions
|
|
131
|
+
* `.netlify/edge-functions`
|
|
132
|
+
*/
|
|
133
|
+
get edgeFunctionsDir() {
|
|
134
|
+
return this.resolveFromPackagePath(".netlify/edge-functions");
|
|
135
|
+
}
|
|
136
|
+
/** Absolute path of the edge handler */
|
|
137
|
+
get edgeHandlerDir() {
|
|
138
|
+
return join(this.edgeFunctionsDir, EDGE_HANDLER_NAME);
|
|
139
|
+
}
|
|
140
|
+
constructor(options) {
|
|
141
|
+
this.packageJSON = JSON.parse(readFileSync(join(PLUGIN_DIR, "package.json"), "utf-8"));
|
|
142
|
+
this.pluginName = this.packageJSON.name;
|
|
143
|
+
this.pluginVersion = this.packageJSON.version;
|
|
144
|
+
this.constants = options.constants;
|
|
145
|
+
this.utils = options.utils;
|
|
146
|
+
this.netlifyConfig = options.netlifyConfig;
|
|
147
|
+
}
|
|
148
|
+
/** Resolves a path correctly with mono repository awareness for .netlify directories mainly */
|
|
149
|
+
resolveFromPackagePath(...args) {
|
|
150
|
+
return resolve(this.constants.PACKAGE_PATH || "", ...args);
|
|
151
|
+
}
|
|
152
|
+
/** Resolves a path correctly from site directory */
|
|
153
|
+
resolveFromSiteDir(...args) {
|
|
154
|
+
return resolve(this.requiredServerFiles.appDir, ...args);
|
|
155
|
+
}
|
|
156
|
+
/** Get the next prerender-manifest.json */
|
|
157
|
+
async getPrerenderManifest() {
|
|
158
|
+
return JSON.parse(await readFile(join(this.publishDir, "prerender-manifest.json"), "utf-8"));
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Uses various heuristics to try to find the .next dir.
|
|
162
|
+
* Works by looking for BUILD_ID, so requires the site to have been built
|
|
163
|
+
*/
|
|
164
|
+
findDotNext() {
|
|
165
|
+
for (const dir of [
|
|
166
|
+
// The publish directory
|
|
167
|
+
this.publishDir,
|
|
168
|
+
// In the root
|
|
169
|
+
resolve(DEFAULT_PUBLISH_DIR),
|
|
170
|
+
// The sibling of the publish directory
|
|
171
|
+
resolve(this.publishDir, "..", DEFAULT_PUBLISH_DIR),
|
|
172
|
+
// In the package dir
|
|
173
|
+
resolve(this.constants.PACKAGE_PATH || "", DEFAULT_PUBLISH_DIR)
|
|
174
|
+
]) {
|
|
175
|
+
if (existsSync(join(dir, "BUILD_ID"))) {
|
|
176
|
+
return dir;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Get Next.js middleware config from the build output
|
|
183
|
+
*/
|
|
184
|
+
async getMiddlewareManifest() {
|
|
185
|
+
return JSON.parse(
|
|
186
|
+
await readFile(join(this.publishDir, "server/middleware-manifest.json"), "utf-8")
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
// don't make private as it is handy inside testing to override the config
|
|
190
|
+
_requiredServerFiles = null;
|
|
191
|
+
/** Get RequiredServerFiles manifest from build output **/
|
|
192
|
+
get requiredServerFiles() {
|
|
193
|
+
if (!this._requiredServerFiles) {
|
|
194
|
+
let requiredServerFilesJson = join(this.publishDir, "required-server-files.json");
|
|
195
|
+
if (!existsSync(requiredServerFilesJson)) {
|
|
196
|
+
const dotNext = this.findDotNext();
|
|
197
|
+
if (dotNext) {
|
|
198
|
+
requiredServerFilesJson = join(dotNext, "required-server-files.json");
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
this._requiredServerFiles = JSON.parse(
|
|
202
|
+
readFileSync(requiredServerFilesJson, "utf-8")
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
return this._requiredServerFiles;
|
|
206
|
+
}
|
|
207
|
+
#exportDetail = null;
|
|
208
|
+
/** Get metadata when output = export */
|
|
209
|
+
get exportDetail() {
|
|
210
|
+
if (this.buildConfig.output !== "export") {
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
if (!this.#exportDetail) {
|
|
214
|
+
const detailFile = join(
|
|
215
|
+
this.requiredServerFiles.appDir,
|
|
216
|
+
this.buildConfig.distDir,
|
|
217
|
+
"export-detail.json"
|
|
218
|
+
);
|
|
219
|
+
if (!existsSync(detailFile)) {
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
try {
|
|
223
|
+
this.#exportDetail = JSON.parse(readFileSync(detailFile, "utf-8"));
|
|
224
|
+
} catch {
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return this.#exportDetail;
|
|
228
|
+
}
|
|
229
|
+
/** Get Next Config from build output **/
|
|
230
|
+
get buildConfig() {
|
|
231
|
+
return this.requiredServerFiles.config;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Get Next.js routes manifest from the build output
|
|
235
|
+
*/
|
|
236
|
+
async getRoutesManifest() {
|
|
237
|
+
return JSON.parse(await readFile(join(this.publishDir, "routes-manifest.json"), "utf-8"));
|
|
238
|
+
}
|
|
239
|
+
/** Fails a build with a message and an optional error */
|
|
240
|
+
failBuild(message, error) {
|
|
241
|
+
return this.utils.build.failBuild(message, error instanceof Error ? { error } : void 0);
|
|
242
|
+
}
|
|
243
|
+
};
|
|
13
244
|
export {
|
|
14
245
|
EDGE_HANDLER_NAME,
|
|
15
246
|
PluginContext,
|
|
@@ -7,6 +7,9 @@ import tracing from '{{cwd}}/.netlify/dist/run/handlers/tracing.js'
|
|
|
7
7
|
|
|
8
8
|
process.chdir('{{cwd}}')
|
|
9
9
|
|
|
10
|
+
// Set feature flag for regional blobs
|
|
11
|
+
process.env.USE_REGIONAL_BLOBS = '{{useRegionalBlobs}}'
|
|
12
|
+
|
|
10
13
|
let cachedHandler
|
|
11
14
|
export default async function (req, context) {
|
|
12
15
|
if (process.env.NETLIFY_OTLP_TRACE_EXPORTER_URL) {
|
|
@@ -6,6 +6,9 @@ import serverHandler from './.netlify/dist/run/handlers/server.js'
|
|
|
6
6
|
import { getTracer } from './.netlify/dist/run/handlers/tracer.cjs'
|
|
7
7
|
import tracing from './.netlify/dist/run/handlers/tracing.js'
|
|
8
8
|
|
|
9
|
+
// Set feature flag for regional blobs
|
|
10
|
+
process.env.USE_REGIONAL_BLOBS = '{{useRegionalBlobs}}'
|
|
11
|
+
|
|
9
12
|
export default async function handler(req, context) {
|
|
10
13
|
if (process.env.NETLIFY_OTLP_TRACE_EXPORTER_URL) {
|
|
11
14
|
tracing.start()
|
|
@@ -5,14 +5,87 @@
|
|
|
5
5
|
})();
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} from "../esm-chunks/chunk-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
require_semver
|
|
9
|
+
} from "../esm-chunks/chunk-PJG75HGC.js";
|
|
10
|
+
import {
|
|
11
|
+
__toESM
|
|
12
|
+
} from "../esm-chunks/chunk-5JVNISGM.js";
|
|
13
|
+
|
|
14
|
+
// src/build/verification.ts
|
|
15
|
+
var import_semver = __toESM(require_semver(), 1);
|
|
16
|
+
import { existsSync } from "node:fs";
|
|
17
|
+
import { join } from "node:path";
|
|
18
|
+
import { ApiRouteType, getAPIRoutesConfigs } from "./advanced-api-routes.js";
|
|
19
|
+
var SUPPORTED_NEXT_VERSIONS = ">=13.5.0";
|
|
20
|
+
function verifyPublishDir(ctx) {
|
|
21
|
+
if (!existsSync(ctx.publishDir)) {
|
|
22
|
+
ctx.failBuild(
|
|
23
|
+
`Your publish directory was not found at: ${ctx.publishDir}. Please check your build settings`
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
if (ctx.publishDir === ctx.resolveFromPackagePath("")) {
|
|
27
|
+
ctx.failBuild(
|
|
28
|
+
`Your publish directory cannot be the same as the base directory of your site. Please check your build settings`
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
ctx.buildConfig;
|
|
33
|
+
} catch {
|
|
34
|
+
ctx.failBuild(
|
|
35
|
+
"Your publish directory does not contain expected Next.js build output. Please check your build settings"
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
if (ctx.buildConfig.output === "standalone" || ctx.buildConfig.output === void 0) {
|
|
39
|
+
if (!existsSync(join(ctx.publishDir, "BUILD_ID"))) {
|
|
40
|
+
ctx.failBuild(
|
|
41
|
+
"Your publish directory does not contain expected Next.js build output. Please check your build settings"
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
if (!existsSync(ctx.standaloneRootDir)) {
|
|
45
|
+
ctx.failBuild(
|
|
46
|
+
`Your publish directory does not contain expected Next.js build output. Please make sure you are using Next.js version (${SUPPORTED_NEXT_VERSIONS})`
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (ctx.buildConfig.output === "export") {
|
|
51
|
+
if (!ctx.exportDetail?.success) {
|
|
52
|
+
ctx.failBuild(`Your export failed to build. Please check your build settings`);
|
|
53
|
+
}
|
|
54
|
+
if (!existsSync(ctx.exportDetail?.outDirectory)) {
|
|
55
|
+
ctx.failBuild(
|
|
56
|
+
`Your export directory was not found at: ${ctx.exportDetail?.outDirectory}. Please check your build settings`
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function verifyNextVersion(ctx, nextVersion) {
|
|
62
|
+
if (!(0, import_semver.satisfies)(nextVersion, SUPPORTED_NEXT_VERSIONS, { includePrerelease: true })) {
|
|
63
|
+
ctx.failBuild(
|
|
64
|
+
`@netlify/plugin-next@5 requires Next.js version ${SUPPORTED_NEXT_VERSIONS}, but found ${nextVersion}. Please upgrade your project's Next.js version.`
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function verifyBuildConfig(ctx) {
|
|
69
|
+
if (ctx.buildConfig.experimental.ppr) {
|
|
70
|
+
console.log(
|
|
71
|
+
`Partial prerendering is not yet fully supported on Netlify, see https://ntl.fyi/nextjs-ppr for details`
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async function verifyNoAdvancedAPIRoutes(ctx) {
|
|
76
|
+
const apiRoutesConfigs = await getAPIRoutesConfigs(ctx);
|
|
77
|
+
const unsupportedAPIRoutes = apiRoutesConfigs.filter((apiRouteConfig) => {
|
|
78
|
+
return apiRouteConfig.config.type === ApiRouteType.BACKGROUND || apiRouteConfig.config.type === ApiRouteType.SCHEDULED;
|
|
79
|
+
});
|
|
80
|
+
if (unsupportedAPIRoutes.length !== 0) {
|
|
81
|
+
ctx.failBuild(
|
|
82
|
+
`@netlify/plugin-next@5 does not support advanced API routes. The following API routes should be migrated to Netlify background or scheduled functions:
|
|
83
|
+
${unsupportedAPIRoutes.map((apiRouteConfig) => ` - ${apiRouteConfig.apiRoute} (type: "${apiRouteConfig.config.type}")`).join("\n")}
|
|
84
|
+
|
|
85
|
+
Refer to https://ntl.fyi/next-scheduled-bg-function-migration as migration example.`
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
16
89
|
export {
|
|
17
90
|
verifyBuildConfig,
|
|
18
91
|
verifyNextVersion,
|
|
@@ -8,7 +8,7 @@ import "./chunk-5JVNISGM.js";
|
|
|
8
8
|
|
|
9
9
|
// package.json
|
|
10
10
|
var name = "@netlify/plugin-nextjs";
|
|
11
|
-
var version = "5.
|
|
11
|
+
var version = "5.2.0";
|
|
12
12
|
var description = "Run Next.js seamlessly on Netlify";
|
|
13
13
|
var main = "./dist/index.js";
|
|
14
14
|
var type = "module";
|
|
@@ -57,14 +57,14 @@ var bugs = {
|
|
|
57
57
|
var homepage = "https://github.com/netlify/next-runtime-minimal#readme";
|
|
58
58
|
var devDependencies = {
|
|
59
59
|
"@fastly/http-compute-js": "1.1.4",
|
|
60
|
-
"@netlify/blobs": "^7.0
|
|
61
|
-
"@netlify/build": "^29.
|
|
62
|
-
"@netlify/edge-bundler": "^
|
|
60
|
+
"@netlify/blobs": "^7.3.0",
|
|
61
|
+
"@netlify/build": "^29.41.0",
|
|
62
|
+
"@netlify/edge-bundler": "^12.0.0",
|
|
63
63
|
"@netlify/edge-functions": "^2.5.1",
|
|
64
64
|
"@netlify/eslint-config-node": "^7.0.1",
|
|
65
65
|
"@netlify/functions": "^2.5.1",
|
|
66
66
|
"@netlify/serverless-functions-api": "^1.10.1",
|
|
67
|
-
"@netlify/zip-it-and-ship-it": "^9.
|
|
67
|
+
"@netlify/zip-it-and-ship-it": "^9.32.0",
|
|
68
68
|
"@opentelemetry/api": "^1.8.0",
|
|
69
69
|
"@opentelemetry/exporter-trace-otlp-http": "^0.49.0",
|
|
70
70
|
"@opentelemetry/resources": "^1.21.0",
|
package/dist/index.js
CHANGED
|
@@ -4,21 +4,6 @@
|
|
|
4
4
|
return createRequire(import.meta.url);
|
|
5
5
|
})();
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
createServerHandler
|
|
9
|
-
} from "./esm-chunks/chunk-HESS57SH.js";
|
|
10
|
-
import {
|
|
11
|
-
copyPrerenderedContent
|
|
12
|
-
} from "./esm-chunks/chunk-MRD3XSKD.js";
|
|
13
|
-
import "./esm-chunks/chunk-4BNHE6TP.js";
|
|
14
|
-
import {
|
|
15
|
-
copyStaticAssets,
|
|
16
|
-
copyStaticContent,
|
|
17
|
-
copyStaticExport,
|
|
18
|
-
publishStaticDir,
|
|
19
|
-
unpublishStaticDir
|
|
20
|
-
} from "./esm-chunks/chunk-V2T6NUOM.js";
|
|
21
|
-
import "./esm-chunks/chunk-TYCYFZ22.js";
|
|
22
7
|
import {
|
|
23
8
|
wrapTracer
|
|
24
9
|
} from "./esm-chunks/chunk-PDPDW32D.js";
|
|
@@ -26,33 +11,36 @@ import {
|
|
|
26
11
|
init_esm,
|
|
27
12
|
trace
|
|
28
13
|
} from "./esm-chunks/chunk-Y3K5Q6FP.js";
|
|
14
|
+
import "./esm-chunks/chunk-5JVNISGM.js";
|
|
15
|
+
|
|
16
|
+
// src/index.ts
|
|
17
|
+
init_esm();
|
|
18
|
+
import { rm } from "fs/promises";
|
|
19
|
+
import { restoreBuildCache, saveBuildCache } from "./build/cache.js";
|
|
20
|
+
import { copyPrerenderedContent } from "./build/content/prerendered.js";
|
|
29
21
|
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} from "./
|
|
37
|
-
import {
|
|
38
|
-
|
|
39
|
-
} from "./
|
|
40
|
-
import {
|
|
41
|
-
PluginContext
|
|
42
|
-
} from "./esm-chunks/chunk-L6OM53B6.js";
|
|
22
|
+
copyStaticAssets,
|
|
23
|
+
copyStaticContent,
|
|
24
|
+
copyStaticExport,
|
|
25
|
+
publishStaticDir,
|
|
26
|
+
unpublishStaticDir
|
|
27
|
+
} from "./build/content/static.js";
|
|
28
|
+
import { createEdgeHandlers } from "./build/functions/edge.js";
|
|
29
|
+
import { createServerHandler } from "./build/functions/server.js";
|
|
30
|
+
import { setImageConfig } from "./build/image-cdn.js";
|
|
31
|
+
import { PluginContext } from "./build/plugin-context.js";
|
|
43
32
|
import {
|
|
44
33
|
verifyBuildConfig,
|
|
45
34
|
verifyNoAdvancedAPIRoutes,
|
|
46
35
|
verifyPublishDir
|
|
47
|
-
} from "./
|
|
48
|
-
import "./esm-chunks/chunk-PJG75HGC.js";
|
|
49
|
-
import "./esm-chunks/chunk-BG455SFE.js";
|
|
50
|
-
import "./esm-chunks/chunk-UYKENJEU.js";
|
|
51
|
-
import "./esm-chunks/chunk-5JVNISGM.js";
|
|
52
|
-
|
|
53
|
-
// src/index.ts
|
|
54
|
-
init_esm();
|
|
36
|
+
} from "./build/verification.js";
|
|
55
37
|
var tracer = wrapTracer(trace.getTracer("Next.js runtime"));
|
|
38
|
+
var onPreDev = async (options) => {
|
|
39
|
+
await tracer.withActiveSpan("onPreDev", async () => {
|
|
40
|
+
const context = new PluginContext(options);
|
|
41
|
+
await rm(context.blobDir, { recursive: true, force: true });
|
|
42
|
+
});
|
|
43
|
+
};
|
|
56
44
|
var onPreBuild = async (options) => {
|
|
57
45
|
await tracer.withActiveSpan("onPreBuild", async () => {
|
|
58
46
|
process.env.NEXT_PRIVATE_STANDALONE = "true";
|
|
@@ -108,5 +96,6 @@ export {
|
|
|
108
96
|
onEnd,
|
|
109
97
|
onPostBuild,
|
|
110
98
|
onPreBuild,
|
|
99
|
+
onPreDev,
|
|
111
100
|
onSuccess
|
|
112
101
|
};
|
package/dist/run/config.js
CHANGED
|
@@ -4,13 +4,32 @@
|
|
|
4
4
|
return createRequire(import.meta.url);
|
|
5
5
|
})();
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
getRunConfig,
|
|
9
|
-
getTagsManifest,
|
|
10
|
-
setRunConfig
|
|
11
|
-
} from "../esm-chunks/chunk-3SUDZQ7L.js";
|
|
12
|
-
import "../esm-chunks/chunk-UYKENJEU.js";
|
|
13
7
|
import "../esm-chunks/chunk-5JVNISGM.js";
|
|
8
|
+
|
|
9
|
+
// src/run/config.ts
|
|
10
|
+
import { existsSync } from "node:fs";
|
|
11
|
+
import { readFile } from "node:fs/promises";
|
|
12
|
+
import { join, resolve } from "node:path";
|
|
13
|
+
import { PLUGIN_DIR, RUN_CONFIG } from "./constants.js";
|
|
14
|
+
var getRunConfig = async () => {
|
|
15
|
+
return JSON.parse(await readFile(resolve(PLUGIN_DIR, RUN_CONFIG), "utf-8"));
|
|
16
|
+
};
|
|
17
|
+
var setRunConfig = (config) => {
|
|
18
|
+
const cacheHandler = join(PLUGIN_DIR, ".netlify/dist/run/handlers/cache.cjs");
|
|
19
|
+
if (!existsSync(cacheHandler)) {
|
|
20
|
+
throw new Error(`Cache handler not found at ${cacheHandler}`);
|
|
21
|
+
}
|
|
22
|
+
config.experimental = {
|
|
23
|
+
...config.experimental,
|
|
24
|
+
incrementalCacheHandlerPath: cacheHandler
|
|
25
|
+
};
|
|
26
|
+
config.cacheHandler = cacheHandler;
|
|
27
|
+
config.cacheMaxMemorySize = 0;
|
|
28
|
+
process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(config);
|
|
29
|
+
};
|
|
30
|
+
var getTagsManifest = async () => {
|
|
31
|
+
return JSON.parse(await readFile(resolve(PLUGIN_DIR, ".netlify/tags-manifest.json"), "utf-8"));
|
|
32
|
+
};
|
|
14
33
|
export {
|
|
15
34
|
getRunConfig,
|
|
16
35
|
getTagsManifest,
|
package/dist/run/constants.js
CHANGED
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
return createRequire(import.meta.url);
|
|
5
5
|
})();
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
MODULE_DIR,
|
|
9
|
-
PLUGIN_DIR,
|
|
10
|
-
RUN_CONFIG
|
|
11
|
-
} from "../esm-chunks/chunk-UYKENJEU.js";
|
|
12
7
|
import "../esm-chunks/chunk-5JVNISGM.js";
|
|
8
|
+
|
|
9
|
+
// src/run/constants.ts
|
|
10
|
+
import { resolve } from "node:path";
|
|
11
|
+
import { fileURLToPath } from "node:url";
|
|
12
|
+
var MODULE_DIR = fileURLToPath(new URL(".", import.meta.url));
|
|
13
|
+
var PLUGIN_DIR = resolve(`${MODULE_DIR}../../..`);
|
|
14
|
+
var RUN_CONFIG = "run-config.json";
|
|
13
15
|
export {
|
|
14
16
|
MODULE_DIR,
|
|
15
17
|
PLUGIN_DIR,
|