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 blitz install for recipes that use the path helper #3995

Merged
merged 3 commits into from
Dec 9, 2022

Conversation

itsdillon
Copy link
Member

Closes: #3900

What are the changes and their implications?

Check if src/pages directory exists in the installer paths helper, else use the root pages directory.

Bug Checklist

  • Changeset added (run pnpm changeset in the root directory)

@changeset-bot
Copy link

changeset-bot bot commented Nov 28, 2022

🦋 Changeset detected

Latest commit: 481ee8a

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

This PR includes changesets to release 7 packages
Name Type
blitz Patch
@blitzjs/auth Patch
@blitzjs/next Patch
@blitzjs/rpc Patch
@blitzjs/codemod Patch
@blitzjs/config Patch
@blitzjs/generator 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

@maotora
Copy link
Contributor

maotora commented Nov 28, 2022

@dillonraphael Hey nice catch, I was facing the same error trying to install the tailwind recipe.
I just left a comment in one of your files. I think previous versions of blitz were using app/pages or something similar instead of just pages.

@itsdillon
Copy link
Member Author

@dillonraphael Hey nice catch, I was facing the same error trying to install the tailwind recipe. I just left a comment in one of your files. I think previous versions of blitz were using app/pages or something similar instead of just pages.

Thanks so much for the review @maotora. Love seeing the community get involved.

So for the legacy framework (which can be found here https://github.com/blitz-js/legacy-framework), allowed for the pages directory to in the app folder. But for blitz 2.0 this is no longer a case.

@maotora
Copy link
Contributor

maotora commented Nov 30, 2022

Thanks for your response, @dillonraphael!

I just tested this and I found there is another edge case to cover for Tailwindcss to get our coding files which no longer reside at pages or app directories.
We need to update tailwind.config.js content array to reflect the directory change as well.

I came up with something like this which fixed it;

// tailwind.config.js
module.exports = {
  content: ["src/**/*.{js,ts,jsx,tsx}"],
  theme: {
    extend: {},
  },
  plugins: [],
}

Which worked!

@itsdillon
Copy link
Member Author

Good find @maotora. Would you like to open another PR for updating the tailwind recipe (since this is tailwind recipe specific)?

@maotora
Copy link
Contributor

maotora commented Dec 1, 2022

@dillonraphael sure I can do that. Will make a PR and tag you then.

@itsdillon itsdillon requested a review from flybayer December 3, 2022 14:57
@maotora
Copy link
Contributor

maotora commented Dec 4, 2022

@dillonraphael done I've made a PR: here

@itsdillon itsdillon merged commit a059627 into main Dec 9, 2022
@itsdillon itsdillon deleted the fix-blitz-install-pages-path branch December 9, 2022 16:32
@cassilup
Copy link

cassilup commented Jan 13, 2024

Still experiencing this in 2.0.2.

@Doc0x1
Copy link
Contributor

Doc0x1 commented Jan 20, 2024

Still experiencing this in 2.0.3 as well. I haven't tested to make sure but I think this might be an issue for projects that are using the App Router instead of the older Pages system.

@siddhsuresh
Copy link
Member

yeah @Doc0x1, that seems likely, we would need to add additional handling to also check for the existence of the app directory in the same area as the change in this PR.

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.

Blitz install stuck on "Generating file diff" in new project
7 participants