Move the default frontend scaffold into a separate onboarding command
From Discord the other day:
MD: Is there any vision for frontend or is Tempest gonna do its best to stay out of that? I can see that tempest/app has already got Tailwind by default Brent: Tailwind for convenience, but I donβt want people to feel locked in. MD: imo it can be a bit "fly in my soup" - what about one of those normalise css files from a cdn so there's no need for even a package.json in tempest/app? just thinking about avoiding the frontend wars π Brent: We can defintily think about how to improve it, I don't have a strong opinion on the matter. Everything frontend kind of sucks :p MD: lmao yeah neither do i - but that nightmare what made me think of how to avoid it in the first place π©
This PR removes Tailwind from the default tempest/app install in favour of a short bit of plain CSS, but adds a post-create-project-cmd hook to the composer.json file to allow users to reinstall it via a separate tempest/scaffold package I started throwing together - https://github.com/mattdinthehouse/tempest-scaffold
Because frontend is such a heated debate I feel it's better to provide some starter kits and ask people what they want
I'm picturing that this tempest/scaffold package would eventually have templates for things like Authentication too, similar to Laravel's laravel/ui package but baked into the composer create-project ... flow for easier setup
π There's so much potential here, and it's so great to see a third-party Tempest package π We're definitely gonna merge this, but first let's discuss a couple of things. My first question: the scaffold commands should live somewhere within Tempest β I don't know yet where. It could be a separate tempest/scaffold package that's included with the tempest/app? WDYT?
Next: @aidan-casey wdyt? We've been talking about code generation in general as well. I don't think that should be a blocker for now, but we need to make sure tempest/scaffold (or something else) gets updated in time. Same for the upcoming filesystem.
Also: any other templates you had in mind?
Thanks @brendt π
My first question: the scaffold commands should live somewhere within Tempest β I don't know yet where. It could be a separate tempest/scaffold package that's included with the tempest/app? WDYT?
Agree - I prefer to hand it over to tempest mainline so it can live at tempest/scaffold in packagist and tempestphp/tempest-scaffold on github, especially if it's going to be default dev dependency of tempest/app
We've been talking about code generation in general as well. I don't think that should be a blocker for now, but we need to make sure tempest/scaffold (or something else) gets updated in time. Same for the upcoming filesystem.
I'm happy to keep the scaffold up to date, and honestly if you know a better way of doing it then let me know - I briefly looked at diff/patching packages but found most depended on running shell_exec which isn't a guarantee, and I didn't want to go too far down a rabbit hole just yet
Also: any other templates you had in mind?
The obvious ones for frontend are:
- bootstrap with postcss
- react/vue/etc with vite or webpack
But I was also picturing some authentication templates but I wasn't sure if you had a vision for that?
But I was also picturing some authentication templates but I wasn't sure if you had a vision for that?
Yeah, that would be nice as well. Still need to figure out how we need to do that, but it's definitely something we should have
I saw your poll on Discord and https://github.com/tempestphp/tempest-framework/pull/493 so I'll add an authentication UI scaffold that calls the Authenticator interface when that's stable and merged, and I'll add those easy frontend compile chains during the week π
Sorry for being silent on this so long. Could you PR your package to tempest/scaffold first? I made a repo for it: https://github.com/tempestphp/tempest-scaffold
@brendt shouldn't this be in tempest/cli?
Oh yes, I forgot about that π«£ Yeah it should go in there: https://github.com/tempestphp/cli
(@aidan-casey why did you call that repo cli and not tempest-cli)?
Sorry for being silent on this so long
Likewise! I'm overseas until Thursday so didn't get time to add anything before I left...
https://github.com/tempestphp/cli looks like a sample project rather than a package?
@aidan-casey why did you call that repo cli and not tempest-cli
Because is a separate project, not a package. Given that, I followed the convention highlight gives us.
looks like a sample project rather than a package?
It's an actual project. Will be a CLI tool you can install locally or into a project to do various tempest stuff.
Closing in favor of #9, we might revisit it later because I think there are some interesting ideas in this PR still, but I feel like we need a bit more time using Tempest in practice before locking into a solution