Git Product home page Git Product logo

mailsprg-differ's Introduction

Mailspring Plugin Starter

This folder contains a sample plugin for Mailspring that adds components to the composer's "action bar" and the right sidebar shown in the message viewer.

Building a Plugin

Copy or symlink this project into ~/Library/Application Support/Mailspring/packages on MacOS, or the corresponding location on Windows and Linux. (You can find this directory by going to Developer > Show Mailsync Logs in Mailspring).

You can rename this directory and change the name field of package.json to rename your plugin. Keep in mind that plugins are like node modules and the names cannot contain spaces!

To get started, run npm install in your plugin's directory and then npm run-script build to compile the src folder into the lib folder. To see your changes in Mailspring, quit and relaunch the app OR open the developer tools and reload the app's main window.

For documentation of how to build plugins, check out https://foundry376.github.io/Mailspring/ for (slightly outdated) information and also have a look at the many plugins that ship within the core app: https://github.com/Foundry376/Mailspring/tree/master/app/internal_packages. Some of the bundled plugins, like composer-translate, composer-templates, and phishing-detection are great starting points!

Shipping a Plugin

Mailspring does not transpile the source code in your plugin when it runs - it expects that your JSX files, TypeScript, etc. has already been converted to plain ES2017 JavaScript. To give your plugin to other people, you should commit the lib directory so that they can download the repository, put it in place via the "Install a Plugin..." menu item in Mailspring, and be done.

Future

In the next year or so, we'll be launching a first-class "plugin gallery" in Mailspring and formalizing the development and release processes. Right now, building a plugin using TypeScript is a real pain because Mailspring - while written in TypeScript - doesn't export the types for you to build against. Stay tuned!

A note about Node Modules

Right now, if your plugin depends on external node modules (say, a CSV parser like node-csv), you'd need to package up a zip file that contained those modules already installed in node_modules, or have your users run npm install. In the future, Mailspring will run npm install for you.

However, we do not plan to support Mailspring plugins that require native node modules - the kind that compile C++ or C code into platform-specific binaries. It's really hard to ship all of the tooling required to build these reliably, pre-packing them for each platform is annoying, and they often break when the node / nan versions change. Be warned! (An example of this would be sqlite or something like node-addressbook. You can often tell if a module contains native code if there is a binding.gyp file or if the install process takes a while and calls out to make or gcc.)

mailsprg-differ's People

Watchers

Rob Blafford avatar

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.