Skip to content

Commit

Permalink
Separated Composer packages
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbertsoft committed Aug 22, 2022
1 parent 5845e1a commit 9157def
Show file tree
Hide file tree
Showing 178 changed files with 3,381 additions and 2,614 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/.idea/
/.mage/
/.vscode/
/public/base-packages/
/public/p/
/public/p2/
/public/satis/
Expand Down
4 changes: 4 additions & 0 deletions .mage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ magephp:
- ./public/packages.json
- ./stubs
- ./tests
- ./tmp
- ./tools
- ./var
- ./LICENSE
Expand All @@ -30,15 +31,18 @@ magephp:
- exec: { cmd: "echo \"APP_ENV=prod\" >> .env.local", desc: "Create .env.local" }
- composer/install: { flags: '--no-dev --no-progress --optimize-autoloader' }
on-deploy:
- exec: { cmd: 'mkdir -p tmp/base-packages', desc: 'Create tmp/base-packages folder' }
- exec: { cmd: 'mkdir -p var', desc: 'Create var folder' }
- exec: { cmd: 'mkdir -p var/satis', desc: 'Create var/satis folder' }
- exec: { cmd: 'test -d ~/site/shared/base-packages || mkdir -p ~/site/shared/base-packages', desc: 'Create shared/base-packages folder' }
- exec: { cmd: 'test -d ~/site/shared/public/satis || mkdir -p ~/site/shared/public/satis', desc: 'Create shared/public/satis folder' }
- fs/link: { from: "../../../shared/.env.local", to: ".env.local" }
- fs/link: { from: "../../../../shared/public/satis", to: "public/satis" }
- fs/link: { from: "satis/p", to: "public/p" }
- fs/link: { from: "satis/p2", to: "public/p2" }
- fs/link: { from: "satis/aliases.json", to: "public/aliases.json" }
- fs/link: { from: "satis/packages.json", to: "public/packages.json" }
- fs/link: { from: "../../../../../shared/base-packages", to: "tmp/base-packages/packages" }
- exec: { cmd: "sqlite3 ~/site/mage/current/var/gettr.db '.backup var/gettr.db'", desc: "Copy DB" }
- exec: { cmd: "php-restart", desc: "Restart PHP and reset OPcache" }
- exec: { cmd: "php ./bin/console doctrine:migrations:sync-metadata-storage --no-interaction", desc: "Synchronize DB Migrations" }
Expand Down
3 changes: 3 additions & 0 deletions cnf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ location ~ (?!^\/\.well-known)\/\. {
allow 213.144.157.127;
allow 2001:1620:c7f:111::/64;

# Allow GitHub for webhook testing
allow 140.82.115.0/24;

# Block abusing IPs
deny 212.95.122.212;

Expand Down
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
"ext-iconv": "*",
"ext-json": "*",
"ext-sqlite3": "*",
"ext-zip": "*",
"ext-zlib": "*",
"composer/composer": "^2.2",
"composer/satis": "^3.0@dev",
"composer/semver": "^3.3",
"doctrine/collections": "^1.6",
Expand Down Expand Up @@ -64,6 +66,8 @@
"symfony/dependency-injection": "^5.4",
"symfony/dotenv": "^5.4",
"symfony/expression-language": "^5.4",
"symfony/filesystem": "^5.4",
"symfony/finder": "^5.4",
"symfony/flex": "^2.2",
"symfony/form": "^5.4",
"symfony/framework-bundle": "^5.4",
Expand All @@ -75,6 +79,7 @@
"symfony/mime": "^5.4",
"symfony/monolog-bundle": "^3.1",
"symfony/notifier": "^5.4",
"symfony/options-resolver": "^5.4",
"symfony/process": "^5.4",
"symfony/property-access": "^5.4",
"symfony/property-info": "^5.4",
Expand Down
3 changes: 2 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions config/packages/framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ framework:
php_errors:
log: true

form:
legacy_error_messages: false

when@test:
framework:
test: true
Expand Down
2 changes: 1 addition & 1 deletion config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ security:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
admin:
pattern: ^/admin
pattern: ^/(admin|login|logout)
lazy: true
provider: users_in_memory
form_login:
Expand Down
2 changes: 2 additions & 0 deletions config/packages/twig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ twig:
packagist:
search: https://packagist.org/explore/?type=typo3-cms-extension
submit: https://packagist.org/packages/submit
form_themes:
- 'form/custom_theme.html.twig'
22 changes: 21 additions & 1 deletion config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
app.domain: '%env(APP_DOMAIN)%'
app.base_packages_project_dir: 'tmp/base-packages'
app.base_packages_assets_dir: 'base-packages'

services:
# default configuration for services in *this* file
Expand All @@ -17,10 +19,14 @@ services:
App\:
resource: '../src/'
exclude:
- '../src/DataFixtures/'
- '../src/DependencyInjection/'
- '../src/Entity/'
- '../src/Kernel.php'
- '../src/Enum/'
- '../src/Exception/'
- '../src/Package/'
- '../src/Tests/'
- '../src/Kernel.php'

# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
Expand All @@ -34,6 +40,9 @@ services:
arguments:
$appDomain: '%env(APP_DOMAIN)%'

App\EventListener\BasePackageListener:
tags: ['doctrine.orm.entity_listener']

App\EventListener\MajorVersionListener:
tags: ['doctrine.orm.entity_listener']

Expand All @@ -43,6 +52,17 @@ services:
App\EventListener\RequirementListener:
tags: ['doctrine.orm.entity_listener']

App\Security\GitHubRequestChecker:
arguments:
$signingSecret: '%env(APP_WEBHOOK_SECRET_GITHUB)%'

App\Service\BasePackageService:
arguments:
$projectDir: '%app.base_packages_project_dir%'
$assetsDir: '%app.base_packages_assets_dir%'

App\Service\CacheWarmupService:
arguments:
$baseUrl: '%env(BASE_URL)%'

Composer\Console\Application:
2 changes: 1 addition & 1 deletion migrations/Version20220818095608.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class Version20220818095608 extends AbstractMigration
{
public function getDescription(): string
{
return '';
return 'Add ID to Requirements';
}

public function up(Schema $schema): void
Expand Down
53 changes: 53 additions & 0 deletions migrations/Version20220818183005.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

declare(strict_types=1);

/*
* This file is part of the package t3o/get.typo3.org.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220818183005 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add BasePackages for Sitepackage Builder';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE base_packages (name VARCHAR(255) NOT NULL, active BOOLEAN NOT NULL, official BOOLEAN NOT NULL, PRIMARY KEY(name))');
$this->addSql('INSERT INTO base_packages (name, active, official) VALUES (?, ?, ?)', ['1' => 'typo3/bootstrap-package', '2' => 1, '3' => 1], ['1' => 2, '2' => 5, '3' => 5]);
$this->addSql('INSERT INTO base_packages (name, active, official) VALUES (?, ?, ?)', ['1' => 'typo3/fluid-styled-content', '2' => 1, '3' => 1], ['1' => 2, '2' => 5, '3' => 5]);
$this->addSql('INSERT INTO base_packages (name, active, official) VALUES (?, ?, ?)', ['1' => 'typo3/introduction-package', '2' => 1, '3' => 0], ['1' => 2, '2' => 5, '3' => 5]);
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE base_packages');
}
}
8 changes: 8 additions & 0 deletions public/assets/Css/additions.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,11 @@ pre {
.frame .swagger-ui .auth-wrapper .authorize {
margin-right: 0;
}


/* BasePackage List */
.basepackage-official-badge {
position: absolute;
right: 0.75em;
transform: translate(0, 25%);
}
92 changes: 92 additions & 0 deletions public/assets/Images/OfficialBadge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9157def

Please sign in to comment.