Comparing version 2.0.0-beta.1 to 2.0.0-beta.2
@@ -12,3 +12,3 @@ module.exports = { | ||
rules: { | ||
'strict': 'error', | ||
strict: 'error', | ||
'no-var': 'error', | ||
@@ -18,10 +18,3 @@ 'no-console': 'off', | ||
'object-shorthand': 'error', | ||
'prettier/prettier': [ | ||
'error', | ||
{ | ||
singleQuote: true, | ||
trailingComma: 'es5', | ||
printWidth: 100, | ||
}, | ||
], | ||
'prettier/prettier': ['error', require('./prettier.config')], | ||
}, | ||
@@ -28,0 +21,0 @@ overrides: [ |
# master | ||
# 2.0.0-beta.2 | ||
* Update internal dependencies to latest versions. | ||
* Remove usages of `RSVP` (in favor of using native promises). | ||
# 2.0.0-beta.1 | ||
@@ -4,0 +9,0 @@ |
'use strict'; | ||
const promiseFinally = require('promise.prototype.finally'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const RSVP = require('rsvp'); | ||
const EventEmitter = require('events').EventEmitter; | ||
const tmp = require('tmp'); | ||
@@ -45,4 +46,5 @@ const heimdall = require('heimdalljs'); | ||
module.exports = class Builder { | ||
module.exports = class Builder extends EventEmitter { | ||
constructor(outputNode, options) { | ||
super(); | ||
if (options == null) options = {}; | ||
@@ -90,8 +92,6 @@ | ||
if (this._cancelationRequest) { | ||
return RSVP.Promise.reject( | ||
new BuilderError('Cannot start a build if one is already running') | ||
); | ||
return Promise.reject(new BuilderError('Cannot start a build if one is already running')); | ||
} | ||
let promise = RSVP.Promise.resolve(); | ||
let promise = Promise.resolve(); | ||
@@ -109,12 +109,14 @@ this.buildId++; | ||
// from this node, but not from previous nodes. | ||
return RSVP.resolve() | ||
.then(() => this._cancelationRequest.throwIfRequested()) | ||
.then(() => this.trigger('beginNode', nw)) | ||
.then(() => nw.build()) | ||
.finally(() => { | ||
return promiseFinally( | ||
Promise.resolve() | ||
.then(() => this._cancelationRequest.throwIfRequested()) | ||
.then(() => this.emit('beginNode', nw)) | ||
.then(() => nw.build()), | ||
() => { | ||
if (this._cancelationRequest.isCancelled) { | ||
return; | ||
} | ||
this.trigger('endNode', nw); | ||
}) | ||
this.emit('endNode', nw); | ||
} | ||
) | ||
.then(() => this._cancelationRequest.throwIfRequested()) | ||
@@ -129,13 +131,15 @@ .catch(err => { | ||
return promise | ||
.then(() => { | ||
return this.outputNodeWrapper; | ||
}) | ||
.then(outputNodeWrapper => { | ||
this.buildHeimdallTree(outputNodeWrapper); | ||
return outputNodeWrapper; | ||
}) | ||
.finally(() => { | ||
return promiseFinally( | ||
promise | ||
.then(() => { | ||
return this.outputNodeWrapper; | ||
}) | ||
.then(outputNodeWrapper => { | ||
this.buildHeimdallTree(outputNodeWrapper); | ||
return outputNodeWrapper; | ||
}), | ||
() => { | ||
this._cancelationRequest = null; | ||
}); | ||
} | ||
); | ||
} | ||
@@ -146,3 +150,3 @@ | ||
// No current build, so no cancellation | ||
return RSVP.Promise.resolve(); | ||
return Promise.resolve(); | ||
} | ||
@@ -440,4 +444,2 @@ | ||
RSVP.EventTarget.mixin(module.exports.prototype); | ||
module.exports.BuilderError = BuilderError; | ||
@@ -444,0 +446,0 @@ module.exports.InvalidNodeError = broccoliNodeInfo.InvalidNodeError; |
'use strict'; | ||
const RSVP = require('rsvp'); | ||
const promiseFinally = require('promise.prototype.finally'); | ||
const TreeSync = require('tree-sync'); | ||
@@ -60,3 +60,3 @@ const childProcess = require('child_process'); | ||
const server = broccoli.server.serve(watcher, options.host, parseInt(options.port, 10)); | ||
actionPromise = (server && server.closingPromise) || RSVP.resolve(); | ||
actionPromise = (server && server.closingPromise) || Promise.resolve(); | ||
}); | ||
@@ -121,14 +121,13 @@ | ||
actionPromise = watcher | ||
.start() | ||
.catch(err => console.log((err && err.stack) || err)) | ||
.finally(() => { | ||
actionPromise = promiseFinally( | ||
watcher.start().catch(err => console.log((err && err.stack) || err)), | ||
() => { | ||
builder.cleanup(); | ||
process.exit(0); | ||
}) | ||
.catch(err => { | ||
console.log('Cleanup error:'); | ||
console.log((err && err.stack) || err); | ||
process.exit(1); | ||
}); | ||
} | ||
).catch(err => { | ||
console.log('Cleanup error:'); | ||
console.log((err && err.stack) || err); | ||
process.exit(1); | ||
}); | ||
}); | ||
@@ -143,3 +142,3 @@ | ||
return actionPromise || RSVP.resolve(); | ||
return actionPromise || Promise.resolve(); | ||
}; | ||
@@ -146,0 +145,0 @@ |
'use strict'; | ||
const EventEmitter = require('events').EventEmitter; | ||
const RSVP = require('rsvp'); | ||
class Watcher { | ||
class Watcher extends EventEmitter { | ||
constructor(builder) { | ||
super(); | ||
this.builder = builder; | ||
@@ -13,7 +13,12 @@ this.currentBuild = null; | ||
start() { | ||
this._lifetimeDeferred = RSVP.defer(); | ||
let lifetime = (this._lifetimeDeferred = {}); | ||
lifetime.promise = new Promise((resolve, reject) => { | ||
lifetime.resolve = resolve; | ||
lifetime.reject = reject; | ||
}); | ||
this.currentBuild = this.builder.build(); | ||
this.currentBuild | ||
.then(() => this.trigger('buildSuccess')) | ||
.catch(err => this.trigger('buildFailure', err)); | ||
.then(() => this.emit('buildSuccess')) | ||
.catch(err => this.emit('buildFailure', err)); | ||
return this._lifetimeDeferred.promise; | ||
@@ -27,4 +32,2 @@ } | ||
RSVP.EventTarget.mixin(Watcher.prototype); | ||
module.exports = Watcher; |
@@ -7,3 +7,3 @@ 'use strict'; | ||
onBuildSuccess(builder) { | ||
printSlowNodes(builder.outputNodeWrapper); | ||
printSlowNodes(builder.outputNodeWrapper.__heimdall__); | ||
console.log( | ||
@@ -10,0 +10,0 @@ 'Built - ' + |
'use strict'; | ||
const promiseFinally = require('promise.prototype.finally'); | ||
const http = require('http'); | ||
@@ -41,15 +42,14 @@ | ||
server.closingPromise = server.watcher | ||
.start() | ||
.catch(err => console.log((err && err.stack) || err)) | ||
.finally(() => { | ||
server.closingPromise = promiseFinally( | ||
server.watcher.start().catch(err => console.log((err && err.stack) || err)), | ||
() => { | ||
server.builder.cleanup(); | ||
server.http.close(); | ||
process.exit(0); | ||
}) | ||
.catch(err => { | ||
console.log('Cleanup error:'); | ||
console.log((err && err.stack) || err); | ||
process.exit(1); | ||
}); | ||
} | ||
).catch(err => { | ||
console.log('Cleanup error:'); | ||
console.log((err && err.stack) || err); | ||
process.exit(1); | ||
}); | ||
@@ -56,0 +56,0 @@ server.http.listen(parseInt(port, 10), host); |
'use strict'; | ||
const EventEmitter = require('events').EventEmitter; | ||
const sane = require('sane'); | ||
const RSVP = require('rsvp'); | ||
const logger = require('heimdalljs-logger')('broccoli:watcherAdapter'); | ||
@@ -14,8 +14,9 @@ | ||
logger.debug(event, root + '/' + filepath); | ||
adapter.trigger('change'); | ||
adapter.emit('change'); | ||
}); | ||
} | ||
class WatcherAdapter { | ||
class WatcherAdapter extends EventEmitter { | ||
constructor(options) { | ||
super(); | ||
this.options = options || {}; | ||
@@ -42,3 +43,3 @@ this.options.filter = this.options.filter || defaultFilterFunction; | ||
logger.debug('error', err); | ||
this.trigger('error', err); | ||
this.emit('error', err); | ||
}); | ||
@@ -71,3 +72,2 @@ | ||
module.exports = WatcherAdapter; | ||
RSVP.EventTarget.mixin(WatcherAdapter.prototype); | ||
module.exports.bindFileEvent = bindFileEvent; |
'use strict'; | ||
const RSVP = require('rsvp'); | ||
const promiseFinally = require('promise.prototype.finally'); | ||
const EventEmitter = require('events').EventEmitter; | ||
const WatcherAdapter = require('./watcher_adapter'); | ||
@@ -11,4 +12,5 @@ const logger = require('heimdalljs-logger')('broccoli:watcher'); | ||
class Watcher { | ||
class Watcher extends EventEmitter { | ||
constructor(builder, options) { | ||
super(); | ||
this.options = options || {}; | ||
@@ -28,7 +30,11 @@ if (this.options.debounce == null) this.options.debounce = 100; | ||
throw new Error('Watcher.prototype.start() must not be called more than once'); | ||
this._lifetimeDeferred = RSVP.defer(); | ||
let lifetime = (this._lifetimeDeferred = {}); | ||
lifetime.promise = new Promise((resolve, reject) => { | ||
lifetime.resolve = resolve; | ||
lifetime.reject = reject; | ||
}); | ||
this.watcherAdapter.on('change', this._change.bind(this)); | ||
this.watcherAdapter.on('error', this._error.bind(this)); | ||
RSVP.resolve() | ||
Promise.resolve() | ||
.then(() => { | ||
@@ -59,9 +65,9 @@ return this.watcherAdapter.watch(this.builder.watchedPaths); | ||
// Wait for current build, and ignore build failure | ||
RSVP.resolve(this.currentBuild) | ||
Promise.resolve(this.currentBuild) | ||
.catch(() => {}) | ||
.then(() => { | ||
if (this._quitting) return; | ||
const buildPromise = new RSVP.Promise(resolve => { | ||
const buildPromise = new Promise(resolve => { | ||
logger.debug('debounce'); | ||
this.trigger('debounce'); | ||
this.emit('debounce'); | ||
setTimeout(resolve, this.options.debounce); | ||
@@ -80,3 +86,3 @@ }).then(() => { | ||
logger.debug('buildStart'); | ||
this.trigger('buildStart'); | ||
this.emit('buildStart'); | ||
const buildPromise = this.builder.build(); | ||
@@ -89,7 +95,7 @@ // Trigger change/error events. Importantly, if somebody else chains to | ||
logger.debug('buildSuccess'); | ||
this.trigger('buildSuccess'); | ||
this.emit('buildSuccess'); | ||
}, | ||
err => { | ||
logger.debug('buildFailure'); | ||
this.trigger('buildFailure', err); | ||
this.emit('buildFailure', err); | ||
} | ||
@@ -123,12 +129,12 @@ ); | ||
return RSVP.resolve() | ||
.then(() => this.watcherAdapter.quit()) | ||
.finally(() => { | ||
return promiseFinally( | ||
promiseFinally(Promise.resolve().then(() => this.watcherAdapter.quit()), () => { | ||
// Wait for current build, and ignore build failure | ||
return RSVP.resolve(this.currentBuild).catch(() => {}); | ||
}) | ||
.finally(() => logger.debug('quitEnd')); | ||
return Promise.resolve(this.currentBuild).catch(() => {}); | ||
}), | ||
() => logger.debug('quitEnd') | ||
); | ||
} | ||
} | ||
RSVP.EventTarget.mixin(Watcher.prototype); | ||
module.exports = Watcher; |
@@ -5,3 +5,2 @@ 'use strict'; | ||
const fs = require('fs'); | ||
const RSVP = require('rsvp'); | ||
const undefinedToNull = require('../utils/undefined-to-null'); | ||
@@ -23,3 +22,3 @@ const rimraf = require('rimraf'); | ||
return new RSVP.Promise(resolve => { | ||
return new Promise(resolve => { | ||
startTime = process.hrtime(); | ||
@@ -26,0 +25,0 @@ |
{ | ||
"name": "broccoli", | ||
"version": "2.0.0-beta.2", | ||
"description": "Fast client-side asset builder", | ||
"version": "2.0.0-beta.1", | ||
"author": "Jo Liss <joliss42@gmail.com>", | ||
"main": "lib/index.js", | ||
"license": "MIT", | ||
"keywords": [ | ||
"asset", | ||
"browser", | ||
"build", | ||
"builder", | ||
"build", | ||
"frontend", | ||
"browser", | ||
"asset", | ||
"pipeline" | ||
], | ||
"homepage": "https://github.com/broccolijs/broccoli", | ||
"license": "MIT", | ||
"author": "Jo Liss <joliss42@gmail.com>", | ||
"main": "lib/index.js", | ||
"repository": { | ||
@@ -20,16 +21,22 @@ "type": "git", | ||
}, | ||
"homepage": "https://github.com/broccolijs/broccoli", | ||
"scripts": { | ||
"lint": "eslint lib test", | ||
"lint:fix": "eslint --fix lib test", | ||
"pretest": "multidep test/multidep.json", | ||
"test": "mocha", | ||
"test:debug": "mocha --inspect-brk" | ||
}, | ||
"dependencies": { | ||
"broccoli-node-info": "1.1.0", | ||
"broccoli-slow-trees": "^2.0.0", | ||
"broccoli-slow-trees": "^3.0.1", | ||
"broccoli-source": "^1.1.0", | ||
"commander": "^2.11.0", | ||
"connect": "^3.6.5", | ||
"commander": "^2.15.1", | ||
"connect": "^3.6.6", | ||
"findup-sync": "^2.0.0", | ||
"handlebars": "^4.0.11", | ||
"heimdalljs": "^0.2.3", | ||
"heimdalljs": "^0.2.5", | ||
"heimdalljs-logger": "^0.1.9", | ||
"mime": "^1.5.0", | ||
"mime": "^2.3.1", | ||
"promise.prototype.finally": "^3.1.0", | ||
"rimraf": "^2.6.2", | ||
"rsvp": "^4.7.0", | ||
"sane": "^2.2.0", | ||
@@ -44,27 +51,20 @@ "tmp": "0.0.33", | ||
"chai-as-promised": "^7.1.1", | ||
"eslint-config-prettier": "^2.8.0", | ||
"eslint-plugin-mocha": "^4.11.0", | ||
"eslint-plugin-node": "^5.2.1", | ||
"eslint-plugin-prettier": "^2.3.1", | ||
"eslint-config-prettier": "^2.9.0", | ||
"eslint-plugin-mocha": "^5.0.0", | ||
"eslint-plugin-node": "^6.0.1", | ||
"eslint-plugin-prettier": "^2.6.0", | ||
"fixturify": "^0.3.4", | ||
"mocha": "^4.0.1", | ||
"mocha": "^5.2.0", | ||
"mocha-eslint": "^4.1.0", | ||
"multidep": "^2.0.2", | ||
"portfinder": "^1.0.13", | ||
"prettier": "^1.8.2", | ||
"semver": "^5.4.1", | ||
"sinon": "^4.1.2", | ||
"sinon-chai": "^2.14.0", | ||
"symlink-or-copy": "^1.1.8" | ||
"prettier": "^1.13.5", | ||
"semver": "^5.5.0", | ||
"sinon": "^5.1.1", | ||
"sinon-chai": "^3.1.0", | ||
"symlink-or-copy": "^1.2.0" | ||
}, | ||
"engines": { | ||
"node": ">= 4" | ||
}, | ||
"scripts": { | ||
"lint": "eslint lib test", | ||
"lint:fix": "eslint --fix lib test", | ||
"pretest": "multidep test/multidep.json", | ||
"test": "mocha", | ||
"test:debug": "mocha --inspect-brk" | ||
"node": ">= 6" | ||
} | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
72146
30
1341
2
+ Addedarray-buffer-byte-length@1.0.1(transitive)
+ Addedarraybuffer.prototype.slice@1.0.3(transitive)
+ Addedavailable-typed-arrays@1.0.7(transitive)
+ Addedbroccoli-slow-trees@3.1.0(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addeddata-view-buffer@1.0.1(transitive)
+ Addeddata-view-byte-length@1.0.1(transitive)
+ Addeddata-view-byte-offset@1.0.0(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddefine-properties@1.2.1(transitive)
+ Addedes-abstract@1.23.5(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.0.0(transitive)
+ Addedes-set-tostringtag@2.0.3(transitive)
+ Addedes-to-primitive@1.2.1(transitive)
+ Addedfor-each@0.3.3(transitive)
+ Addedfunction.prototype.name@1.1.6(transitive)
+ Addedfunctions-have-names@1.2.3(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedget-symbol-description@1.0.2(transitive)
+ Addedglobalthis@1.0.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-bigints@1.0.2(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedinternal-slot@1.0.7(transitive)
+ Addedis-array-buffer@3.0.4(transitive)
+ Addedis-async-function@2.0.0(transitive)
+ Addedis-bigint@1.0.4(transitive)
+ Addedis-boolean-object@1.1.2(transitive)
+ Addedis-callable@1.2.7(transitive)
+ Addedis-data-view@1.0.1(transitive)
+ Addedis-date-object@1.0.5(transitive)
+ Addedis-finalizationregistry@1.1.0(transitive)
+ Addedis-generator-function@1.0.10(transitive)
+ Addedis-map@2.0.3(transitive)
+ Addedis-negative-zero@2.0.3(transitive)
+ Addedis-number-object@1.0.7(transitive)
+ Addedis-regex@1.1.4(transitive)
+ Addedis-set@2.0.3(transitive)
+ Addedis-shared-array-buffer@1.0.3(transitive)
+ Addedis-string@1.0.7(transitive)
+ Addedis-symbol@1.0.4(transitive)
+ Addedis-typed-array@1.1.13(transitive)
+ Addedis-weakmap@2.0.2(transitive)
+ Addedis-weakref@1.0.2(transitive)
+ Addedis-weakset@2.0.3(transitive)
+ Addedisarray@2.0.5(transitive)
+ Addedmime@2.6.0(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedobject.assign@4.1.5(transitive)
+ Addedpossible-typed-array-names@1.0.0(transitive)
+ Addedpromise.prototype.finally@3.1.8(transitive)
+ Addedreflect.getprototypeof@1.0.7(transitive)
+ Addedregexp.prototype.flags@1.5.3(transitive)
+ Addedsafe-array-concat@1.1.2(transitive)
+ Addedsafe-regex-test@1.0.3(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedset-function-name@2.0.2(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedstring.prototype.trim@1.2.9(transitive)
+ Addedstring.prototype.trimend@1.0.8(transitive)
+ Addedstring.prototype.trimstart@1.0.8(transitive)
+ Addedtyped-array-buffer@1.0.2(transitive)
+ Addedtyped-array-byte-length@1.0.1(transitive)
+ Addedtyped-array-byte-offset@1.0.3(transitive)
+ Addedtyped-array-length@1.0.7(transitive)
+ Addedunbox-primitive@1.0.2(transitive)
+ Addedwhich-boxed-primitive@1.0.2(transitive)
+ Addedwhich-builtin-type@1.2.0(transitive)
+ Addedwhich-collection@1.0.2(transitive)
+ Addedwhich-typed-array@1.1.15(transitive)
- Removedrsvp@^4.7.0
- Removedbroccoli-slow-trees@2.0.0(transitive)
- Removedmime@1.6.0(transitive)
Updatedbroccoli-slow-trees@^3.0.1
Updatedcommander@^2.15.1
Updatedconnect@^3.6.6
Updatedheimdalljs@^0.2.5
Updatedmime@^2.3.1