[Pkg-javascript-commits] [node-rollup-plugin-commonjs] 01/05: New upstream version 8.2.0

Julien Puydt julien.puydt at laposte.net
Wed Sep 6 16:04:04 UTC 2017


This is an automated email from the git hooks/post-receive script.

jpuydt-guest pushed a commit to branch master
in repository node-rollup-plugin-commonjs.

commit 9780602153aca4d73e2ba90484635f9787eb3a18
Author: Julien Puydt <julien.puydt at laposte.net>
Date:   Wed Sep 6 17:59:43 2017 +0200

    New upstream version 8.2.0
---
 CHANGELOG.md                                   |   8 +
 LICENSE                                        |  21 +
 package-lock.json                              | 808 ++++++++++++++-----------
 package.json                                   |  28 +-
 rollup.config.js                               |  17 +-
 src/defaultResolver.js                         |   2 +-
 src/index.js                                   |   6 +-
 src/utils.js                                   |  10 +-
 test/samples/rename-index/invalid-var/index.js |   1 +
 test/samples/rename-index/main.js              |   5 +
 test/samples/rename-index/other/nonIndex.js    |   1 +
 test/samples/rename-index/validVar/index.js    |   1 +
 test/test.js                                   | 380 ++++++------
 13 files changed, 715 insertions(+), 573 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index c287b48..49fbf47 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
 # rollup-plugin-commonjs changelog
 
+## 8.2.0
+
+* Avoid using `index` as a variable name ([#208](https://github.com/rollup/rollup-plugin-commonjs/pull/208))
+
+## 8.1.1
+
+* Compatibility with 0.48 ([#220](https://github.com/rollup/rollup-plugin-commonjs/issues/220))
+
 ## 8.1.0
 
 * Handle `options.external` correctly ([#212](https://github.com/rollup/rollup-plugin-commonjs/pull/212))
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..fa6e515
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2017 [these people](https://github.com/rollup/rollup-plugin-commonjs/graphs/contributors)
+
+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/package-lock.json b/package-lock.json
index e9223b1..f435049 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,13 +1,13 @@
 {
   "name": "rollup-plugin-commonjs",
-  "version": "8.0.2",
+  "version": "8.1.1",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
     "acorn": {
-      "version": "4.0.13",
-      "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz",
-      "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c="
+      "version": "5.1.1",
+      "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.1.tgz",
+      "integrity": "sha512-vOk6uEMctu0vQrvuSqFdJyqj1Q0S5VTDL79qtjo+DhRr+1mmaD+tluFSCZqhvi/JUhXSzoZN2BhtstaPEeE8cw=="
     },
     "acorn-jsx": {
       "version": "3.0.1",
@@ -44,12 +44,14 @@
       }
     },
     "ajv": {
-      "version": "4.11.8",
-      "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz",
-      "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=",
+      "version": "5.2.2",
+      "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.2.2.tgz",
+      "integrity": "sha1-R8aNaehvXZUxA7AHSpQw3GPaXjk=",
       "dev": true,
       "requires": {
         "co": "4.6.0",
+        "fast-deep-equal": "1.0.0",
+        "json-schema-traverse": "0.3.1",
         "json-stable-stringify": "1.0.1"
       }
     },
@@ -60,9 +62,9 @@
       "dev": true
     },
     "ansi-escapes": {
-      "version": "1.4.0",
-      "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz",
-      "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=",
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-2.0.0.tgz",
+      "integrity": "sha1-W65SvkJIeN2Xg+iRDj/Cki6DyBs=",
       "dev": true
     },
     "ansi-regex": {
@@ -126,14 +128,38 @@
       "dev": true
     },
     "babel-code-frame": {
-      "version": "6.22.0",
-      "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz",
-      "integrity": "sha1-AnYgvuVnqIwyVhV05/0IAdMxGOQ=",
+      "version": "6.26.0",
+      "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
+      "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=",
       "dev": true,
       "requires": {
         "chalk": "1.1.3",
         "esutils": "2.0.2",
         "js-tokens": "3.0.2"
+      },
+      "dependencies": {
+        "chalk": {
+          "version": "1.1.3",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+          "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+          "dev": true,
+          "requires": {
+            "ansi-styles": "2.2.1",
+            "escape-string-regexp": "1.0.5",
+            "has-ansi": "2.0.0",
+            "strip-ansi": "3.0.1",
+            "supports-color": "2.0.0"
+          }
+        },
+        "strip-ansi": {
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+          "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+          "dev": true,
+          "requires": {
+            "ansi-regex": "2.1.1"
+          }
+        }
       }
     },
     "balanced-match": {
@@ -206,6 +232,19 @@
           "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=",
           "dev": true
         },
+        "chalk": {
+          "version": "1.1.3",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+          "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+          "dev": true,
+          "requires": {
+            "ansi-styles": "2.2.1",
+            "escape-string-regexp": "1.0.5",
+            "has-ansi": "2.0.0",
+            "strip-ansi": "3.0.1",
+            "supports-color": "2.0.0"
+          }
+        },
         "magic-string": {
           "version": "0.14.0",
           "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.14.0.tgz",
@@ -214,6 +253,21 @@
           "requires": {
             "vlq": "0.2.2"
           }
+        },
+        "minimist": {
+          "version": "1.2.0",
+          "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+          "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
+          "dev": true
+        },
+        "strip-ansi": {
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+          "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+          "dev": true,
+          "requires": {
+            "ansi-regex": "2.1.1"
+          }
         }
       }
     },
@@ -239,16 +293,34 @@
       "dev": true
     },
     "chalk": {
-      "version": "1.1.3",
-      "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
-      "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
+      "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
       "dev": true,
       "requires": {
-        "ansi-styles": "2.2.1",
+        "ansi-styles": "3.2.0",
         "escape-string-regexp": "1.0.5",
-        "has-ansi": "2.0.0",
-        "strip-ansi": "3.0.1",
-        "supports-color": "2.0.0"
+        "supports-color": "4.2.1"
+      },
+      "dependencies": {
+        "ansi-styles": {
+          "version": "3.2.0",
+          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
+          "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
+          "dev": true,
+          "requires": {
+            "color-convert": "1.9.0"
+          }
+        },
+        "supports-color": {
+          "version": "4.2.1",
+          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz",
+          "integrity": "sha512-qxzYsob3yv6U+xMzPrv170y8AwGP7i74g+pbixCfD6rgso8BscLT2qXIuz6TpOaiJZ3mFgT5O9lyT9nMU4LfaA==",
+          "dev": true,
+          "requires": {
+            "has-flag": "2.0.0"
+          }
+        }
       }
     },
     "circular-json": {
@@ -258,12 +330,12 @@
       "dev": true
     },
     "cli-cursor": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz",
-      "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=",
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
+      "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=",
       "dev": true,
       "requires": {
-        "restore-cursor": "1.0.1"
+        "restore-cursor": "2.0.0"
       }
     },
     "cli-width": {
@@ -278,10 +350,19 @@
       "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=",
       "dev": true
     },
-    "code-point-at": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
-      "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
+    "color-convert": {
+      "version": "1.9.0",
+      "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz",
+      "integrity": "sha1-Gsz5fdc5uYO/mU1W/sj5WFNkG3o=",
+      "dev": true,
+      "requires": {
+        "color-name": "1.1.3"
+      }
+    },
+    "color-name": {
+      "version": "1.1.3",
+      "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+      "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
       "dev": true
     },
     "commander": {
@@ -316,13 +397,15 @@
       "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
       "dev": true
     },
-    "d": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz",
-      "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=",
+    "cross-spawn": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
+      "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
       "dev": true,
       "requires": {
-        "es5-ext": "0.10.26"
+        "lru-cache": "4.1.1",
+        "shebang-command": "1.2.0",
+        "which": "1.3.0"
       }
     },
     "debug": {
@@ -371,75 +454,11 @@
         "isarray": "1.0.0"
       }
     },
