xref: /webtrees/composer.json (revision acded4704268af582f9e51c164aad2947c0b804b)
1{
2    "name": "fisharebest/webtrees",
3    "description": "webtrees online genealogy",
4    "keywords": [
5        "webtrees",
6        "genealogy"
7    ],
8    "license": "GPL-3.0-or-later",
9    "autoload": {
10        "psr-4": {
11            "Fisharebest\\Webtrees\\": "app/"
12        },
13        "files": [
14            "app/Helpers/functions.php"
15        ]
16    },
17    "autoload-dev": {
18        "classmap": [
19            "tests/TestCase.php",
20            "tests/MockGlobalFunctions.php"
21        ]
22    },
23    "config": {
24        "platform": {
25            "php": "7.4"
26        },
27        "sort-packages": true,
28        "process-timeout": 3600
29    },
30    "require": {
31        "php": "7.4 - 8.0",
32        "ext-curl": "*",
33        "ext-gd": "*",
34        "ext-iconv": "*",
35        "ext-intl": "*",
36        "ext-json": "*",
37        "ext-pcre": "*",
38        "ext-pdo": "*",
39        "ext-session": "*",
40        "ext-xml": "*",
41        "ext-zip": "*",
42        "aura/router": "~3.1",
43        "doctrine/dbal": "~3.1",
44        "ezyang/htmlpurifier": "~4.13",
45        "fig/http-message-util": "^1.1",
46        "fisharebest/algorithm": "~1.5",
47        "fisharebest/ext-calendar": "~2.5",
48        "fisharebest/flysystem-chroot-adapter": "~2.0",
49        "fisharebest/localization": "~1.15",
50        "guzzlehttp/guzzle": "~7.3",
51        "illuminate/container": "~8.38",
52        "illuminate/database": "~8.38",
53        "illuminate/support": "~8.38",
54        "intervention/image": "^2.5",
55        "io-developer/php-whois": "~4.0",
56        "league/commonmark": "~1.6",
57        "league/flysystem": "^2.0.7",
58        "league/flysystem-ziparchive": "~2.0",
59        "middlewares/client-ip": "~2.0",
60        "mlocati/ip-lib": "~1.14",
61        "nesbot/carbon": "~2.46",
62        "nyholm/psr7": "~1.4",
63        "nyholm/psr7-server": "~1.0",
64        "oscarotero/middleland": "~1.0",
65        "psr/cache": "~1.0",
66        "psr/http-message": "~1.0",
67        "psr/http-server-handler": "~1.0",
68        "psr/http-server-middleware": "~1.0",
69        "ramsey/uuid": "~4.1",
70        "sabre/vobject": "~4.3",
71        "swiftmailer/swiftmailer": "~6.2",
72        "symfony/cache": "~5.2",
73        "symfony/expression-language": "~5.2",
74        "symfony/polyfill-mbstring": "~1.22",
75        "symfony/polyfill-php80": "^1.22",
76        "tecnickcom/tcpdf": "^6.4.1"
77    },
78    "require-dev": {
79        "ext-dom": "*",
80        "ext-pdo_sqlite": "*",
81        "ext-sqlite3": "*",
82        "composer/composer": "~2.0",
83        "league/flysystem-memory": "~2.0",
84        "maximebf/debugbar": "~1.16",
85        "php-coveralls/php-coveralls": "~2.4",
86        "phpunit/phpunit": "~9.5"
87    },
88    "suggest": {
89        "ext-imagick": "Required to generate thumbnail images",
90        "ext-pdo_mysql": "Required to use MySQL for database storage",
91        "ext-pdo_sqlite": "Required to use SQLite for database storage",
92        "ext-pdo_pgsql": "Required to use PostgreSQL for database storage",
93        "ext-pdo_sqlsvr": "Required to use SQL Server for database storage",
94        "ext-zlib": "Required to compress HTTP respnses"
95    },
96    "scripts": {
97        "webtrees:build": [
98            "rm -Rf webtrees/",
99            "git archive --prefix=webtrees/ HEAD --format=tar | tar -x",
100            "@composer webtrees:lang",
101            "for FILE in resources/lang/*/messages.php; do cp $FILE webtrees/$FILE; done",
102            "zip --quiet --recurse-paths --move -9 webtrees.zip webtrees"
103        ],
104        "webtrees:pre-commit-hook": [
105            "@composer webtrees:phpcs",
106            "@composer webtrees:phpstan",
107            "@composer webtrees:test"
108        ],
109        "webtrees:check": [
110            "### PHP-CODE-SNIFFER",
111            "@composer webtrees:phpcs",
112            "### PHPSTAN",
113            "@composer webtrees:phpstan",
114            "### PSALM",
115            "@composer webtrees:psalm"
116        ],
117        "webtrees:phpcs": [
118            "@composer global require squizlabs/php_codesniffer=* --quiet",
119            "~/.composer/vendor/bin/phpcs --standard=PSR12 --colors --extensions=php --exclude=Generic.Files.LineLength index.php app tests",
120            "~/.composer/vendor/bin/phpcs --colors --extensions=css resources/css"
121        ],
122        "webtrees:phpstan": [
123            "@composer global require --quiet phpstan/phpstan=*",
124            "@composer global require --quiet phpstan/extension-installer=*",
125            "@composer global require --quiet phpstan/phpstan-deprecation-rules=*",
126            "@composer global require --quiet phpstan/phpstan-strict-rules=*",
127            "@composer global require --quiet phpstan/phpstan-phpunit=*",
128            "@composer install --quiet",
129            "~/.composer/vendor/bin/phpstan analyze --level=max index.php app",
130            "@composer install --no-dev --quiet"
131        ],
132        "webtrees:psalm": [
133            "@composer global require --quiet vimeo/psalm",
134            "@composer install --quiet",
135            "~/.composer/vendor/bin/psalm",
136            "@composer install --no-dev --quiet"
137        ],
138        "webtrees:test": [
139            "@composer install --quiet",
140            "@php vendor/bin/phpunit",
141            "@composer install --no-dev --quiet"
142        ],
143        "webtrees:coverage": [
144            "@composer install --dev --quiet",
145            "vendor/bin/phpunit --coverage-html=tests/coverage",
146            "@composer install --no-dev --quiet"
147        ],
148        "webtrees:lang": [
149            "Fisharebest\\Webtrees\\Console\\ComposerScripts::languageFiles"
150        ],
151        "webtrees:missing-tests": [
152            "Fisharebest\\Webtrees\\Console\\ComposerScripts::missingTests"
153        ],
154        "webtrees:po": [
155            "sed -i.bak -e 's/\\(I18N::[^)]*[)]\\)/<?php echo \\1; ?>/g' resources/xml/reports/*.xml",
156            "git grep -I --name-only --fixed-strings -e I18N:: -- '*.php' '*.phtml' '*.xml' | xargs xgettext --package-name=webtrees --package-version=1.0 --msgid-bugs-address=i18n@webtrees.net --output=resources/lang/webtrees.pot --no-wrap --language=PHP --add-comments=I18N --from-code=utf-8 --keyword --keyword=translate:1 --keyword=translateContext:1c,2 --keyword=plural:1,2",
157            "find resources/xml/reports/ -name '*.xml' -exec mv {}.bak {} \\;",
158            "find resources/lang -name '*.po' -exec msgmerge --no-wrap --sort-output --no-fuzzy-matching --quiet --output={} {} resources/lang/webtrees.pot \\;"
159        ],
160        "webtrees:png": [
161            "find resources/css -name *.png -exec pngquant --ext .png --force --skip-if-larger --speed 1 {} \\;",
162            "find resources/css -name *.png -exec pngcrush -rem allb -brute -reduce {} {} \\;",
163            "find resources/css -name *.png -exec optipng -o7 -zm1-9 {} \\;"
164        ]
165    },
166    "scripts-descriptions": {
167        "webtrees:build": "Create a distribution file (webtrees.zip)",
168        "webtrees:check": "Run various static analysis tools",
169        "webtrees:coverage": "Generate test coverage report",
170        "webtrees:lang": "Compile the language files (messages.php)",
171        "webtrees:po": "Update the language (webtrees.pot, *.po)"
172    }
173}
174