@fy-stack/app-construct 0.0.147-alpha.30693 → 0.0.147-alpha.30694
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/lib/shared/code-deployment.js +1 -1
- package/dist/lib/shared/next-app-router.d.ts +1 -1
- package/dist/lib/shared/next-app-router.d.ts.map +1 -1
- package/dist/lib/shared/next-app-router.js +7 -5
- package/dist/lib/standalone/image-app-container.js +1 -1
- package/dist/lib/standalone/next-app-router-code.js +1 -1
- package/dist/lib/standalone/next-app-router-container.js +2 -2
- package/package.json +2 -2
|
@@ -6,7 +6,7 @@ const cdk = tslib_1.__importStar(require("aws-cdk-lib"));
|
|
|
6
6
|
const s3Deploy = tslib_1.__importStar(require("aws-cdk-lib/aws-s3-deployment"));
|
|
7
7
|
function codeDeployment(scope, bucket, output, version) {
|
|
8
8
|
const codeFiles = s3Deploy.Source.asset(output);
|
|
9
|
-
const codePrefix =
|
|
9
|
+
const codePrefix = `${version}/assets/code`;
|
|
10
10
|
const codeDeployment = new s3Deploy.BucketDeployment(scope, `CodeDeployment`, {
|
|
11
11
|
destinationBucket: bucket,
|
|
12
12
|
sources: [codeFiles],
|
|
@@ -23,7 +23,7 @@ export declare function filesFromSSM(scope: Construct, reference: string, versio
|
|
|
23
23
|
key: string;
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
-
export declare function staticDeployment(app: Construct, bucket: s3.IBucket, output: string): {
|
|
26
|
+
export declare function staticDeployment(app: Construct, bucket: s3.IBucket, output: string, version?: string): {
|
|
27
27
|
files: {
|
|
28
28
|
staticFiles: {
|
|
29
29
|
deployment: cdk.aws_s3_deployment.BucketDeployment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-app-router.d.ts","sourceRoot":"","sources":["../../../src/lib/shared/next-app-router.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AACnC,OAAO,KAAK,UAAU,MAAM,4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AE;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CACvE,CAAC;AAEF,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,SAAW;;;;;;;;EAuBnB;AAED,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,SAAS,EACd,MAAM,EAAE,EAAE,CAAC,OAAO,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM;;;;;;;;;;;EAsDjB;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,EAChB,YAAY,EAAE,EAAE,CAAC,OAAO,EACxB,YAAY,EAAE,UAAU,CAAC,OAAO,EAChC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,EACd,QAAQ,UAAQ;;EAkGjB"}
|
|
@@ -21,20 +21,22 @@ function filesFromSSM(scope, reference, version = 'latest') {
|
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function staticDeployment(app, bucket, output) {
|
|
24
|
+
function staticDeployment(app, bucket, output, version) {
|
|
25
25
|
const staticFiles = s3Deploy.Source.asset(node_path_1.default.join(output, '/.next/static'));
|
|
26
26
|
const publicFiles = s3Deploy.Source.asset(node_path_1.default.join(output, '/public'));
|
|
27
|
+
const staticPrefix = version ? `${version}/assets/static` : 'assets/static';
|
|
28
|
+
const publicPrefix = version ? `${version}/assets/public` : 'assets/public';
|
|
27
29
|
const staticDeployment = new s3Deploy.BucketDeployment(app, `StaticAssetDeployment`, {
|
|
28
30
|
destinationBucket: bucket,
|
|
29
31
|
sources: [staticFiles],
|
|
30
|
-
destinationKeyPrefix:
|
|
32
|
+
destinationKeyPrefix: staticPrefix,
|
|
31
33
|
retainOnDelete: false,
|
|
32
34
|
extract: false,
|
|
33
35
|
});
|
|
34
36
|
const publicDeployment = new s3Deploy.BucketDeployment(app, `PublicAssetDeployment`, {
|
|
35
37
|
destinationBucket: bucket,
|
|
36
38
|
sources: [publicFiles],
|
|
37
|
-
destinationKeyPrefix:
|
|
39
|
+
destinationKeyPrefix: publicPrefix,
|
|
38
40
|
retainOnDelete: false,
|
|
39
41
|
extract: false,
|
|
40
42
|
});
|
|
@@ -42,14 +44,14 @@ function staticDeployment(app, bucket, output) {
|
|
|
42
44
|
staticFiles: {
|
|
43
45
|
deployment: staticDeployment,
|
|
44
46
|
key: cdk.Fn.join('/', [
|
|
45
|
-
|
|
47
|
+
staticPrefix,
|
|
46
48
|
cdk.Fn.select(0, staticDeployment.objectKeys),
|
|
47
49
|
]),
|
|
48
50
|
},
|
|
49
51
|
publicFiles: {
|
|
50
52
|
deployment: publicDeployment,
|
|
51
53
|
key: cdk.Fn.join('/', [
|
|
52
|
-
|
|
54
|
+
publicPrefix,
|
|
53
55
|
cdk.Fn.select(0, publicDeployment.objectKeys),
|
|
54
56
|
]),
|
|
55
57
|
},
|
|
@@ -23,7 +23,7 @@ class ImageAppContainer extends constructs_1.Construct {
|
|
|
23
23
|
});
|
|
24
24
|
new ecrDeployment.ECRDeployment(this, 'DeployedContainer', {
|
|
25
25
|
src: new ecrDeployment.DockerImageName(container.imageUri),
|
|
26
|
-
dest: new ecrDeployment.DockerImageName(cdk.Fn.join(':', [repo.repositoryUri, props.version
|
|
26
|
+
dest: new ecrDeployment.DockerImageName(cdk.Fn.join(':', [repo.repositoryUri, props.version])),
|
|
27
27
|
});
|
|
28
28
|
const versions = [props.version, 'latest'];
|
|
29
29
|
const parameters = [];
|
|
@@ -18,7 +18,7 @@ class NextAppRouterCode extends constructs_1.Construct {
|
|
|
18
18
|
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
19
19
|
autoDeleteObjects: true,
|
|
20
20
|
});
|
|
21
|
-
const deployment = (0, next_app_router_1.staticDeployment)(this, artifactBucket, props.output);
|
|
21
|
+
const deployment = (0, next_app_router_1.staticDeployment)(this, artifactBucket, props.output, props.version);
|
|
22
22
|
const serverOutput = node_path_1.default.join(props.output, '/.next/standalone');
|
|
23
23
|
node_fs_1.default.writeFileSync(node_path_1.default.join(serverOutput, 'run.sh'), props.cmd);
|
|
24
24
|
const code = (0, code_deployment_1.codeDeployment)(this, artifactBucket, serverOutput, props.version);
|
|
@@ -27,10 +27,10 @@ class NextAppRouterContainer extends constructs_1.Construct {
|
|
|
27
27
|
platform: ecrAssets.Platform.LINUX_AMD64,
|
|
28
28
|
...props.container,
|
|
29
29
|
});
|
|
30
|
-
const deployment = (0, next_app_router_1.staticDeployment)(this, artifactBucket, props.output);
|
|
30
|
+
const deployment = (0, next_app_router_1.staticDeployment)(this, artifactBucket, props.output, props.version);
|
|
31
31
|
new ecrDeployment.ECRDeployment(this, 'DeployedContainer', {
|
|
32
32
|
src: new ecrDeployment.DockerImageName(container.imageUri),
|
|
33
|
-
dest: new ecrDeployment.DockerImageName(cdk.Fn.join(':', [repo.repositoryUri, props.version
|
|
33
|
+
dest: new ecrDeployment.DockerImageName(cdk.Fn.join(':', [repo.repositoryUri, props.version])),
|
|
34
34
|
});
|
|
35
35
|
const versions = [props.version, 'latest'];
|
|
36
36
|
const parameters = [];
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fy-stack/app-construct",
|
|
3
|
-
"version": "0.0.147-alpha.
|
|
3
|
+
"version": "0.0.147-alpha.30694",
|
|
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.30694",
|
|
7
7
|
"tslib": "^2.3.0",
|
|
8
8
|
"zod": "^4.3.6"
|
|
9
9
|
},
|