@codedazur/cdk-next-app 0.2.0 → 0.2.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/CHANGELOG.md +6 -0
- package/README.md +30 -2
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @codedazur/cdk-next-app
|
|
2
2
|
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4aad27259400d8c8c4fd6825ee20ef970b6ad718`](https://github.com/codedazur/toolkit/commit/4aad27259400d8c8c4fd6825ee20ef970b6ad718) Thanks [@thijsdaniels](https://github.com/thijsdaniels)! - The construct name was corrected.
|
|
8
|
+
|
|
3
9
|
## 0.2.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -4,9 +4,37 @@ The NextApp CDK construct deploys a standalone Next.js build to a load balanced
|
|
|
4
4
|
|
|
5
5
|
## Example
|
|
6
6
|
|
|
7
|
+
### Standard Repository
|
|
8
|
+
|
|
9
|
+
For a non-mnonorepo build, simply provide the path to the directory that contains your Dockerfile.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
new NextApp(this, "NextApp", {
|
|
13
|
+
path: "../next",
|
|
14
|
+
});
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Monorepo
|
|
18
|
+
|
|
19
|
+
For monorepo builds, set the build context to the root of your monorepo, and provide the path to your Next.js module's Dockerfile.
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
new NextApp(this, "NextApp", {
|
|
23
|
+
path: "../../",
|
|
24
|
+
file: "apps/next/Dockerfile",
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Scaling
|
|
29
|
+
|
|
30
|
+
The NextApp is based on the [DockerCluster](https://github.com/codedazur/toolkit/tree/main/packages/cdk-docker-cluster) construct and supports all of its features for horizontal and vertical scaling.
|
|
31
|
+
|
|
7
32
|
```ts
|
|
8
|
-
new NextApp(this, "
|
|
9
|
-
|
|
33
|
+
new NextApp(this, "NextApp", {
|
|
34
|
+
...
|
|
35
|
+
cpu: 1024,
|
|
36
|
+
memory: 4096,
|
|
37
|
+
tasks: { min: 1, max: 10 },
|
|
10
38
|
});
|
|
11
39
|
```
|
|
12
40
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { DockerClusterProps, DockerCluster } from '@codedazur/cdk-docker-cluster';
|
|
2
2
|
import { Construct } from 'constructs';
|
|
3
3
|
|
|
4
|
-
interface
|
|
4
|
+
interface NextAppProps extends DockerClusterProps {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* A docker cluster preconfigured for running a Next.js application with support
|
|
8
8
|
* for private NPM packages using a build-time secret.
|
|
9
9
|
*/
|
|
10
|
-
declare class
|
|
11
|
-
constructor(scope: Construct, id: string, { port, secrets, ...props }:
|
|
10
|
+
declare class NextApp extends DockerCluster {
|
|
11
|
+
constructor(scope: Construct, id: string, { port, secrets, ...props }: NextAppProps);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export {
|
|
14
|
+
export { NextApp, NextAppProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { DockerClusterProps, DockerCluster } from '@codedazur/cdk-docker-cluster';
|
|
2
2
|
import { Construct } from 'constructs';
|
|
3
3
|
|
|
4
|
-
interface
|
|
4
|
+
interface NextAppProps extends DockerClusterProps {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* A docker cluster preconfigured for running a Next.js application with support
|
|
8
8
|
* for private NPM packages using a build-time secret.
|
|
9
9
|
*/
|
|
10
|
-
declare class
|
|
11
|
-
constructor(scope: Construct, id: string, { port, secrets, ...props }:
|
|
10
|
+
declare class NextApp extends DockerCluster {
|
|
11
|
+
constructor(scope: Construct, id: string, { port, secrets, ...props }: NextAppProps);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export {
|
|
14
|
+
export { NextApp, NextAppProps };
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
|
-
|
|
33
|
+
NextApp: () => NextApp
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(src_exports);
|
|
36
36
|
|
|
@@ -39,7 +39,7 @@ var import_os = __toESM(require("os"));
|
|
|
39
39
|
var import_path = __toESM(require("path"));
|
|
40
40
|
var import_cdk_docker_cluster = require("@codedazur/cdk-docker-cluster");
|
|
41
41
|
var import_aws_cdk_lib = require("aws-cdk-lib");
|
|
42
|
-
var
|
|
42
|
+
var NextApp = class extends import_cdk_docker_cluster.DockerCluster {
|
|
43
43
|
constructor(scope, id, { port = 3e3, secrets, ...props }) {
|
|
44
44
|
super(scope, id, {
|
|
45
45
|
port,
|
|
@@ -53,5 +53,5 @@ var NextDockerCluster = class extends import_cdk_docker_cluster.DockerCluster {
|
|
|
53
53
|
};
|
|
54
54
|
// Annotate the CommonJS export names for ESM import in node:
|
|
55
55
|
0 && (module.exports = {
|
|
56
|
-
|
|
56
|
+
NextApp
|
|
57
57
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
DockerCluster
|
|
6
6
|
} from "@codedazur/cdk-docker-cluster";
|
|
7
7
|
import { DockerBuildSecret } from "aws-cdk-lib";
|
|
8
|
-
var
|
|
8
|
+
var NextApp = class extends DockerCluster {
|
|
9
9
|
constructor(scope, id, { port = 3e3, secrets, ...props }) {
|
|
10
10
|
super(scope, id, {
|
|
11
11
|
port,
|
|
@@ -18,5 +18,5 @@ var NextDockerCluster = class extends DockerCluster {
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
export {
|
|
21
|
-
|
|
21
|
+
NextApp
|
|
22
22
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codedazur/cdk-next-app",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"main": ".dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@codedazur/eslint-config": "*",
|
|
34
34
|
"@codedazur/tsconfig": "*",
|
|
35
|
-
"@types/node": "^20.
|
|
36
|
-
"aws-cdk-lib": "^2.
|
|
35
|
+
"@types/node": "^20.14.2",
|
|
36
|
+
"aws-cdk-lib": "^2.145.0",
|
|
37
37
|
"constructs": "^10.3.0",
|
|
38
38
|
"esbuild": "^0.20.2",
|
|
39
39
|
"eslint": "^8.30.0",
|