Compare commits

...

4 Commits

Author SHA1 Message Date
Sebastian McKenzie
8565e2b4e5 v5.2.11 2015-05-04 22:32:28 +01:00
Sebastian McKenzie
4317a46a3e add 5.2.11 changelog 2015-05-04 22:31:44 +01:00
Sebastian McKenzie
81ca29adc3 5.2.10 2015-05-04 22:31:38 +01:00
Sebastian McKenzie
c1a6ff7f44 rename getModuleName option to getModuleId 2015-05-04 22:31:34 +01:00
7 changed files with 25 additions and 14 deletions

View File

@@ -13,6 +13,18 @@ _Note: Gaps between patch versions are faulty/broken releases._
See [CHANGELOG - 6to5](CHANGELOG-6to5.md) for the pre-4.0.0 version changelog.
## 5.2.11
* **Internal**
* Rename `getModuleName` option to `getModuleId`, doh.
## 5.2.10
* **Bug Fix**
* Fix numerous issues in `replaceWithSourceString`. Thanks [@pangratz](https://github.com/pangratz)!
* **New Feature**
* Add `getModuleName` option. Thanks [@jayphelps](https://github.com/jayphelps)!
## 5.2.9
* **Bug Fix**

View File

@@ -1,7 +1,7 @@
{
"name": "babel-core",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "5.2.10",
"version": "5.2.11",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
"repository": "babel/babel",

View File

@@ -1,13 +1,13 @@
{
"name": "babel",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "5.2.9",
"version": "5.2.10",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
"repository": "babel/babel",
"preferGlobal": true,
"dependencies": {
"babel-core": "^5.2.9",
"babel-core": "^5.2.10",
"chokidar": "^1.0.0",
"commander": "^2.6.0",
"convert-source-map": "^1.1.0",

View File

@@ -1,7 +1,7 @@
{
"name": "babel-runtime",
"description": "babel selfContained runtime",
"version": "5.2.9",
"version": "5.2.10",
"repository": "babel/babel",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"dependencies": {

View File

@@ -25,7 +25,7 @@
"type": "string"
},
"getModuleName": {
"getModuleId": {
"hidden": true
},

View File

@@ -185,8 +185,8 @@ export default class DefaultFormatter {
getModuleName() {
var opts = this.file.opts;
// moduleId is n/a if a `getModuleName()` is provided
if (opts.moduleId && !opts.getModuleName) {
// moduleId is n/a if a `getModuleId()` is provided
if (opts.moduleId && !opts.getModuleId) {
return opts.moduleId;
}
@@ -217,10 +217,9 @@ export default class DefaultFormatter {
// normalize path separators
moduleName = moduleName.replace(/\\/g, "/");
if (opts.getModuleName) {
// If return is falsy, assume they want us to use
// our generated default name
return opts.getModuleName(moduleName) || moduleName;
if (opts.getModuleId) {
// If return is falsy, assume they want us to use our generated default name
return opts.getModuleId(moduleName) || moduleName;
} else {
return moduleName;
}

View File

@@ -18,8 +18,8 @@ suite("api", function () {
assert.ok(!result.ast);
});
suite("getModuleName() {} option", function () {
// As of this commit, `getModuleName` is the only option that isn't JSON
suite("getModuleId() {} option", function () {
// As of this commit, `getModuleId` is the only option that isn't JSON
// compatible which is why it's not inside /test/core/fixtures/transformation
function getModuleNameTest(moduleFormat, expected) {
@@ -27,7 +27,7 @@ suite("api", function () {
filename: "foo/bar/index",
modules: moduleFormat,
moduleIds: true,
getModuleName: function (name) {
getModuleId: function (name) {
return name.replace(/\/index$/, "");
}
});