@@ -16,11 +16,11 @@ help: ## Displays list of available commands
1616# ------------------------------------------------------------------------------
1717
1818.PHONY : help generate-schema generate-schema-native check-fix php-checks php-lock-icons php-translations \
19- storefront-checks storefront-translations run-acceptance-tests-base \
19+ storefront-checks storefront-translations check-schema run-acceptance-tests-base \
2020 run-acceptance-tests-regression selected-acceptance-tests-base selected-acceptance-tests-regression \
2121 run-specific-test-regression run-specific-test-base \
2222 open-acceptance-tests-base open-acceptance-tests-regression run-smoke-tests \
23- generate-snapshots-info-table _prepare -data-for-acceptance-tests _cypress -prepare _cypress -cleanup \
23+ generate-snapshots-info-table prepare -data-for-acceptance-tests cypress -prepare cypress -cleanup \
2424 check-licenses
2525
2626# ------------------------------------------------------------------------------
@@ -33,20 +33,20 @@ generate-schema: ## Generates GraphQL schema and frontend types (in Docker)
3333 docker compose cp php-fpm:/var/www/html/schema.graphql /tmp/schema.graphql
3434 docker compose cp /tmp/schema.graphql storefront:/home/node/app/schema.graphql
3535 docker compose exec -u root storefront chown node:node schema.graphql
36- find project-base/ storefront/graphql/requests -type f -name " *.generated.tsx" -exec rm {} \;
37- docker compose exec storefront npm run gql
36+ find storefront/graphql/requests -type f -name " *.generated.tsx" -exec rm {} \;
37+ docker compose exec storefront pnpm run gql
3838 docker compose exec storefront rm -rf /home/node/app/schema.graphql
3939
4040generate-schema-native : # # Generates GraphQL schema and frontend types (natively)
4141 cd app; php ./bin/console graphql:validate
4242 cd app; php phing frontend-api-generate-graphql-schema
4343 cp app/schema.graphql storefront/schema.graphql
44- find project-base/ storefront/graphql/requests -type f -name " *.generated.tsx" -exec rm {} \;
45- cd storefront; npm run gql
44+ find storefront/graphql/requests -type f -name " *.generated.tsx" -exec rm {} \;
45+ cd storefront; pnpm run gql
4646 rm -rf storefront/schema.graphql
4747
4848# ------------------------------------------------------------------------------
49- # ✅ Code Checks and Fixes (PHP & JS/TS)
49+ # ✅ Code Checks and Fixes (PHP and JS/TS)
5050# ------------------------------------------------------------------------------
5151
5252check-fix : generate-schema php-checks php-translations storefront-checks storefront-translations check-licenses # # Runs all code checks (backend & storefront) and attempts to fix issues
@@ -66,20 +66,17 @@ storefront-checks: ## Runs Storefront (JS/TS) checks and attempts to fix issues
6666storefront-translations : # # Updates translation files of the storefront
6767 docker compose exec storefront pnpm run translate
6868
69+ check-schema : # # Checks if generated GraphQL schema is correct
70+ docker compose exec php-fpm php phing frontend-api-generate-graphql-schema
71+ docker compose cp php-fpm:/var/www/html/schema.graphql /tmp/schema.graphql
72+ docker compose cp /tmp/schema.graphql storefront:/home/node/app/schema.graphql
73+ docker compose exec -u root storefront chown node:node schema.graphql
74+ docker compose exec storefront sh check-code-gen.sh
75+
6976# ------------------------------------------------------------------------------
7077# 🧪 Testing & Quality Assurance
7178# ------------------------------------------------------------------------------
7279
73- # Internal helper functions (not shown in help)
74- _prepare-data-for-acceptance-tests :
75- $(call prepare-data-for-acceptance-tests)
76-
77- _cypress-prepare :
78- $(call cypress-prepare)
79-
80- _cypress-cleanup :
81- $(call cypress-cleanup)
82-
8380define prepare-data-for-acceptance-tests
8481 docker compose exec php-fpm php phing -D production.confirm.action=y -D change.environment=test environment-change
8582 docker compose exec php-fpm php phing test-db-create test-db-demo test-elasticsearch-index-recreate test-elasticsearch-export
@@ -98,27 +95,28 @@ define cypress-cleanup
9895endef
9996
10097define run_acceptance_tests
101- $(call _prepare -data-for-acceptance-tests)
102- $(call _cypress -prepare)
98+ $(call prepare -data-for-acceptance-tests)
99+ $(call cypress -prepare)
103100 @echo "▶️ Running acceptance tests of type $(1 ) ..."
104101 -docker compose run --rm -e TYPE=$(1 ) -e COMMAND=run cypress || true
105102 @echo "✅ Acceptance tests of type $(1 ) finished."
106- $(call _cypress -cleanup)
103+ $(call cypress -cleanup)
107104endef
108105
109106define selected_acceptance_tests
110- $(call _prepare -data-for-acceptance-tests)
111- $(call _cypress -prepare)
107+ $(call prepare -data-for-acceptance-tests)
108+ $(call cypress -prepare)
112109 @echo "▶️ Running selected acceptance tests of type $(1 ) ..."
113110 -docker compose run --rm -e TYPE=$(1 ) -e COMMAND=selected cypress || true
114111 @echo "✅ Selected acceptance tests of type $(1 ) finished."
115- $(call _cypress -cleanup)
112+ $(call cypress -cleanup)
116113endef
117114
118115define run_specific_acceptance_test
119116 $(call prepare-data-for-acceptance-tests)
120117 $(call cypress-prepare)
121118 @echo "▶️ Running specific acceptance test: $(2 ) of type $(1 ) ..."
119+ docker compose build cypress
122120 -docker compose run --rm -e TYPE=$(1 ) -e SPEC=$(2 ) cypress || true
123121 @echo "✅ Specific acceptance test $(2 ) of type $(1 ) finished."
124122 $(call cypress-cleanup)
@@ -134,15 +132,15 @@ else
134132endif
135133
136134define open_acceptance_tests
137- $(call _prepare -data-for-acceptance-tests)
138- $(call _cypress -prepare)
135+ $(call prepare -data-for-acceptance-tests)
136+ $(call cypress -prepare)
139137 @if [ "$(IS_WSL ) " = "" ]; then \
140138 xhost + $(get_ip ) ; \
141139 fi
142140 @echo "▶️ Opening acceptance tests of type $(1 ) ..."
143141 -docker compose run --rm -e TYPE=$(1 ) -e DISPLAY=$(get_ip ) :0 -e COMMAND=open cypress || true
144142 @echo "✅ Acceptance tests of type $(1 ) finished."
145- $(call _cypress -cleanup)
143+ $(call cypress -cleanup)
146144endef
147145
148146# Cypress Acceptance Tests
@@ -159,13 +157,6 @@ selected-acceptance-tests-base: ## Runs selected base acceptance tests (interact
159157selected-acceptance-tests-regression : # # Runs selected regression acceptance tests (interactive selection, headless)
160158 $(call selected_acceptance_tests,regression)
161159
162- run-specific-test-base : # # Runs a specific base acceptance test (interactive selection, headless)
163- @if [ -z " $( SPEC) " ]; then \
164- echo " ❌ Error: SPEC parameter is required. Usage: make run-specific-test-base SPEC=e2e/filterAndSort/categoryDetailFilterAndSort.cy.ts" ; \
165- exit 1; \
166- fi
167- $(call run_specific_acceptance_test,base,$(SPEC ) )
168-
169160run-specific-test-regression : # # Runs a specific regression acceptance test (interactive selection, headless)
170161 @if [ -z " $( SPEC) " ]; then \
171162 echo " ❌ Error: SPEC parameter is required. Usage: make run-specific-test-regression SPEC=e2e/filterAndSort/categoryDetailFilterAndSort.cy.ts" ; \
@@ -180,41 +171,52 @@ run-specific-test-base: ## Runs a specific base acceptance test (interactive sel
180171 fi
181172 $(call run_specific_acceptance_test,base,$(SPEC ) )
182173
183- run-specific-test-actual : # # Runs a specific actual acceptance test (interactive selection, headless)
184- @if [ -z " $( SPEC) " ]; then \
185- echo " ❌ Error: SPEC parameter is required. Usage: make run-specific-test-actual SPEC=e2e/filterAndSort/categoryDetailFilterAndSort.cy.ts" ; \
186- exit 1; \
187- fi
188- $(call run_specific_acceptance_test,actual,$(SPEC ) )
189-
190174open-acceptance-tests-base : # # Opens the Cypress GUI for debugging base acceptance tests
191175 $(call open_acceptance_tests,base)
192176
193177open-acceptance-tests-regression : # # Opens the Cypress GUI for debugging regression acceptance tests
194178 $(call open_acceptance_tests,regression)
195179
196180run-smoke-tests : # # Runs smoke tests (Cypress)
197- $(call _prepare -data-for-acceptance-tests)
198- $(call _cypress -prepare)
181+ $(call prepare -data-for-acceptance-tests)
182+ $(call cypress -prepare)
199183 @echo " ▶️ Running smoke tests..."
200184 -docker compose run --rm -e TYPE=null -e COMMAND=smoke cypress || true
201185 @echo " ✅ Smoke tests finished."
202- $(call _cypress -cleanup)
186+ $(call cypress -cleanup)
203187
204188# ------------------------------------------------------------------------------
205189# 📸 Snapshots & Utilities
206190# ------------------------------------------------------------------------------
207191
208192generate-snapshots-info-table : # # Generates overview table of Cypress snapshots
209- $(call _prepare -data-for-acceptance-tests)
210- $(call _cypress -prepare)
193+ $(call prepare -data-for-acceptance-tests)
194+ $(call cypress -prepare)
211195 @echo " ▶️ Generating snapshots info table..."
212196 -docker compose exec storefront-cypress npm run generate-snapshots-table --prefix cypress || true
213197 @echo " ✅ Snapshots info table generation finished."
214- $(call _cypress-cleanup)
198+ $(call cypress-cleanup)
199+
200+ # ------------------------------------------------------------------------------
201+ # 📦 Checking dependencies licenses
202+ # ------------------------------------------------------------------------------
215203
216204check-licenses : # # Checks dependency licenses in Composer and NPM (php-fpm & storefront)
217205 @echo " 🔍 Checking dependency licenses..."
218- @docker compose exec php-fpm bash -lc " scripts/check-licenses.sh" && \
219- docker compose exec storefront sh -lc " sh scripts/check-licenses.sh" && \
206+ @docker compose exec -T php-fpm bash -lc " scripts/check-licenses.sh" && \
207+ docker compose exec -T storefront sh -lc " sh scripts/check-licenses.sh" && \
220208 echo " ✅ All license checks passed"
209+
210+ # ------------------------------------------------------------------------------
211+ # 💅 Compiling Tailwind CSS for admin
212+ # ------------------------------------------------------------------------------
213+
214+ generate-tailwind-for-admin :
215+ @echo " 🚀 Compiling Tailwind CSS for admin..."
216+ rm -rf storefront/public/tailwind-for-admin/style.css
217+ mkdir -p storefront/public/tailwind-for-admin
218+ docker compose exec storefront pnpm compile-tailwind-for-admin
219+ @echo " ✅ Tailwind CSS compiled to: storefront/public/tailwind-for-admin/style.css"
220+ @echo " 🔧 Rebuilding backend admin assets..."
221+ docker compose exec php-fpm php phing npm-dev
222+ @echo " 🎉 Admin assets rebuilt! Tailwind classes are now available in GrapesJS."
0 commit comments