Skip to content

Commit

Permalink
fix: YASSG default project layout (#152)
Browse files Browse the repository at this point in the history
* feat: YASSG default project layout

* feat: YASSG default project layout
  • Loading branch information
dkarlovi authored Dec 22, 2023
1 parent 92be586 commit 149609b
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 0 deletions.
8 changes: 8 additions & 0 deletions resources/YASSG/default/.gitattributes.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/docs export-ignore
/tests export-ignore
/.* export-ignore
/*dist export-ignore
/*baseline* export-ignore
/composer.lock export-ignore
/Makefile export-ignore
content/**/*.webp filter=lfs diff=lfs merge=lfs -text
5 changes: 5 additions & 0 deletions resources/YASSG/default/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/node_modules/
/public/
/var/
/vendor/
/index.php
17 changes: 17 additions & 0 deletions resources/YASSG/default/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.SILENT:

APP_ROOT := $(abspath $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))))

include vendor/sigwin/infra/resources/YASSG/default.mk

build/docker/imgproxy:
docker compose up imgproxy -d
build/docker: build/docker/imgproxy
docker compose run --rm webpack npm ci
docker compose run --rm webpack npx encore production
docker compose run --rm --env IMGPROXY_URL=http://imgproxy:8080 app vendor/sigwin/yassg/bin/yassg yassg:generate --env prod "$(BASE_URL)"

vendor/sigwin/infra/resources/YASSG/default.mk:
mv composer.json composer.json~ && rm -f composer.lock
docker run --rm --user '$(shell id -u):$(shell id -g)' --volume '$(shell pwd):/app' --workdir /app composer:2 require sigwin/infra
mv composer.json~ composer.json && rm -f composer.lock
30 changes: 30 additions & 0 deletions resources/YASSG/default/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
services:
app:
image: php:8.2-alpine
environment:
BASE_URL: ${BASE_URL}
working_dir: /app
volumes:
- .:/app
tmpfs:
- /tmp
webpack:
image: node:20-alpine
environment:
BASE_URL: ${BASE_URL}
working_dir: /app
volumes:
- .:/app
tmpfs:
- /tmp
imgproxy:
image: darthsim/imgproxy:v3
environment:
- IMGPROXY_LOCAL_FILESYSTEM_ROOT=/app
working_dir: /app
ports:
- 8090:8080
volumes:
- .:/app:ro
tmpfs:
- /tmp
46 changes: 46 additions & 0 deletions resources/YASSG/default/psalm.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0"?>
<psalm xmlns="https://getpsalm.org/schema/config"
cacheDirectory="var/phpqa/psalm"
checkForThrowsInGlobalScope="true"
ensureArrayIntOffsetsExist="true"
ensureArrayStringOffsetsExist="true"
errorLevel="1"
findUnusedBaselineEntry="true"
findUnusedCode="true"
findUnusedPsalmSuppress="true"
findUnusedVariablesAndParams="true"
limitMethodComplexity="true"
restrictReturnTypes="false"
strictBinaryOperands="true">
<projectFiles>
<directory name="./"/>
<ignoreFiles allowMissingFiles="true">
<file name=".php-cs-fixer.dist.php"/>
<directory name="var/"/>
<directory name="vendor/"/>
</ignoreFiles>
</projectFiles>

<issueHandlers>
<MissingConstructor>
<errorLevel type="suppress">
<directory name="src/Model"/>
</errorLevel>
</MissingConstructor>
<PossiblyUnusedProperty>
<errorLevel type="suppress">
<directory name="src/Model"/>
</errorLevel>
</PossiblyUnusedProperty>
<UnusedClass>
<errorLevel type="suppress">
<directory name="src/Model"/>
</errorLevel>
</UnusedClass>
</issueHandlers>

<plugins>
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
<pluginClass class="Psalm\SymfonyPsalmPlugin\Plugin"/>
</plugins>
</psalm>

0 comments on commit 149609b

Please sign in to comment.