Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add option to define the root folder of a lambda deployment. #540

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

aheissenberger
Copy link
Contributor

This change allows to handle the differences of bundling the deployment ZIP for the serverless framework and the AWS CDK.

…s is a requirement of the serverless framework.
Copy link

vercel bot commented Feb 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
waku ✅ Ready (Inspect) Visit Preview Feb 26, 2024 11:15am

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@@ -7,7 +7,7 @@ import path from 'node:path';
import { existsSync, readFileSync } from 'node:fs';

const ssr = !!import.meta.env.WAKU_BUILD_SSR;
const distDir = import.meta.env.WAKU_CONFIG_DIST_DIR!;
const distDir = process.env?.WAKU_BUILD_DIST_DIR ?? '';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly sure how it works, but should default be something other than ''?

const distDir = process.env?.WAKU_BUILD_DIST_DIR ?? import.meta.env.WAKU_CONFIG_DIST_DIR!;
const distDir = process.env?.WAKU_BUILD_DIST_DIR ?? '.';

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fix to handle the problem of the Serverless framework including the top folder dist in the deployed ZIP which is the reason for my problems #514 to implement the private folder in the build-adapter code.

Other deployment solution (e.g. AWS CDK) do not add this extra hierarchy and do not need to know the name of the dist folder.

This is not a perfect solution, but works for now with both deployment options described in the docs. I will have to optimize it in a next step to remove the currently fixed coded dist folder in deployment configs for the serverless framework and AWS CDK, to solution which can extract the value from WAKU_CONFIG_DIST_DIR.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, if it's expected to be '' by default, it's fine. As I don't follow every details, I count on you. 😄

@dai-shi dai-shi merged commit 7c52d9a into dai-shi:main Feb 27, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants