Comparing version 3.4.1 to 3.4.2
# master | ||
# 3.4.2 | ||
* fix TypeScript types | ||
* add missing semi colon | ||
# 3.4.1 | ||
@@ -4,0 +9,0 @@ |
@@ -18,8 +18,75 @@ "use strict"; | ||
const node_1 = __importDefault(require("./wrappers/node")); | ||
const heimdall = require('heimdalljs'); | ||
const underscoreString = require('underscore.string'); | ||
const broccoliNodeInfo = require('broccoli-node-info'); | ||
const logger = require('heimdalljs-logger')('broccoli:builder'); | ||
const heimdalljs_1 = __importDefault(require("heimdalljs")); | ||
const underscore_string_1 = __importDefault(require("underscore.string")); | ||
// @ts-ignore | ||
const broccoli_node_info_1 = __importDefault(require("broccoli-node-info")); | ||
const heimdalljs_logger_1 = __importDefault(require("heimdalljs-logger")); | ||
const logger = new heimdalljs_logger_1.default('broccoli:builder'); | ||
// Clean up left-over temporary directories on uncaught exception. | ||
tmp_1.default.setGracefulCleanup(); | ||
function reParentNodes(outputNodeWrapper) { | ||
// re-parent heimdall nodes according to input nodes | ||
const seen = new Set(); | ||
const queue = [outputNodeWrapper]; | ||
let node; | ||
let parent; | ||
const stack = []; | ||
while ((node = queue.pop()) !== undefined) { | ||
if (parent === node) { | ||
parent = stack.pop(); | ||
} | ||
else { | ||
queue.push(node); | ||
let heimdallNode = node.__heimdall__; | ||
if (heimdallNode === undefined || seen.has(heimdallNode)) { | ||
// make 0 time node | ||
const cookie = heimdalljs_1.default.start(Object.assign({}, heimdallNode.id)); | ||
heimdallNode = heimdalljs_1.default.current; | ||
heimdallNode.id.broccoliCachedNode = true; | ||
cookie.stop(); | ||
heimdallNode.stats.time.self = 0; | ||
} | ||
else { | ||
seen.add(heimdallNode); | ||
// Only push children for non "cached inputs" | ||
const inputNodeWrappers = node.inputNodeWrappers; | ||
for (let i = inputNodeWrappers.length - 1; i >= 0; i--) { | ||
queue.push(inputNodeWrappers[i]); | ||
} | ||
} | ||
if (parent) { | ||
heimdallNode.remove(); | ||
parent.__heimdall__.addChild(heimdallNode); | ||
stack.push(parent); | ||
} | ||
parent = node; | ||
} | ||
} | ||
} | ||
function aggregateTime() { | ||
const queue = [heimdalljs_1.default.current]; | ||
const stack = []; | ||
let parent; | ||
let node; | ||
while ((node = queue.pop()) !== undefined) { | ||
if (parent === node) { | ||
parent = stack.pop(); | ||
if (parent !== undefined) { | ||
parent.stats.time.total += node.stats.time.total; | ||
} | ||
} | ||
else { | ||
const children = node._children; | ||
queue.push(node); | ||
for (let i = children.length - 1; i >= 0; i--) { | ||
queue.push(children[i]); | ||
} | ||
if (parent) { | ||
stack.push(parent); | ||
} | ||
node.stats.time.total = node.stats.time.self; | ||
parent = node; | ||
} | ||
} | ||
} | ||
// For an explanation and reference of the API that we use to communicate with | ||
@@ -76,3 +143,3 @@ // nodes (__broccoliFeatures__ and __broccoliGetInfo__), see | ||
static get InvalidNodeError() { | ||
return broccoliNodeInfo.InvalidNodeError; | ||
return broccoli_node_info_1.default.InvalidNodeError; | ||
} | ||
@@ -143,3 +210,3 @@ static get NodeSetupError() { | ||
finally { | ||
let buildsSkipped = filter_map_1.default(this._nodeWrappers.values(), (nw) => nw.buildState.built === false).length; | ||
const buildsSkipped = filter_map_1.default(this._nodeWrappers.values(), (nw) => nw.buildState.built === false).length; | ||
logger.debug(`Total nodes skipped: ${buildsSkipped} out of ${this._nodeWrappers.size}`); | ||
@@ -166,3 +233,3 @@ this._cancelationRequest = null; | ||
makeNodeWrapper(node, _stack = []) { | ||
let wrapper = this._nodeWrappers.get(node); | ||
const wrapper = this._nodeWrappers.get(node); | ||
if (wrapper !== undefined) { | ||
@@ -179,6 +246,6 @@ return wrapper; | ||
try { | ||
nodeInfo = broccoliNodeInfo.getNodeInfo(node); | ||
nodeInfo = broccoli_node_info_1.default.getNodeInfo(node); | ||
} | ||
catch (e) { | ||
if (!(e instanceof broccoliNodeInfo.InvalidNodeError)) | ||
if (!(e instanceof broccoli_node_info_1.default.InvalidNodeError)) | ||
throw e; | ||
@@ -192,3 +259,3 @@ // We don't have the instantiation stack of an invalid node, so to aid | ||
: '\nused as output node'; | ||
throw new broccoliNodeInfo.InvalidNodeError(e.message + messageSuffix); | ||
throw new broccoli_node_info_1.default.InvalidNodeError(e.message + messageSuffix); | ||
} | ||
@@ -299,3 +366,3 @@ // Compute label, like "Funnel (test suite)" | ||
this.builderTmpDirCleanup = tmpObj.removeCallback; | ||
for (let nodeWrapper of this._nodeWrappers.values()) { | ||
for (const nodeWrapper of this._nodeWrappers.values()) { | ||
if (nodeWrapper.nodeInfo.nodeType === 'transform') { | ||
@@ -319,9 +386,9 @@ nodeWrapper.inputPaths = nodeWrapper.inputNodeWrappers.map((nw) => nw.outputPath); | ||
mkTmpDir(nodeWrapper, type) { | ||
let nameAndAnnotation = nodeWrapper.nodeInfo.name + ' ' + (nodeWrapper.nodeInfo.annotation || ''); | ||
const nameAndAnnotation = nodeWrapper.nodeInfo.name + ' ' + (nodeWrapper.nodeInfo.annotation || ''); | ||
// slugify turns fooBar into foobar, so we call underscored first to | ||
// preserve word boundaries | ||
let suffix = underscoreString.underscored(nameAndAnnotation.substr(0, 60)); | ||
suffix = underscoreString.slugify(suffix).replace(/-/g, '_'); | ||
let suffix = underscore_string_1.default.underscored(nameAndAnnotation.substr(0, 60)); | ||
suffix = underscore_string_1.default.slugify(suffix).replace(/-/g, '_'); | ||
// 1 .. 147 -> '001' .. '147' | ||
const paddedId = underscoreString.pad('' + nodeWrapper.id, ('' + this._nodeWrappers.size).length, '0'); | ||
const paddedId = underscore_string_1.default.pad('' + nodeWrapper.id, ('' + this._nodeWrappers.size).length, '0'); | ||
const dirname = type + '-' + paddedId + '-' + suffix; | ||
@@ -337,3 +404,3 @@ const tmpDir = path_1.default.join(this.builderTmpDir, dirname); | ||
setupNodes() { | ||
for (let nw of this._nodeWrappers.values()) { | ||
for (const nw of this._nodeWrappers.values()) { | ||
try { | ||
@@ -356,3 +423,3 @@ nw.setup(this.features); | ||
} | ||
node.__heimdall_cookie__ = heimdall.start({ | ||
node['__heimdall_cookie__'] = heimdalljs_1.default.start({ | ||
name, | ||
@@ -367,3 +434,3 @@ label: node.label, | ||
}); | ||
node.__heimdall__ = heimdall.current; | ||
node.__heimdall__ = heimdalljs_1.default.current; | ||
}); | ||
@@ -386,71 +453,6 @@ this.on('endNode', node => { | ||
get features() { | ||
return broccoliNodeInfo.features; | ||
return broccoli_node_info_1.default.features; | ||
} | ||
} | ||
function reParentNodes(outputNodeWrapper) { | ||
// re-parent heimdall nodes according to input nodes | ||
const seen = new Set(); | ||
const queue = [outputNodeWrapper]; | ||
let node; | ||
let parent; | ||
let stack = []; | ||
while ((node = queue.pop()) !== undefined) { | ||
if (parent === node) { | ||
parent = stack.pop(); | ||
} | ||
else { | ||
queue.push(node); | ||
let heimdallNode = node.__heimdall__; | ||
if (heimdallNode === undefined || seen.has(heimdallNode)) { | ||
// make 0 time node | ||
const cookie = heimdall.start(Object.assign({}, heimdallNode.id)); | ||
heimdallNode = heimdall.current; | ||
heimdallNode.id.broccoliCachedNode = true; | ||
cookie.stop(); | ||
heimdallNode.stats.time.self = 0; | ||
} | ||
else { | ||
seen.add(heimdallNode); | ||
// Only push children for non "cached inputs" | ||
const inputNodeWrappers = node.inputNodeWrappers; | ||
for (let i = inputNodeWrappers.length - 1; i >= 0; i--) { | ||
queue.push(inputNodeWrappers[i]); | ||
} | ||
} | ||
if (parent) { | ||
heimdallNode.remove(); | ||
parent.__heimdall__.addChild(heimdallNode); | ||
stack.push(parent); | ||
} | ||
parent = node; | ||
} | ||
} | ||
} | ||
function aggregateTime() { | ||
let queue = [heimdall.current]; | ||
let stack = []; | ||
let parent; | ||
let node; | ||
while ((node = queue.pop()) !== undefined) { | ||
if (parent === node) { | ||
parent = stack.pop(); | ||
if (parent !== undefined) { | ||
parent.stats.time.total += node.stats.time.total; | ||
} | ||
} | ||
else { | ||
const children = node._children; | ||
queue.push(node); | ||
for (let i = children.length - 1; i >= 0; i--) { | ||
queue.push(children[i]); | ||
} | ||
if (parent) { | ||
stack.push(parent); | ||
} | ||
node.stats.time.total = node.stats.time.self; | ||
parent = node; | ||
} | ||
} | ||
} | ||
module.exports = Builder; | ||
//# sourceMappingURL=builder.js.map |
@@ -21,2 +21,3 @@ "use strict"; | ||
then() { | ||
// eslint-disable-next-line prefer-rest-params | ||
return this._pendingWork.then(...arguments); | ||
@@ -23,0 +24,0 @@ } |
@@ -12,4 +12,9 @@ "use strict"; | ||
const messages_1 = __importDefault(require("./messages")); | ||
const WatchDetector = require('watch-detector'); | ||
const UI = require('console-ui'); | ||
const watch_detector_1 = __importDefault(require("watch-detector")); | ||
const console_ui_1 = __importDefault(require("console-ui")); | ||
function buildBrocfileOptions(options) { | ||
return { | ||
env: options.environment, | ||
}; | ||
} | ||
function getBuilder(options) { | ||
@@ -26,3 +31,3 @@ const brocfile = index_1.default.loadBrocfile(options); | ||
} | ||
const detector = new WatchDetector({ | ||
const detector = new watch_detector_1.default({ | ||
ui, | ||
@@ -46,12 +51,2 @@ childProcess: child_process_1.default, | ||
} | ||
function buildBrocfileOptions(options) { | ||
return { | ||
env: options.environment, | ||
}; | ||
} | ||
function guardOutputDir(outputDir) { | ||
if (isParentDirectory(outputDir)) { | ||
throw new cli_1.default(`build directory can not be the current or direct parent directory: ${outputDir}`); | ||
} | ||
} | ||
function isParentDirectory(outputPath) { | ||
@@ -72,7 +67,14 @@ if (!fs_1.default.existsSync(outputPath)) { | ||
} | ||
module.exports = function broccoliCLI(args, ui = new UI()) { | ||
function guardOutputDir(outputDir) { | ||
if (isParentDirectory(outputDir)) { | ||
throw new cli_1.default(`build directory can not be the current or direct parent directory: ${outputDir}`); | ||
} | ||
} | ||
module.exports = function broccoliCLI(args, ui = new console_ui_1.default()) { | ||
// always require a fresh commander, as it keeps state at module scope | ||
delete require.cache[require.resolve('commander')]; | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const program = require('commander'); | ||
let actionPromise; | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
program.version(require('../package.json').version).usage('<command> [options] [<args ...>]'); | ||
@@ -113,3 +115,3 @@ program | ||
if (e instanceof cli_1.default) { | ||
ui.writeError(e.message); | ||
ui.writeError(e); | ||
return process.exit(1); | ||
@@ -116,0 +118,0 @@ } |
@@ -9,3 +9,3 @@ "use strict"; | ||
this._lifetimeDeferred = {}; | ||
let lifetime = this._lifetimeDeferred; | ||
const lifetime = this._lifetimeDeferred; | ||
lifetime.promise = new Promise((resolve, reject) => { | ||
@@ -29,4 +29,3 @@ lifetime.resolve = resolve; | ||
} | ||
; | ||
module.exports = Watcher; | ||
//# sourceMappingURL=dummy-watcher.js.map |
@@ -70,3 +70,2 @@ "use strict"; | ||
exports.default = BuildError; | ||
; | ||
//# sourceMappingURL=build.js.map |
@@ -14,3 +14,2 @@ "use strict"; | ||
exports.default = BuilderError; | ||
; | ||
//# sourceMappingURL=builder.js.map |
@@ -15,3 +15,2 @@ "use strict"; | ||
exports.default = Cancelation; | ||
; | ||
//# sourceMappingURL=cancelation.js.map |
@@ -7,3 +7,2 @@ "use strict"; | ||
exports.default = CliError; | ||
; | ||
//# sourceMappingURL=cli.js.map |
@@ -26,3 +26,2 @@ "use strict"; | ||
exports.default = NodeSetupError; | ||
; | ||
//# sourceMappingURL=node-setup.js.map |
@@ -7,3 +7,4 @@ "use strict"; | ||
const findup_sync_1 = __importDefault(require("findup-sync")); | ||
const esmRequire = require('esm')(module); | ||
const esm_1 = __importDefault(require("esm")); | ||
const esmRequire = esm_1.default(module); | ||
/** | ||
@@ -40,2 +41,3 @@ * Require a brocfile via either ESM or TypeScript | ||
// ESM `export default X` is represented as module.exports = { default: X } | ||
// eslint-disable-next-line no-prototype-builtins | ||
if (brocfile !== null && typeof brocfile === 'object' && brocfile.hasOwnProperty('default')) { | ||
@@ -42,0 +44,0 @@ brocfile = brocfile.default; |
@@ -10,7 +10,8 @@ "use strict"; | ||
const handlebars_1 = __importDefault(require("handlebars")); | ||
const resolvePath = require('resolve-path'); | ||
const ansiHTML = require('ansi-html'); | ||
const resolve_path_1 = __importDefault(require("resolve-path")); | ||
// @ts-ignore | ||
const ansi_html_1 = __importDefault(require("ansi-html")); | ||
// Resets foreground and background colors to black | ||
// and white respectively | ||
ansiHTML.setColors({ | ||
ansi_html_1.default.setColors({ | ||
reset: ['#000', '#fff'], | ||
@@ -29,5 +30,6 @@ }); | ||
function handleRequest(outputPath, request, response, next, options) { | ||
// eslint-disable-next-line node/no-deprecated-api | ||
const urlObj = url_1.default.parse(request.url); | ||
let pathname = urlObj.pathname || ''; | ||
let filename, stat, lastModified, buffer; | ||
const pathname = urlObj.pathname || ''; | ||
let filename, stat; | ||
try { | ||
@@ -40,3 +42,3 @@ filename = decodeURIComponent(pathname); | ||
} | ||
filename = resolvePath(outputPath, filename.substr(1)); | ||
filename = resolve_path_1.default(outputPath, filename.substr(1)); | ||
} | ||
@@ -104,3 +106,3 @@ catch (err) { | ||
} | ||
lastModified = stat.mtime.toUTCString(); | ||
const lastModified = stat.mtime.toUTCString(); | ||
response.setHeader('Last-Modified', lastModified); | ||
@@ -118,3 +120,3 @@ // nginx style treat last-modified as a tag since browsers echo it back | ||
// the builder (Windows does not allow us to delete while the file is open). | ||
buffer = fs_1.default.readFileSync(filename); | ||
const buffer = fs_1.default.readFileSync(filename); | ||
response.writeHead(200); | ||
@@ -139,3 +141,3 @@ response.end(buffer); | ||
const context = { | ||
stack: ansiHTML(error.stack || ''), | ||
stack: ansi_html_1.default(error.stack || ''), | ||
liveReloadPath: options.liveReloadPath, | ||
@@ -142,0 +144,0 @@ payload: error.broccoliPayload, |
@@ -116,7 +116,6 @@ "use strict"; | ||
} | ||
; | ||
module.exports = { | ||
Server, | ||
serve | ||
serve, | ||
}; | ||
//# sourceMappingURL=server.js.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const logger = require('heimdalljs-logger')('broccoli:watcherAdapter'); | ||
const heimdalljs_logger_1 = __importDefault(require("heimdalljs-logger")); | ||
const logger = new heimdalljs_logger_1.default('broccoli:watcherAdapter'); | ||
function bindFileEvent(adapter, watcher, node, event) { | ||
@@ -5,0 +9,0 @@ // @ts-ignores |
@@ -20,7 +20,7 @@ "use strict"; | ||
let groupedNodes = []; | ||
let nodesGroupedByName = {}; | ||
const nodesGroupedByName = {}; | ||
// calculate times | ||
tree.visitPostOrder((node) => { | ||
tree.visitPostOrder(node => { | ||
let nonbroccoliChildrenTime = 0; | ||
node.forEachChild((childNode) => { | ||
node.forEachChild(childNode => { | ||
// subsume non-broccoli nodes as their ancestor broccoli nodes' | ||
@@ -69,3 +69,2 @@ // broccoliSelfTime | ||
exports.default = calculateSummary; | ||
; | ||
//# sourceMappingURL=calculate-summary.js.map |
@@ -13,3 +13,2 @@ "use strict"; | ||
exports.default = filterMap; | ||
; | ||
//# sourceMappingURL=filter-map.js.map |
@@ -15,2 +15,25 @@ "use strict"; | ||
} | ||
function pad(str, len, char, dir) { | ||
if (!char) { | ||
char = ' '; | ||
} | ||
if (len + 1 >= str.length) | ||
switch (dir) { | ||
case 'left': { | ||
str = Array(len + 1 - str.length).join(char) + str; | ||
break; | ||
} | ||
case 'both': { | ||
const padlen = len - str.length; | ||
const right = Math.ceil(padlen / 2); | ||
const left = padlen - right; | ||
str = Array(left + 1).join(char) + str + Array(right + 1).join(char); | ||
break; | ||
} | ||
default: { | ||
str = str + Array(len + 1 - str.length).join(char); | ||
} | ||
} | ||
return str; | ||
} | ||
function printSlowNodes(tree, factor, ui) { | ||
@@ -53,26 +76,2 @@ try { | ||
exports.default = printSlowNodes; | ||
; | ||
function pad(str, len, char, dir) { | ||
if (!char) { | ||
char = ' '; | ||
} | ||
if (len + 1 >= str.length) | ||
switch (dir) { | ||
case 'left': { | ||
str = Array(len + 1 - str.length).join(char) + str; | ||
break; | ||
} | ||
case 'both': { | ||
const padlen = len - str.length; | ||
const right = Math.ceil(padlen / 2); | ||
const left = padlen - right; | ||
str = Array(left + 1).join(char) + str + Array(right + 1).join(char); | ||
break; | ||
} | ||
default: { | ||
str = str + Array(len + 1 - str.length).join(char); | ||
} | ||
} | ||
return str; | ||
} | ||
//# sourceMappingURL=slow-trees.js.map |
@@ -6,2 +6,3 @@ "use strict"; | ||
for (const key in obj) { | ||
// eslint-disable-next-line no-prototype-builtins | ||
if (obj.hasOwnProperty(key) && obj[key] === undefined) { | ||
@@ -14,3 +15,2 @@ obj[key] = null; | ||
exports.default = undefinedToNull; | ||
; | ||
//# sourceMappingURL=undefined-to-null.js.map |
@@ -14,3 +14,2 @@ "use strict"; | ||
exports.default = wrapPrimitiveErrors; | ||
; | ||
//# sourceMappingURL=wrap-primitive-errors.js.map |
@@ -9,3 +9,4 @@ "use strict"; | ||
const bind_file_event_1 = __importDefault(require("./utils/bind-file-event")); | ||
const logger = require('heimdalljs-logger')('broccoli:watcherAdapter'); | ||
const heimdalljs_logger_1 = __importDefault(require("heimdalljs-logger")); | ||
const logger = new heimdalljs_logger_1.default('broccoli:watcherAdapter'); | ||
function defaultFilterFunction(name) { | ||
@@ -34,3 +35,3 @@ return /^[^.]/.test(name); | ||
watch() { | ||
let watchers = this.watchedNodes.map((node) => { | ||
const watchers = this.watchedNodes.map((node) => { | ||
const watchedPath = node.nodeInfo.sourceDirectory; | ||
@@ -55,6 +56,7 @@ const watcher = sane_1.default(watchedPath, this.options); | ||
}); | ||
// eslint-disable-next-line @typescript-eslint/no-empty-function | ||
return Promise.all(watchers).then(() => { }); | ||
} | ||
quit() { | ||
let closing = this.watchers.map((watcher) => new Promise((resolve, reject) => | ||
const closing = this.watchers.map((watcher) => new Promise((resolve, reject) => | ||
// @ts-ignore | ||
@@ -68,7 +70,7 @@ watcher.close((err) => { | ||
this.watchers.length = 0; | ||
// eslint-disable-next-line @typescript-eslint/no-empty-function | ||
return Promise.all(closing).then(() => { }); | ||
} | ||
} | ||
; | ||
module.exports = WatcherAdapter; | ||
//# sourceMappingURL=watcher_adapter.js.map |
@@ -8,3 +8,4 @@ "use strict"; | ||
const watcher_adapter_1 = __importDefault(require("./watcher_adapter")); | ||
const logger = require('heimdalljs-logger')('broccoli:watcher'); | ||
const heimdalljs_logger_1 = __importDefault(require("heimdalljs-logger")); | ||
const logger = new heimdalljs_logger_1.default('broccoli:watcher'); | ||
// This Watcher handles all the Broccoli logic, such as debouncing. The | ||
@@ -58,3 +59,3 @@ // WatcherAdapter handles I/O via the sane package, and could be pluggable in | ||
this._lifetime = {}; | ||
let lifetime = this._lifetime; | ||
const lifetime = this._lifetime; | ||
lifetime.promise = new Promise((resolve, reject) => { | ||
@@ -126,3 +127,3 @@ lifetime.resolve = resolve; | ||
// This is to maintain backwards compatibility with broccoli-sane-watcher | ||
let annotation = { | ||
const annotation = { | ||
type: filePath ? 'rebuild' : 'initial', | ||
@@ -178,3 +179,3 @@ reason: 'watcher', | ||
} | ||
let quitting = this._quit(); | ||
const quitting = this._quit(); | ||
if (this._lifetime && typeof this._lifetime.resolve === 'function') { | ||
@@ -181,0 +182,0 @@ this._lifetime.resolve(quitting); |
@@ -35,6 +35,4 @@ "use strict"; | ||
} | ||
; | ||
} | ||
exports.default = NodeWrapper; | ||
; | ||
//# sourceMappingURL=node.js.map |
@@ -10,2 +10,3 @@ "use strict"; | ||
class SourceNodeWrapper extends node_1.default { | ||
// eslint-disable-next-line @typescript-eslint/no-empty-function | ||
setup( /* features */) { } | ||
@@ -31,3 +32,3 @@ build() { | ||
toString() { | ||
let hint = this.nodeInfo.sourceDirectory + (this.nodeInfo.watched ? '' : ' (unwatched)'); | ||
const hint = this.nodeInfo.sourceDirectory + (this.nodeInfo.watched ? '' : ' (unwatched)'); | ||
return '[NodeWrapper:' + this.id + ' ' + hint + ']'; | ||
@@ -46,3 +47,2 @@ } | ||
exports.default = SourceNodeWrapper; | ||
; | ||
//# sourceMappingURL=source-node.js.map |
@@ -10,3 +10,4 @@ "use strict"; | ||
const node_1 = __importDefault(require("./node")); | ||
const logger = require('heimdalljs-logger')('broccoli:transform-node'); | ||
const heimdalljs_logger_1 = __importDefault(require("heimdalljs-logger")); | ||
const logger = new heimdalljs_logger_1.default('broccoli:transform-node'); | ||
class TransformNodeWrapper extends node_1.default { | ||
@@ -26,6 +27,6 @@ setup(features) { | ||
shouldBuild() { | ||
let nodesThatChanged = []; | ||
const nodesThatChanged = []; | ||
this.inputNodeWrappers.forEach((wrapper) => { | ||
let wrapper_revision_meta = this.inputRevisions.get(wrapper); | ||
if (!wrapper_revision_meta || wrapper_revision_meta.revision !== wrapper.revision) { | ||
const wrapperRevisionMeta = this.inputRevisions.get(wrapper); | ||
if (!wrapperRevisionMeta || wrapperRevisionMeta.revision !== wrapper.revision) { | ||
nodesThatChanged.push(wrapper.id); | ||
@@ -58,3 +59,3 @@ this.inputRevisions.set(wrapper, { revision: wrapper.revision, changed: true }); | ||
async build() { | ||
let startTime = process.hrtime(); | ||
const startTime = process.hrtime(); | ||
if (!this.shouldBuild()) { | ||
@@ -69,3 +70,3 @@ this.buildState.built = false; | ||
if (this.nodeInfo.trackInputChanges === true) { | ||
let changed = this.inputNodeWrappers.map(wrapper => this.inputRevisions.get(wrapper).changed); | ||
const changed = this.inputNodeWrappers.map(wrapper => this.inputRevisions.get(wrapper).changed); | ||
await this.callbackObject.build({ changedNodes: changed }); | ||
@@ -112,3 +113,2 @@ } | ||
exports.default = TransformNodeWrapper; | ||
; | ||
//# sourceMappingURL=transform-node.js.map |
{ | ||
"name": "broccoli", | ||
"version": "3.4.1", | ||
"version": "3.4.2", | ||
"description": "Fast client-side asset builder", | ||
@@ -26,4 +26,4 @@ "keywords": [ | ||
"html": "copyfiles -u 1 lib/templates/*.html ./dist", | ||
"lint": "eslint lib test", | ||
"lint:fix": "eslint --fix lib test", | ||
"lint": "eslint --ext .ts,.js lib/ test/", | ||
"lint:fix": "eslint --ext .ts,.js lib/ test/ --fix", | ||
"prepare": "yarn build", | ||
@@ -63,2 +63,3 @@ "pretest": "multidep test/multidep.json", | ||
"@types/console-ui": "^2.2.3", | ||
"@types/esm": "^3.2.0", | ||
"@types/findup-sync": "^2.0.2", | ||
@@ -70,4 +71,5 @@ "@types/mime-types": "^2.1.0", | ||
"@types/tmp": "^0.0.33", | ||
"@typescript-eslint/eslint-plugin": "^2.21.0", | ||
"@typescript-eslint/parser": "^2.21.0", | ||
"@types/underscore.string": "^0.0.38", | ||
"@typescript-eslint/eslint-plugin": "^2.28.0", | ||
"@typescript-eslint/parser": "^2.28.0", | ||
"broccoli-node-api": "^1.7.0", | ||
@@ -86,3 +88,2 @@ "chai": "^4.1.2", | ||
"mocha": "^7.1.0", | ||
"mocha-eslint": "^4.1.0", | ||
"multidep": "^2.0.2", | ||
@@ -89,0 +90,0 @@ "portfinder": "^1.0.25", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
165693
58
1899
34