diff --git a/.gitattributes b/.gitattributes index 76ea8fe..e7b792f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -42,6 +42,9 @@ *.xml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 *.yml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +# PHPStan's baseline uses tabs instead of spaces. +core/.phpstan-baseline.php text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tabwidth=2 diff=php linguist-language=php + # Define binary file attributes. # - Do not treat them as text. # - Include binary diff in patches instead of "binary files differ." diff --git a/.gitignore b/.gitignore index 2c25169..8509c84 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,12 @@ vendor/ web/modules/contrib web/core web/sites/default/files +web/themes/contrib web/sites/default/files/* web/sites/default/settings.local.php */node_modules/ web/themes/custom/dchadwick/node_modules/* web/themes/custom/dchadwick/node_modules - +.DS_STORE +.ddev/ +web/modules/custom/*/node_modules diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4b90cc7..dcbdb08 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,20 +30,25 @@ build-job: # This job runs in the build stage, which runs first. - apt-get install rsync php php-curl php-zip curl -y - curl -sS https://getcomposer.org/installer -o composer-setup.php - php composer-setup.php --install-dir=/usr/local/bin --filename=composer - - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' - - mkdir -p ~/.ssh - - eval $(ssh-agent -s) - - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + - rm composer-setup.php script: - - ssh-add <(echo "$ZOIDBERG") - - ssh -o StrictHostKeyChecking=no dan@164.92.85.112 'cd /var/www/html/dchadwick/web && ls -lah' - composer install --ignore-platform-reqs --no-dev --optimize-autoloader --no-ansi --no-interaction - # - rsync -r ./ dan@164.92.85.112:/var/www/html/dchadwick/ + +#install-drupal: + # stage: test + #before_script: + # - apt-get update -y + #- apt-get install rsync php php-curl php-zip curl -y + #- curl -sS https://getcomposer.org/installer -o composer-setup.php + #- php composer-setup.php --install-dir=/usr/local/bin --filename=composer + #- rm composer-setup.php + #script: +# - composer install --ignore-platform-reqs --no-dev --optimize-autoloader --no-ansi --no-interaction + unit-test-job: # This job runs in the test stage. stage: test # It only starts when the job in the build stage completes successfully. script: - echo "Running unit tests... This will take about 60 seconds." - - sleep 60 - echo "Code coverage is 90%" lint-test-job: # This job also runs in the test stage. @@ -56,7 +61,23 @@ lint-test-job: # This job also runs in the test stage. deploy-job: # This job runs in the deploy stage. stage: deploy # It only runs when *both* jobs in the test stage complete successfully. environment: production + before_script: + - apt-get update -y + - apt-get install rsync git php php-curl php-zip curl -y + - curl -sS https://getcomposer.org/installer -o composer-setup.php + - php composer-setup.php --install-dir=/usr/local/bin --filename=composer + - rm composer-setup.php + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + - mkdir -p ~/.ssh + - eval $(ssh-agent -s) + - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' script: - #- rsync -r ./ dan@164.92.85.112:/var/www/html/dchadwick/ - - echo "Deploying application..." + - ssh-add <(echo "$ZOIDBERG") + - ssh -o StrictHostKeyChecking=no dan@164.92.85.112 'cd /var/www/html/dchadwick/web && ls -lah' + - composer install --ignore-platform-reqs --no-dev --optimize-autoloader --no-ansi --no-interaction + - ls -lah + - rsync -avzr ./ dan@164.92.85.112:/tmp/build --delete + - ssh -t dan@164.92.85.112 'SUDO_ASKPASS="/home/dan/pass" sudo -A cp -r /tmp/build/. /var/www/html/dchadwick/' + #- drush @self.prod updb -y + #- drush @self.prod cim -y - echo "Application successfully deployed." diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..c1264de --- /dev/null +++ b/TODO.md @@ -0,0 +1,4 @@ +1. Create API endpoints for recent fights +2. Switch to DCJS for fighter page +3. Create react based component for recent fights +4. Create unit tests for the web scraper diff --git a/composer.json b/composer.json index e709b5a..b2760d1 100644 --- a/composer.json +++ b/composer.json @@ -16,15 +16,23 @@ ], "require": { "composer/installers": "^2.0", + "cweagans/composer-patches": "^1.7", "drupal/admin_toolbar": "^3.4", + "drupal/bootstrap5": "^3.0", + "drupal/config_split": "^2.0", "drupal/core-composer-scaffold": "^10.2", "drupal/core-project-message": "^10.2", "drupal/core-recommended": "^10.2", + "drupal/devel_entity_updates": "^4.1", + "drupal/field_group": "^3.4", "drupal/migrate_plus": "^6.0", "drupal/migrate_tools": "^6.0", "drupal/pathauto": "^1.12", + "drupal/stage_file_proxy": "^2.1", "drupal/views_json_source": "^2.0", "drush/drush": "^12.4", + "symfony/css-selector": "^7.0", + "symfony/dom-crawler": "^7.0", "symfony/polyfill-iconv": "1.28", "symfony/polyfill-php80": "^1.29", "symfony/polyfill-php81": "^1.29", @@ -42,7 +50,8 @@ "drupal/core-project-message": true, "phpstan/extension-installer": true, "dealerdirect/phpcodesniffer-composer-installer": true, - "php-http/discovery": true + "php-http/discovery": true, + "cweagans/composer-patches": true }, "sort-packages": true }, diff --git a/composer.lock b/composer.lock index d9c43c0..5216abe 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8c373b8c3dcdeee153a365e81766e481", + "content-hash": "e7e102a26bf77765332247d29436a2d2", "packages": [ { "name": "asm89/stack-cors", @@ -864,6 +864,54 @@ }, "time": "2022-12-06T17:57:16+00:00" }, + { + "name": "cweagans/composer-patches", + "version": "1.7.3", + "source": { + "type": "git", + "url": "https://github.com/cweagans/composer-patches.git", + "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/e190d4466fe2b103a55467dfa83fc2fecfcaf2db", + "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3.0" + }, + "require-dev": { + "composer/composer": "~1.0 || ~2.0", + "phpunit/phpunit": "~4.6" + }, + "type": "composer-plugin", + "extra": { + "class": "cweagans\\Composer\\Patches" + }, + "autoload": { + "psr-4": { + "cweagans\\Composer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Cameron Eagans", + "email": "me@cweagans.net" + } + ], + "description": "Provides a way to patch Composer packages.", + "support": { + "issues": "https://github.com/cweagans/composer-patches/issues", + "source": "https://github.com/cweagans/composer-patches/tree/1.7.3" + }, + "time": "2022-12-20T22:53:13+00:00" + }, { "name": "dflydev/dot-access-data", "version": "v3.0.2", @@ -1015,6 +1063,97 @@ }, "time": "2023-02-01T09:20:38+00:00" }, + { + "name": "doctrine/common", + "version": "3.4.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/common.git", + "reference": "8b5e5650391f851ed58910b3e3d48a71062eeced" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/common/zipball/8b5e5650391f851ed58910b3e3d48a71062eeced", + "reference": "8b5e5650391f851ed58910b3e3d48a71062eeced", + "shasum": "" + }, + "require": { + "doctrine/persistence": "^2.0 || ^3.0", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9.0 || ^10.0", + "doctrine/collections": "^1", + "phpstan/phpstan": "^1.4.1", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5.20 || ^8.5 || ^9.0", + "squizlabs/php_codesniffer": "^3.0", + "symfony/phpunit-bridge": "^6.1", + "vimeo/psalm": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects depend on such as better reflection support, proxies and much more.", + "homepage": "https://www.doctrine-project.org/projects/common.html", + "keywords": [ + "common", + "doctrine", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/common/issues", + "source": "https://github.com/doctrine/common/tree/3.4.3" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcommon", + "type": "tidelift" + } + ], + "time": "2022-10-09T11:47:59+00:00" + }, { "name": "doctrine/deprecations", "version": "1.1.3", @@ -1062,6 +1201,97 @@ }, "time": "2024-01-30T19:34:25+00:00" }, + { + "name": "doctrine/event-manager", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/event-manager.git", + "reference": "750671534e0241a7c50ea5b43f67e23eb5c96f32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/750671534e0241a7c50ea5b43f67e23eb5c96f32", + "reference": "750671534e0241a7c50ea5b43f67e23eb5c96f32", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "conflict": { + "doctrine/common": "<2.9" + }, + "require-dev": { + "doctrine/coding-standard": "^10", + "phpstan/phpstan": "^1.8.8", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^4.28" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", + "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "keywords": [ + "event", + "event dispatcher", + "event manager", + "event system", + "events" + ], + "support": { + "issues": "https://github.com/doctrine/event-manager/issues", + "source": "https://github.com/doctrine/event-manager/tree/2.0.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager", + "type": "tidelift" + } + ], + "time": "2022-10-12T20:59:15+00:00" + }, { "name": "doctrine/lexer", "version": "2.1.1", @@ -1140,6 +1370,104 @@ ], "time": "2024-02-05T11:35:39+00:00" }, + { + "name": "doctrine/persistence", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/persistence.git", + "reference": "477da35bd0255e032826f440b94b3e37f2d56f42" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/persistence/zipball/477da35bd0255e032826f440b94b3e37f2d56f42", + "reference": "477da35bd0255e032826f440b94b3e37f2d56f42", + "shasum": "" + }, + "require": { + "doctrine/event-manager": "^1 || ^2", + "php": "^7.2 || ^8.0", + "psr/cache": "^1.0 || ^2.0 || ^3.0" + }, + "conflict": { + "doctrine/common": "<2.10" + }, + "require-dev": { + "composer/package-versions-deprecated": "^1.11", + "doctrine/coding-standard": "^11", + "doctrine/common": "^3.0", + "phpstan/phpstan": "1.9.4", + "phpstan/phpstan-phpunit": "^1", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.5", + "symfony/cache": "^4.4 || ^5.4 || ^6.0", + "vimeo/psalm": "4.30.0 || 5.3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Persistence\\": "src/Persistence" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.", + "homepage": "https://www.doctrine-project.org/projects/persistence.html", + "keywords": [ + "mapper", + "object", + "odm", + "orm", + "persistence" + ], + "support": { + "issues": "https://github.com/doctrine/persistence/issues", + "source": "https://github.com/doctrine/persistence/tree/3.3.2" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fpersistence", + "type": "tidelift" + } + ], + "time": "2024-03-12T14:54:36+00:00" + }, { "name": "drupal/admin_toolbar", "version": "3.4.2", @@ -1222,17 +1550,145 @@ } }, { - "name": "drupal/core", - "version": "10.2.4", + "name": "drupal/bootstrap5", + "version": "3.0.11", "source": { "type": "git", - "url": "https://github.com/drupal/core.git", - "reference": "d1c5b44adfc79bda03252471491b0fba89d87eff" + "url": "https://git.drupalcode.org/project/bootstrap5.git", + "reference": "3.0.11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core/zipball/d1c5b44adfc79bda03252471491b0fba89d87eff", - "reference": "d1c5b44adfc79bda03252471491b0fba89d87eff", + "url": "https://ftp.drupal.org/files/projects/bootstrap5-3.0.11.zip", + "reference": "3.0.11", + "shasum": "ea2ada76567d00cb84aa18904fd35e60dce716eb" + }, + "require": { + "drupal/core": "^9.4 || ^10" + }, + "type": "drupal-theme", + "extra": { + "drupal": { + "version": "3.0.11", + "datestamp": "1711069787", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Vladimir Roudakov (vladimiraus)", + "homepage": "https://www.drupal.org/u/vladimiraus", + "role": "Maintainer" + }, + { + "name": "VladimirAus", + "homepage": "https://www.drupal.org/user/673120" + } + ], + "description": "Master theme using Bootstrap 5: powerful front-end framework for faster and easier web development.", + "homepage": "https://www.drupal.org/project/bootstrap5", + "support": { + "source": "https://git.drupalcode.org/project/bootstrap5", + "issues": "https://www.drupal.org/project/issues/bootstrap5" + } + }, + { + "name": "drupal/config_split", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/config_split.git", + "reference": "2.0.0" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/config_split-2.0.0.zip", + "reference": "2.0.0", + "shasum": "be9fd0aba1206e0f19e8448f69d4210e53dae069" + }, + "require": { + "drupal/core": "^8.8 || ^9 || ^10" + }, + "conflict": { + "drush/drush": "<10" + }, + "require-dev": { + "drupal/config_filter": "^1||^2" + }, + "suggest": { + "drupal/chosen": "Chosen uses the Chosen jQuery plugin to make the