This is a skeleton for a Symfony 4 project.
--- ✂ --------------------------------------------------------------------------
composer create-project itk-dev/symfony-4-skeleton my-itk-dev-project
- Edit
.env
and define theCOMPOSE_PROJECT_NAME
variable. - Edit
$header
in.php_cs.dist
. - Edit
README.md
(Remove optional sections and describe your actual project).
composer require symfony/orm-pack
composer require --dev symfony/maker-bundle
Set DATABASE_URL
in .env.dev
:
DATABASE_URL=mysql://db:db@mariadb:3306/db
composer require admin
composer require alterphp/easyadmin-extension-bundle
composer require api
composer require encore
Add tools for linting assets:
yarn add --dev eslint eslint-config-standard eslint-plugin-import eslint-plugin-node eslint-plugin-promise eslint-plugin-standard
yarn add --dev stylelint stylelint-config-recommended-scss stylelint-scss
Add these lines to scripts
in package.json
:
"check-coding-standards/stylelint": "stylelint --config=.stylelintrc.js 'assets/**/*.scss'",
"check-coding-standards/scss": "yarn run check-coding-standards/stylelint",
"check-coding-standards/eslint": "eslint --config .eslintrc.js 'assets/**/*.js'",
"check-coding-standards/js": "yarn run check-coding-standards/eslint",
"check-coding-standards": "yarn run check-coding-standards/scss; yarn run check-coding-standards/js",
"apply-coding-standards/stylelint": "stylelint --config=.stylelintrc.js 'assets/**/*.scss' --fix",
"apply-coding-standards/scss": "yarn run apply-coding-standards/stylelint",
"apply-coding-standards/eslint": "eslint --config .eslintrc.js 'assets/**/*.js' --fix",
"apply-coding-standards/js": "yarn run apply-coding-standards/eslint",
"apply-coding-standards": "yarn run apply-coding-standards/scss; yarn run apply-coding-standards/js"
See also:
--- ✂ --------------------------------------------------------------------------
docker-compose pull
docker-compose up -d
Open the site in your default browser:
open http://$(docker-compose port nginx 80)
Check Symfony coding standards using PHP Coding Standards Fixer and PHP_CodeSniffer:
composer check-coding-standards
Apply Symfony coding standards:
composer apply-coding-standards
Check Twig templates using Twigcs:
composer check-coding-standards/twigcs
--- ✂ --- (remove this section if not using encore) ----------------------------
Check coding standards in all assets:
yarn check-coding-standards
Check coding standards in SCSS files:
yarn check-coding-standards/scss
Check coding standards in JavaScript files:
yarn check-coding-standards/js
Apply coding standards to all assets:
yarn apply-coding-standards
Apply coding standards to SCSS files:
yarn apply-coding-standards/scss
Apply coding standards to JavaScript files:
yarn apply-coding-standards/js
--- ✂ --------------------------------------------------------------------------