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 subpath support regressions #2330

Merged
merged 9 commits into from
Jan 6, 2022
Merged

Fix subpath support regressions #2330

merged 9 commits into from
Jan 6, 2022

Conversation

matthewp
Copy link
Contributor

@matthewp matthewp commented Jan 6, 2022

Changes

Testing

  • Tests for the preview server were added to match what we already have for the dev server.

Docs

N/A, bug fix.

@changeset-bot
Copy link

changeset-bot bot commented Jan 6, 2022

🦋 Changeset detected

Latest commit: 1c81f87

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

This PR includes changesets to release 1 package
Name Type
astro 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

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) test labels Jan 6, 2022
@netlify
Copy link

netlify bot commented Jan 6, 2022

✔️ Deploy Preview for astro-www ready!

🔨 Explore the source changes: a233b75

🔍 Inspect the deploy log: https://app.netlify.com/sites/astro-www/deploys/61d7017ab317fe0007b632dc

😎 Browse the preview: https://deploy-preview-2330--astro-www.netlify.app/

@netlify
Copy link

netlify bot commented Jan 6, 2022

✔️ Deploy Preview for astro-docs-2 ready!

🔨 Explore the source changes: a233b75

🔍 Inspect the deploy log: https://app.netlify.com/sites/astro-docs-2/deploys/61d7017ab011b30007e02707

😎 Browse the preview: https://deploy-preview-2330--astro-docs-2.netlify.app

@netlify
Copy link

netlify bot commented Jan 6, 2022

✔️ Deploy Preview for astro-www ready!

🔨 Explore the source changes: 9671fc6

🔍 Inspect the deploy log: https://app.netlify.com/sites/astro-www/deploys/61d75bbf5fd85c0008410e75

😎 Browse the preview: https://deploy-preview-2330--astro-www.netlify.app

@netlify
Copy link

netlify bot commented Jan 6, 2022

✔️ Deploy Preview for astro-docs-2 ready!

🔨 Explore the source changes: 9671fc6

🔍 Inspect the deploy log: https://app.netlify.com/sites/astro-docs-2/deploys/61d75bbe6b22a400086367ae

😎 Browse the preview: https://deploy-preview-2330--astro-docs-2.netlify.app

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

This looks good to me with the exception of a potential missed edge case!

}

export function prependDotSlash(path: string) {
return path[0] === '.' ? path : './' + path;
Copy link
Member

Choose a reason for hiding this comment

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

This only checks that the path starts with ., not ./. In the unlikely case that there's a .filename file, this wouldn't prepend ./.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed with e4d60b2

packages/astro/test/preview-routing.test.js Show resolved Hide resolved
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

LGTM!

@matthewp matthewp merged commit 71ca091 into main Jan 6, 2022
@matthewp matthewp deleted the preview-subpath branch January 6, 2022 21:32
@github-actions github-actions bot mentioned this pull request Jan 6, 2022
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
* Fix subpath support regressions

* Adds a changeset

* Update tests to reflect relative URL change

* Pick a different port and hopefully windows works

* Remove bad lint warning

* Better handling of relative paths

* or

* Fixes use with pageUrlFormat

* Update the pageDirectoryUrl test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 BUG: Subpath builds fail 🐛 BUG: pageUrlFormat: 'file' creates .html file
3 participants