Skip to content

Commit

Permalink
!!! [TASK] change requirements
Browse files Browse the repository at this point in the history
* drop TYPO3 10 Support
* add TYPO3 13 Support
* use CI
  • Loading branch information
achimfritz-b13 committed May 23, 2024
1 parent d3fb8a2 commit 0808c5a
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 25 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on: [push, pull_request]

jobs:
testsuite:

runs-on: ubuntu-latest
strategy:
matrix:
TYPO3: [ '11' , '12', '13']

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up PHP Version
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: composer:v2

- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: dependencies-composer-${{ hashFiles('composer.json') }}

- name: Install composer dependencies TYPO3 13
if: matrix.TYPO3 == '13'
run: |
composer install --no-progress --no-interaction
- name: Install composer dependencies TYPO3 12
if: matrix.TYPO3 == '12'
run: |
composer require typo3/cms-core:^12.4 --no-progress --no-interaction --dev -W
- name: Install composer dependencies TYPO3 11
if: matrix.TYPO3 == '11'
run: |
composer require typo3/cms-core:^11.5 --no-progress --no-interaction --dev -W
- name: Phpstan
run: ./vendor/bin/phpstan analyze -c Build/phpstan.neon
- name: Phpcsfix
run: ./vendor/bin/php-cs-fixer fix --config=Build/php-cs-fixer.php --dry-run --stop-on-violation --using-cache=no
File renamed without changes.
6 changes: 6 additions & 0 deletions Build/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
includes:
- ../vendor/saschaegerer/phpstan-typo3/extension.neon
parameters:
level: 5
paths:
- %currentWorkingDirectory%/Classes
2 changes: 0 additions & 2 deletions Configuration/Services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,3 @@ services:
tags:
- name: event.listener
identifier: 'b13-bolt/add-typoscript-from-site-extension'
# for v10 compat, optional since v11
event: TYPO3\CMS\Core\TypoScript\IncludeTree\Event\AfterTemplatesHaveBeenDeterminedEvent
3 changes: 3 additions & 0 deletions Configuration/user.tsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# default user ts config for v13
# Hide tstemplate "Edit TypoScript record" and "Constant Editor" in core v12
options.hideModules := addToList(web_typoscript_infomodify, web_typoscript_constanteditor)
16 changes: 11 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
"license": "GPL-2.0-or-later",
"keywords": ["TYPO3 CMS", "Integrators", "Site Extension", "Site Package", "TypoScript"],
"require": {
"php": "^7.2 || ^8.0",
"typo3/cms-core": "^10.4 || ^11.0 || ^12.0"
"php": "^7.4 || ^8.0",
"typo3/cms-core": "^11.0 || ^12.0 || ^13.1",
"typo3/cms-backend": "^11.0 || ^12.0 || ^13.1"
},
"replace": {
"cmsexperts/bolt": "*",
Expand All @@ -24,13 +25,18 @@
}
},
"require-dev": {
"typo3/coding-standards": "^0.4.0",
"saschaegerer/phpstan-typo3": "^1.8",
"typo3/coding-standards": "^0.7",
"typo3/tailor": "^1.1"
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"typo3/cms-composer-installers": true,
"typo3/class-alias-loader": true
}
},
"scripts": {
"php:cs": "@composer exec php-cs-fixer fix"
"php:cs": "@composer exec 'php-cs-fixer fix --config=Build/php-cs-fixer.php'"
}
}
4 changes: 2 additions & 2 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
'title' => 'Bolt - An easy TYPO3 integration basis',
'description' => 'Connect a Site configuration to a Site package / extension',
'category' => 'fe',
'version' => '2.3.1',
'version' => '3.0.0',
'state' => 'stable',
'clearcacheonload' => true,
'author' => 'Benni Mack',
'author_email' => 'typo3@b13.com',
'author_company' => 'b13 GmbH',
'constraints' => [
'depends' => [
'typo3' => '10.4.0-12.99.99',
'typo3' => '11.5.0-13.99.99',
],
],
];
21 changes: 19 additions & 2 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,22 @@

defined('TYPO3') or die();

// Register autoloading for TypoScript for TYPO3 v10 and v11
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Core/TypoScript/TemplateService']['runThroughTemplatesPostProcessing']['bolt'] = \B13\Bolt\TypoScript\Loader::class . '->addSiteConfiguration';
(function() {
// Register autoloading for TypoScript for TYPO3 v11
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Core/TypoScript/TemplateService']['runThroughTemplatesPostProcessing']['bolt'] = \B13\Bolt\TypoScript\Loader::class . '->addSiteConfiguration';

// v13 Page TS
$pageTs = '
# Disable adding new sys_template records in list module
mod.web_list.deniedNewTables := addToList(sys_template)
# Hide TSconfig and tsconfig_includes fields when editing pages
TCEFORM.pages.TSconfig.disabled=1
TCEFORM.pages.tsconfig_includes.disabled=1';

if (isset($GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'])) {
$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'] .= $pageTs;
} else {
$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'] = $pageTs;
}
})();
32 changes: 18 additions & 14 deletions ext_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@

defined('TYPO3') or die();

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
# Disable adding new sys_template records in list module
mod.web_list.deniedNewTables := addToList(sys_template)
if ((\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Information\Typo3Version::class))->getMajorVersion() < 12) {
// $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'] is used for v13
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
# Disable adding new sys_template records in list module
mod.web_list.deniedNewTables := addToList(sys_template)
# Hide tstemplate "Info/Modify" and "Constant Editor" in core v10 & v11
mod.web_ts.menu.function.TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateConstantEditorModuleFunctionController = 0
mod.web_ts.menu.function.TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateInformationModuleFunctionController = 0
# Hide tstemplate "Info/Modify" and "Constant Editor" in core v11
mod.web_ts.menu.function.TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateConstantEditorModuleFunctionController = 0
mod.web_ts.menu.function.TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateInformationModuleFunctionController = 0
# Hide TSconfig and tsconfig_includes fields when editing pages
TCEFORM.pages.TSconfig.disabled=1
TCEFORM.pages.tsconfig_includes.disabled=1
');
# Hide TSconfig and tsconfig_includes fields when editing pages
TCEFORM.pages.TSconfig.disabled=1
TCEFORM.pages.tsconfig_includes.disabled=1
');

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('
# Hide tstemplate "Edit TypoScript record" and "Constant Editor" in core v12
options.hideModules := addToList(web_typoscript_infomodify, web_typoscript_constanteditor)
');
// Configuration/user.tsconfig is used for v13
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('
# Hide tstemplate "Edit TypoScript record" and "Constant Editor" in core v12
options.hideModules := addToList(web_typoscript_infomodify, web_typoscript_constanteditor)
');
};

0 comments on commit 0808c5a

Please sign in to comment.