-    "es5-ext": {
-      "version": "0.10.26",
-      "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.26.tgz",
-      "integrity": "sha1-UbISilMbcMT2dkCTpzy+u4IYY3I=",
-      "dev": true,
-      "requires": {
-        "es6-iterator": "2.0.1",
-        "es6-symbol": "3.1.1"
-      }
-    },
-    "es6-iterator": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz",
-      "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=",
-      "dev": true,
-      "requires": {
-        "d": "1.0.0",
-        "es5-ext": "0.10.26",
-        "es6-symbol": "3.1.1"
-      }
-    },
-    "es6-map": {
-      "version": "0.1.5",
-      "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz",
-      "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=",
-      "dev": true,
-      "requires": {
-        "d": "1.0.0",
-        "es5-ext": "0.10.26",
-        "es6-iterator": "2.0.1",
-        "es6-set": "0.1.5",
-        "es6-symbol": "3.1.1",
-        "event-emitter": "0.3.5"
-      }
-    },
-    "es6-set": {
-      "version": "0.1.5",
-      "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz",
-      "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=",
-      "dev": true,
-      "requires": {
-        "d": "1.0.0",
-        "es5-ext": "0.10.26",
-        "es6-iterator": "2.0.1",
-        "es6-symbol": "3.1.1",
-        "event-emitter": "0.3.5"
-      }
-    },
-    "es6-symbol": {
-      "version": "3.1.1",
-      "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz",
-      "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=",
-      "dev": true,
-      "requires": {
-        "d": "1.0.0",
-        "es5-ext": "0.10.26"
-      }
-    },
-    "es6-weak-map": {
-      "version": "2.0.2",
-      "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz",
-      "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=",
-      "dev": true,
-      "requires": {
-        "d": "1.0.0",
-        "es5-ext": "0.10.26",
-        "es6-iterator": "2.0.1",
-        "es6-symbol": "3.1.1"
-      }
+    "es6-object-assign": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz",
+      "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=",
+      "dev": true
     },
     "escape-string-regexp": {
       "version": "1.0.5",
@@ -447,77 +466,69 @@
       "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
       "dev": true
     },
-    "escope": {
-      "version": "3.6.0",
-      "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz",
-      "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=",
-      "dev": true,
-      "requires": {
-        "es6-map": "0.1.5",
-        "es6-weak-map": "2.0.2",
-        "esrecurse": "4.2.0",
-        "estraverse": "4.2.0"
-      }
-    },
     "eslint": {
-      "version": "3.19.0",
-      "resolved": "https://registry.npmjs.org/eslint/-/eslint-3.19.0.tgz",
-      "integrity": "sha1-yPxiAcf0DdCJQbh8CFdnOGpnmsw=",
+      "version": "4.5.0",
+      "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.5.0.tgz",
+      "integrity": "sha1-u3XTuL3pf7XhPvzVOXRGd/6wGcM=",
       "dev": true,
       "requires": {
-        "babel-code-frame": "6.22.0",
-        "chalk": "1.1.3",
+        "ajv": "5.2.2",
+        "babel-code-frame": "6.26.0",
+        "chalk": "2.1.0",
         "concat-stream": "1.6.0",
+        "cross-spawn": "5.1.0",
         "debug": "2.6.8",
         "doctrine": "2.0.0",
-        "escope": "3.6.0",
-        "espree": "3.4.3",
+        "eslint-scope": "3.7.1",
+        "espree": "3.5.0",
         "esquery": "1.0.0",
         "estraverse": "4.2.0",
         "esutils": "2.0.2",
         "file-entry-cache": "2.0.0",
+        "functional-red-black-tree": "1.0.1",
         "glob": "7.1.2",
         "globals": "9.18.0",
         "ignore": "3.3.3",
         "imurmurhash": "0.1.4",
-        "inquirer": "0.12.0",
-        "is-my-json-valid": "2.16.0",
+        "inquirer": "3.2.2",
         "is-resolvable": "1.0.0",
         "js-yaml": "3.9.1",
         "json-stable-stringify": "1.0.1",
         "levn": "0.3.0",
         "lodash": "4.17.4",
+        "minimatch": "3.0.4",
         "mkdirp": "0.5.1",
         "natural-compare": "1.4.0",
         "optionator": "0.8.2",
         "path-is-inside": "1.0.2",
-        "pluralize": "1.2.1",
-        "progress": "1.1.8",
+        "pluralize": "4.0.0",
+        "progress": "2.0.0",
         "require-uncached": "1.0.3",
-        "shelljs": "0.7.8",
-        "strip-bom": "3.0.0",
+        "semver": "5.4.1",
+        "strip-ansi": "4.0.0",
         "strip-json-comments": "2.0.1",
-        "table": "3.8.3",
-        "text-table": "0.2.0",
-        "user-home": "2.0.0"
+        "table": "4.0.1",
+        "text-table": "0.2.0"
+      }
+    },
+    "eslint-scope": {
+      "version": "3.7.1",
+      "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz",
+      "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=",
+      "dev": true,
+      "requires": {
+        "esrecurse": "4.2.0",
+        "estraverse": "4.2.0"
       }
     },
     "espree": {
-      "version": "3.4.3",
-      "resolved": "https://registry.npmjs.org/espree/-/espree-3.4.3.tgz",
-      "integrity": "sha1-KRC1zNSc6JPC//+qtP2LOjG4I3Q=",
+      "version": "3.5.0",
+      "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.0.tgz",
+      "integrity": "sha1-mDWGJb3QVYYeon4oZ+pyn69GPY0=",
       "dev": true,
       "requires": {
         "acorn": "5.1.1",
         "acorn-jsx": "3.0.1"
-      },
-      "dependencies": {
-        "acorn": {
-          "version": "5.1.1",
-          "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.1.tgz",
-          "integrity": "sha512-vOk6uEMctu0vQrvuSqFdJyqj1Q0S5VTDL79qtjo+DhRr+1mmaD+tluFSCZqhvi/JUhXSzoZN2BhtstaPEeE8cw==",
-          "dev": true
-        }
       }
     },
     "esprima": {
@@ -552,9 +563,9 @@
       "dev": true
     },
     "estree-walker": {
-      "version": "0.3.1",
-      "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.3.1.tgz",
-      "integrity": "sha1-5rGlHPcpJSTnI3wxLl/mZgwc4ao="
+      "version": "0.5.0",
+      "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.0.tgz",
+      "integrity": "sha512-/bEAy+yKAZQrEWUhGmS3H9XpGqSDBtRzX0I2PgMw9kA2n1jN22uV5B5p7MFdZdvWdXCRJztXAfx6ZeRfgkEETg=="
     },
     "esutils": {
       "version": "2.0.2",
@@ -562,22 +573,6 @@
       "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
       "dev": true
     },
-    "event-emitter": {
-      "version": "0.3.5",
-      "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz",
-      "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=",
-      "dev": true,
-      "requires": {
-        "d": "1.0.0",
-        "es5-ext": "0.10.26"
-      }
-    },
-    "exit-hook": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz",
-      "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=",
-      "dev": true
-    },
     "expand-brackets": {
       "version": "0.1.5",
       "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz",
@@ -594,6 +589,17 @@
         "fill-range": "2.2.3"
       }
     },
