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

Added windows support for static files #387

Merged
merged 8 commits into from
Sep 17, 2024

Conversation

veitbjarsch
Copy link
Contributor

Changes

  • Added windows support for static files

On windows machines it did not split up the path for static files into it's parts, because it was only searching for posix separators.

Testing

Run the build on windows machines an check the _routes.json before and after.

Docs

Copy link

changeset-bot bot commented Sep 11, 2024

🦋 Changeset detected

Latest commit: b6574c8

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

This PR includes changesets to release 10 packages
Name Type
@astrojs/cloudflare Patch
@test/astro-cloudflare-astro-dev-platform Patch
@test/astro-cloudflare-astro-env Patch
@test/astro-cloudflare-compile-image-service Patch
@test/astro-cloudflare-external-image-service Patch
@test/astro-cloudflare-wasm Patch
@test/astro-cloudflare-no-output Patch
@test/astro-cloudflare-routes-json Patch
@test/astro-cloudflare-with-solid-js Patch
@test/astro-cloudflare-wrangler-preview-platform Patch

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

Copy link
Member

@alexanderniebuhr alexanderniebuhr left a comment

Choose a reason for hiding this comment

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

Let's wait for tests, but lgtm

@veitbjarsch
Copy link
Contributor Author

@alexanderniebuhr fixed the formatting and linting error. PR should be good to go now.

@bluwy
Copy link
Member

bluwy commented Sep 11, 2024

Do you have a repro or test for this? Checking the Astro source code, I don't think a backslash could happen in the first place. It'd be a bug there.

@veitbjarsch
Copy link
Contributor Author

@bluwy Here is a minimal reproduction of the issue. Just installed asto (latest version) and the astro cloudflare plugin.
https://github.com/veitbjarsch/astro-cloudflare-demo

When I add folders in the public folder and run npx astro build on windows the reoutes.json looks like this:
https://github.com/veitbjarsch/astro-cloudflare-demo/blob/main/dist/_routes.json

@bluwy
Copy link
Member

bluwy commented Sep 12, 2024

With your adjusted code, it makes more sense now and I think that's the right fix. Initially you made the change for Astro's paths which shouldn't have this issue.

@alexanderniebuhr
Copy link
Member

@veitbjarsch can you add an changeset with pnpm exec changeset

@veitbjarsch
Copy link
Contributor Author

@alexanderniebuhr done

@alexanderniebuhr alexanderniebuhr merged commit 04e5c38 into withastro:main Sep 17, 2024
3 checks passed
@github-actions github-actions bot mentioned this pull request Sep 17, 2024
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.

3 participants