refactor: ♻️ app-template refacto part 2
All checks were successful
repod / xml (push) Successful in 13s
repod / php (push) Successful in 39s
repod / nodejs (push) Successful in 1m20s
repod / release (push) Has been skipped

This commit is contained in:
Michel Roux 2024-05-29 17:55:14 +02:00
parent de1b7184d2
commit 010550fa60
11 changed files with 42 additions and 63 deletions

View File

@ -1,8 +1,13 @@
*.iml
.idea
/.php-cs-fixer.cache
/.php_cs.cache
/build/
/.idea/
/*.iml
/vendor/
js/
node_modules/
/vendor-bin/*/vendor/
/.php-cs-fixer.cache
/tests/.phpunit.cache
/node_modules/
/js/
/build/

View File

@ -1,9 +0,0 @@
*.iml
.idea
/.php-cs-fixer.cache
/.php_cs.cache
/build/
/vendor/
js/
node_modules/
l10n/

View File

@ -1,8 +1,13 @@
.idea/
*.iml
.idea
/.php-cs-fixer.cache
/.php_cs.cache
build/
vendor/
js/
vendor-bin/*/vendor/
.php-cs-fixer.cache
tests/.phpunit.cache
node_modules/
js/
build/

View File

@ -23,11 +23,11 @@ class MyConfig extends Config
$config = new MyConfig();
$config
->getFinder()
->ignoreVCSIgnored(true)
->notPath('build')
->notPath('l10n')
->notPath('node_modules')
->notPath('src')
->notPath('vendor')
->in(__DIR__);
return $config;

View File

@ -1,14 +1,12 @@
{
"name": "nextcloud/repod",
"description": "🔊 Browse, manage and listen to podcasts",
"type": "project",
"license": "AGPL-3.0-or-later",
"version": "2.3.0",
"require-dev": {
"nextcloud/ocp": "^29.0.1",
"roave/security-advisories": "dev-latest",
"nextcloud/coding-standard": "^1.2.1",
"vimeo/psalm": "^5.24.0"
"autoload": {
"psr-4": {
"OCA\\RePod\\": "lib/",
"OCA\\GPodderSync\\": "stubs/OCA/GPodderSync/"
}
},
"scripts": {
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './build/*' -print0 | xargs -0 -n1 php -l",
@ -16,11 +14,11 @@
"cs:fix": "php-cs-fixer fix",
"psalm": "psalm --threads=1 --no-cache --show-info=true"
},
"autoload": {
"psr-4": {
"OCA\\RePod\\": "lib/",
"OCA\\GPodderSync\\": "stubs/OCA/GPodderSync/"
}
"require-dev": {
"nextcloud/ocp": "^29.0.1",
"roave/security-advisories": "dev-latest",
"nextcloud/coding-standard": "^1.2.1",
"vimeo/psalm": "^5.24.0"
},
"config": {
"optimize-autoloader": true,

11
composer.lock generated
View File

@ -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": "6fbdd24b91ec2a3afe776062f3fbddb6",
"content-hash": "65775ebb89b46239e28c1e32a3e02324",
"packages": [],
"packages-dev": [
{
@ -1304,12 +1304,12 @@
"source": {
"type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git",
"reference": "a73032ab55e80a4fef2732a9a8a3396c345f953b"
"reference": "e567d8d7d81fe18d93e87f64427a49caf3d5511f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/a73032ab55e80a4fef2732a9a8a3396c345f953b",
"reference": "a73032ab55e80a4fef2732a9a8a3396c345f953b",
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/e567d8d7d81fe18d93e87f64427a49caf3d5511f",
"reference": "e567d8d7d81fe18d93e87f64427a49caf3d5511f",
"shasum": ""
},
"conflict": {
@ -1317,6 +1317,7 @@
"admidio/admidio": "<4.2.13",
"adodb/adodb-php": "<=5.20.20|>=5.21,<=5.21.3",
"aheinze/cockpit": "<2.2",
"aimeos/aimeos-core": ">=2022.04.1,<2022.10.17|>=2023.04.1,<2023.10.17|>=2024.04.1,<2024.04.7",
"aimeos/aimeos-typo3": "<19.10.12|>=20,<20.10.5",
"airesvsg/acf-to-rest-api": "<=3.1",
"akaunting/akaunting": "<2.1.13",
@ -2095,7 +2096,7 @@
"type": "tidelift"
}
],
"time": "2024-05-29T12:12:50+00:00"
"time": "2024-05-29T15:04:31+00:00"
},
{
"name": "sebastian/diff",

View File

@ -8,31 +8,22 @@ use OCA\RePod\AppInfo\Application;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\ContentSecurityPolicy;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\IRequest;
use OCP\Util;
class PageController extends Controller
{
public function __construct(
IRequest $request,
private IConfig $config
) {
parent::__construct(Application::APP_ID, $request);
}
/**
* @NoAdminRequired
* @NoCSRFRequired
*/
public function index(): TemplateResponse {
Util::addScript(Application::APP_ID, 'repod-main');
Util::addScript(Application::APP_ID, 'main');
$csp = new ContentSecurityPolicy();
$csp->addAllowedImageDomain('*');
$csp->addAllowedMediaDomain('*');
$response = new TemplateResponse(Application::APP_ID, 'main');
$response = new TemplateResponse(Application::APP_ID, 'index');
$response->setContentSecurityPolicy($csp);
return $response;

2
package-lock.json generated
View File

@ -1,12 +1,10 @@
{
"name": "repod",
"version": "2.3.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "repod",
"version": "2.3.0",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@nextcloud/axios": "^2.5.0",

View File

@ -1,6 +1,5 @@
{
"name": "repod",
"version": "2.3.0",
"license": "AGPL-3.0-or-later",
"scripts": {
"build": "NODE_ENV=production webpack --config webpack.js --progress",

1
templates/index.php Normal file
View File

@ -0,0 +1 @@
<div id="content"></div>

View File

@ -1,10 +0,0 @@
<?php
declare(strict_types=1);
use OCA\RePod\AppInfo\Application;
use OCP\Util;
Util::addScript(Application::APP_ID, 'main');
?>
<div id="content"></div>