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: use the root of the project as the functions location #6075

Conversation

NachoVazquez
Copy link
Contributor

@NachoVazquez NachoVazquez commented Jan 31, 2023

Changes

  • Use the configuration root as the location of the Cloudflare Pages functions when using the directory mode.

Fixes: #6066

Testing

Test the location of the functions folder creation.

Docs

Docs don't need to be updated, docs already state that the root of the project is the place to generate the functions folder.

@changeset-bot
Copy link

changeset-bot bot commented Jan 31, 2023

🦋 Changeset detected

Latest commit: 6a88eba

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Jan 31, 2023
@NachoVazquez NachoVazquez force-pushed the fix/6066/use-config-root-for-cloudflare-functions branch from 477b9e8 to 15ccdda Compare January 31, 2023 19:59
@NachoVazquez NachoVazquez marked this pull request as ready for review January 31, 2023 21:22
@NachoVazquez
Copy link
Contributor Author

I need help with the tests here. The fixture doesn't seem to work correctly when creating the functions folder, and the previous tests were naive.

@matthewp
Copy link
Contributor

matthewp commented Feb 1, 2023

I assume the problem is with using relative paths in the test, right? Those are defined here: https://github.com/withastro/astro/blob/main/packages/astro/test/test-utils.js#L168-L171 if it helps with debugging.

@NachoVazquez
Copy link
Contributor Author

NachoVazquez commented Feb 1, 2023

Part of the problem is that the functions folder is not being created when I read the elements of the folder in the console.log.

But that helps, thank you!

@NachoVazquez NachoVazquez force-pushed the fix/6066/use-config-root-for-cloudflare-functions branch from 31bb236 to cd25d60 Compare February 3, 2023 11:16
Copy link
Contributor

@AirBorne04 AirBorne04 left a comment

Choose a reason for hiding this comment

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

Sorry for being picky 😄

packages/integrations/cloudflare/test/directory.test.js Outdated Show resolved Hide resolved
packages/integrations/src/env.d.ts Outdated Show resolved Hide resolved
@NachoVazquez
Copy link
Contributor Author

Sorry for being picky 😄

Thanks for being picky :)

Copy link
Contributor

@AirBorne04 AirBorne04 left a comment

Choose a reason for hiding this comment

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

one more :)

packages/integrations/cloudflare/functions/[[path]].js Outdated Show resolved Hide resolved
@NachoVazquez NachoVazquez force-pushed the fix/6066/use-config-root-for-cloudflare-functions branch from 219637b to 85de8ab Compare February 3, 2023 13:15
Copy link
Contributor

@AirBorne04 AirBorne04 left a comment

Choose a reason for hiding this comment

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

Nice job! Thank you for making Astro better!

@NachoVazquez
Copy link
Contributor Author

Nice job! Thank you for making Astro better!

Thanks for your help!!!

@AirBorne04 AirBorne04 merged commit 45b41d9 into withastro:main Feb 3, 2023
@astrobot-houston astrobot-houston mentioned this pull request Feb 3, 2023
@NachoVazquez NachoVazquez deleted the fix/6066/use-config-root-for-cloudflare-functions branch February 12, 2023 00:01
@NachoVazquez
Copy link
Contributor Author

Hi @AirBorne04 , sorry to bother you, but do you have any info about when the next release of the Cloudflare adapter will happen? I need this changes :) thank you!

@NachoVazquez
Copy link
Contributor Author

Nevermind, I think it is out already! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
3 participants