From 1bfbfdffc9abca3441dd29e356d7476e288734ce Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Fri, 8 Sep 2017 01:18:54 -0600 Subject: [PATCH] feat: improve macro --- package.json | 4 ++-- src/macro.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 3b420fb..f689c4c 100644 --- a/package.json +++ b/package.json @@ -22,15 +22,15 @@ "license": "MIT", "dependencies": { "babel-core": "^6.26.0", + "babel-macros": "^1.0.0", "babel-register": "^6.26.0", "babylon": "^6.18.0", "require-from-string": "^1.2.1" }, "devDependencies": { "ast-pretty-print": "^2.0.0", - "babel-macros": "^0.5.2", "babel-plugin-tester": "^4.0.0", - "kcd-scripts": "^0.2.3" + "kcd-scripts": "^0.4.0" }, "eslintConfig": { "extends": "./node_modules/kcd-scripts/eslint.js" diff --git a/src/macro.js b/src/macro.js index 90b46a3..4886d0c 100644 --- a/src/macro.js +++ b/src/macro.js @@ -1,9 +1,9 @@ /* istanbul ignore next */ // const printAST = require('ast-pretty-print') +const {createMacro} = require('babel-macros') const getReplacement = require('./get-replacement') -// this implements the babel-macros v0.4.0 API -module.exports = prevalMacros +module.exports = createMacro(prevalMacros) function prevalMacros({references, state}) { references.default.forEach(referencePath => {