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

feat: Frameworks API cleanup #5737

Merged
merged 12 commits into from
Jun 25, 2024
Merged

feat: Frameworks API cleanup #5737

merged 12 commits into from
Jun 25, 2024

Conversation

eduardoboucas
Copy link
Member

@eduardoboucas eduardoboucas commented Jun 25, 2024

Summary

Follow-up to #5668 with some clean-up tasks:

  1. ce2fe0d and 9fafe15: Rename the deploy_config directories to frameworks_api
  2. 7068df1: Wipe the .netlify/v1 directory before building to ensure we're not using leftover artefacts from a previous build
  3. 1b3892e: Address @orinokai's comment on feat: add Frameworks API #5668 (comment), replacing a forEach with a map
  4. 7116931: Make functions generated with the Frameworks API take precedence over functions generated using the legacy internal directory
  5. 3ebe12e: Make edge functions generated with the Frameworks API take precedence over edge functions generated using the legacy internal directory

@eduardoboucas eduardoboucas requested review from a team as code owners June 25, 2024 11:12
@eduardoboucas eduardoboucas changed the title Feat/frameworks api cleanup feat: Frameworks API cleanup Jun 25, 2024
Copy link
Contributor

This pull request adds or modifies JavaScript (.js, .cjs, .mjs) files.
Consider converting them to TypeScript.

export const preCleanup: CoreStep = {
event: 'onPreBuild',
coreStep,
coreStepId: 'pre_cleanup',
coreStepName: 'Pre cleanup',
coreStepDescription: () => 'Cleaning up leftover files from previous builds',
condition: blobsPresent,
Copy link
Member Author

@eduardoboucas eduardoboucas Jun 25, 2024

Choose a reason for hiding this comment

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

This means that this core step will now run for all builds as opposed to only running if there are blobs directories. That is fine, since calling rm() on a directory that doesn't exist will not throw here, and we have a try/catch around the calls anyway.

Copy link
Contributor

@lukasholzer lukasholzer left a comment

Choose a reason for hiding this comment

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

LGTM! 🐳

const files = await new fdir()
.withRelativePaths() // we want the relative path from the blobsDir
.filter((fpath) => !path.basename(fpath).startsWith(METADATA_PREFIX))
.crawl(blobsDir)
.withPromise()

files.forEach((filePath) => {
return files.map((filePath) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks ❤️

@eduardoboucas eduardoboucas merged commit a1f4d9a into main Jun 25, 2024
37 checks passed
@eduardoboucas eduardoboucas deleted the feat/frameworks-api-cleanup branch June 25, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants