@fy-stack/app-construct 0.0.147-alpha.3051 → 0.0.147-alpha.3053
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/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/lib/containers/image-app-container.d.ts +7 -0
- package/dist/lib/containers/image-app-container.d.ts.map +1 -0
- package/dist/lib/containers/image-app-container.js +33 -0
- package/dist/lib/containers/next-app-router-container.d.ts +7 -0
- package/dist/lib/containers/next-app-router-container.d.ts.map +1 -0
- package/dist/lib/containers/next-app-router-container.js +45 -0
- package/dist/lib/containers/types.d.ts +7 -0
- package/dist/lib/containers/types.d.ts.map +1 -0
- package/dist/lib/containers/types.js +2 -0
- package/dist/lib/ecs/shared/taskDefinitionImage.d.ts +1 -1
- package/dist/lib/ecs/shared/taskDefinitionImage.d.ts.map +1 -1
- package/dist/lib/ecs/shared/taskDefinitionImage.js +1 -1
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { ImageAppContainer } from './lib/containers/image-app-container';
|
|
2
|
+
export { NextAppRouterContainer } from './lib/containers/next-app-router-container';
|
|
1
3
|
export { EcsConstruct } from './lib/ecs/ecs-construct';
|
|
2
4
|
export type { EcsConstructProps } from './lib/ecs/types';
|
|
3
5
|
export { LambdaConstruct } from './lib/lambda/lambda-construct';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StaticConstruct = exports.lambdaGrant = exports.lambdaAttach = exports.LambdaConstruct = exports.EcsConstruct = void 0;
|
|
3
|
+
exports.StaticConstruct = exports.lambdaGrant = exports.lambdaAttach = exports.LambdaConstruct = exports.EcsConstruct = exports.NextAppRouterContainer = exports.ImageAppContainer = void 0;
|
|
4
|
+
var image_app_container_1 = require("./lib/containers/image-app-container");
|
|
5
|
+
Object.defineProperty(exports, "ImageAppContainer", { enumerable: true, get: function () { return image_app_container_1.ImageAppContainer; } });
|
|
6
|
+
var next_app_router_container_1 = require("./lib/containers/next-app-router-container");
|
|
7
|
+
Object.defineProperty(exports, "NextAppRouterContainer", { enumerable: true, get: function () { return next_app_router_container_1.NextAppRouterContainer; } });
|
|
4
8
|
var ecs_construct_1 = require("./lib/ecs/ecs-construct");
|
|
5
9
|
Object.defineProperty(exports, "EcsConstruct", { enumerable: true, get: function () { return ecs_construct_1.EcsConstruct; } });
|
|
6
10
|
var lambda_construct_1 = require("./lib/lambda/lambda-construct");
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Construct } from 'constructs';
|
|
2
|
+
import type { StandaloneContainer } from './types';
|
|
3
|
+
export type ImageAppProps = StandaloneContainer;
|
|
4
|
+
export declare class ImageAppContainer extends Construct {
|
|
5
|
+
constructor(scope: Construct, id: string, props: ImageAppProps);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=image-app-container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-app-container.d.ts","sourceRoot":"","sources":["../../../src/lib/containers/image-app-container.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,MAAM,aAAa,GAAG,mBAAmB,CAAC;AAEhD,qBAAa,iBAAkB,SAAQ,SAAS;gBAClC,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa;CAyB/D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImageAppContainer = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const cdk = tslib_1.__importStar(require("aws-cdk-lib"));
|
|
6
|
+
const ecr = tslib_1.__importStar(require("aws-cdk-lib/aws-ecr"));
|
|
7
|
+
const ecrAssets = tslib_1.__importStar(require("aws-cdk-lib/aws-ecr-assets"));
|
|
8
|
+
const ssm = tslib_1.__importStar(require("aws-cdk-lib/aws-ssm"));
|
|
9
|
+
const ecrDeployment = tslib_1.__importStar(require("cdk-ecr-deployment"));
|
|
10
|
+
const constructs_1 = require("constructs");
|
|
11
|
+
class ImageAppContainer extends constructs_1.Construct {
|
|
12
|
+
constructor(scope, id, props) {
|
|
13
|
+
super(scope, id);
|
|
14
|
+
const repo = new ecr.Repository(this, 'Repository');
|
|
15
|
+
const container = new ecrAssets.DockerImageAsset(this, 'ContainerAsset', {
|
|
16
|
+
directory: props.output,
|
|
17
|
+
platform: ecrAssets.Platform.LINUX_AMD64,
|
|
18
|
+
...props.container,
|
|
19
|
+
});
|
|
20
|
+
new ecrDeployment.ECRDeployment(this, 'DeployedContainer', {
|
|
21
|
+
src: new ecrDeployment.DockerImageName(container.imageUri),
|
|
22
|
+
dest: new ecrDeployment.DockerImageName(cdk.Fn.join(':', [repo.repositoryUri, props.version])),
|
|
23
|
+
});
|
|
24
|
+
new ssm.StringParameter(this, 'OutputParams', {
|
|
25
|
+
parameterName: id,
|
|
26
|
+
stringValue: JSON.stringify({
|
|
27
|
+
repository: repo.repositoryName,
|
|
28
|
+
tag: props.version,
|
|
29
|
+
}),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.ImageAppContainer = ImageAppContainer;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Construct } from 'constructs';
|
|
2
|
+
import type { StandaloneContainer } from './types';
|
|
3
|
+
export type NextAppRouterProps = StandaloneContainer;
|
|
4
|
+
export declare class NextAppRouterContainer extends Construct {
|
|
5
|
+
constructor(scope: Construct, id: string, props: NextAppRouterProps);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=next-app-router-container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-app-router-container.d.ts","sourceRoot":"","sources":["../../../src/lib/containers/next-app-router-container.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAErD,qBAAa,sBAAuB,SAAQ,SAAS;gBACvC,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB;CAsCpE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NextAppRouterContainer = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const cdk = tslib_1.__importStar(require("aws-cdk-lib"));
|
|
6
|
+
const ecr = tslib_1.__importStar(require("aws-cdk-lib/aws-ecr"));
|
|
7
|
+
const ecrAssets = tslib_1.__importStar(require("aws-cdk-lib/aws-ecr-assets"));
|
|
8
|
+
const ssm = tslib_1.__importStar(require("aws-cdk-lib/aws-ssm"));
|
|
9
|
+
const ecrDeployment = tslib_1.__importStar(require("cdk-ecr-deployment"));
|
|
10
|
+
const constructs_1 = require("constructs");
|
|
11
|
+
const next_app_router_1 = require("../shared/next-app-router");
|
|
12
|
+
class NextAppRouterContainer extends constructs_1.Construct {
|
|
13
|
+
constructor(scope, id, props) {
|
|
14
|
+
super(scope, id);
|
|
15
|
+
const repo = new ecr.Repository(this, 'Repository', {
|
|
16
|
+
emptyOnDelete: true,
|
|
17
|
+
});
|
|
18
|
+
const container = new ecrAssets.DockerImageAsset(this, 'ContainerAsset', {
|
|
19
|
+
directory: props.output,
|
|
20
|
+
platform: ecrAssets.Platform.LINUX_AMD64,
|
|
21
|
+
...props.container,
|
|
22
|
+
});
|
|
23
|
+
const deployment = (0, next_app_router_1.staticDeployment)(this, props.output);
|
|
24
|
+
new ecrDeployment.ECRDeployment(this, 'DeployedContainer', {
|
|
25
|
+
src: new ecrDeployment.DockerImageName(container.imageUri),
|
|
26
|
+
dest: new ecrDeployment.DockerImageName(cdk.Fn.join(':', [repo.repositoryUri, props.version])),
|
|
27
|
+
});
|
|
28
|
+
new ssm.StringParameter(this, 'OutputParams', {
|
|
29
|
+
parameterName: id,
|
|
30
|
+
stringValue: JSON.stringify({
|
|
31
|
+
repository: repo.repositoryName,
|
|
32
|
+
tag: props.version,
|
|
33
|
+
files: {
|
|
34
|
+
staticFiles: {
|
|
35
|
+
key: deployment.files.staticFiles,
|
|
36
|
+
},
|
|
37
|
+
publicFiles: {
|
|
38
|
+
key: deployment.files.publicFiles,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.NextAppRouterContainer = NextAppRouterContainer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/containers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAE1E,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,uBAAuB,CAAC;CACrC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as ecs from 'aws-cdk-lib/aws-ecs';
|
|
2
|
-
import type { AppProperties, AppSource } from '../types';
|
|
3
2
|
import type { Construct } from 'constructs';
|
|
3
|
+
import type { AppProperties, AppSource } from '../types';
|
|
4
4
|
type Props = AppSource & Pick<AppProperties, 'env' | 'port' | 'logGroup' | 'taskDefinition'>;
|
|
5
5
|
export declare function taskDefinitionImage(scope: Construct, id: string, props: Props): ecs.ContainerDefinition;
|
|
6
6
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taskDefinitionImage.d.ts","sourceRoot":"","sources":["../../../../src/lib/ecs/shared/taskDefinitionImage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"taskDefinitionImage.d.ts","sourceRoot":"","sources":["../../../../src/lib/ecs/shared/taskDefinitionImage.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEzD,KAAK,KAAK,GAAG,SAAS,GACpB,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,MAAM,GAAG,UAAU,GAAG,gBAAgB,CAAC,CAAC;AAEtE,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,SAAS,EAChB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,KAAK,2BA8Cb"}
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.taskDefinitionImage = taskDefinitionImage;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
6
|
+
const ecr = tslib_1.__importStar(require("aws-cdk-lib/aws-ecr"));
|
|
6
7
|
const ecrAssets = tslib_1.__importStar(require("aws-cdk-lib/aws-ecr-assets"));
|
|
7
8
|
const ecs = tslib_1.__importStar(require("aws-cdk-lib/aws-ecs"));
|
|
8
|
-
const ecr = tslib_1.__importStar(require("aws-cdk-lib/aws-ecr"));
|
|
9
9
|
function taskDefinitionImage(scope, id, props) {
|
|
10
10
|
let image;
|
|
11
11
|
let containerProps;
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fy-stack/app-construct",
|
|
3
|
-
"version": "0.0.147-alpha.
|
|
3
|
+
"version": "0.0.147-alpha.3053",
|
|
4
4
|
"repository": "https://github.com/festusyuma/fy-stack",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@fy-stack/types": "0.0.147-alpha.
|
|
6
|
+
"@fy-stack/types": "0.0.147-alpha.3053",
|
|
7
7
|
"tslib": "^2.3.0",
|
|
8
8
|
"zod": "^3.24.1"
|
|
9
9
|
},
|
|
10
10
|
"peerDependencies": {
|
|
11
11
|
"aws-cdk-lib": "^2.235.0",
|
|
12
|
-
"constructs": "^10.4.4"
|
|
12
|
+
"constructs": "^10.4.4",
|
|
13
|
+
"cdk-ecr-deployment": "^4.1.2"
|
|
13
14
|
},
|
|
14
15
|
"main": "./dist/index.js",
|
|
15
16
|
"module": "./dist/index.mjs",
|