cdk-nextjs 0.7.1 → 0.7.3
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/.jsii +39 -39
- package/.jsii.tabl.json +1 -1
- package/README.md +1 -0
- package/docs/breaking-changes.md +4 -2
- package/docs/native-dependencies-guide.md +223 -0
- package/lib/adapter/cache-handler.mjs +37811 -47726
- package/lib/adapter/use-cache-default-handler.mjs +8758 -12276
- package/lib/adapter/use-cache-remote-handler.mjs +2017 -5507
- package/lib/nextjs-api.js +1 -1
- package/lib/nextjs-build/nextjs-build.d.ts +25 -0
- package/lib/nextjs-build/nextjs-build.js +103 -2
- package/lib/nextjs-build/nextjs-build.test.js +50 -1
- package/lib/nextjs-cache.js +1 -1
- package/lib/nextjs-compute/nextjs-containers.js +1 -1
- package/lib/nextjs-compute/nextjs-functions.js +1 -1
- package/lib/nextjs-distribution.js +1 -1
- package/lib/nextjs-post-deploy.js +1 -1
- package/lib/nextjs-static-assets.js +1 -1
- package/lib/root-constructs/nextjs-base-construct.js +1 -1
- package/lib/root-constructs/nextjs-global-containers.js +1 -1
- package/lib/root-constructs/nextjs-global-functions.js +1 -1
- package/lib/root-constructs/nextjs-regional-containers.js +1 -1
- package/lib/root-constructs/nextjs-regional-functions.js +1 -1
- package/lib/runtime/lambda.mjs +5962 -7889
- package/lib/runtime/server.mjs +5962 -7889
- package/package.json +12 -12
package/lib/nextjs-api.js
CHANGED
|
@@ -22,7 +22,7 @@ const API_PATH_PART = /^[a-zA-Z0-9:._\-$]+$/;
|
|
|
22
22
|
* Creates an API Gateway REST API for Next.js applications
|
|
23
23
|
*/
|
|
24
24
|
class NextjsApi extends constructs_1.Construct {
|
|
25
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsApi", version: "0.7.
|
|
25
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsApi", version: "0.7.3" };
|
|
26
26
|
/**
|
|
27
27
|
* The API Gateway REST API
|
|
28
28
|
*/
|
|
@@ -209,6 +209,16 @@ export declare class NextjsBuild extends Construct {
|
|
|
209
209
|
* function that cannot serve it) is this, several steps downstream.
|
|
210
210
|
*/
|
|
211
211
|
private resolveDeploymentRoots;
|
|
212
|
+
/**
|
|
213
|
+
* `next build` traces native addons from the machine it runs on, and only
|
|
214
|
+
* `sharp` is swapped for the target. Anything else built for another platform
|
|
215
|
+
* fails with MODULE_NOT_FOUND or ERR_DLOPEN_FAILED on the first request that
|
|
216
|
+
* loads it, so say which package at synth. A warning, not an error: some
|
|
217
|
+
* addons are optional (`ws`'s `bufferutil`, `fsevents`) and fall back to JS.
|
|
218
|
+
*
|
|
219
|
+
* Only the OS and CPU are checked: glibc and musl builds share a header.
|
|
220
|
+
*/
|
|
221
|
+
private warnOnForeignNativeBinaries;
|
|
212
222
|
/**
|
|
213
223
|
* Lambda enforces 250 MB unzipped at CloudFormation time, which is minutes
|
|
214
224
|
* into a deploy and reports only a size. Splitting exists to stay under that
|
|
@@ -414,6 +424,21 @@ export declare function sharpBinaryDir(root: string): string;
|
|
|
414
424
|
* monorepo.
|
|
415
425
|
*/
|
|
416
426
|
export declare function listTree(root: string): Dirent[];
|
|
427
|
+
/**
|
|
428
|
+
* The platform a native addon was compiled for, read from its header:
|
|
429
|
+
* `linux-<arch>`, `darwin` or `win32`, or `undefined` for a file that is none
|
|
430
|
+
* of those.
|
|
431
|
+
*/
|
|
432
|
+
export declare function nativeBinaryPlatform(file: string): string | undefined;
|
|
433
|
+
/**
|
|
434
|
+
* The packages under `root` that have `.node` addons but none built for
|
|
435
|
+
* `target`, so they'd fail to load there. Returned as `root`-relative paths.
|
|
436
|
+
*
|
|
437
|
+
* A package with addons for several platforms is fine as long as one of them
|
|
438
|
+
* is `target`: packages like `bufferutil` bundle a `darwin` and a
|
|
439
|
+
* `linux-x64` addon and load whichever matches the machine.
|
|
440
|
+
*/
|
|
441
|
+
export declare function findForeignNativePackages(root: string, target: string): string[];
|
|
417
442
|
/**
|
|
418
443
|
* Write {@link PUBLIC_FILES_FILE_NAME} into a deployment root's runtime
|
|
419
444
|
* directory: every file under `publicDir`, listed the way the runtime would
|