@fy-stack/app-construct 0.0.140 → 0.0.142
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-app-router-construct.d.ts","sourceRoot":"","sources":["../../src/lib/next-app-router-construct.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAC;AAEzD,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"next-app-router-construct.d.ts","sourceRoot":"","sources":["../../src/lib/next-app-router-construct.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAC;AAEzD,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AAGjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAItD,QAAA,MAAM,iBAAiB;;;;;;EAErB,CAAC;AAEH,qBAAa,sBAAuB,SAAQ,SAAU,YAAW,YAAY;IACpE,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC1B,KAAK,EAAE,GAAG,CAAC,KAAK,GAAG,SAAS,CAAC;IAEpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;gBAEvB,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAiEjG,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,eAAe,CAAC;IAwDpE,gBAAgB,CAAC,cAAc,EAAE,MAAM;IAIvC,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC;IAI3C,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;IAI7C,KAAK,CAAC,GAAG,MAAM,EAAE,SAAS,EAAE;IAI5B,YAAY,IAAI,kBAAkB;IAIlC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO;;;CAG7B"}
|
|
@@ -8,7 +8,6 @@ const cdk = tslib_1.__importStar(require("aws-cdk-lib"));
|
|
|
8
8
|
const cloudfront = tslib_1.__importStar(require("aws-cdk-lib/aws-cloudfront"));
|
|
9
9
|
const cloudfrontOrigin = tslib_1.__importStar(require("aws-cdk-lib/aws-cloudfront-origins"));
|
|
10
10
|
const lambda = tslib_1.__importStar(require("aws-cdk-lib/aws-lambda"));
|
|
11
|
-
const aws_lambda_1 = require("aws-cdk-lib/aws-lambda");
|
|
12
11
|
const s3 = tslib_1.__importStar(require("aws-cdk-lib/aws-s3"));
|
|
13
12
|
const s3Deploy = tslib_1.__importStar(require("aws-cdk-lib/aws-s3-deployment"));
|
|
14
13
|
const constructs_1 = require("constructs");
|
|
@@ -57,6 +56,7 @@ class NextAppRouterConstruct extends constructs_1.Construct {
|
|
|
57
56
|
AWS_LAMBDA_EXEC_WRAPPER: '/opt/bootstrap',
|
|
58
57
|
PORT: '8080',
|
|
59
58
|
AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1',
|
|
59
|
+
AWS_LWA_INVOKE_MODE: 'response_stream'
|
|
60
60
|
};
|
|
61
61
|
Object.assign(environment, props.env);
|
|
62
62
|
const serverOutput = path.join(props.output, "/.next/standalone");
|
|
@@ -67,7 +67,7 @@ class NextAppRouterConstruct extends constructs_1.Construct {
|
|
|
67
67
|
handler: "run.sh",
|
|
68
68
|
timeout: cdk.Duration.seconds(60),
|
|
69
69
|
code: lambda.Code.fromAsset(serverOutput),
|
|
70
|
-
loggingFormat:
|
|
70
|
+
loggingFormat: lambda.LoggingFormat.JSON,
|
|
71
71
|
layers: [webAdapterLayer],
|
|
72
72
|
environment,
|
|
73
73
|
});
|
|
@@ -75,6 +75,7 @@ class NextAppRouterConstruct extends constructs_1.Construct {
|
|
|
75
75
|
cloudfront(path) {
|
|
76
76
|
const webUrl = this.function.addFunctionUrl({
|
|
77
77
|
authType: lambda.FunctionUrlAuthType.NONE,
|
|
78
|
+
invokeMode: lambda.InvokeMode.RESPONSE_STREAM
|
|
78
79
|
});
|
|
79
80
|
const serverOrigin = new cloudfrontOrigin.FunctionUrlOrigin(webUrl);
|
|
80
81
|
const staticOrigin = new cloudfrontOrigin.S3StaticWebsiteOrigin(this.static);
|
|
@@ -9,7 +9,7 @@ function lambdaApi(func, path) {
|
|
|
9
9
|
authType: lambda.FunctionUrlAuthType.NONE,
|
|
10
10
|
});
|
|
11
11
|
func.addEnvironment('BASE_PATH', path);
|
|
12
|
-
const integration = new aws_apigatewayv2_integrations_1.HttpUrlIntegration('AppIntegration', apiUrl.url);
|
|
12
|
+
const integration = new aws_apigatewayv2_integrations_1.HttpUrlIntegration('AppIntegration', apiUrl.url + '{proxy}');
|
|
13
13
|
return {
|
|
14
14
|
[path]: integration,
|
|
15
15
|
[`${path}/{proxy+}`]: integration,
|
|
@@ -6,7 +6,7 @@ function lambdaAttach(func, attachable) {
|
|
|
6
6
|
Object.assign(params, ...Object.entries(attachable)
|
|
7
7
|
.map(([key, val]) => {
|
|
8
8
|
return Object.fromEntries(Object.entries(val?.attachable() ?? {})
|
|
9
|
-
.map(([subKey, subVal]) => [`${key}_${subKey}
|
|
9
|
+
.map(([subKey, subVal]) => [`${key}_${subKey}`.toUpperCase(), subVal]));
|
|
10
10
|
}));
|
|
11
11
|
for (const i in params) {
|
|
12
12
|
func.addEnvironment(i, params[i]);
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fy-stack/app-construct",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.142",
|
|
4
4
|
"repository": "https://github.com/festusyuma/fy-stack",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@fy-stack/types": "0.0.
|
|
6
|
+
"@fy-stack/types": "0.0.142",
|
|
7
7
|
"tslib": "^2.3.0",
|
|
8
8
|
"zod": "^3.24.1"
|
|
9
9
|
},
|