Skip to content
Draft
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8b08583
separte advanced flag
Ujstor Jan 21, 2025
1801009
working config
Ujstor Jan 27, 2025
3364611
liter
Ujstor Jan 27, 2025
8565824
git flag fix
Ujstor Jan 27, 2025
545a1a6
move frameworks flag to backed
Ujstor Jan 28, 2025
4a4075a
remove depend flags
Ujstor Jan 29, 2025
698e34b
prompt order
Ujstor Jan 29, 2025
e4b2943
fix actions
Ujstor Jan 29, 2025
5845750
move git logic
Ujstor Jan 30, 2025
84ef692
fix ui prompts
Ujstor Jan 30, 2025
2f967a8
remove http_router framework
Ujstor Jan 30, 2025
1ce2141
short flags commands
Ujstor Jan 30, 2025
aecc318
Readme update
Ujstor Jan 30, 2025
401c3e6
docs update
Ujstor Jan 30, 2025
c1286fd
readme
Ujstor Jan 30, 2025
15713b1
contrib update
Ujstor Jan 30, 2025
a6c576f
import and git impl
Ujstor Jan 29, 2025
7053241
add fronted
Ujstor Jan 29, 2025
0610810
working flags
Ujstor Jan 29, 2025
60e59c4
svg
Ujstor Jan 29, 2025
229347d
tree update
Ujstor Jan 29, 2025
a505d9d
final config
Ujstor Jan 29, 2025
eefab6b
clean leftovers
Ujstor Jan 29, 2025
4605f5d
add readme icon
Ujstor Jan 29, 2025
8661942
svg and struct
Ujstor Jan 30, 2025
32dbf5d
remove http_router framework
Ujstor Jan 30, 2025
c401be2
htmx tailwind tree fix
Ujstor Feb 2, 2025
7f17dcd
remove script form dinam updat content
Ujstor Feb 2, 2025
1396b0f
Prevent page navigation on form submission
Ujstor Feb 2, 2025
874853c
remove httpRouter from workflows
Ujstor Feb 2, 2025
1d09645
fix workflow
Ujstor Feb 2, 2025
d28c3b0
fix frontend linter
Ujstor Feb 2, 2025
5bc3105
remove bp_ui to sepate branch
Ujstor Feb 2, 2025
e5b978a
-backend-framework
Ujstor Feb 2, 2025
5a8ab70
readme
Ujstor Feb 2, 2025
096972a
file rename
Ujstor Feb 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ on:
jobs:
build-deploy:
name: Build and deploy docs

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
20 changes: 7 additions & 13 deletions .github/workflows/generate-linter-advanced.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ on:
workflow_dispatch: {}

jobs:
framework_matrix:
blueprint_matrix:
strategy:
matrix:
framework: [chi, gin, fiber, gorilla/mux, httprouter, standard-library, echo]
backend: [chi, gin, fiber, gorilla/mux, httprouter, standard-library, echo]
driver: [postgres]
git: [commit]
advanced: [htmx, githubaction, websocket, tailwind, docker, react]
advanced: [githubaction, websocket, docker]

runs-on: ubuntu-latest
steps:
Expand All @@ -30,18 +30,12 @@ jobs:
git config --global user.name 'testname'
git config --global user.email '[email protected]'

- name: Set framework variable
id: set-proejct-directory
run: echo "PROJECT_DIRECTORY=${{ matrix.framework }}" | sed 's/\//-/g' >> $GITHUB_ENV
- name: Set dir variable
id: set-project-directory
run: echo "PROJECT_DIRECTORY=${{ matrix.backend }}" | sed 's/\//-/g' >> $GITHUB_ENV

- name: build templates
run: script -q /dev/null -c "go run main.go create -n ${{ env.PROJECT_DIRECTORY }} -f ${{ matrix.framework}} -d ${{ matrix.driver }} -g ${{ matrix.git}} --advanced --feature ${{ matrix.advanced }}"

- if: ${{ matrix.advanced == 'htmx' || matrix.advanced == 'tailwind' }}
name: Install Templ & gen templates
run: |
go install github.com/a-h/templ/cmd/templ@latest
/home/runner/go/bin/templ generate -path ${{ env.PROJECT_DIRECTORY }}
run: script -q /dev/null -c "go run main.go create -n ${{ env.PROJECT_DIRECTORY }} -b ${{ matrix.backend}} -d ${{ matrix.driver }} -g ${{ matrix.git}} -a --feature ${{ matrix.advanced }}"

- name: golangci-lint
run: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/generate-linter-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ on:
workflow_dispatch: {}

jobs:
framework_matrix:
blueprint_matrix:
strategy:
matrix:
framework: [chi, gin, fiber, gorilla/mux, httprouter, standard-library, echo]
backend: [chi, gin, fiber, gorilla/mux, httprouter, standard-library, echo]
driver: [mysql, postgres, sqlite, mongo, redis, scylla, none]
git: [commit, stage, skip]

Expand All @@ -29,12 +29,12 @@ jobs:
git config --global user.name 'testname'
git config --global user.email '[email protected]'

