From 056c77100ea3f72f69b8e2ef5de222d722dc5067 Mon Sep 17 00:00:00 2001 From: zalmanix <65413567+zalmanix@users.noreply.github.com> Date: Mon, 7 Feb 2022 09:27:18 +0100 Subject: [PATCH] webpack implementation fix for hints not showing (#197) * initial commit * initial commit * not fixed * hot not fix * basic webpack implementation * implement webpack * implement webpack * added fixes and mobile support * deleated package-lock.json * Delete yarn.lock * adding new lines and deleated public build * Change input to symfony form row * GHA fix * GHA fix * Gha fix build->encore * Fix spec ImageTransformer * Gha fix node version changed to 14.x * scrutinizer node fix * scrutinizer node fix * scrutinizer node fix Co-authored-by: kuba-end Co-authored-by: Tomasz Grochowski --- .github/workflows/build.yml | 4 +- .gitignore | 25 + composer.json | 4 +- package.json | 12 + .../Product/ImageTransformerSpec.php | 2 +- src/Form/Type/SearchBoxType.php | 5 +- src/Resources/assets/admin/entry.js | 2 + src/Resources/assets/admin/js/index.js | 0 src/Resources/assets/admin/scss/main.scss | 0 src/Resources/assets/shop/entry.js | 2 + .../shop/js/elasticSearchAutocomplete.js | 133 ++ src/Resources/assets/shop/js/index.js | 1 + .../assets/shop/js/initAutocomleate.js | 3 + .../shop/scss/elasticSearchAutocomplete.scss | 92 + src/Resources/assets/shop/scss/main.scss | 2 + .../public/bitbag-elasticsearch-admin.css | 1 + .../public/bitbag-elasticsearch-admin.js | 111 ++ .../public/bitbag-elasticsearch-shop.css | 64 + .../public/bitbag-elasticsearch-shop.js | 319 ++++ .../public/css/bitbag-autocomplete-search.css | 3 - src/Resources/public/entrypoints.json | 20 + .../public/js/bitbag-autocomplete-search.js | 52 - src/Resources/public/manifest.json | 6 + .../views/Shop/Menu/_searchForm.html.twig | 16 +- src/Transformer/Product/ImageTransformer.php | 2 +- tests/Application/.env | 2 +- tests/Application/.github/CODEOWNERS | 2 + tests/Application/.github/workflows/build.yml | 195 ++ tests/Application/.gitignore | 3 + tests/Application/assets/admin/entry.js | 1 + tests/Application/assets/shop/entry.js | 1 + tests/Application/composer.json | 7 +- tests/Application/composer.lock | 1603 +++++++++++++++++ tests/Application/config/bundles.php | 1 + tests/Application/config/packages/assets.yaml | 11 + .../config/packages/webpack_encore.yaml | 8 + ...lpfile.babel.js => gulpfile.babel.js.temp} | 0 tests/Application/package.json | 26 +- .../SyliusAdminBundle/_scripts.html.twig | 2 + .../SyliusAdminBundle/_styles.html.twig | 2 + .../SyliusShopBundle/_scripts.html.twig | 2 + .../SyliusShopBundle/_styles.html.twig | 2 + tests/Application/webpack.config.js | 49 + webpack.config.js | 40 + 44 files changed, 2750 insertions(+), 88 deletions(-) create mode 100644 package.json create mode 100644 src/Resources/assets/admin/entry.js create mode 100644 src/Resources/assets/admin/js/index.js create mode 100644 src/Resources/assets/admin/scss/main.scss create mode 100644 src/Resources/assets/shop/entry.js create mode 100644 src/Resources/assets/shop/js/elasticSearchAutocomplete.js create mode 100644 src/Resources/assets/shop/js/index.js create mode 100644 src/Resources/assets/shop/js/initAutocomleate.js create mode 100644 src/Resources/assets/shop/scss/elasticSearchAutocomplete.scss create mode 100644 src/Resources/assets/shop/scss/main.scss create mode 100644 src/Resources/public/bitbag-elasticsearch-admin.css create mode 100644 src/Resources/public/bitbag-elasticsearch-admin.js create mode 100644 src/Resources/public/bitbag-elasticsearch-shop.css create mode 100644 src/Resources/public/bitbag-elasticsearch-shop.js delete mode 100644 src/Resources/public/css/bitbag-autocomplete-search.css create mode 100644 src/Resources/public/entrypoints.json delete mode 100644 src/Resources/public/js/bitbag-autocomplete-search.js create mode 100644 src/Resources/public/manifest.json create mode 100644 tests/Application/.github/CODEOWNERS create mode 100644 tests/Application/.github/workflows/build.yml create mode 100644 tests/Application/assets/admin/entry.js create mode 100644 tests/Application/assets/shop/entry.js create mode 100644 tests/Application/composer.lock create mode 100644 tests/Application/config/packages/assets.yaml create mode 100644 tests/Application/config/packages/webpack_encore.yaml rename tests/Application/{gulpfile.babel.js => gulpfile.babel.js.temp} (100%) create mode 100644 tests/Application/templates/bundles/SyliusAdminBundle/_scripts.html.twig create mode 100644 tests/Application/templates/bundles/SyliusAdminBundle/_styles.html.twig create mode 100644 tests/Application/templates/bundles/SyliusShopBundle/_scripts.html.twig create mode 100644 tests/Application/templates/bundles/SyliusShopBundle/_styles.html.twig create mode 100644 tests/Application/webpack.config.js create mode 100644 webpack.config.js diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb911e4..a050fb4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: php: ["8.0", "7.4"] symfony: ["^4.4", "^5.2"] sylius: ["~1.9.0", "~1.10.0"] - node: ["10.x"] + node: ["14.x"] mysql: ["8.0"] exclude: @@ -157,7 +157,7 @@ jobs: name: Prepare test application assets run: | (cd tests/Application && bin/console assets:install public -vvv) - (cd tests/Application && yarn build) + (cd tests/Application && yarn encore production) - name: Prepare test application cache diff --git a/.gitignore b/.gitignore index 07229a6..cd0efc5 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,28 @@ /behat.yml /phpspec.yml + +/vendor/ +/node_modules/ +package-lock.json + +/etc/build/* +!/etc/build/.gitignore + +tests/Application/node_modules/ + +tests/Application/var/ +!tests/Application/var/.gitkeep + +tests/Application/web/* +!tests/Application/web/favicon.ico +!tests/Application/web/app.php +!tests/Application/web/app_dev.php +!tests/Application/web/app_test.php + +/tests/Application/yarn.lock + +/composer.lock + +/etc/build/* +!/etc/build/.gitkeep \ No newline at end of file diff --git a/composer.json b/composer.json index b8be63d..6052bf1 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,9 @@ "sylius/sylius": "~1.8.0 || ~1.9.0 || ~1.10.0", "friendsofsymfony/elastica-bundle": "^6.0", "symfony/property-access": "^4.4 || ^5.2", - "bitbag/coding-standard": "^1.0" + "bitbag/coding-standard": "^1.0", + "symfony/orm-pack": "^2.1", + "symfony/webpack-encore-bundle": "^1.13" }, "require-dev": { "behat/behat": "^3.6.1", diff --git a/package.json b/package.json new file mode 100644 index 0000000..40e9aca --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "@bitbag/elasticsearch-plugin", + "description": "Elasticsearch plugin for Sylius.", + "repository": "https://github.com/BitBagCommerce/[...].git", + "license": "MIT", + "scripts": { + "dist": "yarn encore production --config-name bitbag-plugin-dist" + }, + "dependencies": { + "node-sass": "7.0.1" + } +} diff --git a/spec/Transformer/Product/ImageTransformerSpec.php b/spec/Transformer/Product/ImageTransformerSpec.php index 649eedc..fc33093 100644 --- a/spec/Transformer/Product/ImageTransformerSpec.php +++ b/spec/Transformer/Product/ImageTransformerSpec.php @@ -34,7 +34,7 @@ final class ImageTransformerSpec extends ObjectBehavior ImageInterface $productImage, FilterService $filterService ): void { - $product->getImagesByType('thumbnail')->willReturn(new ArrayCollection([$productImage->getWrappedObject()])); + $product->getImagesByType('main')->willReturn(new ArrayCollection([$productImage->getWrappedObject()])); $productImage->getPath()->willReturn('/path-to-image'); $filterService diff --git a/src/Form/Type/SearchBoxType.php b/src/Form/Type/SearchBoxType.php index 29a477c..5bba926 100644 --- a/src/Form/Type/SearchBoxType.php +++ b/src/Form/Type/SearchBoxType.php @@ -27,7 +27,10 @@ final class SearchBoxType extends AbstractType SymfonySearchType::class, [ 'label' => false, - 'attr' => ['placeholder' => 'bitbag_sylius_elasticsearch_plugin.ui.search_box.query.placeholder'], + 'attr' => [ + 'placeholder' => 'bitbag_sylius_elasticsearch_plugin.ui.search_box.query.placeholder', + 'class' => 'prompt app-quick-add-code-input', + ], 'constraints' => [new NotBlank()], ] ) diff --git a/src/Resources/assets/admin/entry.js b/src/Resources/assets/admin/entry.js new file mode 100644 index 0000000..9b7cbfb --- /dev/null +++ b/src/Resources/assets/admin/entry.js @@ -0,0 +1,2 @@ +import './scss/main.scss' +import './js/' diff --git a/src/Resources/assets/admin/js/index.js b/src/Resources/assets/admin/js/index.js new file mode 100644 index 0000000..e69de29 diff --git a/src/Resources/assets/admin/scss/main.scss b/src/Resources/assets/admin/scss/main.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/Resources/assets/shop/entry.js b/src/Resources/assets/shop/entry.js new file mode 100644 index 0000000..6306ee0 --- /dev/null +++ b/src/Resources/assets/shop/entry.js @@ -0,0 +1,2 @@ +import './scss/main.scss' +import './js/' \ No newline at end of file diff --git a/src/Resources/assets/shop/js/elasticSearchAutocomplete.js b/src/Resources/assets/shop/js/elasticSearchAutocomplete.js new file mode 100644 index 0000000..746735e --- /dev/null +++ b/src/Resources/assets/shop/js/elasticSearchAutocomplete.js @@ -0,0 +1,133 @@ +export default class ElasticSearchAutocomplete { + constructor( + config = {}, + ) { + this.config = config; + this.defaultConfig = { + searchFields: '.searchdiv', + baseAutocompleteVariantUrl: '[data-bb-elastic-url]', + searchInput: '.app-quick-add-code-input', + resultsTarget: '.results', + resultContainerClassesArray: ['result'], + resultImageClass: 'image', + resultContentClass: 'result__content', + resultPriceClass: 'result__price', + resultTitleClass: 'js-title', + resultDescriptionClass: 'result__description', + resultLinkClass: 'result__link', + resultCategoryClass: 'result__category', + resultImageClass: 'result__image', + resultContainerClass: 'result__container', + }; + this.finalConfig = {...this.defaultConfig, ...config}; + this.searchFieldsSelector = document.querySelector(this.finalConfig.searchFields); + } + + init() { + if (this.config && typeof this.config !== 'object') { + throw new Error('BitBag - CreateConfirmationModal - given config is not valid - expected object'); + } + + this._debounce(); + } + + _toggleModalVisibility(elements) { + document.addEventListener('variantsVisible', () => { + document.addEventListener('click', () => { + elements.forEach((element) => { + element.innerHTML = ''; + element.style.display = 'none'; + }); + }); + }); + } + + _modalTemplate(item, categoryStyle) { + const result = document.createElement('a'); + result.classList.add(...this.finalConfig.resultContainerClassesArray, 'js-result'); + result.innerHTML = ` +

${item.taxon_name}

+ +
+ +
+
${item.name}
+
${item.price}
+
+
+
+ `; + + return result; + } + + _assignElements(entry, data) { + const currentResults = this.searchFieldsSelector.querySelector(this.finalConfig.resultsTarget); + + currentResults.innerHTML = '' + currentResults.style = 'visibility: visible'; + + const allResults = document.querySelectorAll(this.finalConfig.resultsTarget); + + if (data.items.length === 0) { + currentResults.innerHTML = '
no matching results
'; + } + + data.items = data.items.sort((a,b) => { + if (b.taxon_name < a.taxon_name) return 1; + if (b.taxon_name > a.taxon_name) return -1; + return 0; + }); + + let tempTaxonName; + data.items.forEach((item) => { + + let categoryStyle = "visibility: visible" + if (tempTaxonName == item.taxon_name) { + categoryStyle = "visibility: hidden"; + } + + tempTaxonName = item.taxon_name; + currentResults.appendChild(this._modalTemplate(item, categoryStyle)); + }); + + currentResults.style.display = 'block'; + this._toggleModalVisibility(allResults); + + const customEvent = new CustomEvent('variantsVisible'); + document.dispatchEvent(customEvent); + } + + async _getProducts(entry) { + const variantUrl = document.querySelector(this.finalConfig.baseAutocompleteVariantUrl).dataset.bbElasticUrl; + const url = `${variantUrl}?query=${entry.value}`; + + entry.parentNode.classList.add('loading'); + + try { + const response = await fetch(url); + const data = await response.json(); + + this._assignElements(entry, data); + } catch (error) { + console.error(error); + } finally { + entry.parentNode.classList.remove('loading'); + } + } + + _debounce() { + const codeInputs = document.querySelectorAll(this.finalConfig.searchInput); + let timeout; + + codeInputs.forEach((input) => { + input.addEventListener('input', () => { + clearTimeout(timeout); + timeout = setTimeout(() => { + this._getProducts(input); + }, 400); + }); + }); + } + +} diff --git a/src/Resources/assets/shop/js/index.js b/src/Resources/assets/shop/js/index.js new file mode 100644 index 0000000..a472edd --- /dev/null +++ b/src/Resources/assets/shop/js/index.js @@ -0,0 +1 @@ +import './initAutocomleate'; \ No newline at end of file diff --git a/src/Resources/assets/shop/js/initAutocomleate.js b/src/Resources/assets/shop/js/initAutocomleate.js new file mode 100644 index 0000000..8e4e324 --- /dev/null +++ b/src/Resources/assets/shop/js/initAutocomleate.js @@ -0,0 +1,3 @@ +import ElasticSearchAutocomplete from './elasticSearchAutocomplete'; + +new ElasticSearchAutocomplete().init(); \ No newline at end of file diff --git a/src/Resources/assets/shop/scss/elasticSearchAutocomplete.scss b/src/Resources/assets/shop/scss/elasticSearchAutocomplete.scss new file mode 100644 index 0000000..b5d5313 --- /dev/null +++ b/src/Resources/assets/shop/scss/elasticSearchAutocomplete.scss @@ -0,0 +1,92 @@ +.results { + margin-top: 0.5rem; + position: absolute; + left: 50%; + -webkit-transform: translateX(-50%); + transform: translateX(-50%); + min-width: 100%; + width: 600px; + padding: 0 1rem 0 1rem; + background-color: white; + backdrop-filter: blur(1px); + z-index: 16; + box-shadow: 0px 1px 2px 0px #d4d4d5, 0px 0px 0px 1px #d4d4d5; + visibility: hidden; + color: #050428; + max-height: 50vh; + overflow-x: auto; + + @media (max-width: 767px) { + width: 300px; + } + + .result { + padding: 1px; + + &__category { + padding-top: 1rem; + color: #050428; + } + + &__link { + padding-top: 1rem; + + .result__container { + max-height: 400px; + box-shadow: 0px 1px 1px 0px #d4d4d5, 0px 0px 0px 1px #d4d4d5; + color: #050428; + display: flex; + flex-direction: row; + align-items: center; + + .result__image { + max-width: 7rem; + max-height: 7rem; + width: 100%; + padding: 0.5rem; + object-fit: cover; + + @media (max-width: 767px){ + max-width: 6rem; + max-height: 6rem; + } + } + + .result__content { + display: flex; + flex-direction: row; + justify-content: space-between; + font-weight: bold; + padding: 0.5rem 3.7rem 0 0; + + + @media (max-width: 767px) { + flex-direction: column; + justify-content: space-evenly; + text-align: left; + width: 100%; + padding: 1rem; + } + + .result__price { + position: absolute; + right: 1.5rem; + + @media (max-width: 767px) { + position: relative; + right: 0; + } + } + } + + .result__description { + padding: 10px; + } + } + + .result__container:hover { + background-color: rgba(250, 250, 250, 0.952); + } + } + } +} diff --git a/src/Resources/assets/shop/scss/main.scss b/src/Resources/assets/shop/scss/main.scss new file mode 100644 index 0000000..e997738 --- /dev/null +++ b/src/Resources/assets/shop/scss/main.scss @@ -0,0 +1,2 @@ +@import './elasticSearchAutocomplete.scss'; + diff --git a/src/Resources/public/bitbag-elasticsearch-admin.css b/src/Resources/public/bitbag-elasticsearch-admin.css new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/Resources/public/bitbag-elasticsearch-admin.css @@ -0,0 +1 @@ + diff --git a/src/Resources/public/bitbag-elasticsearch-admin.js b/src/Resources/public/bitbag-elasticsearch-admin.js new file mode 100644 index 0000000..5352123 --- /dev/null +++ b/src/Resources/public/bitbag-elasticsearch-admin.js @@ -0,0 +1,111 @@ +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./src/Resources/assets/admin/js/index.js": +/*!************************************************!*\ + !*** ./src/Resources/assets/admin/js/index.js ***! + \************************************************/ +/***/ (() => { + + + +/***/ }), + +/***/ "./src/Resources/assets/admin/scss/main.scss": +/*!***************************************************!*\ + !*** ./src/Resources/assets/admin/scss/main.scss ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be in strict mode. +(() => { +"use strict"; +/*!*********************************************!*\ + !*** ./src/Resources/assets/admin/entry.js ***! + \*********************************************/ +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _scss_main_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scss/main.scss */ "./src/Resources/assets/admin/scss/main.scss"); +/* harmony import */ var _js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./js/ */ "./src/Resources/assets/admin/js/index.js"); +/* harmony import */ var _js___WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_js___WEBPACK_IMPORTED_MODULE_1__); + + +})(); + +/******/ })() +; \ No newline at end of file diff --git a/src/Resources/public/bitbag-elasticsearch-shop.css b/src/Resources/public/bitbag-elasticsearch-shop.css new file mode 100644 index 0000000..5336d0d --- /dev/null +++ b/src/Resources/public/bitbag-elasticsearch-shop.css @@ -0,0 +1,64 @@ +.results { + min-width: 33vw; + padding: 0 1rem 1rem 1rem; + background-color: white; + backdrop-filter: blur(1px); + position: absolute; + z-index: 16; + box-shadow: 0px 1px 2px 0px #d4d4d5, 0px 0px 0px 1px #d4d4d5; + visibility: hidden; + color: #050428; + max-height: 50vh; + overflow-x: auto; +} + +.results .result { + padding: 1px; +} + +.results .result .result__category { + padding-top: 1em; + color: #050428; +} + +.results .result .result__link { + padding-top: 1 em; +} + +.results .result .result__link .result__container { + max-height: 400px; + padding: 1 rem; + box-shadow: 0px 1px 1px 0px #d4d4d5, 0px 0px 0px 1px #d4d4d5; + color: #050428; + display: flex; + flex-direction: row; +} + +.results .result .result__link .result__container .result__image { + max-width: 12vw; + max-height: 12vh; + padding: 1em; +} + +.results .result .result__link .result__container .result__content { + padding-left: 1em; + display: flex; + flex-direction: row; + justify-content: space-between; + font-weight: bold; + align-items: center; +} + +.results .result .result__link .result__container .result__content .result__price { + position: absolute; + right: 5%; +} + +.results .result .result__link .result__container .result__description { + padding: 10px; +} + +.results .result .result__link .result__container:hover { + background-color: rgba(250, 250, 250, 0.952); +} + diff --git a/src/Resources/public/bitbag-elasticsearch-shop.js b/src/Resources/public/bitbag-elasticsearch-shop.js new file mode 100644 index 0000000..c6b1d83 --- /dev/null +++ b/src/Resources/public/bitbag-elasticsearch-shop.js @@ -0,0 +1,319 @@ +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "./src/Resources/assets/shop/js/elastictSearchAutocomplete.js": +/*!********************************************************************!*\ + !*** ./src/Resources/assets/shop/js/elastictSearchAutocomplete.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ ElasticSearchAutocomplete) +/* harmony export */ }); +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } + +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +var ElasticSearchAutocomplete = /*#__PURE__*/function () { + function ElasticSearchAutocomplete() { + var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + searchFields: '.searchdiv', + baseAutocompleteVariantUrl: '[data-bb-elastic-url]', + searchInput: '.app-quick-add-code-input', + resultsTarget: '.results', + resultContainerClassesArray: ['result'], + resultImageClass: 'image', + resultContentClass: 'result__content', + resultPriceClass: 'result__price', + resultTitleClass: 'js-title', + resultDescriptionClass: 'result__description' + }; + + _classCallCheck(this, ElasticSearchAutocomplete); + + this.searchFieldsSelector = config.searchFields; + this.searchFields = document.querySelectorAll(config.searchFields); + this.baseAutocompleteVariantUrl = config.baseAutocompleteVariantUrl; + this.searchInput = config.searchInput; + this.resultsTarget = config.resultsTarget; + this.resultContainerClassesArray = config.resultContainerClassesArray; + this.resultImageClass = config.resultImageClass; + this.resultContentClass = config.resultContentClass; + this.resultPriceClass = config.resultPriceClass; + this.resultTitleClass = config.resultTitleClass; + this.resultDescriptionClass = config.resultDescriptionClass; + } + + _createClass(ElasticSearchAutocomplete, [{ + key: "_toggleModalVisibility", + value: function _toggleModalVisibility(elements) { + document.addEventListener('variantsVisible', function () { + document.addEventListener('click', function () { + elements.forEach(function (element) { + element.innerHTML = ''; + element.style.display = 'none'; + }); + }); + }); + } + }, { + key: "_assignElements", + value: function _assignElements(entry, data) { + var _this = this; + + var currentResults = entry.closest(this.searchFieldsSelector).querySelector(this.resultsTarget); + currentResults.innerHTML = ''; + currentResults.style = 'visibility: visible'; + var allResults = document.querySelectorAll(this.resultsTarget); + + if (data.items.length === 0) { + currentResults.innerHTML = '
no matching results
'; + } + + data.items = data.items.sort(function (a, b) { + if (b.taxon_name < a.taxon_name) return 1; + if (b.taxon_name > a.taxon_name) return -1; + return 0; + }); + console.log(data.items); + var itemTemp; + data.items.forEach(function (item) { + var _result$classList; + + var category = item.taxon_name; + var categoryStyle = "visibility: visible"; + + if (itemTemp == item.taxon_name) { + categoryStyle = "visibility: hidden"; + } + + var result = document.createElement('a'); + + (_result$classList = result.classList).add.apply(_result$classList, _toConsumableArray(_this.resultContainerClassesArray).concat(['js-result'])); + + result.innerHTML = "\n

").concat(category, "

\n \n
\n \n
\n
").concat(item.name, "
\n
").concat(item.price, "
\n
\n \n
\n
\n "); + itemTemp = item.taxon_name; + currentResults.appendChild(result); + }); + currentResults.style.display = 'block'; + + this._toggleModalVisibility(allResults); + + var customEvent = new CustomEvent('variantsVisible'); + document.dispatchEvent(customEvent); + } + }, { + key: "_getProducts", + value: function () { + var _getProducts2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(entry) { + var variantUrl, url, response, data; + return regeneratorRuntime.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + variantUrl = document.querySelector(this.baseAutocompleteVariantUrl).dataset.bbElasticUrl; + url = "".concat(variantUrl, "?query=").concat(entry.value); + entry.parentNode.classList.add('loading'); + _context.prev = 3; + _context.next = 6; + return fetch(url); + + case 6: + response = _context.sent; + _context.next = 9; + return response.json(); + + case 9: + data = _context.sent; + + this._assignElements(entry, data); + + _context.next = 16; + break; + + case 13: + _context.prev = 13; + _context.t0 = _context["catch"](3); + console.error(_context.t0); + + case 16: + _context.prev = 16; + entry.parentNode.classList.remove('loading'); + return _context.finish(16); + + case 19: + case "end": + return _context.stop(); + } + } + }, _callee, this, [[3, 13, 16, 19]]); + })); + + function _getProducts(_x) { + return _getProducts2.apply(this, arguments); + } + + return _getProducts; + }() + }, { + key: "_debounce", + value: function _debounce() { + var _this2 = this; + + var codeInputs = document.querySelectorAll(this.searchInput); + var timeout; + codeInputs.forEach(function (input) { + input.addEventListener('input', function () { + clearTimeout(timeout); + timeout = setTimeout(function () { + _this2._getProducts(input); + }, 400); + }); + }); + } + }, { + key: "init", + value: function init() { + if (this.searchFields.length === 0) { + return; + } + + this._debounce(); + } + }]); + + return ElasticSearchAutocomplete; +}(); + + + +/***/ }), + +/***/ "./src/Resources/assets/shop/js/index.js": +/*!***********************************************!*\ + !*** ./src/Resources/assets/shop/js/index.js ***! + \***********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _initAutocomleate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./initAutocomleate */ "./src/Resources/assets/shop/js/initAutocomleate.js"); + + +/***/ }), + +/***/ "./src/Resources/assets/shop/js/initAutocomleate.js": +/*!**********************************************************!*\ + !*** ./src/Resources/assets/shop/js/initAutocomleate.js ***! + \**********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _elastictSearchAutocomplete__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./elastictSearchAutocomplete */ "./src/Resources/assets/shop/js/elastictSearchAutocomplete.js"); + +new _elastictSearchAutocomplete__WEBPACK_IMPORTED_MODULE_0__["default"]().init(); + +/***/ }), + +/***/ "./src/Resources/assets/shop/scss/main.scss": +/*!**************************************************!*\ + !*** ./src/Resources/assets/shop/scss/main.scss ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +(() => { +/*!********************************************!*\ + !*** ./src/Resources/assets/shop/entry.js ***! + \********************************************/ +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _scss_main_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scss/main.scss */ "./src/Resources/assets/shop/scss/main.scss"); +/* harmony import */ var _js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./js/ */ "./src/Resources/assets/shop/js/index.js"); + + +})(); + +/******/ })() +; \ No newline at end of file diff --git a/src/Resources/public/css/bitbag-autocomplete-search.css b/src/Resources/public/css/bitbag-autocomplete-search.css deleted file mode 100644 index 9356b52..0000000 --- a/src/Resources/public/css/bitbag-autocomplete-search.css +++ /dev/null @@ -1,3 +0,0 @@ -#products-search .results { - width: 100%; -} diff --git a/src/Resources/public/entrypoints.json b/src/Resources/public/entrypoints.json new file mode 100644 index 0000000..4932606 --- /dev/null +++ b/src/Resources/public/entrypoints.json @@ -0,0 +1,20 @@ +{ + "entrypoints": { + "bitbag-elasticsearch-shop": { + "css": [ + "/public/bitbag-elasticsearch-shop.css" + ], + "js": [ + "/public/bitbag-elasticsearch-shop.js" + ] + }, + "bitbag-elasticsearch-admin": { + "css": [ + "/public/bitbag-elasticsearch-admin.css" + ], + "js": [ + "/public/bitbag-elasticsearch-admin.js" + ] + } + } +} \ No newline at end of file diff --git a/src/Resources/public/js/bitbag-autocomplete-search.js b/src/Resources/public/js/bitbag-autocomplete-search.js deleted file mode 100644 index d3f3fbf..0000000 --- a/src/Resources/public/js/bitbag-autocomplete-search.js +++ /dev/null @@ -1,52 +0,0 @@ -(function ( $ ) { - 'use strict'; - - $.fn.extend({ - autocompleteSearch: function (autocompleteInputElement, apiEndpointPath) { - $(autocompleteInputElement) - .search({ - type: 'category', - minCharacters: 3, - apiSettings: { - onResponse: function (autocompleteResponse) { - let - response = { - results: {} - } - ; - - $.each(autocompleteResponse.items, function (index, item) { - var - taxonName = item.taxon_name, - maxResults = 10 - ; - - if (index >= maxResults) { - return false; - } - - if (response.results[taxonName] === undefined) { - response.results[taxonName] = { - name: taxonName, - results: [] - }; - } - - response.results[taxonName].results.push({ - title: item.name, - description: item.description, - url: item.slug, - price: item.price, - image: item.image - }); - }); - - return response; - }, - url: apiEndpointPath - } - }) - ; - } - }); -})( jQuery ); diff --git a/src/Resources/public/manifest.json b/src/Resources/public/manifest.json new file mode 100644 index 0000000..74627fe --- /dev/null +++ b/src/Resources/public/manifest.json @@ -0,0 +1,6 @@ +{ + "public/bitbag-elasticsearch-shop.css": "/public/bitbag-elasticsearch-shop.css", + "public/bitbag-elasticsearch-shop.js": "/public/bitbag-elasticsearch-shop.js", + "public/bitbag-elasticsearch-admin.css": "/public/bitbag-elasticsearch-admin.css", + "public/bitbag-elasticsearch-admin.js": "/public/bitbag-elasticsearch-admin.js" +} \ No newline at end of file diff --git a/src/Resources/views/Shop/Menu/_searchForm.html.twig b/src/Resources/views/Shop/Menu/_searchForm.html.twig index 4e90514..faefa7d 100644 --- a/src/Resources/views/Shop/Menu/_searchForm.html.twig +++ b/src/Resources/views/Shop/Menu/_searchForm.html.twig @@ -1,5 +1,13 @@ -{% form_theme settings.form '@BitBagSyliusElasticsearchPlugin/Shop/Menu/_searchFormTheme.html.twig' %} +
+ +
+
diff --git a/src/Transformer/Product/ImageTransformer.php b/src/Transformer/Product/ImageTransformer.php index b0afefb..904e1d8 100644 --- a/src/Transformer/Product/ImageTransformer.php +++ b/src/Transformer/Product/ImageTransformer.php @@ -16,7 +16,7 @@ use Sylius\Component\Core\Model\ProductInterface; final class ImageTransformer implements TransformerInterface { - private const SYLIUS_THUMBNAIL_TYPE = 'thumbnail'; + private const SYLIUS_THUMBNAIL_TYPE = 'main'; private const SYLIUS_THUMBNAIL_FILTER = 'sylius_shop_product_thumbnail'; diff --git a/tests/Application/.env b/tests/Application/.env index c35078c..aa7a176 100755 --- a/tests/Application/.env +++ b/tests/Application/.env @@ -26,4 +26,4 @@ JWT_PASSPHRASE=acme_plugin_development # For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode=" # Delivery is disabled by default via "null://localhost" MAILER_URL=smtp://localhost -###< symfony/swiftmailer-bundle ### +###< symfony/swiftmailer-bundle ### \ No newline at end of file diff --git a/tests/Application/.github/CODEOWNERS b/tests/Application/.github/CODEOWNERS new file mode 100644 index 0000000..5b60113 --- /dev/null +++ b/tests/Application/.github/CODEOWNERS @@ -0,0 +1,2 @@ +@ @BitBagCommerce +* @Sylius/core-team \ No newline at end of file diff --git a/tests/Application/.github/workflows/build.yml b/tests/Application/.github/workflows/build.yml new file mode 100644 index 0000000..7c4e211 --- /dev/null +++ b/tests/Application/.github/workflows/build.yml @@ -0,0 +1,195 @@ +name: Build + +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: ~ + release: + types: [created] + schedule: + - + cron: "0 1 * * 6" # Run at 1am every Saturday + workflow_dispatch: ~ + +jobs: + tests: + runs-on: ubuntu-18.04 + + name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}" + + strategy: + fail-fast: false + matrix: + php: ["8.0", "7.4"] + symfony: ["^4.4", "^5.2"] + sylius: ["~1.9.0", "~1.10.0"] + node: ["14.x"] + mysql: ["8.0"] + + exclude: + - sylius: ~1.9.0 + php: 8.0 + + - sylius: ~1.10.0 + symfony: ^4.4 + # friendsofsymfony/elastica-bundle - package is locking php 7.x + - sylius: ~1.10.0 + php: 8.0 + + env: + APP_ENV: test + DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}" + + steps: + - + uses: actions/checkout@v2 + + - + name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "${{ matrix.php }}" + extensions: intl + tools: symfony + coverage: none + + - + name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: "${{ matrix.node }}" + + - + name: Shutdown default MySQL + run: sudo service mysql stop + + - + name: Setup MySQL + uses: mirromutth/mysql-action@v1.1 + with: + mysql version: "${{ matrix.mysql }}" + mysql root password: "root" + + - + name: Configure sysctl limits + run: | + sudo swapoff -a + sudo sysctl -w vm.swappiness=1 + sudo sysctl -w fs.file-max=262144 + sudo sysctl -w vm.max_map_count=262144 + + - + name: Runs Elasticsearch + uses: elastic/elastic-github-actions/elasticsearch@master + with: + stack-version: 6.8.15 + + - + name: Output PHP version for Symfony CLI + run: php -v | head -n 1 | awk '{ print $2 }' > .php-version + + - + name: Install certificates + run: symfony server:ca:install + + - + name: Run Chrome Headless + run: google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1 > /dev/null 2>&1 & + + - + name: Run webserver + run: (cd tests/Application && symfony server:start --port=8080 --dir=public --daemon) + + - + name: Get Composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - + name: Cache Composer + uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php-${{ matrix.php }}-composer- + + - + name: Restrict Symfony version + if: matrix.symfony != '' + run: | + composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10" + composer config extra.symfony.require "${{ matrix.symfony }}" + + - + name: Restrict Sylius version + if: matrix.sylius != '' + run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction + + - + name: Install PHP dependencies + run: composer install --no-interaction --no-scripts + + - + name: Get Yarn cache directory + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + + - + name: Cache Yarn + uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-node-${{ matrix.node }}-yarn- + + - + name: Install JS dependencies + run: (cd tests/Application && yarn install) + + - + name: Prepare test application database + run: | + (cd tests/Application && bin/console doctrine:database:create -vvv) + (cd tests/Application && bin/console doctrine:schema:create -vvv) + + - + name: Prepare test application assets + run: | + (cd tests/Application && bin/console assets:install public -vvv) + (cd tests/Application && yarn encore production) + + - + name: Prepare test application cache + run: (cd tests/Application && bin/console cache:warmup -vvv) + + - + name: Load fixtures in test application + run: (cd tests/Application && bin/console sylius:fixtures:load -n) + + - + name: Validate composer.json + run: composer validate --ansi --strict + + - + name: Validate database schema + run: (cd tests/Application && bin/console doctrine:schema:validate) + + - + name: Run PHPSpec + run: vendor/bin/phpspec run --ansi -f progress --no-interaction + + - + name: Run Behat + run: vendor/bin/behat --colors --strict -vvv --no-interaction || vendor/bin/behat --colors --strict -vvv --no-interaction --rerun + + - + name: Upload Behat logs + uses: actions/upload-artifact@v2 + if: failure() + with: + name: Behat logs + path: etc/build/ + if-no-files-found: ignore \ No newline at end of file diff --git a/tests/Application/.gitignore b/tests/Application/.gitignore index 8ad1225..fc6a866 100755 --- a/tests/Application/.gitignore +++ b/tests/Application/.gitignore @@ -1,4 +1,5 @@ /public/assets +/public/build /public/css /public/js /public/media/* @@ -7,6 +8,7 @@ !/public/media/image/.gitignore /node_modules +package-lock.json ###> symfony/framework-bundle ### /.env.*.local @@ -20,3 +22,4 @@ ###> symfony/web-server-bundle ### /.web-server-pid ###< symfony/web-server-bundle ### + diff --git a/tests/Application/assets/admin/entry.js b/tests/Application/assets/admin/entry.js new file mode 100644 index 0000000..9c0f784 --- /dev/null +++ b/tests/Application/assets/admin/entry.js @@ -0,0 +1 @@ +import 'sylius/bundle/AdminBundle/Resources/private/entry'; \ No newline at end of file diff --git a/tests/Application/assets/shop/entry.js b/tests/Application/assets/shop/entry.js new file mode 100644 index 0000000..ae9a3ba --- /dev/null +++ b/tests/Application/assets/shop/entry.js @@ -0,0 +1 @@ +import 'sylius/bundle/ShopBundle/Resources/private/entry'; \ No newline at end of file diff --git a/tests/Application/composer.json b/tests/Application/composer.json index 326735f..a247232 100755 --- a/tests/Application/composer.json +++ b/tests/Application/composer.json @@ -1,5 +1,8 @@ { - "name": "sylius/plugin-skeleton-test-application", + "name": "sylius/plugin-elasticsearch-test-application", "description": "Sylius application for plugin testing purposes (composer.json needed for project dir resolving)", - "license": "MIT" + "license": "MIT", + "require": { + "symfony/webpack-encore-bundle": "^1.13" + } } diff --git a/tests/Application/composer.lock b/tests/Application/composer.lock new file mode 100644 index 0000000..0051ccb --- /dev/null +++ b/tests/Application/composer.lock @@ -0,0 +1,1603 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "6ff4f240538723da6a3ce47e709229c0", + "packages": [ + { + "name": "psr/container", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" + }, + "time": "2021-11-05T16:50:12+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "symfony/asset", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/asset.git", + "reference": "49e355b57b4b6a5cef1d2dbc4e36cee49369cf7d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/asset/zipball/49e355b57b4b6a5cef1d2dbc4e36cee49369cf7d", + "reference": "49e355b57b4b6a5cef1d2dbc4e36cee49369cf7d", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "symfony/http-foundation": "<5.3" + }, + "require-dev": { + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^5.3|^6.0", + "symfony/http-kernel": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/http-foundation": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Asset\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/asset/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-23T10:19:22+00:00" + }, + { + "name": "symfony/config", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "e39cf688c80fd79ab0a6a2d05a9facac9b2d534b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/e39cf688c80fd79ab0a6a2d05a9facac9b2d534b", + "reference": "e39cf688c80fd79ab0a6a2d05a9facac9b2d534b", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/filesystem": "^4.4|^5.0|^6.0", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.16", + "symfony/polyfill-php81": "^1.22" + }, + "conflict": { + "symfony/finder": "<4.4" + }, + "require-dev": { + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/messenger": "^4.4|^5.0|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/yaml": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/config/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-28T15:25:38+00:00" + }, + { + "name": "symfony/dependency-injection", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "69c398723857bb19fdea78496cedea0f756decab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/69c398723857bb19fdea78496cedea0f756decab", + "reference": "69c398723857bb19fdea78496cedea0f756decab", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1.1", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16", + "symfony/polyfill-php81": "^1.22", + "symfony/service-contracts": "^1.1.6|^2" + }, + "conflict": { + "ext-psr": "<1.1|>=2", + "symfony/config": "<5.3", + "symfony/finder": "<4.4", + "symfony/proxy-manager-bridge": "<4.4", + "symfony/yaml": "<4.4" + }, + "provide": { + "psr/container-implementation": "1.0", + "symfony/service-implementation": "1.0|2.0" + }, + "require-dev": { + "symfony/config": "^5.3|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/yaml": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", + "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows you to standardize and centralize the way objects are constructed in your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/dependency-injection/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-29T15:30:56+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-12T14:48:14+00:00" + }, + { + "name": "symfony/error-handler", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/error-handler.git", + "reference": "8433fa3145ac78df88b87a4a539118e950828126" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/8433fa3145ac78df88b87a4a539118e950828126", + "reference": "8433fa3145ac78df88b87a4a539118e950828126", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/log": "^1|^2|^3", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "require-dev": { + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/http-kernel": "^4.4|^5.0|^6.0", + "symfony/serializer": "^4.4|^5.0|^6.0" + }, + "bin": [ + "Resources/bin/patch-type-declarations" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\ErrorHandler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to manage errors and ease debugging PHP code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/error-handler/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-29T15:30:56+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "27d39ae126352b9fa3be5e196ccf4617897be3eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/27d39ae126352b9fa3be5e196ccf4617897be3eb", + "reference": "27d39ae126352b9fa3be5e196ccf4617897be3eb", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/event-dispatcher-contracts": "^2|^3", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "symfony/dependency-injection": "<4.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^4.4|^5.0|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/stopwatch": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-23T10:19:22+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", + "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/event-dispatcher": "^1" + }, + "suggest": { + "symfony/event-dispatcher-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-12T14:48:14+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/731f917dc31edcffec2c6a777f3698c33bea8f01", + "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-10-28T13:39:27+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "5ef86ac7927d2de08dc1e26eb91325f9ccbe6309" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/5ef86ac7927d2de08dc1e26eb91325f9ccbe6309", + "reference": "5ef86ac7927d2de08dc1e26eb91325f9ccbe6309", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "predis/predis": "~1.0", + "symfony/cache": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/mime": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/mime": "To use the file extension guesser" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Defines an object-oriented layer for the HTTP specification", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-28T15:25:38+00:00" + }, + { + "name": "symfony/http-kernel", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-kernel.git", + "reference": "e012f16688bcb151e965473a70d8ebaa8b1d15ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/e012f16688bcb151e965473a70d8ebaa8b1d15ea", + "reference": "e012f16688bcb151e965473a70d8ebaa8b1d15ea", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/log": "^1|^2", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^5.0|^6.0", + "symfony/http-foundation": "^5.3.7|^6.0", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "symfony/browser-kit": "<5.4", + "symfony/cache": "<5.0", + "symfony/config": "<5.0", + "symfony/console": "<4.4", + "symfony/dependency-injection": "<5.3", + "symfony/doctrine-bridge": "<5.0", + "symfony/form": "<5.0", + "symfony/http-client": "<5.0", + "symfony/mailer": "<5.0", + "symfony/messenger": "<5.0", + "symfony/translation": "<5.0", + "symfony/twig-bridge": "<5.0", + "symfony/validator": "<5.0", + "twig/twig": "<2.13" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/cache": "^1.0|^2.0|^3.0", + "symfony/browser-kit": "^5.4|^6.0", + "symfony/config": "^5.0|^6.0", + "symfony/console": "^4.4|^5.0|^6.0", + "symfony/css-selector": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^5.3|^6.0", + "symfony/dom-crawler": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/http-client-contracts": "^1.1|^2|^3", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/routing": "^4.4|^5.0|^6.0", + "symfony/stopwatch": "^4.4|^5.0|^6.0", + "symfony/translation": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2|^3", + "twig/twig": "^2.13|^3.0.4" + }, + "suggest": { + "symfony/browser-kit": "", + "symfony/config": "", + "symfony/console": "", + "symfony/dependency-injection": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpKernel\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a structured process for converting a Request into a Response", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-kernel/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-29T16:56:53+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.23.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T12:26:48+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.23.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-28T13:41:28+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "e66119f3de95efc359483f810c4c3e6436279436" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/e66119f3de95efc359483f810c4c3e6436279436", + "reference": "e66119f3de95efc359483f810c4c3e6436279436", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-21T13:25:03+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-04T16:48:04+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "89ab66eaef230c9cd1992de2e9a1b26652b127b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/89ab66eaef230c9cd1992de2e9a1b26652b127b9", + "reference": "89ab66eaef230c9cd1992de2e9a1b26652b127b9", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "phpunit/phpunit": "<5.4.3", + "symfony/console": "<4.4" + }, + "require-dev": { + "ext-iconv": "*", + "symfony/console": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/uid": "^5.1|^6.0", + "twig/twig": "^2.13|^3.0.4" + }, + "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", + "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides mechanisms for walking through any arbitrary PHP variable", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "support": { + "source": "https://github.com/symfony/var-dumper/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-29T15:30:56+00:00" + }, + { + "name": "symfony/webpack-encore-bundle", + "version": "v1.13.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/webpack-encore-bundle.git", + "reference": "509cad50878e838c879743225e0e921b3b64a3f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/webpack-encore-bundle/zipball/509cad50878e838c879743225e0e921b3b64a3f2", + "reference": "509cad50878e838c879743225e0e921b3b64a3f2", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "symfony/asset": "^4.4 || ^5.0 || ^6.0", + "symfony/config": "^4.4 || ^5.0 || ^6.0", + "symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0", + "symfony/http-kernel": "^4.4 || ^5.0 || ^6.0", + "symfony/service-contracts": "^1.0 || ^2.0 || ^3.0" + }, + "require-dev": { + "symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0", + "symfony/phpunit-bridge": "^5.3 || ^6.0", + "symfony/twig-bundle": "^4.4 || ^5.0 || ^6.0", + "symfony/web-link": "^4.4 || ^5.0 || ^6.0" + }, + "type": "symfony-bundle", + "extra": { + "thanks": { + "name": "symfony/webpack-encore", + "url": "https://github.com/symfony/webpack-encore" + } + }, + "autoload": { + "psr-4": { + "Symfony\\WebpackEncoreBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Integration with your Symfony app & Webpack Encore!", + "support": { + "issues": "https://github.com/symfony/webpack-encore-bundle/issues", + "source": "https://github.com/symfony/webpack-encore-bundle/tree/v1.13.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-12-02T19:45:55+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.1.0" +} diff --git a/tests/Application/config/bundles.php b/tests/Application/config/bundles.php index 5a3b67a..519328b 100644 --- a/tests/Application/config/bundles.php +++ b/tests/Application/config/bundles.php @@ -57,4 +57,5 @@ return [ Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true], Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true], SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true], + Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], ]; diff --git a/tests/Application/config/packages/assets.yaml b/tests/Application/config/packages/assets.yaml new file mode 100644 index 0000000..ed047f5 --- /dev/null +++ b/tests/Application/config/packages/assets.yaml @@ -0,0 +1,11 @@ +framework: + assets: + packages: + shop: + json_manifest_path: '%kernel.project_dir%/public/build/shop/manifest.json' + admin: + json_manifest_path: '%kernel.project_dir%/public/build/admin/manifest.json' + elasticsearch_shop: + json_manifest_path: '%kernel.project_dir%/public/build/bitbag/elasticsearch/shop/manifest.json' + elasticsearch_admin: + json_manifest_path: '%kernel.project_dir%/public/build/bitbag/elasticsearch/admin/manifest.json' diff --git a/tests/Application/config/packages/webpack_encore.yaml b/tests/Application/config/packages/webpack_encore.yaml new file mode 100644 index 0000000..6498e18 --- /dev/null +++ b/tests/Application/config/packages/webpack_encore.yaml @@ -0,0 +1,8 @@ +webpack_encore: + output_path: '%kernel.project_dir%/public/build/default' + builds: + shop: '%kernel.project_dir%/public/build/shop' + admin: '%kernel.project_dir%/public/build/admin' + elasticsearch_shop: '%kernel.project_dir%/public/build/bitbag/elasticsearch/shop' + elasticsearch_admin: '%kernel.project_dir%/public/build/bitbag/elasticsearch/admin' + \ No newline at end of file diff --git a/tests/Application/gulpfile.babel.js b/tests/Application/gulpfile.babel.js.temp similarity index 100% rename from tests/Application/gulpfile.babel.js rename to tests/Application/gulpfile.babel.js.temp diff --git a/tests/Application/package.json b/tests/Application/package.json index f1dc816..36fd23c 100755 --- a/tests/Application/package.json +++ b/tests/Application/package.json @@ -5,10 +5,13 @@ "jquery": "^3.5.0", "jquery.dirtyforms": "^2.0.0", "lightbox2": "^2.9.0", + "node-sass": "6.0.1", + "sass-loader": "^12.4.0", "semantic-ui-css": "^2.2.0", "slick-carousel": "^1.8.1" }, "devDependencies": { + "@symfony/webpack-encore": "^1.8.1", "babel-core": "^6.26.3", "babel-plugin-external-helpers": "^6.22.0", "babel-plugin-module-resolver": "^3.1.1", @@ -21,31 +24,14 @@ "eslint-import-resolver-babel-module": "^4.0.0", "eslint-plugin-import": "^2.12.0", "fast-async": "^6.3.7", - "gulp": "^4.0.0", - "gulp-chug": "^0.5", - "gulp-concat": "^2.6.0", - "gulp-debug": "^2.1.2", - "gulp-if": "^2.0.0", - "gulp-livereload": "^3.8.1", - "gulp-order": "^1.1.1", - "gulp-sass": "^4.0.1", - "gulp-sourcemaps": "^1.6.0", - "gulp-uglifycss": "^1.0.5", "merge-stream": "^1.0.0", - "rollup": "^0.60.7", - "rollup-plugin-babel": "^3.0.4", - "rollup-plugin-commonjs": "^9.1.3", - "rollup-plugin-inject": "^2.0.0", - "rollup-plugin-node-resolve": "^3.3.0", - "rollup-plugin-uglify": "^4.0.0", "upath": "^1.1.0", "yargs": "^6.4.0" }, "scripts": { - "build": "gulp build", - "gulp": "gulp build", - "lint": "yarn lint:js", - "lint:js": "eslint gulpfile.babel.js" + "dev": "yarn encore dev", + "watch": "yarn encore dev --watch", + "prod": "yarn encore prod" }, "repository": { "type": "git", diff --git a/tests/Application/templates/bundles/SyliusAdminBundle/_scripts.html.twig b/tests/Application/templates/bundles/SyliusAdminBundle/_scripts.html.twig new file mode 100644 index 0000000..6c2321f --- /dev/null +++ b/tests/Application/templates/bundles/SyliusAdminBundle/_scripts.html.twig @@ -0,0 +1,2 @@ +{{ encore_entry_script_tags('admin-entry', null, 'admin') }} +{{ encore_entry_script_tags('bitbag-elasticsearch-admin', null, 'elasticsearch_admin') }} diff --git a/tests/Application/templates/bundles/SyliusAdminBundle/_styles.html.twig b/tests/Application/templates/bundles/SyliusAdminBundle/_styles.html.twig new file mode 100644 index 0000000..0e52056 --- /dev/null +++ b/tests/Application/templates/bundles/SyliusAdminBundle/_styles.html.twig @@ -0,0 +1,2 @@ +{{ encore_entry_link_tags('admin-entry', null, 'admin') }} +{{ encore_entry_link_tags('bitbag-elasticsearch-admin', null, 'elasticsearch_admin') }} diff --git a/tests/Application/templates/bundles/SyliusShopBundle/_scripts.html.twig b/tests/Application/templates/bundles/SyliusShopBundle/_scripts.html.twig new file mode 100644 index 0000000..a0f4802 --- /dev/null +++ b/tests/Application/templates/bundles/SyliusShopBundle/_scripts.html.twig @@ -0,0 +1,2 @@ +{{ encore_entry_script_tags('shop-entry', null, 'shop') }} +{{ encore_entry_script_tags('bitbag-elasticsearch-shop', null, 'elasticsearch_shop') }} diff --git a/tests/Application/templates/bundles/SyliusShopBundle/_styles.html.twig b/tests/Application/templates/bundles/SyliusShopBundle/_styles.html.twig new file mode 100644 index 0000000..5f82382 --- /dev/null +++ b/tests/Application/templates/bundles/SyliusShopBundle/_styles.html.twig @@ -0,0 +1,2 @@ +{{ encore_entry_link_tags('shop-entry', null, 'shop') }} +{{ encore_entry_link_tags('bitbag-elasticsearch-shop', null, 'elasticsearch_shop') }} diff --git a/tests/Application/webpack.config.js b/tests/Application/webpack.config.js new file mode 100644 index 0000000..9fce4b4 --- /dev/null +++ b/tests/Application/webpack.config.js @@ -0,0 +1,49 @@ +const path = require('path'); +const Encore = require('@symfony/webpack-encore'); + +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/'); +const uiBundleResources = path.resolve(syliusBundles, 'UiBundle/Resources/private/'); + +// Shop config +Encore + .setOutputPath('public/build/shop/') + .setPublicPath('/build/shop') + .addEntry('shop-entry', './assets/shop/entry.js') + .disableSingleRuntimeChunk() + .cleanupOutputBeforeBuild() + .enableSourceMaps(!Encore.isProduction()) + .enableVersioning(Encore.isProduction()) + .enableSassLoader(); + +const shopConfig = Encore.getWebpackConfig(); + +shopConfig.resolve.alias['sylius/ui'] = uiBundleScripts; +shopConfig.resolve.alias['sylius/ui-resources'] = uiBundleResources; +shopConfig.resolve.alias['sylius/bundle'] = syliusBundles; +shopConfig.name = 'shop'; + +Encore.reset(); + +// Admin config +Encore + .setOutputPath('public/build/admin/') + .setPublicPath('/build/admin') + .addEntry('admin-entry', './assets/admin/entry.js') + .disableSingleRuntimeChunk() + .cleanupOutputBeforeBuild() + .enableSourceMaps(!Encore.isProduction()) + .enableVersioning(Encore.isProduction()) + .enableSassLoader(); + +const adminConfig = Encore.getWebpackConfig(); + +adminConfig.resolve.alias['sylius/ui'] = uiBundleScripts; +adminConfig.resolve.alias['sylius/ui-resources'] = uiBundleResources; +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 diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..ccdef55 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,40 @@ +const path = require('path'); +const Encore = require('@symfony/webpack-encore'); +const pluginName = 'elasticsearch'; + +const getConfig = (pluginName, type) => { + Encore.reset(); + + Encore + .setOutputPath(`public/build/bitbag/${pluginName}/${type}/`) + .setPublicPath(`/build/bitbag/${pluginName}/${type}/`) + .addEntry(`bitbag-${pluginName}-${type}`, path.resolve(__dirname, `./src/Resources/assets/${type}/entry.js`)) + .disableSingleRuntimeChunk() + .cleanupOutputBeforeBuild() + .enableSourceMaps(!Encore.isProduction()) + .enableSassLoader(); + + const config = Encore.getWebpackConfig(); + config.name = `bitbag-${pluginName}-${type}`; + + return config; +} + +Encore + .setOutputPath(`src/Resources/public/`) + .setPublicPath(`/public/`) + .addEntry(`bitbag-${pluginName}-shop`, path.resolve(__dirname, `./src/Resources/assets/shop/entry.js`)) + .addEntry(`bitbag-${pluginName}-admin`, path.resolve(__dirname, `./src/Resources/assets/admin/entry.js`)) + .cleanupOutputBeforeBuild() + .disableSingleRuntimeChunk() + .enableSassLoader(); + +const distConfig = Encore.getWebpackConfig(); +distConfig.name = `bitbag-plugin-dist`; + +Encore.reset(); + +const shopConfig = getConfig(pluginName, 'shop') +const adminConfig = getConfig(pluginName, 'admin') + +module.exports = [shopConfig, adminConfig, distConfig];