broccoli-caching-writer
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -9,3 +9,3 @@ 'use strict'; | ||
var symlinkOrCopy = require('symlink-or-copy'); | ||
var assign = require('lodash-node/modern/object/assign'); | ||
var assign = require('lodash.assign'); | ||
var Plugin = require('broccoli-plugin'); | ||
@@ -12,0 +12,0 @@ var debugGenerator = require('debug'); |
{ | ||
"name": "broccoli-caching-writer", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Broccoli plugin that allows simple caching (while still allowing N:N) based on the input tree hash.", | ||
@@ -24,3 +24,3 @@ "main": "index.js", | ||
"debug": "^2.1.1", | ||
"lodash-node": "^3.2.0", | ||
"lodash.assign": "^3.2.0", | ||
"rimraf": "^2.2.8", | ||
@@ -27,0 +27,0 @@ "rsvp": "^3.0.17", |
@@ -7,3 +7,3 @@ # Broccoli Caching Writer | ||
Drop-in-replacement for | ||
[broccoli-plugin](https://github.com/broccolijs/broccoli-plugin) adding a thin | ||
[broccoli-writer](https://github.com/broccolijs/broccoli-writer) adding a thin | ||
caching layer based on the computed hash of the input directory trees. If any | ||
@@ -16,6 +16,5 @@ file in an input node has changed, the `build` method will be called, | ||
Say your plugin derives from `Plugin` like so: | ||
```js | ||
var Plugin = require('broccoli-plugin'); | ||
var Plugin = require('broccoli-caching-writer'); | ||
@@ -26,2 +25,3 @@ MyPlugin.prototype = Object.create(Plugin.prototype); | ||
options = options || {}; | ||
// options.inputFiles === array of globs, to consider for the cache key | ||
Plugin.call(this, inputNodes, { | ||
@@ -31,20 +31,12 @@ annotation: options.annotation | ||
} | ||
``` | ||
To add caching, simply replace `Plugin` with `CachingWriter`, like so: | ||
```js | ||
var CachingWriter = require('broccoli-caching-writer'); | ||
MyPlugin.prototype = Object.create(CachingWriter.prototype); | ||
MyPlugin.prototype.constructor = MyPlugin; | ||
function MyPlugin(inputNodes, options) { | ||
options = options || {}; | ||
CachingWriter.call(this, inputNodes, { | ||
annotation: options.annotation | ||
}); | ||
} | ||
MyPlugin.prototype.build = function() { | ||
// cache has been busted | ||
// do anything, for example: | ||
// 1. read from this.inputPaths | ||
// 2. do something based on the result | ||
// 3. and then, write to this.outputPath | ||
}; | ||
``` | ||
## Documentation | ||
@@ -70,3 +62,8 @@ | ||
## `plugin.listFiles` | ||
list files matched, helpful as it allows us avoid a second glob | ||
## `plugin.listEntries` | ||
list entries (stat objects) of files matched, helpful when further FS information is required on rebuild. | ||
## ZOMG!!! TESTS?!?!!? | ||
@@ -73,0 +70,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34330
81
+ Addedlodash.assign@^3.2.0
+ Addedlodash._baseassign@3.2.0(transitive)
+ Addedlodash._basecopy@3.0.1(transitive)
+ Addedlodash._bindcallback@3.0.1(transitive)
+ Addedlodash._createassigner@3.1.1(transitive)
+ Addedlodash._getnative@3.9.1(transitive)
+ Addedlodash._isiterateecall@3.0.9(transitive)
+ Addedlodash.assign@3.2.0(transitive)
+ Addedlodash.isarguments@3.1.0(transitive)
+ Addedlodash.isarray@3.0.4(transitive)
+ Addedlodash.keys@3.1.2(transitive)
+ Addedlodash.restparam@3.6.1(transitive)
- Removedlodash-node@^3.2.0
- Removedlodash-node@3.10.2(transitive)