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 dot files not being copied over on non-root builds (#9740) #9741

Merged
merged 3 commits into from
Jan 22, 2024

Conversation

taktran
Copy link
Contributor

@taktran taktran commented Jan 19, 2024

Changes

Fixes #9740

When running astro build outside of where the astro files are, dotfiles are not copied over because the includeDotfiles parameter is not passed in. This PR adds a true includeDotfiles value to copyFiles to fix this.

Testing

  1. Check out this PR locally

  2. Download astro bug example https://stackblitz.com/edit/github-es2mdg-tnkbfm?file=README.md

  3. Check bug

    cd another-astro
    pnpm install
    npm run astro build -- --root ../
    ls -la ../dist
    # Notice that there is no `.htaccess` file
    
    pnpm link [PR-root]/astro/packages/astro
    npm run astro build -- --root ../
    ls -la ../dist
    # Now there is a `.htaccess` file

Not sure if this requires an e2e test, but if so, please point me in the direction of an example of how one is set up.

Docs

Fixes a bug with build, so shouldn't affect any of the docs

When running `astro build` outside of where the astro files are, dotfiles are not copied over because the `includeDotfiles` parameter is not passed in.
Copy link

changeset-bot bot commented Jan 19, 2024

🦋 Changeset detected

Latest commit: e1e5b9c

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: astro Related to the core `astro` package (scope) label Jan 19, 2024
Copy link
Contributor

@lilnasy lilnasy left a comment

Choose a reason for hiding this comment

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

Tried this earlier. Looks great to me!

Thanks for fixing it 💜

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! I think with this change we might always be copying dotfiles and can probably remove the third argument? No need to take care of that in this PR, though.

taktran added a commit to ag-grid/ag-charts that referenced this pull request Jan 22, 2024
…de of astro folder

Needed because nx runs in the root folder outside of `ag-charts-website`, and there is a bug in astro that doesn't copy dot files over in these instances. Can remove this, when withastro/astro#9741 is merged
@ematipico ematipico merged commit 73d7440 into withastro:main Jan 22, 2024
13 checks passed
@taktran taktran deleted the non-root-build-dot-files-bug branch January 22, 2024 12:09
@astrobot-houston astrobot-houston mentioned this pull request Jan 22, 2024
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.

Dot files not copied over from public folder if not running build from root folder
5 participants