Skip to content
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

Merged
merged 1 commit into from
Dec 6, 2017

Conversation

stelcheck
Copy link
Member

Fixes multiple outstanding issues, and pretifies error output by:

  1. using pretty-error to render the error
  2. stripping part of the stack that really should have no relevance

Fixes #4 #5 #8 #9 #11

cc @Tatsujinichi @ronkorving

@stelcheck stelcheck force-pushed the fixes/a-whole-bunch-and-more branch from 42eeccd to 99dd1ad Compare November 26, 2017 06:46
* 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');
Copy link
Member

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] === '.') {
Copy link
Member

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?)

Copy link
Member Author

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);
Copy link
Member

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...');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of -> or

@ronkorving
Copy link
Member

Wow, that's a lot to take in :) Sounds promising though!

Fixes multiple outstanding issues, and pretifies error output by:

  1. using pretty-error to render the error
  2. stripping part of the stack that really should have no relevance

Fixes mage#4 mage#5 mage#8 mage#9 mage#11
@stelcheck stelcheck force-pushed the fixes/a-whole-bunch-and-more branch from 99dd1ad to ed32bb5 Compare December 6, 2017 09:52
@stelcheck
Copy link
Member Author

Will release alongside the next MAGE release.

@stelcheck stelcheck merged commit faceff0 into mage:master Dec 6, 2017
@ronkorving
Copy link
Member

ronkorving commented Dec 7, 2017

Is there a dependency on the upcoming MAGE release?

@stelcheck
Copy link
Member Author

Yes, mage/mage#173 is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants