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/
.idea /*.iml
/.php-cs-fixer.cache
/.php_cs.cache
/build/
/vendor/ /vendor/
js/ /vendor-bin/*/vendor/
node_modules/
/.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 *.iml
.idea
/.php-cs-fixer.cache
/.php_cs.cache
build/
vendor/ vendor/
js/ vendor-bin/*/vendor/
.php-cs-fixer.cache
tests/.phpunit.cache
node_modules/ node_modules/
js/
build/

View File

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

View File

@ -1,14 +1,12 @@
{ {
"name": "nextcloud/repod", "name": "nextcloud/repod",
"description": "🔊 Browse, manage and listen to podcasts", "description": "🔊 Browse, manage and listen to podcasts",
"type": "project",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"version": "2.3.0", "autoload": {
"require-dev": { "psr-4": {
"nextcloud/ocp": "^29.0.1", "OCA\\RePod\\": "lib/",
"roave/security-advisories": "dev-latest", "OCA\\GPodderSync\\": "stubs/OCA/GPodderSync/"
"nextcloud/coding-standard": "^1.2.1", }
"vimeo/psalm": "^5.24.0"
}, },
"scripts": { "scripts": {
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './build/*' -print0 | xargs -0 -n1 php -l", "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", "cs:fix": "php-cs-fixer fix",
"psalm": "psalm --threads=1 --no-cache --show-info=true" "psalm": "psalm --threads=1 --no-cache --show-info=true"
}, },
"autoload": { "require-dev": {
"psr-4": { "nextcloud/ocp": "^29.0.1",
"OCA\\RePod\\": "lib/", "roave/security-advisories": "dev-latest",
"OCA\\GPodderSync\\": "stubs/OCA/GPodderSync/" "nextcloud/coding-standard": "^1.2.1",
} "vimeo/psalm": "^5.24.0"
}, },
"config": { "config": {
"optimize-autoloader": true, "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", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "6fbdd24b91ec2a3afe776062f3fbddb6", "content-hash": "65775ebb89b46239e28c1e32a3e02324",
"packages": [], "packages": [],
"packages-dev": [ "packages-dev": [
{ {
@ -1304,12 +1304,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git", "url": "https://github.com/Roave/SecurityAdvisories.git",
"reference": "a73032ab55e80a4fef2732a9a8a3396c345f953b" "reference": "e567d8d7d81fe18d93e87f64427a49caf3d5511f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/a73032ab55e80a4fef2732a9a8a3396c345f953b", "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/e567d8d7d81fe18d93e87f64427a49caf3d5511f",
"reference": "a73032ab55e80a4fef2732a9a8a3396c345f953b", "reference": "e567d8d7d81fe18d93e87f64427a49caf3d5511f",
"shasum": "" "shasum": ""
}, },
"conflict": { "conflict": {
@ -1317,6 +1317,7 @@
"admidio/admidio": "<4.2.13", "admidio/admidio": "<4.2.13",
"adodb/adodb-php": "<=5.20.20|>=5.21,<=5.21.3", "adodb/adodb-php": "<=5.20.20|>=5.21,<=5.21.3",
"aheinze/cockpit": "<2.2", "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", "aimeos/aimeos-typo3": "<19.10.12|>=20,<20.10.5",
"airesvsg/acf-to-rest-api": "<=3.1", "airesvsg/acf-to-rest-api": "<=3.1",
"akaunting/akaunting": "<2.1.13", "akaunting/akaunting": "<2.1.13",
@ -2095,7 +2096,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-05-29T12:12:50+00:00" "time": "2024-05-29T15:04:31+00:00"
}, },
{ {
"name": "sebastian/diff", "name": "sebastian/diff",

View File

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

2
package-lock.json generated
View File

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

View File

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