cdk-nextjs 0.6.0 → 0.6.1

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 CHANGED
@@ -20122,6 +20122,6 @@
20122
20122
  "symbolId": "src/nextjs-build/nextjs-build:PublicDirEntry"
20123
20123
  }
20124
20124
  },
20125
- "version": "0.6.0",
20126
- "fingerprint": "pFFkq0kZiIR22+vr8dHzSYSgrCGrr7EuMSFNU7NYwag="
20125
+ "version": "0.6.1",
20126
+ "fingerprint": "CNSM7+9wiiYa50t7x3sWjO/HoWHemGnsJ9hz8GxwePs="
20127
20127
  }
@@ -50,17 +50,19 @@ Expanding Turbopack's root to include the entire monorepo causes it to repeatedl
50
50
 
51
51
  ### The Solution (Hack)
52
52
 
53
- The `examples/app-playground/package.json` includes a `prebuild` script that copies the necessary files directly into `node_modules` without symlinks:
53
+ The `examples/app-playground/package.json` includes a `sync-cdk-nextjs` script that copies the necessary files directly into `node_modules` without symlinks:
54
54
 
55
55
  ```json
56
- "prebuild": "rm -rf node_modules/cdk-nextjs && mkdir -p node_modules/cdk-nextjs/lib/adapter && cp ../../package.json node_modules/cdk-nextjs/package.json && cp ../../lib/adapter/adapter.mjs node_modules/cdk-nextjs/lib/adapter/adapter.mjs && cp ../../lib/adapter/cache-handler.mjs node_modules/cdk-nextjs/lib/adapter/cache-handler.mjs"
56
+ "sync-cdk-nextjs": "rm -rf node_modules/cdk-nextjs && mkdir -p node_modules/cdk-nextjs/lib/adapter && cp ../../package.json node_modules/cdk-nextjs/package.json && cp ../../lib/adapter/adapter.mjs node_modules/cdk-nextjs/lib/adapter/adapter.mjs && cp ../../lib/adapter/cache-handler.mjs node_modules/cdk-nextjs/lib/adapter/cache-handler.mjs"
57
57
  ```
58
58
 
59
- This runs automatically before `pnpm build`, ensuring fresh copies of the adapter files are present. While hacky, it:
59
+ Both `build` and `dev` chain it explicitly (`npm run sync-cdk-nextjs && next …`) so the copy happens no matter which package manager invokes them. While hacky, it:
60
60
 
61
61
  - Avoids symlink issues entirely
62
62
  - Keeps Turbopack's root narrow
63
63
  - Simulates real npm package installation
64
64
  - Enables proper package export resolution
65
65
 
66
- For iterative development, just run `pnpm build` from the root to rebuild the adapter, then `pnpm build` in the example app—prebuild will copy the latest version.
66
+ For iterative development, just run `pnpm build` from the root to rebuild the adapter, then `pnpm build` in the example app—the sync step will copy the latest version.
67
+
68
+ Note that `pnpm install` recreates the `link:../..` symlink, so always go through `pnpm build` / `pnpm dev`. Invoking `next build` or `next dev` directly skips the sync and Turbopack then fails on the symlinked path, e.g. `FileSystemPath("app-playground").join("./../../lib/adapter/cache-handler.mjs") leaves the filesystem root`.
@@ -1,4 +1,4 @@
1
- const require = (await import('node:module')).createRequire(import.meta.url);
1
+ import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,4 +1,4 @@
1
- const require = (await import('node:module')).createRequire(import.meta.url);
1
+ import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,4 +1,4 @@
1
- import { createRequire } from 'node:module'; import { fileURLToPath } from 'node:url'; import { dirname } from 'node:path'; const require = createRequire(import.meta.url); const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename);
1
+ import { createRequire } from 'node:module'; const require = createRequire(import.meta.url); import { fileURLToPath } from 'node:url'; import { dirname } from 'node:path'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename);
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
package/lib/nextjs-api.js CHANGED
@@ -11,7 +11,7 @@ const base_path_1 = require("./utils/base-path");
11
11
  * Creates an API Gateway REST API for Next.js applications
12
12
  */
