From 4043618d71056e8df7330310d0e2dc8d6d1c51f9 Mon Sep 17 00:00:00 2001 From: Yucho Ho Date: Thu, 21 Jun 2018 20:15:59 -0700 Subject: [PATCH 1/3] Fix: broken update from commit bf3c458 --- index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 39fa968..4aae89f 100644 --- a/index.js +++ b/index.js @@ -15,8 +15,8 @@ module.exports = function metalsmithBabel(options) { options = Object.assign({}, options); let noFilesRenamed = true; - return function metalsmithBabelPlugin(files, metalsmith) { - for (const originalFilename of Object.keys(files)) { + return function metalsmithBabelPlugin(files, metalsmith, done) { + Object.keys(files).forEach(originalFilename => { const ext = extname(originalFilename).toLowerCase(); if (ext !== '.js' && ext !== '.mjs' && ext !== '.jsx') { return; @@ -51,12 +51,13 @@ module.exports = function metalsmithBabel(options) { } files[filename].contents = SafeBuffer.from(result.code); - } + }); if (noFilesRenamed) { - return; + return done(); } toFastProperties(files); + return done(); }; }; From 6675cbb60db475c009a94ee3b3eaf5995cc1f323 Mon Sep 17 00:00:00 2001 From: Yucho Ho Date: Thu, 21 Jun 2018 21:49:57 -0700 Subject: [PATCH 2/3] Change request #6 and increment build number --- index.js | 11 +++++------ package.json | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 4aae89f..f9d13b6 100644 --- a/index.js +++ b/index.js @@ -15,11 +15,11 @@ module.exports = function metalsmithBabel(options) { options = Object.assign({}, options); let noFilesRenamed = true; - return function metalsmithBabelPlugin(files, metalsmith, done) { - Object.keys(files).forEach(originalFilename => { + return function metalsmithBabelPlugin(files, metalsmith) { + for (const originalFilename of Object.keys(files)) { const ext = extname(originalFilename).toLowerCase(); if (ext !== '.js' && ext !== '.mjs' && ext !== '.jsx') { - return; + continue; } const filename = originalFilename.replace(/\.jsx$/i, '.js'); @@ -51,13 +51,12 @@ module.exports = function metalsmithBabel(options) { } files[filename].contents = SafeBuffer.from(result.code); - }); + } if (noFilesRenamed) { - return done(); + return; } toFastProperties(files); - return done(); }; }; diff --git a/package.json b/package.json index 38b06a2..79e4d45 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metalsmith-babel", - "version": "4.2.1", + "version": "4.2.2", "description": "Babel plugin for Metalsmith", "repository": "babel/metalsmith-babel", "author": "Shinnosuke Watanabe (https://github.com/shinnn)", From 94aa78f1d38f7e631ac30407801a827f003a69b6 Mon Sep 17 00:00:00 2001 From: Yucho Ho Date: Thu, 21 Jun 2018 22:26:45 -0700 Subject: [PATCH 3/3] Build number reverted --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 79e4d45..38b06a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metalsmith-babel", - "version": "4.2.2", + "version": "4.2.1", "description": "Babel plugin for Metalsmith", "repository": "babel/metalsmith-babel", "author": "Shinnosuke Watanabe (https://github.com/shinnn)",