+    "external-editor": {
+      "version": "2.0.4",
+      "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.0.4.tgz",
+      "integrity": "sha1-HtkZnanL/i7y96MbL96LDRI2iXI=",
+      "dev": true,
+      "requires": {
+        "iconv-lite": "0.4.18",
+        "jschardet": "1.5.1",
+        "tmp": "0.0.31"
+      }
+    },
     "extglob": {
       "version": "0.3.2",
       "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz",
@@ -602,6 +608,12 @@
         "is-extglob": "1.0.0"
       }
     },
+    "fast-deep-equal": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz",
+      "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=",
+      "dev": true
+    },
     "fast-levenshtein": {
       "version": "2.0.6",
       "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
@@ -609,13 +621,12 @@
       "dev": true
     },
     "figures": {
-      "version": "1.7.0",
-      "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz",
-      "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=",
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
+      "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=",
       "dev": true,
       "requires": {
-        "escape-string-regexp": "1.0.5",
-        "object-assign": "4.1.1"
+        "escape-string-regexp": "1.0.5"
       }
     },
     "file-entry-cache": {
@@ -676,21 +687,12 @@
       "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
       "dev": true
     },
-    "generate-function": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz",
-      "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=",
+    "functional-red-black-tree": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
+      "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
       "dev": true
     },
-    "generate-object-property": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz",
-      "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=",
-      "dev": true,
-      "requires": {
-        "is-property": "1.0.2"
-      }
-    },
     "glob": {
       "version": "7.1.2",
       "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
@@ -770,9 +772,15 @@
       }
     },
     "has-flag": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz",
-      "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=",
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
+      "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
+      "dev": true
+    },
+    "iconv-lite": {
+      "version": "0.4.18",
+      "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.18.tgz",
+      "integrity": "sha512-sr1ZQph3UwHTR0XftSbK85OvBbxe/abLGzEnPENCQwmHf7sck8Oyu4ob3LgBxWWxRoM+QszeUyl7jbqapu2TqA==",
       "dev": true
     },
     "ignore": {
@@ -804,23 +812,24 @@
       "dev": true
     },
     "inquirer": {
-      "version": "0.12.0",
-      "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz",
-      "integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=",
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.2.2.tgz",
+      "integrity": "sha512-bTKLzEHJVATimZO/YFdLrom0lRx1BHfRYskFHfIMVkGdp8+dIZaxuU+4yrsS1lcu6YWywVQVVsfvdwESzbeqHw==",
       "dev": true,
       "requires": {
-        "ansi-escapes": "1.4.0",
-        "ansi-regex": "2.1.1",
-        "chalk": "1.1.3",
-        "cli-cursor": "1.0.2",
+        "ansi-escapes": "2.0.0",
+        "chalk": "2.1.0",
+        "cli-cursor": "2.1.0",
         "cli-width": "2.1.0",
-        "figures": "1.7.0",
+        "external-editor": "2.0.4",
+        "figures": "2.0.0",
         "lodash": "4.17.4",
-        "readline2": "1.0.1",
-        "run-async": "0.1.0",
-        "rx-lite": "3.1.2",
-        "string-width": "1.0.2",
-        "strip-ansi": "3.0.1",
+        "mute-stream": "0.0.7",
+        "run-async": "2.3.0",
+        "rx-lite": "4.0.8",
+        "rx-lite-aggregates": "4.0.8",
+        "string-width": "2.1.1",
+        "strip-ansi": "4.0.0",
         "through": "2.3.8"
       }
     },
@@ -859,13 +868,10 @@
       "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA="
     },
     "is-fullwidth-code-point": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
-      "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
-      "dev": true,
-      "requires": {
-        "number-is-nan": "1.0.1"
-      }
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
+      "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
+      "dev": true
     },
     "is-glob": {
       "version": "2.0.1",
@@ -875,17 +881,11 @@
         "is-extglob": "1.0.0"
       }
     },
-    "is-my-json-valid": {
-      "version": "2.16.0",
-      "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz",
-      "integrity": "sha1-8Hndm/2uZe4gOKrorLyGqxCeNpM=",
-      "dev": true,
-      "requires": {
-        "generate-function": "2.0.0",
-        "generate-object-property": "1.2.0",
-        "jsonpointer": "4.0.1",
-        "xtend": "4.0.1"
-      }
+    "is-module": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz",
+      "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=",
+      "dev": true
     },
     "is-number": {
       "version": "2.1.0",
@@ -929,10 +929,10 @@
       "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz",
       "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU="
     },
-    "is-property": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
-      "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=",
+    "is-promise": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz",
+      "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=",
       "dev": true
     },
     "is-resolvable": {
@@ -949,6 +949,12 @@
       "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
       "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
     },
+    "isexe": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+      "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
+      "dev": true
+    },
     "isobject": {
       "version": "2.1.0",
       "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
@@ -973,6 +979,18 @@
         "esprima": "4.0.0"
       }
     },
+    "jschardet": {
+      "version": "1.5.1",
+      "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-1.5.1.tgz",
+      "integrity": "sha512-vE2hT1D0HLZCLLclfBSfkfTTedhVj0fubHpJBHKwwUWX0nSbhPAfk+SG9rTX95BYNmau8rGFfCeaT6T5OW1C2A==",
+      "dev": true
+    },
+    "json-schema-traverse": {
+      "version": "0.3.1",
+      "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz",
+      "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=",
+      "dev": true
+    },
     "json-stable-stringify": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz",
@@ -994,12 +1012,6 @@
       "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=",
       "dev": true
     },
-    "jsonpointer": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz",
-      "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=",
-      "dev": true
-    },
     "kind-of": {
       "version": "3.2.2",
       "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
@@ -1098,10 +1110,20 @@
         "lodash.isarray": "3.0.4"
       }
     },
+    "lru-cache": {
+      "version": "4.1.1",
+      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz",
+      "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==",
+      "dev": true,
+      "requires": {
+        "pseudomap": "1.0.2",
+        "yallist": "2.1.2"
+      }
+    },
     "magic-string": {
-      "version": "0.19.1",
-      "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.19.1.tgz",
-      "integrity": "sha1-FNdoATyvLsj96hakmvgvw3fnUgE=",
+      "version": "0.22.4",
+      "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.4.tgz",
+      "integrity": "sha512-kxBL06p6iO2qPBHsqGK2b3cRwiRGpnmSuVWNhwHcMX7qJOUr1HvricYP1LZOCdkQBUp0jiWg2d6WJwR3vYgByw==",
       "requires": {
         "vlq": "0.2.2"
       }
@@ -1126,6 +1148,12 @@
         "regex-cache": "0.4.3"
       }
     },
+    "mimic-fn": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz",
+      "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=",
+      "dev": true
+    },
     "minimatch": {
       "version": "3.0.4",
       "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
@@ -1136,9 +1164,9 @@
       }
     },
     "minimist": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
-      "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
+      "version": "0.0.8",
+      "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
+      "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
       "dev": true
     },
     "mkdirp": {
@@ -1148,14 +1176,6 @@
       "dev": true,
       "requires": {
         "minimist": "0.0.8"
-      },
-      "dependencies": {
-        "minimist": {
-          "version": "0.0.8",
-          "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
-          "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
-          "dev": true
-        }
       }
     },
     "mocha": {
@@ -1191,6 +1211,12 @@
             "path-is-absolute": "1.0.1"
           }
         },
