Skip to content

Commit

Permalink
chore: update babel deps and jest
Browse files Browse the repository at this point in the history
  • Loading branch information
quantizor committed May 19, 2023
1 parent b8d2954 commit 911fc09
Show file tree
Hide file tree
Showing 17 changed files with 1,528 additions and 2,444 deletions.
33 changes: 14 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.1.1",
"version": "2.1.3",
"name": "babel-plugin-styled-components",
"description": "Improve the debugging experience and add server-side rendering support to styled-components",
"repository": "styled-components/babel-plugin-styled-components",
Expand All @@ -16,29 +16,24 @@
],
"license": "MIT",
"devDependencies": {
"@babel/cli": "^7.16.0",
"@babel/core": "^7.16.0",
"@babel/plugin-proposal-class-properties": "^7.16.0",
"@babel/plugin-transform-modules-commonjs": "^7.16.0",
"@babel/preset-env": "^7.16.4",
"babel-core": "7.0.0-bridge.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"babel-test": "^0.2.1",
"jest": "^27.3.1",
"@babel/cli": "^7.21.5",
"@babel/core": "^7.21.8",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-transform-modules-commonjs": "^7.21.5",
"@babel/preset-env": "^7.21.5",
"babel-test": "^0.2.4",
"jest": "^29.5.0",
"jest-file-snapshot": "^0.5.0",
"prettier": "^2.4.1",
"rimraf": "^3.0.0",
"styled-components": "^5.3.3"
"prettier": "^2.8.8",
"rimraf": "^3.0.2",
"styled-components": "^5.3.10"
},
"dependencies": {
"@babel/helper-annotate-as-pure": "^7.16.0",
"@babel/helper-module-imports": "^7.16.0",
"@babel/helper-annotate-as-pure": "^7.18.6",
"@babel/helper-module-imports": "^7.21.4",
"babel-plugin-syntax-jsx": "^6.18.0",
"lodash": "^4.17.21",
"picomatch": "^2.3.0"
},
"resolutions": {
"babel-core": "7.0.0-bridge.0"
"picomatch": "^2.3.1"
},
"peerDependencies": {
"styled-components": ">= 2"
Expand Down
2 changes: 0 additions & 2 deletions test/fixtures/add-display-names/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ Component = styled.div.withConfig({
const WrappedComponent = styled(Inner).withConfig({
displayName: "WrappedComponent"
})``;

class ClassComponent {}

ClassComponent.Child = styled.div.withConfig({
displayName: "Child"
})``;
Expand Down
1 change: 0 additions & 1 deletion test/fixtures/css-declared-after-component/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export default function Example() {
return <_StyledDiv>oops</_StyledDiv>;
}
const someCss = css(["color:red;"]);

var _StyledDiv = _styled("div").withConfig({
displayName: "code___StyledDiv",
componentId: "sc-7mydya-0"
Expand Down
2 changes: 0 additions & 2 deletions test/fixtures/does-not-desugar-styled-assignment/output.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const domElements = ['div'];

const styled = () => {};

domElements.forEach(domElement => {
styled[domElement] = styled(domElement);
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const styled_default = require('styled-components/native');

const TestNormal = styled.div.withConfig({
displayName: "code__TestNormal",
componentId: "sc-1w0epmj-0"
Expand Down
2 changes: 0 additions & 2 deletions test/fixtures/ignore-external-styled-import/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ const Paragraph = s.p.withConfig({
displayName: "code__Paragraph",
componentId: "sc-10i7tpl-0"
})(["color:green;"]);

const Foo = p => <Paragraph {...p} />;

const TestNormal = styled(Foo)({
color: red
});
8 changes: 0 additions & 8 deletions test/fixtures/minify-css-to-use-with-transpilation/output.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
"use strict";

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }

var Simple = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["width:100%;"])));

var Interpolation = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["content:\" ", " \";"])), function (props) {
return props.text;
});

var SpecialCharacters = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["content:\" ", " \";color:red;"])), function (props) {
return props.text;
});

var Comment = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["color:red;"])));

var Parens = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["&:hover{color:blue;}"])));
1 change: 0 additions & 1 deletion test/fixtures/pre-transpiled/output.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var _styled = _interopRequireDefault(require("styled-components"));

const Test = (0, _styled.default)('div').withConfig({
displayName: "Test",
componentId: "sc-1m3e07f-0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,29 @@
"use strict";

var _styledComponents = _interopRequireWildcard(require("styled-components"));

var _react = _interopRequireDefault(require("react"));

var _icons = _interopRequireDefault(require("./icons"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

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); }

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; }

const someCss = (0, _styledComponents.css)([" background:purple;"]);

const App1 = () => {
return <_StyledIcons />;
};

const App2 = () => {
return <_StyledIconsFoo />;
};

const App3 = () => {
return <_StyledIconsFooBar />;
};

var _StyledIcons = (0, _styledComponents.default)(_icons.default).withConfig({
displayName: "code___StyledIcons",
componentId: "sc-1wxehft-0"
})(["", ""], someCss);

var _StyledIconsFoo = (0, _styledComponents.default)(_icons.default.Foo).withConfig({
displayName: "code___StyledIconsFoo",
componentId: "sc-1wxehft-1"
})(["", ""], someCss);

var _StyledIconsFooBar = (0, _styledComponents.default)(_icons.default.Foo.Bar).withConfig({
displayName: "code___StyledIconsFooBar",
componentId: "sc-1wxehft-2"
Expand Down
12 changes: 1 addition & 11 deletions test/fixtures/transpile-css-prop-add-import/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _react = _interopRequireDefault(require("react"));

var _Card = _interopRequireDefault(require("../../shared/components/Card"));

var _config = _interopRequireDefault(require("../../../config"));

var _templateObject;

var _templateObject; // @flow
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }

var _default = function _default() {
return <_StyledDiv>
<_Card.default>
Expand All @@ -31,7 +23,5 @@ var _default = function _default() {
</_Card.default>
</_StyledDiv>;
};

exports["default"] = _default;

var _StyledDiv = (0, _styledComponents["default"])("div")(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 35em;\n "])));
10 changes: 1 addition & 9 deletions test/fixtures/transpile-css-prop-add-require/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _react = _interopRequireDefault(require("react"));

var _templateObject;

var _templateObject; // @flow
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }

var _default = function _default() {
return <_StyledDiv />;
};

exports["default"] = _default;

var _StyledDiv = (0, _styledComponents["default"])("div")(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 35em;\n "])));
Loading

0 comments on commit 911fc09

Please sign in to comment.