broccoli-caching-writer
Advanced tools
Comparing version 2.3.0 to 2.3.1
## master | ||
## 2.3.1 | ||
* [REVERT] listFiles and listEntries output is now lexicographically sorted (by related path) | ||
ember-cli uses concat inputFiles instead of headerFiles for files which much be ordered | ||
## 2.3.0 | ||
@@ -4,0 +9,0 @@ |
15
index.js
@@ -218,16 +218,3 @@ 'use strict'; | ||
} | ||
return listEntries(this._lastKeys, []).sort(function (a, b) { | ||
var pathA = a.relativePath; | ||
var pathB = b.relativePath; | ||
if (pathA === pathB) { | ||
return 0; | ||
} else if (pathA < pathB) { | ||
return -1; | ||
} else { | ||
return 1; | ||
} | ||
} | ||
); | ||
return listEntries(this._lastKeys, []); | ||
}; | ||
@@ -234,0 +221,0 @@ |
{ | ||
"name": "broccoli-caching-writer", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "Broccoli plugin that allows simple caching (while still allowing N:N) based on the input tree hash.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -59,6 +59,6 @@ # Broccoli Caching Writer | ||
## `plugin.listFiles` | ||
list files matched, helpful as it allows us avoid a second glob, lexicographically sorted by relativePath. | ||
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, lexicographically sorted by relativePath. | ||
list entries (stat objects) of files matched, helpful when further FS information is required on rebuild. | ||
@@ -65,0 +65,0 @@ ## ZOMG!!! TESTS?!?!!? |
@@ -285,16 +285,11 @@ 'use strict'; | ||
describe('listFiles', function() { | ||
function getListFilesFor(options, sourcePaths) { | ||
var listFiles; | ||
var listFiles; | ||
if (arguments.length < 2) { | ||
sourcePaths = [sourcePath]; | ||
} | ||
setupCachingWriter(sourcePaths, options, function() { | ||
function getListFilesFor(options) { | ||
setupCachingWriter([sourcePath], options, function() { | ||
var writer = this; | ||
listFiles = this.listFiles().map(function(fullPath) { | ||
return path.basename(fullPath); | ||
listFiles = this.listFiles().map(function(p) { | ||
return path.relative(writer.inputPaths[0], p); | ||
}); | ||
}); | ||
return expectRebuild().then(function() { | ||
@@ -327,28 +322,12 @@ return listFiles; | ||
}); | ||
it('returns a sorted array', function() { | ||
return expect(getListFilesFor( | ||
{}, [sourcePath, secondaryPath] | ||
)).to.eventually.deep.equal([ | ||
'bar.js', | ||
'core.js', | ||
'foo-baz.js', | ||
'foo.js', | ||
'main.js', | ||
]); | ||
}); | ||
}); | ||
describe('listEntries', function() { | ||
function getListEntriesFor(options, sourcePaths) { | ||
var listEntries; | ||
var listEntries; | ||
if (arguments.length < 2) { | ||
sourcePaths = [sourcePath]; | ||
} | ||
setupCachingWriter(sourcePaths, options, function() { | ||
function getListEntriesFor(options) { | ||
setupCachingWriter([sourcePath], options, function() { | ||
var writer = this; | ||
listEntries = this.listEntries().map(function(entry) { | ||
return path.basename(entry.fullPath); | ||
listEntries = this.listEntries().map(function(p) { | ||
return path.relative(writer.inputPaths[0], p.fullPath); | ||
}); | ||
@@ -384,15 +363,2 @@ }); | ||
}); | ||
it('returns a sorted array', function() { | ||
return expect(getListEntriesFor( | ||
{}, [sourcePath, secondaryPath] | ||
)).to.eventually.deep.equal([ | ||
'bar.js', | ||
'core.js', | ||
'foo-baz.js', | ||
'foo.js', | ||
'main.js', | ||
]); | ||
}); | ||
}); | ||
@@ -399,0 +365,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
34276
655