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 18, 2022
1 parent 7d5fc27 commit 1895d3c
Show file tree
Hide file tree
Showing 490 changed files with 6,730 additions and 1,021 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
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: 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'
18 changes: 17 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: 'var/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,13 @@ services:
App\EventListener\RequirementListener:
tags: ['doctrine.orm.entity_listener']

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:
31 changes: 31 additions & 0 deletions migrations/Version20220818183005.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

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 '';
}

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, version VARCHAR(63) NOT NULL, active BOOLEAN NOT NULL, official BOOLEAN NOT NULL, PRIMARY KEY(name))');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE base_packages');
}
}
21 changes: 21 additions & 0 deletions packages/base-package-bootstrap-package/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "typo3/base-package-bootstrap-package",
"description": "Base package for the generation of a TYPO3 Sitepackage based on bk2k/bootstrap-package at https://get.typo3.org.",
"license": "GPL-2.0-or-later",
"type": "typo3-base-package",
"extra": {
"typo3/base-package": {
"title": "Bootstrap Package",
"description": "Create a Sitepackage based on the popular Bootstrap Package.",
"core-versions": [
"8.7",
"9.5",
"10.4",
"11.5"
],
"images": {
"preview": "images/preview.png"
}
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "{{ package.vendorNameAlternative }}-{{ package.packageNameAlternative }}",
"name": "{{ package.composerVendorName }}-{{ package.composerProjectName }}",
"description": "{{ package.description }}",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
{% if package.typo3version < 11000000 %}defined('TYPO3_MODE') || die();{% else %}defined('TYPO3') or die('Access denied.');{% endif %}
defined('TYPO3_MODE') || die();
call_user_func(function()
{
Expand All @@ -9,7 +9,7 @@ call_user_func(function()
$extensionKey = '{{ package.extensionKey }}';
/**
* Default PageTS for {{ package.packageName }}
* Default PageTS for {{ package.extensionKey }}
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
$extensionKey,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
{% if package.typo3version < 11000000 %}defined('TYPO3_MODE') || die();{% else %}defined('TYPO3') or die('Access denied.');{% endif %}
defined('TYPO3_MODE') || die();
call_user_func(function()
{
Expand All @@ -9,7 +9,7 @@ call_user_func(function()
$extensionKey = '{{ package.extensionKey }}';
/**
* Default TypoScript for {{ package.packageName }}
* Default TypoScript for {{ package.extensionKey }}
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
$extensionKey,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//
// Variables
//
@import "variables";

//
// Import needed Bootstrap Package Files
//
@import "EXT:bootstrap_package/Resources/Public/Scss/bootstrap5/theme";
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "{{ package.vendorNameAlternative }}/{{ package.packageNameAlternative }}",
"name": "{{ package.composerName }}",
"type": "typo3-cms-extension",
"description": "{{ package.description}}",
"homepage": "{{ package.author.homepage }}",
"license": ["GPL-2.0-or-later"],
"keywords": ["TYPO3 CMS"],
"require": {
"bk2k/bootstrap-package": "{% if package.typo3version < 9000000 %}^10.0{% elseif package.typo3version < 10000000 %}^10.0 || ^11.0{% else %}^12.0{% endif %}"
"bk2k/bootstrap-package": "^12.0"
},
"autoload": {
"psr-4": {
"{{ package.vendorName }}\\{{ package.packageName }}\\": "Classes/"
"{{ package.psr4Namespace }}\\": "Classes"
}
},
"extra": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ $EM_CONF[$_EXTKEY] = [
'category' => 'templates',
'constraints' => [
'depends' => [
'bootstrap_package' => '{% if package.typo3version < 9000000 %}10.0.0-10.0.99{% elseif package.typo3version < 10000000 %}10.0.0-11.0.99{% else %}12.0.0-12.9.99{% endif %}',
'bootstrap_package' => '12.0.0-12.9.99',
],
'conflicts' => [
],
],
'autoload' => [
'psr-4' => [
'{{ package.vendorName }}\\{{ package.packageName }}\\' => 'Classes',
'{{ package.psr4Namespace }}\\' => 'Classes',
],
],
'state' => 'stable',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
{% if package.typo3version < 11000000 %}defined('TYPO3_MODE') || die();{% else %}defined('TYPO3') or die('Access denied.');{% endif %}
defined('TYPO3') or die('Access denied.');
/***************
* Add default RTE configuration
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
defined('TYPO3') or die('Access denied.');
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
module.exports = function(grunt) {

/**
* Project configuration.
*/
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
paths: {
root: '../',
resources: '<%= paths.root %>Resources/',
fonts: '<%= paths.resources %>Public/Fonts/',
img: '<%= paths.resources %>Public/Images/',
js: '<%= paths.resources %>Public/JavaScript/'
},
banner: '/*!\n' +
' * {{ package.title }} v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
' * Copyright 2017-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
' * Licensed under the <%= pkg.license %> license\n' +
' */\n',
uglify: {
all: {
options: {
banner: '<%= banner %>',
mangle: true,
compress: true,
beautify: false
},
files: {
"<%= paths.js %>/Dist/scripts.js": [
"<%= paths.js %>Src/main.js"
]
}
}
},
imagemin: {
extension: {
files: [{
expand: true,
cwd: '<%= paths.resources %>',
src: [
'**/*.{png,jpg,gif,svg}'
],
dest: '<%= paths.resources %>'
}]
}
},
watch: {
options: {
livereload: true
},
javascript: {
files: '<%= paths.js %>Src/**/*.js',
tasks: ['js']
}
}
});

/**
* Register tasks
*/
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-imagemin');

/**
* Grunt update task
*/
grunt.registerTask('js', ['uglify']);
grunt.registerTask('build', ['js', 'imagemin']);
grunt.registerTask('default', ['build']);

};
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "{{ package.composerVendorName }}-{{ package.composerProjectName }}",
"description": "{{ package.description }}",
"repository": {
"type": "git",
"url": "{{ package.repositoryUrl }}"
},
"homepage": "{{ package.author.homepage }}",
"author": "{{ package.author.name }}",
"version": "1.0.0",
"license": "GPL-2.0-or-later",
"devDependencies": {
"grunt": "^1.0.3",
"grunt-contrib-uglify": "^4.0.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-contrib-imagemin": "^2.0.1"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
imports:
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" }
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" }
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml" }
- { resource: "EXT:bootstrap_package/Configuration/RTE/Default.yaml" }

editor:
config:
contentsCss: "EXT:bootstrap_package/Resources/Public/Css/bootstrap4-rte.min.css"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
{% if package.typo3version < 11000000 %}defined('TYPO3_MODE') || die();{% else %}defined('TYPO3') or die('Access denied.');{% endif %}
defined('TYPO3') or die('Access denied.');
call_user_func(function()
{
Expand All @@ -9,7 +9,7 @@ call_user_func(function()
$extensionKey = '{{ package.extensionKey }}';
/**
* Default PageTS for {{ package.packageName }}
* Default PageTS for {{ package.extensionKey }}
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
$extensionKey,
Expand Down
Loading

0 comments on commit 1895d3c

Please sign in to comment.