+        "has-flag": {
+          "version": "1.0.0",
+          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz",
+          "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=",
+          "dev": true
+        },
         "supports-color": {
           "version": "3.1.2",
           "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz",
@@ -1209,9 +1235,9 @@
       "dev": true
     },
     "mute-stream": {
-      "version": "0.0.5",
-      "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz",
-      "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=",
+      "version": "0.0.7",
+      "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz",
+      "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=",
       "dev": true
     },
     "natural-compare": {
@@ -1225,15 +1251,9 @@
       "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
       "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=",
       "requires": {
-        "remove-trailing-separator": "1.0.2"
+        "remove-trailing-separator": "1.1.0"
       }
     },
-    "number-is-nan": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
-      "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
-      "dev": true
-    },
     "object-assign": {
       "version": "4.1.1",
       "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
@@ -1259,10 +1279,13 @@
       }
     },
     "onetime": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz",
-      "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=",
-      "dev": true
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
+      "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=",
+      "dev": true,
+      "requires": {
+        "mimic-fn": "1.1.0"
+      }
     },
     "optionator": {
       "version": "0.8.2",
@@ -1284,6 +1307,12 @@
       "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
       "dev": true
     },
+    "os-tmpdir": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
+      "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
+      "dev": true
+    },
     "parse-glob": {
       "version": "3.0.4",
       "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz",
@@ -1334,9 +1363,9 @@
       }
     },
     "pluralize": {
-      "version": "1.2.1",
-      "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz",
-      "integrity": "sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU=",
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-4.0.0.tgz",
+      "integrity": "sha1-WbcIwcAZCi9pLxx2GMRGsFL9F2I=",
       "dev": true
     },
     "prelude-ls": {
@@ -1357,9 +1386,15 @@
       "dev": true
     },
     "progress": {
-      "version": "1.1.8",
-      "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz",
-      "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=",
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz",
+      "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=",
+      "dev": true
+    },
+    "pseudomap": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
+      "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=",
       "dev": true
     },
     "randomatic": {
@@ -1414,17 +1449,6 @@
         "util-deprecate": "1.0.2"
       }
     },
-    "readline2": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz",
-      "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=",
-      "dev": true,
-      "requires": {
-        "code-point-at": "1.1.0",
-        "is-fullwidth-code-point": "1.0.0",
-        "mute-stream": "0.0.5"
-      }
-    },
     "rechoir": {
       "version": "0.6.2",
       "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
@@ -1444,9 +1468,9 @@
       }
     },
     "remove-trailing-separator": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz",
-      "integrity": "sha1-abBi2XhyetFNxrVrpKt3L9jXBRE="
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
+      "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8="
     },
     "repeat-element": {
       "version": "1.1.2",
@@ -1489,13 +1513,13 @@
       "dev": true
     },
     "restore-cursor": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz",
-      "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=",
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
+      "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=",
       "dev": true,
       "requires": {
-        "exit-hook": "1.1.1",
-        "onetime": "1.1.0"
+        "onetime": "2.0.1",
+        "signal-exit": "3.0.2"
       }
     },
     "rimraf": {
@@ -1508,13 +1532,10 @@
       }
     },
     "rollup": {
-      "version": "0.40.2",
-      "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.40.2.tgz",
-      "integrity": "sha1-tZyDdzMvgovjiYMZLzNp5QL55Es=",
-      "dev": true,
-      "requires": {
-        "source-map-support": "0.4.15"
-      }
+      "version": "0.48.2",
+      "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.48.2.tgz",
+      "integrity": "sha512-5IOVEA87/OWQlojaAPN0WStLAhlaY7GS/5p+pA/IHReXjtc+d7IJYgRD3Y/U2LVXoD7f1SBc3ymYd4g3M/zRzQ==",
+      "dev": true
     },
     "rollup-plugin-buble": {
       "version": "0.15.0",
@@ -1545,13 +1566,14 @@
       }
     },
     "rollup-plugin-node-resolve": {
-      "version": "2.1.1",
-      "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-2.1.1.tgz",
-      "integrity": "sha1-y7eDsNFbAnlNWJFTULLw2QK43cg=",
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.0.0.tgz",
+      "integrity": "sha1-i4l8TDAw1QASd7BRSyXSygloPuA=",
       "dev": true,
       "requires": {
         "browser-resolve": "1.11.2",
         "builtin-modules": "1.1.1",
+        "is-module": "1.0.0",
         "resolve": "1.4.0"
       }
     },
@@ -1562,38 +1584,66 @@
       "requires": {
         "estree-walker": "0.3.1",
         "micromatch": "2.3.11"
-      }
-    },
-    "rollup-watch": {
-      "version": "3.2.2",
-      "resolved": "https://registry.npmjs.org/rollup-watch/-/rollup-watch-3.2.2.tgz",
-      "integrity": "sha1-XldCMunvNtqRd/RpRtgIDLJnNUs=",
-      "dev": true,
-      "requires": {
-        "require-relative": "0.8.7"
+      },
+      "dependencies": {
+        "estree-walker": {
+          "version": "0.3.1",
+          "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.3.1.tgz",
+          "integrity": "sha1-5rGlHPcpJSTnI3wxLl/mZgwc4ao="
+        }
       }
     },
     "run-async": {
-      "version": "0.1.0",
-      "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz",
-      "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=",
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz",
+      "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=",
       "dev": true,
       "requires": {
-        "once": "1.4.0"
+        "is-promise": "2.1.0"
       }
     },
     "rx-lite": {
-      "version": "3.1.2",
-      "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz",
-      "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=",
+      "version": "4.0.8",
+      "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz",
+      "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=",
       "dev": true
     },
+    "rx-lite-aggregates": {
+      "version": "4.0.8",
+      "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz",
+      "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=",
+      "dev": true,
+      "requires": {
+        "rx-lite": "4.0.8"
+      }
+    },
     "safe-buffer": {
       "version": "5.1.1",
       "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
       "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==",
       "dev": true
     },
+    "semver": {
+      "version": "5.4.1",
+      "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz",
+      "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==",
+      "dev": true
+    },
+    "shebang-command": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
+      "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
+      "dev": true,
+      "requires": {
+        "shebang-regex": "1.0.0"
+      }
+    },
+    "shebang-regex": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
+      "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
+      "dev": true
+    },
     "shelljs": {
       "version": "0.7.8",
       "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz",
@@ -1605,6 +1655,31 @@
         "rechoir": "0.6.2"
       }
     },
+    "shx": {
+      "version": "0.2.2",
+      "resolved": "https://registry.npmjs.org/shx/-/shx-0.2.2.tgz",
+      "integrity": "sha1-CjBNAgsO3xMGrYFXDoDwNG31ijk=",
+      "dev": true,
+      "requires": {
+        "es6-object-assign": "1.1.0",
+        "minimist": "1.2.0",
+        "shelljs": "0.7.8"
+      },
+      "dependencies": {
+        "minimist": {
+          "version": "1.2.0",
+          "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+          "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
+          "dev": true
+        }
+      }
+    },
+    "signal-exit": {
+      "version": "3.0.2",
+      "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
+      "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
+      "dev": true
+    },
     "slice-ansi": {
       "version": "0.0.4",
       "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz",
@@ -1612,18 +1687,18 @@
       "dev": true
     },
     "source-map": {
-      "version": "0.5.6",
-      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz",
-      "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=",
+      "version": "0.5.7",
+      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
+      "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
       "dev": true
     },
     "source-map-support": {
-      "version": "0.4.15",
-      "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.15.tgz",
-      "integrity": "sha1-AyAt9lwG0r2MfsI2KhkwVv7407E=",
+      "version": "0.4.16",
+      "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.16.tgz",
+      "integrity": "sha512-A6vlydY7H/ljr4L2UOhDSajQdZQ6dMD7cLH0pzwcmwLyc9u8PNI4WGtnfDDzX7uzGL6c/T+ORL97Zlh+S4iOrg==",
       "dev": true,
       "requires": {
-        "source-map": "0.5.6"
+        "source-map": "0.5.7"
       }
     },
     "sprintf-js": {
@@ -1642,31 +1717,32 @@
       }
     },
     "string-width": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
