-
Notifications
You must be signed in to change notification settings - Fork 239
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
feat: Check if templ and tailwindcss commands are available before #296
Conversation
I saw the PR after I commented on the open issue ticket. I just didn't pick up on the fact that you mentioned it in the PR. First, we need to resolve the linter issue. I will leave my review shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pipeline is fixed, it should pass on next push.
|
||
build: | ||
check: | ||
@command -v templ >/dev/null 2>&1 || { echo >&2 "templ is not installed. Run 'go install go install github.com/a-h/templ/cmd/templ@latest' to install it or check your environment."; exit 1; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about adding an option to install tmpl, similar to what I proposed in your open issue ticket?
@command -v tailwindcss >/dev/null 2>&1 || { echo >&2 "tailwindcss is not install. Go to https://tailwindcss.com/docs/installation to install it or check your environment."; exit 1; } | ||
|
||
{{end}} | ||
build:{{if or ( .AdvancedOptions.htmx ) ( .AdvancedOptions.tailwind )}} check{{end}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should restrict check
to only Unix-based OS. Unfortunately, this will not work on Win
{{if .UnixBased }}"check"{{ else }}""{{ end }}
@@ -2,8 +2,14 @@ | |||
|
|||
# Build the application | |||
all: build | |||
{{if or ( .AdvancedOptions.htmx ) ( .AdvancedOptions.tailwind )}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If htmx flag is used, only the tmpl check
is needed. If tailwind is used, it will automatically include the htmx flag in the project, so the tmpl and htmx check
need to be templated together.
Thanks, I'll take a look and check how to do it in Windows |
It would be nice to have a Windows implementation….something like 30% of blueprint users are on Win |
here were other open issues related to the Makefile, and I resolved them all in one PR. |
building (#295)
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.
Problem/Feature
When creating a new project for the first time, and having tailwindcss and templ options enable, the Makefile does not check if those commands are available. I'm adding a "check" step in the Makefile to do this, and redirect the user to installed them if they are not available.
Description of Changes:
check
step if tailwindcss and templ options are enabledChecklist