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: preserve ./netlify/functions-internal #8899

Merged
merged 9 commits into from
Feb 8, 2023

Conversation

lemusthelroy
Copy link
Contributor

@lemusthelroy lemusthelroy commented Feb 6, 2023

Summary

Some Netlify integrations, such as the emails integration, auto generate functions prior to the build and these will exist in the functions-internal folder. I am not totally aware of why the functions-internal directory is emptied currently by this adapter, however, this PR ensures that only the files that are generated by SvelteKit are removed and not any other files.

How has this been tested?

  • With a new svelte kit project, that has the Netlify adapter added and running netlify build
  • Adapting the above project, setting split:true and running netlify build again
  • Reversing the above setting and running netlify build again

Closes #8903

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Copy link
Member

@benmccann benmccann left a comment

Choose a reason for hiding this comment

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

I am not totally aware of why the functions-internal directory is emptied currently by this adapter, however, this PR ensures that only the files that are generated by SvelteKit are removed and not any other files.

It was just done to remove any leftover files from previous builds

packages/adapter-netlify/index.js Outdated Show resolved Hide resolved
@lemusthelroy
Copy link
Contributor Author

lemusthelroy commented Feb 6, 2023

I have just spotted that the name of the files generated could be dynamic - https://github.com/sveltejs/kit/pull/8899/files#diff-cc76725f3c6f8ff40fb8605aff3b0d3eeefc561e4a6c9a162b79dda99c95dedaL196.

@dummdidumm
Copy link
Member

Thank you! Could you add a changeset? Then we're good to merge.

Copy link

@orinokai orinokai left a comment

Choose a reason for hiding this comment

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

Thanks Lewis. All looks good 🎉

@lemusthelroy
Copy link
Contributor Author

Thank you! Could you add a changeset? Then we're good to merge.

Added 👍

@dummdidumm dummdidumm merged commit 12fc26f into sveltejs:master Feb 8, 2023
@github-actions github-actions bot mentioned this pull request Feb 8, 2023
Rich-Harris added a commit that referenced this pull request Feb 8, 2023
dummdidumm pushed a commit that referenced this pull request Feb 9, 2023
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.

functions-internal is emptied - adapter-netlify
4 participants