Skip to content

Commit 7e19bc6

Browse files
fixed makefile in project-base (#4183)
2 parents ff6f9b9 + 45ec807 commit 7e19bc6

5 files changed

Lines changed: 74 additions & 58 deletions

File tree

.gitlab-ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ tests:functional-and-acceptance-with-licenses-check:
109109
script:
110110
- cp -f ./gitlab/docker-compose-ci.yml ./docker-compose.yml
111111
- docker compose up -d
112-
- docker compose cp ./scripts php-fpm:/var/www/html/scripts
113112
- docker compose exec -T php-fpm /bin/bash -c "mv PRODUCTION DEVELOPMENT; php phing composer-dev npm-install-dependencies test-db-create frontend-api-generate-new-keys tests tests-acceptance-build tests-acceptance"
114113
- docker compose exec -T php-fpm bash -c "scripts/check-licenses.sh"
115114
after_script:

Makefile

Lines changed: 50 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -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

4040
generate-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

5252
check-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
6666
storefront-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-
8380
define 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
9895
endef
9996

10097
define 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)
107104
endef
108105

109106
define 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)
116113
endef
117114

118115
define 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
134132
endif
135133

136134
define 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)
146144
endef
147145

148146
# Cypress Acceptance Tests
@@ -159,13 +157,6 @@ selected-acceptance-tests-base: ## Runs selected base acceptance tests (interact
159157
selected-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-
169160
run-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-
190174
open-acceptance-tests-base: ## Opens the Cypress GUI for debugging base acceptance tests
191175
$(call open_acceptance_tests,base)
192176

193177
open-acceptance-tests-regression: ## Opens the Cypress GUI for debugging regression acceptance tests
194178
$(call open_acceptance_tests,regression)
195179

196180
run-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

208192
generate-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

216204
check-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."

app/symfony.lock

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -652,16 +652,16 @@
652652
]
653653
},
654654
"shopsys/administration": {
655-
"version": "17.0.x-dev"
655+
"version": "17.0.0"
656656
},
657657
"shopsys/article-feed-luigis-box": {
658-
"version": "17.0.x-dev"
658+
"version": "17.0.0"
659659
},
660660
"shopsys/brand-feed-luigis-box": {
661-
"version": "17.0.x-dev"
661+
"version": "17.0.0"
662662
},
663663
"shopsys/category-feed-luigis-box": {
664-
"version": "17.0.x-dev"
664+
"version": "17.0.0"
665665
},
666666
"shopsys/coding-standards": {
667667
"version": "v9.1.1"
@@ -685,7 +685,10 @@
685685
"version": "1.7.0"
686686
},
687687
"shopsys/luigis-box": {
688-
"version": "17.0.x-dev"
688+
"version": "17.0.0"
689+
},
690+
"shopsys/maker": {
691+
"version": "17.0.0"
689692
},
690693
"shopsys/migrations": {
691694
"version": "v9.1.1"
@@ -706,7 +709,10 @@
706709
"version": "v9.1.1"
707710
},
708711
"shopsys/product-feed-luigis-box": {
709-
"version": "17.0.x-dev"
712+
"version": "17.0.0"
713+
},
714+
"shopsys/product-feed-mergado": {
715+
"version": "17.0.0"
710716
},
711717
"shopsys/product-feed-zbozi": {
712718
"version": "v9.1.1"
@@ -917,6 +923,15 @@
917923
"config/packages/mailer.yaml"
918924
]
919925
},
926+
"symfony/maker-bundle": {
927+
"version": "1.64",
928+
"recipe": {
929+
"repo": "github.com/symfony/recipes",
930+
"branch": "main",
931+
"version": "1.0",
932+
"ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f"
933+
}
934+
},
920935
"symfony/messenger": {
921936
"version": "5.4",
922937
"recipe": {

storefront/cypress/docker/entrypoint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ echo "SPEC variable is set to: $SPEC"
55

66
if [ -n "$SPEC" ]; then
77
echo "🎯 Running specific test: $SPEC"
8-
if [ "$TYPE" = "actual" ]; then
9-
echo "🔍 Running npm run specific-actual $SPEC"
10-
npm run specific-actual "$SPEC"
8+
if [ "$TYPE" = "regression" ]; then
9+
echo "🔍 Running npm run specific-regression $SPEC"
10+
npm run specific-regression "$SPEC"
1111
else
1212
echo "🔍 Running npm run specific-base $SPEC"
1313
npm run specific-base "$SPEC"

0 commit comments

Comments
 (0)