Skip to content

Commit

Permalink
[WIP] Replace broccoli-filter with broccoli-persistent-filter
Browse files Browse the repository at this point in the history
  • Loading branch information
elucid committed Apr 2, 2016
1 parent 3386577 commit 9bae601
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/asset-rev.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function AssetRev(inputTree, options) {
this.prepend = options.prepend || defaults.prepend;
this.ignore = options.ignore;
this.description = options.description;
this.persist = options.persist;

var fingerprintTree = Fingerprint(inputTree, this);

Expand Down
13 changes: 11 additions & 2 deletions lib/fingerprint.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var fs = require('fs');
var path = require('path');
var crypto = require('crypto');
var Filter = require('broccoli-filter');
var Filter = require('broccoli-persistent-filter');
var Promise = require('rsvp').Promise;
// JSON.stringify is not stable
var stringify = require('json-stable-stringify');
Expand All @@ -24,10 +24,15 @@ function Fingerprint(inputNode, options) {

options = options || {};

if (options.persist === undefined) {
options.persist = true;
}

Filter.call(this, inputNode, {
extensions: options.extensions || [],
// We should drop support for `description` in the next major release
annotation: options.description || options.annotation
annotation: options.description || options.annotation,
persist: options.persist
})

this.assetMap = options.assetMap || {};
Expand Down Expand Up @@ -70,6 +75,10 @@ Fingerprint.prototype.canProcessFile = function (relativePath) {
return Filter.prototype.getDestFilePath.apply(this, arguments) != null;
};

Fingerprint.prototype.baseDir = function () {
return path.resolve(__dirname, '..');
};

Fingerprint.prototype.processFile = function (srcDir, destDir, relativePath) {
var file = fs.readFileSync(srcDir + '/' + relativePath);
var self = this;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"homepage": "https://github.com/rickharrison/broccoli-asset-rev",
"dependencies": {
"broccoli-asset-rewrite": "^1.0.9",
"broccoli-filter": "^1.2.2",
"broccoli-persistent-filter": "^1.2.0",
"json-stable-stringify": "^1.0.0",
"matcher-collection": "^1.0.1",
"rsvp": "~3.0.6"
Expand Down

0 comments on commit 9bae601

Please sign in to comment.