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

Add support for frontend v2 for nuxt #1345

Merged
merged 6 commits into from
Aug 28, 2024

Conversation

vladiulianbogdan
Copy link
Member

Pull Request Template

Type of change

  • πŸ• New feature
  • πŸ› Bug Fix
  • πŸ”₯ Breaking change
  • πŸ§‘β€πŸ’» Improvement
  • πŸ“ Documentation Update

Description

Add CDN support for Nuxt.

Checklist

  • My code follows the contributor guidelines of this project;
  • I have updated the documentation;
  • I have added tests;
  • New and existing unit tests pass locally with my changes;

@@ -105,6 +105,7 @@ export async function getAllFilesFromCurrentPath(
export async function zipDirectory(
sourceDir: string,
outPath: string,
includeHiddenFiles: boolean = false,
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be true by default.

So before this change dot: true, hence all of the previous method calls assume that hidden files will be included by default, right?

Copy link
Member Author

@vladiulianbogdan vladiulianbogdan Aug 28, 2024

Choose a reason for hiding this comment

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

It doesn't matter. I changed in all places where this is used. The default value is for future usage and I think false is a more safe default value.

Copy link
Member

Choose a reason for hiding this comment

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

Comment on lines +748 to +749
const presignedUrlForProjectCode = await getPresignedURLForProjectCodePush(region, name, stage);
return uploadContentToS3(
Copy link
Member

Choose a reason for hiding this comment

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

I think we should clean tmpFolderProject here with something like:

await deleteFolder(path.dirname(tmpFolderProject));

Copy link
Member

Choose a reason for hiding this comment

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

All temporary folders are already deleted at process exit:

await deleteFolder(temporaryFolder).catch((error) => {

Copy link
Member

Choose a reason for hiding this comment

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

My bad, disregard my comment

Comment on lines +735 to +744
[
"**/node_modules/*",
"./node_modules/*",
"node_modules/*",
"**/node_modules",
"./node_modules",
"node_modules",
"node_modules/**",
"**/node_modules/**",
],
Copy link
Member

Choose a reason for hiding this comment

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

It seems to me that the exclusion list is smaller than it was before refactoring.
I believe we are adding the .git directory and any other temporary directories used by vercel, opennnext in the zip.

Is this something we want?

I think we should at least keep ignoring the .git related stuff.

Copy link
Member Author

Choose a reason for hiding this comment

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

All dot files and folders are ignored. That's why I did the change with zipDirectory.

Copy link
Member

@costinsin costinsin left a comment

Choose a reason for hiding this comment

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

LGTM

presignedUrlForProjectCode,
path.join(tmpFolderProject, "projectCode.zip"),
);
await uploadUserCode(configuration.name, configuration.region, options.stage);
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for doing this refactoring! It was DEFINITELY needed.

Comment on lines +748 to +749
const presignedUrlForProjectCode = await getPresignedURLForProjectCodePush(region, name, stage);
return uploadContentToS3(
Copy link
Member

Choose a reason for hiding this comment

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

All temporary folders are already deleted at process exit:

await deleteFolder(temporaryFolder).catch((error) => {

return;
}

const paths: CreateFrontendV2Path[] = files.map((file) => ({
Copy link
Member

Choose a reason for hiding this comment

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

What if there are more than 250 files? πŸ˜₯

Copy link
Member Author

Choose a reason for hiding this comment

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

We cry. I'll add a task for this.

Copy link
Member

@andreia-oca andreia-oca left a comment

Choose a reason for hiding this comment

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

LGTM 🦭

@vladiulianbogdan vladiulianbogdan merged commit 910bfad into dev Aug 28, 2024
5 checks passed
@vladiulianbogdan vladiulianbogdan deleted the add-support-for-frontend-v2-for-nuxt branch August 28, 2024 11:20
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.

3 participants