These are chat archives for jescalan/roots

1st
Jul 2015
Sergio Forés
@t0t
Jul 01 2015 15:26

Hey @EnMod , it gives me: `➜ maderlim git:(contentful) ✗ roots watch
compiling... [Error: [object Object]]

Potentially unhandled rejection [4] {"sys":{"type":"Error","id":"UnknownField"},"message":"No field with apiName \"environment\" found.","details":{"errors":[{"name":"unknown","path":["fields","environment"]}]},"requestId":"c0e-1598615491"} (WARNING: non-Error used)`

In contenful I have a content_type Product
Sergio Forés
@t0t
Jul 01 2015 15:31
but no idea on what this does: filters: { 'fields.environment[in]': ['staging', 'production'] } path: (e) -> "blogging/#{e.category}/#{slugify(e.title)}"
Henry Snopek
@hhsnopek
Jul 01 2015 15:33
what happens if you remove the filter?
Sergio Forés
@t0t
Jul 01 2015 16:09
This is what I get when removing the filter:

[Error: ReferenceError: slugify is not defined]

Potentially unhandled rejection [4] ReferenceError: slugify is not defined
at Object.module.exports.extensions.contentful.content_types.product.path (/Users/o0/Dropbox/TRABAJO/sites/maderlim/app.coffee:27:50)
at /Users/o0/Dropbox/TRABAJO/sites/maderlim/node_modules/roots-contentful/lib/index.js:176:44
at tryCatch2 (/Users/o0/Dropbox/TRABAJO/sites/maderlim/node_modules/roots-contentful/node_modules/when/lib/makePromise.js:833:12)
at mapAt (/Users/o0/Dropbox/TRABAJO/sites/maderlim/node_modules/roots-contentful/node_modules/when/lib/makePromise.js:227:40)
at traverseAt (/Users/o0/Dropbox/TRABAJO/sites/maderlim/node_modules/roots-contentful/node_modules/when/lib/makePromise.js:247:6)
at traverseWith (/Users/o0/Dropbox/TRABAJO/sites/maderlim/node_modules/roots-contentful/node_modules/when/lib/makePromise.js:216:5)
at Function.traverse (/Users/o0/Dropbox/TRABAJO/sites/maderlim/node_modules/roots-contentful/node_modules/when/lib/makePromise.js:198:11)
at Function.map (/Users/o0/Dropbox/TRABAJO/sites/maderlim/node_modules/roots-contentful/node_modules/when/lib/decorators/array.js:197:19)
at /Users/o0/Dropbox/TRABAJO/sites/maderlim/node_modules/roots-contentful/node_modules/when/when.js:207:19
at tryCatchReject (/Users/o0/Dropbox/TRABAJO/sites/maderlim/node_modules/roots-contentful/node_modules/when/lib/makePromise.js:845:30)
at runContinuation1 (/Users/o0/Dropbox/TRABAJO/sites/maderlim/node_modules/roots-contentful/node_modules/when/lib/makePromise.js:804:4)
at Fulfilled.when (/Users/o0/Dropbox/TRABAJO/sites/maderlim/node_modules/roots-contentful/node_modules/when/lib/makePromise.js:592:4)
at ContinuationTask.run (/Users/o0/Dropbox/TRABAJO/sites/maderlim/node_modules/roots-contentful/node_modules/when/lib/makePromise.js:702:24)
at Scheduler._drain (/Users/o0/Dropbox/TRABAJO/sites/maderlim/node_modules/roots-contentful/node_modules/when/lib/Scheduler.js:62:19)
at Scheduler.drain (/Users/o0/Dropbox/TRABAJO/sites/maderlim/node_modules/roots-contentful/node_modules/when/lib/Scheduler.js:27:9)
at process._tickCallback (node.js:355:11)

Ladislav Šulc
@ladislavsulc
Jul 01 2015 17:29
@hhsnopek That is what I would love to know - how to do it in cofee app file. Could you help please?
@hhsnopek I have managed to add scss support (which is easy) and remove stylus stuff, but I have no idea how to add autoprefixer task according to the docs.
Henry Snopek
@hhsnopek
Jul 01 2015 18:40
@t0t hmm okay
@ladislavsulc hmm I'm not sure off the top of my head... but my initial thought is to use multipass on your scss files, so basically it will compile to css, then postcss will pick up the css, and you'll use the postcss autoprefixer plugin
in your app.coffee you'll add something like this
autoprefixerPostCssPlugin = require 'autoprefixerPostCssPlugin'

postcss:
  use: [autoprefixerPostCssPlugin()]
Henry Snopek
@hhsnopek
Jul 01 2015 18:46
Your scss files will be something like this main.css.scss
Ladislav Šulc
@ladislavsulc
Jul 01 2015 18:47
@hhsnopek thanks a lot, appreciate it. Will try it.
Henry Snopek
@hhsnopek
Jul 01 2015 18:47
@t0t I would ping @jenius or @joshrowley on that one :/
@ladislavsulc no problem
Declan de Wet
@declandewet
Jul 01 2015 19:28
Alsome
I'm now an author of a postcss plugin and use it with roots a lot :)
Henry Snopek
@hhsnopek
Jul 01 2015 19:29
@declandewet do you thing that solution would work?
Declan de Wet
@declandewet
Jul 01 2015 19:32
That will work but be sure to change the file extension to "<file>.css.scss" so multi pass can pick it up. Also be sure to use the latest postcss because they've deprecated being a standalone plugin and are now just postcss-exclusive
Also I'm on mobile so don't mind my typing :3
Henry Snopek
@hhsnopek
Jul 01 2015 19:57
@ladislavsulc see @declandewet 's comment, above