babel-plugin-knifecycle
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -0,1 +1,5 @@ | ||
# [3.0.0](https://github.com/nfroidure/babel-plugin-knifecycle/compare/v2.0.0...v3.0.0) (2020-09-14) | ||
# [2.0.0](https://github.com/nfroidure/babel-plugin-knifecycle/compare/v1.2.0...v2.0.0) (2020-05-17) | ||
@@ -2,0 +6,0 @@ |
@@ -30,2 +30,34 @@ "use strict"; | ||
}); | ||
it('should work with object rest spreads', () => { | ||
var example = ` | ||
import noop from 'noop'; | ||
import { autoInject } from 'knifecycle'; | ||
export default autoInject(getUser); | ||
async function getUser({ mysql: db, log = noop, ...services }, { userId }) { | ||
return {}; | ||
} | ||
`; | ||
const { | ||
code | ||
} = (0, _core.transform)(example, { | ||
plugins: [_.default] | ||
}); | ||
expect(code).toMatchInlineSnapshot(` | ||
"import noop from 'noop'; | ||
import { inject as _inject } from 'knifecycle'; | ||
export default _inject([\\"mysql\\", \\"?log\\"], getUser); | ||
async function getUser({ | ||
mysql: db, | ||
log = noop, | ||
...services | ||
}, { | ||
userId | ||
}) { | ||
return {}; | ||
}" | ||
`); | ||
}); | ||
it('should work with no injection', () => { | ||
@@ -32,0 +64,0 @@ var example = ` |
{ | ||
"name": "babel-plugin-knifecycle", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "A Babel plugin to transform Knifecycle auto* functions to their raw equivalent.", | ||
@@ -58,20 +58,20 @@ "keywords": [ | ||
"dependencies": { | ||
"knifecycle": "^9.1.1" | ||
"knifecycle": "^10.0.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.8.4", | ||
"@babel/core": "^7.9.6", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.9.6", | ||
"@babel/preset-env": "^7.9.6", | ||
"@babel/register": "^7.9.0", | ||
"@babel/cli": "^7.10.5", | ||
"@babel/core": "^7.11.1", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.11.0", | ||
"@babel/preset-env": "^7.11.0", | ||
"@babel/register": "^7.10.5", | ||
"babel-eslint": "^10.1.0", | ||
"commitizen": "^4.1.2", | ||
"conventional-changelog-cli": "^2.0.34", | ||
"conventional-changelog-cli": "^2.1.0", | ||
"coveralls": "^3.1.0", | ||
"cz-conventional-changelog": "^3.2.0", | ||
"eslint": "^7.0.0", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"jest": "^26.0.1", | ||
"metapak": "^3.1.9", | ||
"metapak-nfroidure": "10.2.0", | ||
"eslint": "^7.7.0", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"jest": "^26.4.0", | ||
"metapak": "^3.1.10", | ||
"metapak-nfroidure": "10.2.5", | ||
"prettier": "^2.0.5" | ||
@@ -78,0 +78,0 @@ }, |
@@ -11,8 +11,8 @@ [//]: # ( ) | ||
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nfroidure/babel-plugin-knifecycle/blob/master/LICENSE) | ||
[![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) | ||
[![Build status](https://travis-ci.com/nfroidure/babel-plugin-knifecycle.svg?branch=master)](https://travis-ci.com/github/nfroidure/babel-plugin-knifecycle) | ||
[![Coverage Status](https://coveralls.io/repos/github/nfroidure/babel-plugin-knifecycle/badge.svg?branch=master)](https://coveralls.io/github/nfroidure/babel-plugin-knifecycle?branch=master) | ||
[![NPM version](https://badge.fury.io/js/babel-plugin-knifecycle.svg)](https://npmjs.org/package/babel-plugin-knifecycle) | ||
[![Dependency Status](https://david-dm.org/nfroidure/babel-plugin-knifecycle.svg)](https://david-dm.org/nfroidure/babel-plugin-knifecycle) | ||
[![devDependency Status](https://david-dm.org/nfroidure/babel-plugin-knifecycle/dev-status.svg)](https://david-dm.org/nfroidure/babel-plugin-knifecycle#info=devDependencies) | ||
[![Package Quality](http://npm.packagequality.com/shield/babel-plugin-knifecycle.svg)](http://packagequality.com/#?package=babel-plugin-knifecycle) | ||
[![Package Quality](https://npm.packagequality.com/shield/babel-plugin-knifecycle.svg)](https://packagequality.com/#?package=babel-plugin-knifecycle) | ||
@@ -19,0 +19,0 @@ |
@@ -23,2 +23,32 @@ // src/__tests__/index-test.js | ||
it('should work with object rest spreads', () => { | ||
var example = ` | ||
import noop from 'noop'; | ||
import { autoInject } from 'knifecycle'; | ||
export default autoInject(getUser); | ||
async function getUser({ mysql: db, log = noop, ...services }, { userId }) { | ||
return {}; | ||
} | ||
`; | ||
const { code } = transform(example, { plugins: [plugin] }); | ||
expect(code).toMatchInlineSnapshot(` | ||
"import noop from 'noop'; | ||
import { inject as _inject } from 'knifecycle'; | ||
export default _inject([\\"mysql\\", \\"?log\\"], getUser); | ||
async function getUser({ | ||
mysql: db, | ||
log = noop, | ||
...services | ||
}, { | ||
userId | ||
}) { | ||
return {}; | ||
}" | ||
`); | ||
}); | ||
it('should work with no injection', () => { | ||
@@ -25,0 +55,0 @@ var example = ` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
115413
1388
+ Addedknifecycle@10.0.3(transitive)
- Removedknifecycle@9.1.1(transitive)
Updatedknifecycle@^10.0.1