From 1673f78ab5d7ac99086df689fb9e4a56d97a38e0 Mon Sep 17 00:00:00 2001 From: Alberto Leal Date: Mon, 15 Dec 2014 00:35:17 -0500 Subject: [PATCH 1/2] Clarify usage in node env --- doc/usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/usage.md b/doc/usage.md index 4a474def03..23119e367b 100644 --- a/doc/usage.md +++ b/doc/usage.md @@ -167,7 +167,7 @@ to5.transformFile("filename.js", options, function (err, result) { All subsequent files required by node with the extensions `.es6` and `.js` will be transformed by 6to5. The polyfill specified in [Polyfill](polyfill.md) is -also required. +also required; but this is automatically loaded when using: ```javascript require("6to5/register"); From 104b1f4c9b49482c99c9d0733abddd4b9ac58955 Mon Sep 17 00:00:00 2001 From: Douglas Duteil Date: Wed, 10 Dec 2014 02:39:33 +0100 Subject: [PATCH 2/2] feat(system-module): rewrite --- lib/6to5/transformation/modules/system.js | 488 ++++++++++++------ .../exports-named/expected.js | 26 - .../exports-default/actual.js | 0 .../exports-default/expected.js | 2 - .../exports-from/actual.js | 0 .../exports-from/expected.js | 22 +- .../exports-named/actual.js | 0 .../exports-named/expected.js | 24 + .../exports-variable/actual.js | 0 .../exports-variable/expected.js | 1 - .../hoist-function-exports/actual.js | 0 .../hoist-function-exports/expected.js | 0 .../imports-default/actual.js | 0 .../imports-default/expected.js | 0 .../imports-glob/actual.js | 0 .../imports-glob/expected.js | 0 .../imports-mixing/actual.js | 0 .../imports-mixing/expected.js | 0 .../imports-named/actual.js | 0 .../imports-named/expected.js | 0 .../imports/actual.js | 0 .../imports/expected.js | 0 .../options.json | 0 .../overview/actual.js | 0 .../overview/expected.js | 0 25 files changed, 368 insertions(+), 195 deletions(-) delete mode 100644 test/fixtures/transformation/.es6-modules-system/exports-named/expected.js rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/exports-default/actual.js (100%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/exports-default/expected.js (99%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/exports-from/actual.js (100%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/exports-from/expected.js (59%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/exports-named/actual.js (100%) create mode 100644 test/fixtures/transformation/es6-modules-system/exports-named/expected.js rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/exports-variable/actual.js (100%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/exports-variable/expected.js (99%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/hoist-function-exports/actual.js (100%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/hoist-function-exports/expected.js (100%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/imports-default/actual.js (100%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/imports-default/expected.js (100%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/imports-glob/actual.js (100%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/imports-glob/expected.js (100%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/imports-mixing/actual.js (100%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/imports-mixing/expected.js (100%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/imports-named/actual.js (100%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/imports-named/expected.js (100%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/imports/actual.js (100%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/imports/expected.js (100%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/options.json (100%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/overview/actual.js (100%) rename test/fixtures/transformation/{.es6-modules-system => es6-modules-system}/overview/expected.js (100%) diff --git a/lib/6to5/transformation/modules/system.js b/lib/6to5/transformation/modules/system.js index 73ddc6f107..a06706f8b1 100644 --- a/lib/6to5/transformation/modules/system.js +++ b/lib/6to5/transformation/modules/system.js @@ -1,58 +1,349 @@ module.exports = SystemFormatter; -var util = require("../../util"); -var t = require("../../types"); -var _ = require("lodash"); +var util = require("../../util"); +var t = require("../../types"); +var traverse = require("../../traverse"); +var _ = require("lodash"); -var SETTER_MODULE_NAMESPACE = t.identifier("m"); -var DEFAULT_IDENTIFIER = t.identifier("default"); -var NULL_SETTER = t.literal(null); +var SETTER_MODULE_NAMESPACE = t.identifier("m"); +var PRIVATE_MODULE_NAME_IDENTIFIER = t.identifier("__moduleName"); +var DEFAULT_IDENTIFIER = t.identifier("default"); +var NULL_SETTER = t.literal(null); function SystemFormatter(file) { + this.moduleNameLiteral = null; this.exportedStatements = []; - this.importedModule = {}; + this.moduleDependencies = {}; + this.importedVariables = {}; this.exportIdentifier = file.generateUidIdentifier("export"); this.file = file; + + /** + * @type Function + * @param {Array} args - The arguments of the "_export(...args)" function + * @return {Object} The expression statement with the call expression. + */ + this._makeExportStatements = _.compose( + t.expressionStatement, + // will generate the call expression : _export(...args) + _.partial(t.callExpression, this.exportIdentifier) + ); } +SystemFormatter.prototype.import = + SystemFormatter.prototype.export = function (node, nodes) { + nodes.push(node); + }; + +SystemFormatter.prototype.importSpecifier = + SystemFormatter.prototype.exportSpecifier = function (specifier, node, nodes) { + if (!nodes.length) nodes.push(node); + }; + SystemFormatter.prototype.transform = function (ast) { - var program = ast.program; - var body = program.body; + + var systemTransform = this; // extract the module name - var moduleName = this.file.opts.filename - .replace(/^.*\//, "").replace(/\..*$/, ""); + this.moduleNameLiteral = t.literal( + this.file.opts.filename.replace(/^.*\//, "").replace(/\..*$/, "") + ); - // build an array of module names - var dependencies = Object.keys(this.importedModule).map(t.literal); + // Post extraction of the import/export declaration + traverse(ast, function (node) { + var replacementNode = null; + /** + * Process the current node with an extractor. + * @param {Function} extractor Extract the node data + * @returns {*} Can be a `node` (for replacement), void 0 (for removing) + * or false. + */ + function processTheNode(extractor) { + var result = extractor.call(systemTransform, node); + result = (result === void 0) ? [] : result; + replacementNode = result || replacementNode; + return !!replacementNode; + } + + _.some([ + // Import + SystemFormatter.prototype._extractImportSpecifiers, + SystemFormatter.prototype._extractImport, + + // Export + SystemFormatter.prototype._extractExportDefault, + SystemFormatter.prototype._extractExportVariableDeclaration, + SystemFormatter.prototype._extractExportFunctionDeclaration, + SystemFormatter.prototype._extractExportSpecifiers + ], + processTheNode + ); + + return replacementNode; + }); + + // Other + this._prependImportVariables(ast); + this._prependPrivateModuleName(ast); + this._appendModuleReturnStatement(ast); + this._wrapInSystemRegisterCallExpression(ast); +}; + +// +// Import extraction +// + +SystemFormatter.prototype._extractImportSpecifiers = function (node) { + + var systemTransform = this; + + if (!(t.isImportDeclaration(node) && node.specifiers && node.specifiers.length )) { + return false; + } + + _.each(node.specifiers, function (specifier) { + + var variableName = t.getSpecifierName(specifier); + + if (specifier.default) { + specifier.id = DEFAULT_IDENTIFIER; + } + + var right = SETTER_MODULE_NAMESPACE; + if (!t.isImportBatchSpecifier(specifier)) { + right = t.memberExpression(right, specifier.id); + } + systemTransform.importedVariables[variableName.name] = true; + systemTransform._addImportStatement(node.source.value, t.expressionStatement( + t.assignmentExpression("=", variableName, right) + )); + + }); +}; + +SystemFormatter.prototype._extractImport = function (node) { + if (!(t.isImportDeclaration(node))) { + return false; + } + + this._addImportStatement(node.source.value); +}; + +// +// Export extraction +// + +SystemFormatter.prototype._extractExportDefault = function (node) { + if (!(t.isExportDeclaration(node) && node.default)) { + return false; + } + + var declar = node.declaration; + var variableName = DEFAULT_IDENTIFIER.name; + var returnNode; + + if (t.isFunction(declar)) { + if (!declar.id) { + declar.id = this.file.generateUidIdentifier("anonymous"); + } + returnNode = t.toStatement(declar); + declar = declar.id; + } + + this._addToExportStatements(variableName, declar); + + return returnNode; +}; + +SystemFormatter.prototype._extractExportVariableDeclaration = function (node) { + var systemTransform = this; + var declar = node.declaration; + + if (!(t.isExportDeclaration(node) && t.isVariableDeclaration(declar))) { + return false; + } + + function separateDeclarationAndInit(memo, varDeclar) { + memo.varDeclaration.push(_.omit(varDeclar, "init")); + systemTransform._addToExportStatements(varDeclar.id.name, varDeclar); + return memo; + } + + var declarationSeparation = _.reduce( + declar.declarations, + separateDeclarationAndInit, + { varDeclaration: [], varInitialization: [] } + ); + + return _.assign(declar, { declarations: declarationSeparation.varDeclaration }); +}; + +SystemFormatter.prototype._extractExportFunctionDeclaration = function (node) { + var declar = node.declaration; + + if (!(t.isExportDeclaration(node) && t.isFunctionDeclaration(declar))) { + return false; + } + this._addToExportStatements(declar.id.name, declar.id); + return declar; + +}; + +SystemFormatter.prototype._extractExportSpecifiers = function (node) { + var systemTransform = this; + + if (!( t.isExportDeclaration(node) && node.specifiers )) { + return false; + } + + _.each(node.specifiers, function (specifier) { + + // Run each, break when one is true. + _.some([ + SystemFormatter.prototype._extractExportBatch, + SystemFormatter.prototype._extractExportFrom, + SystemFormatter.prototype._extractExportNamed + ], function (extractor) { + var result = extractor.call(systemTransform, specifier, node); + return result === void 0 || result; + }); + + }); + + // Note: here we don't care about the node replacement. + // The current node will always be removed. + // So no return. +}; + +SystemFormatter.prototype._extractExportBatch = function (specifier, node) { + + if (!(node.source && t.isExportBatchSpecifier(specifier))) { + return false; + } + + var exportBatch = this._makeExportWildcard(SETTER_MODULE_NAMESPACE); + this._addImportStatement(node.source.value, exportBatch); +}; + +SystemFormatter.prototype._extractExportFrom = function (specifier, node) { + + // Weak test here... + if (!(node.source)) { + return false; + } + + var variableName = t.getSpecifierName(specifier); + + var target = t.memberExpression( + SETTER_MODULE_NAMESPACE, + specifier.id + ); + + var exportSelection = this._makeExportStatements([ + t.literal(variableName.name), target + ]); + + this._addImportStatement(node.source.value, exportSelection); +}; + +SystemFormatter.prototype._extractExportNamed = function (specifier) { + + // Last case... + // Dunno what to test here... + + var variableName = t.getSpecifierName(specifier); + this._addToExportStatements(variableName.name, specifier.id); +}; + +// +// Utils collection handler +// + +SystemFormatter.prototype._addToExportStatements = function (name, identifier) { + this.exportedStatements.push( + this._makeExportStatements([t.literal(name), identifier]) + ); +}; + +/** + * Generate a export wildcard expression + * /!\ this is a hack over the existing "exports-wildcard" template + * @param objectIdentifier + * @returns the export wildcard expression + * @private + */ +SystemFormatter.prototype._makeExportWildcard = function (objectIdentifier) { + + var exportStatement = util.template("exports-wildcard", { + OBJECT: objectIdentifier + }, true); + + delete exportStatement.expression.callee.expression._scopeReferences; + + var forStatement = exportStatement.expression.callee.expression.body.body[0]; + var iteratorIdentifier = forStatement.left.declarations[0].id; + var target = t.memberExpression( + forStatement.right, + iteratorIdentifier, + true + ); + + forStatement.body.body = [ + this._makeExportStatements([iteratorIdentifier, target]) + ]; + + return exportStatement; +}; + +SystemFormatter.prototype._addImportStatement = function (name, importStatement) { + this.moduleDependencies[name] = this.moduleDependencies[name] || []; + importStatement && this.moduleDependencies[name].push(importStatement); +}; + +// +// Additional body content +// + +SystemFormatter.prototype._prependImportVariables = function (ast) { + + var declaredSetters = _(this.importedVariables).keys().map(function (name) { + return _.compose(t.variableDeclarator, t.identifier)(name); + } + ).value(); + + if (declaredSetters.length) { + ast.program.body.splice(1, 0, t.variableDeclaration("var", declaredSetters)); + } +}; + +SystemFormatter.prototype._prependPrivateModuleName = function (ast) { // generate the __moduleName variable var moduleNameVariableNode = t.variableDeclaration("var", [ t.variableDeclarator( - t.identifier("__moduleName"), - t.literal(moduleName) + PRIVATE_MODULE_NAME_IDENTIFIER, + this.moduleNameLiteral ) ]); - body.splice(1, 0, moduleNameVariableNode); - // generate an array of import variables + ast.program.body.splice(1, 0, moduleNameVariableNode); +}; - var declaredSetters = _(this.importedModule) - .map() - .flatten() - .pluck("variableName") - .pluck("name") - .uniq() - .map(t.identifier) - .map(function (name) { - return t.variableDeclarator(name); - }) - .value(); +SystemFormatter.prototype._buildSetters = function () { + // generate setters array expression elements + return _.map(this.moduleDependencies, function (specs) { + if (!specs.length) { + return NULL_SETTER; + } - if (declaredSetters.length) { - body.splice(2, 0, t.variableDeclaration("var", declaredSetters)); - } + return t.functionExpression( + null, [SETTER_MODULE_NAMESPACE], t.blockStatement(specs) + ); + }); +}; + +SystemFormatter.prototype._appendModuleReturnStatement = function (ast) { // generate the execute function expression var executeFunctionExpression = t.functionExpression( @@ -67,12 +358,21 @@ SystemFormatter.prototype.transform = function (ast) { t.property("init", t.identifier("setters"), settersArrayExpression), t.property("init", t.identifier("execute"), executeFunctionExpression) ])); - body.push(moduleReturnStatement); - // runner + ast.program.body.push(moduleReturnStatement); +}; + +SystemFormatter.prototype._wrapInSystemRegisterCallExpression = function (ast) { + var program = ast.program; + var body = program.body; + + var moduleDependencyNames = Object + .keys(this.moduleDependencies) + .map(t.literal); + var runner = util.template("register", { - MODULE_NAME: t.literal(moduleName), - MODULE_DEPENDENCIES: t.arrayExpression(dependencies), + MODULE_NAME: this.moduleNameLiteral, + MODULE_DEPENDENCIES: t.arrayExpression(moduleDependencyNames), MODULE_BODY: t.functionExpression( null, [this.exportIdentifier], @@ -82,121 +382,3 @@ SystemFormatter.prototype.transform = function (ast) { program.body = [t.expressionStatement(runner)]; }; - -SystemFormatter.prototype._buildSetters = function () { - // generate setters array expression elements - return _.map(this.importedModule, function (specs) { - if (!specs.length) { - return NULL_SETTER; - } - - var expressionStatements = _.map(specs, function (spec) { - var right = SETTER_MODULE_NAMESPACE; - if (!spec.isBatch) { - right = t.memberExpression(right, spec.key); - } - - return t.expressionStatement( - t.assignmentExpression("=", spec.variableName, right - ) - ); - }); - - return t.functionExpression( - null, [SETTER_MODULE_NAMESPACE], t.blockStatement(expressionStatements) - ); - }); -}; - -SystemFormatter.prototype.import = function (node) { - var MODULE_NAME = node.source.value; - this.importedModule[MODULE_NAME] = this.importedModule[MODULE_NAME] || []; -}; - -SystemFormatter.prototype.importSpecifier = function (specifier, node) { - var variableName = t.getSpecifierName(specifier); - - // import foo from "foo"; - if (specifier.default) { - specifier.id = DEFAULT_IDENTIFIER; - } - - var MODULE_NAME = node.source.value; - - this.importedModule[MODULE_NAME] = this.importedModule[MODULE_NAME] || []; - - this.importedModule[MODULE_NAME].push({ - variableName: variableName, - isBatch: specifier.type === "ImportBatchSpecifier", - key: specifier.id - }); -}; - -SystemFormatter.prototype._export = function (name, identifier) { - this.exportedStatements.push(t.expressionStatement( - t.callExpression(this.exportIdentifier, [t.literal(name), identifier]) - )); -}; - -SystemFormatter.prototype.export = function (node, nodes) { - var declar = node.declaration; - var variableName, identifier; - - if (node.default) { - // export default foo - variableName = DEFAULT_IDENTIFIER.name; - if (t.isClass(declar) || t.isFunction(declar)) { - if (!declar.id) { - declar.id = this.file.generateUidIdentifier("anonymous"); - } - - nodes.push(t.toStatement(declar)); - declar = declar.id; - } - - identifier = declar; - } else if (t.isVariableDeclaration(declar)) { - // export var foo - variableName = declar.declarations[0].id.name; - identifier = declar.declarations[0].id; - - nodes.push(declar); - } else { - // export function foo () {} - variableName = declar.id.name; - identifier = declar.id; - - nodes.push(declar); - } - - this._export(variableName, identifier); -}; - -SystemFormatter.prototype.exportSpecifier = function (specifier, node) { - var variableName = t.getSpecifierName(specifier); - - if (node.source) { - if (t.isExportBatchSpecifier(specifier)) { - // export * from "foo"; - var exportIdentifier = t.identifier("exports"); - this.exportedStatements.push( - t.variableDeclaration("var", [ - t.variableDeclarator(exportIdentifier, this.exportIdentifier) - ]) - ); - - this.exportedStatements.push(util.template("exports-wildcard", { - OBJECT: t.identifier(node.source.value) - }, true)); - } else { - // export { foo } from "test"; - this._export(variableName.name, t.memberExpression( - t.identifier(node.source.value), - specifier.id - )); - } - } else { - // export { foo }; - this._export(variableName.name, specifier.id); - } -}; diff --git a/test/fixtures/transformation/.es6-modules-system/exports-named/expected.js b/test/fixtures/transformation/.es6-modules-system/exports-named/expected.js deleted file mode 100644 index e0f17a11f9..0000000000 --- a/test/fixtures/transformation/.es6-modules-system/exports-named/expected.js +++ /dev/null @@ -1,26 +0,0 @@ -System.register("actual", [], function (_export) { - "use strict"; - - var __moduleName = "actual"; - - return { - setters: [ - function(m) { - _export("foo", m.foo); - - _export("foo", m.foo); - - _export("bar", m.bar); - - _export("bar", m.foo); - - _export("default", m.foo); - - _export("default", m.foo); - - _export("bar", m.bar); - }], - execute: function () { - } - }; -}); diff --git a/test/fixtures/transformation/.es6-modules-system/exports-default/actual.js b/test/fixtures/transformation/es6-modules-system/exports-default/actual.js similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/exports-default/actual.js rename to test/fixtures/transformation/es6-modules-system/exports-default/actual.js diff --git a/test/fixtures/transformation/.es6-modules-system/exports-default/expected.js b/test/fixtures/transformation/es6-modules-system/exports-default/expected.js similarity index 99% rename from test/fixtures/transformation/.es6-modules-system/exports-default/expected.js rename to test/fixtures/transformation/es6-modules-system/exports-default/expected.js index 7e90c983cb..934c42e2f3 100644 --- a/test/fixtures/transformation/.es6-modules-system/exports-default/expected.js +++ b/test/fixtures/transformation/es6-modules-system/exports-default/expected.js @@ -5,10 +5,8 @@ System.register("actual", [], function (_export) { function _anonymous() {} var _anonymous2; - function foo() {} var Foo; - return { setters: [], execute: function () { diff --git a/test/fixtures/transformation/.es6-modules-system/exports-from/actual.js b/test/fixtures/transformation/es6-modules-system/exports-from/actual.js similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/exports-from/actual.js rename to test/fixtures/transformation/es6-modules-system/exports-from/actual.js diff --git a/test/fixtures/transformation/.es6-modules-system/exports-from/expected.js b/test/fixtures/transformation/es6-modules-system/exports-from/expected.js similarity index 59% rename from test/fixtures/transformation/.es6-modules-system/exports-from/expected.js rename to test/fixtures/transformation/es6-modules-system/exports-from/expected.js index 680bae3c9f..b1ff79e7e4 100644 --- a/test/fixtures/transformation/.es6-modules-system/exports-from/expected.js +++ b/test/fixtures/transformation/es6-modules-system/exports-from/expected.js @@ -3,11 +3,14 @@ System.register("actual", ["foo"], function (_export) { var __moduleName = "actual"; - var _localExports = ['foo', 'bar', 'default']; - return { - setters: [ - function(m) { + setters: [function (m) { + (function (obj) { + for (var i in obj) { + _export(i, obj[i]); + } + })(m); + _export("foo", m.foo); _export("foo", m.foo); @@ -21,14 +24,7 @@ System.register("actual", ["foo"], function (_export) { _export("default", m.foo); _export("bar", m.bar); - - for (var p in m) { - if (_localExports.indexOf(i) == -1) - _export(p, m[p]); - } - } - ], - execute: function () { - } + }], + execute: function () {} }; }); diff --git a/test/fixtures/transformation/.es6-modules-system/exports-named/actual.js b/test/fixtures/transformation/es6-modules-system/exports-named/actual.js similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/exports-named/actual.js rename to test/fixtures/transformation/es6-modules-system/exports-named/actual.js diff --git a/test/fixtures/transformation/es6-modules-system/exports-named/expected.js b/test/fixtures/transformation/es6-modules-system/exports-named/expected.js new file mode 100644 index 0000000000..716fd14641 --- /dev/null +++ b/test/fixtures/transformation/es6-modules-system/exports-named/expected.js @@ -0,0 +1,24 @@ +System.register("actual", [], function (_export) { + "use strict"; + + var __moduleName = "actual"; + + return { + setters: [], + execute: function () { + _export("foo", foo); + + _export("foo", foo); + + _export("bar", bar); + + _export("bar", foo); + + _export("default", foo); + + _export("default", foo); + + _export("bar", bar); + } + }; +}); diff --git a/test/fixtures/transformation/.es6-modules-system/exports-variable/actual.js b/test/fixtures/transformation/es6-modules-system/exports-variable/actual.js similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/exports-variable/actual.js rename to test/fixtures/transformation/es6-modules-system/exports-variable/actual.js diff --git a/test/fixtures/transformation/.es6-modules-system/exports-variable/expected.js b/test/fixtures/transformation/es6-modules-system/exports-variable/expected.js similarity index 99% rename from test/fixtures/transformation/.es6-modules-system/exports-variable/expected.js rename to test/fixtures/transformation/es6-modules-system/exports-variable/expected.js index fd8e2dba9e..39fe8267e1 100644 --- a/test/fixtures/transformation/.es6-modules-system/exports-variable/expected.js +++ b/test/fixtures/transformation/es6-modules-system/exports-variable/expected.js @@ -13,7 +13,6 @@ System.register("actual", [], function (_export) { _export("foo7", foo7); var foo8; - return { setters: [], execute: function () { diff --git a/test/fixtures/transformation/.es6-modules-system/hoist-function-exports/actual.js b/test/fixtures/transformation/es6-modules-system/hoist-function-exports/actual.js similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/hoist-function-exports/actual.js rename to test/fixtures/transformation/es6-modules-system/hoist-function-exports/actual.js diff --git a/test/fixtures/transformation/.es6-modules-system/hoist-function-exports/expected.js b/test/fixtures/transformation/es6-modules-system/hoist-function-exports/expected.js similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/hoist-function-exports/expected.js rename to test/fixtures/transformation/es6-modules-system/hoist-function-exports/expected.js diff --git a/test/fixtures/transformation/.es6-modules-system/imports-default/actual.js b/test/fixtures/transformation/es6-modules-system/imports-default/actual.js similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/imports-default/actual.js rename to test/fixtures/transformation/es6-modules-system/imports-default/actual.js diff --git a/test/fixtures/transformation/.es6-modules-system/imports-default/expected.js b/test/fixtures/transformation/es6-modules-system/imports-default/expected.js similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/imports-default/expected.js rename to test/fixtures/transformation/es6-modules-system/imports-default/expected.js diff --git a/test/fixtures/transformation/.es6-modules-system/imports-glob/actual.js b/test/fixtures/transformation/es6-modules-system/imports-glob/actual.js similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/imports-glob/actual.js rename to test/fixtures/transformation/es6-modules-system/imports-glob/actual.js diff --git a/test/fixtures/transformation/.es6-modules-system/imports-glob/expected.js b/test/fixtures/transformation/es6-modules-system/imports-glob/expected.js similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/imports-glob/expected.js rename to test/fixtures/transformation/es6-modules-system/imports-glob/expected.js diff --git a/test/fixtures/transformation/.es6-modules-system/imports-mixing/actual.js b/test/fixtures/transformation/es6-modules-system/imports-mixing/actual.js similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/imports-mixing/actual.js rename to test/fixtures/transformation/es6-modules-system/imports-mixing/actual.js diff --git a/test/fixtures/transformation/.es6-modules-system/imports-mixing/expected.js b/test/fixtures/transformation/es6-modules-system/imports-mixing/expected.js similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/imports-mixing/expected.js rename to test/fixtures/transformation/es6-modules-system/imports-mixing/expected.js diff --git a/test/fixtures/transformation/.es6-modules-system/imports-named/actual.js b/test/fixtures/transformation/es6-modules-system/imports-named/actual.js similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/imports-named/actual.js rename to test/fixtures/transformation/es6-modules-system/imports-named/actual.js diff --git a/test/fixtures/transformation/.es6-modules-system/imports-named/expected.js b/test/fixtures/transformation/es6-modules-system/imports-named/expected.js similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/imports-named/expected.js rename to test/fixtures/transformation/es6-modules-system/imports-named/expected.js diff --git a/test/fixtures/transformation/.es6-modules-system/imports/actual.js b/test/fixtures/transformation/es6-modules-system/imports/actual.js similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/imports/actual.js rename to test/fixtures/transformation/es6-modules-system/imports/actual.js diff --git a/test/fixtures/transformation/.es6-modules-system/imports/expected.js b/test/fixtures/transformation/es6-modules-system/imports/expected.js similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/imports/expected.js rename to test/fixtures/transformation/es6-modules-system/imports/expected.js diff --git a/test/fixtures/transformation/.es6-modules-system/options.json b/test/fixtures/transformation/es6-modules-system/options.json similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/options.json rename to test/fixtures/transformation/es6-modules-system/options.json diff --git a/test/fixtures/transformation/.es6-modules-system/overview/actual.js b/test/fixtures/transformation/es6-modules-system/overview/actual.js similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/overview/actual.js rename to test/fixtures/transformation/es6-modules-system/overview/actual.js diff --git a/test/fixtures/transformation/.es6-modules-system/overview/expected.js b/test/fixtures/transformation/es6-modules-system/overview/expected.js similarity index 100% rename from test/fixtures/transformation/.es6-modules-system/overview/expected.js rename to test/fixtures/transformation/es6-modules-system/overview/expected.js