@mui/codemod 5.10.11 → 5.10.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/codemod.js
CHANGED
|
File without changes
|
|
@@ -274,7 +274,7 @@ function transformer(file, api, options) {
|
|
|
274
274
|
* @param {import('jscodeshift').ObjectExpression | import('jscodeshift').ArrowFunctionExpression | import('jscodeshift').FunctionDeclaration} prevStyleArg
|
|
275
275
|
*/
|
|
276
276
|
|
|
277
|
-
function convertToStyledArg(functionExpression, rootKeys
|
|
277
|
+
function convertToStyledArg(functionExpression, rootKeys, prevStyleArg) {
|
|
278
278
|
const objectExpression = getObjectExpression(functionExpression);
|
|
279
279
|
|
|
280
280
|
if (objectExpression) {
|
|
@@ -9,7 +9,7 @@ exports.useExportedStyles = exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
|
14
14
|
var _core = require("@material-ui/core");
|
|
15
15
|
|
|
@@ -17,6 +17,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
17
17
|
|
|
18
18
|
var _InnerComponent;
|
|
19
19
|
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
20
24
|
const useStyles = (0, _core.makeStyles)(() => ({
|
|
21
25
|
test: {
|
|
22
26
|
backgroundColor: "purple",
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.useExportedStyles = exports.default = void 0;
|
|
9
7
|
|
|
10
|
-
var
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
9
|
|
|
12
10
|
var _mui = require("tss-react/mui");
|
|
13
11
|
|
|
@@ -15,6 +13,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
15
13
|
|
|
16
14
|
var _InnerComponent;
|
|
17
15
|
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
|
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
+
|
|
18
20
|
// TODO jss-to-tss-react codemod: Unable to handle style definition reliably. ArrowFunctionExpression in CSS prop.
|
|
19
21
|
const useStyles = (0, _mui.makeStyles)()((_theme, _params, classes) => ({
|
|
20
22
|
test: {
|