diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-28 00:38:50 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-28 00:40:43 +0200 |
commit | 7fff4499fd915bcea3fa93b1aa8b35f4fe7a6027 (patch) | |
tree | 6de9a1aebd150a23b7f8c273ec657a5d0a18fe3e /node_modules/babel-plugin-espower | |
parent | 963b7a41feb29cc4be090a2446bdfe0c1f1bcd81 (diff) | |
download | wallet-core-7fff4499fd915bcea3fa93b1aa8b35f4fe7a6027.tar.xz |
add linting (and some initial fixes)
Diffstat (limited to 'node_modules/babel-plugin-espower')
15 files changed, 1453 insertions, 0 deletions
diff --git a/node_modules/babel-plugin-espower/CHANGELOG.md b/node_modules/babel-plugin-espower/CHANGELOG.md new file mode 100644 index 000000000..b0891892b --- /dev/null +++ b/node_modules/babel-plugin-espower/CHANGELOG.md @@ -0,0 +1,212 @@ +### [2.3.2](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v2.3.2) (2017-01-13) + + +#### Bug Fixes + +* [Value recorder should clean up captured values at the end of assertion expression](https://github.com/power-assert-js/babel-plugin-espower/pull/19) + + +### [2.3.1](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v2.3.1) (2016-06-21) + + +#### Bug Fixes + +* stop capturing SequenceExpression itself since SequenceExpressions are not enclosed in parentheses in some cases ([bf64b96a](https://github.com/power-assert-js/babel-plugin-espower/commit/bf64b96a139e0872590d39f2e5f4df02a2472eb3)) + + +## [2.3.0](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v2.3.0) (2016-06-21) + + +#### Features + +* [Support SequenceExpression (i.e., comma operator)](https://github.com/power-assert-js/babel-plugin-espower/pull/17) + + +## [2.2.0](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v2.2.0) (2016-05-31) + + +#### Features + +* [`embedAst` option to embed assertion's AST and tokens to make runtime side parser unnecessary](https://github.com/power-assert-js/babel-plugin-espower/pull/13) +* [Make babel-plugin-espower customizable via plugin options](https://github.com/power-assert-js/babel-plugin-espower/pull/16) + + +### [2.1.2](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v2.1.2) (2016-02-14) + + +#### Bug Fixes + +* do not include comments in one-line format assertion ([c5af6c55](https://github.com/power-assert-js/babel-plugin-espower/commit/c5af6c558f2caad8e30c1494c218d7ad3203eb16)) + + +### [2.1.1](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v2.1.1) (2016-01-26) + + +### Performance Improvements + +* [Use prototype based Recorder for performance boost](https://github.com/power-assert-js/babel-plugin-espower/pull/12) (by [@jamestalmage](https://github.com/jamestalmage)) + + +## [2.1.0](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v2.1.0) (2016-01-10) + + +#### Features + +* [Embed value capturing helper into transpiled code](https://github.com/power-assert-js/babel-plugin-espower/pull/11) + + +## [2.0.0](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v2.0.0) (2015-11-13) + + +#### Features + +* [Babel 6.x support](https://github.com/power-assert-js/babel-plugin-espower/pull/5) + + +#### Breaking Changes + +Babel6 is incompatible with Babel5. For Babel 5 or lower, you need to use the 1.x release of babel-plugin-espower. + +``` +$ npm install --save-dev babel-plugin-espower@1.1.0 +``` + + +### [1.1.1](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v1.1.1) (2016-06-22) + + +#### Bug Fixes + +* pin espower dependency to >=1.0.0 <1.3.0 since there was a little breaking change ([f9a7d781](https://github.com/power-assert-js/babel-plugin-espower/commit/f9a7d78167d92ca7f86c0923478f1a7ab6e71f5d)) + + +## [1.1.0](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v1.1.0) (2015-11-06) + + +#### Features + +* [async/await support](https://github.com/power-assert-js/babel-plugin-espower/pull/7) (by [@jamestalmage](https://github.com/jamestalmage)) + + +### [1.0.1](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v1.0.1) (2015-11-07) + + +#### Bug Fixes + +* pin espower dependency to >=1.0.0 <=1.2.0 since there was a little breaking change ([6420b3dc](https://github.com/power-assert-js/babel-plugin-espower/commit/6420b3dc49a00f731eebbee695c90be8f13d5e73), closes [#8](https://github.com/power-assert-js/babel-plugin-espower/issues/8)) + + +## [1.0.0](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v1.0.0) (2015-05-25) + + +#### Features + +* use `process.cwd()` for `sourceRoot` option value ([71016432](https://github.com/power-assert-js/babel-plugin-espower/commit/71016432565568e2b7325b11cf07ae90d029c45b)) +* update espower to 1.0.0 ([337cdfd2](https://github.com/power-assert-js/babel-plugin-espower/commit/337cdfd26a2868addd1aabdd7787733a79eab11a)) + + +### [0.4.1](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v0.4.1) (2015-05-21) + + +#### Bug Fixes + +* eliminate remaining babel-core dependencies ([7735ed5f](https://github.com/power-assert-js/babel-plugin-espower/commit/7735ed5f8e6c38660c0328404057c6497370ebd7)) + + +## [0.4.0](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v0.4.0) (2015-05-21) + + +#### Bug Fixes + +* avoid visiting replacement node ([c4da8f8f](https://github.com/power-assert-js/babel-plugin-espower/commit/c4da8f8f8d3a56ccfe64812ef4f2c839ebec892c)) + + +#### Features + +* use new 5.2.0+ API with shared babel-core. No more peerDependencies. ([39eb684b](https://github.com/power-assert-js/babel-plugin-espower/commit/39eb684b733729a0b0d6752bd52a008c5b08159b)) + + +#### Breaking Changes + +* function returned by `babel-plugin-espower/create` takes babel instance as a first argument. + +If you are customizing babel-plugin-espower using `babel-plugin-espower/create`, you may have to migrate. + +To migrate, change your code from the following: + +``` +var babel = require('babel-core'); +var createEspowerPlugin = require('babel-plugin-espower/create'); +var transformed = babel.transform(jsCode, { + plugins: [ + createEspowerPlugin({ + patterns: [ + 'assert.isNull(object, [message])', + 'assert.same(actual, expected, [message])', + 'assert.near(actual, expected, delta, [message])' + ] + }) + ] +}); +``` + +To: + +``` +var babel = require('babel-core'); +var createEspowerPlugin = require('babel-plugin-espower/create'); +var transformed = babel.transform(jsCode, { + plugins: [ + createEspowerPlugin(babel, { + patterns: [ + 'assert.isNull(object, [message])', + 'assert.same(actual, expected, [message])', + 'assert.near(actual, expected, delta, [message])' + ] + }) + ] +}); +``` + +([39eb684b](https://github.com/power-assert-js/babel-plugin-espower/commit/39eb684b733729a0b0d6752bd52a008c5b08159b)) + + +### [0.3.1](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v0.3.1) (2015-05-18) + + +#### Bug Fixes + +* use version range since babel-core 5.4.3 does not work. ([3b586fa9](https://github.com/power-assert-js/babel-plugin-espower/commit/3b586fa9c20650871f7420c70d6e9c189be7412c) + + +## [0.3.0](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v0.3.0) (2015-05-01) + + +#### Bug Fixes + +* deal with babel 5.2.x internal changes. ([17698583](https://github.com/power-assert-js/babel-plugin-espower/commit/17698583a871e59c0af660cd888c2e98f85aea38), closes [#3](https://github.com/power-assert-js/babel-plugin-espower/issues/3)) + + +### [0.2.2](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v0.2.2) (2015-04-24) + + +* update escallmatch to 1.3.2 ([941c75c2](https://github.com/power-assert-js/babel-plugin-espower/commit/941c75c29504284fee7fa916752e4096fd65011f)) + + +### [0.2.1](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v0.2.1) (2015-04-21) + + +* down peerDependencies to minimum version to make dedupe friendly ([093ce106](https://github.com/power-assert-js/babel-plugin-espower/commit/093ce1068a11ac1550830c5e541f93a3271623af)) + + +## [0.2.0](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v0.2.0) (2015-04-19) + + +* export create.js to customize assertion patterns ([092c3464](https://github.com/power-assert-js/babel-plugin-espower/commit/092c3464ae37ab27a91cd01e3dd8fa2062a08dfe)) +* docs about customizing assertion patterns via Babel API ([f72a9b1](https://github.com/power-assert-js/babel-plugin-espower/commit/f72a9b19b68d3d12287ba8b33878c7ff63049175)) + + +## [0.1.0](https://github.com/power-assert-js/babel-plugin-espower/releases/tag/v0.1.0) (2015-04-18) + + +The first release. diff --git a/node_modules/babel-plugin-espower/LICENSE b/node_modules/babel-plugin-espower/LICENSE new file mode 100644 index 000000000..4606ba496 --- /dev/null +++ b/node_modules/babel-plugin-espower/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017 Takuto Wada, https://github.com/power-assert-js/babel-plugin-espower + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/babel-plugin-espower/README.md b/node_modules/babel-plugin-espower/README.md new file mode 100644 index 000000000..df61bda66 --- /dev/null +++ b/node_modules/babel-plugin-espower/README.md @@ -0,0 +1,449 @@ +babel-plugin-espower +================================ + +Babel plugin for power-assert. + +[![Build Status][travis-image]][travis-url] +[![NPM version][npm-image]][npm-url] +[![Dependency Status][depstat-image]][depstat-url] +[![License][license-image]][license-url] + + +DESCRIPTION +--------------------------------------- + +`babel-plugin-espower` is a [Babel](https://babeljs.io/) plugin for [power-assert](https://github.com/power-assert-js/power-assert). + +`power-assert` provides descriptive assertion messages for your tests, like this. + +``` + 1) ES6 demo Destructuring and TemplateLiteral: + + AssertionError: # test/demo_test.js:7 + + assert(`${ alice.name } and ${ bob.name }` === `bob and alice`) + | | | | | | | + | | | | | | "bob and alice" + | | | | "bob" false + | | "alice" Object{name:"bob"} + | Object{name:"alice"} + "alice and bob" + + --- [string] `bob and alice` + +++ [string] `${ alice.name } and ${ bob.name }` + @@ -1,13 +1,13 @@ + -bob and alice + +alice and bob +``` + +Pull-requests, issue reports and patches are always welcomed. See [power-assert](https://github.com/power-assert-js/power-assert) project for more documentation. + + +FYI: There's a [babel preset for all power-assert plugins](https://github.com/power-assert-js/babel-preset-power-assert) + + +INSTALL +--------------------------------------- + +``` +$ npm install --save-dev babel-plugin-espower +``` + + +CAUTION +--------------------------------------- + +Babel6 is incompatible with Babel5. For Babel 5 or lower, you need to use the 1.x release of babel-plugin-espower. + +``` +$ npm install --save-dev babel-plugin-espower@1.1.1 +``` + + +HOW TO USE +--------------------------------------- + + +### via [.babelrc](https://babeljs.io/docs/usage/babelrc/) + +```javascript +{ + "presets": [ + ... + ], + "plugins": [ + "babel-plugin-espower" + ] +} +``` + +``` +$ babel /path/to/test/some_test.js > /path/to/build/some_test.js +``` + +For example, with `babel-register` module and `.babelrc` above, you can run mocha without code generation steps. + +``` +$ $(npm bin)/mocha --require babel-register test/some_test.js +``` + + +### via [Babel API](https://babeljs.io/docs/usage/api/) + +```javascript +var babel = require('babel-core'); +var jsCode = fs.readFileSync('/path/to/test/some_test.js'); +var transformed = babel.transform(jsCode, { + presets: [...], + plugins: ['babel-plugin-espower'] +}); +console.log(transformed.code); +``` + + +### via [Babel Require Hook](https://babeljs.io/docs/usage/require/) + +```javascript +require('babel-register')({ + presets: [...], + plugins: ['babel-plugin-espower'] +}); +``` + +For example, with `babel_hook.js` above, you can run mocha without code generation steps. + +``` +$ $(npm bin)/mocha --require ./babel_hook /path/to/test/demo_test.js +``` + + +### with [babelify](https://github.com/babel/babelify) + +```javascript +var fs = require('fs'); +var browserify = require('browserify'); +var babelify = require('babelify'); +var glob = require('glob'), +browserify({ entries: glob.sync('./test/*_test.js'), debug: true }) + .transform(babelify.configure({ + presets: [...], + plugins: ['babel-plugin-espower'] + })) + .bundle() + .on('error', function (err) { console.log('Error : ' + err.message); }) + .pipe(fs.createWriteStream('all_test.js')); +``` + +``` +$ $(npm bin)/browserify -d -e ./test/*_test.js -t [ babelify --presets ... --plugins babel-plugin-espower ] +``` + + +### with [babelify](https://github.com/babel/babelify) and [gulp](http://gulpjs.com/) + +```javascript +var source = require('vinyl-source-stream'); +var browserify = require('browserify'); +var glob = require('glob'), +gulp.task('build_test', function() { + var files = glob.sync('./test/*_test.js'); + var b = browserify({entries: files, debug: true}); + b.transform(babelify.configure({ + presets: [...], + plugins: ['babel-plugin-espower'] + })); + return b.bundle() + .pipe(source('all_test.js')) + .pipe(gulp.dest('./build')); +}); +``` + + +### with [babelify](https://github.com/babel/babelify) and [Karma](https://karma-runner.github.io) + +```javascript +module.exports = function(config) { + config.set({ + frameworks: ['mocha', 'browserify'], + files: [ + "test/**/*.js" + ], + preprocessors: { + "test/**/*.js": "browserify" + }, + browserify: { + debug: true, + transform: [ + [ + 'babelify', { + presets: [...], + plugins: ['babel-plugin-espower'] + } + ] + ] + }, + // ... +``` + + +EXAMPLE +--------------------------------------- + + +For given test file `test/demo_test.js` below, + +```javascript +import assert from 'power-assert'; + +describe('ES6 demo', () => { + + it('Destructuring and TemplateLiteral', () => { + let [alice, bob] = [ { name: 'alice' }, { name: 'bob' } ]; + assert(`${alice.name} and ${bob.name}` === `bob and alice`); + }); + + it('ArrowFunctionExpression and SpreadElement', () => { + let seven = 7, ary = [4, 5]; + assert(seven === ((v, i) => v + i)(...[...ary])); + }); + + it('Enhanced Object Literals', () => { + let name = 'bobby'; + assert.deepEqual({ + name, + [ `${name}'s greet` ]: `Hello, I'm ${name}` + }, null); + }); + +}); +``` + +prepare `babel_hook.js` to transform tests. + +```javascript +{ + "presets": [ + ... + ], + "plugins": [ + "babel-plugin-espower" + ] +} +``` + +Run `mocha` with `--require babel-register` option. You will see the power-assert output appears. + +``` +$ $(npm bin)/mocha --require babel-register test/demo_test.js + + ES6 demo + 1) Destructuring and TemplateLiteral + 2) ArrowFunctionExpression and SpreadElement + 3) Enhanced Object Literals + + + 0 passing + 3 failing + + 1) ES6 demo Destructuring and TemplateLiteral: + + AssertionError: # test/demo_test.js:7 + + assert(`${ alice.name } and ${ bob.name }` === `bob and alice`) + | | | | | | | + | | | | | | "bob and alice" + | | | | "bob" false + | | "alice" Object{name:"bob"} + | Object{name:"alice"} + "alice and bob" + + --- [string] `bob and alice` + +++ [string] `${ alice.name } and ${ bob.name }` + @@ -1,13 +1,13 @@ + -bob and alice + +alice and bob + + at Context.<anonymous> (test/demo_test.js:19:28) + + 2) ES6 demo ArrowFunctionExpression and SpreadElement: + + AssertionError: # test/demo_test.js:12 + + assert(seven === ((v, i) => v + i)(...[...ary])) + | | | | | + | | | | [4,5] + | | 9 [4,5] + 7 false + + [number] ((v, i) => v + i)(...[...ary]) + => 9 + [number] seven + => 7 + + at Context.<anonymous> (test/demo_test.js:29:28) + + 3) ES6 demo Enhanced Object Literals: + AssertionError: # test/demo_test.js:17 + + assert.deepEqual({name,[`${ name }'s greet`]: `Hello, I'm ${ name }`}, null) + | | | | | + | | | | "bobby" + | | "bobby" "Hello, I'm bobby" + | "bobby's greet" + Object{name:"bobby","bobby's greet":"Hello, I'm bobby"} + + at Context.<anonymous> (test/demo_test.js:40:29) +``` + + +CUSTOMIZE +--------------------------------------- + +### by plugin options + +You can customize configs such as assertion patterns via [.babelrc](https://babeljs.io/docs/usage/babelrc/) + +```javascript +{ + "presets": [ + ... + ], + "plugins": [ + ["babel-plugin-espower", { + "embedAst": true, + "patterns": [ + "assert.isNull(object, [message])", + "assert.same(actual, expected, [message])", + "assert.near(actual, expected, delta, [message])" + ] + }] + ] +} +``` + +### by API + +#### var plugin = createEspowerPlugin(babel, [options]) + +You can customize configs such as assertion patterns via [Babel API](https://babeljs.io/docs/usage/api/), + +```javascript +var babel = require('babel-core'); +var createEspowerPlugin = require('babel-plugin-espower/create'); +var jsCode = fs.readFileSync('/path/to/test/some_test.js'); +var transformed = babel.transform(jsCode, { + presets: [...], + plugins: [ + createEspowerPlugin(babel, { + embedAst: true, + patterns: [ + 'assert.isNull(object, [message])', + 'assert.same(actual, expected, [message])', + 'assert.near(actual, expected, delta, [message])' + ] + }) + ] +}); +console.log(transformed.code); +``` + +or via [Require Hook](https://babeljs.io/docs/usage/require/). + +```javascript +var createEspowerPlugin = require('babel-plugin-espower/create'); +require('babel-register')({ + presets: [...], + plugins: [ + createEspowerPlugin(babel, { + embedAst: true, + patterns: [ + 'assert.isNull(object, [message])', + 'assert.same(actual, expected, [message])', + 'assert.near(actual, expected, delta, [message])' + ] + }) + ] +}); +``` + +#### options + +| type | default value | +|:---------|:--------------------| +| `object` | objects shown below | + +Configuration options for `babel-plugin-espower`. If not passed, default options will be used (return value of `defaultOptions()` with default `embedAst`, `visitorKeys`, `astWhiteList`, `path`, `sourceRoot` and `sourceMap`. `visitorKeys` is value of `babel.types.VISITOR_KEYS`. `astWhiteList` is value of `babel.types.BUILDER_KEYS`. `path` is filename passed to babel. `sourceRoot` is be return value of `process.cwd()`, `sourceMap` is babel's internal SourceMap object). + +```javascript +{ + patterns: [ + 'assert(value, [message])', + 'assert.ok(value, [message])', + 'assert.equal(actual, expected, [message])', + 'assert.notEqual(actual, expected, [message])', + 'assert.strictEqual(actual, expected, [message])', + 'assert.notStrictEqual(actual, expected, [message])', + 'assert.deepEqual(actual, expected, [message])', + 'assert.notDeepEqual(actual, expected, [message])', + 'assert.deepStrictEqual(actual, expected, [message])', + 'assert.notDeepStrictEqual(actual, expected, [message])' + ], + embedAst: false, + visitorKeys: babel.types.VISITOR_KEYS, + astWhiteList: babel.types.BUILDER_KEYS, + sourceRoot: process.cwd(), + path: file.opts.filename, + sourceMap: file.opts.inputSourceMap +} +``` + +#### options.embedAst + +If you want to use non-ECMASCript-standard features such as JSX tags in your `assert()`, you should set `embedAst` option to `true`. + +```js +assert(shallow(<Foo />).is('.foo')); +``` + + +CHANGELOG +--------------------------------------- +See [CHANGELOG](https://github.com/power-assert-js/babel-plugin-espower/blob/master/CHANGELOG.md) + + +AUTHOR +--------------------------------------- +* [Takuto Wada](https://github.com/twada) + + +CONTRIBUTORS +--------------------------------------- +* [James Talmage (jamestalmage)](https://github.com/jamestalmage) + + +OUR SUPPORT POLICY +--------------------------------------- + +We support Node under maintenance. In other words, we stop supporting old Node version when [their maintenance ends](https://github.com/nodejs/LTS). + +This means that any other environment is not supported. + +NOTE: If babel-plugin-espower works in any of the unsupported environments, it is purely coincidental and has no bearing on future compatibility. Use at your own risk. + + +LICENSE +--------------------------------------- +Licensed under the [MIT](https://github.com/power-assert-js/babel-plugin-espower/blob/master/LICENSE) license. + + +[npm-url]: https://npmjs.org/package/babel-plugin-espower +[npm-image]: https://badge.fury.io/js/babel-plugin-espower.svg + +[travis-url]: https://travis-ci.org/power-assert-js/babel-plugin-espower +[travis-image]: https://secure.travis-ci.org/power-assert-js/babel-plugin-espower.svg?branch=master + +[depstat-url]: https://gemnasium.com/power-assert-js/babel-plugin-espower +[depstat-image]: https://gemnasium.com/power-assert-js/babel-plugin-espower.svg + +[license-url]: https://github.com/power-assert-js/babel-plugin-espower/blob/master/LICENSE +[license-image]: https://img.shields.io/badge/license-MIT-brightgreen.svg diff --git a/node_modules/babel-plugin-espower/create.js b/node_modules/babel-plugin-espower/create.js new file mode 100644 index 000000000..eaa16851a --- /dev/null +++ b/node_modules/babel-plugin-espower/create.js @@ -0,0 +1,7 @@ +'use strict'; + +var createEspowerVisitor = require('./lib/create-espower-visitor'); + +module.exports = function createEspowerPlugin (babel, options) { + return createEspowerVisitor(babel, options); +}; diff --git a/node_modules/babel-plugin-espower/index.js b/node_modules/babel-plugin-espower/index.js new file mode 100644 index 000000000..72e659daf --- /dev/null +++ b/node_modules/babel-plugin-espower/index.js @@ -0,0 +1,17 @@ +/** + * babel-plugin-espower: + * Babel plugin for power-assert + * + * https://github.com/power-assert-js/babel-plugin-espower + * + * Copyright (c) 2015-2017 Takuto Wada + * Licensed under the MIT license. + * https://github.com/power-assert-js/babel-plugin-espower/blob/master/LICENSE + */ +'use strict'; + +var createEspowerPlugin = require('./create'); + +module.exports = function (babel) { + return createEspowerPlugin(babel); +}; diff --git a/node_modules/babel-plugin-espower/lib/babel-assertion-visitor.js b/node_modules/babel-plugin-espower/lib/babel-assertion-visitor.js new file mode 100644 index 000000000..6135f5766 --- /dev/null +++ b/node_modules/babel-plugin-espower/lib/babel-assertion-visitor.js @@ -0,0 +1,341 @@ +'use strict'; + +var EspowerLocationDetector = require('espower-location-detector'); +var estraverse = require('estraverse'); +var cloneWithWhitelist = require('espurify').cloneWithWhitelist; +var babelgen = require('babel-generator'); +var define = require('./define-properties'); +var toBeCaptured = require('./to-be-captured'); +var toBeSkipped = require('./to-be-skipped'); +var fs = require('fs'); +var helperCode = '(' + + fs.readFileSync(require.resolve('./power-assert-recorder.js'), 'utf8') + .split('\n') + .slice(2) + .join('\n') + + ')()'; + +function BabelAssertionVisitor (babel, matcher, options) { + this.babel = babel; + this.matcher = matcher; + this.options = options; + this.currentArgumentNodePath = null; + this.argumentModified = false; + this.valueRecorder = null; + this.locationDetector = new EspowerLocationDetector(this.options); + var babelTemplate = babel.template; + this.helperTemplate = babelTemplate(helperCode); + var whiteListWithRange = Object.keys(options.astWhiteList).reduce(function (acc, key) { + acc[key] = options.astWhiteList[key].concat(['range']); + return acc; + }, {}); + this.purifyAst = cloneWithWhitelist(whiteListWithRange); +} + +BabelAssertionVisitor.prototype.enter = function (nodePath) { + this.assertionNodePath = nodePath; + var currentNode = nodePath.node; + this.location = this.locationDetector.locationFor(currentNode); + var enclosingFunc = this.findEnclosingFunction(nodePath); + this.withinGenerator = enclosingFunc && enclosingFunc.generator; + this.withinAsync = enclosingFunc && enclosingFunc.async; + this.generateCanonicalCode(nodePath, currentNode); // should be next to enclosingFunc detection + // store original espath for each node + var visitorKeys = this.options.visitorKeys; + estraverse.traverse(currentNode, { + keys: visitorKeys, + enter: function (node) { + if (this.path()) { + var espath = this.path().join('/'); + define(node, { _espowerEspath: espath }); + } + } + }); +}; + +BabelAssertionVisitor.prototype.enterArgument = function (nodePath) { + var currentNode = nodePath.node; + var parentNode = nodePath.parent; + var argMatchResult = this.matcher.matchArgument(currentNode, parentNode); + if (!argMatchResult) { + return; + } + if (argMatchResult.name === 'message' && argMatchResult.kind === 'optional') { + // skip optional message argument + return; + } + this.verifyNotInstrumented(currentNode); + // create recorder per argument + this.valueRecorder = this.createNewRecorder(nodePath); + // entering target argument + this.currentArgumentNodePath = nodePath; +}; + +BabelAssertionVisitor.prototype.leave = function (nodePath) { + var currentNode = nodePath.node; + var visitorKeys = this.options.visitorKeys; + estraverse.traverse(currentNode, { + keys: visitorKeys, + enter: function (node) { + delete node._espowerEspath; + } + }); +}; + +BabelAssertionVisitor.prototype.leaveArgument = function (resultTree) { + try { + return this.argumentModified ? this.captureArgument(resultTree) : resultTree; + } finally { + this.currentArgumentNodePath = null; + this.argumentModified = false; + this.valueRecorder = null; + } +}; + +BabelAssertionVisitor.prototype.captureNode = function (nodePath) { + var currentNode = nodePath.node; + var t = this.babel.types; + this.argumentModified = true; + var relativeEsPath = currentNode._espowerEspath; + var newNode = t.callExpression( + t.memberExpression(this.valueRecorder, t.identifier('_capt')), + [ + currentNode, + t.valueToNode(relativeEsPath) + ]); + define(newNode, { _generatedByEspower: true }); + return newNode; +}; + +BabelAssertionVisitor.prototype.toBeSkipped = function (nodePath) { + return toBeSkipped(this.babel.types, nodePath); +}; + +BabelAssertionVisitor.prototype.toBeCaptured = function (nodePath) { + return toBeCaptured(this.babel.types, nodePath); +}; + +BabelAssertionVisitor.prototype.isArgumentModified = function () { + return !!this.argumentModified; +}; + +BabelAssertionVisitor.prototype.isCapturingArgument = function () { + return !!this.currentArgumentNodePath; +}; + +BabelAssertionVisitor.prototype.isLeavingAssertion = function (nodePath) { + return this.assertionNodePath === nodePath; +}; + +BabelAssertionVisitor.prototype.isLeavingArgument = function (nodePath) { + return this.currentArgumentNodePath === nodePath; +}; + +BabelAssertionVisitor.prototype.isGeneratedNode = function (nodePath) { + var currentNode = nodePath.node; + return !!currentNode._generatedByEspower; +}; + +// internal + +BabelAssertionVisitor.prototype.generateCanonicalCode = function (nodePath, node) { + var file = nodePath.hub.file; + var gen = new babelgen.CodeGenerator(node, { concise: true, comments: false }); + var output = gen.generate(); + this.canonicalCode = output.code; + if (!this.options.embedAst) { + return; + } + var astAndTokens = this.parseCanonicalCode(file, this.canonicalCode); + this.ast = JSON.stringify(this.purifyAst(astAndTokens.expression)); + this.tokens = JSON.stringify(astAndTokens.tokens); + var _this = this; + var types = this.babel.types; + this.visitorKeys = this.getOrCreateNode(nodePath, 'powerAssertVisitorKeys', function () { + return types.stringLiteral(JSON.stringify(_this.options.visitorKeys)); + }); +}; + +BabelAssertionVisitor.prototype.parseCanonicalCode = function (file, code) { + var ast, tokens; + + function doParse(wrapper) { + var content = wrapper ? wrapper(code) : code; + var output = file.parse(content); + if (wrapper) { + ast = output.program.body[0].body; + tokens = output.tokens.slice(6, -2); + } else { + ast = output.program; + tokens = output.tokens.slice(0, -1); + } + } + + if (this.withinAsync) { + doParse(wrappedInAsync); + } else if (this.withinGenerator) { + doParse(wrappedInGenerator); + } else { + doParse(); + } + + var exp = ast.body[0].expression; + var columnOffset = exp.loc.start.column; + var offsetTree = estraverse.replace(exp, { + keys: this.options.visitorKeys, + enter: function (eachNode) { + eachNode.range = [ + eachNode.loc.start.column - columnOffset, + eachNode.loc.end.column - columnOffset + ]; + delete eachNode.loc; + return eachNode; + } + }); + + return { + tokens: offsetAndSlimDownTokens(tokens), + expression: offsetTree + }; +}; + +function wrappedInGenerator (jsCode) { + return 'function *wrapper() { ' + jsCode + ' }'; +} + +function wrappedInAsync (jsCode) { + return 'async function wrapper() { ' + jsCode + ' }'; +} + +function offsetAndSlimDownTokens (tokens) { + var i, token, newToken, result = []; + var columnOffset; + for(i = 0; i < tokens.length; i += 1) { + token = tokens[i]; + if (i === 0) { + columnOffset = token.loc.start.column; + } + newToken = { + type: { + label: token.type.label + } + }; + if (typeof token.value !== 'undefined') { + newToken.value = token.value; + } + newToken.range = [ + token.loc.start.column - columnOffset, + token.loc.end.column - columnOffset + ]; + result.push(newToken); + } + return result; +} + +BabelAssertionVisitor.prototype.captureArgument = function (node) { + var t = this.babel.types; + var props = { + content: this.canonicalCode, + filepath: this.location.source, + line: this.location.line + }; + if (this.withinAsync) { + props.async = true; + } + if (this.withinGenerator) { + props.generator = true; + } + if (this.ast) { + props.ast = this.ast; + } + if (this.tokens) { + props.tokens = this.tokens; + } + var propsNode = t.valueToNode(props); + if (this.visitorKeys) { + var visitorKeysNode = t.objectProperty(t.identifier('visitorKeys'), this.visitorKeys); + propsNode.properties.push(visitorKeysNode); + } + var newNode = t.callExpression( + t.memberExpression(this.valueRecorder, t.identifier('_expr')), + [ + node, + propsNode + ] + ); + define(newNode, { _generatedByEspower: true }); + return newNode; +}; + +BabelAssertionVisitor.prototype.verifyNotInstrumented = function (currentNode) { + var types = this.babel.types; + if (!types.isCallExpression(currentNode)) { + return; + } + if (!types.isMemberExpression(currentNode.callee)) { + return; + } + var prop = currentNode.callee.property; + if (types.isIdentifier(prop) && prop.name === '_expr') { + var errorMessage = '[espower] Attempted to transform AST twice.'; + if (this.options.path) { + errorMessage += ' path: ' + this.options.path; + } + throw new Error(errorMessage); + } +}; + +BabelAssertionVisitor.prototype.createNewRecorder = function (nodePath) { + var _this = this; + var types = this.babel.types; + var helperNameNode = this.getOrCreateNode(nodePath, 'powerAssertRecorder', function () { + return types.toExpression(_this.helperTemplate()); + }); + var recorderIdent = nodePath.scope.generateUidIdentifier('rec'); + define(recorderIdent, { _generatedByEspower: true }); + var init = types.newExpression(helperNameNode, []); + define(init, { _generatedByEspower: true }); + nodePath.scope.push({ id: recorderIdent, init: init }); + return recorderIdent; +}; + +BabelAssertionVisitor.prototype.getOrCreateNode = function (nodePath, keyName, generateNode) { + var file = nodePath.hub.file; + var ident = file.get(keyName); + if (!ident) { + ident = this.createNode(nodePath, keyName, generateNode); + // helperNameNode = file.addImport('power-assert-runtime/recorder', 'default', 'recorder'); + } + return ident; +}; + +BabelAssertionVisitor.prototype.createNode = function (nodePath, keyName, generateNode) { + var file = nodePath.hub.file; + var programScope = nodePath.scope.getProgramParent(); + var ident = programScope.generateUidIdentifier(keyName); + define(ident, { _generatedByEspower: true }); + file.set(keyName, ident); + var generatedNode = generateNode(); + var visitorKeys = this.options.visitorKeys; + estraverse.traverse(generatedNode, { + keys: visitorKeys, + enter: function (node) { + define(node, { _generatedByEspower: true }); + } + }); + generatedNode._compact = true; + programScope.push({ id: ident, init: generatedNode }); + return ident; +}; + +BabelAssertionVisitor.prototype.findEnclosingFunction = function (nodePath) { + if (!nodePath) { + return null; + } + if (this.babel.types.isFunction(nodePath.node)) { + return nodePath.node; + } + return this.findEnclosingFunction(nodePath.parentPath); +}; + +module.exports = BabelAssertionVisitor; diff --git a/node_modules/babel-plugin-espower/lib/babel-espower-visitor.js b/node_modules/babel-plugin-espower/lib/babel-espower-visitor.js new file mode 100644 index 000000000..61a7e37be --- /dev/null +++ b/node_modules/babel-plugin-espower/lib/babel-espower-visitor.js @@ -0,0 +1,86 @@ +'use strict'; + +var CallMatcher = require('call-matcher'); +var babylon = require('babylon'); +var assign = require('core-js/library/fn/object/assign'); +var find = require('core-js/library/fn/array/find'); +var BabelAssertionVisitor = require('./babel-assertion-visitor'); + +function BabelEspowerVisitor (babel, opts) { + this.babel = babel; + this.matchers = opts.patterns.map(function (pattern) { + var signatureAst = babylon.parse(pattern); + var expression = signatureAst.program.body[0].expression; + return new CallMatcher(expression, opts); + }); + this.options = opts; +} + +BabelEspowerVisitor.prototype.enter = function (nodePath) { + var currentNode = nodePath.node; + var file = nodePath.hub.file; + var assertionVisitor = file.get('espowerAssertionVisitor'); + if (assertionVisitor) { + if (assertionVisitor.isGeneratedNode(nodePath) || assertionVisitor.toBeSkipped(nodePath)) { + // skipping this Node + // MEMO: exit() will not be called when skip() is called + nodePath.skip(); + return; + } + if (!assertionVisitor.isCapturingArgument() && !this.isCalleeOfParentCallExpression(nodePath)) { + // entering argument + assertionVisitor.enterArgument(nodePath); + } + } else if (nodePath.isCallExpression()) { + var matcher = find(this.matchers, function (m) { return m.test(currentNode); }); + if (matcher) { + // entering assertion + var espowerOptions = assign({ + path: file.opts.filename, // or opts.sourceFileName? + sourceMap: file.opts.inputSourceMap + }, this.options); + assertionVisitor = new BabelAssertionVisitor(this.babel, matcher, espowerOptions); + assertionVisitor.enter(nodePath); + file.set('espowerAssertionVisitor', assertionVisitor); + } + } +}; + +BabelEspowerVisitor.prototype.exit = function (nodePath) { + var currentNode = nodePath.node; + var resultTree = currentNode; + var file = nodePath.hub.file; + var assertionVisitor = file.get('espowerAssertionVisitor'); + if (!assertionVisitor) { + return; + } + if (assertionVisitor.isLeavingAssertion(nodePath)) { + // leaving assertion + assertionVisitor.leave(nodePath); + file.delete('espowerAssertionVisitor'); + return; + } + if (!assertionVisitor.isCapturingArgument()) { + return; + } + if (assertionVisitor.toBeCaptured(nodePath)) { + // capturing Node + resultTree = assertionVisitor.captureNode(nodePath); + } + if (assertionVisitor.isLeavingArgument(nodePath)) { + // capturing whole argument on leaving argument + resultTree = assertionVisitor.leaveArgument(resultTree); + } + if (resultTree !== currentNode) { + nodePath.replaceWith(resultTree); + } +}; + +BabelEspowerVisitor.prototype.isCalleeOfParentCallExpression = function (nodePath) { + var currentKey = nodePath.key; + var parentNode = nodePath.parent; + var types = this.babel.types; + return types.isCallExpression(parentNode) && currentKey === 'callee'; +}; + +module.exports = BabelEspowerVisitor; diff --git a/node_modules/babel-plugin-espower/lib/create-espower-visitor.js b/node_modules/babel-plugin-espower/lib/create-espower-visitor.js new file mode 100644 index 000000000..eab911ab8 --- /dev/null +++ b/node_modules/babel-plugin-espower/lib/create-espower-visitor.js @@ -0,0 +1,32 @@ +'use strict'; + +var defaultOptions = require('./default-options'); +var assign = require('core-js/library/fn/object/assign'); +var BabelEspowerVisitor = require('./babel-espower-visitor'); + +module.exports = function createEspowerVisitor (babel, options) { + return { + visitor: { + Program: function (path, state) { + var opts = assign(defaultOptions(), { + astWhiteList: babel.types.BUILDER_KEYS, + visitorKeys: babel.types.VISITOR_KEYS, + sourceRoot: process.cwd() + }, options, state.opts); + var espowerVisitor = new BabelEspowerVisitor(babel, opts); + var innerVisitor = Object.keys(opts.visitorKeys).reduce(function (handlers, nodeType) { + handlers[nodeType] = { + enter: function (nodePath, pluginPass) { + espowerVisitor.enter(nodePath); + }, + exit: function (nodePath, pluginPass) { + espowerVisitor.exit(nodePath); + } + }; + return handlers; + }, {}); + path.traverse(innerVisitor, state); + } + } + }; +}; diff --git a/node_modules/babel-plugin-espower/lib/default-options.js b/node_modules/babel-plugin-espower/lib/default-options.js new file mode 100644 index 000000000..d9d6cc1c6 --- /dev/null +++ b/node_modules/babel-plugin-espower/lib/default-options.js @@ -0,0 +1,19 @@ +'use strict'; + +module.exports = function defaultOptions () { + return { + embedAst: false, + patterns: [ + 'assert(value, [message])', + 'assert.ok(value, [message])', + 'assert.equal(actual, expected, [message])', + 'assert.notEqual(actual, expected, [message])', + 'assert.strictEqual(actual, expected, [message])', + 'assert.notStrictEqual(actual, expected, [message])', + 'assert.deepEqual(actual, expected, [message])', + 'assert.notDeepEqual(actual, expected, [message])', + 'assert.deepStrictEqual(actual, expected, [message])', + 'assert.notDeepStrictEqual(actual, expected, [message])' + ] + }; +}; diff --git a/node_modules/babel-plugin-espower/lib/define-properties.js b/node_modules/babel-plugin-espower/lib/define-properties.js new file mode 100644 index 000000000..9f86150fb --- /dev/null +++ b/node_modules/babel-plugin-espower/lib/define-properties.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function defineProperties (obj, map) { + Object.keys(map).forEach(function (name) { + Object.defineProperty(obj, name, { + configurable: true, + enumerable: false, + value: map[name], + writable: true + }); + }); +}; diff --git a/node_modules/babel-plugin-espower/lib/power-assert-recorder.js b/node_modules/babel-plugin-espower/lib/power-assert-recorder.js new file mode 100644 index 000000000..0e59999f5 --- /dev/null +++ b/node_modules/babel-plugin-espower/lib/power-assert-recorder.js @@ -0,0 +1,26 @@ +'use strict'; +module.exports = /* intentional newline */ + function () { + function PowerAssertRecorder() { + this.captured = []; + } + + PowerAssertRecorder.prototype._capt = function _capt (value, espath) { + this.captured.push({value: value, espath: espath}); + return value; + }; + + PowerAssertRecorder.prototype._expr = function _expr (value, source) { + var capturedValues = this.captured; + this.captured = []; + return { + powerAssertContext: { + value: value, + events: capturedValues + }, + source: source + }; + }; + + return PowerAssertRecorder; +} diff --git a/node_modules/babel-plugin-espower/lib/to-be-captured.js b/node_modules/babel-plugin-espower/lib/to-be-captured.js new file mode 100644 index 000000000..248fe5366 --- /dev/null +++ b/node_modules/babel-plugin-espower/lib/to-be-captured.js @@ -0,0 +1,56 @@ +'use strict'; + +var typesToBeCaptured = [ + 'Identifier', + 'BinaryExpression', + 'MemberExpression', + 'CallExpression', + 'UnaryExpression', + 'LogicalExpression', + 'ArrayExpression', + 'ObjectExpression', + 'TemplateLiteral', + 'YieldExpression', + 'AwaitExpression', + 'NewExpression', + 'AssignmentExpression', + 'UpdateExpression', + 'TaggedTemplateExpression' +]; + +function isCaputuringTargetType (types, nodePath) { + var currentNode = nodePath.node; + return typesToBeCaptured.some(function (nodeType) { + return types['is' + nodeType](currentNode); + }); +} + +function isCalleeOfParent(types, nodePath) { + var currentKey = nodePath.key; + var parentNode = nodePath.parent; + return (types.isCallExpression(parentNode) || types.isNewExpression(parentNode)) && currentKey === 'callee'; +} + +function isChildOfTaggedTemplateExpression(types, nodePath) { + var parentNode = nodePath.parent; + return types.isTaggedTemplateExpression(parentNode); +} + +function isYieldOrAwaitArgument(types, nodePath) { + var currentKey = nodePath.key; + var parentNode = nodePath.parent; + // capture the yielded/await result, not the promise + return (types.isYieldExpression(parentNode) || types.isAwaitExpression(parentNode)) && currentKey === 'argument'; +} + +var blacklist = [ + isYieldOrAwaitArgument, + isCalleeOfParent, + isChildOfTaggedTemplateExpression +]; + +module.exports = function toBeCaptured (types, nodePath) { + return isCaputuringTargetType(types, nodePath) && !blacklist.some(function (predicate) { + return predicate(types, nodePath); + }); +}; diff --git a/node_modules/babel-plugin-espower/lib/to-be-skipped.js b/node_modules/babel-plugin-espower/lib/to-be-skipped.js new file mode 100644 index 000000000..92b2528c8 --- /dev/null +++ b/node_modules/babel-plugin-espower/lib/to-be-skipped.js @@ -0,0 +1,107 @@ +'use strict'; + +var typesNotToBeSkippedDuringCapturing = [ + 'Identifier', + 'BinaryExpression', + 'MemberExpression', + 'CallExpression', + 'UnaryExpression', + 'LogicalExpression', + 'ArrayExpression', + 'ObjectExpression', + 'SequenceExpression', + 'TemplateLiteral', + 'YieldExpression', + 'AwaitExpression', + 'NewExpression', + 'AssignmentExpression', + 'UpdateExpression', + 'TaggedTemplateExpression', + 'ConditionalExpression', + 'SpreadElement', + 'Property' +]; + +function isTypeNotToBeSkippedDuringCapturing (types, nodePath) { + var currentNode = nodePath.node; + return typesNotToBeSkippedDuringCapturing.some(function (nodeType) { + return types['is' + nodeType](currentNode); + }); +} + +function isTypeToBeSkippedDuringCapturing (types, nodePath) { + return !isTypeNotToBeSkippedDuringCapturing(types, nodePath); +} + +function isLeftHandSideOfAssignment(types, nodePath) { + var currentKey = nodePath.key; + var parentNode = nodePath.parent; + // Do not instrument left due to 'Invalid left-hand side in assignment' + return types.isAssignmentExpression(parentNode) && currentKey === 'left'; +} + +function isChildOfObjectLiteral (types, parentNode) { + return types.isObjectProperty(parentNode) || + types.isObjectMethod(parentNode) || + types.isSpreadProperty(parentNode); +} + +function isObjectLiteralKey (types, parentNode, currentKey) { + return isChildOfObjectLiteral(types, parentNode) && currentKey === 'key'; +} + +function isObjectLiteralValue (types, parentNode, currentKey) { + return isChildOfObjectLiteral(types, parentNode) && currentKey === 'value'; +} + +function isNonComputedObjectLiteralKey(types, nodePath) { + var currentKey = nodePath.key; + var parentNode = nodePath.parent; + // Do not instrument non-computed Object literal key + return isObjectLiteralKey(types, parentNode, currentKey) && !parentNode.computed; +} + +function isShorthandedValueOfObjectLiteral(types, nodePath) { + var currentKey = nodePath.key; + var parentNode = nodePath.parent; + // Do not instrument shorthanded Object literal value + return isObjectLiteralValue(types, parentNode, currentKey) && parentNode.shorthand; +} + +function isUpdateExpression(types, nodePath) { + var parentNode = nodePath.parent; + // Just wrap UpdateExpression, not digging in. + return types.isUpdateExpression(parentNode); +} + +function isCallExpressionWithNonComputedMemberExpression(types, nodePath) { + var currentKey = nodePath.key; + var currentNode = nodePath.node; + var parentNode = nodePath.parent; + // Do not instrument non-computed property of MemberExpression within CallExpression. + return types.isIdentifier(currentNode) && types.isMemberExpression(parentNode) && !parentNode.computed && currentKey === 'property'; +} + +function isTypeOfOrDeleteUnaryExpression(types, nodePath) { + var currentKey = nodePath.key; + var currentNode = nodePath.node; + var parentNode = nodePath.parent; + // 'typeof Identifier' or 'delete Identifier' is not instrumented + return types.isIdentifier(currentNode) && types.isUnaryExpression(parentNode) && (parentNode.operator === 'typeof' || parentNode.operator === 'delete') && currentKey === 'argument'; +} + +var criteriaForSkipping = [ + isTypeToBeSkippedDuringCapturing, + isLeftHandSideOfAssignment, + isNonComputedObjectLiteralKey, + isShorthandedValueOfObjectLiteral, + isUpdateExpression, + isCallExpressionWithNonComputedMemberExpression, + isTypeOfOrDeleteUnaryExpression, +]; + +module.exports = function toBeSkipped (types, nodePath) { + return criteriaForSkipping.some(function (predicate) { + return predicate(types, nodePath); + }); +}; diff --git a/node_modules/babel-plugin-espower/node_modules/.bin/babylon b/node_modules/babel-plugin-espower/node_modules/.bin/babylon new file mode 120000 index 000000000..7ceac0182 --- /dev/null +++ b/node_modules/babel-plugin-espower/node_modules/.bin/babylon @@ -0,0 +1 @@ +../../../babylon/bin/babylon.js
\ No newline at end of file diff --git a/node_modules/babel-plugin-espower/package.json b/node_modules/babel-plugin-espower/package.json new file mode 100644 index 000000000..e264321b8 --- /dev/null +++ b/node_modules/babel-plugin-espower/package.json @@ -0,0 +1,66 @@ +{ + "name": "babel-plugin-espower", + "description": "Babel plugin for power-assert", + "version": "2.3.2", + "author": { + "name": "Takuto Wada", + "email": "takuto.wada@gmail.com", + "url": "https://github.com/twada" + }, + "bugs": "https://github.com/power-assert-js/babel-plugin-espower/issues", + "contributors": [ + { + "name": "James Talmage", + "url": "https://github.com/jamestalmage" + } + ], + "dependencies": { + "babel-generator": "^6.1.0", + "babylon": "^6.1.0", + "call-matcher": "^1.0.0", + "core-js": "^2.0.0", + "espower-location-detector": "^1.0.0", + "espurify": "^1.6.0", + "estraverse": "^4.1.1" + }, + "devDependencies": { + "babel-core": "^6.1.0", + "babel-preset-es2015": "^6.1.2", + "babel-preset-react": "^6.1.2", + "babel-preset-stage-2": "^6.1.2", + "mocha": "^3.0.0" + }, + "directories": { + "lib": "./lib", + "test": "./test" + }, + "files": [ + "README.md", + "CHANGELOG.md", + "LICENSE", + "index.js", + "create.js", + "lib", + "package.json" + ], + "homepage": "https://github.com/power-assert-js/babel-plugin-espower", + "keywords": [ + "assert", + "assertion", + "babel", + "babel-plugin", + "power-assert", + "test", + "testing", + "transform" + ], + "license": "MIT", + "main": "index.js", + "repository": { + "type": "git", + "url": "https://github.com/power-assert-js/babel-plugin-espower.git" + }, + "scripts": { + "test": "mocha --timeout 0" + } +} |