babel-plugin-emotion-rename
Advanced tools
Comparing version 1.0.0-beta.19 to 1.0.0-beta.20
@@ -72,3 +72,4 @@ "use strict"; | ||
name: key, | ||
path: MAP_CSS_LIST[key].path | ||
path: MAP_CSS_LIST[key].path, | ||
_type: MAP_CSS_LIST[key]._type | ||
}; | ||
@@ -81,2 +82,6 @@ }); | ||
var _t$path$scope$block$b, _t$path$scope$block$b2; | ||
if (t._type === "callee") { | ||
t.path.node.callee.name = "css2"; | ||
return; | ||
} | ||
if ((_t$path$scope$block$b = t.path.scope.block.body.body[0]) !== null && _t$path$scope$block$b !== void 0 && _t$path$scope$block$b.argument.tag) { | ||
@@ -140,2 +145,7 @@ t.path.scope.block.body.body[0].argument.tag.name = "css2"; | ||
var _path$node$tag$object; | ||
// if (path.node.tag?.name === CSS_LOCAL_NAME) { | ||
// if (path?.parent?.id?.type === "Identifier") { | ||
// MAP_CSS_LIST[path?.parent?.id.name] = 1; | ||
// } | ||
// } | ||
if (((_path$node$tag$object = path.node.tag.object) === null || _path$node$tag$object === void 0 ? void 0 : _path$node$tag$object.name) === STYLED_LOCAL_NAME) { | ||
@@ -229,2 +239,23 @@ path.node.quasi.expressions.map(function (exp) { | ||
} | ||
if (path.node.callee.name === CSS_LOCAL_NAME && path.node.arguments && path.node.arguments.length) { | ||
var _path$parent, _path$parent$id3; | ||
if (((_path$parent = path.parent) === null || _path$parent === void 0 ? void 0 : (_path$parent$id3 = _path$parent.id) === null || _path$parent$id3 === void 0 ? void 0 : _path$parent$id3.type) === "Identifier") { | ||
var _path$parent2, _path$parent2$id; | ||
MAP_CSS_LIST[(_path$parent2 = path.parent) === null || _path$parent2 === void 0 ? void 0 : (_path$parent2$id = _path$parent2.id) === null || _path$parent2$id === void 0 ? void 0 : _path$parent2$id.name] = { | ||
_type: "callee", | ||
path: path | ||
}; | ||
} | ||
path.node.arguments.filter(function (a) { | ||
return a.type === "Identifier"; | ||
}).map(function (a) { | ||
return a.name; | ||
}).forEach(function (expName) { | ||
if (MAP_CSS_LIST[expName]) { | ||
MAP_STYLED_VARS[expName] = 1; | ||
console.log("css within css --->", expName); | ||
} | ||
}); | ||
return; | ||
} | ||
REP.forEach(function (_ref2) { | ||
@@ -231,0 +262,0 @@ var original = _ref2.original; |
{ | ||
"name": "babel-plugin-emotion-rename", | ||
"version": "1.0.0-beta.19", | ||
"version": "1.0.0-beta.20", | ||
"description": "Babel plugin to rename old Emotion 9 import to new Emotion 10+ import", | ||
@@ -5,0 +5,0 @@ "main": "lib/index", |
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
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
16539
279