-      "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
+      "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
       "dev": true,
       "requires": {
-        "code-point-at": "1.1.0",
-        "is-fullwidth-code-point": "1.0.0",
-        "strip-ansi": "3.0.1"
+        "is-fullwidth-code-point": "2.0.0",
+        "strip-ansi": "4.0.0"
       }
     },
     "strip-ansi": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
-      "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
+      "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
       "dev": true,
       "requires": {
-        "ansi-regex": "2.1.1"
+        "ansi-regex": "3.0.0"
+      },
+      "dependencies": {
+        "ansi-regex": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
+          "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
+          "dev": true
+        }
       }
     },
-    "strip-bom": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
-      "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
-      "dev": true
-    },
     "strip-json-comments": {
       "version": "2.0.1",
       "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
@@ -1680,9 +1756,9 @@
       "dev": true
     },
     "table": {
-      "version": "3.8.3",
-      "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz",
-      "integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=",
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/table/-/table-4.0.1.tgz",
+      "integrity": "sha1-qBFsEz+sLGH0pCCrbN9cTWHw5DU=",
       "dev": true,
       "requires": {
         "ajv": "4.11.8",
@@ -1693,35 +1769,36 @@
         "string-width": "2.1.1"
       },
       "dependencies": {
-        "ansi-regex": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
-          "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
-          "dev": true
-        },
-        "is-fullwidth-code-point": {
-          "version": "2.0.0",
-          "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
-          "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
-          "dev": true
+        "ajv": {
+          "version": "4.11.8",
+          "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz",
+          "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=",
+          "dev": true,
+          "requires": {
+            "co": "4.6.0",
+            "json-stable-stringify": "1.0.1"
+          }
         },
-        "string-width": {
-          "version": "2.1.1",
-          "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
-          "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
+        "chalk": {
+          "version": "1.1.3",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+          "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
           "dev": true,
           "requires": {
-            "is-fullwidth-code-point": "2.0.0",
-            "strip-ansi": "4.0.0"
+            "ansi-styles": "2.2.1",
+            "escape-string-regexp": "1.0.5",
+            "has-ansi": "2.0.0",
+            "strip-ansi": "3.0.1",
+            "supports-color": "2.0.0"
           }
         },
         "strip-ansi": {
-          "version": "4.0.0",
-          "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
-          "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+          "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
           "dev": true,
           "requires": {
-            "ansi-regex": "3.0.0"
+            "ansi-regex": "2.1.1"
           }
         }
       }
@@ -1738,6 +1815,15 @@
       "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
       "dev": true
     },
+    "tmp": {
+      "version": "0.0.31",
+      "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz",
+      "integrity": "sha1-jzirlDjhcxXl29izZX6L+yd65Kc=",
+      "dev": true,
+      "requires": {
+        "os-tmpdir": "1.0.2"
+      }
+    },
     "tryit": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz",
@@ -1759,15 +1845,6 @@
       "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
       "dev": true
     },
-    "user-home": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz",
-      "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=",
-      "dev": true,
-      "requires": {
-        "os-homedir": "1.0.2"
-      }
-    },
     "util-deprecate": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
@@ -1779,6 +1856,15 @@
       "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.2.tgz",
       "integrity": "sha1-4xbVJXtAuGu0PLjV/qXX9U1rDKE="
     },
+    "which": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz",
+      "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==",
+      "dev": true,
+      "requires": {
+        "isexe": "2.0.0"
+      }
+    },
     "wordwrap": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
@@ -1800,10 +1886,10 @@
         "mkdirp": "0.5.1"
       }
     },
-    "xtend": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
-      "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=",
+    "yallist": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
+      "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=",
       "dev": true
     }
   }
diff --git a/package.json b/package.json
index 7e41651..408f5f2 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "rollup-plugin-commonjs",
-  "version": "8.1.0",
+  "version": "8.2.0",
   "description": "Convert CommonJS modules to ES2015",
   "main": "dist/rollup-plugin-commonjs.cjs.js",
   "module": "dist/rollup-plugin-commonjs.es.js",
@@ -8,7 +8,7 @@
   "scripts": {
     "test": "mocha",
     "pretest": "npm run build",
-    "build": "rm -rf dist/* && rollup -c",
+    "build": "shx rm -rf dist/* && rollup -c",
     "dev": "rollup -c -w",
     "lint": "eslint src/*.js test/*.js",
     "prepublish": "npm run lint && npm test"
@@ -19,23 +19,23 @@
     "README.md"
   ],
   "dependencies": {
-    "acorn": "^4.0.1",
-    "estree-walker": "^0.3.0",
-    "magic-string": "^0.19.0",
-    "resolve": "^1.1.7",
+    "acorn": "^5.1.1",
+    "estree-walker": "^0.5.0",
+    "magic-string": "^0.22.4",
+    "resolve": "^1.4.0",
     "rollup-pluginutils": "^2.0.1"
   },
   "devDependencies": {
-    "eslint": "^3.5.0",
-    "locate-character": "^2.0.0",
-    "mocha": "^3.0.2",
+    "eslint": "^4.5.0",
+    "locate-character": "^2.0.1",
+    "mocha": "^3.5.0",
     "require-relative": "^0.8.7",
-    "rollup": "^0.40.2",
+    "rollup": "^0.48.2",
     "rollup-plugin-buble": "^0.15.0",
-    "rollup-plugin-node-resolve": "^2.0.0",
-    "rollup-watch": "^3.1.0",
-    "source-map": "^0.5.6",
-    "source-map-support": "^0.4.2"
+    "rollup-plugin-node-resolve": "^3.0.0",
+    "shx": "^0.2.2",
+    "source-map": "^0.5.7",
+    "source-map-support": "^0.4.16"
   },
   "repository": "rollup/rollup-plugin-commonjs",
   "author": "Rich Harris",
diff --git a/rollup.config.js b/rollup.config.js
index b457f61..95c6aef 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -1,26 +1,23 @@
 import buble from 'rollup-plugin-buble';
