-
-
Notifications
You must be signed in to change notification settings - Fork 443
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
fix(blocks): switch the file-type to @sgtpooki/file-type #6803
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
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.
It still depends on buffer: sindresorhus/file-type#578.
The only solution is to reimplement file-type.
I also tried upgrading file-type package but got this error in AFFiNE.
|
7d72f3a
to
42257ef
Compare
if (!blob) { | ||
return null; | ||
} | ||
|
||
if (!blob.type) { |
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 suggest that we not delete file-type, because affine's sync backend does not store blob.type
. You can expect all blob.types
to be empty ""
. We can only calculate them through file-type
when type is needed.
As for the buffer issue of file-type v19 in the browser, affine can workaround by adding node:buffer
polyfill.
8bd528b
to
9e08d39
Compare
9e08d39
to
43645ce
Compare
43645ce
to
d85ec8d
Compare
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.
@sgtpooki/file-type
and it's direct dependencies are audited. No malicious codes found.
Merge activity
|
Fix toeverything/AFFiNE#6603 This pull request switches the [file-type](https://github.com/sindresorhus/file-type) to [@sgtpooki/file-type](https://github.com/sgtpooki/file-type). It also includes other minor changes and updates. ~~The `file-type` is no longer useful since the toeverything/AFFiNE#3245 resolved in toeverything/AFFiNE#5565 --- More context see toeverything/AFFiNE#3245 #3555 #4818 #5372 sindresorhus/file-type#578 --- ## Caveat The [@sgtpooki/file-type](https://github.com/sgtpooki/file-type) is an unofficial fork package from the community. It may need to be source code audited before updating. Also, thanks to sgtpooki for their strong contribution to @sgtpooki/file-type
d85ec8d
to
7664f3e
Compare
## Features - toeverything/blocksuite#6842 @donteatfriedrice - toeverything/blocksuite#6836 @regischen ## Bugfix - toeverything/blocksuite#6837 @pengx17 - toeverything/blocksuite#6803 @lawvs - toeverything/blocksuite#6843 @donteatfriedrice - toeverything/blocksuite#6838 @donteatfriedrice - toeverything/blocksuite#6834 @regischen - toeverything/blocksuite#6835 @donteatfriedrice - toeverything/blocksuite#6831 @pengx17 - toeverything/blocksuite#6827 @golok727 - toeverything/blocksuite#6828 @regischen ## Refactor ## Misc
This pull request is for sunsetting the `@sgtpooki/file-type` and using the official file-type v19.1.0. The `file-type` package has replaced the usage of `node:buffer` with `Uint8Array`. This change allows it to run safely in the browser now. The file-type package is used in the attachment-block and image-block modules to determine the file type of uploaded files. Related to #6803 sindresorhus/file-type#578 (comment)
Fix toeverything/AFFiNE#6603
This pull request switches the file-type to @sgtpooki/file-type.
It also includes other minor changes and updates.
Thefile-type
is no longer useful since the toeverything/AFFiNE#3245 resolved in toeverything/AFFiNE#5565More context see toeverything/AFFiNE#3245 #3555 #4818 #5372 sindresorhus/file-type#578
Caveat
The @sgtpooki/file-type is an unofficial fork package from the community. It may need to be source code audited before updating.
Also, thanks to sgtpooki for their strong contribution to @sgtpooki/file-type