GithubHelp home page GithubHelp logo

alvarolorentedev / electron-plugin Goto Github PK

View Code? Open in Web Editor NEW
36.0 5.0 0.0 4.35 MB

an electron plugin extension package

License: MIT License

JavaScript 91.01% Shell 8.99%
nodejs electron plugin-manager plugin-architecture plugin-loader

electron-plugin's Introduction

logomakr_2nqeyp

Build Status codecov npm GitHub license Maintenance

Create extensible electron applications through a plugin architecture that uses NPM (or similar registry) or GitHub as repository for the extensions.

Installation

add it to your electron project using npm install electron-plugin --save or yarn add electron-plugin

Usage

require electron-plugin exports a function that requires a javascript object and an electron window, as seen on the next example:

const pluginManager = require(`electron-plugin`)
let config = { 
        installPath: `${__dirname}/test_folder`,
        plugins : {
            "electron-plugin-example": "0.0.2"
        }
     },
    extensionPoint = {
        app: 'anything you want to use as exstention point'
    }

pluginManager.load(config, extensionPoint)
Created my free logo at LogoMakr.com

electron-plugin's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar

electron-plugin's Issues

Error trying to add plugin from github

So, I tried to add a plugin from github, but it return me an error, plugin
maybe some more options an liberty from where the packages come, because, they don't need to be all from https://www.npmjs.com/

The build is a clean one from quick-start, using electron "^6.0.12" and Windows 10.

I tried several combos from (here )[https://docs.npmjs.com/cli/install] but some did get to an error, others blocked in some security walls for public access

code in src and test folders

Hi Alvaro,

in lifecycle.js you use module.paths and plugin.onLoad, but these attributes were added only during test/unit.

So your amazing plugin can only be used with your own tests. That's not neat a little.

Can we have a demo?

This would be easier to have an idea of how to implement if we had a demo.

Usage

Hi.
I'm not sure, this solution can be used to build a real plugin base system.
If a plugin doesn't have dependencies or have dependencies, which doesn't require any extra installation actions it will work. But, if the plugin has "complicated" dependency, which requires some extra installation actions, it will not.

You can try to create a plugin, which has as a dependency for example "node-pty". The thing is - node-pty does some extra installation actions. And npm can do it within some environment.

If you run electron application via terminal (something like "electron myapp.js" it could work, because in this case electron will use your environment.

But, if you will build an electron application and run it as a desktop application, the installation will be failed. Because your application will not use your environment anymore. For example, the variable PATH will not have your regular PATHs. As a result, during installation of node-pty will be an error, because npm/node cannot find python, which is needed to install node-pty.

So, to resolve this problem you should add PATH before call npm installation. But does it make sense? What if user of your application doesn't have on a board python? But to use and install plugin he has to install python?

Also not clear how you resolve an issue with necessary to rebuild some modules (https://electronjs.org/docs/tutorial/using-native-node-modules). Not sure, will be enough just install it plugin.

Also, this is not good idea to use programmatically npm. It doesn't looks like developers care about this way of usage. There are tons of documentation about CLI, but nothing about API.

So, definitely would be nice if you will provide more information about the usage of your solution.

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.