FormidableLabs / builder-init

A project generator for builder archetypes.
MIT License
12 stars 2 forks source link

Capture full stack traces and add init.js errors. #26

Closed ryan-roemer closed 8 years ago

ryan-roemer commented 8 years ago

An alternate approach to https://github.com/FormidableLabs/builder-init/pull/24

This captures stacks from anything that throws at a more granular level.

For example, @paulathevalley 's syntax error in init.js now points us to the _lazyRequire() import function specifically within the async.auto.init workflow function, and I've added an extra message adjustment to help a bit more so we get:

$ builder-init $(pwd)/temp-archetype/
temp-archetype-1.0.0.tgz
SyntaxError: Unexpected token }
[builder-init] Error when importing 'temp-archetype/init.js'
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:414:25)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Task._lazyRequire (/Users/rroemer/scm/fmd/builder-init/lib/task.js:120:10)
    at Array.async.auto.init (/Users/rroemer/scm/fmd/builder-init/lib/task.js:223:21)
    at listener (/Users/rroemer/scm/fmd/builder-init/node_modules/async/lib/async.js:605:42)

/cc @coopy @paulathevalley

coopy commented 8 years ago

Perfect! I'll close up #24

ryan-roemer commented 8 years ago

Released in builder-init@0.2.1