Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to Bootstrap 5 #122

Merged
merged 48 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
d3d24a8
Migration to BS v5.0
mycreedo Sep 9, 2023
5c4e5a6
Migration to BS v5.0 - BS Components
mycreedo Sep 9, 2023
d44c551
Migration to BS v5.3 - Replace deprecated classes
mycreedo Sep 9, 2023
7cf4ad5
Remove not necessary dependencies
mycreedo Nov 2, 2023
0a8161c
Sass architecture structure and default variables
mycreedo Nov 2, 2023
a0d69c5
Add example of custom font-family
mycreedo Nov 2, 2023
b7e7ffb
Change default webpack output to public/themes/ dir
mycreedo Nov 4, 2023
8b63431
Design changes for header, footer and homepage
mycreedo Nov 4, 2023
f3feaff
Error pages in new direction
mycreedo Nov 10, 2023
c5df502
Fix address book error
mycreedo Nov 10, 2023
aba0dfe
Fix sorting & search on category page
mycreedo Nov 10, 2023
e3d608e
Improve responsiveness of homepage
mycreedo Nov 10, 2023
a6c6f0c
Add prefooter banner
mycreedo Nov 10, 2023
38d51bc
Align pre-footer to main container line
mycreedo Nov 10, 2023
17a5d1b
Move user widget to header main bar
mycreedo Nov 10, 2023
cabee8c
Fix spacing of headings on homepage
mycreedo Nov 16, 2023
e99e2a6
Design changes for taxon/category pages
mycreedo Nov 16, 2023
b62a601
Add styles for pagination component
mycreedo Dec 1, 2023
cd1d931
Add breadcrumbs macro, user panel styling
mycreedo Dec 1, 2023
dc5bf09
Product details page styling
mycreedo Dec 4, 2023
9c636e1
Product reviews page styling
mycreedo Dec 4, 2023
603aa36
Account dashboard styling
mycreedo Dec 4, 2023
536f50d
Cart page styling
mycreedo Dec 5, 2023
a2fda5a
Cart widget styling
mycreedo Dec 7, 2023
043b36d
Checkout process styling
mycreedo Dec 7, 2023
27be3fb
Authorization pages & header styling
mycreedo Dec 7, 2023
88b8e8a
Minor changes and improvements
mycreedo Dec 7, 2023
e7f38e6
Add promotion labels
mycreedo Dec 7, 2023
fc5acad
Fix spacing in cart popup
mycreedo Dec 7, 2023
9a87759
Tests moved to 1.12
RadnoK Dec 30, 2023
43ec4bd
Configuration fixes on test Sylius instance
RadnoK Dec 30, 2023
93b0843
Fix shadows and header
RadnoK Dec 30, 2023
67a774f
Merge pull request #1 from 8lines/tests-moved-to-1-12
RadnoK Dec 30, 2023
ebfe435
Add new demo images
RadnoK Dec 30, 2023
a5a00f6
Update README.md
RadnoK Dec 30, 2023
f0f55b0
Update Behat test suites
RadnoK Dec 30, 2023
803c242
update ci version
oallain Jan 2, 2024
56965b6
update ci twigCS
oallain Jan 2, 2024
084f63b
fix twigCS errors
oallain Jan 2, 2024
27671cd
add glightbox in Readme front dependencies
oallain Jan 5, 2024
4dd453e
fix twigCS errors
oallain Jan 5, 2024
5fc9d8b
add PHPUnit tests
oallain Jan 5, 2024
d07f079
run PHPUnit in Github Action
oallain Jan 5, 2024
8381e58
add tests for pages
oallain Jan 6, 2024
7c2f67d
add ESLint to CI
oallain Jan 6, 2024
b2a27ad
refacto(sass-utils): clean duplicate bs5 variables declaration
maxperei Jan 11, 2024
c1896d1
refacto(js): clean duplicate bootstrap import
maxperei Jan 11, 2024
c52d301
Merge pull request #2 from maxperei/migration-to-bs5
mycreedo Jan 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 16 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
},
extends: [
"eslint:recommended",
],
parserOptions: {
sourceType: "module"
},
globals: {
Translator: 'readonly',
},
};
18 changes: 14 additions & 4 deletions .github/workflows/code_quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

-
name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.0'
coverage: none

- name: Composer - Get Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- uses: actions/cache@v1
- uses: actions/cache@v3
id: cache-composer
with:
path: ${{ steps.composer-cache.outputs.dir }}
Expand All @@ -48,5 +48,15 @@ jobs:
- name: Composer - Update dependencies
run: composer update --no-progress

- name: Yarn install
uses: borales/actions-yarn@v4
with:
cmd: install

- name: Yarn ESLint
uses: borales/actions-yarn@v4
with:
cmd: lint

