Skip to content

Commit

Permalink
feat: make install for 2.x
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Engeln <jerome.engeln@adeliom.com>
  • Loading branch information
jeromeengeln committed Feb 20, 2025
1 parent 61924b9 commit 5e23d2a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions .makefile/dev.mk
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ ${APP_DIR}:
(symfony composer create-project --no-interaction --prefer-dist --no-scripts --no-progress --no-install sylius/sylius-standard="${SYLIUS_VERSION}" ${APP_DIR})
cd ${APP_DIR} && chmod -R 777 public
echo "COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME}" >> ${APP_DIR}/.env
echo "NODE_VERSION=${NODE_VERSION}" >> ${APP_DIR}/.env
${MAKE} apply_dist

apply_dist:
Expand Down Expand Up @@ -89,8 +90,10 @@ platform:
(cd ${APP_DIR} && sed -i'' -e 's|APP_DEBUG: 0|APP_DEBUG: 1|g' compose.override.yml); \
(cd ${APP_DIR} && sed -i'' -e 's|- "80:80"|- "$(DOCKER_PHP_PORT):80"\n depends_on:\n - php|g' compose.override.yml); \
(cd ${APP_DIR} && sed -i'' -e 's| - public-media:/srv/sylius/public/media:ro,nocopy| - public-media:/srv/sylius/public/media:ro,nocopy\n - ../../:/srv/sylius/${PLUGIN_DIR}:rw|g' compose.override.yml); \
(cd ${APP_DIR} && sed -i'' -e 's|plugin-proposal-object-rest-spread|plugin-transform-object-rest-spread|g' .babelrc); \
(cd ${APP_DIR} && rm -rf compose.override.yml-e); \
(cd ${APP_DIR} && rm -rf composer.json-e); \
(cd ${APP_DIR} && rm -rf .babelrc-e); \
(cd ${APP_DIR} && echo "const tailwindTheme = require('./themes/TailwindTheme/webpack.config');" >> ./webpack.config.js); \
(cd ${APP_DIR} && echo "module.exports = [shopConfig, adminConfig, appShopConfig, appAdminConfig, tailwindTheme];" >> ./webpack.config.js); \
(cd ${APP_DIR} && echo " tailwindTheme:" >> ./config/packages/assets.yaml); \
Expand All @@ -106,23 +109,21 @@ platform:
cd ${APP_DIR} && (ENV=$(ENV) docker compose run --rm php composer config minimum-stability dev)
cd ${APP_DIR} && (ENV=$(ENV) docker compose run --rm php composer config extra.symfony.allow-contrib true)
cd ${APP_DIR} && (ENV=$(ENV) docker compose run --rm php composer config repositories.plugin '{"type": "path", "url": "../../"}')
#cd ${APP_DIR} && (ENV=$(ENV) docker compose run --rm php composer config repositories.adeliom '{"type":"vcs","url":"$(PLUGIN_URL)"}')
cd ${APP_DIR} && (ENV=$(ENV) docker compose run --rm php composer config extra.symfony.require "~${SYMFONY_VERSION}")
cd ${APP_DIR} && (ENV=$(ENV) docker compose run --rm php composer require --no-install --no-scripts --no-progress sylius/sylius="~${SYLIUS_VERSION}")
cd ${APP_DIR} && (ENV=$(ENV) docker compose run --rm php composer require --no-install --no-scripts --dev friendsoftwig/twigcs)
cd ${APP_DIR} && (ENV=$(ENV) docker compose run --rm php composer global config allow-plugins.${PLUGIN_NAME} true)
cd ${APP_DIR} && (ENV=$(ENV) docker compose run --rm php composer dump-autoload)
#cd ${APP_DIR} && (ENV=$(ENV) docker compose run --rm php composer require --no-interaction --with-all-dependencies --no-scripts ${PLUGIN_NAME}="*@dev")
cd ${APP_DIR} && (ENV=$(ENV) docker compose run --rm php composer install --no-interaction --no-scripts --prefer-dist)
${MAKE} platform_up
${MAKE} platform_assets

platform_assets:
rm -rf ${APP_DIR}/node_modules
mkdir ${APP_DIR}/node_modules
rm -rf ${APP_DIR}/package-lock.json
cd ${APP_DIR} && (ENV=$(ENV) docker compose run --rm -i nodejs "npm install -D tailwindcss postcss postcss-loader autoprefixer @fortawesome/fontawesome-free daisyui")
cd ${APP_DIR} && (ENV=$(ENV) docker compose run --rm nodejs)
cd ${APP_DIR} && (ENV=$(ENV) docker compose run --rm nodejs "npm run build")

platform_debug:
cd ${APP_DIR} && (ENV=$(ENV) docker compose -f compose.yml -f compose.override.yml -f compose.debug.yml up -d)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM adeliom/php:8.2-caddy-node20

ARG SYLIUS_VERSION=2.0.0
ARG SYMFONY_VERSION=7.1
ARG SYMFONY_VERSION=7.2

RUN apk add --update make

Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ SHELL=/bin/bash
### ¯¯¯

SYLIUS_VERSION=2.0.0
SYMFONY_VERSION=7.1
SYMFONY_VERSION=7.2
NODE_VERSION=20
COMPOSE_PROJECT_NAME=sylius-happy-cms-plugin

PLUGIN_NAME=agence-adeliom/sylius-tailwindcss-theme
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
[//]: # (</p>)

### Try our demo 🚀 [https://sylius-tailwind.adeliom.io/](https://sylius-tailwind.adeliom.io/)
### NEW ✨ Compatible with Sylius 2.0

## Introduction

Expand Down

0 comments on commit 5e23d2a

Please sign in to comment.