Comparing version 2.2.9 to 2.2.10
var fs = require('fs') | ||
var path = require('path') | ||
var minimist = require('minimist') | ||
var bstr = require('browserify-string') | ||
var multistream = require('multistream') | ||
var concat = require('concat-stream') | ||
var browserify = require('browserify') | ||
var split = require('split2') | ||
@@ -37,29 +40,30 @@ var convert = require('./stack-convert') | ||
bstr('require("' + __dirname + '/gen")(' + JSON.stringify(json) + ', ' + opts + ')', {}) | ||
.bundle(function (err, src) { | ||
if (err) { | ||
debug( | ||
'Unable to generate client side code for flamegraph', | ||
err | ||
) | ||
} | ||
multistream([ | ||
browserify({standalone: 'd3'}).add(require.resolve('d3')).bundle(), | ||
browserify({standalone: 'hsl'}).add(require.resolve('hsl-to-rgb-for-reals')).bundle(), | ||
browserify({standalone: 'flamer'}).add(path.join(__dirname, './flamer')).bundle(), | ||
browserify({standalone: 'gen'}).add(path.join(__dirname, './gen')).bundle() | ||
]).pipe(concat(function (bundle) { | ||
write(bundle + '\ngen(' + JSON.stringify(json) + ', ' + opts + ')') | ||
})) | ||
var opts = { | ||
name: '-', | ||
theme: args.theme, | ||
title: args.title, | ||
script: src.toString(), | ||
exclude: args.exclude | ||
} | ||
function write (src) { | ||
var opts = { | ||
name: '-', | ||
theme: args.theme, | ||
title: args.title, | ||
script: src.toString(), | ||
exclude: args.exclude | ||
} | ||
if (args.langs) opts.langs = args.langs | ||
if (args.tiers) opts.tiers = args.tiers | ||
if (args.langs) opts.langs = args.langs | ||
if (args.tiers) opts.tiers = args.tiers | ||
gen(json, opts, function () {}, function () { | ||
debug('flamegraph generated') | ||
debug('exiting') | ||
process.exit() | ||
}) | ||
gen(json, opts, function () {}, function () { | ||
debug('flamegraph generated') | ||
debug('exiting') | ||
process.exit() | ||
}) | ||
} | ||
})) | ||
} |
69
index.js
@@ -8,6 +8,8 @@ var fs = require('fs') | ||
var sym = require('perf-sym') | ||
var bstr = require('clean-browserify-string') | ||
var through = require('through2') | ||
var convert = require('./stack-convert') | ||
var gen = require('./gen') | ||
var browserify = require('browserify') | ||
var multistream = require('multistream') | ||
var concat = require('concat-stream') | ||
var gen = require('./gen.js') | ||
var debug = require('debug')('0x') | ||
@@ -302,37 +304,38 @@ var status = require('single-line-log').stderr | ||
if (tiers) opts.tiers = tiers | ||
bstr('require("' + __dirname + '/gen")(' + JSON.stringify(json) + ', ' + opts + ')', {}) | ||
.bundle(function (err, src) { | ||
if (err) { | ||
debug( | ||
'Unable to generate client side code for flamegraph', | ||
err | ||
) | ||
} | ||
var opts = { | ||
theme: theme, | ||
title: title, | ||
script: src.toString(), | ||
dir: folder, | ||
preview: preview, | ||
exclude: exclude, | ||
include: include | ||
} | ||
multistream([ | ||
browserify({standalone: 'd3'}).add(require.resolve('d3')).bundle(), | ||
browserify({standalone: 'hsl'}).add(require.resolve('hsl-to-rgb-for-reals')).bundle(), | ||
browserify({standalone: 'flamer'}).add(path.join(__dirname, './flamer')).bundle(), | ||
browserify({standalone: 'gen'}).add(path.join(__dirname, './gen')).bundle() | ||
]).pipe(concat(function (bundle) { | ||
write(bundle + '\ngen(' + JSON.stringify(json) + ', ' + opts + ')') | ||
})) | ||
if (langs) opts.langs = langs | ||
if (tiers) opts.tiers = tiers | ||
function write (src) { | ||
var opts = { | ||
theme: theme, | ||
title: title, | ||
script: src.toString(), | ||
dir: folder, | ||
preview: preview, | ||
exclude: exclude, | ||
include: include | ||
} | ||
fs.writeFileSync(folder + '/stacks.' + pid + '.json', JSON.stringify(json, 0, 2)) | ||
gen(json, opts, function () { | ||
status('') | ||
}, function () { | ||
debug('flamegraph generated') | ||
tidy(args) | ||
log('file://' + process.cwd() + '/' + folder + '/flamegraph.html\n\n') | ||
debug('exiting') | ||
debug('done rendering') | ||
process.exit() | ||
}) | ||
if (langs) opts.langs = langs | ||
if (tiers) opts.tiers = tiers | ||
fs.writeFileSync(folder + '/stacks.' + pid + '.json', JSON.stringify(json, 0, 2)) | ||
gen(json, opts, function () { | ||
status('') | ||
}, function () { | ||
debug('flamegraph generated') | ||
tidy(args) | ||
log('file://' + process.cwd() + '/' + folder + '/flamegraph.html\n\n') | ||
debug('exiting') | ||
debug('done rendering') | ||
process.exit() | ||
}) | ||
} | ||
}) | ||
@@ -339,0 +342,0 @@ } |
{ | ||
"name": "0x", | ||
"version": "2.2.9", | ||
"version": "2.2.10", | ||
"description": "", | ||
@@ -24,4 +24,3 @@ "main": "index.js", | ||
"browserify": "^13.0.0", | ||
"clean-browserify-string": "^1.0.0", | ||
"clockface": "^1.1.1", | ||
"concat-stream": "^1.5.2", | ||
"d3": "^3.5.16", | ||
@@ -33,2 +32,3 @@ "debug": "^2.2.0", | ||
"minimist": "^1.2.0", | ||
"multistream": "^2.1.0", | ||
"perf-sym": "^2.0.0", | ||
@@ -35,0 +35,0 @@ "pump": "^1.0.1", |
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
10648188
1368
+ Addedconcat-stream@^1.5.2
+ Addedmultistream@^2.1.0
+ Addedmultistream@2.1.1(transitive)
- Removedclean-browserify-string@^1.0.0
- Removedclockface@^1.1.1
- Removedansi-escapes@1.4.0(transitive)
- Removedclean-browserify-string@1.0.0(transitive)
- Removedclockface@1.1.1(transitive)