-
Notifications
You must be signed in to change notification settings - Fork 3
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
Multiple fixes and prettification of errors #12
Conversation
42eeccd
to
99dd1ad
Compare
* Force-configure mage to use cluster: 1 (one master, one process), | ||
* and set the list of files and folders to watch for. | ||
*/ | ||
var config = require('../mage/lib/config'); |
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.
Why the ../
before mage
? Module resolution should find mage/lib/config
just fine, right?
var watcher = watch(WATCH_FILES, { | ||
recursive: true | ||
}, function (event, name) { | ||
if (name.split(path.sep).pop()[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.
I know this code existed before, but what is this about? Hidden files? Why ignore them exactly? (.DS_Store and stuff?)
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.
Correct. IIRC WebStorm and some other IDEs create and update dot files on file save; this was a quick fix to ensure file watch woild not trigger more than once (arguably not a real fix, but in this case it got the job done).
index.js
Outdated
} | ||
|
||
var rendered = prettyError.render(error); | ||
rendered = rendered.substring(0, rendered.length - 5); |
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.
Friendly tip:
rendered = rendered.slice(0, -5);
index.js
Outdated
} else { | ||
console.log(''); | ||
logger.warning('------------------------------------------------------'); | ||
logger.warning('Worker down, save a file of press any key to reload...'); |
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.
of
-> or
Wow, that's a lot to take in :) Sounds promising though! |
99dd1ad
to
ed32bb5
Compare
Will release alongside the next MAGE release. |
Is there a dependency on the upcoming MAGE release? |
Yes, mage/mage#173 is needed. |
Fixes multiple outstanding issues, and pretifies error output by:
Fixes #4 #5 #8 #9 #11
cc @Tatsujinichi @ronkorving