postcss / postcss-load-config

Autoload Config for PostCSS
MIT License
642 stars 72 forks source link

feat(src/index): support synchronous config loading (`rc.sync`) #186

Closed bmatcuk closed 5 years ago

bmatcuk commented 5 years ago

Notable Changes

This PR adds support for a synchronous loading function, such as:

const postcssrc = require("postcss-load-config")
const config = postcssrc.sync({})

I'm trying to write an eslint plugin, but eslint has no support for asynchronous plugins. I would love to use postcss-load-config, but I would need this support for that.

While I was in there, I also updated cosmiconfig to the latest version, which closes #184.

Commit Message Summary (CHANGELOG)

chore(package): update `cosmiconfig` v4.0.0...5.0.0
feat(src/index): support synchronous config loading (`rc.sync`)

Type

SemVer

Issues

Checklist

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.8%) to 98.058% when pulling d9da571f63513a55a22c823137790530f9167744 on bmatcuk:synchronous into 4349ea939d42d6ac4a4c1d3e3b231d3588431a14 on michael-ciniawsky:master.

michael-ciniawsky commented 5 years ago

Please split the commit into separate commits

chore(package): update `cosmiconfig` v4.0.0...5.0.0
feat(src/index): support synchronous config loading (`rc.sync`)
bmatcuk commented 5 years ago

Made all of the requested changes; removed the "strip require stack" stuff since I can't reproduce it on another laptop.

Thanks for the feedback!

bmatcuk commented 5 years ago

lol, travis is failing with the require stack error now! What do you guys think would be the best way to handle it?

bmatcuk commented 5 years ago

Thanks @michael-ciniawsky - I've updated the tests (I went with /^blah blah .*$/m instead). Looks like all the tests are passing now =)

michael-ciniawsky commented 5 years ago

Released in v2.1.0 🎉

bmatcuk commented 5 years ago

Thanks!