Skip to content

Conversation

@Ujstor
Copy link
Collaborator

@Ujstor Ujstor commented Feb 2, 2025

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

Problem/Feature

Fronted flag implementation

image

Check README for flag usage

Description of Changes:

close #360
close #331

Checklist

Copy link
Owner

@Melkeydev Melkeydev left a comment

Choose a reason for hiding this comment

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

we should meet and discuss

@@ -0,0 +1,54 @@
name: Linting Generated Blueprints Advanced
Copy link
Owner

Choose a reason for hiding this comment

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

Why does the frontend linter need to know the backend matrix?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Backend framework, DB drivers and Git are required inputs for project creation. And we are looping over all backends to ensure we don't have templating issues on any of them when they are paired with frontend.

- Docker configuration for go project
- [React](https://react.dev/) frontend written in TypeScript, including an example fetch request to the backend

Note: Selecting Tailwind option will automatically select HTMX unless React is explicitly selected
Copy link
Owner

Choose a reason for hiding this comment

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

i think we should still keep this here to let people know

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In new implementation this is not an issue anymore. In frontend mode you choose framework and then there is a prompt for frontend-advanced options, in this case Tailwind


```bash
go-blueprint create --name my-project --framework gin --driver postgres --git commit
go-blueprint create -n my-project -b gin -d postgres -g commit
Copy link
Owner

Choose a reason for hiding this comment

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

For discussion:
I dont know if i like the move to change the backend go frameworks to backend. They are still frameworks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Long flag can be --backend-framework, I will push the changes. And then we can discuss what else can be improved or removed :)

</p>

Websocket:
Advanced features are accessible with the `-a` flag
Copy link
Owner

Choose a reason for hiding this comment

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

The flag redesign makes sense in certain areas, but something this major definitely needs to be fully discussed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I agree

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Other flags are not redefined, only the -framework is now -b or --backend-framework. All flags had a short and long notation, we always used the long one. For example --advanced, which also had the short -a. It is unusual for primary flags to be used in long notation in examples, and can be confusing with secondary flags that have only the long input (--feature, --frontend-framework or --frontend-advanced).

Comment on lines 11 to 15
RUN go install github.com/a-h/templ/cmd/templ@latest && \
templ generate && \
curl -sL https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.10/tailwindcss-linux-x64 -o tailwindcss && \
chmod +x tailwindcss && \
./tailwindcss -i cmd/web/styles/input.css -o cmd/web/assets/css/output.css
Copy link
Owner

Choose a reason for hiding this comment

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

This dockerfile is only for respective frontend flags triggered?
How come there is tailwind + templ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This part is from blueprint-ui, and I moved code to a separate branch and PR so that it is less confusing. #377

Comment on lines 19 to 23
tailwind-install:
@if [ ! -f tailwindcss ]; then curl -sL https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.10/tailwindcss-linux-x64 -o tailwindcss; fi

@chmod +x tailwindcss

Copy link
Owner

Choose a reason for hiding this comment

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

i dont think this needs to be a make file for the users to use

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also part of bp-ui (#377) , crucial for local dev and test. Easier deployment and maintenance benefits, if new PR changes directory and file layout this part of code also needs to be updated, along with docs code. I added this requirement to the PR checklist.

@Ujstor Ujstor mentioned this pull request Feb 2, 2025
2 tasks
@Ujstor Ujstor marked this pull request as draft April 18, 2025 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Panic occurs when there is no git [Community Vote] Removing HttpRouter or Gorilla/mux from Go-Blueprint

3 participants