tempest-app icon indicating copy to clipboard operation
tempest-app copied to clipboard

Move the default frontend scaffold into a separate onboarding command

Open mattdinthehouse opened this issue 1 year ago β€’ 9 comments

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

mattdinthehouse avatar Sep 22 '24 12:09 mattdinthehouse

πŸ‘ 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?

brendt avatar Sep 25 '24 09:09 brendt

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?

mattdinthehouse avatar Sep 25 '24 21:09 mattdinthehouse

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

brendt avatar Sep 26 '24 11:09 brendt

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 😊

mattdinthehouse avatar Sep 28 '24 02:09 mattdinthehouse

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 avatar Oct 11 '24 08:10 brendt

@brendt shouldn't this be in tempest/cli?

aidan-casey avatar Oct 11 '24 11:10 aidan-casey

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)?

brendt avatar Oct 11 '24 12:10 brendt

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?

mattdinthehouse avatar Oct 11 '24 13:10 mattdinthehouse

@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.

aidan-casey avatar Oct 11 '24 13:10 aidan-casey

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

brendt avatar Dec 12 '24 07:12 brendt