Skip to content

Conversation

@AliKdhim87
Copy link
Contributor

Screen.Recording.2025-06-04.at.09.45.16.mov

@AliKdhim87 AliKdhim87 requested a review from Robbert June 4, 2025 07:49
@vercel
Copy link

vercel bot commented Jun 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cms-frameless-io ❌ Failed (Inspect) Jun 4, 2025 7:49am
tiptap ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 7:49am

@AliKdhim87 AliKdhim87 linked an issue Jun 5, 2025 that may be closed by this pull request
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deze config is wel erg uitgebreid, zouden alle strapi plugins niet een gedeelde tsconfig kunnen extenden?


3. Open the `plugins.ts` file for editing.

4. Add the following configuration to set up the Vercel provider:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Vercel provider"?


## Author

Created by [Frameless](https://github.com/frameless).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Created by [Frameless](https://github.com/frameless).
Created by [Frameless](https://frameless.io/).


// Mime type check
if (allowedMimeTypes && !allowedMimeTypes.includes(file.mime)) {
const allowedTypes = allowedMimeTypes.map((type) => type.split('/')[1].toUpperCase()).join(', ');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dit is geen nauwkeurige benadering, ik zou gewoon een lijst maken van alle volledige mime types.

}

// Mime type check
if (allowedMimeTypes && !allowedMimeTypes.includes(file.mime)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

om een goede match te hebben, onafhankelijk van hoofdletters enzo, stel ik voor dat je een library gebruikt om de mime type te normaliseren. Zowel de lijst met mime types die uit de configuratie komt, als de file.mime. Ik zou zo vroeg mogelijk in het proces die normalisatie doen. https://www.npmjs.com/package/media-type is een library van een goede developer die ik vertrouw.

throw new Error('Strapi global object with dirs.static.public is not available.');
}

const uploadPath = path.resolve(strapiGlobal.dirs.static.public, UPLOADS_FOLDER_NAME);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waarom maken we niet de hele path configurable? Waarom is uploads hardcoded?

},

delete(file: File): Promise<string | void> {
return new Promise((resolve, reject) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waarom doen we hier promises op de "oude manier", in plaats van await?

if (!fs.existsSync(filePath)) {
resolve("File doesn't exist");
return;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Volgens mij word existSync afgeraden, zou een try/catch om unlink beter en voldoende zijn?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uploads filteren in Media Library

3 participants