Giter Club home page Giter Club logo

Comments (5)

davideicardi avatar davideicardi commented on June 5, 2024 3

But I can think for a similar feature for a next release...as usual any help/PR is appreciated!

from live-plugin-manager.

davideicardi avatar davideicardi commented on June 5, 2024

This is the expected behavior.
The idea is that the local plugin folder is just a cache. So if you install again a dependency no new files is downloaded, but I suggest to store the list of plugins somewhere else (like in a database).
This is also required when you have your app scaled to multiple instances: some instances can be new, with the directory empty.

You can always reinstall that files from filesystem if you want to just reuse that.

What do you think?

from live-plugin-manager.

neaplus avatar neaplus commented on June 5, 2024

Thanks for quick reply. i know that expected behavior but optionaly supporting a method for scan cache folder would be nice.

So in my case stateless worker client app, managed remotely. i install and update packages when required except this, i want to keep working app even it crashes and restarts automaticaly without any state restore or check dependencies.

bellow code works for me now i've written temporary. something like lpm.scan() method in the library with better implementation can be helpfull.

const fs = require("fs"), lpm = new(require('live-plugin-manager')).PluginManager(),
setTimeout(async () => {
    const packages = fs.readdirSync(lpm.options.pluginsPath, {
            withFileTypes: true
        })
        .filter(dirent => dirent.isDirectory())
        .map(dirent => dirent.name)
    packages.forEach(async (package) => lpm.installedPlugins.push(await lpm.createPluginInfo(package)));
    setTimeout(() => console.log('PACKAGES', packages, lpm.list()), 1000);
}, 0);

make sense?

from live-plugin-manager.

davideicardi avatar davideicardi commented on June 5, 2024

I suggest to store the list of the installed plugins in a custom storage. It can be a simple text file. And at startup just read this file and install all.
Otherwise you can have some side effects. For example if you want to install plugin A, but it depends on B, you will end up with 2 plugins, while logically the plugins is only 1.

The code seems to be correct, but not officially supported ;-).

from live-plugin-manager.

davideicardi avatar davideicardi commented on June 5, 2024

Closing this issue for now. We can then open a new one more specific, I think something like: "Allow to re install plugins from file system cache"

from live-plugin-manager.

Related Issues (20)

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.