-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use getNodeInfo() to get plugin/node name/label" #29
Use getNodeInfo() to get plugin/node name/label" #29
Conversation
package.json
Outdated
@@ -30,6 +30,7 @@ | |||
"silent-error": "^1.0.1" | |||
}, | |||
"devDependencies": { | |||
"broccoli-node-info": "^1.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will need to be a dep not a devDep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, yes, oops
@@ -296,6 +306,14 @@ function getPluginName(tree) { | |||
|
|||
exports.getDescription = getDescription | |||
function getDescription (tree) { | |||
if (typeof tree !== 'string') { | |||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this protecting us against? I don’t think we want to swallow any/all errors here.
I think the swap to broccoli-node-info should address the originally reported issue properly without the try / catch...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/broccolijs/broccoli-node-info
This function throws a broccoliNodeInfo.InvalidNodeError when called with
- a plain string node (while still supported by the Broccoli Builder, they are deprecated in favor of broccoli-source),
- a node using the old .read/.rebuild API (see docs/broccoli-1-0-plugin-api.md), or
- some other object that isn't a node.
Seem like 2 could be a problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ya, sounds good, lets check for the specific error and only swallow that one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🆗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
lib/builder.js
Outdated
@@ -4,6 +4,7 @@ var apiCompat = require('./api_compat') | |||
var heimdall = require('heimdalljs'); | |||
var SilentError = require('silent-error'); | |||
var BroccoliBuildError = require('./broccoli-build-error'); | |||
var BroccoliNodeInfo = require('broccoli-node-info'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do this instead:
var getNodeInfo = require(‘broccoli-node-info’).getNodeInfo;
Seems like it would make the call sites simpler...
So, I've tried this with: Also switched to the "broken" branch, and it works just fine there too. Soooo, not sure. |
Reverts #28
I need to work on testing instruction using
npm link
or something to test with a new ember app