-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(config): allow macro config to come from plugin options in babel…
… config. (#113) * Allow macro config to come from plugin options in babel config. * Respond to review feedback * Ensure failing test output is readable * Ensure cosmiconfig conf is cached * Prioritize file config over plugin options config
- Loading branch information
1 parent
e0ebca7
commit 796c189
Showing
8 changed files
with
310 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
module.exports = { | ||
configurableMacro: { | ||
fileConfig: true, | ||
someConfig: true, | ||
}, | ||
} |
3 changes: 3 additions & 0 deletions
3
src/__tests__/fixtures/primitive-config/babel-plugin-macros.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
configurableMacro: 4, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import configured from './configurable.macro' | ||
|
||
// eslint-disable-next-line babel/no-unused-expressions | ||
configured`stuff` |
10 changes: 10 additions & 0 deletions
10
src/__tests__/fixtures/primitive-config/configurable.macro.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const {createMacro} = require('../../../../') | ||
|
||
const configName = 'configurableMacro' | ||
const realMacro = jest.fn() | ||
module.exports = createMacro(realMacro, {configName}) | ||
// for testing purposes only | ||
Object.assign(module.exports, { | ||
realMacro, | ||
configName, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.