- Updated internal conventions
- Updated dependencies
- Now supports TaskGroup v5 and TaskGroup v4
- Updated internal conventions
- Updated dependencies
chain.action(method, taskOptions)
can now receive an extension name as the method, allowing you to change the behaviour of an existing extension by configuring the options for its execution- Removed the internal
prependResultToArguments
task option, and added the publicargs
task option. UseChainy.injectChainDataAsArgument
andChainy.injectExpandedChainDataAsArguments
as special argument items that do what their names suggest. - Updated dependencies
- A few changes about how extension inheritance works to make it simpler and more robust
- Extensions are now explicitly added to each child class and child instance (instead of implicitly inherited from the prototype tree)
- Extensions are now only instantiated by default on child instances, instead of both child instances and child classes as before
- Extensions are no longer added to the prototype of a child class by default
- Where extensions are added can be changed by setting the
applyTo
extension option to include where you would like the extension to apply to, valid options are['instance', 'class', 'prototype']
, default option is['instance']
- Class and instance trees are now more robust (especially class trees)
mixin
method now supportsoptions
argument that accepts theapplyTo
property, defaults to['instance', 'class', 'prototype']
to maintain backwards compatible behaviour- Now throws an error when a class prototype method is being overwritten by an extension
- If you desire to overwrite a class prototype method, then use the
custom
extension type, and perform the overwrite manually by using themixin
method (see theautoinstall
plugin for an example of this)
- If you desire to overwrite a class prototype method, then use the
- Now works when
chainy-core
is npm linked- This is done by now using the parent module's lookup paths, instead of the chainy module's lookup paths
- Failed requires now provides more information about why the require could have failed
- Notes
- Use
var chain = Chainy.create()
instead ofvar chain = new Chainy()
- Use
Chainy.subclass(...)
instead ofclass MyChainy extends Chainy
- This is because the
create
andsubclass
methods perform some operations to maintain the tree (required for extension inheritance) that cannot be replicated via the native counterparts. If this is an issue for you, then let us know via the GitHub Issue tracker.
- Use
- Support use case where
aliases
option is a string instead of an array
- Fixed
method.extensionOptions
parsing (never actually worked)
- Added support for the extension option:
aliases
- Fixed undefined action results over-writing chain data, undefined action results are discarded
-
Added
klass
andparent
options toChainy.create(opts)
-
Useful for creating standalone action plugins that have sub chains:
this.create() // ... // becomes require('chainy-core').create({parent:this}) // ...
-
-
Added
Chainy.isChainyInstance(chain)
method
- Added tomdoc inline documentation, indicating what is internal and public methods, properties, and options
- Changed some of the internal functionality
- Plugins can now also do
module.exports.extension = {method, type, ...}
, which is useful for existing modules that want to become chainy extensions, or similar situations where the top level export is not a chainy plugin method - Plugins can now also do
module.exports.extensionOptions = {}
, which is useful when the top level export is a chainy plugin, but you also want to customise other options of it than just theextensionType
- Fixed mixin helper
- API is now mature for public use, enjoy!
- Utilities are now also added to directly to classes, instead of just their prototypes
- Support the first argument being a space separated string list of plugins
- Only allow lowercase letters in plugin names
- Initial working release