broccolijs / broccoli

Browser compilation library – an asset pipeline for applications that run in the browser
https://broccoli.build
MIT License
3.33k stars 217 forks source link

Enable colored syntax highlighting in error messages from babel #415

Closed astronomersiva closed 5 years ago

stefanpenner commented 5 years ago

nice

Two things:

astronomersiva commented 5 years ago

@stefanpenner,

  • whats our plan to coordinate this capability with ember-cli-babel, so we can configure babel to provide ansi coloring?

Since ember apps rely on broccoli-middleware instead of this middleware, we will have to make the same changes in its error-handler.

We can then remove the options.highlightCode = false in ember-cli-babel.

This is how it looks after doing these steps.

Screen Shot 2019-06-27 at 21 13 02

We can probably change the cyan to something else to make it play along well with the page background.

Let me take a stab at writing a test for this.

stefanpenner commented 5 years ago

@astronomersiva this LGTM, is the plan for ember-cli-babel to detect the version of broccoli installed an swap the boolean flag when the appropriate version is present or...

stefanpenner commented 5 years ago

released as v3.1.2 🎉

astronomersiva commented 5 years ago

@stefanpenner, yes that's what I have in mind as well. After porting these changes to broccoli-middleware, we will have to check for that version in ember-cli-babel to toggle the boolean like you said.

We should probably explore merging broccoli-middleware with the middleware in this repo as well.

stefanpenner commented 5 years ago

@astronomersiva yes, unifying the middleware would be fantastic.