13
13
  class NextjsApi extends constructs_1.Construct {
14
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsApi", version: "0.6.0" };
14
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsApi", version: "0.6.1" };
15
15
  /**
16
16
  * The API Gateway REST API
17
17
  */
@@ -24,7 +24,7 @@ const debug = (0, debug_1.default)("cdk-nextjs:nextjs-build");
24
24
  * @link https://nextjs.org/docs/pages/api-reference/next-config-js/output
25
25
  */
26
26
  class NextjsBuild extends constructs_1.Construct {
27
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsBuild", version: "0.6.0" };
27
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsBuild", version: "0.6.1" };
28
28
  /**
29
29
  * Unique id for Next.js build. Used to partition cache storage and as
30
30
  * metadata for static assets in S3 bucket.
@@ -13,7 +13,7 @@ const constants_1 = require("./constants");
13
13
  * Next.js Cache construct providing unified S3 and DynamoDB cache management.
14
14
  */
15
15
  class NextjsCache extends constructs_1.Construct {
16
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsCache", version: "0.6.0" };
16
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsCache", version: "0.6.1" };
17
17
  cacheBucket;
18
18
  revalidationTable;
19
19
  buildId;
@@ -18,7 +18,7 @@ const constants_1 = require("../constants");
18
18
  * Fargate.
19
19
  */
20
20
  class NextjsContainers extends constructs_1.Construct {
21
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsContainers", version: "0.6.0" };
21
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsContainers", version: "0.6.1" };
22
22
  albFargateService;
23
23
  ecsCluster;
24
24
  url;
@@ -15,7 +15,7 @@ const get_architecture_1 = require("../utils/get-architecture");
15
15
  * Run Next.js in functions on AWS with AWS Lambda.
16
16
  */
17
17
  class NextjsFunctions extends constructs_1.Construct {
18
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsFunctions", version: "0.6.0" };
18
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsFunctions", version: "0.6.1" };
19
19
  function;
20
20
  functionUrl;
21
21
  props;
@@ -15,7 +15,7 @@ const get_architecture_1 = require("../utils/get-architecture");
15
15
  * Lambda instead of paying the Docker/Lambda Web Adapter cold-start cost.
16
16
  */
17
17
  class NextjsImageFunction extends constructs_1.Construct {
18
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsImageFunction", version: "0.6.0" };
18
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsImageFunction", version: "0.6.1" };
19
19
  function;
20
20
  functionUrl;
21
21
  props;
@@ -9,7 +9,7 @@ const constructs_1 = require("constructs");
9
9
  const constants_1 = require("./constants");
10
10
  const base_path_1 = require("./utils/base-path");
11
11
  class NextjsDistribution extends constructs_1.Construct {
12
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsDistribution", version: "0.6.0" };
12
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsDistribution", version: "0.6.1" };
13
13
  distribution;
14
14
  props;
15
15
  /**
@@ -17,7 +17,7 @@ const get_architecture_1 = require("./utils/get-architecture");
17
17
  * current build id AND are older than `msTtl`
18
18
  */
19
19
  class NextjsPostDeploy extends constructs_1.Construct {
20
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsPostDeploy", version: "0.6.0" };
20
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsPostDeploy", version: "0.6.1" };
21
21
  customResource;
22
22
  lambdaFunction;
23
23
  props;
@@ -15,7 +15,7 @@ const base_path_1 = require("./utils/base-path");
15
15
  * Creates S3 Bucket for public and _next/static assets and deploys them using S3Deployment.
16
16
  */
17
17
  class NextjsStaticAssets extends constructs_1.Construct {
18
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsStaticAssets", version: "0.6.0" };
18
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsStaticAssets", version: "0.6.1" };
19
19
  bucket;
20
20
  deployment;
21
21
  /**
@@ -14,7 +14,7 @@ const base_path_1 = require("../utils/base-path");
14
14
  * Base class for all Next.js root constructs
15
15
  */
16
16
  class NextjsBaseConstruct extends constructs_1.Construct {
17
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsBaseConstruct", version: "0.6.0" };
17
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsBaseConstruct", version: "0.6.1" };
18
18
  nextjsBuild;
19
19
  nextjsStaticAssets;
20
20
  nextjsCache;
@@ -18,7 +18,7 @@ const base_path_1 = require("../utils/base-path");
18
18
  * for containers.
19
19
  */
20
20
  class NextjsGlobalContainers extends nextjs_base_construct_1.NextjsBaseConstruct {
21
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsGlobalContainers", version: "0.6.0" };
21
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsGlobalContainers", version: "0.6.1" };
22
22
  nextjsContainers;
23
23
  nextjsDistribution;
24
24
  nextjsPostDeploy;
@@ -18,7 +18,7 @@ const experimental_flags_1 = require("../utils/experimental-flags");
18
18
  * for functions.
19
19
  */
20
20
  class NextjsGlobalFunctions extends nextjs_base_construct_1.NextjsBaseConstruct {
21
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsGlobalFunctions", version: "0.6.0" };
21
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsGlobalFunctions", version: "0.6.1" };
22
22
  nextjsFunctions;
23
23
  /**
24
24
  * Only created when the (experimental, unsupported) dedicated image
@@ -13,7 +13,7 @@ const nextjs_post_deploy_1 = require("../nextjs-post-deploy");
13
13
  * for containers.
14
14
  */
15
15
  class NextjsRegionalContainers extends nextjs_base_construct_1.NextjsBaseConstruct {
16
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsRegionalContainers", version: "0.6.0" };
16
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsRegionalContainers", version: "0.6.1" };
17
17
  nextjsContainers;
18
18
  nextjsPostDeploy;
19
19
  get url() {
@@ -12,7 +12,7 @@ const experimental_flags_1 = require("../utils/experimental-flags");
12
12
  * for routing requests and AWS Lambda Functions for server-side rendering.
13
13
  */
14
14
  class NextjsRegionalFunctions extends nextjs_base_construct_1.NextjsBaseConstruct {
15
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsRegionalFunctions", version: "0.6.0" };
15
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-nextjs.NextjsRegionalFunctions", version: "0.6.1" };
16
16
  nextjsFunctions;
17
17
  /**
18
18
  * Only created when the (experimental, unsupported) dedicated image
package/package.json CHANGED
@@ -81,7 +81,7 @@
81
81
  "publishConfig": {
82
82
  "access": "public"
83
83
  },
84
- "version": "0.6.0",
84
+ "version": "0.6.1",
85
85
  "jest": {
86
86
  "coverageProvider": "v8",
87
87
  "testPathIgnorePatterns": [