diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 59d8f8c..cf4fc87 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -1,14 +1,7 @@
module.exports = {
- extends: [
- '@nextcloud',
- '@vue/eslint-config-typescript/recommended',
- 'plugin:prettier/recommended',
- ],
- parser: 'vue-eslint-parser',
+ extends: ['@nextcloud', 'plugin:prettier/recommended'],
rules: {
'jsdoc/require-jsdoc': 'off',
- 'vue/first-attribute-linebreak': 'off',
'sort-imports': 'error',
- 'vue/attributes-order': ['error', { alphabetical: true }],
},
}
diff --git a/appinfo/info.xml b/appinfo/info.xml
index 436ee70..0f8e3d9 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -5,7 +5,7 @@
Retro
🕹️ Play your favorite retro games in Nextcloud
An example description
- 0.1.0
+ 1.0.0
agpl
Michel Roux
Retro
@@ -13,7 +13,7 @@
https://git.crystalyx.net/Xefir/retro
https://git.crystalyx.net/Xefir/retro/issues
-
+
diff --git a/composer.json b/composer.json
index bffa39f..805f037 100644
--- a/composer.json
+++ b/composer.json
@@ -16,7 +16,7 @@
"rector": "rector && composer cs:fix"
},
"require": {
- "php": "^8.1"
+ "php": "^8.2"
},
"require-dev": {
"nextcloud/ocp": "^30.0.4",
@@ -24,13 +24,14 @@
"nextcloud/coding-standard": "^1.3.2",
"nextcloud/rector": "^0.2.1",
"rector/rector": "~1.2.10",
+ "symfony/mime": "^7.2.1",
"vimeo/psalm": "^5.26.1"
},
"config": {
"optimize-autoloader": true,
"sort-packages": true,
"platform": {
- "php": "8.1"
+ "php": "8.2"
}
}
}
diff --git a/composer.lock b/composer.lock
index f5e6fe2..bc2c22e 100644
--- a/composer.lock
+++ b/composer.lock
@@ -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": "71be025f1b762a92e851b18347e49db6",
+ "content-hash": "1c093d99c361ea9e5e1b4e69b06dd6d9",
"packages": [],
"packages-dev": [
{
@@ -1214,16 +1214,16 @@
},
{
"name": "phpstan/phpstan",
- "version": "1.12.13",
+ "version": "1.12.14",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
- "reference": "9b469068840cfa031e1deaf2fa1886d00e20680f"
+ "reference": "e73868f809e68fff33be961ad4946e2e43ec9e38"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9b469068840cfa031e1deaf2fa1886d00e20680f",
- "reference": "9b469068840cfa031e1deaf2fa1886d00e20680f",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e73868f809e68fff33be961ad4946e2e43ec9e38",
+ "reference": "e73868f809e68fff33be961ad4946e2e43ec9e38",
"shasum": ""
},
"require": {
@@ -1268,7 +1268,7 @@
"type": "github"
}
],
- "time": "2024-12-17T17:00:20+00:00"
+ "time": "2024-12-31T07:26:13+00:00"
},
{
"name": "psr/clock",
@@ -2387,29 +2387,29 @@
},
{
"name": "sebastian/diff",
- "version": "5.1.1",
+ "version": "6.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e"
+ "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e",
- "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544",
+ "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.2"
},
"require-dev": {
- "phpunit/phpunit": "^10.0",
- "symfony/process": "^6.4"
+ "phpunit/phpunit": "^11.0",
+ "symfony/process": "^4.2 || ^5"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "5.1-dev"
+ "dev-main": "6.0-dev"
}
},
"autoload": {
@@ -2442,7 +2442,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/diff/issues",
"security": "https://github.com/sebastianbergmann/diff/security/policy",
- "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1"
+ "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2"
},
"funding": [
{
@@ -2450,7 +2450,7 @@
"type": "github"
}
],
- "time": "2024-03-02T07:15:17+00:00"
+ "time": "2024-07-03T04:53:05+00:00"
},
{
"name": "spatie/array-to-xml",
@@ -2522,47 +2522,46 @@
},
{
"name": "symfony/console",
- "version": "v6.4.15",
+ "version": "v7.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd"
+ "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/f1fc6f47283e27336e7cebb9e8946c8de7bff9bd",
- "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd",
+ "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3",
+ "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3",
"shasum": ""
},
"require": {
- "php": ">=8.1",
- "symfony/deprecation-contracts": "^2.5|^3",
+ "php": ">=8.2",
"symfony/polyfill-mbstring": "~1.0",
"symfony/service-contracts": "^2.5|^3",
- "symfony/string": "^5.4|^6.0|^7.0"
+ "symfony/string": "^6.4|^7.0"
},
"conflict": {
- "symfony/dependency-injection": "<5.4",
- "symfony/dotenv": "<5.4",
- "symfony/event-dispatcher": "<5.4",
- "symfony/lock": "<5.4",
- "symfony/process": "<5.4"
+ "symfony/dependency-injection": "<6.4",
+ "symfony/dotenv": "<6.4",
+ "symfony/event-dispatcher": "<6.4",
+ "symfony/lock": "<6.4",
+ "symfony/process": "<6.4"
},
"provide": {
"psr/log-implementation": "1.0|2.0|3.0"
},
"require-dev": {
"psr/log": "^1|^2|^3",
- "symfony/config": "^5.4|^6.0|^7.0",
- "symfony/dependency-injection": "^5.4|^6.0|^7.0",
- "symfony/event-dispatcher": "^5.4|^6.0|^7.0",
+ "symfony/config": "^6.4|^7.0",
+ "symfony/dependency-injection": "^6.4|^7.0",
+ "symfony/event-dispatcher": "^6.4|^7.0",
"symfony/http-foundation": "^6.4|^7.0",
"symfony/http-kernel": "^6.4|^7.0",
- "symfony/lock": "^5.4|^6.0|^7.0",
- "symfony/messenger": "^5.4|^6.0|^7.0",
- "symfony/process": "^5.4|^6.0|^7.0",
- "symfony/stopwatch": "^5.4|^6.0|^7.0",
- "symfony/var-dumper": "^5.4|^6.0|^7.0"
+ "symfony/lock": "^6.4|^7.0",
+ "symfony/messenger": "^6.4|^7.0",
+ "symfony/process": "^6.4|^7.0",
+ "symfony/stopwatch": "^6.4|^7.0",
+ "symfony/var-dumper": "^6.4|^7.0"
},
"type": "library",
"autoload": {
@@ -2596,7 +2595,7 @@
"terminal"
],
"support": {
- "source": "https://github.com/symfony/console/tree/v6.4.15"
+ "source": "https://github.com/symfony/console/tree/v7.2.1"
},
"funding": [
{
@@ -2612,7 +2611,7 @@
"type": "tidelift"
}
],
- "time": "2024-11-06T14:19:14+00:00"
+ "time": "2024-12-11T03:49:26+00:00"
},
{
"name": "symfony/deprecation-contracts",
@@ -2683,25 +2682,25 @@
},
{
"name": "symfony/filesystem",
- "version": "v6.4.13",
+ "version": "v7.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
- "reference": "4856c9cf585d5a0313d8d35afd681a526f038dd3"
+ "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/4856c9cf585d5a0313d8d35afd681a526f038dd3",
- "reference": "4856c9cf585d5a0313d8d35afd681a526f038dd3",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb",
+ "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.2",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-mbstring": "~1.8"
},
"require-dev": {
- "symfony/process": "^5.4|^6.4|^7.0"
+ "symfony/process": "^6.4|^7.0"
},
"type": "library",
"autoload": {
@@ -2729,7 +2728,7 @@
"description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/filesystem/tree/v6.4.13"
+ "source": "https://github.com/symfony/filesystem/tree/v7.2.0"
},
"funding": [
{
@@ -2745,7 +2744,91 @@
"type": "tidelift"
}
],
- "time": "2024-10-25T15:07:50+00:00"
+ "time": "2024-10-25T15:15:23+00:00"
+ },
+ {
+ "name": "symfony/mime",
+ "version": "v7.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/mime.git",
+ "reference": "7f9617fcf15cb61be30f8b252695ed5e2bfac283"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/mime/zipball/7f9617fcf15cb61be30f8b252695ed5e2bfac283",
+ "reference": "7f9617fcf15cb61be30f8b252695ed5e2bfac283",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.2",
+ "symfony/polyfill-intl-idn": "^1.10",
+ "symfony/polyfill-mbstring": "^1.0"
+ },
+ "conflict": {
+ "egulias/email-validator": "~3.0.0",
+ "phpdocumentor/reflection-docblock": "<3.2.2",
+ "phpdocumentor/type-resolver": "<1.4.0",
+ "symfony/mailer": "<6.4",
+ "symfony/serializer": "<6.4.3|>7.0,<7.0.3"
+ },
+ "require-dev": {
+ "egulias/email-validator": "^2.1.10|^3.1|^4",
+ "league/html-to-markdown": "^5.0",
+ "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
+ "symfony/dependency-injection": "^6.4|^7.0",
+ "symfony/process": "^6.4|^7.0",
+ "symfony/property-access": "^6.4|^7.0",
+ "symfony/property-info": "^6.4|^7.0",
+ "symfony/serializer": "^6.4.3|^7.0.3"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Mime\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Allows manipulating MIME messages",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "mime",
+ "mime-type"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/mime/tree/v7.2.1"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-12-07T08:50:44+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -2904,6 +2987,89 @@
],
"time": "2024-09-09T11:45:10+00:00"
},
+ {
+ "name": "symfony/polyfill-intl-idn",
+ "version": "v1.31.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-intl-idn.git",
+ "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c36586dcf89a12315939e00ec9b4474adcb1d773",
+ "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2",
+ "symfony/polyfill-intl-normalizer": "^1.10"
+ },
+ "suggest": {
+ "ext-intl": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Intl\\Idn\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Laurent Bassin",
+ "email": "laurent@bassin.info"
+ },
+ {
+ "name": "Trevor Rowbotham",
+ "email": "trevor.rowbotham@pm.me"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "idn",
+ "intl",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.31.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-09-09T11:45:10+00:00"
+ },
{
"name": "symfony/polyfill-intl-normalizer",
"version": "v1.31.0",
@@ -3150,20 +3316,20 @@
},
{
"name": "symfony/string",
- "version": "v6.4.15",
+ "version": "v7.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
- "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f"
+ "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/string/zipball/73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f",
- "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f",
+ "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82",
+ "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.2",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-intl-grapheme": "~1.0",
"symfony/polyfill-intl-normalizer": "~1.0",
@@ -3173,11 +3339,12 @@
"symfony/translation-contracts": "<2.5"
},
"require-dev": {
- "symfony/error-handler": "^5.4|^6.0|^7.0",
- "symfony/http-client": "^5.4|^6.0|^7.0",
- "symfony/intl": "^6.2|^7.0",
+ "symfony/emoji": "^7.1",
+ "symfony/error-handler": "^6.4|^7.0",
+ "symfony/http-client": "^6.4|^7.0",
+ "symfony/intl": "^6.4|^7.0",
"symfony/translation-contracts": "^2.5|^3.0",
- "symfony/var-exporter": "^5.4|^6.0|^7.0"
+ "symfony/var-exporter": "^6.4|^7.0"
},
"type": "library",
"autoload": {
@@ -3216,7 +3383,7 @@
"utf8"
],
"support": {
- "source": "https://github.com/symfony/string/tree/v6.4.15"
+ "source": "https://github.com/symfony/string/tree/v7.2.0"
},
"funding": [
{
@@ -3232,7 +3399,7 @@
"type": "tidelift"
}
],
- "time": "2024-11-13T13:31:12+00:00"
+ "time": "2024-11-13T13:31:26+00:00"
},
{
"name": "vimeo/psalm",
@@ -3411,11 +3578,11 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
- "php": "^8.1"
+ "php": "^8.2"
},
"platform-dev": [],
"platform-overrides": {
- "php": "8.1"
+ "php": "8.2"
},
"plugin-api-version": "2.6.0"
}
diff --git a/img/app.svg b/img/app.svg
index ff8f6ab..3f4a71b 100644
--- a/img/app.svg
+++ b/img/app.svg
@@ -1,5 +1,5 @@
-
-
-
-
-
-
-
diff --git a/src/init.ts b/src/init.ts
index e69de29..24aba70 100644
--- a/src/init.ts
+++ b/src/init.ts
@@ -0,0 +1,27 @@
+import { FileAction, FileType, Node, registerFileAction } from '@nextcloud/files'
+import cores from './mime.json'
+import { generateUrl } from '@nextcloud/router'
+import icon from '../img/'
+import { t } from '@nextcloud/l10n'
+
+const action = new FileAction({
+ id: 'retro',
+ displayName: () => t('repod', 'Play'),
+ iconSvgInline: () => icon,
+ enabled: (files: Node[]) => {
+ if (files.length !== 1) return false
+ const file = files[0]
+ if (file.type !== FileType.File) return false
+ for (const core in cores) {
+ if (cores[core].types === file.mime) return true
+ if (cores[core].extensions.includes(file.extension)) return true
+ }
+ return false
+ },
+ exec: async (file: Node) => {
+ location.href = generateUrl('/apps/retro/' + file.path)
+ return true
+ },
+})
+
+registerFileAction(action)
diff --git a/src/main.ts b/src/main.ts
index 945f412..e69de29 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -1,6 +0,0 @@
-import '@formatjs/intl-segmenter/polyfill'
-import App from './App.vue'
-import { createApp } from 'vue'
-
-const View = createApp(App)
-View.mount('#retro')
diff --git a/src/mime.json b/src/mime.json
new file mode 100644
index 0000000..80f735c
--- /dev/null
+++ b/src/mime.json
@@ -0,0 +1,109 @@
+{
+ "nes": {
+ "types": [
+ "application/x-nes-rom"
+ ],
+ "extensions": [
+ "fds",
+ "nes",
+ "unif",
+ "unf",
+ "nez"
+ ]
+ },
+ "snes": {
+ "types": [
+ "application/x-snes-rom"
+ ],
+ "extensions": [
+ "smc",
+ "fig",
+ "sfc",
+ "gd3",
+ "gd7",
+ "dx2",
+ "bsx",
+ "swc"
+ ]
+ },
+ "n64": {
+ "types": [
+ "application/x-n64-rom"
+ ],
+ "extensions": [
+ "z64",
+ "n64",
+ "v64"
+ ]
+ },
+ "pce": {
+ "types": [
+ "application/x-pc-engine-rom"
+ ],
+ "extensions": [
+ "pce"
+ ]
+ },
+ "ngp": {
+ "types": [
+ "application/x-neo-geo-pocket-rom",
+ "application/x-neo-geo-pocket-color-rom"
+ ],
+ "extensions": [
+ "ngp",
+ "ngc"
+ ]
+ },
+ "ws": {
+ "types": [
+ "application/x-wonderswan-rom",
+ "application/x-wonderswan-color-rom"
+ ],
+ "extensions": [
+ "ws",
+ "wsc"
+ ]
+ },
+ "coleco": {
+ "types": [],
+ "extensions": [
+ "col",
+ "cv"
+ ]
+ },
+ "vice_x64sc": {
+ "types": [],
+ "extensions": [
+ "d64"
+ ]
+ },
+ "nds": {
+ "types": [
+ "application/x-nintendo-ds-rom"
+ ],
+ "extensions": [
+ "nds"
+ ]
+ },
+ "gba": {
+ "types": [
+ "application/x-gba-rom"
+ ],
+ "extensions": [
+ "gba",
+ "agb"
+ ]
+ },
+ "gb": {
+ "types": [
+ "application/x-gameboy-rom",
+ "application/x-gameboy-color-rom"
+ ],
+ "extensions": [
+ "gb",
+ "sgb",
+ "gbc",
+ "cgb"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/tsconfig.json b/tsconfig.json
index cd4df6e..190d375 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,6 +1,5 @@
{
- "extends": "@vue/tsconfig",
- "include": ["./src/**/*.ts", "./src/**/*.vue", "**/*.ts"],
+ "include": ["./src/**/*.ts", "**/*.ts"],
"compilerOptions": {
"allowImportingTsExtensions": true,
"allowSyntheticDefaultImports": true,