- name: Set framework variable
id: set-proejct-directory
run: echo "PROJECT_DIRECTORY=${{ matrix.framework }}" | sed 's/\//-/g' >> $GITHUB_ENV
- name: Set dir variable
id: set-project-directory
run: echo "PROJECT_DIRECTORY=${{ matrix.backend }}" | sed 's/\//-/g' >> $GITHUB_ENV

- name: build templates
run: script -q /dev/null -c "go run main.go create -n ${{ env.PROJECT_DIRECTORY }} -f ${{ matrix.framework}} -d ${{ matrix.driver }} -g ${{ matrix.git}}"
run: script -q /dev/null -c "go run main.go create -n ${{ env.PROJECT_DIRECTORY }} -b ${{ matrix.backend}} -d ${{ matrix.driver }} -g ${{ matrix.git}}"

- name: golangci-lint
run: |
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/generate-linter-frontend.yml
Original file line number Diff line number Diff line change
@@ -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.


on:
pull_request: {}
workflow_dispatch: {}

jobs:
blueprint_matrix:
strategy:
matrix:
backend: [chi, gin, fiber, gorilla/mux, httprouter, standard-library, echo]
driver: [postgres]
git: [commit]
advanced: [docker]
frontendFramework: [htmx, react]
frontendAdvanced: [tailwind]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23.x'

- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/cmd/[email protected]

- name: Commit report
run: |
git config --global user.name 'testname'
git config --global user.email '[email protected]'

- name: Set dir variable
id: set-project-directory
run: echo "PROJECT_DIRECTORY=${{ matrix.backend }}" | sed 's/\//-/g' >> $GITHUB_ENV

- name: build templates
run: script -q /dev/null -c "go run main.go create -n ${{ env.PROJECT_DIRECTORY }} -b ${{ matrix.backend}} -d ${{ matrix.driver }} -g ${{ matrix.git}} -a --feature ${{ matrix.advanced }} -f ${{ matrix.frontendFramework }} --frontend-advanced ${{ matrix.frontendAdvanced}}"

- if: ${{ matrix.frontendFramework == 'htmx'}}
name: Install Templ & gen templates
run: |
go install github.com/a-h/templ/cmd/templ@latest
/home/runner/go/bin/templ generate -path ${{ env.PROJECT_DIRECTORY }}

- name: golangci-lint
run: |
cd ${{ env.PROJECT_DIRECTORY }}
golangci-lint run

- name: remove templates
run: rm -rf ${{ env.PROJECT_DIRECTORY }}
12 changes: 6 additions & 6 deletions .github/workflows/update-htmx-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Get version from file
id: get_version_file
run: |
VERSION_FILE=$(curl -s https://raw.githubusercontent.com/Melkeydev/go-blueprint/main/cmd/template/advanced/files/htmx/htmx.min.js.tmpl | grep version | awk -F'"' '{print "v" $2}')
VERSION_FILE=$(curl -s https://raw.githubusercontent.com/Melkeydev/go-blueprint/main/cmd/template/frontend/files/htmx/htmx.min.js.tmpl | grep version | awk -F'"' '{print "v" $2}')
echo "version file: $VERSION_FILE"
if [[ "$VERSION_FILE" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "version_file=$VERSION_FILE" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -47,27 +47,27 @@ jobs:

- name: dump latest htmx version
if: steps.compare_versions.outputs.release_changed == 'true'
run: curl -L https://github.com/bigskysoftware/htmx/releases/latest/download/htmx.min.js -o cmd/template/advanced/files/htmx/htmx.min.js
run: curl -L https://github.com/bigskysoftware/htmx/releases/latest/download/htmx.min.js -o cmd/template/frontend/files/htmx/htmx.min.js

- name: Prettify code
if: steps.compare_versions.outputs.release_changed == 'true'
run: |
npm install --save-dev --save-exact prettier
npx prettier --write cmd/template/advanced/files/htmx/htmx.min.js
npx prettier --write cmd/template/frontend/files/htmx/htmx.min.js
rm -rf node_modules
rm package-lock.json
rm package.json

- name: Create tmpl after Prettify
if: steps.compare_versions.outputs.release_changed == 'true'
run: mv cmd/template/advanced/files/htmx/htmx.min.js cmd/template/advanced/files/htmx/htmx.min.js.tmpl
run: mv cmd/template/frontend/files/htmx/htmx.min.js cmd/template/frontend/files/htmx/htmx.min.js.tmpl

- name: Create Pull Request
if: steps.compare_versions.outputs.release_changed == 'true'
uses: peter-evans/create-pull-request@v6
with:
commit-message: update htmx version ${{ steps.get_version_api.outputs.version_api }}
commit-message: update htmx ${{ steps.get_version_api.outputs.version_api }}
title: Update htmx to version ${{ steps.get_version_api.outputs.version_api }} [Bot]
body: New htmx ${{ steps.get_version_api.outputs.version_api }} version is available. This is an automatic PR to update changes.
body: New htmx ${{ steps.get_version_api.outputs.version_api }} is available. This is an automatic PR to update changes.
branch: htmx-version-update
base: main
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
go-blueprint
main

site

*templ.go
output.css
tailwindcss
tmp/
Loading
Loading