kentcdodds / babel-plugin-macros

🎣 Allows you to build simple compile-time libraries
https://npm.im/babel-plugin-macros
MIT License
2.62k stars 135 forks source link

Allow macro config to come from plugin options in babel config. #113

Closed conartist6 closed 5 years ago

conartist6 commented 5 years ago

Fixes #112

I'm missing test coverage, but I'm also not familiar with the way this test environment is set up. Some tips on how to test this well would be appreciated.

conartist6 commented 5 years ago

Never mind I figured out how to write the tests. Should be ready to go.

conartist6 commented 5 years ago

Whoops, forgot to git add a folder. Should really be ready to go.

conartist6 commented 5 years ago

I've added some more or less unrelated changes, but I've split them out into separate commits.

When trying to debug the tests I discovered that most tests assertion output was silently discarded. I also found that failing objectContaining assertions where the actual object contains babel were printing output so long that they were obscuring useful output by pushing it completely out of my 1000 line terminal scrollback.

kentcdodds commented 5 years ago

@all-contributors please add @conartist6 for code, tests, and docs

allcontributors[bot] commented 5 years ago

@kentcdodds

I've put up a pull request to add @conartist6! :tada:

kentcdodds commented 5 years ago

:tada: This PR is included in version 2.6.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

conartist6 commented 5 years ago

Awesome! Thanks! By the way, I realized that something I said was wrong. It definitely does make sense for macros to optimize for the case where it isn't being used, because one of its goals is to allow people who don't have control over their transpilation environment access to the power of transformations. That means it is a reasonable expectation that it will be added to quite a few projects that won't use it at all.