- name: TwigCS - Check
run: vendor/bin/twigcs SyliusShopBundle/ --severity error --display blocking
run: vendor/bin/twigcs templates/ --severity error --display blocking --reporter githubAction
101 changes: 101 additions & 0 deletions .github/workflows/sylius.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Install & Test
'on':
push:
branches:
- master
paths-ignore:
- README.md
pull_request:
paths-ignore:
- README.md
jobs:
sylius:
name: 'Sylius ${{ matrix.sylius }} Node ${{ matrix.node }}'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- 8.2
sylius:
- 1.12.0
symfony:
- 6.3
node:
- 18.x
env:
APP_ENV: test
package-name: sylius/bootstrap-theme
steps:
-
name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: '${{ matrix.php }}'
ini-values: date.timezone=UTC
extensions: intl
tools: symfony
coverage: none
-
name: 'Setup Node'
uses: actions/setup-node@v3
with:
node-version: '${{ matrix.node }}'
-
uses: actions/checkout@v3
-
name: 'Composer - Get Cache Directory'
id: composer-cache
run: 'echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT'
-
name: 'Composer - Set cache'
uses: actions/cache@v3
id: cache-composer
with:
path: '${{ steps.composer-cache.outputs.dir }}'
key: 'php-${{ matrix.php }}-sylius-${{ matrix.sylius }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles(''**/composer.json'') }}'
restore-keys: 'php-${{ matrix.php }}-sylius-${{ matrix.sylius }}-symfony-${{ matrix.symfony }}-composer-'
-
name: 'Composer - Create cache directory'
run: 'mkdir -p /home/runner/.composer/cache'
if: 'steps.cache-composer.outputs.cache-hit != ''true'''
-
name: 'Composer - Github Auth'
run: 'composer config -g github-oauth.github.com ${{ github.token }}'
-
name: 'Yarn - Get cache directory'
id: yarn-cache
run: 'echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT'
-
name: 'Yarn - Set Cache'
uses: actions/cache@v3
with:
path: '${{ steps.yarn-cache.outputs.dir }}'
key: 'node-${{ matrix.node }}-yarn-${{ hashFiles(''**/package.json **/yarn.lock'') }}'
restore-keys: "node-${{ matrix.node }}-yarn-\n"
-
name: 'Install Sylius-Standard and Plugin'
run: 'make install -e SYLIUS_VERSION=${{ matrix.sylius }} SYMFONY_VERSION=${{ matrix.symfony }} PHP_VERSION=${{ matrix.php }}'
-
name: 'Output PHP version for Symfony CLI'
working-directory: ./tests/Application
run: 'php -v | head -n 1 | awk ''{ print $2 }'' > .php-version'
-
name: 'Install certificates'
working-directory: ./tests/Application
run: 'symfony server:ca:install'
-
name: 'Run webserver'
working-directory: ./tests/Application
run: 'symfony server:start --port=8080 --dir=public --daemon'
-
name: 'Run PHPUnit'
run: 'make phpunit'
services:
mariadb:
image: 'mariadb:10'
ports:
- '3306:3306'
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
options: '--health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3'
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
/vendor/
/node_modules
/composer.lock

