electron-userland / electron-compilers

DEPRECATED: Compiler implementations for electron-compile
35 stars 55 forks source link

Stylus support? #33

Closed jamen closed 8 years ago

jamen commented 8 years ago

I use Stylus primarily. Stylus is made in JavaScript, so it should be okay.

anaisbetts commented 8 years ago

Sure, I'd take a PR for it

anaisbetts commented 8 years ago

Submit a PR to this repo for the compiler, then submit a PR to electron-compile to add some tests, use npm link to pull it in. If that makes no sense, let me know and I can help out :)

lellimecnar commented 8 years ago

I was just playing around with this today, but I must be missing something... I've created a new class in src/css/stylus.js which extends the SimpleCompilerBase class, set up the compileSync() method, and then I added the mime type and extension to rig-mime-types.js in the other repo. I added some logs to make sure it was getting into the new class constructor, which it is, but it's never getting into the compileSync method...

What am I missing?

anaisbetts commented 8 years ago

@lellimecnar Send up what you've got as PRs and I'll have a look, it sounds like you're on the right track

lellimecnar commented 8 years ago

@paulcbetts #36 let me know if I should create a pr for the changes to the other repo as well

anaisbetts commented 8 years ago

@lellimecnar Please do!

lellimecnar commented 8 years ago

I manually updated db.json in mime-db to include the stylus mime type, and it's at least compiling. For whatever reason, modifying rig-mime-types.js wasn't enough.

I'm assuming there was a reason for using a scoped version of mime-db? Can that be updated?

anaisbetts commented 8 years ago

@lellimecnar Yeah, the scoped version is intentional because the original mime-db takes up a ton of memory

lellimecnar commented 8 years ago

So, since we're only working with a handful of mime types, can we just forgo the module altogether, and use the file extension instead? Since that's really all the module is doing anyway...

anaisbetts commented 8 years ago

@lellimecnar I actually just got it working with the custom mime-db, my big problem right now is that Stylus only offers an async API, which only happens to work for compileSync atm, it's not guaranteed to (because stylus could choose to call the fn later)

anaisbetts commented 8 years ago

Added in 3.2.0!

jamen commented 8 years ago

Awesome, thanks @lellimecnar and @paulcbetts.