| language: node_js | ||
| node_js: | ||
| - "0.8" | ||
| - "0.10" | ||
| before_install: | ||
| - npm install -g npm@~1.4.6 |
| var sort = require('../'); | ||
| var test = require('tape'); | ||
| var through = require('through2'); | ||
| test('indexed', function (t) { | ||
| t.plan(1); | ||
| var s = sort({ index: true }); | ||
| var rows = []; | ||
| function write (row, enc, next) { rows.push(row); next() } | ||
| function end () { | ||
| t.deepEqual(rows, [ | ||
| { | ||
| id: '/bar.js', | ||
| deps: {}, | ||
| index: 1, | ||
| indexDeps: {} | ||
| }, | ||
| { | ||
| id: '/foo.js', | ||
| deps: { './bar': '/bar.js' }, | ||
| index: 2, | ||
| indexDeps: { './bar': 1 } | ||
| }, | ||
| { | ||
| id: '/main.js', | ||
| deps: { './foo': '/foo.js' }, | ||
| index: 3, | ||
| indexDeps: { './foo': 2 } | ||
| }, | ||
| ]); | ||
| } | ||
| s.pipe(through.obj(write, end)); | ||
| s.write({ id: '/main.js', deps: { './foo': '/foo.js' } }); | ||
| s.write({ id: '/foo.js', deps: { './bar': '/bar.js' } }); | ||
| s.write({ id: '/bar.js', deps: {} }); | ||
| s.end(); | ||
| }); |
+23
| var sort = require('../'); | ||
| var test = require('tape'); | ||
| var through = require('through2'); | ||
| test('sort', function (t) { | ||
| t.plan(1); | ||
| var s = sort(); | ||
| var rows = []; | ||
| function write (row, enc, next) { rows.push(row); next() } | ||
| function end () { | ||
| t.deepEqual(rows, [ | ||
| { id: '/bar.js', deps: {} }, | ||
| { id: '/foo.js', deps: { './bar': '/bar.js' } }, | ||
| { id: '/main.js', deps: { './foo': '/foo.js' } } | ||
| ]); | ||
| } | ||
| s.pipe(through.obj(write, end)); | ||
| s.write({ id: '/main.js', deps: { './foo': '/foo.js' } }); | ||
| s.write({ id: '/foo.js', deps: { './bar': '/bar.js' } }); | ||
| s.write({ id: '/bar.js', deps: {} }); | ||
| s.end(); | ||
| }); |
+6
-6
@@ -1,2 +0,2 @@ | ||
| var through = require('through'); | ||
| var through = require('through2'); | ||
@@ -7,5 +7,5 @@ module.exports = function (opts) { | ||
| var rows = []; | ||
| return through(write, end); | ||
| return through.obj(write, end); | ||
| function write (row) { rows.push(row) } | ||
| function write (row, enc, next) { rows.push(row); next() } | ||
@@ -27,3 +27,3 @@ function end () { | ||
| }); | ||
| tr.queue(row); | ||
| tr.push(row); | ||
| }); | ||
@@ -33,6 +33,6 @@ } | ||
| rows.forEach(function (row) { | ||
| tr.queue(row); | ||
| tr.push(row); | ||
| }); | ||
| } | ||
| tr.queue(null); | ||
| tr.push(null); | ||
| } | ||
@@ -39,0 +39,0 @@ |
+39
-39
| { | ||
| "name": "deps-sort", | ||
| "version": "0.1.2", | ||
| "description": "sort module-deps output for deterministic browserify bundles", | ||
| "main": "index.js", | ||
| "bin": { | ||
| "deps-sort": "bin/cmd.js" | ||
| }, | ||
| "dependencies": { | ||
| "through": "~2.3.4", | ||
| "JSONStream": "~0.6.4", | ||
| "minimist": "~0.0.1" | ||
| }, | ||
| "devDependencies": { | ||
| "tap": "~0.4.0" | ||
| }, | ||
| "scripts": { | ||
| "test": "tap test/*.js" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git://github.com/substack/deps-sort.git" | ||
| }, | ||
| "homepage": "https://github.com/substack/deps-sort", | ||
| "keywords": [ | ||
| "dependency", | ||
| "graph", | ||
| "browser", | ||
| "browserify", | ||
| "module-deps", | ||
| "browser-pack", | ||
| "sorted", | ||
| "determinism" | ||
| ], | ||
| "author": { | ||
| "name": "James Halliday", | ||
| "email": "mail@substack.net", | ||
| "url": "http://substack.net" | ||
| }, | ||
| "license": "MIT" | ||
| "name": "deps-sort", | ||
| "version": "1.0.0", | ||
| "description": "sort module-deps output for deterministic browserify bundles", | ||
| "main": "index.js", | ||
| "bin": { | ||
| "deps-sort": "bin/cmd.js" | ||
| }, | ||
| "dependencies": { | ||
| "JSONStream": "~0.8.4", | ||
| "minimist": "~0.2.0", | ||
| "through2": "~0.5.1" | ||
| }, | ||
| "devDependencies": { | ||
| "tape": "^2.13.4" | ||
| }, | ||
| "scripts": { | ||
| "test": "tape test/*.js" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git://github.com/substack/deps-sort.git" | ||
| }, | ||
| "homepage": "https://github.com/substack/deps-sort", | ||
| "keywords": [ | ||
| "dependency", | ||
| "graph", | ||
| "browser", | ||
| "browserify", | ||
| "module-deps", | ||
| "browser-pack", | ||
| "sorted", | ||
| "determinism" | ||
| ], | ||
| "author": { | ||
| "name": "James Halliday", | ||
| "email": "mail@substack.net", | ||
| "url": "http://substack.net" | ||
| }, | ||
| "license": "MIT" | ||
| } |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
7049
35.53%9
50%103
123.91%0
-100%75
2.74%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
Updated
Updated