-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Create a favicon for an artist based on their avatar #912
feat: Create a favicon for an artist based on their avatar #912
Conversation
👷 Deploy request for mirlo pending review.Visit the deploys page to approve it
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing, thanks for doing this!
Added a comment that i think should help
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! I can't really think of a way to make the final folder structure a bit more organized. I wonder if favicons should go into their own bucket, but I guess that doesn't necessarily have to happen? As long as the file name is consistent and identifiable.
@lenikadali not sure why this is failing. I'm wondering if you could try rebasing your branch onto the |
I would lean towards a separate bucket for favicons. That being said, I think it would (potentially) require moving the whole process to |
Added the sharp-ico package and tried to generate a favicon based on the artist avatar we have.
Fixed comment to match JS style comments
Added call to upload the artist avatar favicon to the Minio store and some logging to indicate when it happens
Removed the artistFavicon variable since the return value of the ico method is the size, width and height properties of the favicon. Switch to setting the file name as a variable and use that when saving the favicon to the Minio bucket.
764fdcb
to
107daa2
Compare
Did this and |
Hmm, I'll pull down the branch and try to replicate in the next day or so to try and see what's up. |
Odd, |
"@faker-js/faker@npm:^8.3.1": | ||
version: 8.3.1 | ||
resolution: "@faker-js/faker@npm:8.3.1" | ||
checksum: 10/66b25cb82af907ff127767b54a5d6e95919c8051cd2de9131a6f5dd45dc539ebfbafad66e590e603e347e4c411f0f83c28e70043024af66faebba49d9868c263 | ||
"@esbuild/win32-x64@npm:0.24.0": | ||
version: 0.24.0 | ||
resolution: "@esbuild/win32-x64@npm:0.24.0" | ||
conditions: os=win32 & cpu=x64 | ||
languageName: node | ||
linkType: hard | ||
|
||
"@fal-works/esbuild-plugin-global-externals@npm:^2.1.2": | ||
version: 2.1.2 | ||
resolution: "@fal-works/esbuild-plugin-global-externals@npm:2.1.2" | ||
checksum: 10/fd68714cccfbd33a8ec31d11ac7c6373100a5e1b8e31941a45c723c802feccb0a00dde946f55cc91d58bff77d405adc2064b22f0faf5ee165968965e5da758a1 | ||
"@faker-js/faker@npm:^8.3.1": | ||
version: 8.4.1 | ||
resolution: "@faker-js/faker@npm:8.4.1" | ||
checksum: 10/5983c2ea64f26055ad6648de748878e11ebe2fb751e3c7435ae141cdffabc2dccfe4c4f49da69a3d2add71e21b415c683ac5fba196fab0d5ed6779fbec436c80 | ||
languageName: node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Odd,
yarn tsc
passes on main, but not on this branch. I'm wondering whethersharp-ico
introduces a faker version somewhere? I tried upgrading to a more recent version of typescript and the error still persists. Specifying where types are stored also doesn't help.
@simonv3 it would seem it does going by the changes in yarn.lock
here. Let me take a look at the library's dependencies to see if we can get one that depends on main
's version of faker
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to go by the versions here and tried yarn install
for all of them. yarn.lock
didn't change the faker
version back to what it is on main
so it looks like the newer version was the original dependency for sharp-ico
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing we could do is freeze the faker
version to 8.3.1
. The diff would look like so:
$ git diff
diff --git a/package.json b/package.json
index 1dd8dc92..18f57d25 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,7 @@
},
"dependencies": {
"@bull-board/express": "^4.11.0",
- "@faker-js/faker": "^8.3.1",
+ "@faker-js/faker": "8.3.1",
"@prisma/client": "5",
"@types/connect-busboy": "^1.0.3",
"@types/faker": "^6.6.9",
diff --git a/yarn.lock b/yarn.lock
index 504574d0..d4c4365e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1755,10 +1755,10 @@ __metadata:
languageName: node
linkType: hard
-"@faker-js/faker@npm:^8.3.1":
- version: 8.4.1
- resolution: "@faker-js/faker@npm:8.4.1"
- checksum: 10/5983c2ea64f26055ad6648de748878e11ebe2fb751e3c7435ae141cdffabc2dccfe4c4f49da69a3d2add71e21b415c683ac5fba196fab0d5ed6779fbec436c80
+"@faker-js/faker@npm:8.3.1":
+ version: 8.3.1
+ resolution: "@faker-js/faker@npm:8.3.1"
+ checksum: 10/66b25cb82af907ff127767b54a5d6e95919c8051cd2de9131a6f5dd45dc539ebfbafad66e590e603e347e4c411f0f83c28e70043024af66faebba49d9868c263
languageName: node
linkType: hard
@@ -13044,7 +13044,7 @@ __metadata:
resolution: "mirlo@workspace:."
dependencies:
"@bull-board/express": "npm:^4.11.0"
- "@faker-js/faker": "npm:^8.3.1"
+ "@faker-js/faker": "npm:8.3.1"
"@prisma/client": "npm:5"
"@types/archiver": "npm:^5.3.2"
"@types/bcryptjs": "npm:^2.4.2"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lenikadali does freezing it prevent the type error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No unfortunately not.
This is what I see when I run yarn tsc
:
$ yarn tsc
error TS2688: Cannot find type definition file for 'faker'.
The file is in the program because:
Entry point for implicit type library 'faker'
Found 1 error.
The other thing we could try is cherry-pick the commits onto main
and see if yarn tsc
passes (with the freeze).
Edit: tried to cherry-pick
and yarn tsc
still fails. It seems that for this to be merged, we may have to upgrade faker
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does upgrading faker help? I thought I did that when I was attempting this locally earlier in the week, but maybe that's a step I forgot. It's totally fine to upgrade faker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried upgrading faker and that didn't seem to do anything.
weird because the dependency tree of sharp-ico does not include faker:
└─ [email protected]
├─ @types/[email protected]
│ └─ @types/[email protected]
│ └─ [email protected]
├─ [email protected]
│ ├─ [email protected]
│ ├─ [email protected]
│ │ ├─ [email protected]
│ │ └─ @canvas/[email protected]
│ └─ @canvas/[email protected]
├─ [email protected]
└─ [email protected]
├─ [email protected]
├─ @img/[email protected]
│ └─ @emnapi/[email protected]
│ └─ [email protected]
├─ @img/[email protected]
│ └─ @img/[email protected]
├─ [email protected]
│ ├─ [email protected]
│ │ └─ [email protected]
│ └─ [email protected]
│ ├─ [email protected]
│ │ └─ [email protected]
│ └─ [email protected]
├─ [email protected]
├─ @img/[email protected]
│ └─ @img/[email protected]
├─ @img/[email protected]
├─ @img/[email protected]
│ └─ @img/[email protected]
├─ @img/[email protected]
├─ @img/[email protected]
│ └─ @img/[email protected]
├─ @img/[email protected]
│ └─ @img/[email protected]
├─ @img/[email protected]
│ └─ @img/[email protected]
├─ @img/[email protected]
│ └─ @img/[email protected]
├─ @img/[email protected]
│ └─ @img/[email protected]
├─ @img/[email protected]
├─ @img/[email protected]
├─ @img/[email protected]
├─ @img/[email protected]
├─ @img/[email protected]
├─ @img/[email protected]
├─ @img/[email protected]
└─ @img/[email protected]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I think something else happened here. When I go to the main branch, create a new branch for this, and install sharp-ico
from scratch, I don't get the type error.
@lenikadali I wonder if starting from scratch here would be a good idea? Basically just a blank branch, install sharp-ico
and then add the lines changed. I'd do the copy paste job but want to make sure you get credit!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-doing the changes from the original PR funmusicplace#912 adding the ability to create a favicon from an artist's avatar. Somehow faker got upgraded and made tests fail
Fixes #330