aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/pleroma
diff options
context:
space:
mode:
authorLibravatar MCMXC <16797721+mcmxcdev@users.noreply.github.com>2023-07-26 06:29:03 -0600
committerLibravatar GitHub <noreply@github.com>2023-07-26 17:59:03 +0530
commit9b8f01716774a960073e944823ab727cc867a8f6 (patch)
tree732b83770baa78f5cf12776aaa33ce65bebfa418 /recipes/pleroma
parentAdd Excalidraw recipe (#393) (diff)
downloadferdium-recipes-9b8f01716774a960073e944823ab727cc867a8f6.tar.gz
ferdium-recipes-9b8f01716774a960073e944823ab727cc867a8f6.tar.zst
ferdium-recipes-9b8f01716774a960073e944823ab727cc867a8f6.zip
chore: improve lint setup (#397)
- update eslint config to closely mirror the ones from ferdium-app - add .eslintignore - opt in to eslint `reportUnusedDisableDirectives` config option - remove `trailingComma: all` from `prettier` config which is default in `prettier` v3 - autofix or disable a lot of lint issues throughout codebase - add `volta` configuration to `package.json` to autoload correct `node` and `pnpm` versions - upgrade all `eslint` and `prettier` related dependencies to latest - update lint:fix npm script - reformat touched files with prettier - bumped up minor version for all recipes that have changes - introduced injection of 'service.css' where it was missing in many recipes --------- Co-authored-by: Vijay A <vraravam@users.noreply.github.com>
Diffstat (limited to 'recipes/pleroma')
-rw-r--r--recipes/pleroma/index.js36
-rw-r--r--recipes/pleroma/package.json2
-rw-r--r--recipes/pleroma/webview.js2
3 files changed, 22 insertions, 18 deletions
diff --git a/recipes/pleroma/index.js b/recipes/pleroma/index.js
index 67a0e19..2050059 100644
--- a/recipes/pleroma/index.js
+++ b/recipes/pleroma/index.js
@@ -1,19 +1,21 @@
1module.exports = Ferdium => class Pleroma extends Ferdium { 1module.exports = Ferdium =>
2 async validateUrl(url) { 2 class Pleroma extends Ferdium {
3 try { 3 async validateUrl(url) {
4 const resp = await window.fetch(`${url}/api/v1/instance`, { 4 try {
5 Accept: 'application/json', 5 const resp = await window.fetch(`${url}/api/v1/instance`, {
6 }); 6 Accept: 'application/json',
7 const data = await resp.json(); 7 });
8 const version = data.version; 8 const data = await resp.json();
9 return typeof (version) === 'string' && version.includes('Pleroma'); 9 const version = data.version;
10 } catch (error) { 10 return typeof version === 'string' && version.includes('Pleroma');
11 console.log('Pleroma server validation error', error); 11 } catch (error) {
12 // eslint-disable-next-line no-console
13 console.log('Pleroma server validation error', error);
14 }
15 return false;
12 } 16 }
13 return false;
14 }
15 17
16 buildUrl(url) { 18 buildUrl(url) {
17 return `${url}/main/friends`; 19 return `${url}/main/friends`;
18 } 20 }
19}; 21 };
diff --git a/recipes/pleroma/package.json b/recipes/pleroma/package.json
index de92244..5819a75 100644
--- a/recipes/pleroma/package.json
+++ b/recipes/pleroma/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "pleroma", 2 "id": "pleroma",
3 "name": "Pleroma", 3 "name": "Pleroma",
4 "version": "1.3.0", 4 "version": "1.4.0",
5 "license": "MIT", 5 "license": "MIT",
6 "config": { 6 "config": {
7 "hasCustomUrl": true 7 "hasCustomUrl": true
diff --git a/recipes/pleroma/webview.js b/recipes/pleroma/webview.js
index 41516f6..703a53f 100644
--- a/recipes/pleroma/webview.js
+++ b/recipes/pleroma/webview.js
@@ -16,6 +16,7 @@ const getInstanceConfig = async () => {
16 const pleromaFeConfig = frontendConfig.pleroma_fe || {}; 16 const pleromaFeConfig = frontendConfig.pleroma_fe || {};
17 return { ...staticConfig, ...pleromaFeConfig }; 17 return { ...staticConfig, ...pleromaFeConfig };
18 } catch (error) { 18 } catch (error) {
19 // eslint-disable-next-line no-console
19 console.log('Failed to load dynamic frontend configuration', error); 20 console.log('Failed to load dynamic frontend configuration', error);
20 return staticConfig; 21 return staticConfig;
21 } 22 }
@@ -162,6 +163,7 @@ module.exports = Ferdium => {
162 }); 163 });
163 }, 164 },
164 error => { 165 error => {
166 // eslint-disable-next-line no-console
165 console.log('Failed to load instance logo', error); 167 console.log('Failed to load instance logo', error);
166 Ferdium.loop(getMessages); 168 Ferdium.loop(getMessages);
167 }, 169 },