Closed balupton closed 10 years ago
/cc @JedWatson, and thoughts on the namespacing?
Example of what installing deps would look like with both options:
npm install --save chainy chainy-set chainy-map chainy-feed chainy-geocode
npm install --save chainy chainy-plugin-set chainy-plugin-map chainy-plugin-feed chainy-plugin-geocode
require('chainy').subclass().require('set', 'map', 'feed', 'geocode')
Installing deps could be simplified by a CLI:
npm install -g chainy
chainy install set map feed geocode
Bundles could help:
npm install chainy chainy-common
npm install chainy chainy-plugin-common
require('chainy').subclass().require('common')
Enabling direct inclusion in the bundle by doing:
// support direct inclusion
module.exports = require('chainy').subclass().require('common').freeze()
// support normal custom plugin type include
module.exports.setupPlugin = function(chain){
chain.require('set', 'map', 'feed', 'geocode')
}
Could also help:
npm install chainy-common
npm install chainy-plugin-common
require('chainy-common').subclass()
require('chainy-plugin-common').subclass()
Automatic installation and inclusion is also an option, however that requires harmony features: https://github.com/chainyjs/chainy/issues/5
Regarding whether it is for all plugins or just some, I'm in favour of all plugins. It allows:
Solved. See the wiki for the latest details. To answer the questions:
chainy-plugin-blah
, and chainy-bundle-blah
, the chainy cli will reduce friction here allowing chainy install blah
peerDependencies
field and no scripts, you are to require them manually or use the autoload extension
Questions:
chainy-pluginname
, orchainy-plugin-pluginname