@chakra-ui/cli
Advanced tools
Comparing version 0.0.0-dev-20211126154241 to 0.0.0-dev-202111299720
@@ -6,2 +6,4 @@ "use strict"; | ||
var _prettier = require("prettier"); | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
@@ -13,33 +15,32 @@ | ||
var createFormatFileWithPrettier = function createFormatFileWithPrettier(prettier) { | ||
return /*#__PURE__*/function () { | ||
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(content) { | ||
var prettierConfig; | ||
return regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
_context.next = 2; | ||
return prettier.resolveConfig(process.cwd()); | ||
function createFormatFileWithPrettier(_x) { | ||
return _createFormatFileWithPrettier.apply(this, arguments); | ||
} | ||
case 2: | ||
prettierConfig = _context.sent; | ||
return _context.abrupt("return", prettier.format(String(content), _extends({}, prettierConfig, { | ||
parser: "typescript" | ||
}))); | ||
function _createFormatFileWithPrettier() { | ||
_createFormatFileWithPrettier = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(content) { | ||
var prettierConfig; | ||
return regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
_context.next = 2; | ||
return (0, _prettier.resolveConfig)(process.cwd()); | ||
case 4: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
case 2: | ||
prettierConfig = _context.sent; | ||
return _context.abrupt("return", (0, _prettier.format)(String(content), _extends({}, prettierConfig, { | ||
parser: "typescript" | ||
}))); | ||
case 4: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
}, _callee); | ||
})); | ||
} | ||
}, _callee); | ||
})); | ||
return _createFormatFileWithPrettier.apply(this, arguments); | ||
} | ||
return function (_x) { | ||
return _ref.apply(this, arguments); | ||
}; | ||
}(); | ||
}; | ||
function formatWithPrettierIfAvailable(_x2) { | ||
@@ -51,3 +52,2 @@ return _formatWithPrettierIfAvailable.apply(this, arguments); | ||
_formatWithPrettierIfAvailable = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(content) { | ||
var prettier; | ||
return regeneratorRuntime.wrap(function _callee2$(_context2) { | ||
@@ -57,17 +57,5 @@ while (1) { | ||
case 0: | ||
_context2.prev = 0; | ||
// eslint-disable-next-line global-require | ||
prettier = require("prettier"); | ||
_context2.next = 7; | ||
break; | ||
return _context2.abrupt("return", createFormatFileWithPrettier(content)); | ||
case 4: | ||
_context2.prev = 4; | ||
_context2.t0 = _context2["catch"](0); | ||
return _context2.abrupt("return", content); | ||
case 7: | ||
return _context2.abrupt("return", createFormatFileWithPrettier(prettier)(content)); | ||
case 8: | ||
case 1: | ||
case "end": | ||
@@ -77,3 +65,3 @@ return _context2.stop(); | ||
} | ||
}, _callee2, null, [[0, 4]]); | ||
}, _callee2); | ||
})); | ||
@@ -80,0 +68,0 @@ return _formatWithPrettierIfAvailable.apply(this, arguments); |
{ | ||
"name": "@chakra-ui/cli", | ||
"version": "0.0.0-dev-20211126154241", | ||
"version": "0.0.0-dev-202111299720", | ||
"description": "Generate theme typings for autocomplete", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
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
77197
854