aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-08-11 21:01:14 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-08-11 21:01:14 +0530
commit664b2c5a0523439c9672248b652df858facf7ff2 (patch)
treebd6e138cd725166dfef1a93cec7b35118b6b3903
parentrevert: fixing #1757 by commenting out partial fix (diff)
downloadferdium-app-664b2c5a0523439c9672248b652df858facf7ff2.tar.gz
ferdium-app-664b2c5a0523439c9672248b652df858facf7ff2.tar.zst
ferdium-app-664b2c5a0523439c9672248b652df858facf7ff2.zip
refactor: removed legacy properties from recipes
(Addendum to getferdi/recipes#605)
-rw-r--r--package-lock.json13
-rw-r--r--package.json1
m---------recipes0
-rw-r--r--src/features/communityRecipes/store.js1
-rw-r--r--src/models/Recipe.js12
5 files changed, 3 insertions, 24 deletions
diff --git a/package-lock.json b/package-lock.json
index bafb70961..6739d0e52 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -7306,14 +7306,6 @@
7306 "integrity": "sha1-anmQQ3ynNtXhKI25K9MmbV9csqo=", 7306 "integrity": "sha1-anmQQ3ynNtXhKI25K9MmbV9csqo=",
7307 "dev": true 7307 "dev": true
7308 }, 7308 },
7309 "address-rfc2822": {
7310 "version": "2.1.0",
7311 "resolved": "https://registry.npmjs.org/address-rfc2822/-/address-rfc2822-2.1.0.tgz",
7312 "integrity": "sha512-TwoTmJcYzS+CLw/h+AO3zOzRFGSMNowmp/tlOXcYPygkr2vMAWLs0pDajJiJK/dtVPpFx1utw/CzzLfmmtkagw==",
7313 "requires": {
7314 "email-addresses": "^4.0.0"
7315 }
7316 },
7317 "agent-base": { 7309 "agent-base": {
7318 "version": "6.0.2", 7310 "version": "6.0.2",
7319 "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", 7311 "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
@@ -13261,11 +13253,6 @@
13261 } 13253 }
13262 } 13254 }
13263 }, 13255 },
13264 "email-addresses": {
13265 "version": "4.0.0",
13266 "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-4.0.0.tgz",
13267 "integrity": "sha512-Nas3sSSiD5lSIoqBos0FMjB9h4clHxXuAahHKGJ5doRWavEB7pBHzOxnI7R5f1MuGNrrSnsZFJ81HCBv0DZmnw=="
13268 },
13269 "emittery": { 13256 "emittery": {
13270 "version": "0.8.1", 13257 "version": "0.8.1",
13271 "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz", 13258 "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz",
diff --git a/package.json b/package.json
index e19a74360..7be375805 100644
--- a/package.json
+++ b/package.json
@@ -69,7 +69,6 @@
69 "@meetfranz/theme": "file:packages/theme", 69 "@meetfranz/theme": "file:packages/theme",
70 "@meetfranz/ui": "file:packages/ui", 70 "@meetfranz/ui": "file:packages/ui",
71 "@sentry/electron": "2.5.1", 71 "@sentry/electron": "2.5.1",
72 "address-rfc2822": "2.1.0",
73 "atob": "2.1.2", 72 "atob": "2.1.2",
74 "auto-launch": "5.0.5", 73 "auto-launch": "5.0.5",
75 "btoa": "1.2.1", 74 "btoa": "1.2.1",
diff --git a/recipes b/recipes
Subproject 97697e3d069972844b2912a93022f4a4904a40d Subproject 2fd678efd32725a881152af2b2ee5fa64f422de
diff --git a/src/features/communityRecipes/store.js b/src/features/communityRecipes/store.js
index b115a53e1..a3614dd11 100644
--- a/src/features/communityRecipes/store.js
+++ b/src/features/communityRecipes/store.js
@@ -19,6 +19,7 @@ export class CommunityRecipesStore extends FeatureStore {
19 if (!this.stores) return []; 19 if (!this.stores) return [];
20 20
21 return this.stores.recipePreviews.dev.map((r) => { 21 return this.stores.recipePreviews.dev.map((r) => {
22 // TODO: Need to figure out if this is even necessary/used
22 r.isDevRecipe = !!r.author.find((a) => a.email === this.stores.user.data.email); 23 r.isDevRecipe = !!r.author.find((a) => a.email === this.stores.user.data.email);
23 24
24 return r; 25 return r;
diff --git a/src/models/Recipe.js b/src/models/Recipe.js
index 92ff0d67d..e616055d6 100644
--- a/src/models/Recipe.js
+++ b/src/models/Recipe.js
@@ -1,9 +1,9 @@
1import emailParser from 'address-rfc2822';
2import semver from 'semver'; 1import semver from 'semver';
3import { pathExistsSync } from 'fs-extra'; 2import { pathExistsSync } from 'fs-extra';
4import { join } from 'path'; 3import { join } from 'path';
5 4
6export default class Recipe { 5export default class Recipe {
6 // Note: Do NOT change these default values. If they change, then the corresponding changes in the recipes needs to be done
7 id = ''; 7 id = '';
8 8
9 name = ''; 9 name = '';
@@ -60,8 +60,6 @@ export default class Recipe {
60 60
61 this.id = data.id || this.id; 61 this.id = data.id || this.id;
62 this.name = data.name || this.name; 62 this.name = data.name || this.name;
63 this.rawAuthor = data.author || this.author;
64 this.description = data.description || this.description;
65 this.version = data.version || this.version; 63 this.version = data.version || this.version;
66 this.path = data.path; 64 this.path = data.path;
67 65
@@ -86,14 +84,8 @@ export default class Recipe {
86 this.message = data.config.message || this.message; 84 this.message = data.config.message || this.message;
87 } 85 }
88 86
87 // TODO: Need to remove this if its not used anywhere
89 get author() { 88 get author() {
90 try {
91 const addresses = emailParser.parse(this.rawAuthor);
92 return addresses.map((a) => ({ email: a.address, name: a.phrase }));
93 } catch (err) {
94 console.warn(`Not a valid author for ${this.name}`);
95 }
96
97 return []; 89 return [];
98 } 90 }
99 91