From 21ad505523d12de327241994cb95765147eddc78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kali=C5=84ski?= Date: Fri, 20 Sep 2024 16:35:26 +0200 Subject: [PATCH] OP-546 - webpack dependencies - upgraded to Sylius-2.0 --- composer.json | 27 +++++++++++++---------- tests/Application/assets/admin/entry.js | 2 +- tests/Application/assets/controllers.json | 5 +++++ tests/Application/assets/shop/entry.js | 2 +- tests/Application/package.json | 15 ++++++++++++- tests/Application/webpack.config.js | 7 ++++-- 6 files changed, 41 insertions(+), 17 deletions(-) create mode 100644 tests/Application/assets/controllers.json diff --git a/composer.json b/composer.json index 71642b00..8e54f689 100644 --- a/composer.json +++ b/composer.json @@ -6,11 +6,14 @@ "require": { "php": "^8.1", "ext-json": "*", - "friendsofsymfony/elastica-bundle": "^6.0", - "sylius/sylius": "~1.13.0", - "symfony/property-access": "^5.4 || ^6.0", - "symfony/webpack-encore-bundle": "^1.15", - "symfony/proxy-manager-bridge": "^5.4 || ^6.0" + "friendsofsymfony/elastica-bundle": "^6.4", + "sylius/sylius": "~v2.0.0-alpha.1", + "symfony/property-access": "^6.4", + "symfony/proxy-manager-bridge": "^6.4", + "symfony/stimulus-bundle": "^2.19", + "symfony/ux-autocomplete": "^2.19", + "symfony/ux-live-component": "^2.19", + "symfony/webpack-encore-bundle": "^1.15" }, "require-dev": { "behat/behat": "^3.6.1", @@ -40,11 +43,11 @@ "robertfausk/behat-panther-extension": "^1.1", "sylius-labs/coding-standard": "^4.2", "sylius-labs/suite-tags-extension": "^0.2", - "symfony/browser-kit": "^5.4 || ^6.0", - "symfony/debug-bundle": "^5.4 || ^6.0", - "symfony/dotenv": "^5.4 || ^6.0", - "symfony/intl": "^5.4 || ^6.0", - "symfony/web-profiler-bundle": "^5.4 || ^6.0" + "symfony/browser-kit": "^6.4", + "symfony/debug-bundle": "^6.4", + "symfony/dotenv": "^6.4", + "symfony/intl": "^6.4", + "symfony/web-profiler-bundle": "^6.4" }, "conflict": { "api-platform/core": "v2.7.17", @@ -62,10 +65,10 @@ }, "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "v2.0.x-dev" }, "symfony": { - "require": "^5.4 || ^6.0" + "require": "^6.4" } }, "autoload": { diff --git a/tests/Application/assets/admin/entry.js b/tests/Application/assets/admin/entry.js index 9c0f7844..063df3e0 100644 --- a/tests/Application/assets/admin/entry.js +++ b/tests/Application/assets/admin/entry.js @@ -1 +1 @@ -import 'sylius/bundle/AdminBundle/Resources/private/entry'; \ No newline at end of file +import 'sylius/bundle/AdminBundle/Resources/assets/entrypoint'; diff --git a/tests/Application/assets/controllers.json b/tests/Application/assets/controllers.json new file mode 100644 index 00000000..696ad495 --- /dev/null +++ b/tests/Application/assets/controllers.json @@ -0,0 +1,5 @@ +{ + "controllers": { + }, + "entrypoints": [] +} diff --git a/tests/Application/assets/shop/entry.js b/tests/Application/assets/shop/entry.js index ae9a3ba7..dbb7d931 100644 --- a/tests/Application/assets/shop/entry.js +++ b/tests/Application/assets/shop/entry.js @@ -1 +1 @@ -import 'sylius/bundle/ShopBundle/Resources/private/entry'; \ No newline at end of file +import 'sylius/bundle/ShopBundle/Resources/assets/entrypoint'; diff --git a/tests/Application/package.json b/tests/Application/package.json index 36e6c1f0..96a70029 100644 --- a/tests/Application/package.json +++ b/tests/Application/package.json @@ -1,7 +1,13 @@ { "dependencies": { "@babel/polyfill": "^7.0.0", + "@popperjs/core": "^2.11.8", + "@tabler/core": "^1.0.0-beta21", + "apexcharts": "^3.53.0", + "bootstrap": "^5.3.3", "chart.js": "^3.7.1", + "flag-icons": "^7.2.3", + "infinite-tree": "^1.18.0", "jquery": "^3.5.0", "jquery.dirtyforms": "^2.0.0", "lightbox2": "^2.9.0", @@ -9,6 +15,10 @@ "slick-carousel": "^1.8.1" }, "devDependencies": { + "@hotwired/stimulus": "^3.2.2", + "@symfony/stimulus-bridge": "^3.2.2", + "@symfony/ux-autocomplete": "file:../../vendor/symfony/ux-autocomplete/assets", + "@symfony/ux-live-component": "file:../../vendor/symfony/ux-live-component/assets", "@symfony/webpack-encore": "^1.6.1", "babel-core": "^6.26.3", "babel-plugin-external-helpers": "^6.22.0", @@ -23,7 +33,10 @@ "eslint-plugin-import": "^2.11.0", "merge-stream": "^1.0.0", "sass": "^1.39.2", - "sass-loader": "^12.1.0" + "sass-loader": "^12.1.0", + "slugify": "^1.6.6", + "stimulus-use": "^0.52.2", + "tom-select": "^2.3.1" }, "scripts": { "dev": "yarn encore dev", diff --git a/tests/Application/webpack.config.js b/tests/Application/webpack.config.js index 9fce4b44..eea47ce9 100644 --- a/tests/Application/webpack.config.js +++ b/tests/Application/webpack.config.js @@ -1,7 +1,8 @@ const path = require('path'); const Encore = require('@symfony/webpack-encore'); -const [bitbagElasticsearchShop, bitbagElasticsearchAdmin] = require('../../webpack.config.js') +const [bitbagElasticsearchShop, bitbagElasticsearchAdmin] = require('../../webpack.config.js'); + const syliusBundles = path.resolve(__dirname, '../../vendor/sylius/sylius/src/Sylius/Bundle/'); const uiBundleScripts = path.resolve(syliusBundles, 'UiBundle/Resources/private/js/'); @@ -12,6 +13,7 @@ Encore .setOutputPath('public/build/shop/') .setPublicPath('/build/shop') .addEntry('shop-entry', './assets/shop/entry.js') + .enableStimulusBridge('./assets/controllers.json') .disableSingleRuntimeChunk() .cleanupOutputBeforeBuild() .enableSourceMaps(!Encore.isProduction()) @@ -32,6 +34,7 @@ Encore .setOutputPath('public/build/admin/') .setPublicPath('/build/admin') .addEntry('admin-entry', './assets/admin/entry.js') + .enableStimulusBridge('./assets/controllers.json') .disableSingleRuntimeChunk() .cleanupOutputBeforeBuild() .enableSourceMaps(!Encore.isProduction()) @@ -46,4 +49,4 @@ adminConfig.resolve.alias['sylius/bundle'] = syliusBundles; adminConfig.externals = Object.assign({}, adminConfig.externals, { window: 'window', document: 'document' }); adminConfig.name = 'admin'; -module.exports = [shopConfig, adminConfig, bitbagElasticsearchShop, bitbagElasticsearchAdmin]; \ No newline at end of file +module.exports = [shopConfig, adminConfig, bitbagElasticsearchShop, bitbagElasticsearchAdmin];