/etc/build/*
!/etc/build/.gitignore

/tests/Application/yarn.lock
/tests/Application/
/install/Application/*.local

/.phpunit.result.cache
/behat.yml
/phpspec.yml
/phpunit.xml

###> symfony/webpack-encore-bundle ###
/node_modules/
Expand Down
69 changes: 0 additions & 69 deletions Dockerfile

This file was deleted.

145 changes: 86 additions & 59 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,63 +1,90 @@
.DEFAULT_GOAL := help
SHELL=/bin/bash
COMPOSER_ROOT=composer
TEST_DIRECTORY=tests/Application
CONSOLE=cd tests/Application && php bin/console -e test
COMPOSER=cd tests/Application && composer
YARN=cd tests/Application && yarn

##
## Project setup
##---------------------------------------------------------------------------
.PHONY: install start stop clean

install: start ## Install requirements for tests
sudo chmod -Rf 777 tests/Application/var
sudo chmod -Rf 777 tests/Application/public/media
docker-compose exec php php -d memory_limit=-1 /usr/bin/composer install
docker-compose exec nodejs yarn --cwd tests/Application install
docker-compose exec php tests/Application/bin/console doctrine:database:create --if-not-exists -vvv
docker-compose exec php tests/Application/bin/console doctrine:schema:create -vvv
docker-compose exec php tests/Application/bin/console assets:install tests/Application/public -vvv
docker-compose exec nodejs yarn --cwd tests/Application build
docker-compose exec php php -d memory_limit=-1 tests/Application/bin/console cache:warmup -vvv
docker-compose exec php tests/Application/bin/console sylius:fixtures:load -n

start: ## Start the project
docker-compose up -d

stop: ## Stop and clean
docker-compose kill
docker-compose rm -v --force

clean: stop ## Clean plugin
docker-compose down -v
sudo rm -Rf node_modules vendor .phpunit.result.cache composer.lock

##
## Assets
##---------------------------------------------------------------------------
.PHONY: assets assets-watch

assets: ## Build assets for dev environment
docker-compose exec nodejs yarn --cwd tests/Application dev

assets-watch: ## Watch asset during development
docker-compose exec nodejs yarn --cwd tests/Application watch

##
## QA
##---------------------------------------------------------------------------
.PHONY: validate behat ci

validate: ## Validate composer.json
docker-compose exec php composer validate --ansi --strict

behat: ## Run behat
docker-compose exec php php -d memory_limit=-1 vendor/bin/behat --profile docker --colors --strict -vvv -f progress --no-interaction --tags="@javascript && ~@todo && ~@cli"

ci: validate behat ## Execute github actions tasks

##
## Utilities
##---------------------------------------------------------------------------
.PHONY: help
SYLIUS_VERSION=1.12.0
SYMFONY_VERSION=6.3
PHP_VERSION=8.2
PLUGIN_NAME=sylius/bootstrap-theme

###
### DEVELOPMENT
### ¯¯¯¯¯¯¯¯¯¯¯

install: sylius ## Install Plugin on Sylius [SYLIUS_VERSION=1.12.0] [SYMFONY_VERSION=6.3] [PHP_VERSION=8.2]
.PHONY: install

reset: ## Remove dependencies
ifneq ("$(wildcard tests/Application/bin/console)","")
${CONSOLE} doctrine:database:drop --force --if-exists || true
endif
rm -rf tests/Application
.PHONY: reset

phpunit: phpunit-configure phpunit-run ## Run PHPUnit
.PHONY: phpunit

###
### OTHER
### ¯¯¯¯¯¯

sylius: sylius-standard update-dependencies install-plugin install-theme install-sylius
.PHONY: sylius

help: ## Show all make tasks (default)
@grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
sylius-standard:
${COMPOSER_ROOT} create-project sylius/sylius-standard ${TEST_DIRECTORY} "~${SYLIUS_VERSION}" --no-install --no-scripts
${COMPOSER} config allow-plugins true
${COMPOSER} require sylius/sylius:"~${SYLIUS_VERSION}"

-include Makefile.local
update-dependencies:
${COMPOSER} config extra.symfony.require "~${SYMFONY_VERSION}"
${COMPOSER} update --no-progress -n

install-plugin:
${COMPOSER} config repositories.plugin '{"type": "path", "url": "../../"}'
${COMPOSER} config extra.symfony.allow-contrib true
${COMPOSER} config minimum-stability "dev"
${COMPOSER} config prefer-stable true
${COMPOSER} req ${PLUGIN_NAME}:* --prefer-source --no-scripts

install-theme:
ifneq ("$(wildcard install/Application)","")
cp -r install/Application tests
endif
mkdir ${TEST_DIRECTORY}/themes/BootstrapTheme
cp -r assets ${TEST_DIRECTORY}/themes/BootstrapTheme
cp -r templates ${TEST_DIRECTORY}/themes/BootstrapTheme
cp composer.json ${TEST_DIRECTORY}/themes/BootstrapTheme
cp webpack.config.js ${TEST_DIRECTORY}/themes/BootstrapTheme
echo "const bootstrapTheme = require('./themes/BootstrapTheme/webpack.config');" >> ${TEST_DIRECTORY}/webpack.config.js
echo "module.exports = [shopConfig, adminConfig, appShopConfig, appAdminConfig, bootstrapTheme];" >> ${TEST_DIRECTORY}/webpack.config.js
echo " bootstrapTheme:" >> ${TEST_DIRECTORY}/config/packages/assets.yaml
echo " json_manifest_path: '%kernel.project_dir%/public/themes/bootstrap-theme/manifest.json'" >> ${TEST_DIRECTORY}/config/packages/assets.yaml
echo " bootstrapTheme: '%kernel.project_dir%/public/themes/bootstrap-theme'" >> ${TEST_DIRECTORY}/config/packages/webpack_encore.yaml

install-sylius:
${CONSOLE} doctrine:database:create --if-not-exists
${CONSOLE} doctrine:migrations:migrate -n
${CONSOLE} sylius:fixtures:load default -n
${YARN} install
${YARN} add bootstrap@^5.3 @fortawesome/fontawesome-free@^6.4.2 lightbox axios @popperjs/core@^2.11 glightbox
${YARN} build
${CONSOLE} cache:clear

phpunit-configure:
cp phpunit.xml.dist ${TEST_DIRECTORY}/phpunit.xml

phpunit-run:
cd ${TEST_DIRECTORY} && ./vendor/bin/phpunit --testdox

help: SHELL=/bin/bash
help: ## Dislay this help
@IFS=$$'\n'; for line in `grep -h -E '^[a-zA-Z_#-]+:?.*?##.*$$' $(MAKEFILE_LIST)`; do if [ "$${line:0:2}" = "##" ]; then \
echo $$line | awk 'BEGIN {FS = "## "}; {printf "\033[33m %s\033[0m\n", $$2}'; else \
echo $$line | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m%s\n", $$1, $$2}'; fi; \
done; unset IFS;
.PHONY: help
Loading
Loading