I'm building an open source assistant. Mostly for fun and to learn Node JS.Currently my directory structure is like...app/app/Skill/reminderapp/Skill/helloworldapp/Skill/currencysrc/src/Core/src/Training/src/Request/and so forth...All the core code is in src and the project can be fetched via npm. But when you fetch the project you also get all the app skills, reminder, helloworld, currency, etc..I want the app directory to be empty (and using .gitignore) and then the user must add in the skills. These skills can be multiple nodejs files, and they can have dependencies, e.g. currency skill requires a node module that does API calls.I started to build something using `commander` and a package manager within src/ which will fetch a list of available packages which is in a json file on another repo, basically "cheap" / hacked signed packages. The user can type in something like `$ node bot install skill currency` and this will fetch the git repo name and clone it into the app/ directory. It's really prototype but the code can be found here - it was hacked together in a day and I don't mind scrapping it for a better solution.It's working great, I can also put in remove, update and package sets to install demo setups.But now I feel like I'm hitting a problem, how to handle node module dependencies in these packages. I haven't even added a package.json file into these skills yet. Example of a skill git repo.So far I have about 12 skills and the list will get longer.Am I reinventing the wheel? Should I just use NPM for all these skill packages? I want these packages to go into certain directories under the app directory and not lost within the other hundreds of node modules in node_modules/.Advice, articles or a guide in the right direction will be great.BTW the master branch of this code is currently broken! I'm making this last change as a final architecture update and then making the code stable. You can see a demo of it working on the docs (some parts are still broken, this project is tough!).
Submitted November 11, 2018 at 05:48AM by DarrenMoore
No comments:
Post a Comment