From 5803f0cbe4e0464608086c118f57777bfdebaae4 Mon Sep 17 00:00:00 2001 From: Patchy Date: Fri, 16 Jun 2023 10:10:23 +1000 Subject: [PATCH 1/2] Install node dependencies --- .env.dist | 1 + Makefile | 7 ++++++- docker-compose.yml | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.env.dist b/.env.dist index 0d2c46e..1a38f1b 100644 --- a/.env.dist +++ b/.env.dist @@ -2,6 +2,7 @@ WEB_PORT=8080 MYSQL_PORT=3306 SELENIUM_PORT=4444 VNC_PORT=5900 +NODE_PORT=3000 BASE_URI=http://127.0.0.1:8080 UID=1000 GID=1000 diff --git a/Makefile b/Makefile index 1479810..76b2c70 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ ifneq ("$(shell whoami)", "skpr") EXEC=docker-compose exec -T php-cli + NODE_EXEC=docker-compose exec -T node endif DRUSH=$(EXEC) ./bin/drush @@ -9,12 +10,16 @@ DRUSH_INSTALL=$(DRUSH) -y site:install --account-pass=password GIT_SWITCH=cd app && git switch PHP_VERSION=8.2 -clean: composer minimal login +clean: composer node minimal login composer: rm -rf composer.lock vendor app/vendor $(EXEC) composer install +node: + rm -rf app/core/node_modules + $(NODE_EXEC) yarn install --cwd=/data/app/core + start: stop-php PHP_VERSION=$(PHP_VERSION) docker-compose up --build -d diff --git a/docker-compose.yml b/docker-compose.yml index 272e2a3..a14ba91 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,7 @@ services: - "${MYSQL_PORT:-3306}:3306" - "${SELENIUM_PORT:-4444}:4444" - "${VNC_PORT:-5900}:5900" + - "${NODE_PORT:-3000}:3000" extra_hosts: - "host.docker.internal:host-gateway" volumes: @@ -51,3 +52,10 @@ services: selenium: image: ${SELENIUM_IMAGE:-selenium/standalone-chrome} network_mode: service:nginx + + node: + image: skpr/node:18-v2-latest + command: /bin/bash -c "sleep infinity" + network_mode: service:nginx + volumes: + - ./:/data From 2ce57820da1f2e2c1820299bde5aa9379a9791f9 Mon Sep 17 00:00:00 2001 From: Patchy Date: Fri, 16 Jun 2023 10:25:23 +1000 Subject: [PATCH 2/2] Configure eslint --- assets/scaffold/files/Project_Default.xml | 6 ++++++ assets/scaffold/files/eslint.xml | 9 +++++++++ src/ComposerScripts.php | 4 ++++ 3 files changed, 19 insertions(+) create mode 100644 assets/scaffold/files/Project_Default.xml create mode 100644 assets/scaffold/files/eslint.xml diff --git a/assets/scaffold/files/Project_Default.xml b/assets/scaffold/files/Project_Default.xml new file mode 100644 index 0000000..03d9549 --- /dev/null +++ b/assets/scaffold/files/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/assets/scaffold/files/eslint.xml b/assets/scaffold/files/eslint.xml new file mode 100644 index 0000000..273562e --- /dev/null +++ b/assets/scaffold/files/eslint.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/src/ComposerScripts.php b/src/ComposerScripts.php index d341110..9849a5a 100644 --- a/src/ComposerScripts.php +++ b/src/ComposerScripts.php @@ -53,9 +53,13 @@ public static function configurePhpStorm(Event $event): void { } $io->write("Configuring PhpStorm"); mkdir('.idea'); + mkdir('.idea/inspectionProfiles'); + mkdir('.idea/jsLinters'); copy('assets/scaffold/files/php.xml', '.idea/php.xml'); copy('assets/scaffold/files/symfony2.xml', '.idea/symfony2.xml'); copy('assets/scaffold/files/workspace.xml', '.idea/workspace.xml'); + copy('assets/scaffold/files/Project_Default.xml', '.idea/inspectionProfiles/Project_Default.xml'); + copy('assets/scaffold/files/eslint.xml', '.idea/jsLinters/eslint.xml'); } }