@material-ui/codemod
Advanced tools
Comparing version 1.0.0-beta.45 to 1.0.0-rc.0
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -64,3 +64,2 @@ Object.defineProperty(exports, "__esModule", { | ||
}; | ||
var pathBaseSource = ['material-ui/src/', 'material-ui/src/']; | ||
@@ -81,3 +80,2 @@ var pathBasePackage = ['material-ui/lib/', 'material-ui/']; | ||
var j = api.jscodeshift; | ||
return j(fileInfo.source).find(j.ImportDeclaration).filter(function (path) { | ||
@@ -90,5 +88,4 @@ // Only consider Material-UI imports | ||
var pathSuffix = pathOld.substring(pathsBase[0].length); | ||
var pathNew; | ||
var pathNew = void 0; | ||
if (pathConversion[pathSuffix]) { | ||
@@ -105,2 +102,2 @@ pathNew = pathsBase[1] + pathConversion[pathSuffix]; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy92MC4xNS4wL2ltcG9ydC1wYXRoLmpzIl0sIm5hbWVzIjpbInRyYW5zZm9ybWVyIiwicGF0aENvbnZlcnNpb24iLCJhdmF0YXIiLCJiYWRnZSIsImRpYWxvZyIsImRpdmlkZXIiLCJwYXBlciIsInNsaWRlciIsImNoZWNrYm94IiwidG9nZ2xlIiwic25hY2tiYXIiLCJNdWlUaGVtZVByb3ZpZGVyIiwicGF0aEJhc2VTb3VyY2UiLCJwYXRoQmFzZVBhY2thZ2UiLCJnZXRQYXRoc0Jhc2UiLCJwYXRoIiwiaW5kZXhPZiIsIkVycm9yIiwiZmlsZUluZm8iLCJhcGkiLCJqIiwianNjb2Rlc2hpZnQiLCJzb3VyY2UiLCJmaW5kIiwiSW1wb3J0RGVjbGFyYXRpb24iLCJmaWx0ZXIiLCJ2YWx1ZSIsInJlcGxhY2VXaXRoIiwicGF0aE9sZCIsInBhdGhzQmFzZSIsInBhdGhTdWZmaXgiLCJzdWJzdHJpbmciLCJsZW5ndGgiLCJwYXRo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bywgYXBpKSB7XG4gIGNvbnN0IGogPSBhcGkuanNjb2Rlc2hpZnQ7XG5cbiAgcmV0dXJuIGooZmlsZUluZm8uc291cmNlKVxuICAgIC5maW5kKGouSW1wb3J0RGVjbGFyYXRpb24pXG4gICAgLmZpbHRlcihwYXRoID0+IHtcbiAgICAgIC8vIE9ubHkgY29uc2lkZXIgTWF0ZXJpYWwtVUkgaW1wb3J0c1xuICAgICAgcmV0dXJuIHBhdGgudmFsdWUuc291cmNlLnZhbHVlLmluZGV4T2YoJ21hdGVyaWFsLXVpLycpID09PSAwO1xuICAgIH0pXG4gICAgLnJlcGxhY2VXaXRoKHBhdGggPT4ge1xuICAgICAgY29uc3QgcGF0aE9sZCA9IHBhdGgudmFsdWUuc291cmNlLnZhbHVlO1xuICAgICAgY29uc3QgcGF0aHNCYXNlID0gZ2V0UGF0aHNCYXNlKHBhdGhPbGQpO1xuICAgICAgY29uc3QgcGF0aFN1ZmZpeCA9IHBhdGhPbGQuc3Vic3RyaW5nKHBhdGhzQmFzZVswXS5sZW5ndGgpO1xuXG4gICAgICBsZXQgcGF0aE5ldztcblxuICAgICAgaWYgKHBhdGhDb252ZXJzaW9uW3BhdGhTdWZmaXhdKSB7XG4gICAgICAgIHBhdGhOZXcgPSBwYXRoc0Jhc2VbMV0gKyBwYXRoQ29udmVyc2lvbltwYXRoU3VmZml4XTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHBhdGhOZXcgPSBwYXRoc0Jhc2VbMV0gKyBwYXRoU3VmZml4O1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gai5pbXBvcnREZWNsYXJhdGlvbihwYXRoLm5vZGUuc3BlY2lmaWVycywgai5saXRlcmFsKHBhdGhOZXcpKTtcbiAgICB9KVxuICAgIC50b1NvdXJjZSh7XG4gICAgICBxdW90ZTogJ3NpbmdsZScsXG4gICAgfSk7XG59XG4iXX0= | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3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RoKTtcblxuICAgICAgbGV0IHBhdGhOZXc7XG5cbiAgICAgIGlmIChwYXRoQ29udmVyc2lvbltwYXRoU3VmZml4XSkge1xuICAgICAgICBwYXRoTmV3ID0gcGF0aHNCYXNlWzFdICsgcGF0aENvbnZlcnNpb25bcGF0aFN1ZmZpeF07XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBwYXRoTmV3ID0gcGF0aHNCYXNlWzFdICsgcGF0aFN1ZmZpeDtcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIGouaW1wb3J0RGVjbGFyYXRpb24ocGF0aC5ub2RlLnNwZWNpZmllcnMsIGoubGl0ZXJhbChwYXRoTmV3KSk7XG4gICAgfSlcbiAgICAudG9Tb3VyY2Uoe1xuICAgICAgcXVvdGU6ICdzaW5nbGUnLFxuICAgIH0pO1xufVxuIl19 |
@@ -1,11 +0,11 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
// This codemod attempts to fix the color imports breaking change introduced in | ||
// https://github.com/mui-org/material-ui/releases/tag/v1.0.0-alpha.21 | ||
// List of colors that are in the `common` module | ||
var commonColors = ['black', 'white', 'transparent', 'fullBlack', 'darkBlack', 'lightBlack', 'minBlack', 'faintBlack', 'fullWhite', 'darkWhite', 'lightWhite']; | ||
/** | ||
@@ -16,11 +16,14 @@ * Break down `colorIdentifier` into its `palette` and `hue` | ||
*/ | ||
function colorAccent(colorIdentifier) { | ||
var _colorIdentifier$matc = colorIdentifier.match(/([A-za-z]+?)(A?\d+)?$/), | ||
_colorIdentifier$matc2 = _slicedToArray(_colorIdentifier$matc, 3), | ||
_colorIdentifier$matc2 = (0, _slicedToArray2.default)(_colorIdentifier$matc, 3), | ||
palette = _colorIdentifier$matc2[1], | ||
hue = _colorIdentifier$matc2[2]; | ||
return { palette: palette, hue: hue }; | ||
return { | ||
palette: palette, | ||
hue: hue | ||
}; | ||
} | ||
/** | ||
@@ -30,6 +33,7 @@ * Return color module path | ||
*/ | ||
function colorImportPath(colorPalette) { | ||
return commonColors.indexOf(colorPalette) !== -1 ? 'common' : colorPalette; | ||
} | ||
/** | ||
@@ -42,2 +46,4 @@ * Replace all expressions that use identifier to access color palettes. | ||
*/ | ||
function transformMemberExpressions(identifier, j, root) { | ||
@@ -58,7 +64,5 @@ // replace all expressions using `identifier` to access color palettes | ||
var property = hue || palette; | ||
path.node.property = hue || colorModuleName === 'common' ? j.memberExpression(j.identifier(colorModuleName), /^[_|a-z]/i.test(property) ? j.identifier(property) : j.literal(property)) : j.identifier(colorModuleName); | ||
}); | ||
} | ||
/** | ||
@@ -72,8 +76,15 @@ * Replace all member imports. | ||
*/ | ||
function transformMemberImports(j, root, importPath, targetPath) { | ||
// find member imports | ||
root.find(j.ImportDeclaration, { source: { value: importPath } }).forEach(function (importDeclaration) { | ||
root.find(j.ImportDeclaration, { | ||
source: { | ||
value: importPath | ||
} | ||
}).forEach(function (importDeclaration) { | ||
var memberImportSpecifiers = importDeclaration.node.specifiers.filter(function (specifier) { | ||
return specifier.type === 'ImportSpecifier'; | ||
}); | ||
if (memberImportSpecifiers.length) { | ||
@@ -83,3 +94,2 @@ j(importDeclaration).replaceWith(function () { | ||
var assignmentExpressions = []; | ||
memberImportSpecifiers.forEach(function (memberSpecifier) { | ||
@@ -91,6 +101,5 @@ var _colorAccent2 = colorAccent(memberSpecifier.imported.name), | ||
var colorModuleName = colorImportPath(palette); | ||
var modulePath = targetPath + '/' + colorModuleName; | ||
var colorIdentifier = j.identifier(colorModuleName); | ||
var modulePath = "".concat(targetPath, "/").concat(colorModuleName); | ||
var colorIdentifier = j.identifier(colorModuleName); // import color module (if not already imported) | ||
// import color module (if not already imported) | ||
if (importDeclarations.map(function (p) { | ||
@@ -100,5 +109,5 @@ return p.source.value; | ||
importDeclarations.push(j.importDeclaration([j.importDefaultSpecifier(colorIdentifier)], j.literal(modulePath))); | ||
} | ||
} // conditional assignment expression | ||
// conditional assignment expression | ||
if (hue || colorModuleName === 'common') { | ||
@@ -109,3 +118,2 @@ var property = hue || palette; | ||
}); | ||
return importDeclarations.concat(assignmentExpressions); | ||
@@ -116,3 +124,2 @@ }); | ||
} | ||
/** | ||
@@ -126,8 +133,15 @@ * Replace all namespace imports. | ||
*/ | ||
function transformNamespaceImports(j, root, importPath, targetPath) { | ||
// find namespace imports | ||
root.find(j.ImportDeclaration, { source: { value: importPath } }).forEach(function (importDeclaration) { | ||
root.find(j.ImportDeclaration, { | ||
source: { | ||
value: importPath | ||
} | ||
}).forEach(function (importDeclaration) { | ||
var namespaceImportSpecifier = importDeclaration.node.specifiers.find(function (specifier) { | ||
return specifier.type === 'ImportNamespaceSpecifier'; | ||
}); | ||
if (namespaceImportSpecifier) { | ||
@@ -142,14 +156,13 @@ j(importDeclaration).replaceWith(j.importDeclaration([j.importNamespaceSpecifier(j.identifier(namespaceImportSpecifier.local.name))], j.literal(targetPath))); | ||
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | ||
var j = api.jscodeshift; | ||
var root = j(fileInfo.source); | ||
var importPath = options.importPath || 'material-ui/styles/colors'; | ||
var targetPath = options.targetPath || 'material-ui/colors'; | ||
var targetPath = options.targetPath || '@material-ui/core/colors'; // transforms | ||
// transforms | ||
transformMemberImports(j, root, importPath, targetPath); | ||
transformNamespaceImports(j, root, importPath, targetPath); | ||
return root.toSource({ quote: 'single' }); | ||
return root.toSource({ | ||
quote: 'single' | ||
}); | ||
}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy92MS4wLjAvY29sb3ItaW1wb3J0cy5qcyJdLCJuYW1lcyI6WyJjb21tb25Db2xvcnMiLCJjb2xvckFjY2VudCIsImNvbG9ySWRlbnRpZmllciIsIm1hdGNoIiwicGFsZXR0ZSIsImh1ZSIsImNvbG9ySW1wb3J0UGF0aCIsImNvbG9yUGFsZXR0ZSIsImluZGV4T2YiLCJ0cmFuc2Zvcm1NZW1iZXJFeHByZXNzaW9ucyIsImlkZW50aWZpZXIiLCJqIiwicm9vdCIsImZpbmQiLCJNZW1iZXJFeHByZXNzaW9uIiwiZm9yRWFjaCIsInBhdGgiLCJub2RlIiwib2JqZWN0IiwibmFtZSIsImNvbG9yUHJvcGVydHkiLCJwcm9wZXJ0eSIsImNvbG9yTW9kdWxlTmFtZSIsIm1lbWJlckV4cHJlc3Npb24iLCJ0ZXN0IiwibGl0ZXJhbCIsInRyYW5zZm9ybU1lbWJlckltcG9ydHMiLCJpbXBvcnRQYXRoIiwidGFyZ2V0UGF0aCIsIkltcG9ydERlY2xhcmF0aW9uIiwic291cmNlIiwidmFsdWUiLCJtZW1iZXJJbXBvcnRTcGVjaWZpZXJzIiwiaW1wb3J0RGVjbGFyYXRpb24iLCJzcGVjaWZpZXJzIiwiZmlsdGVyIiwic3BlY2lmaWVyIiwidHlwZSIsImxlbmd0aCIsInJlcGxhY2VXaXRoIiwiaW1wb3J0RGVjbGFyYXRpb25zIiwiYXNzaWdubWVudEV4cHJlc3Npb25zIiwibWVtYmVyU3BlY2lmaWVyIiwiaW1wb3J0ZWQiLCJtb2R1bGVQYXRoIiwibWFwIiwicCIsInB1c2giLCJpbXBvcnREZWZhdWx0U3BlY2lmaWVyIiwidmFyaWFibGVEZWNsYXJhdGlvbiIsInZ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G1lbWJlckltcG9ydFNwZWNpZmllcnMgPSBpbXBvcnREZWNsYXJhdGlvbi5ub2RlLnNwZWNpZmllcnMuZmlsdGVyKFxuICAgICAgc3BlY2lmaWVyID0+IHNwZWNpZmllci50eXBlID09PSAnSW1wb3J0U3BlY2lmaWVyJyxcbiAgICApO1xuICAgIGlmIChtZW1iZXJJbXBvcnRTcGVjaWZpZXJzLmxlbmd0aCkge1xuICAgICAgaihpbXBvcnREZWNsYXJhdGlvbikucmVwbGFjZVdpdGgoKCkgPT4ge1xuICAgICAgICBjb25zdCBpbXBvcnREZWNsYXJhdGlvbnMgPSBbXTtcbiAgICAgICAgY29uc3QgYXNzaWdubWVudEV4cHJlc3Npb25zID0gW107XG5cbiAgICAgICAgbWVtYmVySW1wb3J0U3BlY2lmaWVycy5mb3JFYWNoKG1lbWJlclNwZWNpZmllciA9PiB7XG4gICAgICAgICAgY29uc3QgeyBwYWxldHRlLCBodWUgfSA9IGNvbG9yQWNjZW50KG1lbWJlclNwZWNpZmllci5pbXBvcnRlZC5uYW1lKTtcbiAgICAgICAgICBjb25zdCBjb2xvck1vZHVsZU5hbWUgPSBjb2xvckltcG9ydFBhdGgocGFsZXR0ZSk7XG4gICAgICAgICAgY29uc3QgbW9kdWxlUGF0aCA9IGAke3RhcmdldFBhdGh9LyR7Y29sb3JNb2R1bGVOYW1lfWA7XG4gICAgICAgICAgY29uc3QgY29sb3JJZGVudGlmaWVyID0gai5pZGVudGlmaWVyKGNvbG9yTW9kdWxlTmFtZSk7XG5cbiAgICAgICAgICAvLyBpbXBvcnQgY29sb3IgbW9kdWxlIChpZiBub3QgYWxyZWFkeSBpbXBvcnRlZClcbiAgICAgICAgICBpZiAoaW1wb3J0RGVjbGFyYXRpb25zLm1hcChwID0+IHAuc291cmNlLnZhbHVlKS5pbmRleE9mKG1vZHVsZVBhdGgpID09PSAtMSkge1xuICAgICAgICAgICAgaW1wb3J0RGVjbGFyYXRpb25zLnB1c2goXG4gICAgICAgICAgICAgIGouaW1wb3J0RGVjbGFyYXRpb24oXG4gICAgICAgICAgICAgICAgW2ouaW1wb3J0RGVmYXVsdFNwZWNpZmllcihjb2xvcklkZW50aWZpZXIpXSxcbiAgICAgICAgICAgICAgICBqLmxpdGVyYWwobW9kdWxlUGF0aCksXG4gICAgICAgICAgICAgICksXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIGNvbmRpdGlvbmFsIGFzc2lnbm1lbnQgZXhwcmVzc2lvblxuICAgICAgICAgIGlmIChodWUgfHwgY29sb3JNb2R1bGVOYW1lID09PSAnY29tbW9uJykge1xuICAgICAgICAgICAgY29uc3QgcHJvcGVydHkgPSBodWUgfHwgcGFsZXR0ZTtcbiAgICAgICAgICAgIGFzc2lnbm1lbnRFeHByZXNzaW9ucy5wdXNoKFxuICAgICAgICAgICAgICBqLnZhcmlhYmxlRGVjbGFyYXRpb24oJ2NvbnN0JywgW1xuICAgICAgICAgICAgICAgIGoudmFyaWFibGVEZWNsYXJhdG9yKFxuICAgICAgICAgICAgICAgICAgai5pZGVudGlmaWVyKG1lbWJlclNwZWNpZmllci5sb2NhbC5uYW1lKSxcbiAgICAgICAgICAgICAgICAgIGoubWVtYmVyRXhwcmVzc2lvbihcbiAgICAgICAgICAgICAgICAgICAgY29sb3JJZGVudGlmaWVyLFxuICAgICAgICAgICAgICAgICAgICAvXltffGEtel0vaS50ZXN0KHByb3BlcnR5KSA/IGouaWRlbnRpZmllcihwcm9wZXJ0eSkgOiBqLmxpdGVyYWwocHJvcGVydHkpLFxuICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICByZXR1cm4gaW1wb3J0RGVjbGFyYXRpb25zLmNvbmNhdChhc3NpZ25tZW50RXhwcmVzc2lvbnMpO1xuICAgICAgfSk7XG4gICAgfVxuICB9KTtcbn1cblx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1xuICAgICAgICBjb25zdCBhc3NpZ25tZW50RXhwcmVzc2lvbnMgPSBbXTtcblxuICAgICAgICBtZW1iZXJJbXBvcnRTcGVjaWZpZXJzLmZvckVhY2gobWVtYmVyU3BlY2lmaWVyID0+IHtcbiAgICAgICAgICBjb25zdCB7IHBhbGV0dGUsIGh1ZSB9ID0gY29sb3JBY2NlbnQobWVtYmVyU3BlY2lmaWVyLmltcG9ydGVkLm5hbWUpO1xuICAgICAgICAgIGNvbnN0IGNvbG9yTW9kdWxlTmFtZSA9IGNvbG9ySW1wb3J0UGF0aChwYWxldHRlKTtcbiAgICAgICAgICBjb25zdCBtb2R1bGVQYXRoID0gYCR7dGFyZ2V0UGF0aH0vJHtjb2xvck1vZHVsZU5hbWV9YDtcbiAgICAgICAgICBjb25zdCBjb2xvcklkZW50aWZpZXIgPSBqLmlkZW50aWZpZXIoY29sb3JNb2R1bGVOYW1lKTtcblxuICAgICAgICAgIC8vIGltcG9ydCBjb2xvciBtb2R1bGUgKGlmIG5vdCBhbHJlYWR5IGltcG9ydGVkKVxuICAgICAgICAgIGlmIChpbXBvcnREZWNsYXJhdGlvbnMubWFwKHAgPT4gcC5zb3VyY2UudmFsdWUpLmluZGV4T2YobW9kdWxlUGF0aCkgPT09IC0xKSB7XG4gICAgICAgICAgICBpbXBvcnREZWNsYXJhdGlvbnMucHVzaChcbiAgICAgICAgICAgICAgai5pbXBvcnREZWNsYXJhdGlvbihcbiAgICAgICAgICAgICAgICBbai5pbXBvcnREZWZhdWx0U3BlY2lmaWVyKGNvbG9ySWRlbnRpZmllcildLFxuICAgICAgICAgICAgICAgIGoubGl0ZXJhbChtb2R1bGVQYXRoKSxcbiAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy8gY29uZGl0aW9uYWwgYXNzaWdubWVudCBleHByZXNzaW9uXG4gICAgICAgICAgaWYgKGh1ZSB8fCBjb2xvck1vZHVsZU5hbWUgPT09ICdjb21tb24nKSB7XG4gICAgICAgICAgICBjb25zdCBwcm9wZXJ0eSA9IGh1ZSB8fCBwYWxldHRlO1xuICAgICAgICAgICAgYXNzaWdubWVudEV4cHJlc3Npb25zLnB1c2goXG4gICAgICAgICAgICAgIGoudmFyaWFibGVEZWNsYXJhdGlvbignY29uc3QnLCBbXG4gICAgICAgICAgICAgICAgai52YXJpYWJsZURlY2xhcmF0b3IoXG4gICAgICAgICAgICAgICAgICBqLmlkZW50aWZpZXIobWVtYmVyU3BlY2lmaWVyLmxvY2FsLm5hbWUpLFxuICAgICAgICAgICAgICAgICAgai5tZW1iZXJFeHByZXNzaW9uKFxuICAgICAgICAgICAgICAgICAgICBjb2xvcklkZW50aWZpZXIsXG4gICAgICAgICAgICAgICAgICAgIC9eW198YS16XS9pLnRlc3QocHJvcGVydHkpID8gai5pZGVudGlmaWVyKHByb3BlcnR5KSA6IGoubGl0ZXJhbChwcm9wZXJ0eSksXG4gICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiBpbXBvcnREZWNsYXJhdGlvbnMuY29uY2F0KGFzc2lnbm1lbnRFeHByZXNzaW9ucyk7XG4gICAgICB9KTtcbiAgICB9XG4gIH0pO1xufVxuXG4vKipcbiAqIFJlcGxhY2UgYWxsIG5hbWVzcGFjZSBpbXBvcnRzLlxuICogZS5nLiBpbXBvcnQgKiBhcyBjb2xvcnMgZnJvbSAnbWF0ZXJpYWwtdWkvc3R5bGVzL2NvbG9ycydcbiAqIEBwYXJhbSB7anNjb2Rlc2hpZnRfYXBpX29iamVjdH0galxuICogQHBhcmFtIHtqc2NvZGVzaGlmdF9hc3Rfb2JqZWN0fSByb290XG4gKiBAcGFyYW0ge3N0cmluZ30gaW1wb3J0UGF0aFxuICogQHBhcmFtIHtzdHJpbmd9IHRhcmdldFBhdGhc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GNvbnN0IHJvb3QgPSBqKGZpbGVJbmZvLnNvdXJjZSk7XG4gIGNvbnN0IGltcG9ydFBhdGggPSBvcHRpb25zLmltcG9ydFBhdGggfHwgJ21hdGVyaWFsLXVpL3N0eWxlcy9jb2xvcnMnO1xuICBjb25zdCB0YXJnZXRQYXRoID0gb3B0aW9ucy50YXJnZXRQYXRoIHx8ICdAbWF0ZXJpYWwtdWkvY29yZS9jb2xvcnMnO1xuXG4gIC8vIHRyYW5zZm9ybXNcbiAgdHJhbnNmb3JtTWVtYmVySW1wb3J0cyhqLCByb290LCBpbXBvcnRQYXRoLCB0YXJnZXRQYXRoKTtcbiAgdHJhbnNmb3JtTmFtZXNwYWNlSW1wb3J0cyhqLCByb290LCBpbXBvcnRQYXRoLCB0YXJnZXRQYXRoKTtcblxuICByZXR1cm4gcm9vdC50b1NvdXJjZSh7IHF1b3RlOiAnc2luZ2xlJyB9KTtcbn07XG4iXX0= |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -7,3 +7,4 @@ Object.defineProperty(exports, "__esModule", { | ||
exports.default = transformer; | ||
var entryModuleToFlatten = ['BottomNavigation', 'BottomNavigationAction', 'Card', 'CardActions', 'CardContent', 'CardHeader', 'CardMedia', 'CircularProgress', 'Collapse', 'Dialog', 'DialogActions', 'DialogContent', 'DialogContentText', 'DialogTitle', 'ExpansionPanel', 'ExpansionPanelActions', 'ExpansionPanelDetails', 'ExpansionPanelSummary', 'Fade', 'Form', 'FormControl', 'FormControlLabel', 'FormGroup', 'FormHelperText', 'FormLabel', 'GridList', 'GridListTile', 'Grow', 'Input', 'InputLabel', 'LinearProgress', 'List', 'ListItem', 'ListItemAvatar', 'ListItemIcon', 'ListItemSecondaryAction', 'ListItemText', 'Menu', 'MenuItem', 'Progress', 'Radio', 'RadioGroup', 'Slide', 'Step', 'StepButton', 'StepContent', 'Stepper', 'Stepper', 'Tab', 'Table', 'TableBody', 'TableCell', 'TableFooter', 'TablePagination', 'TableRow', 'Tabs', 'withMobileDialog']; | ||
var entryModuleToFlatten = ['BottomNavigation', 'BottomNavigationAction', 'Card', 'CardActions', 'CardContent', 'CardHeader', 'CardMedia', 'CircularProgress', 'ClickAwayListener', 'Collapse', 'Dialog', 'DialogActions', 'DialogContent', 'DialogContentText', 'DialogTitle', 'ExpansionPanel', 'ExpansionPanelActions', 'ExpansionPanelDetails', 'ExpansionPanelSummary', 'Fade', 'Form', 'FormControl', 'FormControlLabel', 'FormGroup', 'FormHelperText', 'FormLabel', 'GridList', 'GridListTile', 'Grow', 'Input', 'InputLabel', 'LinearProgress', 'List', 'ListItem', 'ListItemAvatar', 'ListItemIcon', 'ListItemSecondaryAction', 'ListItemText', 'Menu', 'MenuItem', 'Progress', 'Radio', 'RadioGroup', 'Slide', 'Step', 'StepButton', 'StepContent', 'Stepper', 'Stepper', 'Tab', 'Table', 'TableBody', 'TableCell', 'TableFooter', 'TablePagination', 'TableRow', 'Tabs', 'withMobileDialog', 'withWidth', 'Zoom']; | ||
var keepSpecifiers = ['withWidth']; | ||
@@ -17,18 +18,17 @@ function transformer(fileInfo, api, options) { | ||
}; | ||
var importModule = options.importModule || '@material-ui/core'; | ||
var targetModule = options.targetModule || '@material-ui/core'; | ||
var root = j(fileInfo.source); | ||
var importRegExp = /^material-ui\/(.+)/; | ||
var importRegExp = new RegExp("^".concat(importModule, "/(.+)$")); | ||
root.find(j.ImportDeclaration).forEach(function (path) { | ||
var importPath = path.value.source.value; | ||
var entryModule = importPath.match(importRegExp); | ||
var entryModule = importPath.match(importRegExp); // Remove non-Material-UI imports | ||
// Remove non-Material-UI imports | ||
if (!entryModule) { | ||
return; | ||
} | ||
entryModule = entryModule[1].split('/'); | ||
entryModule = entryModule[entryModule.length - 1]; | ||
entryModule = entryModule[entryModule.length - 1]; // No need to flatten | ||
// No need to flatten | ||
if (!entryModuleToFlatten.includes(entryModule)) { | ||
@@ -39,4 +39,8 @@ return; | ||
hasModifications = true; | ||
// console.log('entryModule', entryModule); | ||
if (keepSpecifiers.includes(entryModule)) { | ||
path.value.source.value = "".concat(targetModule, "/").concat(entryModule); | ||
return; | ||
} | ||
path.node.specifiers.forEach(function (specifier) { | ||
@@ -47,7 +51,6 @@ var localName = specifier.local.name; | ||
if (!importedName) { | ||
var importStatement = j.importDeclaration([j.importDefaultSpecifier(j.identifier(localName))], j.literal('material-ui/' + entryModule)); | ||
var importStatement = j.importDeclaration([j.importDefaultSpecifier(j.identifier(localName))], j.literal("".concat(targetModule, "/").concat(entryModule))); | ||
j(path).insertBefore(importStatement); | ||
} else { | ||
var _importStatement = j.importDeclaration([j.importDefaultSpecifier(j.identifier(localName))], j.literal('material-ui/' + importedName)); | ||
var _importStatement = j.importDeclaration([j.importDefaultSpecifier(j.identifier(localName))], j.literal("".concat(targetModule, "/").concat(importedName))); | ||
@@ -57,8 +60,6 @@ j(path).insertBefore(_importStatement); | ||
}); | ||
path.prune(); | ||
}); | ||
return hasModifications ? root.toSource(printOptions) : null; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy92MS4wLjAvaW1wb3J0LXBhdGguanMiXSwibmFtZXMiOlsidHJhbnNmb3JtZXIiLCJlbnRyeU1vZHVsZVRvRmxhdHRlbiIsImZpbGVJbmZvIiwiYXBpIiwib3B0aW9ucyIsImoiLCJqc2NvZGVzaGlmdCIsImhhc01vZGlmaWNhdGlvbnMiLCJwcmludE9wdGlvbnMiLCJxdW90ZSIsInRyYWlsaW5nQ29tbWEiLCJyb290Iiwic291cmNlIiwiaW1wb3J0UmVnRXhwIiwiZmluZCIsIkltcG9ydERlY2xhcmF0aW9uIiwiZm9yRWFjaCIsImltcG9ydFBhdGgiLCJwYXRoIiwidmFsdWUiLCJlbnRyeU1vZHVsZSIsIm1hdGNoIiwic3BsaXQiLCJsZW5ndGgiLCJpbmNsdWRlcyIsIm5vZGUiLCJzcGVjaWZpZXJzIiwibG9jYWxOYW1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hdGVtZW50KTtcbiAgICAgIH1cbiAgICB9KTtcblxuICAgIHBhdGgucHJ1bmUoKTtcbiAgfSk7XG5cbiAgcmV0dXJuIGhhc01vZGlmaWNhdGlvbnMgPyByb290LnRvU291cmNlKHByaW50T3B0aW9ucykgOiBudWxsO1xufVxuIl19 |
@@ -1,5 +0,7 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
/** | ||
@@ -10,5 +12,4 @@ * Capitalize a string | ||
function capitalize(string) { | ||
return string ? '' + string[0].toUpperCase() + string.slice(1) : string; | ||
return string ? "".concat(string[0].toUpperCase()).concat(string.slice(1)) : string; | ||
} | ||
/** | ||
@@ -19,6 +20,7 @@ * Transform kebab-case icon name to PascalCase | ||
*/ | ||
function pascalize(iconName) { | ||
return iconName.split('-').map(capitalize).join(''); | ||
} | ||
/** | ||
@@ -28,6 +30,8 @@ * Update all `svg-icons` import references to use `@material-ui/icons` package. | ||
* of being in an import declaration, or a require() call, etc. | ||
* https://github.com/mui-org/material-ui/tree/v1-beta/packages/@material-ui/icons | ||
* https://github.com/mui-org/material-ui/tree/master/packages/@material-ui/icons | ||
* @param {jscodeshift_api_object} j | ||
* @param {jscodeshift_ast_object} root | ||
*/ | ||
function transformSVGIconImports(j, root) { | ||
@@ -39,9 +43,7 @@ var pathMatchRegex = /^material-ui\/svg-icons\/.+\/(.+)$/; | ||
var _path$node$value$matc = path.node.value.match(pathMatchRegex), | ||
_path$node$value$matc2 = _slicedToArray(_path$node$value$matc, 2), | ||
iconName = _path$node$value$matc2[1]; | ||
_path$node$value$matc2 = (0, _slicedToArray2.default)(_path$node$value$matc, 2), | ||
iconName = _path$node$value$matc2[1]; // update to new path | ||
// update to new path | ||
path.node.value = '@material-ui/icons/' + pascalize(iconName); | ||
path.node.value = "@material-ui/icons/".concat(pascalize(iconName)); | ||
}); | ||
@@ -52,8 +54,9 @@ } | ||
var j = api.jscodeshift; | ||
var root = j(fileInfo.source); | ||
var root = j(fileInfo.source); // transforms | ||
// transforms | ||
transformSVGIconImports(j, root); | ||
return root.toSource({ quote: 'single' }); | ||
return root.toSource({ | ||
quote: 'single' | ||
}); | ||
}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy92MS4wLjAvc3ZnLWljb24taW1wb3J0cy5qcyJdLCJuYW1lcyI6WyJjYXBpdGFsaXplIiwic3RyaW5nIiwidG9VcHBlckNhc2UiLCJzbGljZSIsInBhc2NhbGl6ZSIsImljb25OYW1lIiwic3BsaXQiLCJtYXAiLCJqb2luIiwidHJhbnNmb3JtU1ZHSWNvbkltcG9ydHMiLCJqIiwicm9vdCIsInBhdGhNYXRjaFJlZ2V4IiwiZmluZCIsIkxpdGVyYWwiLCJmaWx0ZXIiLCJ0ZXN0IiwicGF0aCIsIm5vZGUiLCJ2YWx1ZSIsImZvckVhY2giLCJtYXRjaCIsIm1vZHVsZSIsImV4cG9ydHMiLCJ0cmFuc2Zvcm1lciIsImZpbGVJbmZvIiwiYXBpIiwianNjb2Rlc2hpZnQiLCJzb3VyY2UiLCJ0b1NvdXJjZSIsInF1b3RlIl0sIm1hcHBpbmdzIjoiOzs7O0FBQUE7Ozs7QUFJQSxTQUFTQSxVQUFULEN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9yRWFjaChwYXRoID0+IHtcbiAgICAgIGNvbnN0IFssIGljb25OYW1lXSA9IHBhdGgubm9kZS52YWx1ZS5tYXRjaChwYXRoTWF0Y2hSZWdleCk7XG5cbiAgICAgIC8vIHVwZGF0ZSB0byBuZXcgcGF0aFxuICAgICAgcGF0aC5ub2RlLnZhbHVlID0gYEBtYXRlcmlhbC11aS9pY29ucy8ke3Bhc2NhbGl6ZShpY29uTmFtZSl9YDtcbiAgICB9KTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiB0cmFuc2Zvcm1lcihmaWxlSW5mbywgYXBpKSB7XG4gIGNvbnN0IGogPSBhcGkuanNjb2Rlc2hpZnQ7XG4gIGNvbnN0IHJvb3QgPSBqKGZpbGVJbmZvLnNvdXJjZSk7XG5cbiAgLy8gdHJhbnNmb3Jtc1xuICB0cmFuc2Zvcm1TVkdJY29uSW1wb3J0cyhqLCByb290KTtcbiAgcmV0dXJuIHJvb3QudG9Tb3VyY2UoeyBxdW90ZTogJ3NpbmdsZScgfSk7XG59O1xuIl19 |
@@ -5,3 +5,3 @@ { | ||
"author": "Material-UI Team", | ||
"version": "1.0.0-beta.45", | ||
"version": "1.0.0-rc.0", | ||
"description": "Codemod scripts for Material-UI.", | ||
@@ -21,3 +21,3 @@ "keywords": [ | ||
"build": "../../node_modules/.bin/rimraf lib && ../../node_modules/.bin/babel ./src --out-dir ./lib --ignore *.test", | ||
"version": "npm publish" | ||
"release": "yarn build && npm publish" | ||
}, | ||
@@ -29,3 +29,3 @@ "repository": { | ||
"license": "MIT", | ||
"homepage": "https://github.com/mui-org/material-ui/tree/v1-beta/packages/material-ui-codemod", | ||
"homepage": "https://github.com/mui-org/material-ui/tree/master/packages/material-ui-codemod", | ||
"devDependencies": { | ||
@@ -39,4 +39,4 @@ "jscodeshift": "^0.5.0" | ||
"engines": { | ||
"node": ">=6.11.0" | ||
"node": ">=6.0.0" | ||
} | ||
} |
@@ -31,8 +31,8 @@ # @material-ui/codemod | ||
```diff | ||
-import { MenuItem } from 'material-ui/Menu'; | ||
+import MenuItem from 'material-ui/MenuItem'; | ||
-import { MenuItem } from '@material-ui/core/Menu'; | ||
+import MenuItem from '@material-ui/core/MenuItem'; | ||
``` | ||
```sh | ||
find src -name '*.js' -print | xargs jscodeshift -t node_modules/@material-ui/codemod/lib/v0.15.0/import-path.js | ||
find src -name '*.js' -print | xargs jscodeshift -t node_modules/@material-ui/codemod/lib/v1.0.0/import-path.js | ||
``` | ||
@@ -46,5 +46,5 @@ | ||
```diff | ||
-import { blue, teal500 } from 'material-ui/src/styles/colors'; | ||
+import blue from 'material-ui/src/colors/blue'; | ||
+import teal from 'material-ui/src/colors/teal'; | ||
-import { blue, teal500 } from 'material-ui/styles/colors'; | ||
+import blue from '@material-ui/core/colors/blue'; | ||
+import teal from '@material-ui/core/colors/teal'; | ||
+const teal500 = teal['500']; | ||
@@ -64,3 +64,3 @@ ``` | ||
Updates the `svg-icons` import paths from `material-ui/svg-icons/<category>/<icon-name>` to `@material-ui/icons/<IconName>`, to use the new [`@material-ui/icons`](https://github.com/mui-org/material-ui/tree/v1-beta/packages/@material-ui/icons) package. | ||
Updates the `svg-icons` import paths from `material-ui/svg-icons/<category>/<icon-name>` to `@material-ui/icons/<IconName>`, to use the new [`@material-ui/icons`](https://github.com/mui-org/material-ui/tree/master/packages/@material-ui/icons) package. | ||
The diff should look like this: | ||
@@ -104,6 +104,6 @@ | ||
Options to [recast](https://github.com/benjamn/recast)'s printer can be provided | ||
through the `printOptions` command line argument | ||
through the `printOptions` command line argument: | ||
```sh | ||
jscodeshift -t transform.js <path> --printOptions='{"quote":"double"}' | ||
jscodeshift -t transform.js <path> --printOptions='{"quote": "double", "trailingComma": false}' | ||
``` |
@@ -154,3 +154,3 @@ // This codemod attempts to fix the color imports breaking change introduced in | ||
const importPath = options.importPath || 'material-ui/styles/colors'; | ||
const targetPath = options.targetPath || 'material-ui/colors'; | ||
const targetPath = options.targetPath || '@material-ui/core/colors'; | ||
@@ -157,0 +157,0 @@ // transforms |
@@ -1,14 +0,14 @@ | ||
import blue from 'material-ui/colors/blue'; | ||
import teal from 'material-ui/colors/teal'; | ||
import common from 'material-ui/colors/common'; | ||
import blue from '@material-ui/core/colors/blue'; | ||
import teal from '@material-ui/core/colors/teal'; | ||
import common from '@material-ui/core/colors/common'; | ||
const teal500 = teal['500']; | ||
const fullWhite = common.fullWhite; | ||
const fullBlack = common.fullBlack; | ||
import lightBlue from 'material-ui/colors/lightBlue'; | ||
import orange from 'material-ui/colors/orange'; | ||
import lightBlue from '@material-ui/core/colors/lightBlue'; | ||
import orange from '@material-ui/core/colors/orange'; | ||
const primaryColor = lightBlue['600']; | ||
const orangeA200 = orange.A200; | ||
import * as muiColors from 'material-ui/colors'; | ||
import * as muiColors from '@material-ui/core/colors'; | ||
let randomColorUsedFromCollection = muiColors.amber['100']; | ||
console.log(muiColors.common.transparent); |
@@ -10,2 +10,3 @@ const entryModuleToFlatten = [ | ||
'CircularProgress', | ||
'ClickAwayListener', | ||
'Collapse', | ||
@@ -60,4 +61,8 @@ 'Dialog', | ||
'withMobileDialog', | ||
'withWidth', | ||
'Zoom', | ||
]; | ||
const keepSpecifiers = ['withWidth']; | ||
export default function transformer(fileInfo, api, options) { | ||
@@ -71,4 +76,7 @@ const j = api.jscodeshift; | ||
const importModule = options.importModule || '@material-ui/core'; | ||
const targetModule = options.targetModule || '@material-ui/core'; | ||
const root = j(fileInfo.source); | ||
const importRegExp = /^material-ui\/(.+)/; | ||
const importRegExp = new RegExp(`^${importModule}/(.+)$`); | ||
@@ -92,4 +100,8 @@ root.find(j.ImportDeclaration).forEach(path => { | ||
hasModifications = true; | ||
// console.log('entryModule', entryModule); | ||
if (keepSpecifiers.includes(entryModule)) { | ||
path.value.source.value = `${targetModule}/${entryModule}`; | ||
return; | ||
} | ||
path.node.specifiers.forEach(specifier => { | ||
@@ -102,3 +114,3 @@ const localName = specifier.local.name; | ||
[j.importDefaultSpecifier(j.identifier(localName))], | ||
j.literal(`material-ui/${entryModule}`), | ||
j.literal(`${targetModule}/${entryModule}`), | ||
); | ||
@@ -110,3 +122,3 @@ | ||
[j.importDefaultSpecifier(j.identifier(localName))], | ||
j.literal(`material-ui/${importedName}`), | ||
j.literal(`${targetModule}/${importedName}`), | ||
); | ||
@@ -113,0 +125,0 @@ |
import React from 'react'; | ||
import { withStyles } from 'material-ui/styles'; | ||
import { MenuItem } from 'material-ui/Menu'; | ||
import MuiTabs, { Tab } from 'material-ui/Tabs'; | ||
import BottomNavigation, { BottomNavigationAction } from 'material-ui/BottomNavigation'; | ||
import Card, { CardActions, CardContent } from 'material-ui/Card'; | ||
import { CardHeader, CardMedia } from 'material-ui/Card'; | ||
import MuiCollapse from 'material-ui/transitions/Collapse'; | ||
import List, { | ||
ListItemIcon, | ||
ListItem, | ||
ListItemAvatar, | ||
ListItemText, | ||
ListItemSecondaryAction, | ||
} from 'material-ui/List'; | ||
import Dialog, { DialogTitle } from 'material-ui/Dialog'; | ||
import { | ||
withMobileDialog, | ||
DialogActions, | ||
DialogContent, | ||
DialogContentText, | ||
} from 'material-ui/Dialog'; | ||
import Slide from 'material-ui/transitions/Slide'; | ||
import Radio, { RadioGroup } from 'material-ui/Radio'; | ||
import { FormControlLabel } from 'material-ui/Form'; | ||
import ExpansionPanel, { | ||
ExpansionPanelSummary, | ||
ExpansionPanelDetails, | ||
ExpansionPanelActions, | ||
} from 'material-ui/ExpansionPanel'; | ||
import GridList, { GridListTile } from 'material-ui/GridList'; | ||
import { CircularProgress } from 'material-ui/Progress'; | ||
import { LinearProgress as MuiLinearProgress } from 'material-ui/Progress'; | ||
import { | ||
FormLabel, | ||
FormControl, | ||
FormGroup, | ||
FormControlLabel, | ||
FormHelperText, | ||
} from 'material-ui/Form'; | ||
import Fade from 'material-ui/transitions/Fade'; | ||
import Stepper, { Step, StepButton, StepContent } from 'material-ui/Stepper'; | ||
import Table, { | ||
TableBody, | ||
TableCell, | ||
TableFooter, | ||
TablePagination, | ||
TableRow, | ||
} from 'material-ui/Table'; | ||
import Input, { InputLabel } from 'material-ui/Input'; | ||
import Grow from 'material-ui/transitions/Grow'; | ||
import TableFooter from 'material-ui/Table/TableFooter'; | ||
import { withStyles } from '@material-ui/core/styles'; | ||
import MenuItem from '@material-ui/core/MenuItem'; | ||
import Tab from '@material-ui/core/Tab'; | ||
import MuiTabs from '@material-ui/core/Tabs'; | ||
import BottomNavigationAction from '@material-ui/core/BottomNavigationAction'; | ||
import BottomNavigation from '@material-ui/core/BottomNavigation'; | ||
import CardContent from '@material-ui/core/CardContent'; | ||
import CardActions from '@material-ui/core/CardActions'; | ||
import Card from '@material-ui/core/Card'; | ||
import CardMedia from '@material-ui/core/CardMedia'; | ||
import CardHeader from '@material-ui/core/CardHeader'; | ||
import MuiCollapse from '@material-ui/core/Collapse'; | ||
import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction'; | ||
import ListItemText from '@material-ui/core/ListItemText'; | ||
import ListItemAvatar from '@material-ui/core/ListItemAvatar'; | ||
import ListItem from '@material-ui/core/ListItem'; | ||
import ListItemIcon from '@material-ui/core/ListItemIcon'; | ||
import List from '@material-ui/core/List'; | ||
import DialogTitle from '@material-ui/core/DialogTitle'; | ||
import Dialog from '@material-ui/core/Dialog'; | ||
import DialogContentText from '@material-ui/core/DialogContentText'; | ||
import DialogContent from '@material-ui/core/DialogContent'; | ||
import DialogActions from '@material-ui/core/DialogActions'; | ||
import withMobileDialog from '@material-ui/core/withMobileDialog'; | ||
import Slide from '@material-ui/core/Slide'; | ||
import RadioGroup from '@material-ui/core/RadioGroup'; | ||
import Radio from '@material-ui/core/Radio'; | ||
import FormControlLabel from '@material-ui/core/FormControlLabel'; | ||
import ExpansionPanelActions from '@material-ui/core/ExpansionPanelActions'; | ||
import ExpansionPanelDetails from '@material-ui/core/ExpansionPanelDetails'; | ||
import ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary'; | ||
import ExpansionPanel from '@material-ui/core/ExpansionPanel'; | ||
import GridListTile from '@material-ui/core/GridListTile'; | ||
import GridList from '@material-ui/core/GridList'; | ||
import CircularProgress from '@material-ui/core/CircularProgress'; | ||
import MuiLinearProgress from '@material-ui/core/LinearProgress'; | ||
import FormHelperText from '@material-ui/core/FormHelperText'; | ||
import FormGroup from '@material-ui/core/FormGroup'; | ||
import FormControl from '@material-ui/core/FormControl'; | ||
import FormLabel from '@material-ui/core/FormLabel'; | ||
import Fade from '@material-ui/core/Fade'; | ||
import StepContent from '@material-ui/core/StepContent'; | ||
import StepButton from '@material-ui/core/StepButton'; | ||
import Step from '@material-ui/core/Step'; | ||
import Stepper from '@material-ui/core/Stepper'; | ||
import TableRow from '@material-ui/core/TableRow'; | ||
import TablePagination from '@material-ui/core/TablePagination'; | ||
import TableFooter from '@material-ui/core/TableFooter'; | ||
import TableCell from '@material-ui/core/TableCell'; | ||
import TableBody from '@material-ui/core/TableBody'; | ||
import Table from '@material-ui/core/Table'; | ||
import InputLabel from '@material-ui/core/InputLabel'; | ||
import Input from '@material-ui/core/Input'; | ||
import Grow from '@material-ui/core/Grow'; | ||
import withWidth, { isWidthUp } from '@material-ui/core/utils/withWidth'; | ||
import Zoom from '@material-ui/core/transitions/Zoom'; | ||
import ClickAwayListener from '@material-ui/core/utils/ClickAwayListener'; |
import React from 'react'; | ||
import { withStyles } from 'material-ui/styles'; | ||
import MenuItem from 'material-ui/MenuItem'; | ||
import Tab from 'material-ui/Tab'; | ||
import MuiTabs from 'material-ui/Tabs'; | ||
import BottomNavigationAction from 'material-ui/BottomNavigationAction'; | ||
import BottomNavigation from 'material-ui/BottomNavigation'; | ||
import CardContent from 'material-ui/CardContent'; | ||
import CardActions from 'material-ui/CardActions'; | ||
import Card from 'material-ui/Card'; | ||
import CardMedia from 'material-ui/CardMedia'; | ||
import CardHeader from 'material-ui/CardHeader'; | ||
import MuiCollapse from 'material-ui/Collapse'; | ||
import ListItemSecondaryAction from 'material-ui/ListItemSecondaryAction'; | ||
import ListItemText from 'material-ui/ListItemText'; | ||
import ListItemAvatar from 'material-ui/ListItemAvatar'; | ||
import ListItem from 'material-ui/ListItem'; | ||
import ListItemIcon from 'material-ui/ListItemIcon'; | ||
import List from 'material-ui/List'; | ||
import DialogTitle from 'material-ui/DialogTitle'; | ||
import Dialog from 'material-ui/Dialog'; | ||
import DialogContentText from 'material-ui/DialogContentText'; | ||
import DialogContent from 'material-ui/DialogContent'; | ||
import DialogActions from 'material-ui/DialogActions'; | ||
import withMobileDialog from 'material-ui/withMobileDialog'; | ||
import Slide from 'material-ui/Slide'; | ||
import RadioGroup from 'material-ui/RadioGroup'; | ||
import Radio from 'material-ui/Radio'; | ||
import FormControlLabel from 'material-ui/FormControlLabel'; | ||
import ExpansionPanelActions from 'material-ui/ExpansionPanelActions'; | ||
import ExpansionPanelDetails from 'material-ui/ExpansionPanelDetails'; | ||
import ExpansionPanelSummary from 'material-ui/ExpansionPanelSummary'; | ||
import ExpansionPanel from 'material-ui/ExpansionPanel'; | ||
import GridListTile from 'material-ui/GridListTile'; | ||
import GridList from 'material-ui/GridList'; | ||
import CircularProgress from 'material-ui/CircularProgress'; | ||
import MuiLinearProgress from 'material-ui/LinearProgress'; | ||
import FormHelperText from 'material-ui/FormHelperText'; | ||
import FormControlLabel from 'material-ui/FormControlLabel'; | ||
import FormGroup from 'material-ui/FormGroup'; | ||
import FormControl from 'material-ui/FormControl'; | ||
import FormLabel from 'material-ui/FormLabel'; | ||
import Fade from 'material-ui/Fade'; | ||
import StepContent from 'material-ui/StepContent'; | ||
import StepButton from 'material-ui/StepButton'; | ||
import Step from 'material-ui/Step'; | ||
import Stepper from 'material-ui/Stepper'; | ||
import TableRow from 'material-ui/TableRow'; | ||
import TablePagination from 'material-ui/TablePagination'; | ||
import TableFooter from 'material-ui/TableFooter'; | ||
import TableCell from 'material-ui/TableCell'; | ||
import TableBody from 'material-ui/TableBody'; | ||
import Table from 'material-ui/Table'; | ||
import InputLabel from 'material-ui/InputLabel'; | ||
import Input from 'material-ui/Input'; | ||
import Grow from 'material-ui/Grow'; | ||
import TableFooter from 'material-ui/TableFooter'; | ||
import { withStyles } from '@material-ui/core/styles'; | ||
import MenuItem from '@material-ui/core/MenuItem'; | ||
import Tab from '@material-ui/core/Tab'; | ||
import MuiTabs from '@material-ui/core/Tabs'; | ||
import BottomNavigationAction from '@material-ui/core/BottomNavigationAction'; | ||
import BottomNavigation from '@material-ui/core/BottomNavigation'; | ||
import CardContent from '@material-ui/core/CardContent'; | ||
import CardActions from '@material-ui/core/CardActions'; | ||
import Card from '@material-ui/core/Card'; | ||
import CardMedia from '@material-ui/core/CardMedia'; | ||
import CardHeader from '@material-ui/core/CardHeader'; | ||
import MuiCollapse from '@material-ui/core/Collapse'; | ||
import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction'; | ||
import ListItemText from '@material-ui/core/ListItemText'; | ||
import ListItemAvatar from '@material-ui/core/ListItemAvatar'; | ||
import ListItem from '@material-ui/core/ListItem'; | ||
import ListItemIcon from '@material-ui/core/ListItemIcon'; | ||
import List from '@material-ui/core/List'; | ||
import DialogTitle from '@material-ui/core/DialogTitle'; | ||
import Dialog from '@material-ui/core/Dialog'; | ||
import DialogContentText from '@material-ui/core/DialogContentText'; | ||
import DialogContent from '@material-ui/core/DialogContent'; | ||
import DialogActions from '@material-ui/core/DialogActions'; | ||
import withMobileDialog from '@material-ui/core/withMobileDialog'; | ||
import Slide from '@material-ui/core/Slide'; | ||
import RadioGroup from '@material-ui/core/RadioGroup'; | ||
import Radio from '@material-ui/core/Radio'; | ||
import FormControlLabel from '@material-ui/core/FormControlLabel'; | ||
import ExpansionPanelActions from '@material-ui/core/ExpansionPanelActions'; | ||
import ExpansionPanelDetails from '@material-ui/core/ExpansionPanelDetails'; | ||
import ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary'; | ||
import ExpansionPanel from '@material-ui/core/ExpansionPanel'; | ||
import GridListTile from '@material-ui/core/GridListTile'; | ||
import GridList from '@material-ui/core/GridList'; | ||
import CircularProgress from '@material-ui/core/CircularProgress'; | ||
import MuiLinearProgress from '@material-ui/core/LinearProgress'; | ||
import FormHelperText from '@material-ui/core/FormHelperText'; | ||
import FormGroup from '@material-ui/core/FormGroup'; | ||
import FormControl from '@material-ui/core/FormControl'; | ||
import FormLabel from '@material-ui/core/FormLabel'; | ||
import Fade from '@material-ui/core/Fade'; | ||
import StepContent from '@material-ui/core/StepContent'; | ||
import StepButton from '@material-ui/core/StepButton'; | ||
import Step from '@material-ui/core/Step'; | ||
import Stepper from '@material-ui/core/Stepper'; | ||
import TableRow from '@material-ui/core/TableRow'; | ||
import TablePagination from '@material-ui/core/TablePagination'; | ||
import TableFooter from '@material-ui/core/TableFooter'; | ||
import TableCell from '@material-ui/core/TableCell'; | ||
import TableBody from '@material-ui/core/TableBody'; | ||
import Table from '@material-ui/core/Table'; | ||
import InputLabel from '@material-ui/core/InputLabel'; | ||
import Input from '@material-ui/core/Input'; | ||
import Grow from '@material-ui/core/Grow'; | ||
import withWidth, { isWidthUp } from '@material-ui/core/withWidth'; | ||
import Zoom from '@material-ui/core/Zoom'; | ||
import ClickAwayListener from '@material-ui/core/ClickAwayListener'; |
@@ -25,3 +25,3 @@ /** | ||
* of being in an import declaration, or a require() call, etc. | ||
* https://github.com/mui-org/material-ui/tree/v1-beta/packages/@material-ui/icons | ||
* https://github.com/mui-org/material-ui/tree/master/packages/@material-ui/icons | ||
* @param {jscodeshift_api_object} j | ||
@@ -28,0 +28,0 @@ * @param {jscodeshift_ast_object} root |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
102346
26
1035