- The question of what "belongs" in a framework is complex, and depends on your use case. A better question is "what are the defaults?" By pulling all of the current features of Sails into plugins, and then including them by default, we provide full customizability (the possibility of disabling just about everything) without sacrificing all the conveniences Sails developers are used to.
- Plugins make it easier to contribute, and make modifying the core a much less scary proposition.
- Node.js is quite minimalist, and super awesome. Let's take a leaf out of Ryan/Isaac's book!
- Community plugins are fantastic, but to ensure quality, plugins will only be listed on the Sails website/repo when they've met some basic quality assurance testing.
When an app starts up, after the core components load, the initialize
method is triggered for each of the configured plugins. Plugins can tap into events emitted from Sails, and hook into other parts of the app bootstrap process that way.
Plugins also have access to the Sails CLI, if developers choose to configure their installation to use them. The cli:new
, cli:generate
, and cli:build
events are automatic, plus you can add your own command-line hooks.
If a plugin provides configuration options, it should hook into the Sails CLI to generate them for new projects on sails new
. It should also declare the options in its plugin.json
file.
If a plugin adds routes, it should declare them explicitly in its plugin.json
file.
If a plugin adds middleware, it should declare them explicitly in its plugin.json
file.
If a plugin expects a special directory/files to exist at the app level, it should register that with the Sails module loader so the path is fully configurable for end users. The plugin should also create the directory on sails new
.
More to come!
There is some work in that part of sails.js plugins?
I like this feature and if there is any documentation on how to contribute to implement this feature I'd like to help.