From 4f96bd44e2c4adda86f68ccffd5961d5b9611f13 Mon Sep 17 00:00:00 2001 From: Ciffelia Date: Wed, 22 Nov 2023 04:26:04 +0900 Subject: [PATCH] update test fixtures output --- .../output.js | 29 ++------- .../output.js | 42 ++++++------- .../output.js | 62 +++++++------------ 3 files changed, 48 insertions(+), 85 deletions(-) diff --git a/packages/styled-components/transform/tests/fixtures/minify-css-to-use-with-transpilation/output.js b/packages/styled-components/transform/tests/fixtures/minify-css-to-use-with-transpilation/output.js index 9e95d2f24..2b3112d1b 100644 --- a/packages/styled-components/transform/tests/fixtures/minify-css-to-use-with-transpilation/output.js +++ b/packages/styled-components/transform/tests/fixtures/minify-css-to-use-with-transpilation/output.js @@ -1,23 +1,6 @@ -"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;}"]))); +import styled from 'styled-components'; +const Simple = styled.div`width:100%;`; +const Interpolation = styled.div`content:" ${(props)=>props.text} ";`; +const SpecialCharacters = styled.div`content:" ${(props)=>props.text} ";color:red;`; +const Comment = styled.div`color:red;`; +const Parens = styled.div`&:hover{color:blue;}`; diff --git a/packages/styled-components/transform/tests/fixtures/minify-single-line-comments-with-interpolations/output.js b/packages/styled-components/transform/tests/fixtures/minify-single-line-comments-with-interpolations/output.js index db4b692d8..eb1927db1 100644 --- a/packages/styled-components/transform/tests/fixtures/minify-single-line-comments-with-interpolations/output.js +++ b/packages/styled-components/transform/tests/fixtures/minify-single-line-comments-with-interpolations/output.js @@ -1,29 +1,29 @@ import styled from 'styled-components'; const Test1 = styled.div.withConfig({ - displayName: "code__Test1", - componentId: "sc-kc0mjf-0" -})(["width:100%;"]); + displayName: "code__Test1", + componentId: "sc-bfa13f91-0" +})`width:100%;`; const Test2 = styled.div.withConfig({ - displayName: "code__Test2", - componentId: "sc-kc0mjf-1" -})(["width:100%;"]); + displayName: "code__Test2", + componentId: "sc-bfa13f91-1" +})`width:100%;`; const Test3 = styled.div.withConfig({ - displayName: "code__Test3", - componentId: "sc-kc0mjf-2" -})(["width:100%;", ";"], 'red'); + displayName: "code__Test3", + componentId: "sc-bfa13f91-2" +})`width:100%;${'red'};`; const Test4 = styled.div.withConfig({ - displayName: "code__Test4", - componentId: "sc-kc0mjf-3" -})(["width:100%;"]); + displayName: "code__Test4", + componentId: "sc-bfa13f91-3" +})`width:100%;`; const Test5 = styled.div.withConfig({ - displayName: "code__Test5", - componentId: "sc-kc0mjf-4" -})(["width:100%;"]); + displayName: "code__Test5", + componentId: "sc-bfa13f91-4" +})`width:100%;`; const Test6 = styled.div.withConfig({ - displayName: "code__Test6", - componentId: "sc-kc0mjf-5" -})(["background:url(\"https://google.com\");width:100%;", " "], 'green'); + displayName: "code__Test6", + componentId: "sc-bfa13f91-5" +})`background:url("https://google.com");width:100%;${'green'} `; const Test7 = styled.div.withConfig({ - displayName: "code__Test7", - componentId: "sc-kc0mjf-6" -})(["background:url(\"https://google.com\");width:", ";", " height:", ";"], p => p.props.width, 'green', p => p.props.height); + displayName: "code__Test7", + componentId: "sc-bfa13f91-6" +})`background:url("https://google.com");width:${(p)=>p.props.width};${'green'} height:${(p)=>p.props.height};`; diff --git a/packages/styled-components/transform/tests/fixtures/transpile-css-prop-all-options-on/output.js b/packages/styled-components/transform/tests/fixtures/transpile-css-prop-all-options-on/output.js index 00f099d98..adac803bc 100644 --- a/packages/styled-components/transform/tests/fixtures/transpile-css-prop-all-options-on/output.js +++ b/packages/styled-components/transform/tests/fixtures/transpile-css-prop-all-options-on/output.js @@ -6,15 +6,11 @@ const { SomeOtherComponent } = require('../SomeOtherComponentPath'); */ const Thing = styled.div.withConfig({ displayName: "code__Thing", componentId: "sc-867225be-0" -})` - color: red; -`; +})`color:red;`; const Thing2 = styled(Thing).withConfig({ displayName: "code__Thing2", componentId: "sc-867225be-1" -})` - background: blue; -`; +})`background:blue;`; /* * Basic fixtures */ const StaticString = (p)=><_StyledP>A; @@ -86,9 +82,7 @@ const SpreadObjectPropMixedInputs = (p)=>{ const Thing3 = styled.div.withConfig({ displayName: "code__Thing3", componentId: "sc-867225be-2" -})` - color: blue; -`; +})`color:blue;`; var _StyledThing6 = styled(Thing3).withConfig({ displayName: "code___StyledThing6", componentId: "sc-867225be-3" @@ -122,7 +116,7 @@ var _StyledThing3 = styled(Thing3).withConfig({ var _StyledThing = styled(Thing3).withConfig({ displayName: "code___StyledThing", componentId: "sc-867225be-7" -})`color: red;`; +})`color:red;`; const EarlyUsageComponent2 = (p)=><_StyledThing2/>; function Thing4(props1) { return
; @@ -182,25 +176,23 @@ const ObjectPropWithSpread = ()=>{ var _StyledSomeComponent = styled(SomeComponent).withConfig({ displayName: "code___StyledSomeComponent", componentId: "sc-867225be-8" -})`color: red;`; +})`color:red;`; var _StyledSomeOtherComponent = styled(SomeOtherComponent).withConfig({ displayName: "code___StyledSomeOtherComponent", componentId: "sc-867225be-9" -})`color: red;`; +})`color:red;`; var _StyledThing2 = styled(Thing4).withConfig({ displayName: "code___StyledThing2", componentId: "sc-867225be-10" -})`color: red;`; +})`color:red;`; var _StyledP = styled("p").withConfig({ displayName: "code___StyledP", componentId: "sc-867225be-11" -})`flex: 1;`; +})`flex:1;`; var _StyledP2 = styled("p").withConfig({ displayName: "code___StyledP2", componentId: "sc-867225be-12" -})` - flex: 1; - `; +})`flex:1;`; var _StyledP3 = styled("p").withConfig({ displayName: "code___StyledP3", componentId: "sc-867225be-13" @@ -210,17 +202,15 @@ var _StyledP3 = styled("p").withConfig({ var _StyledP4 = styled("p").withConfig({ displayName: "code___StyledP4", componentId: "sc-867225be-14" -})`flex: 1;`; +})`flex:1;`; var _StyledP5 = styled("p").withConfig({ displayName: "code___StyledP5", componentId: "sc-867225be-15" -})` - color: blue; - `; +})`color:blue;`; var _StyledParagraph = styled(Paragraph).withConfig({ displayName: "code___StyledParagraph", componentId: "sc-867225be-16" -})`flex: 1`; +})`flex:1`; var _StyledP6 = styled("p").withConfig({ displayName: "code___StyledP6", componentId: "sc-867225be-17" @@ -228,49 +218,39 @@ var _StyledP6 = styled("p").withConfig({ var _StyledP7 = styled("p").withConfig({ displayName: "code___StyledP7", componentId: "sc-867225be-18" -})` - background: ${(p)=>p.$_css2}; - `; +})`background:${(p)=>p.$_css2};`; var _StyledP8 = styled("p").withConfig({ displayName: "code___StyledP8", componentId: "sc-867225be-19" -})` - color: ${(props1)=>props1.theme.a}; - `; +})`color:${(props1)=>props1.theme.a};`; var _StyledP9 = styled("p").withConfig({ displayName: "code___StyledP9", componentId: "sc-867225be-20" -})` - border-radius: ${radius}px; - `; +})`border-radius:${radius}px;`; var _StyledP10 = styled("p").withConfig({ displayName: "code___StyledP10", componentId: "sc-867225be-21" -})` - color: ${(p)=>p.$_css3}; - `; +})`color:${(p)=>p.$_css3};`; var _StyledP11 = styled("p").withConfig({ displayName: "code___StyledP11", componentId: "sc-867225be-22" -})` - color: ${(props1)=>props1.theme.color}; - `; +})`color:${(props1)=>props1.theme.color};`; var _StyledButtonGhost = styled(Button.Ghost).withConfig({ displayName: "code___StyledButtonGhost", componentId: "sc-867225be-23" -})`flex: 1`; +})`flex:1`; var _StyledButtonGhostNew = styled(Button.Ghost.New).withConfig({ displayName: "code___StyledButtonGhostNew", componentId: "sc-867225be-24" -})`flex: 1`; +})`flex:1`; var _StyledButtonGhost2 = styled(button.ghost).withConfig({ displayName: "code___StyledButtonGhost2", componentId: "sc-867225be-25" -})`flex: 1`; +})`flex:1`; var _StyledButtonGhost3 = styled("button-ghost").withConfig({ displayName: "code___StyledButtonGhost3", componentId: "sc-867225be-26" -})`flex: 1`; +})`flex:1`; var _StyledP12 = styled("p").withConfig({ displayName: "code___StyledP12", componentId: "sc-867225be-27"