Skip to content

Commit

Permalink
Rebuilt a lot of AntCMS
Browse files Browse the repository at this point in the history
* Started work on the next version of AntCMS (#86)

* Started work on the next version of AntCMS

* Allow the CI on any branch

* Update ci.yml

* Fixed deps for older PHP versions

* Deps don't actually support PHP 8.4 yet

* Added more typehints

* Ported the main app to Flight (#88)

* Ported the main app to Flight

* Made PHPStan happy

* Removed AntRouting

* Renamed many internal classes

* Caching related optimization

* Skip the cache test

* Update readme.md

* Got the robots.txt and sitemap plugins working (#89)

* More work for the next version (#90)

* Speedup YAML with an in-memory cache layer

* Cleanup

* Auto cleanup the vendor folder

* Improved the debug info

* Update readme.md

* Twig loader work for the rewrite (#91)

* Slight optimization

* Use an actual twig loader

And some other general cleanup too

* This test was for something I removed

* Update readme.md

* Code improvements, asset compression (#92)

* Fixed asset compression & other changes (#93)

* Fixed asset compression

* Updated the readme, handled some other items

Removed the old profile and admin plugins as I am not happy with how either of them previously worked and they will be rebuilt.

I also updated the BS theme so it's now compatible with the new twig loader setup.

* More prepwork (#94)

* Added config options to control compression

* Added some missing typhints

* Adjustments to the debug info

* Slight tweak to the page content

* Minor renames, deleted an unused file

* Fix the tests
  • Loading branch information
BelleNottelling authored Apr 22, 2024
1 parent b4cb7eb commit 9d3e155
Show file tree
Hide file tree
Showing 76 changed files with 2,349 additions and 2,217 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: []

jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php_version: [8.0, 8.1, 8.2, 8.3]

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
tools: composer:v2
extensions: apcu


- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Dependencies
run: composer install --no-interaction --prefer-dist --optimize-autoloader

- run: cp ./tests/Includes/Config.yaml ./src/Config/Config.yaml

- run: php src/Vendor/bin/phpunit tests

PHPStan:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: php-actions/composer@v6
- uses: php-actions/phpstan@v3
with:
configuration: phpstan.neon
memory_limit: 256M
version: latest
20 changes: 0 additions & 20 deletions .github/workflows/phpstan.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/unittests.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
node_modules
src/Cache/*
src/Config/Config.yaml
src/Config/Pages.yaml
src/Config/Pages.yaml
.php-cs-fixer.cache
16 changes: 16 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->exclude([
'src/Vendor',
'src/Cache',
])
;

return (new PhpCsFixer\Config())
->setRules([
'@PSR12' => true,
])
->setFinder($finder)
;
27 changes: 24 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,20 @@
"antcms/antloader": "^2.0.0",
"elgigi/commonmark-emoji": "^2.0",
"embed/embed": "^4.4",
"flightphp/core": "^3.8",
"hostbybelle/compressionbuffer": "^1.0",
"league/commonmark": "^2.3",
"liborm85/composer-vendor-cleaner": "^1.7",
"nyholm/psr7": "^1.8",
"shapecode/twig-string-loader": "^1.1",
"simonvomeyser/commonmark-ext-lazy-image": "^2.0",
"symfony/cache": "^6.0",
"symfony/yaml": "^6.0",
"twig/twig": "^3.5"
},
"replace": {
"symfony/polyfill-mbstring": "*",
"symfony/polyfill-php80": "*"
},
"authors": [
{
"name": "Belle Aerni",
Expand All @@ -29,11 +35,26 @@
],
"config": {
"vendor-dir": "src/Vendor",
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"liborm85/composer-vendor-cleaner": true
}
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.54",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^9.5",
"rector/rector": "^0.15.4"
"rector/rector": "^1.0.4"
},
"extra": {
"dev-files": {
"/": [
"tests/",
"docs/",
".travis.yml",
".github/",
".devcontainer/"
]
}
}
}
Loading

0 comments on commit 9d3e155

Please sign in to comment.