Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install node dependencies #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@

ifneq ("$(shell whoami)", "skpr")
EXEC=docker-compose exec -T php-cli
NODE_EXEC=docker-compose exec -T node
endif

DRUSH=$(EXEC) ./bin/drush
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

Expand Down
6 changes: 6 additions & 0 deletions assets/scaffold/files/Project_Default.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>
9 changes: 9 additions & 0 deletions assets/scaffold/files/eslint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EslintConfiguration">
<custom-configuration-file used="true" path="$PROJECT_DIR$/app/core/.eslintrc.json" />
<extra-options value="--no-error-on-unmatched-pattern --ignore-pattern=&quot;*.es6.js&quot; --resolve-plugins-relative-to=$_WEB_ROOT/core --ext=.js,.yml" />
<files-pattern value="{**/*,*}.{js,yml}" />
<option name="fix-on-save" value="true" />
</component>
</project>
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
4 changes: 4 additions & 0 deletions src/ComposerScripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

}