From 5d9dc6e59ae664689ddc3027df53259cad87d8b2 Mon Sep 17 00:00:00 2001 From: monirzadeh <25131576+Monirzadeh@users.noreply.github.com> Date: Sun, 1 Sep 2024 23:02:56 +0330 Subject: [PATCH 1/8] move views under internal --- {views => internal/views}/address_results.html | 0 {views => internal/views}/admin/admin_root.html | 0 {views => internal/views}/admin/admin_user_edit.html | 0 {views => internal/views}/embed.go | 0 {views => internal/views}/embed_test.go | 0 {views => internal/views}/equipment/equipment_add.html | 0 {views => internal/views}/equipment/equipment_edit.html | 0 {views => internal/views}/equipment/equipment_list.html | 0 {views => internal/views}/equipment/equipment_show.html | 0 {views => internal/views}/partials/alerts.html | 0 {views => internal/views}/partials/equipment_actions.html | 0 {views => internal/views}/partials/footer.html | 0 {views => internal/views}/partials/head.html | 0 {views => internal/views}/partials/header.html | 0 {views => internal/views}/partials/language.html | 0 {views => internal/views}/partials/messages.html | 0 {views => internal/views}/partials/route_segment_actions.html | 0 {views => internal/views}/partials/route_segment_details.html | 0 {views => internal/views}/partials/route_segment_map.html | 0 .../views}/partials/route_segments_list_details.html | 0 {views => internal/views}/partials/snippet_date.html | 0 {views => internal/views}/partials/statistic_tile.html | 0 {views => internal/views}/partials/stats_records_distance.html | 0 {views => internal/views}/partials/stats_records_totals.html | 0 {views => internal/views}/partials/user_actions.html | 0 {views => internal/views}/partials/user_profile_calendar.html | 0 {views => internal/views}/partials/user_profile_language.html | 0 .../views}/partials/user_profile_preferred_units.html | 0 {views => internal/views}/partials/user_profile_timezone.html | 0 .../views}/partials/user_profile_totals_show.html | 0 {views => internal/views}/partials/version.html | 0 {views => internal/views}/partials/workout_actions.html | 0 {views => internal/views}/partials/workout_breakdown.html | 0 {views => internal/views}/partials/workout_details.html | 0 {views => internal/views}/partials/workout_item.html | 0 {views => internal/views}/partials/workout_map.html | 0 {views => internal/views}/partials/workout_point_title.html | 0 {views => internal/views}/partials/workout_route_segments.html | 0 {views => internal/views}/partials/workout_show_stats.html | 0 {views => internal/views}/partials/workout_social.html | 0 {views => internal/views}/partials/workouts_list_details.html | 0 .../views}/route_segments/route_segments_add.html | 0 .../views}/route_segments/route_segments_edit.html | 0 .../views}/route_segments/route_segments_list.html | 0 .../views}/route_segments/route_segments_show.html | 0 {views => internal/views}/user/user_login.html | 0 {views => internal/views}/user/user_profile.html | 0 {views => internal/views}/user/user_show.html | 0 {views => internal/views}/user/user_statistics.html | 0 {views => internal/views}/user/version_updated.html | 0 {views => internal/views}/workouts/workout_form.html | 0 {views => internal/views}/workouts/workouts_add.html | 0 {views => internal/views}/workouts/workouts_edit.html | 0 {views => internal/views}/workouts/workouts_list.html | 0 {views => internal/views}/workouts/workouts_route_segment.html | 0 {views => internal/views}/workouts/workouts_show.html | 0 main.go | 2 +- pkg/app/app_test.go | 2 +- 58 files changed, 2 insertions(+), 2 deletions(-) rename {views => internal/views}/address_results.html (100%) rename {views => internal/views}/admin/admin_root.html (100%) rename {views => internal/views}/admin/admin_user_edit.html (100%) rename {views => internal/views}/embed.go (100%) rename {views => internal/views}/embed_test.go (100%) rename {views => internal/views}/equipment/equipment_add.html (100%) rename {views => internal/views}/equipment/equipment_edit.html (100%) rename {views => internal/views}/equipment/equipment_list.html (100%) rename {views => internal/views}/equipment/equipment_show.html (100%) rename {views => internal/views}/partials/alerts.html (100%) rename {views => internal/views}/partials/equipment_actions.html (100%) rename {views => internal/views}/partials/footer.html (100%) rename {views => internal/views}/partials/head.html (100%) rename {views => internal/views}/partials/header.html (100%) rename {views => internal/views}/partials/language.html (100%) rename {views => internal/views}/partials/messages.html (100%) rename {views => internal/views}/partials/route_segment_actions.html (100%) rename {views => internal/views}/partials/route_segment_details.html (100%) rename {views => internal/views}/partials/route_segment_map.html (100%) rename {views => internal/views}/partials/route_segments_list_details.html (100%) rename {views => internal/views}/partials/snippet_date.html (100%) rename {views => internal/views}/partials/statistic_tile.html (100%) rename {views => internal/views}/partials/stats_records_distance.html (100%) rename {views => internal/views}/partials/stats_records_totals.html (100%) rename {views => internal/views}/partials/user_actions.html (100%) rename {views => internal/views}/partials/user_profile_calendar.html (100%) rename {views => internal/views}/partials/user_profile_language.html (100%) rename {views => internal/views}/partials/user_profile_preferred_units.html (100%) rename {views => internal/views}/partials/user_profile_timezone.html (100%) rename {views => internal/views}/partials/user_profile_totals_show.html (100%) rename {views => internal/views}/partials/version.html (100%) rename {views => internal/views}/partials/workout_actions.html (100%) rename {views => internal/views}/partials/workout_breakdown.html (100%) rename {views => internal/views}/partials/workout_details.html (100%) rename {views => internal/views}/partials/workout_item.html (100%) rename {views => internal/views}/partials/workout_map.html (100%) rename {views => internal/views}/partials/workout_point_title.html (100%) rename {views => internal/views}/partials/workout_route_segments.html (100%) rename {views => internal/views}/partials/workout_show_stats.html (100%) rename {views => internal/views}/partials/workout_social.html (100%) rename {views => internal/views}/partials/workouts_list_details.html (100%) rename {views => internal/views}/route_segments/route_segments_add.html (100%) rename {views => internal/views}/route_segments/route_segments_edit.html (100%) rename {views => internal/views}/route_segments/route_segments_list.html (100%) rename {views => internal/views}/route_segments/route_segments_show.html (100%) rename {views => internal/views}/user/user_login.html (100%) rename {views => internal/views}/user/user_profile.html (100%) rename {views => internal/views}/user/user_show.html (100%) rename {views => internal/views}/user/user_statistics.html (100%) rename {views => internal/views}/user/version_updated.html (100%) rename {views => internal/views}/workouts/workout_form.html (100%) rename {views => internal/views}/workouts/workouts_add.html (100%) rename {views => internal/views}/workouts/workouts_edit.html (100%) rename {views => internal/views}/workouts/workouts_list.html (100%) rename {views => internal/views}/workouts/workouts_route_segment.html (100%) rename {views => internal/views}/workouts/workouts_show.html (100%) diff --git a/views/address_results.html b/internal/views/address_results.html similarity index 100% rename from views/address_results.html rename to internal/views/address_results.html diff --git a/views/admin/admin_root.html b/internal/views/admin/admin_root.html similarity index 100% rename from views/admin/admin_root.html rename to internal/views/admin/admin_root.html diff --git a/views/admin/admin_user_edit.html b/internal/views/admin/admin_user_edit.html similarity index 100% rename from views/admin/admin_user_edit.html rename to internal/views/admin/admin_user_edit.html diff --git a/views/embed.go b/internal/views/embed.go similarity index 100% rename from views/embed.go rename to internal/views/embed.go diff --git a/views/embed_test.go b/internal/views/embed_test.go similarity index 100% rename from views/embed_test.go rename to internal/views/embed_test.go diff --git a/views/equipment/equipment_add.html b/internal/views/equipment/equipment_add.html similarity index 100% rename from views/equipment/equipment_add.html rename to internal/views/equipment/equipment_add.html diff --git a/views/equipment/equipment_edit.html b/internal/views/equipment/equipment_edit.html similarity index 100% rename from views/equipment/equipment_edit.html rename to internal/views/equipment/equipment_edit.html diff --git a/views/equipment/equipment_list.html b/internal/views/equipment/equipment_list.html similarity index 100% rename from views/equipment/equipment_list.html rename to internal/views/equipment/equipment_list.html diff --git a/views/equipment/equipment_show.html b/internal/views/equipment/equipment_show.html similarity index 100% rename from views/equipment/equipment_show.html rename to internal/views/equipment/equipment_show.html diff --git a/views/partials/alerts.html b/internal/views/partials/alerts.html similarity index 100% rename from views/partials/alerts.html rename to internal/views/partials/alerts.html diff --git a/views/partials/equipment_actions.html b/internal/views/partials/equipment_actions.html similarity index 100% rename from views/partials/equipment_actions.html rename to internal/views/partials/equipment_actions.html diff --git a/views/partials/footer.html b/internal/views/partials/footer.html similarity index 100% rename from views/partials/footer.html rename to internal/views/partials/footer.html diff --git a/views/partials/head.html b/internal/views/partials/head.html similarity index 100% rename from views/partials/head.html rename to internal/views/partials/head.html diff --git a/views/partials/header.html b/internal/views/partials/header.html similarity index 100% rename from views/partials/header.html rename to internal/views/partials/header.html diff --git a/views/partials/language.html b/internal/views/partials/language.html similarity index 100% rename from views/partials/language.html rename to internal/views/partials/language.html diff --git a/views/partials/messages.html b/internal/views/partials/messages.html similarity index 100% rename from views/partials/messages.html rename to internal/views/partials/messages.html diff --git a/views/partials/route_segment_actions.html b/internal/views/partials/route_segment_actions.html similarity index 100% rename from views/partials/route_segment_actions.html rename to internal/views/partials/route_segment_actions.html diff --git a/views/partials/route_segment_details.html b/internal/views/partials/route_segment_details.html similarity index 100% rename from views/partials/route_segment_details.html rename to internal/views/partials/route_segment_details.html diff --git a/views/partials/route_segment_map.html b/internal/views/partials/route_segment_map.html similarity index 100% rename from views/partials/route_segment_map.html rename to internal/views/partials/route_segment_map.html diff --git a/views/partials/route_segments_list_details.html b/internal/views/partials/route_segments_list_details.html similarity index 100% rename from views/partials/route_segments_list_details.html rename to internal/views/partials/route_segments_list_details.html diff --git a/views/partials/snippet_date.html b/internal/views/partials/snippet_date.html similarity index 100% rename from views/partials/snippet_date.html rename to internal/views/partials/snippet_date.html diff --git a/views/partials/statistic_tile.html b/internal/views/partials/statistic_tile.html similarity index 100% rename from views/partials/statistic_tile.html rename to internal/views/partials/statistic_tile.html diff --git a/views/partials/stats_records_distance.html b/internal/views/partials/stats_records_distance.html similarity index 100% rename from views/partials/stats_records_distance.html rename to internal/views/partials/stats_records_distance.html diff --git a/views/partials/stats_records_totals.html b/internal/views/partials/stats_records_totals.html similarity index 100% rename from views/partials/stats_records_totals.html rename to internal/views/partials/stats_records_totals.html diff --git a/views/partials/user_actions.html b/internal/views/partials/user_actions.html similarity index 100% rename from views/partials/user_actions.html rename to internal/views/partials/user_actions.html diff --git a/views/partials/user_profile_calendar.html b/internal/views/partials/user_profile_calendar.html similarity index 100% rename from views/partials/user_profile_calendar.html rename to internal/views/partials/user_profile_calendar.html diff --git a/views/partials/user_profile_language.html b/internal/views/partials/user_profile_language.html similarity index 100% rename from views/partials/user_profile_language.html rename to internal/views/partials/user_profile_language.html diff --git a/views/partials/user_profile_preferred_units.html b/internal/views/partials/user_profile_preferred_units.html similarity index 100% rename from views/partials/user_profile_preferred_units.html rename to internal/views/partials/user_profile_preferred_units.html diff --git a/views/partials/user_profile_timezone.html b/internal/views/partials/user_profile_timezone.html similarity index 100% rename from views/partials/user_profile_timezone.html rename to internal/views/partials/user_profile_timezone.html diff --git a/views/partials/user_profile_totals_show.html b/internal/views/partials/user_profile_totals_show.html similarity index 100% rename from views/partials/user_profile_totals_show.html rename to internal/views/partials/user_profile_totals_show.html diff --git a/views/partials/version.html b/internal/views/partials/version.html similarity index 100% rename from views/partials/version.html rename to internal/views/partials/version.html diff --git a/views/partials/workout_actions.html b/internal/views/partials/workout_actions.html similarity index 100% rename from views/partials/workout_actions.html rename to internal/views/partials/workout_actions.html diff --git a/views/partials/workout_breakdown.html b/internal/views/partials/workout_breakdown.html similarity index 100% rename from views/partials/workout_breakdown.html rename to internal/views/partials/workout_breakdown.html diff --git a/views/partials/workout_details.html b/internal/views/partials/workout_details.html similarity index 100% rename from views/partials/workout_details.html rename to internal/views/partials/workout_details.html diff --git a/views/partials/workout_item.html b/internal/views/partials/workout_item.html similarity index 100% rename from views/partials/workout_item.html rename to internal/views/partials/workout_item.html diff --git a/views/partials/workout_map.html b/internal/views/partials/workout_map.html similarity index 100% rename from views/partials/workout_map.html rename to internal/views/partials/workout_map.html diff --git a/views/partials/workout_point_title.html b/internal/views/partials/workout_point_title.html similarity index 100% rename from views/partials/workout_point_title.html rename to internal/views/partials/workout_point_title.html diff --git a/views/partials/workout_route_segments.html b/internal/views/partials/workout_route_segments.html similarity index 100% rename from views/partials/workout_route_segments.html rename to internal/views/partials/workout_route_segments.html diff --git a/views/partials/workout_show_stats.html b/internal/views/partials/workout_show_stats.html similarity index 100% rename from views/partials/workout_show_stats.html rename to internal/views/partials/workout_show_stats.html diff --git a/views/partials/workout_social.html b/internal/views/partials/workout_social.html similarity index 100% rename from views/partials/workout_social.html rename to internal/views/partials/workout_social.html diff --git a/views/partials/workouts_list_details.html b/internal/views/partials/workouts_list_details.html similarity index 100% rename from views/partials/workouts_list_details.html rename to internal/views/partials/workouts_list_details.html diff --git a/views/route_segments/route_segments_add.html b/internal/views/route_segments/route_segments_add.html similarity index 100% rename from views/route_segments/route_segments_add.html rename to internal/views/route_segments/route_segments_add.html diff --git a/views/route_segments/route_segments_edit.html b/internal/views/route_segments/route_segments_edit.html similarity index 100% rename from views/route_segments/route_segments_edit.html rename to internal/views/route_segments/route_segments_edit.html diff --git a/views/route_segments/route_segments_list.html b/internal/views/route_segments/route_segments_list.html similarity index 100% rename from views/route_segments/route_segments_list.html rename to internal/views/route_segments/route_segments_list.html diff --git a/views/route_segments/route_segments_show.html b/internal/views/route_segments/route_segments_show.html similarity index 100% rename from views/route_segments/route_segments_show.html rename to internal/views/route_segments/route_segments_show.html diff --git a/views/user/user_login.html b/internal/views/user/user_login.html similarity index 100% rename from views/user/user_login.html rename to internal/views/user/user_login.html diff --git a/views/user/user_profile.html b/internal/views/user/user_profile.html similarity index 100% rename from views/user/user_profile.html rename to internal/views/user/user_profile.html diff --git a/views/user/user_show.html b/internal/views/user/user_show.html similarity index 100% rename from views/user/user_show.html rename to internal/views/user/user_show.html diff --git a/views/user/user_statistics.html b/internal/views/user/user_statistics.html similarity index 100% rename from views/user/user_statistics.html rename to internal/views/user/user_statistics.html diff --git a/views/user/version_updated.html b/internal/views/user/version_updated.html similarity index 100% rename from views/user/version_updated.html rename to internal/views/user/version_updated.html diff --git a/views/workouts/workout_form.html b/internal/views/workouts/workout_form.html similarity index 100% rename from views/workouts/workout_form.html rename to internal/views/workouts/workout_form.html diff --git a/views/workouts/workouts_add.html b/internal/views/workouts/workouts_add.html similarity index 100% rename from views/workouts/workouts_add.html rename to internal/views/workouts/workouts_add.html diff --git a/views/workouts/workouts_edit.html b/internal/views/workouts/workouts_edit.html similarity index 100% rename from views/workouts/workouts_edit.html rename to internal/views/workouts/workouts_edit.html diff --git a/views/workouts/workouts_list.html b/internal/views/workouts/workouts_list.html similarity index 100% rename from views/workouts/workouts_list.html rename to internal/views/workouts/workouts_list.html diff --git a/views/workouts/workouts_route_segment.html b/internal/views/workouts/workouts_route_segment.html similarity index 100% rename from views/workouts/workouts_route_segment.html rename to internal/views/workouts/workouts_route_segment.html diff --git a/views/workouts/workouts_show.html b/internal/views/workouts/workouts_show.html similarity index 100% rename from views/workouts/workouts_show.html rename to internal/views/workouts/workouts_show.html diff --git a/main.go b/main.go index 22ed9b90..d7cc3741 100644 --- a/main.go +++ b/main.go @@ -2,9 +2,9 @@ package main import ( appassets "github.com/jovandeginste/workout-tracker/assets" + appviews "github.com/jovandeginste/workout-tracker/internal/views" "github.com/jovandeginste/workout-tracker/pkg/app" apptranslations "github.com/jovandeginste/workout-tracker/translations" - appviews "github.com/jovandeginste/workout-tracker/views" ) var ( diff --git a/pkg/app/app_test.go b/pkg/app/app_test.go index ca6195cd..11195190 100644 --- a/pkg/app/app_test.go +++ b/pkg/app/app_test.go @@ -6,8 +6,8 @@ import ( "github.com/fsouza/slognil" appassets "github.com/jovandeginste/workout-tracker/assets" + appviews "github.com/jovandeginste/workout-tracker/internal/views" apptranslations "github.com/jovandeginste/workout-tracker/translations" - appviews "github.com/jovandeginste/workout-tracker/views" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) From ea4e1ebab14a21939da2be4519a3809334dab782 Mon Sep 17 00:00:00 2001 From: monirzadeh <25131576+Monirzadeh@users.noreply.github.com> Date: Mon, 2 Sep 2024 00:29:52 +0330 Subject: [PATCH 2/8] move assets under view update gitignore and Dockerfile --- .gitignore | 2 +- Dockerfile | 12 +++---- Makefile | 34 +++++++++--------- {assets => internal/views/assets}/common.js | 0 .../views/assets}/dumbbell.png | Bin {assets => internal/views/assets}/embed.go | 0 .../views/assets}/embed_test.go | 0 {assets => internal/views/assets}/map.js | 0 {assets => internal/views/assets}/output.css | 0 .../views/assets}/route_segments.js | 0 main.go | 2 +- pkg/app/app_test.go | 2 +- tailwind.config.js | 2 +- 13 files changed, 27 insertions(+), 27 deletions(-) rename {assets => internal/views/assets}/common.js (100%) rename {assets => internal/views/assets}/dumbbell.png (100%) rename {assets => internal/views/assets}/embed.go (100%) rename {assets => internal/views/assets}/embed_test.go (100%) rename {assets => internal/views/assets}/map.js (100%) rename {assets => internal/views/assets}/output.css (100%) rename {assets => internal/views/assets}/route_segments.js (100%) diff --git a/.gitignore b/.gitignore index afe7ed4a..68677ba2 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,5 @@ node_modules/ workout-tracker.yaml /workout-tracker coverage.out -/assets/dist/ +/internal/views/assets/dist/ .aider* diff --git a/Dockerfile b/Dockerfile index cf8833e9..ae5be76b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,8 @@ RUN make install-deps COPY tailwind.config.js ./tailwind.config.js COPY main.css ./main.css COPY pkg ./pkg -COPY views ./views -COPY assets ./assets +COPY internal/views ./internal/views +COPY internal/views/assets ./internal/views/assets RUN make build-dist build-tw @@ -29,11 +29,11 @@ RUN go mod download COPY main.go ./main.go COPY pkg ./pkg COPY vendor ./vendor -COPY views ./views -COPY assets ./assets +COPY internal/views ./internal/views +COPY internal/views/assets ./internal/views/assets COPY translations ./translations -COPY --from=frontend /app/assets/output.css ./assets/output.css -COPY --from=frontend /app/assets/dist ./assets/dist +COPY --from=frontend /app/internal/views/assets/output.css ./internal/views/assets/output.css +COPY --from=frontend /app/internal/views/assets/dist ./internal/views/assets/dist ENV CGO_ENABLED=0 RUN go build \ diff --git a/Makefile b/Makefile index b5fe046f..fc9a1e33 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,8 @@ install-deps: npm install clean: - rm -fv ./assets/output.css ./workout-tracker - rm -rf ./tmp/ ./node_modules/ ./assets/dist/ + rm -fv ./internal/views/assets/output.css ./workout-tracker + rm -rf ./tmp/ ./node_modules/ ./internal/views/assets/dist/ dev: air @@ -50,32 +50,32 @@ swagger: --generalInfo api_handlers.go build-tw: - npx tailwindcss -i ./main.css -o ./assets/output.css + npx tailwindcss -i ./main.css -o ./internal/views/assets/output.css clean-dist: - rm -rf ./assets/dist/ + rm -rf ./internal/views/assets/dist/ build-dist: clean-dist - mkdir -p ./assets/dist/images - cp -v ./node_modules/fullcalendar/index.global.min.js ./assets/dist/fullcalendar.min.js - cp -v ./node_modules/leaflet/dist/leaflet.css ./assets/dist/ - cp -v ./node_modules/leaflet/dist/images/* ./assets/dist/images/ - cp -v ./node_modules/leaflet/dist/leaflet.js ./assets/dist/ - cp -v ./node_modules/shareon/dist/shareon.iife.js ./assets/dist/ - cp -v ./node_modules/shareon/dist/shareon.min.css ./assets/dist/ - cp -R ./node_modules/@fortawesome/fontawesome-free/ ./assets/dist/fontawesome/ - cp -v ./node_modules/apexcharts/dist/apexcharts.min.js ./assets/dist/ - cp -v ./node_modules/apexcharts/dist/apexcharts.css ./assets/dist/ - cp -v ./node_modules/htmx.org/dist/htmx.min.js ./assets/dist/ + mkdir -p ./internal/views/assets/dist/images + cp -v ./node_modules/fullcalendar/index.global.min.js ./internal/views/assets/dist/fullcalendar.min.js + cp -v ./node_modules/leaflet/dist/leaflet.css ./internal/views/assets/dist/ + cp -v ./node_modules/leaflet/dist/images/* ./internal/views/assets/dist/images/ + cp -v ./node_modules/leaflet/dist/leaflet.js ./internal/views/assets/dist/ + cp -v ./node_modules/shareon/dist/shareon.iife.js ./internal/views/assets/dist/ + cp -v ./node_modules/shareon/dist/shareon.min.css ./internal/views/assets/dist/ + cp -R ./node_modules/@fortawesome/fontawesome-free/ ./internal/views/assets/dist/fontawesome/ + cp -v ./node_modules/apexcharts/dist/apexcharts.min.js ./internal/views/assets/dist/ + cp -v ./node_modules/apexcharts/dist/apexcharts.css ./internal/views/assets/dist/ + cp -v ./node_modules/htmx.org/dist/htmx.min.js ./internal/views/assets/dist/ watch-tw: - npx tailwindcss -i ./main.css -o ./assets/output.css --watch + npx tailwindcss -i ./main.css -o ./internal/views/assets/output.css --watch build-translations: translations translations: - xspreak -o translations/en.json -f json --template-keyword "i18n" -t "views/**/*.html" + xspreak -o translations/en.json -f json --template-keyword "i18n" -t "internal/views/**/*.html" prettier --write translations/*.json serve: diff --git a/assets/common.js b/internal/views/assets/common.js similarity index 100% rename from assets/common.js rename to internal/views/assets/common.js diff --git a/assets/dumbbell.png b/internal/views/assets/dumbbell.png similarity index 100% rename from assets/dumbbell.png rename to internal/views/assets/dumbbell.png diff --git a/assets/embed.go b/internal/views/assets/embed.go similarity index 100% rename from assets/embed.go rename to internal/views/assets/embed.go diff --git a/assets/embed_test.go b/internal/views/assets/embed_test.go similarity index 100% rename from assets/embed_test.go rename to internal/views/assets/embed_test.go diff --git a/assets/map.js b/internal/views/assets/map.js similarity index 100% rename from assets/map.js rename to internal/views/assets/map.js diff --git a/assets/output.css b/internal/views/assets/output.css similarity index 100% rename from assets/output.css rename to internal/views/assets/output.css diff --git a/assets/route_segments.js b/internal/views/assets/route_segments.js similarity index 100% rename from assets/route_segments.js rename to internal/views/assets/route_segments.js diff --git a/main.go b/main.go index d7cc3741..22faae51 100644 --- a/main.go +++ b/main.go @@ -1,8 +1,8 @@ package main import ( - appassets "github.com/jovandeginste/workout-tracker/assets" appviews "github.com/jovandeginste/workout-tracker/internal/views" + appassets "github.com/jovandeginste/workout-tracker/internal/views/assets" "github.com/jovandeginste/workout-tracker/pkg/app" apptranslations "github.com/jovandeginste/workout-tracker/translations" ) diff --git a/pkg/app/app_test.go b/pkg/app/app_test.go index 11195190..07970b5a 100644 --- a/pkg/app/app_test.go +++ b/pkg/app/app_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/fsouza/slognil" - appassets "github.com/jovandeginste/workout-tracker/assets" appviews "github.com/jovandeginste/workout-tracker/internal/views" + appassets "github.com/jovandeginste/workout-tracker/internal/views/assets" apptranslations "github.com/jovandeginste/workout-tracker/translations" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/tailwind.config.js b/tailwind.config.js index cc7557af..863e4e33 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,6 +1,6 @@ /** @type {import('tailwindcss').Config} */ module.exports = { - content: ["./{assets,views}/**/*.{html,js}", "./pkg/templatehelpers/*.go"], + content: ["./internal/views/assets/**/*.{html,js}","./internal/views/**/*.{html,js}", "./pkg/templatehelpers/*.go"], theme: { extend: {}, }, From ef12c87c5e5146e9adb0894a9dc96b0f6cf521cd Mon Sep 17 00:00:00 2001 From: monirzadeh <25131576+Monirzadeh@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:31:05 +0330 Subject: [PATCH 3/8] move pkg to internal in first step --- {pkg => internal/pkg}/app/admin_data.go | 2 +- {pkg => internal/pkg}/app/admin_handlers.go | 2 +- {pkg => internal/pkg}/app/alerts.go | 0 {pkg => internal/pkg}/app/api_handlers.go | 4 ++-- {pkg => internal/pkg}/app/app.go | 4 ++-- {pkg => internal/pkg}/app/app_test.go | 0 {pkg => internal/pkg}/app/auth.go | 2 +- {pkg => internal/pkg}/app/background.go | 2 +- {pkg => internal/pkg}/app/config.go | 0 {pkg => internal/pkg}/app/data.go | 2 +- {pkg => internal/pkg}/app/equipment_handlers.go | 2 +- {pkg => internal/pkg}/app/gpx.go | 0 {pkg => internal/pkg}/app/handlers.go | 2 +- {pkg => internal/pkg}/app/i18n.go | 2 +- {pkg => internal/pkg}/app/route_segments_handlers.go | 2 +- {pkg => internal/pkg}/app/routes.go | 0 {pkg => internal/pkg}/app/routes_test.go | 2 +- {pkg => internal/pkg}/app/self_handlers.go | 2 +- {pkg => internal/pkg}/app/templates.go | 4 ++-- {pkg => internal/pkg}/app/users_handlers.go | 2 +- {pkg => internal/pkg}/app/workouts.go | 4 ++-- {pkg => internal/pkg}/app/workouts_handlers.go | 2 +- {pkg => internal/pkg}/converters/fit.go | 0 {pkg => internal/pkg}/converters/gpx.go | 0 {pkg => internal/pkg}/converters/parse.go | 0 {pkg => internal/pkg}/converters/tcx.go | 0 {pkg => internal/pkg}/database/config.go | 0 {pkg => internal/pkg}/database/equipment.go | 0 {pkg => internal/pkg}/database/extra_metrics.go | 0 {pkg => internal/pkg}/database/gorm.go | 0 {pkg => internal/pkg}/database/gorm_test.go | 0 {pkg => internal/pkg}/database/gpx_sample_1_test.go | 0 {pkg => internal/pkg}/database/gpx_samples_test.go | 0 {pkg => internal/pkg}/database/profile.go | 2 +- {pkg => internal/pkg}/database/route_segment_matching.go | 0 {pkg => internal/pkg}/database/route_segments.go | 2 +- {pkg => internal/pkg}/database/statistics.go | 0 {pkg => internal/pkg}/database/user.go | 0 {pkg => internal/pkg}/database/user_statistics.go | 0 {pkg => internal/pkg}/database/user_test.go | 0 {pkg => internal/pkg}/database/workout_met.go | 0 {pkg => internal/pkg}/database/workout_type.go | 2 +- {pkg => internal/pkg}/database/workout_type_test.go | 0 {pkg => internal/pkg}/database/workouts.go | 2 +- {pkg => internal/pkg}/database/workouts_map.go | 4 ++-- {pkg => internal/pkg}/database/workouts_statistics.go | 2 +- {pkg => internal/pkg}/database/workouts_statistics_test.go | 0 {pkg => internal/pkg}/database/workouts_test.go | 0 {pkg => internal/pkg}/geocoder/reverse.go | 0 {pkg => internal/pkg}/importers/fitotrack.go | 0 {pkg => internal/pkg}/importers/generic.go | 0 {pkg => internal/pkg}/importers/importer.go | 0 {pkg => internal/pkg}/templatehelpers/duration.go | 0 {pkg => internal/pkg}/templatehelpers/duration_test.go | 0 {pkg => internal/pkg}/templatehelpers/icons.go | 0 {pkg => internal/pkg}/templatehelpers/icons_test.go | 0 {pkg => internal/pkg}/templatehelpers/imperial.go | 0 {pkg => internal/pkg}/templatehelpers/metric.go | 0 {pkg => internal/pkg}/templatehelpers/template_funcs.go | 0 {pkg => internal/pkg}/templatehelpers/template_funcs_test.go | 0 main.go | 2 +- 61 files changed, 29 insertions(+), 29 deletions(-) rename {pkg => internal/pkg}/app/admin_data.go (87%) rename {pkg => internal/pkg}/app/admin_handlers.go (97%) rename {pkg => internal/pkg}/app/alerts.go (100%) rename {pkg => internal/pkg}/app/api_handlers.go (98%) rename {pkg => internal/pkg}/app/app.go (96%) rename {pkg => internal/pkg}/app/app_test.go (100%) rename {pkg => internal/pkg}/app/auth.go (93%) rename {pkg => internal/pkg}/app/background.go (99%) rename {pkg => internal/pkg}/app/config.go (100%) rename {pkg => internal/pkg}/app/data.go (97%) rename {pkg => internal/pkg}/app/equipment_handlers.go (98%) rename {pkg => internal/pkg}/app/gpx.go (100%) rename {pkg => internal/pkg}/app/handlers.go (96%) rename {pkg => internal/pkg}/app/i18n.go (97%) rename {pkg => internal/pkg}/app/route_segments_handlers.go (98%) rename {pkg => internal/pkg}/app/routes.go (100%) rename {pkg => internal/pkg}/app/routes_test.go (98%) rename {pkg => internal/pkg}/app/self_handlers.go (97%) rename {pkg => internal/pkg}/app/templates.go (96%) rename {pkg => internal/pkg}/app/users_handlers.go (97%) rename {pkg => internal/pkg}/app/workouts.go (97%) rename {pkg => internal/pkg}/app/workouts_handlers.go (98%) rename {pkg => internal/pkg}/converters/fit.go (100%) rename {pkg => internal/pkg}/converters/gpx.go (100%) rename {pkg => internal/pkg}/converters/parse.go (100%) rename {pkg => internal/pkg}/converters/tcx.go (100%) rename {pkg => internal/pkg}/database/config.go (100%) rename {pkg => internal/pkg}/database/equipment.go (100%) rename {pkg => internal/pkg}/database/extra_metrics.go (100%) rename {pkg => internal/pkg}/database/gorm.go (100%) rename {pkg => internal/pkg}/database/gorm_test.go (100%) rename {pkg => internal/pkg}/database/gpx_sample_1_test.go (100%) rename {pkg => internal/pkg}/database/gpx_samples_test.go (100%) rename {pkg => internal/pkg}/database/profile.go (97%) rename {pkg => internal/pkg}/database/route_segment_matching.go (100%) rename {pkg => internal/pkg}/database/route_segments.go (98%) rename {pkg => internal/pkg}/database/statistics.go (100%) rename {pkg => internal/pkg}/database/user.go (100%) rename {pkg => internal/pkg}/database/user_statistics.go (100%) rename {pkg => internal/pkg}/database/user_test.go (100%) rename {pkg => internal/pkg}/database/workout_met.go (100%) rename {pkg => internal/pkg}/database/workout_type.go (98%) rename {pkg => internal/pkg}/database/workout_type_test.go (100%) rename {pkg => internal/pkg}/database/workouts.go (99%) rename {pkg => internal/pkg}/database/workouts_map.go (98%) rename {pkg => internal/pkg}/database/workouts_statistics.go (98%) rename {pkg => internal/pkg}/database/workouts_statistics_test.go (100%) rename {pkg => internal/pkg}/database/workouts_test.go (100%) rename {pkg => internal/pkg}/geocoder/reverse.go (100%) rename {pkg => internal/pkg}/importers/fitotrack.go (100%) rename {pkg => internal/pkg}/importers/generic.go (100%) rename {pkg => internal/pkg}/importers/importer.go (100%) rename {pkg => internal/pkg}/templatehelpers/duration.go (100%) rename {pkg => internal/pkg}/templatehelpers/duration_test.go (100%) rename {pkg => internal/pkg}/templatehelpers/icons.go (100%) rename {pkg => internal/pkg}/templatehelpers/icons_test.go (100%) rename {pkg => internal/pkg}/templatehelpers/imperial.go (100%) rename {pkg => internal/pkg}/templatehelpers/metric.go (100%) rename {pkg => internal/pkg}/templatehelpers/template_funcs.go (100%) rename {pkg => internal/pkg}/templatehelpers/template_funcs_test.go (100%) diff --git a/pkg/app/admin_data.go b/internal/pkg/app/admin_data.go similarity index 87% rename from pkg/app/admin_data.go rename to internal/pkg/app/admin_data.go index 27a895d7..62a9fdd4 100644 --- a/pkg/app/admin_data.go +++ b/internal/pkg/app/admin_data.go @@ -3,7 +3,7 @@ package app import ( "strconv" - "github.com/jovandeginste/workout-tracker/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/pkg/database" "github.com/labstack/echo/v4" ) diff --git a/pkg/app/admin_handlers.go b/internal/pkg/app/admin_handlers.go similarity index 97% rename from pkg/app/admin_handlers.go rename to internal/pkg/app/admin_handlers.go index b50b54fd..5e34eaca 100644 --- a/pkg/app/admin_handlers.go +++ b/internal/pkg/app/admin_handlers.go @@ -3,7 +3,7 @@ package app import ( "net/http" - "github.com/jovandeginste/workout-tracker/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/pkg/database" "github.com/labstack/echo/v4" ) diff --git a/pkg/app/alerts.go b/internal/pkg/app/alerts.go similarity index 100% rename from pkg/app/alerts.go rename to internal/pkg/app/alerts.go diff --git a/pkg/app/api_handlers.go b/internal/pkg/app/api_handlers.go similarity index 98% rename from pkg/app/api_handlers.go rename to internal/pkg/app/api_handlers.go index bdbd4198..818d44ae 100644 --- a/pkg/app/api_handlers.go +++ b/internal/pkg/app/api_handlers.go @@ -5,8 +5,8 @@ import ( "net/http" "strconv" - "github.com/jovandeginste/workout-tracker/pkg/database" - "github.com/jovandeginste/workout-tracker/pkg/importers" + "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/pkg/importers" echojwt "github.com/labstack/echo-jwt/v4" "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" diff --git a/pkg/app/app.go b/internal/pkg/app/app.go similarity index 96% rename from pkg/app/app.go rename to internal/pkg/app/app.go index 349c7ff5..6d3b2282 100644 --- a/pkg/app/app.go +++ b/internal/pkg/app/app.go @@ -11,8 +11,8 @@ import ( "github.com/alexedwards/scs/v2" "github.com/cat-dealer/go-rand/v2" "github.com/fsouza/slognil" - "github.com/jovandeginste/workout-tracker/pkg/database" - "github.com/jovandeginste/workout-tracker/pkg/geocoder" + "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/pkg/geocoder" "github.com/labstack/echo/v4" "github.com/lmittmann/tint" "github.com/mattn/go-isatty" diff --git a/pkg/app/app_test.go b/internal/pkg/app/app_test.go similarity index 100% rename from pkg/app/app_test.go rename to internal/pkg/app/app_test.go diff --git a/pkg/app/auth.go b/internal/pkg/app/auth.go similarity index 93% rename from pkg/app/auth.go rename to internal/pkg/app/auth.go index 76dd3952..716e5fd9 100644 --- a/pkg/app/auth.go +++ b/internal/pkg/app/auth.go @@ -6,7 +6,7 @@ import ( "time" "github.com/golang-jwt/jwt/v5" - "github.com/jovandeginste/workout-tracker/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/pkg/database" "github.com/labstack/echo/v4" ) diff --git a/pkg/app/background.go b/internal/pkg/app/background.go similarity index 99% rename from pkg/app/background.go rename to internal/pkg/app/background.go index 7d75a506..5d369567 100644 --- a/pkg/app/background.go +++ b/internal/pkg/app/background.go @@ -8,7 +8,7 @@ import ( "path/filepath" "time" - "github.com/jovandeginste/workout-tracker/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/pkg/database" "gorm.io/gorm" ) diff --git a/pkg/app/config.go b/internal/pkg/app/config.go similarity index 100% rename from pkg/app/config.go rename to internal/pkg/app/config.go diff --git a/pkg/app/data.go b/internal/pkg/app/data.go similarity index 97% rename from pkg/app/data.go rename to internal/pkg/app/data.go index 6c8daf58..3122aefb 100644 --- a/pkg/app/data.go +++ b/internal/pkg/app/data.go @@ -4,7 +4,7 @@ import ( "strconv" "github.com/golang-jwt/jwt/v5" - "github.com/jovandeginste/workout-tracker/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/pkg/database" "github.com/labstack/echo/v4" ) diff --git a/pkg/app/equipment_handlers.go b/internal/pkg/app/equipment_handlers.go similarity index 98% rename from pkg/app/equipment_handlers.go rename to internal/pkg/app/equipment_handlers.go index 57850a6a..70d8d9bb 100644 --- a/pkg/app/equipment_handlers.go +++ b/internal/pkg/app/equipment_handlers.go @@ -4,7 +4,7 @@ import ( "net/http" "strconv" - "github.com/jovandeginste/workout-tracker/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/pkg/database" "github.com/labstack/echo/v4" ) diff --git a/pkg/app/gpx.go b/internal/pkg/app/gpx.go similarity index 100% rename from pkg/app/gpx.go rename to internal/pkg/app/gpx.go diff --git a/pkg/app/handlers.go b/internal/pkg/app/handlers.go similarity index 96% rename from pkg/app/handlers.go rename to internal/pkg/app/handlers.go index 363bb7a5..29fd6fd7 100644 --- a/pkg/app/handlers.go +++ b/internal/pkg/app/handlers.go @@ -5,7 +5,7 @@ import ( "errors" "net/http" - "github.com/jovandeginste/workout-tracker/pkg/geocoder" + "github.com/jovandeginste/workout-tracker/internal/pkg/geocoder" "github.com/labstack/echo/v4" ) diff --git a/pkg/app/i18n.go b/internal/pkg/app/i18n.go similarity index 97% rename from pkg/app/i18n.go rename to internal/pkg/app/i18n.go index b4302d96..349f0fc0 100644 --- a/pkg/app/i18n.go +++ b/internal/pkg/app/i18n.go @@ -1,7 +1,7 @@ package app import ( - "github.com/jovandeginste/workout-tracker/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/pkg/database" "github.com/labstack/echo/v4" "github.com/vorlif/spreak" "github.com/vorlif/spreak/humanize" diff --git a/pkg/app/route_segments_handlers.go b/internal/pkg/app/route_segments_handlers.go similarity index 98% rename from pkg/app/route_segments_handlers.go rename to internal/pkg/app/route_segments_handlers.go index 9c729746..a18f008c 100644 --- a/pkg/app/route_segments_handlers.go +++ b/internal/pkg/app/route_segments_handlers.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/jovandeginste/workout-tracker/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/pkg/database" "github.com/labstack/echo/v4" ) diff --git a/pkg/app/routes.go b/internal/pkg/app/routes.go similarity index 100% rename from pkg/app/routes.go rename to internal/pkg/app/routes.go diff --git a/pkg/app/routes_test.go b/internal/pkg/app/routes_test.go similarity index 98% rename from pkg/app/routes_test.go rename to internal/pkg/app/routes_test.go index 30df5581..0cbde404 100644 --- a/pkg/app/routes_test.go +++ b/internal/pkg/app/routes_test.go @@ -5,7 +5,7 @@ import ( "net/http/httptest" "testing" - "github.com/jovandeginste/workout-tracker/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/pkg/database" session "github.com/spazzymoto/echo-scs-session" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/app/self_handlers.go b/internal/pkg/app/self_handlers.go similarity index 97% rename from pkg/app/self_handlers.go rename to internal/pkg/app/self_handlers.go index e541bbe9..aadb5999 100644 --- a/pkg/app/self_handlers.go +++ b/internal/pkg/app/self_handlers.go @@ -3,7 +3,7 @@ package app import ( "net/http" - "github.com/jovandeginste/workout-tracker/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/pkg/database" "github.com/labstack/echo/v4" ) diff --git a/pkg/app/templates.go b/internal/pkg/app/templates.go similarity index 96% rename from pkg/app/templates.go rename to internal/pkg/app/templates.go index 73c69137..f1d14769 100644 --- a/pkg/app/templates.go +++ b/internal/pkg/app/templates.go @@ -9,8 +9,8 @@ import ( "time" "github.com/Masterminds/sprig/v3" - "github.com/jovandeginste/workout-tracker/pkg/database" - "github.com/jovandeginste/workout-tracker/pkg/templatehelpers" + "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/pkg/templatehelpers" "github.com/labstack/echo/v4" "github.com/labstack/gommon/log" "github.com/vorlif/spreak/humanize" diff --git a/pkg/app/users_handlers.go b/internal/pkg/app/users_handlers.go similarity index 97% rename from pkg/app/users_handlers.go rename to internal/pkg/app/users_handlers.go index 52f311a4..e165d932 100644 --- a/pkg/app/users_handlers.go +++ b/internal/pkg/app/users_handlers.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - "github.com/jovandeginste/workout-tracker/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/pkg/database" "github.com/labstack/echo/v4" ) diff --git a/pkg/app/workouts.go b/internal/pkg/app/workouts.go similarity index 97% rename from pkg/app/workouts.go rename to internal/pkg/app/workouts.go index 7730ff1d..093af71c 100644 --- a/pkg/app/workouts.go +++ b/internal/pkg/app/workouts.go @@ -7,8 +7,8 @@ import ( "strings" "time" - "github.com/jovandeginste/workout-tracker/pkg/database" - "github.com/jovandeginste/workout-tracker/pkg/geocoder" + "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/pkg/geocoder" "github.com/labstack/echo/v4" ) diff --git a/pkg/app/workouts_handlers.go b/internal/pkg/app/workouts_handlers.go similarity index 98% rename from pkg/app/workouts_handlers.go rename to internal/pkg/app/workouts_handlers.go index 037c92e6..bf4dd6f2 100644 --- a/pkg/app/workouts_handlers.go +++ b/internal/pkg/app/workouts_handlers.go @@ -8,7 +8,7 @@ import ( "strconv" "time" - "github.com/jovandeginste/workout-tracker/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/pkg/database" "github.com/labstack/echo/v4" ) diff --git a/pkg/converters/fit.go b/internal/pkg/converters/fit.go similarity index 100% rename from pkg/converters/fit.go rename to internal/pkg/converters/fit.go diff --git a/pkg/converters/gpx.go b/internal/pkg/converters/gpx.go similarity index 100% rename from pkg/converters/gpx.go rename to internal/pkg/converters/gpx.go diff --git a/pkg/converters/parse.go b/internal/pkg/converters/parse.go similarity index 100% rename from pkg/converters/parse.go rename to internal/pkg/converters/parse.go diff --git a/pkg/converters/tcx.go b/internal/pkg/converters/tcx.go similarity index 100% rename from pkg/converters/tcx.go rename to internal/pkg/converters/tcx.go diff --git a/pkg/database/config.go b/internal/pkg/database/config.go similarity index 100% rename from pkg/database/config.go rename to internal/pkg/database/config.go diff --git a/pkg/database/equipment.go b/internal/pkg/database/equipment.go similarity index 100% rename from pkg/database/equipment.go rename to internal/pkg/database/equipment.go diff --git a/pkg/database/extra_metrics.go b/internal/pkg/database/extra_metrics.go similarity index 100% rename from pkg/database/extra_metrics.go rename to internal/pkg/database/extra_metrics.go diff --git a/pkg/database/gorm.go b/internal/pkg/database/gorm.go similarity index 100% rename from pkg/database/gorm.go rename to internal/pkg/database/gorm.go diff --git a/pkg/database/gorm_test.go b/internal/pkg/database/gorm_test.go similarity index 100% rename from pkg/database/gorm_test.go rename to internal/pkg/database/gorm_test.go diff --git a/pkg/database/gpx_sample_1_test.go b/internal/pkg/database/gpx_sample_1_test.go similarity index 100% rename from pkg/database/gpx_sample_1_test.go rename to internal/pkg/database/gpx_sample_1_test.go diff --git a/pkg/database/gpx_samples_test.go b/internal/pkg/database/gpx_samples_test.go similarity index 100% rename from pkg/database/gpx_samples_test.go rename to internal/pkg/database/gpx_samples_test.go diff --git a/pkg/database/profile.go b/internal/pkg/database/profile.go similarity index 97% rename from pkg/database/profile.go rename to internal/pkg/database/profile.go index 8d690fd1..ce7a01c6 100644 --- a/pkg/database/profile.go +++ b/internal/pkg/database/profile.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/jovandeginste/workout-tracker/pkg/templatehelpers" + "github.com/jovandeginste/workout-tracker/internal/pkg/templatehelpers" "gorm.io/gorm" ) diff --git a/pkg/database/route_segment_matching.go b/internal/pkg/database/route_segment_matching.go similarity index 100% rename from pkg/database/route_segment_matching.go rename to internal/pkg/database/route_segment_matching.go diff --git a/pkg/database/route_segments.go b/internal/pkg/database/route_segments.go similarity index 98% rename from pkg/database/route_segments.go rename to internal/pkg/database/route_segments.go index d3313815..bfabb207 100644 --- a/pkg/database/route_segments.go +++ b/internal/pkg/database/route_segments.go @@ -11,7 +11,7 @@ import ( "github.com/gomarkdown/markdown" "github.com/gomarkdown/markdown/html" "github.com/gomarkdown/markdown/parser" - "github.com/jovandeginste/workout-tracker/pkg/converters" + "github.com/jovandeginste/workout-tracker/internal/pkg/converters" "github.com/microcosm-cc/bluemonday" "github.com/tkrajina/gpxgo/gpx" "gorm.io/gorm" diff --git a/pkg/database/statistics.go b/internal/pkg/database/statistics.go similarity index 100% rename from pkg/database/statistics.go rename to internal/pkg/database/statistics.go diff --git a/pkg/database/user.go b/internal/pkg/database/user.go similarity index 100% rename from pkg/database/user.go rename to internal/pkg/database/user.go diff --git a/pkg/database/user_statistics.go b/internal/pkg/database/user_statistics.go similarity index 100% rename from pkg/database/user_statistics.go rename to internal/pkg/database/user_statistics.go diff --git a/pkg/database/user_test.go b/internal/pkg/database/user_test.go similarity index 100% rename from pkg/database/user_test.go rename to internal/pkg/database/user_test.go diff --git a/pkg/database/workout_met.go b/internal/pkg/database/workout_met.go similarity index 100% rename from pkg/database/workout_met.go rename to internal/pkg/database/workout_met.go diff --git a/pkg/database/workout_type.go b/internal/pkg/database/workout_type.go similarity index 98% rename from pkg/database/workout_type.go rename to internal/pkg/database/workout_type.go index a5b51a34..c3f2cc97 100644 --- a/pkg/database/workout_type.go +++ b/internal/pkg/database/workout_type.go @@ -5,7 +5,7 @@ import ( "html/template" "slices" - "github.com/jovandeginste/workout-tracker/pkg/templatehelpers" + "github.com/jovandeginste/workout-tracker/internal/pkg/templatehelpers" ) type ( diff --git a/pkg/database/workout_type_test.go b/internal/pkg/database/workout_type_test.go similarity index 100% rename from pkg/database/workout_type_test.go rename to internal/pkg/database/workout_type_test.go diff --git a/pkg/database/workouts.go b/internal/pkg/database/workouts.go similarity index 99% rename from pkg/database/workouts.go rename to internal/pkg/database/workouts.go index a791defd..84172ad1 100644 --- a/pkg/database/workouts.go +++ b/internal/pkg/database/workouts.go @@ -13,7 +13,7 @@ import ( "github.com/gomarkdown/markdown" "github.com/gomarkdown/markdown/html" "github.com/gomarkdown/markdown/parser" - "github.com/jovandeginste/workout-tracker/pkg/converters" + "github.com/jovandeginste/workout-tracker/internal/pkg/converters" "github.com/microcosm-cc/bluemonday" "github.com/tkrajina/gpxgo/gpx" "gorm.io/gorm" diff --git a/pkg/database/workouts_map.go b/internal/pkg/database/workouts_map.go similarity index 98% rename from pkg/database/workouts_map.go rename to internal/pkg/database/workouts_map.go index 967d3cfd..8c127e7a 100644 --- a/pkg/database/workouts_map.go +++ b/internal/pkg/database/workouts_map.go @@ -6,8 +6,8 @@ import ( "time" "github.com/codingsince1985/geo-golang" - "github.com/jovandeginste/workout-tracker/pkg/geocoder" - "github.com/jovandeginste/workout-tracker/pkg/templatehelpers" + "github.com/jovandeginste/workout-tracker/internal/pkg/geocoder" + "github.com/jovandeginste/workout-tracker/internal/pkg/templatehelpers" "github.com/labstack/gommon/log" "github.com/tkrajina/gpxgo/gpx" "github.com/westphae/geomag/pkg/egm96" diff --git a/pkg/database/workouts_statistics.go b/internal/pkg/database/workouts_statistics.go similarity index 98% rename from pkg/database/workouts_statistics.go rename to internal/pkg/database/workouts_statistics.go index cf65562b..5517bb2b 100644 --- a/pkg/database/workouts_statistics.go +++ b/internal/pkg/database/workouts_statistics.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/jovandeginste/workout-tracker/pkg/templatehelpers" + "github.com/jovandeginste/workout-tracker/internal/pkg/templatehelpers" ) type BreakdownItem struct { diff --git a/pkg/database/workouts_statistics_test.go b/internal/pkg/database/workouts_statistics_test.go similarity index 100% rename from pkg/database/workouts_statistics_test.go rename to internal/pkg/database/workouts_statistics_test.go diff --git a/pkg/database/workouts_test.go b/internal/pkg/database/workouts_test.go similarity index 100% rename from pkg/database/workouts_test.go rename to internal/pkg/database/workouts_test.go diff --git a/pkg/geocoder/reverse.go b/internal/pkg/geocoder/reverse.go similarity index 100% rename from pkg/geocoder/reverse.go rename to internal/pkg/geocoder/reverse.go diff --git a/pkg/importers/fitotrack.go b/internal/pkg/importers/fitotrack.go similarity index 100% rename from pkg/importers/fitotrack.go rename to internal/pkg/importers/fitotrack.go diff --git a/pkg/importers/generic.go b/internal/pkg/importers/generic.go similarity index 100% rename from pkg/importers/generic.go rename to internal/pkg/importers/generic.go diff --git a/pkg/importers/importer.go b/internal/pkg/importers/importer.go similarity index 100% rename from pkg/importers/importer.go rename to internal/pkg/importers/importer.go diff --git a/pkg/templatehelpers/duration.go b/internal/pkg/templatehelpers/duration.go similarity index 100% rename from pkg/templatehelpers/duration.go rename to internal/pkg/templatehelpers/duration.go diff --git a/pkg/templatehelpers/duration_test.go b/internal/pkg/templatehelpers/duration_test.go similarity index 100% rename from pkg/templatehelpers/duration_test.go rename to internal/pkg/templatehelpers/duration_test.go diff --git a/pkg/templatehelpers/icons.go b/internal/pkg/templatehelpers/icons.go similarity index 100% rename from pkg/templatehelpers/icons.go rename to internal/pkg/templatehelpers/icons.go diff --git a/pkg/templatehelpers/icons_test.go b/internal/pkg/templatehelpers/icons_test.go similarity index 100% rename from pkg/templatehelpers/icons_test.go rename to internal/pkg/templatehelpers/icons_test.go diff --git a/pkg/templatehelpers/imperial.go b/internal/pkg/templatehelpers/imperial.go similarity index 100% rename from pkg/templatehelpers/imperial.go rename to internal/pkg/templatehelpers/imperial.go diff --git a/pkg/templatehelpers/metric.go b/internal/pkg/templatehelpers/metric.go similarity index 100% rename from pkg/templatehelpers/metric.go rename to internal/pkg/templatehelpers/metric.go diff --git a/pkg/templatehelpers/template_funcs.go b/internal/pkg/templatehelpers/template_funcs.go similarity index 100% rename from pkg/templatehelpers/template_funcs.go rename to internal/pkg/templatehelpers/template_funcs.go diff --git a/pkg/templatehelpers/template_funcs_test.go b/internal/pkg/templatehelpers/template_funcs_test.go similarity index 100% rename from pkg/templatehelpers/template_funcs_test.go rename to internal/pkg/templatehelpers/template_funcs_test.go diff --git a/main.go b/main.go index 22faae51..6da0404f 100644 --- a/main.go +++ b/main.go @@ -1,9 +1,9 @@ package main import ( + "github.com/jovandeginste/workout-tracker/internal/pkg/app" appviews "github.com/jovandeginste/workout-tracker/internal/views" appassets "github.com/jovandeginste/workout-tracker/internal/views/assets" - "github.com/jovandeginste/workout-tracker/pkg/app" apptranslations "github.com/jovandeginste/workout-tracker/translations" ) From 2c2fe4e0665dd854ba5f20dbf32304f33b517532 Mon Sep 17 00:00:00 2001 From: monirzadeh <25131576+Monirzadeh@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:39:56 +0330 Subject: [PATCH 4/8] fix issue with prettier --- Makefile | 1 + internal/views/assets/output.css | 230 +++++++++++++++++++++---------- tailwind.config.js | 6 +- 3 files changed, 162 insertions(+), 75 deletions(-) diff --git a/Makefile b/Makefile index fc9a1e33..ceea86fa 100644 --- a/Makefile +++ b/Makefile @@ -83,6 +83,7 @@ serve: test: test-go test-assets +# TODO: add a mode to style code maybe: prettier --check . --write test-assets: prettier --check . diff --git a/internal/views/assets/output.css b/internal/views/assets/output.css index 656783d9..d5e43799 100644 --- a/internal/views/assets/output.css +++ b/internal/views/assets/output.css @@ -22,7 +22,7 @@ ::before, ::after { - --tw-content: ''; + --tw-content: ""; } /* @@ -44,9 +44,10 @@ html, -moz-tab-size: 4; /* 3 */ -o-tab-size: 4; - tab-size: 4; + tab-size: 4; /* 3 */ - font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", + "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */ font-feature-settings: normal; /* 5 */ @@ -89,7 +90,7 @@ Add the correct text decoration in Chrome, Edge, and Safari. abbr:where([title]) { -webkit-text-decoration: underline dotted; - text-decoration: underline dotted; + text-decoration: underline dotted; } /* @@ -135,7 +136,8 @@ code, kbd, samp, pre { - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, + "Liberation Mono", "Courier New", monospace; /* 1 */ font-feature-settings: normal; /* 2 */ @@ -236,9 +238,9 @@ select { */ button, -input:where([type='button']), -input:where([type='reset']), -input:where([type='submit']) { +input:where([type="button"]), +input:where([type="reset"]), +input:where([type="submit"]) { -webkit-appearance: button; /* 1 */ background-color: transparent; @@ -285,7 +287,7 @@ Correct the cursor style of increment and decrement buttons in Safari. 2. Correct the outline style in Safari. */ -[type='search'] { +[type="search"] { -webkit-appearance: textfield; /* 1 */ outline-offset: -2px; @@ -378,7 +380,8 @@ textarea { 2. Set the default placeholder color to the user's configured gray 400 color. */ -input::-moz-placeholder, textarea::-moz-placeholder { +input::-moz-placeholder, +textarea::-moz-placeholder { opacity: 1; /* 1 */ color: #9ca3af; @@ -473,10 +476,12 @@ video { .leaflet-tooltip, .leaflet-control { --tw-brightness: brightness(0.85); - --tw-contrast: contrast(0.80); + --tw-contrast: contrast(0.8); --tw-invert: invert(100%); --tw-saturate: saturate(0); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) + var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); } } @@ -532,7 +537,9 @@ ul { .dirty:hover { --tw-brightness: brightness(1.1); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } .dirty { @@ -570,8 +577,8 @@ ul { } textarea, - select, - input { +select, +input { border-radius: 0.75rem; border-width: 1px; padding-left: 1.5rem; @@ -584,14 +591,16 @@ textarea, background-color: rgb(244 244 245 / var(--tw-bg-opacity)); } -textarea::-moz-placeholder, select::-moz-placeholder, input::-moz-placeholder { +textarea::-moz-placeholder, +select::-moz-placeholder, +input::-moz-placeholder { --tw-text-opacity: 1; color: rgb(100 116 139 / var(--tw-text-opacity)); } textarea::placeholder, - select::placeholder, - input::placeholder { +select::placeholder, +input::placeholder { --tw-text-opacity: 1; color: rgb(100 116 139 / var(--tw-text-opacity)); } @@ -606,7 +615,9 @@ textarea::placeholder, background-color: rgb(24 24 27 / var(--tw-bg-opacity)); } - textarea::-moz-placeholder, select::-moz-placeholder, input::-moz-placeholder { + textarea::-moz-placeholder, + select::-moz-placeholder, + input::-moz-placeholder { --tw-text-opacity: 1; color: rgb(100 116 139 / var(--tw-text-opacity)); } @@ -620,19 +631,23 @@ textarea::placeholder, } textarea:hover, - select:hover, - input:hover { +select:hover, +input:hover { --tw-brightness: brightness(1.25); --tw-contrast: contrast(1.25); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } textarea:focus, - select:focus, - input:focus { +select:focus, +input:focus { --tw-brightness: brightness(1.25); --tw-contrast: contrast(1.25); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } button.edit { @@ -696,13 +711,17 @@ button { button:hover { --tw-brightness: brightness(1.25); --tw-contrast: contrast(1.25); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } button:focus { --tw-brightness: brightness(1.25); --tw-contrast: contrast(1.25); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } h2 { @@ -762,7 +781,9 @@ h3 { a:hover { --tw-brightness: brightness(1.25); --tw-contrast: contrast(1.25); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } form { @@ -818,7 +839,7 @@ form { } .footer a, - .content a { +.content a { --tw-text-opacity: 1; color: rgb(180 83 9 / var(--tw-text-opacity)); } @@ -832,7 +853,7 @@ form { } .footer, - .menu { +.menu { align-items: baseline; padding-left: 1.5rem; padding-right: 1.5rem; @@ -855,7 +876,7 @@ form { } .footer, - .menu { +.menu { @media print { > div { display: none; @@ -958,12 +979,12 @@ form { .actions { > button, - > form { + > form { margin-top: 0px; margin-bottom: 0px; } > button, - > form { + > form { > button { margin-left: 0px; margin-right: 0px; @@ -1140,8 +1161,8 @@ form { } .version-notice, - .notice, - .alert { +.notice, +.alert { border-width: 1px; position: relative; margin: 1.25rem; @@ -1188,20 +1209,20 @@ table { table { tfoot, - thead { + thead { font-weight: 700; } tfoot, - thead { + thead { text-transform: uppercase; } tfoot, - thead { + thead { --tw-bg-opacity: 1; background-color: rgb(244 244 245 / var(--tw-bg-opacity)); } tfoot, - thead { + thead { --tw-text-opacity: 1; color: rgb(63 63 70 / var(--tw-text-opacity)); } @@ -1220,7 +1241,7 @@ table { } } tfoot, - thead { + thead { tr { border-width: 1px; } @@ -1236,7 +1257,7 @@ table { } } td, - th { + th { padding: 0.5rem; } @media print { @@ -1246,7 +1267,7 @@ table { } } td, - th { + th { vertical-align: top; } th { @@ -1295,7 +1316,7 @@ table { .workout-info { th, - td { + td { padding-left: 0.5rem; padding-right: 0.5rem; } @@ -1343,9 +1364,12 @@ table { border-radius: 1.5rem; } .window { - --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); - --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color); - box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); + --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), + 0 8px 10px -6px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), + 0 8px 10px -6px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), + var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } .window { --tw-bg-opacity: 1; @@ -1470,9 +1494,12 @@ table { font-weight: 500; } button:focus { - --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); - --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color); - box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 + var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 + calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), + var(--tw-shadow, 0 0 #0000); } button.confirm { margin-right: 0.5rem; @@ -1589,7 +1616,9 @@ table { .user-pill:hover { --tw-brightness: brightness(1.1); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } .user-pill { @@ -1623,7 +1652,9 @@ table { .selectable-pill:hover { --tw-brightness: brightness(1.1); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } .selectable-pill { @@ -1648,7 +1679,9 @@ table { .selectable-pill:hover { --tw-brightness: brightness(1.25); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } .selectable-pill { @@ -1693,7 +1726,9 @@ table { .workout-item:hover { --tw-brightness: brightness(1.1); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } .workout-item { @@ -1738,7 +1773,9 @@ table { transition-duration: 1000ms; } -*, ::before, ::after { +*, +::before, +::after { --tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-translate-x: 0; @@ -2034,16 +2071,22 @@ table { .rotate-180 { --tw-rotate: 180deg; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) + rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) + scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } .rotate-90 { --tw-rotate: 90deg; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) + rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) + scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } .transform { - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) + rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) + scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } .resize { @@ -2192,7 +2235,8 @@ table { } .font-mono { - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, + "Liberation Mono", "Courier New", monospace; } .text-3xl { @@ -2425,29 +2469,63 @@ table { .shadow { --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); - --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color); - box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); + --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), + 0 1px 2px -1px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), + var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } .ring { - --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); - --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color); - box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 + var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 + calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), + var(--tw-shadow, 0 0 #0000); } .blur { --tw-blur: blur(8px); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } .filter { - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } .transition { - transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter; - transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; - transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter; + transition-property: + color, + background-color, + border-color, + text-decoration-color, + fill, + stroke, + opacity, + box-shadow, + transform, + filter, + -webkit-backdrop-filter; + transition-property: color, background-color, border-color, + text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, + backdrop-filter; + transition-property: + color, + background-color, + border-color, + text-decoration-color, + fill, + stroke, + opacity, + box-shadow, + transform, + filter, + backdrop-filter, + -webkit-backdrop-filter; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; } @@ -2472,15 +2550,19 @@ table { content: "" !important; } -.icon-regular::before,.icon-regular::after { +.icon-regular::before, +.icon-regular::after { font-weight: 400; } -.icon-solid::before,.icon-solid::after { +.icon-solid::before, +.icon-solid::after { font-weight: 900; } -.icon-brands.icon-inline,.icon-brands::before,.icon-brands::after { +.icon-brands.icon-inline, +.icon-brands::before, +.icon-brands::after { font-family: "Font Awesome 5 Brands"; } @@ -3201,18 +3283,18 @@ table { } } -.\[\&\>\*\]\:basis-1\/2>* { +.\[\&\>\*\]\:basis-1\/2 > * { flex-basis: 50%; } @media (min-width: 1024px) { - .\[\&\>\*\]\:lg\:basis-1\/2>* { + .\[\&\>\*\]\:lg\:basis-1\/2 > * { flex-basis: 50%; } } @media (min-width: 1536px) { - .\[\&\>\*\]\:2xl\:basis-1\/3>* { + .\[\&\>\*\]\:2xl\:basis-1\/3 > * { flex-basis: 33.333333%; } } diff --git a/tailwind.config.js b/tailwind.config.js index 863e4e33..55f0a07e 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,6 +1,10 @@ /** @type {import('tailwindcss').Config} */ module.exports = { - content: ["./internal/views/assets/**/*.{html,js}","./internal/views/**/*.{html,js}", "./pkg/templatehelpers/*.go"], + content: [ + "./internal/views/assets/**/*.{html,js}", + "./internal/views/**/*.{html,js}", + "./pkg/templatehelpers/*.go", + ], theme: { extend: {}, }, From 87901c30c77e73bfe51c3fc00c1466b6f9616e24 Mon Sep 17 00:00:00 2001 From: monirzadeh <25131576+Monirzadeh@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:52:26 +0330 Subject: [PATCH 5/8] get database out of pkg --- internal/{pkg => }/database/config.go | 0 internal/{pkg => }/database/equipment.go | 0 internal/{pkg => }/database/extra_metrics.go | 0 internal/{pkg => }/database/gorm.go | 0 internal/{pkg => }/database/gorm_test.go | 0 internal/{pkg => }/database/gpx_sample_1_test.go | 0 internal/{pkg => }/database/gpx_samples_test.go | 0 internal/{pkg => }/database/profile.go | 0 internal/{pkg => }/database/route_segment_matching.go | 0 internal/{pkg => }/database/route_segments.go | 0 internal/{pkg => }/database/statistics.go | 0 internal/{pkg => }/database/user.go | 0 internal/{pkg => }/database/user_statistics.go | 0 internal/{pkg => }/database/user_test.go | 0 internal/{pkg => }/database/workout_met.go | 0 internal/{pkg => }/database/workout_type.go | 0 internal/{pkg => }/database/workout_type_test.go | 0 internal/{pkg => }/database/workouts.go | 0 internal/{pkg => }/database/workouts_map.go | 0 internal/{pkg => }/database/workouts_statistics.go | 0 internal/{pkg => }/database/workouts_statistics_test.go | 0 internal/{pkg => }/database/workouts_test.go | 0 internal/pkg/app/admin_data.go | 2 +- internal/pkg/app/admin_handlers.go | 2 +- internal/pkg/app/api_handlers.go | 2 +- internal/pkg/app/app.go | 2 +- internal/pkg/app/auth.go | 2 +- internal/pkg/app/background.go | 2 +- internal/pkg/app/data.go | 2 +- internal/pkg/app/equipment_handlers.go | 2 +- internal/pkg/app/i18n.go | 2 +- internal/pkg/app/route_segments_handlers.go | 2 +- internal/pkg/app/routes_test.go | 2 +- internal/pkg/app/self_handlers.go | 2 +- internal/pkg/app/templates.go | 2 +- internal/pkg/app/users_handlers.go | 2 +- internal/pkg/app/workouts.go | 2 +- internal/pkg/app/workouts_handlers.go | 2 +- 38 files changed, 16 insertions(+), 16 deletions(-) rename internal/{pkg => }/database/config.go (100%) rename internal/{pkg => }/database/equipment.go (100%) rename internal/{pkg => }/database/extra_metrics.go (100%) rename internal/{pkg => }/database/gorm.go (100%) rename internal/{pkg => }/database/gorm_test.go (100%) rename internal/{pkg => }/database/gpx_sample_1_test.go (100%) rename internal/{pkg => }/database/gpx_samples_test.go (100%) rename internal/{pkg => }/database/profile.go (100%) rename internal/{pkg => }/database/route_segment_matching.go (100%) rename internal/{pkg => }/database/route_segments.go (100%) rename internal/{pkg => }/database/statistics.go (100%) rename internal/{pkg => }/database/user.go (100%) rename internal/{pkg => }/database/user_statistics.go (100%) rename internal/{pkg => }/database/user_test.go (100%) rename internal/{pkg => }/database/workout_met.go (100%) rename internal/{pkg => }/database/workout_type.go (100%) rename internal/{pkg => }/database/workout_type_test.go (100%) rename internal/{pkg => }/database/workouts.go (100%) rename internal/{pkg => }/database/workouts_map.go (100%) rename internal/{pkg => }/database/workouts_statistics.go (100%) rename internal/{pkg => }/database/workouts_statistics_test.go (100%) rename internal/{pkg => }/database/workouts_test.go (100%) diff --git a/internal/pkg/database/config.go b/internal/database/config.go similarity index 100% rename from internal/pkg/database/config.go rename to internal/database/config.go diff --git a/internal/pkg/database/equipment.go b/internal/database/equipment.go similarity index 100% rename from internal/pkg/database/equipment.go rename to internal/database/equipment.go diff --git a/internal/pkg/database/extra_metrics.go b/internal/database/extra_metrics.go similarity index 100% rename from internal/pkg/database/extra_metrics.go rename to internal/database/extra_metrics.go diff --git a/internal/pkg/database/gorm.go b/internal/database/gorm.go similarity index 100% rename from internal/pkg/database/gorm.go rename to internal/database/gorm.go diff --git a/internal/pkg/database/gorm_test.go b/internal/database/gorm_test.go similarity index 100% rename from internal/pkg/database/gorm_test.go rename to internal/database/gorm_test.go diff --git a/internal/pkg/database/gpx_sample_1_test.go b/internal/database/gpx_sample_1_test.go similarity index 100% rename from internal/pkg/database/gpx_sample_1_test.go rename to internal/database/gpx_sample_1_test.go diff --git a/internal/pkg/database/gpx_samples_test.go b/internal/database/gpx_samples_test.go similarity index 100% rename from internal/pkg/database/gpx_samples_test.go rename to internal/database/gpx_samples_test.go diff --git a/internal/pkg/database/profile.go b/internal/database/profile.go similarity index 100% rename from internal/pkg/database/profile.go rename to internal/database/profile.go diff --git a/internal/pkg/database/route_segment_matching.go b/internal/database/route_segment_matching.go similarity index 100% rename from internal/pkg/database/route_segment_matching.go rename to internal/database/route_segment_matching.go diff --git a/internal/pkg/database/route_segments.go b/internal/database/route_segments.go similarity index 100% rename from internal/pkg/database/route_segments.go rename to internal/database/route_segments.go diff --git a/internal/pkg/database/statistics.go b/internal/database/statistics.go similarity index 100% rename from internal/pkg/database/statistics.go rename to internal/database/statistics.go diff --git a/internal/pkg/database/user.go b/internal/database/user.go similarity index 100% rename from internal/pkg/database/user.go rename to internal/database/user.go diff --git a/internal/pkg/database/user_statistics.go b/internal/database/user_statistics.go similarity index 100% rename from internal/pkg/database/user_statistics.go rename to internal/database/user_statistics.go diff --git a/internal/pkg/database/user_test.go b/internal/database/user_test.go similarity index 100% rename from internal/pkg/database/user_test.go rename to internal/database/user_test.go diff --git a/internal/pkg/database/workout_met.go b/internal/database/workout_met.go similarity index 100% rename from internal/pkg/database/workout_met.go rename to internal/database/workout_met.go diff --git a/internal/pkg/database/workout_type.go b/internal/database/workout_type.go similarity index 100% rename from internal/pkg/database/workout_type.go rename to internal/database/workout_type.go diff --git a/internal/pkg/database/workout_type_test.go b/internal/database/workout_type_test.go similarity index 100% rename from internal/pkg/database/workout_type_test.go rename to internal/database/workout_type_test.go diff --git a/internal/pkg/database/workouts.go b/internal/database/workouts.go similarity index 100% rename from internal/pkg/database/workouts.go rename to internal/database/workouts.go diff --git a/internal/pkg/database/workouts_map.go b/internal/database/workouts_map.go similarity index 100% rename from internal/pkg/database/workouts_map.go rename to internal/database/workouts_map.go diff --git a/internal/pkg/database/workouts_statistics.go b/internal/database/workouts_statistics.go similarity index 100% rename from internal/pkg/database/workouts_statistics.go rename to internal/database/workouts_statistics.go diff --git a/internal/pkg/database/workouts_statistics_test.go b/internal/database/workouts_statistics_test.go similarity index 100% rename from internal/pkg/database/workouts_statistics_test.go rename to internal/database/workouts_statistics_test.go diff --git a/internal/pkg/database/workouts_test.go b/internal/database/workouts_test.go similarity index 100% rename from internal/pkg/database/workouts_test.go rename to internal/database/workouts_test.go diff --git a/internal/pkg/app/admin_data.go b/internal/pkg/app/admin_data.go index 62a9fdd4..e4082a04 100644 --- a/internal/pkg/app/admin_data.go +++ b/internal/pkg/app/admin_data.go @@ -3,7 +3,7 @@ package app import ( "strconv" - "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/database" "github.com/labstack/echo/v4" ) diff --git a/internal/pkg/app/admin_handlers.go b/internal/pkg/app/admin_handlers.go index 5e34eaca..250e55f1 100644 --- a/internal/pkg/app/admin_handlers.go +++ b/internal/pkg/app/admin_handlers.go @@ -3,7 +3,7 @@ package app import ( "net/http" - "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/database" "github.com/labstack/echo/v4" ) diff --git a/internal/pkg/app/api_handlers.go b/internal/pkg/app/api_handlers.go index 818d44ae..fdc39427 100644 --- a/internal/pkg/app/api_handlers.go +++ b/internal/pkg/app/api_handlers.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/database" "github.com/jovandeginste/workout-tracker/internal/pkg/importers" echojwt "github.com/labstack/echo-jwt/v4" "github.com/labstack/echo/v4" diff --git a/internal/pkg/app/app.go b/internal/pkg/app/app.go index 6d3b2282..c9078f82 100644 --- a/internal/pkg/app/app.go +++ b/internal/pkg/app/app.go @@ -11,7 +11,7 @@ import ( "github.com/alexedwards/scs/v2" "github.com/cat-dealer/go-rand/v2" "github.com/fsouza/slognil" - "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/database" "github.com/jovandeginste/workout-tracker/internal/pkg/geocoder" "github.com/labstack/echo/v4" "github.com/lmittmann/tint" diff --git a/internal/pkg/app/auth.go b/internal/pkg/app/auth.go index 716e5fd9..db1af35d 100644 --- a/internal/pkg/app/auth.go +++ b/internal/pkg/app/auth.go @@ -6,7 +6,7 @@ import ( "time" "github.com/golang-jwt/jwt/v5" - "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/database" "github.com/labstack/echo/v4" ) diff --git a/internal/pkg/app/background.go b/internal/pkg/app/background.go index 5d369567..cf406cb3 100644 --- a/internal/pkg/app/background.go +++ b/internal/pkg/app/background.go @@ -8,7 +8,7 @@ import ( "path/filepath" "time" - "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/database" "gorm.io/gorm" ) diff --git a/internal/pkg/app/data.go b/internal/pkg/app/data.go index 3122aefb..70b820f4 100644 --- a/internal/pkg/app/data.go +++ b/internal/pkg/app/data.go @@ -4,7 +4,7 @@ import ( "strconv" "github.com/golang-jwt/jwt/v5" - "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/database" "github.com/labstack/echo/v4" ) diff --git a/internal/pkg/app/equipment_handlers.go b/internal/pkg/app/equipment_handlers.go index 70d8d9bb..d44c0e5d 100644 --- a/internal/pkg/app/equipment_handlers.go +++ b/internal/pkg/app/equipment_handlers.go @@ -4,7 +4,7 @@ import ( "net/http" "strconv" - "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/database" "github.com/labstack/echo/v4" ) diff --git a/internal/pkg/app/i18n.go b/internal/pkg/app/i18n.go index 349f0fc0..043b14d2 100644 --- a/internal/pkg/app/i18n.go +++ b/internal/pkg/app/i18n.go @@ -1,7 +1,7 @@ package app import ( - "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/database" "github.com/labstack/echo/v4" "github.com/vorlif/spreak" "github.com/vorlif/spreak/humanize" diff --git a/internal/pkg/app/route_segments_handlers.go b/internal/pkg/app/route_segments_handlers.go index a18f008c..9e1eb874 100644 --- a/internal/pkg/app/route_segments_handlers.go +++ b/internal/pkg/app/route_segments_handlers.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/database" "github.com/labstack/echo/v4" ) diff --git a/internal/pkg/app/routes_test.go b/internal/pkg/app/routes_test.go index 0cbde404..4eb7d9bc 100644 --- a/internal/pkg/app/routes_test.go +++ b/internal/pkg/app/routes_test.go @@ -5,7 +5,7 @@ import ( "net/http/httptest" "testing" - "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/database" session "github.com/spazzymoto/echo-scs-session" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/internal/pkg/app/self_handlers.go b/internal/pkg/app/self_handlers.go index aadb5999..d2552a02 100644 --- a/internal/pkg/app/self_handlers.go +++ b/internal/pkg/app/self_handlers.go @@ -3,7 +3,7 @@ package app import ( "net/http" - "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/database" "github.com/labstack/echo/v4" ) diff --git a/internal/pkg/app/templates.go b/internal/pkg/app/templates.go index f1d14769..a859952c 100644 --- a/internal/pkg/app/templates.go +++ b/internal/pkg/app/templates.go @@ -9,7 +9,7 @@ import ( "time" "github.com/Masterminds/sprig/v3" - "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/database" "github.com/jovandeginste/workout-tracker/internal/pkg/templatehelpers" "github.com/labstack/echo/v4" "github.com/labstack/gommon/log" diff --git a/internal/pkg/app/users_handlers.go b/internal/pkg/app/users_handlers.go index e165d932..a33c2b61 100644 --- a/internal/pkg/app/users_handlers.go +++ b/internal/pkg/app/users_handlers.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/database" "github.com/labstack/echo/v4" ) diff --git a/internal/pkg/app/workouts.go b/internal/pkg/app/workouts.go index 093af71c..5c3cf59e 100644 --- a/internal/pkg/app/workouts.go +++ b/internal/pkg/app/workouts.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/database" "github.com/jovandeginste/workout-tracker/internal/pkg/geocoder" "github.com/labstack/echo/v4" ) diff --git a/internal/pkg/app/workouts_handlers.go b/internal/pkg/app/workouts_handlers.go index bf4dd6f2..9b4af74a 100644 --- a/internal/pkg/app/workouts_handlers.go +++ b/internal/pkg/app/workouts_handlers.go @@ -8,7 +8,7 @@ import ( "strconv" "time" - "github.com/jovandeginste/workout-tracker/internal/pkg/database" + "github.com/jovandeginste/workout-tracker/internal/database" "github.com/labstack/echo/v4" ) From 50a4a4b3b95f69304a0a34880ab95d7a2f2eb79c Mon Sep 17 00:00:00 2001 From: monirzadeh <25131576+Monirzadeh@users.noreply.github.com> Date: Mon, 2 Sep 2024 16:04:15 +0330 Subject: [PATCH 6/8] move translation to view --- internal/pkg/app/app_test.go | 2 +- {translations => internal/views/translations}/.prettierrc | 0 {translations => internal/views/translations}/de.json | 0 {translations => internal/views/translations}/embed.go | 0 {translations => internal/views/translations}/embed_test.go | 0 {translations => internal/views/translations}/en.json | 0 {translations => internal/views/translations}/fa.json | 0 {translations => internal/views/translations}/fr.json | 0 {translations => internal/views/translations}/id.json | 0 {translations => internal/views/translations}/it.json | 0 {translations => internal/views/translations}/nl.json | 0 {translations => internal/views/translations}/no.json | 0 main.go | 2 +- 13 files changed, 2 insertions(+), 2 deletions(-) rename {translations => internal/views/translations}/.prettierrc (100%) rename {translations => internal/views/translations}/de.json (100%) rename {translations => internal/views/translations}/embed.go (100%) rename {translations => internal/views/translations}/embed_test.go (100%) rename {translations => internal/views/translations}/en.json (100%) rename {translations => internal/views/translations}/fa.json (100%) rename {translations => internal/views/translations}/fr.json (100%) rename {translations => internal/views/translations}/id.json (100%) rename {translations => internal/views/translations}/it.json (100%) rename {translations => internal/views/translations}/nl.json (100%) rename {translations => internal/views/translations}/no.json (100%) diff --git a/internal/pkg/app/app_test.go b/internal/pkg/app/app_test.go index 07970b5a..9059b9ba 100644 --- a/internal/pkg/app/app_test.go +++ b/internal/pkg/app/app_test.go @@ -7,7 +7,7 @@ import ( "github.com/fsouza/slognil" appviews "github.com/jovandeginste/workout-tracker/internal/views" appassets "github.com/jovandeginste/workout-tracker/internal/views/assets" - apptranslations "github.com/jovandeginste/workout-tracker/translations" + apptranslations "github.com/jovandeginste/workout-tracker/internal/views/translations" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/translations/.prettierrc b/internal/views/translations/.prettierrc similarity index 100% rename from translations/.prettierrc rename to internal/views/translations/.prettierrc diff --git a/translations/de.json b/internal/views/translations/de.json similarity index 100% rename from translations/de.json rename to internal/views/translations/de.json diff --git a/translations/embed.go b/internal/views/translations/embed.go similarity index 100% rename from translations/embed.go rename to internal/views/translations/embed.go diff --git a/translations/embed_test.go b/internal/views/translations/embed_test.go similarity index 100% rename from translations/embed_test.go rename to internal/views/translations/embed_test.go diff --git a/translations/en.json b/internal/views/translations/en.json similarity index 100% rename from translations/en.json rename to internal/views/translations/en.json diff --git a/translations/fa.json b/internal/views/translations/fa.json similarity index 100% rename from translations/fa.json rename to internal/views/translations/fa.json diff --git a/translations/fr.json b/internal/views/translations/fr.json similarity index 100% rename from translations/fr.json rename to internal/views/translations/fr.json diff --git a/translations/id.json b/internal/views/translations/id.json similarity index 100% rename from translations/id.json rename to internal/views/translations/id.json diff --git a/translations/it.json b/internal/views/translations/it.json similarity index 100% rename from translations/it.json rename to internal/views/translations/it.json diff --git a/translations/nl.json b/internal/views/translations/nl.json similarity index 100% rename from translations/nl.json rename to internal/views/translations/nl.json diff --git a/translations/no.json b/internal/views/translations/no.json similarity index 100% rename from translations/no.json rename to internal/views/translations/no.json diff --git a/main.go b/main.go index 6da0404f..4e1a5c48 100644 --- a/main.go +++ b/main.go @@ -4,7 +4,7 @@ import ( "github.com/jovandeginste/workout-tracker/internal/pkg/app" appviews "github.com/jovandeginste/workout-tracker/internal/views" appassets "github.com/jovandeginste/workout-tracker/internal/views/assets" - apptranslations "github.com/jovandeginste/workout-tracker/translations" + apptranslations "github.com/jovandeginste/workout-tracker/internal/views/translations" ) var ( From b281b8badaa6df8ddc50efeabb488ecdda968116 Mon Sep 17 00:00:00 2001 From: monirzadeh <25131576+Monirzadeh@users.noreply.github.com> Date: Mon, 2 Sep 2024 16:40:46 +0330 Subject: [PATCH 7/8] fix swagger path in Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ceea86fa..18cd9c1f 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ build-docker: swagger: swag init \ --parseDependency \ - --dir ./pkg/app/,./,./vendor/gorm.io/gorm/,./vendor/github.com/codingsince1985/geo-golang/ \ + --dir ./internal/pkg/app/,./,./vendor/gorm.io/gorm/,./vendor/github.com/codingsince1985/geo-golang/ \ --generalInfo api_handlers.go build-tw: From 0f6a5dc8a1c0fb7f36c37fc526f6fb7f856407c6 Mon Sep 17 00:00:00 2001 From: monirzadeh <25131576+Monirzadeh@users.noreply.github.com> Date: Mon, 16 Sep 2024 18:02:29 +0330 Subject: [PATCH 8/8] fix prettier --- internal/views/assets/output.css | 160 +++++++++++++++++++------------ 1 file changed, 100 insertions(+), 60 deletions(-) diff --git a/internal/views/assets/output.css b/internal/views/assets/output.css index ef461b11..604f754f 100644 --- a/internal/views/assets/output.css +++ b/internal/views/assets/output.css @@ -22,7 +22,7 @@ ::before, ::after { - --tw-content: ''; + --tw-content: ""; } /* @@ -44,9 +44,10 @@ html, -moz-tab-size: 4; /* 3 */ -o-tab-size: 4; - tab-size: 4; + tab-size: 4; /* 3 */ - font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", + "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */ font-feature-settings: normal; /* 5 */ @@ -89,7 +90,7 @@ Add the correct text decoration in Chrome, Edge, and Safari. abbr:where([title]) { -webkit-text-decoration: underline dotted; - text-decoration: underline dotted; + text-decoration: underline dotted; } /* @@ -135,7 +136,8 @@ code, kbd, samp, pre { - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, + "Liberation Mono", "Courier New", monospace; /* 1 */ font-feature-settings: normal; /* 2 */ @@ -236,9 +238,9 @@ select { */ button, -input:where([type='button']), -input:where([type='reset']), -input:where([type='submit']) { +input:where([type="button"]), +input:where([type="reset"]), +input:where([type="submit"]) { -webkit-appearance: button; /* 1 */ background-color: transparent; @@ -285,7 +287,7 @@ Correct the cursor style of increment and decrement buttons in Safari. 2. Correct the outline style in Safari. */ -[type='search'] { +[type="search"] { -webkit-appearance: textfield; /* 1 */ outline-offset: -2px; @@ -378,7 +380,8 @@ textarea { 2. Set the default placeholder color to the user's configured gray 400 color. */ -input::-moz-placeholder, textarea::-moz-placeholder { +input::-moz-placeholder, +textarea::-moz-placeholder { opacity: 1; /* 1 */ color: #9ca3af; @@ -473,10 +476,12 @@ video { .leaflet-tooltip, .leaflet-control { --tw-brightness: brightness(0.85); - --tw-contrast: contrast(0.80); + --tw-contrast: contrast(0.8); --tw-invert: invert(100%); --tw-saturate: saturate(0); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) + var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); } } @@ -532,7 +537,9 @@ ul { .dirty:hover { --tw-brightness: brightness(1.1); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } .dirty { @@ -570,8 +577,8 @@ ul { } textarea, - select, - input { +select, +input { border-radius: 0.75rem; border-width: 1px; padding-left: 1.5rem; @@ -584,14 +591,16 @@ textarea, background-color: rgb(244 244 245 / var(--tw-bg-opacity)); } -textarea::-moz-placeholder, select::-moz-placeholder, input::-moz-placeholder { +textarea::-moz-placeholder, +select::-moz-placeholder, +input::-moz-placeholder { --tw-text-opacity: 1; color: rgb(100 116 139 / var(--tw-text-opacity)); } textarea::placeholder, - select::placeholder, - input::placeholder { +select::placeholder, +input::placeholder { --tw-text-opacity: 1; color: rgb(100 116 139 / var(--tw-text-opacity)); } @@ -606,7 +615,9 @@ textarea::placeholder, background-color: rgb(24 24 27 / var(--tw-bg-opacity)); } - textarea::-moz-placeholder, select::-moz-placeholder, input::-moz-placeholder { + textarea::-moz-placeholder, + select::-moz-placeholder, + input::-moz-placeholder { --tw-text-opacity: 1; color: rgb(100 116 139 / var(--tw-text-opacity)); } @@ -620,23 +631,27 @@ textarea::placeholder, } textarea:hover, - select:hover, - input:hover { +select:hover, +input:hover { --tw-brightness: brightness(1.25); --tw-contrast: contrast(1.25); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } textarea:focus, - select:focus, - input:focus { +select:focus, +input:focus { --tw-brightness: brightness(1.25); --tw-contrast: contrast(1.25); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } button.edit, - button.share { +button.share { --tw-border-opacity: 1; border-color: rgb(251 191 36 / var(--tw-border-opacity)); --tw-bg-opacity: 1; @@ -698,13 +713,17 @@ button { button:hover { --tw-brightness: brightness(1.25); --tw-contrast: contrast(1.25); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } button:focus { --tw-brightness: brightness(1.25); --tw-contrast: contrast(1.25); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } h2 { @@ -764,7 +783,9 @@ h3 { a:hover { --tw-brightness: brightness(1.25); --tw-contrast: contrast(1.25); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } form { @@ -820,7 +841,7 @@ form { } .footer a, - .content a { +.content a { --tw-text-opacity: 1; color: rgb(180 83 9 / var(--tw-text-opacity)); } @@ -834,7 +855,7 @@ form { } .footer, - .menu { +.menu { align-items: baseline; padding-left: 1.5rem; padding-right: 1.5rem; @@ -857,7 +878,7 @@ form { } .footer, - .menu { +.menu { @media print { > div { display: none; @@ -960,12 +981,12 @@ form { .actions { > button, - > form { + > form { margin-top: 0px; margin-bottom: 0px; } > button, - > form { + > form { > button { margin-left: 0px; margin-right: 0px; @@ -1142,8 +1163,8 @@ form { } .version-notice, - .notice, - .alert { +.notice, +.alert { border-width: 1px; position: relative; margin: 1.25rem; @@ -1190,20 +1211,20 @@ table { table { tfoot, - thead { + thead { font-weight: 700; } tfoot, - thead { + thead { text-transform: uppercase; } tfoot, - thead { + thead { --tw-bg-opacity: 1; background-color: rgb(244 244 245 / var(--tw-bg-opacity)); } tfoot, - thead { + thead { --tw-text-opacity: 1; color: rgb(63 63 70 / var(--tw-text-opacity)); } @@ -1222,7 +1243,7 @@ table { } } tfoot, - thead { + thead { tr { border-width: 1px; } @@ -1238,7 +1259,7 @@ table { } } td, - th { + th { padding: 0.5rem; } @media print { @@ -1248,7 +1269,7 @@ table { } } td, - th { + th { vertical-align: top; } th { @@ -1297,7 +1318,7 @@ table { .workout-info { th, - td { + td { padding-left: 0.5rem; padding-right: 0.5rem; } @@ -1345,9 +1366,12 @@ table { border-radius: 1.5rem; } .window { - --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); - --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color); - box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); + --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), + 0 8px 10px -6px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), + 0 8px 10px -6px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), + var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } .window { --tw-bg-opacity: 1; @@ -1472,9 +1496,12 @@ table { font-weight: 500; } button:focus { - --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); - --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color); - box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 + var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 + calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), + var(--tw-shadow, 0 0 #0000); } button.confirm { margin-right: 0.5rem; @@ -1591,7 +1618,9 @@ table { .user-pill:hover { --tw-brightness: brightness(1.1); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } .user-pill { @@ -1625,7 +1654,9 @@ table { .selectable-pill:hover { --tw-brightness: brightness(1.1); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } .selectable-pill { @@ -1650,7 +1681,9 @@ table { .selectable-pill:hover { --tw-brightness: brightness(1.25); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } .selectable-pill { @@ -1695,7 +1728,9 @@ table { .workout-item:hover { --tw-brightness: brightness(1.1); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } .workout-item { @@ -1740,7 +1775,9 @@ table { transition-duration: 1000ms; } -*, ::before, ::after { +*, +::before, +::after { --tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-translate-x: 0; @@ -2072,7 +2109,8 @@ table { } .font-mono { - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, + "Liberation Mono", "Courier New", monospace; } .text-3xl { @@ -2284,7 +2322,9 @@ table { } .filter { - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) + var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) + var(--tw-sepia) var(--tw-drop-shadow); } @media (min-width: 640px) { @@ -2456,18 +2496,18 @@ table { } } -.\[\&\>\*\]\:basis-1\/2>* { +.\[\&\>\*\]\:basis-1\/2 > * { flex-basis: 50%; } @media (min-width: 1024px) { - .\[\&\>\*\]\:lg\:basis-1\/2>* { + .\[\&\>\*\]\:lg\:basis-1\/2 > * { flex-basis: 50%; } } @media (min-width: 1536px) { - .\[\&\>\*\]\:2xl\:basis-1\/3>* { + .\[\&\>\*\]\:2xl\:basis-1\/3 > * { flex-basis: 33.333333%; } }