Skip to content

Commit

Permalink
Upgradr to Symfony 6.4 beta & Asset Mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
ogizanagi committed Nov 15, 2023
1 parent c780e50 commit 71b840f
Show file tree
Hide file tree
Showing 39 changed files with 3,698 additions and 15,864 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/assets/vendor/
1 change: 0 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"eslint:recommended",
"plugin:json/recommended"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module"
Expand Down
21 changes: 3 additions & 18 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ jobs:
- name: 'Checkout'
uses: actions/checkout@v3

- name: 'Setup node'
uses: actions/setup-node@v2
with:
node-version: '16'

- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
Expand All @@ -45,40 +40,30 @@ jobs:
path: public/resized
key: resized-images-${{ secrets.CACHE_VERSION }}

- name: 'Cache NPM dependencies'
uses: actions/cache@v2
with:
path: ~/.npm
key: node-${{ hashFiles('package-lock.json') }}

- name: 'Install dependencies'
run: |
echo "::group::composer install"
composer install --no-progress --ansi
echo "::endgroup::"
echo "::group::npm install"
npm install --color=always --no-progress --no-audit
echo "::endgroup::"
- name: 'Warmup'
run: |
echo "::group::warmup production env"
npx encore production --color
bin/console cache:clear --ansi
bin/console cache:warmup --ansi
bin/console sass:build --ansi
bin/console asset-map:compile --ansi
echo "::endgroup::"
env:
NODE_ENV: production
APP_ENV: prod
WEBPACK_PUBLIC_PATH: /${{ github.event.repository.name }}/build

- name: 'Build static site'
run: bin/console stenope:build --no-interaction -vvv --ansi
env:
APP_ENV: prod
# Replace with your GH Pages URL:
ROUTER_DEFAULT_URI: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}
APP_BASE_PATH: /${{ github.event.repository.name }}

# https://github.com/marketplace/actions/deploy-to-github-pages
- name: '🚀 Deploy'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ jobs:

- name: 'Check build static'
run: |
npx encore production --color
bin/console sass:build --ansi
bin/console asset-map:compile --ansi
bin/console stenope:build --no-interaction -vvv --ansi
env:
APP_ENV: prod
Expand Down
16 changes: 7 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
Expand All @@ -13,14 +12,6 @@
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###

###> symfony/webpack-encore-bundle ###
/node_modules/
/public/build/
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-bundle ###

/build/

###> friendsofphp/php-cs-fixer ###
Expand All @@ -31,3 +22,10 @@ yarn-error.log
###> glide ###
/public/resized
###< glide ###

###> symfony/asset-mapper ###
/public/assets/
/assets/vendor
###< symfony/asset-mapper ###

/node_modules/
18 changes: 6 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ update: update.composer update.npm
update.composer:
symfony composer update

update.npm:
npm update

###############
# Development #
###############
Expand All @@ -39,13 +36,9 @@ serve:
serve.php:
symfony server:start --no-tls

## Dev - Start webpack dev server with HMR (Hot reload)
## Dev - Build Saas files
serve.assets:
npx encore dev-server --mode=development

## Dev - Watch assets
watch.assets:
npm run watch
symfony console sass:build --watch

## Clear - Clear the build dir and assets
clear.build:
Expand All @@ -61,7 +54,8 @@ clear.images:

## Build - Build assets
build.assets:
npm run build
symfony console sass:build
symfony console asset-map:compile

## Build - Build static site
build.content: export APP_ENV = prod
Expand Down Expand Up @@ -131,10 +125,10 @@ lint.phpstan@integration:
symfony php vendor/bin/phpstan --no-progress --no-interaction analyse

lint.eslint:
npx eslint assets/js --ext .js,.json --fix
npx eslint assets --ext .js,.json --fix

lint.eslint@integration:
npx eslint assets/js --ext .js,.json
npx eslint assets --ext .js,.json

########
# Test #
Expand Down
2 changes: 2 additions & 0 deletions assets/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// start the Stimulus application
import './bootstrap.js';
3 changes: 3 additions & 0 deletions assets/bootstrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { startStimulusApp } from '@symfony/stimulus-bundle';

