Code Monkey home page Code Monkey logo

sanity-plugin-external-files's Introduction

sanity-plugin-external-files

Series of plugins for working with media files hosted elsewhere inside of Sanity.

Screenshot of the plugin

Existing implementations

List of vendors currently supported:

Use one of the existing implementations or write your own!

Creating your own implementation

I'm yet to properly document how to create your own implementation, so please reach out if you're looking into doing it! You can get a hold of me at [email protected].

While that documentation gets sorted out, be sure to take a look at the configuration for the Firebase plugin and for the S3 plugin. The core plugin does the heavy lifting: the full implementation of the DigitalOcean plugin is 330 lines of code, including types and documentation ✨

Roadmap

From my own standpoint and use cases, this plugin is feature complete.

That said, I'm willing to develop it further given the interest and resources. Here's a list of features and improvements we could pursue:

  • Synchronizing files uploaded to vendors outside of Sanity
    • ✨ Solves: this would make it possible to have multiple entries to your storage buckets and using Sanity as the single source of truth. A significantly better experience than opening AWS S3's console and managing files there, for example.
    • This actually doesn't involve much code on the plugin side. It'd be more about providing a blessed path for implementing webhooks in a simpler way by developers.
    • If you already have this demand, just take a look at your used plugin's schema and try to build a handler for new files in your vendor that creates documents in Sanity following that schema.
  • Previews for PDFs and other file types
  • New vendors

Contributing

I'm a newbie with collaborating on open-source, so no strict rules here other than being respectful and considerate.

Acknowledgments

Immense gratitude to Akash Reddy and the folks at Playy.co for sponsoring the initial work for this plugin and helping shape it. You gave me the first opportunity to do paid open-source work and this won't be forgotten 💚

Also shout-out to Daniel, José and the great folks at Bürocratik for sponsoring the Sanity V3 upgrade of this plugin.

sanity-plugin-external-files's People

Contributors

hdoro avatar nkgentile avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sanity-plugin-external-files's Issues

Revisit workspace setup

It definitely makes sense to use a monorepo approach here, but the implementation is slightly confusing for new contributors.

  • There is an unused package-lock.json file; consider deleting.
  • Decide which package manager to use–either will suit this setup.
  • Add top-level build script to help get new contributors up-and-running quicker
  • Flesh out the README.md with some tips to get started

Allow users to upload additional file types

Description

Ideally, this plugin could be extended to allow for uploads of any file type: images, PDF's, etc. Additionally, the plugin could expose a few configuration options that are currently private (defaultAccept, toolTitle). This request was raised in the Sanity Community Slack.

Cloudflare R2 Support

Would be great if it could support cloudflare R2. It seems to be much cheaper than S3 and no egress fee.

Firebase-Dam: Is there support for nested files?

By default firebase-dam moves files to the root path, maybe: /video.mp4.

Let's say I would like to upload to /dolphins/video.mp4 instead. Is there a way to do this?

Also, I understand that it's probably not needed since a reference is stored anyways, but I like to be organized and use Firebase Storage Rules.

I'm also eager to contribute if a change (like a new option) needs to be implemented for this.

Firebase DAM includes File URL with token?

I have Sanity on the client of an application, idk if that's suggested or bad.

However, the fileURL that is available as a property of Firebase-DAM has a token query parameter. I believe this query token parameter is used for firebase storage rules to authorize images. Therefore, when I allow read: if false in firebase storage, I still was able to view the image with the fileURL sent.

Could I have an option for excluding FileURL from the document, or could you guide me on where the "options" are so I could try to fix it (and submit a pull request if you would like).

Installation step missing

Hi there,

first of all congratulation for your plugin, it looks good for my use case of creating a DAM on top of S3.

I have a problem when installing the plugin I receive this error:
Module not found: Error: Can't resolve 'config:s3-dam'

Did you miss a step in documentation?

Mirko

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.