-
-var pkg = require('./package.json');
-
-var external = Object.keys( require( './package.json' ).dependencies ).concat([ 'fs', 'path' ]);
+import pkg from './package.json';
 
 export default {
-	entry: 'src/index.js',
+	input: 'src/index.js',
 	plugins: [
 		buble({
 			transforms: { dangerousForOf: true }
 		})
 	],
-	external: external,
-	sourceMap: true,
-	targets: [
+	external: Object.keys( pkg.dependencies ).concat([ 'fs', 'path' ]),
+	sourcemap: true,
+	output: [
 		{
 			format: 'es',
-			dest: pkg.module
+			file: pkg.module
 		},
 		{
 			format: 'cjs',
-			dest: pkg.main
+			file: pkg.main
 		}
 	]
 };
diff --git a/src/defaultResolver.js b/src/defaultResolver.js
index 45a282f..ac16b2c 100644
--- a/src/defaultResolver.js
+++ b/src/defaultResolver.js
@@ -19,7 +19,7 @@ function addJsExtensionIfNecessary ( file ) {
 	return null;
 }
 
-const absolutePath = /^(?:\/|(?:[A-Za-z]:)?[\\|\/])/;
+const absolutePath = /^(?:\/|(?:[A-Za-z]:)?[\\|/])/;
 
 function isAbsolute ( path ) {
 	return absolutePath.test( path );
diff --git a/src/index.js b/src/index.js
index 6533ad9..b6e9824 100644
--- a/src/index.js
+++ b/src/index.js
@@ -63,7 +63,7 @@ export default function commonjs ( options = {} ) {
 	const ignoreRequire = typeof options.ignore === 'function' ?
 		options.ignore :
 		Array.isArray( options.ignore ) ? id => ~options.ignore.indexOf( id ) :
-		() => false;
+			() => false;
 
 	let entryModuleIdPromise = null;
 	let entryModuleId = null;
@@ -124,14 +124,14 @@ export default function commonjs ( options = {} ) {
 
 			const isExternal = options.external ?
 				Array.isArray( options.external ) ? id => ~options.external.indexOf( id ) :
-				options.external :
+					options.external :
 				() => false;
 
 			resolvers.unshift( id => isExternal( id ) ? false : null );
 
 			resolveUsingOtherResolvers = first( resolvers );
 
-			entryModuleIdPromise = resolveId( options.entry ).then( resolved => {
+			entryModuleIdPromise = resolveId( options.input || options.entry ).then( resolved => {
 				entryModuleId = resolved;
 			});
 		},
diff --git a/src/utils.js b/src/utils.js
index a98362e..93640ea 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -1,7 +1,13 @@
-import { basename, extname } from 'path';
+import { basename, extname, dirname, sep } from 'path';
 import { makeLegalIdentifier } from 'rollup-pluginutils';
 
 export function getName ( id ) {
-	return makeLegalIdentifier( basename( id, extname( id ) ) );
+	const name = makeLegalIdentifier( basename( id, extname( id ) ) );
+	if (name !== 'index') {
+		return name;
+	} else {
+		const segments = dirname( id ).split( sep );
+		return makeLegalIdentifier( segments[segments.length - 1] );
+	}
 }
 
diff --git a/test/samples/rename-index/invalid-var/index.js b/test/samples/rename-index/invalid-var/index.js
new file mode 100644
index 0000000..57fba0b
--- /dev/null
+++ b/test/samples/rename-index/invalid-var/index.js
@@ -0,0 +1 @@
+module.exports = 'invalid';
diff --git a/test/samples/rename-index/main.js b/test/samples/rename-index/main.js
new file mode 100644
index 0000000..27dea0f
--- /dev/null
+++ b/test/samples/rename-index/main.js
@@ -0,0 +1,5 @@
+import invalid from './invalid-var';
+import valid from './validVar';
+import other from './other/nonIndex';
+
+console.log(invalid, valid, other);
diff --git a/test/samples/rename-index/other/nonIndex.js b/test/samples/rename-index/other/nonIndex.js
new file mode 100644
index 0000000..66de3ec
--- /dev/null
+++ b/test/samples/rename-index/other/nonIndex.js
@@ -0,0 +1 @@
+module.exports = 'not an index file';
diff --git a/test/samples/rename-index/validVar/index.js b/test/samples/rename-index/validVar/index.js
new file mode 100644
index 0000000..60540be
--- /dev/null
+++ b/test/samples/rename-index/validVar/index.js
@@ -0,0 +1 @@
+module.exports = 'valid';
diff --git a/test/test.js b/test/test.js
index e3b15df..e0291f9 100644
--- a/test/test.js
+++ b/test/test.js
@@ -47,11 +47,11 @@ function execute ( code, context = {} ) {
 	};
 }
 
-function executeBundle ( bundle, { context, exports } = {} ) {
+async function executeBundle ( bundle, { context, exports } = {} ) {
 	const options = { format: 'cjs' };
 	if ( exports ) options.exports = exports;
 
-	const { code } = bundle.generate( options );
+	const { code } = await bundle.generate( options );
 	return execute( code, context );
 }
 
@@ -68,7 +68,7 @@ describe( 'rollup-plugin-commonjs', () => {
 
 			( config.solo ? it.only : it )( dir, () => {
 				const { transform, options } = commonjs( config.options );
-				options({ entry: 'main.js' });
+				options({ input: 'main.js' });
 
 				const input = fs.readFileSync( `form/${dir}/input.js`, 'utf-8' );
 				const expected = fs.readFileSync( `form/${dir}/output.js`, 'utf-8' ).trim();
@@ -91,130 +91,128 @@ describe( 'rollup-plugin-commonjs', () => {
 				config = {};
 			}
 
-			( config.solo ? it.only : it )( dir, () => {
+			( config.solo ? it.only : it )( dir, async () => {
 				const options = Object.assign({
-					entry: `function/${dir}/main.js`,
+					input: `function/${dir}/main.js`,
 					plugins: [ commonjs( config.pluginOptions ) ]
 				}, config.options || {} );
 
-				return rollup( options ).then( bundle => {
-					const { code } = bundle.generate({ format: 'cjs' });
-					if ( config.show || config.solo ) {
-						console.error( code );
-					}
+				const bundle = await rollup( options );
+				const { code } = await bundle.generate({ format: 'cjs' });
+				if ( config.show || config.solo ) {
+					console.error( code );
+				}
 
-					const { exports, global } = execute( code, config.context );
+				const { exports, global } = execute( code, config.context );
 
-					if ( config.exports ) config.exports( exports );
-					if ( config.global ) config.global( global );
-				});
+				if ( config.exports ) config.exports( exports );
+				if ( config.global ) config.global( global );
 			});
 		});
 	});
 
 	describe( 'misc tests', () => {
 		// most of these should be moved over to function...
-		it( 'generates a sourcemap', () => {
-			return rollup({
-				entry: 'samples/sourcemap/main.js',
+		it( 'generates a sourcemap', async () => {
+			const bundle = await rollup({
+				input: 'samples/sourcemap/main.js',
 				plugins: [ commonjs({ sourceMap: true }) ]
-			}).then( bundle => {
-				const generated = bundle.generate({
-					format: 'cjs',
-					sourceMap: true,
-					sourceMapFile: path.resolve( 'bundle.js' )
-				});
+			});
 
-				const smc = new SourceMapConsumer( generated.map );
-				const locator = getLocator( generated.code, { offsetLine: 1 });
+			const generated = await bundle.generate({
+				format: 'cjs',
+				sourceMap: true,
+				sourceMapFile: path.resolve( 'bundle.js' )
+			});
 
-				let generatedLoc = locator( '42' );
-				let loc = smc.originalPositionFor( generatedLoc ); // 42
-				assert.equal( loc.source, 'samples/sourcemap/foo.js' );
-				assert.equal( loc.line, 1 );
-				assert.equal( loc.column, 15 );
+			const smc = new SourceMapConsumer( generated.map );
+			const locator = getLocator( generated.code, { offsetLine: 1 });
 
-				generatedLoc = locator( 'log' );
-				loc = smc.originalPositionFor( generatedLoc ); // log
-				assert.equal( loc.source, 'samples/sourcemap/main.js' );
-				assert.equal( loc.line, 2 );
-				assert.equal( loc.column, 8 );
-			});
+			let generatedLoc = locator( '42' );
+			let loc = smc.originalPositionFor( generatedLoc ); // 42
+			assert.equal( loc.source, 'samples/sourcemap/foo.js' );
+			assert.equal( loc.line, 1 );
+			assert.equal( loc.column, 15 );
+
+			generatedLoc = locator( 'log' );
+			loc = smc.originalPositionFor( generatedLoc ); // log
+			assert.equal( loc.source, 'samples/sourcemap/main.js' );
+			assert.equal( loc.line, 2 );
+			assert.equal( loc.column, 8 );
 		});
 
-		it( 'handles references to `global`', () => {
-			return rollup({
-				entry: 'samples/global/main.js',
+		it( 'handles references to `global`', async () => {
+			const bundle = await rollup({
+				input: 'samples/global/main.js',
 				plugins: [ commonjs() ]
-			}).then( bundle => {
-				const generated = bundle.generate({
-					format: 'cjs'
-				});
+			});
 
-				const mockWindow = {};
-				const mockGlobal = {};
-				const mockSelf = {};
+			const generated = await bundle.generate({
+				format: 'cjs'
+			});
 
-				const fn = new Function ( 'module', 'window', 'global', 'self', generated.code );
+			const mockWindow = {};
+			const mockGlobal = {};
+			const mockSelf = {};
 
-				fn( {}, mockWindow, mockGlobal,  mockSelf);
-				assert.equal( mockWindow.foo, 'bar', generated.code );
-				assert.equal( mockGlobal.foo, undefined, generated.code );
-				assert.equal( mockSelf.foo, undefined, generated.code );
+			const fn = new Function ( 'module', 'window', 'global', 'self', generated.code );
 
-				fn( {}, undefined, mockGlobal,  mockSelf );
-				assert.equal( mockGlobal.foo, 'bar', generated.code );
-				assert.equal( mockSelf.foo, undefined, generated.code );
+			fn( {}, mockWindow, mockGlobal,  mockSelf);
+			assert.equal( mockWindow.foo, 'bar', generated.code );
+			assert.equal( mockGlobal.foo, undefined, generated.code );
+			assert.equal( mockSelf.foo, undefined, generated.code );
 
-				fn( {}, undefined, undefined, mockSelf );
-				assert.equal( mockSelf.foo, 'bar', generated.code );
+			fn( {}, undefined, mockGlobal,  mockSelf );
+			assert.equal( mockGlobal.foo, 'bar', generated.code );
+			assert.equal( mockSelf.foo, undefined, generated.code );
 
-			});
+			fn( {}, undefined, undefined, mockSelf );
+			assert.equal( mockSelf.foo, 'bar', generated.code );
 		});
 
-		it( 'handles multiple references to `global`', () => {
-			return rollup({
-				entry: 'samples/global-in-if-block/main.js',
+		it( 'handles multiple references to `global`', async () => {
+			const bundle = await rollup({
+				input: 'samples/global-in-if-block/main.js',
 				plugins: [ commonjs() ]
-			}).then( bundle => {
-				const generated = bundle.generate({
-					format: 'cjs'
-				});
+			});
 
-				const fn = new Function ( 'module', 'exports', 'window', generated.code );
+			const generated = await bundle.generate({
+				format: 'cjs'
+			});
 
-				const module = { exports: {} };
-				const window = {};
+			const fn = new Function ( 'module', 'exports', 'window', generated.code );
 
-				fn( module, module.exports, window );
-				assert.equal( window.count, 1 );
+			const module = { exports: {} };
+			const window = {};
 
-				fn( module, module.exports, window );
-				assert.equal( window.count, 2 );
-			});
+			fn( module, module.exports, window );
+			assert.equal( window.count, 1 );
+
+			fn( module, module.exports, window );
+			assert.equal( window.count, 2 );
 		});
 
-		it( 'handles transpiled CommonJS modules', () => {
-			return rollup({
-				entry: 'samples/corejs/literal-with-default.js',
+		it( 'handles transpiled CommonJS modules', async () => {
+			const bundle = await rollup({
+				input: 'samples/corejs/literal-with-default.js',
 				plugins: [ commonjs() ]
-			}).then( bundle => {
-				const generated = bundle.generate({
-					format: 'cjs'
-				});
+			});
 
-				const module = { exports: {} };
+			const generated = await bundle.generate({
+				format: 'cjs'
+			});
 
-				const fn = new Function ( 'module', 'exports', generated.code );
-				fn( module, module.exports );
+			const module = { exports: {} };
 
-				assert.equal( module.exports, 'foobar', generated.code );
-			});
+			const fn = new Function ( 'module', 'exports', generated.code );
+			fn( module, module.exports );
+
+			assert.equal( module.exports, 'foobar', generated.code );
 		});
 
-		it( 'allows named exports to be added explicitly via config', () => {
-			return rollup({
-				entry: 'samples/custom-named-exports/main.js',
+		it( 'allows named exports to be added explicitly via config', async () => {
+			const bundle = await rollup({
+				input: 'samples/custom-named-exports/main.js',
 				plugins: [
 					resolve({ main: true }),
 					commonjs({
@@ -224,12 +222,14 @@ describe( 'rollup-plugin-commonjs', () => {
 						}
 					})
 				]
-			}).then( executeBundle );
+			});
+
+			await executeBundle( bundle );
 		});
 
-		it( 'ignores false positives with namedExports (#36)', () => {
-			return rollup({
-				entry: 'samples/custom-named-exports-false-positive/main.js',
+		it( 'ignores false positives with namedExports (#36)', async () => {
+			const bundle = await rollup({
+				input: 'samples/custom-named-exports-false-positive/main.js',
 				plugins: [
 					resolve({ main: true }),
 					commonjs({
@@ -238,21 +238,23 @@ describe( 'rollup-plugin-commonjs', () => {
 						}
 					})
 				]
-			}).then( executeBundle );
+			});
+
+			await executeBundle( bundle );
 		});
 
-		it( 'converts a CommonJS module with custom file extension', () => {
-			return rollup({
-				entry: 'samples/extension/main.coffee',
+		it( 'converts a CommonJS module with custom file extension', async () => {
+			const bundle = await rollup({
+				input: 'samples/extension/main.coffee',
 				plugins: [ commonjs({ extensions: ['.coffee' ]}) ]
-			}).then( bundle => {
-				assert.equal( executeBundle( bundle ).exports, 42 );
 			});
+
+			assert.equal( (await executeBundle( bundle )).exports, 42 );
 		});
 
-		it( 'can ignore references to `global`', () => {
-			return rollup({
-				entry: 'samples/ignore-global/main.js',
+		it( 'can ignore references to `global`', async () => {
+			const bundle = await rollup({
+				input: 'samples/ignore-global/main.js',
 				plugins: [
 					commonjs({ ignoreGlobal: true })
 				],
@@ -260,105 +262,105 @@ describe( 'rollup-plugin-commonjs', () => {
 					if ( warning.code === 'THIS_IS_UNDEFINED' ) return;
 					console.warn( warning.message );
 				}
-			}).then( bundle => {
-				const generated = bundle.generate({
-					format: 'cjs'
-				});
-
-				const { exports, global } = executeBundle( bundle );
+			});
 
-				assert.equal( exports.immediate1, global.setImmediate, generated.code );
-				assert.equal( exports.immediate2, global.setImmediate, generated.code );
-				assert.equal( exports.immediate3, null, generated.code );
+			const generated = await bundle.generate({
+				format: 'cjs'
 			});
+
+			const { exports, global } = await executeBundle( bundle );
+
+			assert.equal( exports.immediate1, global.setImmediate, generated.code );
+			assert.equal( exports.immediate2, global.setImmediate, generated.code );
+			assert.equal( exports.immediate3, null, generated.code );
 		});
 
-		it( 'can handle parens around right have node while producing default export', () => {
-			return rollup({
-				entry: 'samples/paren-expression/index.js',
+		it( 'can handle parens around right have node while producing default export', async () => {
+			const bundle = await rollup({
+				input: 'samples/paren-expression/index.js',
 				plugins: [ commonjs() ]
-			}).then( bundle => {
-				assert.equal( executeBundle( bundle ).exports, 42 );
 			});
+
+			assert.equal( (await executeBundle( bundle )).exports, 42 );
 		});
 
 		describe( 'typeof transforms', () => {
-			it( 'correct-scoping', () => {
-				return rollup({
-					entry: 'samples/umd/correct-scoping.js',
+			it( 'correct-scoping', async () => {
+				const bundle = await rollup({
+					input: 'samples/umd/correct-scoping.js',
 					plugins: [ commonjs() ]
-				}).then( bundle => {
-					assert.equal( executeBundle( bundle ).exports, 'object' );
 				});
+
+				assert.equal( (await executeBundle( bundle )).exports, 'object' );
 			});
 
-			it( 'protobuf', () => {
-				return rollup({
-					entry: 'samples/umd/protobuf.js',
+			it( 'protobuf', async () => {
+				const bundle = await rollup({
+					input: 'samples/umd/protobuf.js',
 					external: [ 'bytebuffer' ],
 					plugins: [ commonjs() ]
-				}).then( bundle => {
-					assert.equal( executeBundle( bundle ).exports, true );
 				});
+
+				assert.equal( (await executeBundle( bundle )).exports, true );
 			});
 
-			it( 'sinon', () => {
-				return rollup({
-					entry: 'samples/umd/sinon.js',
+			it( 'sinon', async () => {
+				const bundle = await rollup({
+					input: 'samples/umd/sinon.js',
 					plugins: [ commonjs() ]
-				}).then( bundle => {
-					const code = bundle.generate({ format: 'es' }).code;
-
-					assert.equal( code.indexOf( 'typeof require' ), -1, code );
-					// assert.notEqual( code.indexOf( 'typeof module' ), -1, code ); // #151 breaks this test
-					// assert.notEqual( code.indexOf( 'typeof define' ), -1, code ); // #144 breaks this test
 				});
+
+				const { code } = await bundle.generate({ format: 'es' });
+
+				assert.equal( code.indexOf( 'typeof require' ), -1, code );
+				// assert.notEqual( code.indexOf( 'typeof module' ), -1, code ); // #151 breaks this test
+				// assert.notEqual( code.indexOf( 'typeof define' ), -1, code ); // #144 breaks this test
 			});
 		});
 
-		it( 'deconflicts helper name', () => {
-			return rollup({
-				entry: 'samples/deconflict-helpers/main.js',
+		it( 'deconflicts helper name', async () => {
+			const bundle = await rollup({
+				input: 'samples/deconflict-helpers/main.js',
 				plugins: [ commonjs() ]
-			}).then( executeBundle ).then( ({ exports }) => {
-				assert.notEqual( exports, 'nope' );
 			});
+
+			const { exports } = await executeBundle( bundle );
+			assert.notEqual( exports, 'nope' );
 		});
 
-		it( 'deconflicts reserved keywords', () => {
-			return rollup({
-				entry: 'samples/reserved-as-property/main.js',
+		it( 'deconflicts reserved keywords', async () => {
+			const bundle = await rollup({
+				input: 'samples/reserved-as-property/main.js',
 				plugins: [ commonjs() ]
-			})
-			.then( bundle => {
-				assert.doesNotThrow(() => {
-					const reservedProp = executeBundle( bundle, { exports: 'named' }).exports.delete;
-					assert.equal(reservedProp, 'foo');
-				});
 			});
+
+			const reservedProp = (await executeBundle( bundle, { exports: 'named' })).exports.delete;
+			assert.equal(reservedProp, 'foo');
 		});
 
-		it( 'does not process the entry file when it has a leading "." (issue #63)', () => {
-			return rollup({
-				entry: './function/basic/main.js',
+		it( 'does not process the entry file when it has a leading "." (issue #63)', async () => {
+			const bundle = await rollup({
+				input: './function/basic/main.js',
 				plugins: [ commonjs() ]
-			}).then( executeBundle );
+			});
+
+			await executeBundle( bundle );
 		});
 
-		it( 'does not reexport named contents', () => {
-			return rollup({
-				entry: 'samples/reexport/main.js',
-				plugins: [ commonjs() ]
-			})
-			.then( executeBundle )
-			.catch( error => {
+		it( 'does not reexport named contents', async () => {
+			try {
+				await rollup({
+					input: 'samples/reexport/main.js',
+					plugins: [ commonjs() ]
+				});
+			} catch (error) {
 				assert.equal( error.message, `'named' is not exported by samples${path.sep}reexport${path.sep}reexport.js` );
-			});
+			}
 		});
 
-		it( 'respects other plugins', () => {
-			return rollup({
-				entry: 'samples/other-transforms/main.js',
+		it( 'respects other plugins', async () => {
+			const bundle = await rollup({
+				input: 'samples/other-transforms/main.js',
 				plugins: [
 					{
 						transform ( code, id ) {
@@ -368,41 +370,55 @@ describe( 'rollup-plugin-commonjs', () => {
 					},
 					commonjs()
 				]
-			}).then( executeBundle );
+			});
+
+			await executeBundle( bundle );
 		});
 
-		it( 'rewrites top-level defines', () => {
-			return rollup({
-				entry: 'samples/define-is-undefined/main.js',
+		it( 'rewrites top-level defines', async () => {
+			const bundle = await rollup({
+				input: 'samples/define-is-undefined/main.js',
 				plugins: [ commonjs() ]
-			})
-			.then( bundle => {
-				function define () {
-					throw new Error( 'nope' );
-				}
+			});
 
-				define.amd = true;
+			function define () {
+				throw new Error( 'nope' );
+			}
 
-				const { exports } = executeBundle( bundle, { context: { define } });
-				assert.equal( exports, 42 );
-			});
+			define.amd = true;
+
+			const { exports } = await executeBundle( bundle, { context: { define } });
+			assert.equal( exports, 42 );
 		});
 
-		it( 'respects options.external', () => {
-			return rollup({
-				entry: 'samples/external/main.js',
+		it( 'respects options.external', async () => {
+			const bundle = await rollup({
+				input: 'samples/external/main.js',
 				plugins: [
 					resolve(),
 					commonjs()
 				],
 				external: ['baz']
+			});
+
+			const { code } = await bundle.generate({ format: 'cjs' });
+			assert.equal( code.indexOf( 'hello' ), -1 );
+
+			const { exports } = await executeBundle( bundle );
+			assert.equal( exports, 'HELLO' );
+		});
+
+		it( 'prefers to set name using directory for index files', () => {
+			return rollup({
+				entry: 'samples/rename-index/main.js',
+				plugins: [ commonjs() ]
 			})
 			.then( async bundle => {
 				const { code } = await bundle.generate({ format: 'cjs' });
-				assert.equal( code.indexOf( 'hello' ), -1 );
-
-				const { exports } = executeBundle( bundle );
-				assert.equal( exports, 'HELLO' );
+				assert.equal( code.indexOf( 'var index' ), -1 );
+				assert.notEqual( code.indexOf( 'var invalidVar' ), -1 );
+				assert.notEqual( code.indexOf( 'var validVar' ), -1 );
+				assert.notEqual( code.indexOf( 'var nonIndex' ), -1 );
 			});
 		});
 	});

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-rollup-plugin-commonjs.git



More information about the Pkg-javascript-commits mailing list