startStimulusApp();
4 changes: 0 additions & 4 deletions assets/js/app.js

This file was deleted.

9 changes: 0 additions & 9 deletions assets/js/bootstrap.js

This file was deleted.

File renamed without changes.
File renamed without changes.
64 changes: 33 additions & 31 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,28 @@
"league/glide-symfony": "^2.0",
"phpdocumentor/reflection-docblock": "^5.2",
"stenope/stenope": "0.x-dev",
"symfony/asset": "^6.1",
"symfony/console": "^6.1",
"symfony/dotenv": "^6.1",
"symfony/expression-language": "^6.1",
"symfony/asset": "6.4.*@beta",
"symfony/asset-mapper": "6.4.*@beta",
"symfony/console": "6.4.*@beta",
"symfony/dotenv": "6.4.*@beta",
"symfony/expression-language": "6.4.*@beta",
"symfony/flex": "^1.17",
"symfony/framework-bundle": "^6.1",
"symfony/intl": "^6.1",
"symfony/mime": "^6.1",
"symfony/framework-bundle": "6.4.*@beta",
"symfony/intl": "6.4.*@beta",
"symfony/mime": "6.4.*@beta",
"symfony/monolog-bundle": "^3.1",
"symfony/process": "^6.1",
"symfony/property-access": "^6.1",
"symfony/property-info": "^6.1",
"symfony/runtime": "^6.1",
"symfony/serializer": "^6.1",
"symfony/string": "^6.1",
"symfony/translation": "^6.1",
"symfony/twig-bundle": "^6.1",
"symfony/ux-swup": "^2.4",
"symfony/webpack-encore-bundle": "^1.11",
"symfony/yaml": "^6.1",
"symfony/process": "6.4.*@beta",
"symfony/property-access": "6.4.*@beta",
"symfony/property-info": "6.4.*@beta",
"symfony/runtime": "6.4.*@beta",
"symfony/serializer": "6.4.*@beta",
"symfony/stimulus-bundle": "^2.13",
"symfony/string": "6.4.*@beta",
"symfony/translation": "6.4.*@beta",
"symfony/twig-bundle": "6.4.*@beta",
"symfony/ux-swup": "^2.13",
"symfony/yaml": "6.4.*@beta",
"symfonycasts/sass-bundle": "0.2.3",
"twig/twig": "^2.12|^3.0"
},
"require-dev": {
Expand All @@ -41,14 +43,14 @@
"phpstan/phpstan": "^1.2",
"phpstan/phpstan-strict-rules": "^1.1",
"phpstan/phpstan-symfony": "^1.0",
"symfony/browser-kit": "^6.1",
"symfony/css-selector": "^6.1",
"symfony/debug-bundle": "^6.1",
"symfony/browser-kit": "6.4.*@beta",
"symfony/css-selector": "6.4.*@beta",
"symfony/debug-bundle": "6.4.*@beta",
"symfony/maker-bundle": "^1.0",
"symfony/phpunit-bridge": "^6.1",
"symfony/stopwatch": "^6.1",
"symfony/var-dumper": "^6.1",
"symfony/web-profiler-bundle": "^6.1"
"symfony/phpunit-bridge": "6.4.*@beta",
"symfony/stopwatch": "6.4.*@beta",
"symfony/var-dumper": "6.4.*@beta",
"symfony/web-profiler-bundle": "6.4.*@beta"
},
"config": {
"optimize-autoloader": true,
Expand Down Expand Up @@ -92,19 +94,19 @@
"post-update-cmd": [
"@auto-scripts"
],
"post-create-project-cmd": [
"npm install --color=always --no-progress --no-audit"
]

"post-create-project-cmd": [
"npm install --color=always --no-progress --no-audit"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "6.1.*"
"require": "6.4.*@beta"
}
},
"prefer-stable": true
"prefer-stable": true,
"minimum-stability": "beta"
}
Loading

0 comments on commit 71b840f

Please sign in to comment.