babel-plugin-knifecycle
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -0,1 +1,10 @@ | ||
## [1.0.1](https://github.com/nfroidure/babel-plugin-knifecycle/compare/v1.0.0...v1.0.1) (2019-01-12) | ||
### Bug Fixes | ||
* **autoService:** Ensure the service initializer prefix are stripped ([780161b](https://github.com/nfroidure/babel-plugin-knifecycle/commit/780161b)), closes [#1](https://github.com/nfroidure/babel-plugin-knifecycle/issues/1) | ||
# 1.0.0 (2018-11-18) | ||
@@ -2,0 +11,0 @@ |
@@ -7,2 +7,5 @@ "use strict"; | ||
exports.default = knifecyclePlugin; | ||
var _util = require("knifecycle/dist/util"); | ||
const AUTO_FUNCTIONS_TRANFORMS = { | ||
@@ -22,3 +25,3 @@ autoInject: { | ||
autoFunctionPath.node.arguments.unshift(babel.types.stringLiteral(name)); | ||
autoFunctionPath.node.arguments.unshift(babel.types.stringLiteral((0, _util.parseName)(name))); | ||
} | ||
@@ -33,3 +36,3 @@ }, | ||
autoFunctionPath.node.arguments = [autoFunctionPath.node.arguments[0], babel.types.stringLiteral(name), babel.types.arrayExpression(injections.map(i => babel.types.stringLiteral(i))), ...autoFunctionPath.node.arguments.slice(1)]; | ||
autoFunctionPath.node.arguments = [autoFunctionPath.node.arguments[0], babel.types.stringLiteral((0, _util.parseName)(name)), babel.types.arrayExpression(injections.map(i => babel.types.stringLiteral(i))), ...autoFunctionPath.node.arguments.slice(1)]; | ||
} | ||
@@ -36,0 +39,0 @@ } |
@@ -68,2 +68,20 @@ "use strict"; | ||
}); | ||
it('should work with init prefix', () => { | ||
var example = ` | ||
import noop from 'noop'; | ||
import { autoName } from 'knifecycle'; | ||
export default autoName(initGetUser); | ||
async function initGetUser({ mysql: db, log = noop }, { userId }) { | ||
return {}; | ||
} | ||
`; | ||
const { | ||
code | ||
} = (0, _core.transform)(example, { | ||
plugins: [_.default] | ||
}); | ||
expect(code).toMatchSnapshot(); | ||
}); | ||
}); | ||
@@ -70,0 +88,0 @@ describe('autoService', () => { |
{ | ||
"name": "babel-plugin-knifecycle", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A Babel plugin to transform Knifecycle auto* functions to their raw equivalent.", | ||
"keywords": [ | ||
"knifecycle", | ||
"injestion", | ||
"injection", | ||
"dependencies", | ||
@@ -18,3 +18,4 @@ "babel-plugin" | ||
"eslint", | ||
"babel" | ||
"babel", | ||
"travis" | ||
], | ||
@@ -26,2 +27,5 @@ "data": { | ||
"dist/**/*.js" | ||
], | ||
"ignore": [ | ||
"dist" | ||
] | ||
@@ -53,19 +57,19 @@ } | ||
"devDependencies": { | ||
"@babel/cli": "^7.1.5", | ||
"@babel/core": "^7.1.6", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0", | ||
"@babel/preset-env": "^7.1.6", | ||
"@babel/cli": "^7.2.3", | ||
"@babel/core": "^7.2.2", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.2.0", | ||
"@babel/preset-env": "^7.2.3", | ||
"@babel/register": "^7.0.0", | ||
"babel-core": "^7.0.0-0", | ||
"babel-eslint": "^10.0.1", | ||
"commitizen": "^3.0.4", | ||
"commitizen": "^3.0.5", | ||
"conventional-changelog-cli": "^2.0.11", | ||
"coveralls": "^3.0.2", | ||
"cz-conventional-changelog": "^2.1.0", | ||
"eslint": "^5.9.0", | ||
"eslint-plugin-prettier": "^3.0.0", | ||
"eslint": "^5.12.0", | ||
"eslint-plugin-prettier": "^3.0.1", | ||
"jest": "^23.6.0", | ||
"metapak": "^2.0.0", | ||
"metapak-nfroidure": "^9.0.3", | ||
"prettier": "^1.14.3" | ||
"metapak-nfroidure": "9.0.4", | ||
"prettier": "^1.15.3" | ||
}, | ||
@@ -159,3 +163,6 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/nfroidure/babel-plugin-knifecycle#readme" | ||
"homepage": "https://github.com/nfroidure/babel-plugin-knifecycle#readme", | ||
"dependencies": { | ||
"knifecycle": "^5.0.4" | ||
} | ||
} |
@@ -10,2 +10,3 @@ [//]: # ( ) | ||
[![Build status](https://secure.travis-ci.org/nfroidure/babel-plugin-knifecycle.svg)](https://travis-ci.org/nfroidure/babel-plugin-knifecycle) | ||
[![Coverage Status](https://coveralls.io/repos/nfroidure/babel-plugin-knifecycle/badge.svg?branch=master)](https://coveralls.io/r/nfroidure/babel-plugin-knifecycle?branch=master) | ||
@@ -12,0 +13,0 @@ [![NPM version](https://badge.fury.io/js/babel-plugin-knifecycle.svg)](https://npmjs.org/package/babel-plugin-knifecycle) |
18714
312
31
1
+ Addedknifecycle@^5.0.4
+ Addeddebug@4.3.5(transitive)
+ Addedknifecycle@5.3.0(transitive)
+ Addedms@2.1.2(transitive)
+ Addedyerror@4.0.1(transitive)