Skip to content

Bump typescript from 3.3.1 to 3.6.2 #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions src/__tests__/baselines/base/sample1.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,28 @@ Source code:
TypeScript before transform:

import styled from "styled-components";
const Button = styled.button \`\\n color: red;\\n\`;
const Button = styled.button \`
color: red;
\`;
declare const nonStyled: any;
const NonButton = nonStyled.button \`\\n yo\\n\`;
const OtherButton = styled(Button) \`\\n color: blue;\\n\`;
const SuperButton = Button.extend \`\\n color: super;\\n\`;
export default styled.link \`\\n color: black;\\n\`;
export const SmallButton = Button.extend \`\\n font-size: .7em;\\n\`;
const MiniButton = styled(SmallButton).attrs({ size: "mini" }) \`\\n font-size: .1em;\\n\`;
const NonButton = nonStyled.button \`
yo
\`;
const OtherButton = styled(Button) \`
color: blue;
\`;
const SuperButton = Button.extend \`
color: super;
\`;
export default styled.link \`
color: black;
\`;
export const SmallButton = Button.extend \`
font-size: .7em;
\`;
const MiniButton = styled(SmallButton).attrs({ size: "mini" }) \`
font-size: .1em;
\`;


TypeScript after transform:
Expand Down
4 changes: 3 additions & 1 deletion src/__tests__/baselines/base/sample3.tsx.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ TypeScript before transform:
interface LabelProps {
size: number;
}
const CustomLabel = styled.label \`\\n font-size: \${(props: LabelProps) => props.size + "px"}\\n\`;
const CustomLabel = styled.label \`
font-size: \${(props: LabelProps) => props.size + "px"}
\`;
const LabeledLink = () => <SmallButton />;
export default CustomLabel;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,21 @@ Source code:
TypeScript before transform:

declare const styled: any;
export const A = styled.div \`\\n border: \${"solid"} 10px;\\n\`;
styled.div \`\\n border: \${"solid"}// comment here\\n10px;\\n border: solid// comment here\\n10px;\\n\`;
styled.div \`\\n border: \${"solid"}/* comment here\\n*/10px;\\n border: \${"solid"}/* comment here\\n*/ 10px;\\n\`;
export const A = styled.div \`
border: \${"solid"} 10px;
\`;
styled.div \`
border: \${"solid"}// comment here
10px;
border: solid// comment here
10px;
\`;
styled.div \`
border: \${"solid"}/* comment here
*/10px;
border: \${"solid"}/* comment here
*/ 10px;
\`;


TypeScript after transform:
Expand Down
16 changes: 14 additions & 2 deletions src/__tests__/baselines/minification-only/issue36.tsx.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,20 @@ TypeScript before transform:

declare const keyframes: any;
declare const styled: any;
const rotate360 = keyframes \`\\n from {\\n transform: rotate(0deg);\\n }\\n to {\\n transform: rotate(360deg);\\n }\\n\`;
export const StyledDiv = styled.div \`\\n width: 100px;\\n height: 100px;\\n background-color: greenyellow;\\n animation: \${rotate360} 2s linear infinite;\\n\`;
const rotate360 = keyframes \`
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
\`;
export const StyledDiv = styled.div \`
width: 100px;
height: 100px;
background-color: greenyellow;
animation: \${rotate360} 2s linear infinite;
\`;


TypeScript after transform:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,21 @@ TypeScript before transform:
declare const css: any;
declare const createGlobalStyle: any;
declare const theColor: any;
const key = keyframes \`\\n to {\\n transform: rotate(360deg);\\n }\\n\`;
const color = css \`\\n color: \${theColor};\\n\`;
const MyRedBody = createGlobalStyle \`\\n body {\\n background-color: red; // comments\\n \${color} // comments\\n // it will be ignored, but still emitted \${color}\\n }\\n\`;
const key = keyframes \`
to {
transform: rotate(360deg);
}
\`;
const color = css \`
color: \${theColor};
\`;
const MyRedBody = createGlobalStyle \`
body {
background-color: red; // comments
\${color} // comments
// it will be ignored, but still emitted \${color}
}
\`;
export {};


Expand All @@ -52,7 +64,8 @@ TypeScript after transform:
declare const theColor: any;
const key = keyframes \`to{transform:rotate(360deg);}\`;
const color = css \`color:\${theColor};\`;
const MyRedBody = createGlobalStyle \`body{background-color:red;\${color}//\${color}\\n}\`;
const MyRedBody = createGlobalStyle \`body{background-color:red;\${color}//\${color}
}\`;
export {};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,24 @@ Source code:
TypeScript before transform:

declare const styled: any;
const Simple = styled.div \`\\n width: 100%;\\n\`;
const Interpolation = styled.div \`\\n content: " \${props => props.text} ";\\n\`;
const SpecialCharacters = styled.div \`\\n content: " \${props => props.text} ";\\n color: red;\\n\`;
const Comment = styled.div \`\\n // comment\\n color: red;\\n\`;
const Parens = styled.div \`\\n &:hover {\\n color: blue;\\n }\\n\`;
const Simple = styled.div \`
width: 100%;
\`;
const Interpolation = styled.div \`
content: " \${props => props.text} ";
\`;
const SpecialCharacters = styled.div \`
content: " \${props => props.text} ";\\n color: red;
\`;
const Comment = styled.div \`
// comment
color: red;
\`;
const Parens = styled.div \`
&:hover {
color: blue;
}
\`;
export {};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,35 @@ Source code:
TypeScript before transform:

declare const styled: any;
const Simple = styled.div \`\\n width: 100%;\\n\`;
const Interpolation = styled.div \`\\n content: "https://test.com/\${props => props.endpoint}";\\n\`;
const SpecialCharacters = styled.div \`\\n content: " \${props => props.text} ";\\n color: red;\\n\`;
const Comment = styled.div \`\\n width: 100%;\\n // comment\\n color: red;\\n\`;
const Parens = styled.div \`\\n &:hover {\\n color: blue;\\n }\\n color: red;\\n\`;
const UrlComments = styled.div \`\\n color: red;\\n /* // */\\n background: red;\\n /* comment 1 */\\n /* comment 2 */\\n // comment 3\\n border: 1px solid green;\\n\`;
const Simple = styled.div \`
width: 100%;
\`;
const Interpolation = styled.div \`
content: "https://test.com/\${props => props.endpoint}";
\`;
const SpecialCharacters = styled.div \`
content: " \${props => props.text} ";\\n color: red;
\`;
const Comment = styled.div \`
width: 100%;
// comment
color: red;
\`;
const Parens = styled.div \`
&:hover {
color: blue;
}
color: red;
\`;
const UrlComments = styled.div \`
color: red;
/* // */
background: red;
/* comment 1 */
/* comment 2 */
// comment 3
border: 1px solid green;
\`;
export {};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,45 @@ Source code:
TypeScript before transform:

declare const styled: any;
const Test1 = styled.div \`\\n width: 100%;\\n // color: \${"red"};\\n\`;
const Test2 = styled.div \`\\n width: 100%;\\n // color: pale\${"red"};\\n\`;
const Test3 = styled.div \`\\n width: 100%;\\n // color\\n \${"red"};\\n\`;
const Test4 = styled.div \`\\n width: 100%;\\n // color: \${"red"}-blue;\\n\`;
const Test5 = styled.div \`\\n width: 100%;\\n // color: \${"red"}\${"blue"};\\n\`;
const Test6 = styled.div \`\\n background: url("https://google.com");\\n width: 100%;\\n \${"green"} // color: \${"red"}\${"blue"};\\n\`;
const Test7 = styled.div \`\\n background: url("https://google.com");\\n width: \${p => p.props.width};\\n \${"green"} // color: \${"red"}\${"blue"};\\n height: \${p => p.props.height};\\n\`;
const Test8 = styled.dev \`\\n color: /* \${"red"} ... disabled */ blue;\\n\`;
const Test9 = styled.dev \`\\n color: // \${"red"} ... disabled\\n blue\\n\`;
const Test1 = styled.div \`
width: 100%;
// color: \${"red"};
\`;
const Test2 = styled.div \`
width: 100%;
// color: pale\${"red"};
\`;
const Test3 = styled.div \`
width: 100%;
// color
\${"red"};
\`;
const Test4 = styled.div \`
width: 100%;
// color: \${"red"}-blue;
\`;
const Test5 = styled.div \`
width: 100%;
// color: \${"red"}\${"blue"};
\`;
const Test6 = styled.div \`
background: url("https://google.com");
width: 100%;
\${"green"} // color: \${"red"}\${"blue"};
\`;
const Test7 = styled.div \`
background: url("https://google.com");
width: \${p => p.props.width};
\${"green"} // color: \${"red"}\${"blue"};
height: \${p => p.props.height};
\`;
const Test8 = styled.dev \`
color: /* \${"red"} ... disabled */ blue;
\`;
const Test9 = styled.dev \`
color: // \${"red"} ... disabled
blue
\`;
export {};


Expand All @@ -81,9 +111,11 @@ TypeScript after transform:
const Test4 = styled.div \`width:100%;//\${'red'}\`;
const Test5 = styled.div \`width:100%;//\${'red'}\${'blue'}\`;
const Test6 = styled.div \`background:url("https://google.com");width:100%;\${'green'}//\${'red'}\${'blue'}\`;
const Test7 = styled.div \`background:url("https://google.com");width:\${p => p.props.width};\${'green'}//\${'red'}\${'blue'}\\nheight:\${p => p.props.height};\`;
const Test7 = styled.div \`background:url("https://google.com");width:\${p => p.props.width};\${'green'}//\${'red'}\${'blue'}
height:\${p => p.props.height};\`;
const Test8 = styled.dev \`color:/*\${'red'}*/blue;\`;
const Test9 = styled.dev \`color://\${'red'}\\nblue\`;
const Test9 = styled.dev \`color://\${'red'}
blue\`;
export {};


Expand Down
17 changes: 12 additions & 5 deletions src/__tests__/baselines/minification-only/simple.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ TypeScript before transform:
styled.div \`abc def//ghi//jkl\`;
// ignores comment markers that are inside strings
// \`abc def"//"ghi\\'//\\'jkl\`
styled.div \`abc def"//"ghi'//'jkl//the end\`;
styled.div \`abc def"//"ghi\\'//\\'jkl//the end\`;
// \`abc def"//"\`
styled.div \`abc def"//"\`;
// ignores comment markers that are inside parantheses
Expand All @@ -103,10 +103,14 @@ TypeScript before transform:
styled.div \`this\\nis\\na/* ignore me \\n please */\\ntest\`;
// removes line comments filling an entire line
// \`line one{line:two;}\`
styled.div \`line one {\\n // remove this comment\\n line: two;\\n}\`;
styled.div \`line one {
// remove this comment
line: two;
}\`;
// removes line comments at the end of lines of code
// \`valid line with out comments\`
styled.div \`valid line with // a comment\\nout comments\`;
styled.div \`valid line with // a comment
out comments\`;
// preserves multi-line comments starting with /*!
// \`this is a /*! dont ignore me please */ test\`
styled.div \`this is a /*! dont ignore me please */ test/* but you can ignore me */\`;
Expand All @@ -119,13 +123,16 @@ TypeScript before transform:
// \`this\\nis\\na \\ntest\`
styled.div \`this\\nis\\na/* ignore me \\n please */\\ntest\`;
// \`this is a test\`
styled.div \`this\\nis\\na/* ignore me \\n please */\\ntest\`;
styled.div \`this
is
a/* ignore me \\n please */
test\`;
// removes spaces around symbols
// \`;:{},;\`
styled.div \`; : { } , ; \`;
// ignores symbols inside strings
// \`;" : "\\' : \\';\`
styled.div \`; " : " ' : ' ;\`;
styled.div \`; " : " \\' : \\' ;\`;


TypeScript after transform:
Expand Down
18 changes: 15 additions & 3 deletions src/__tests__/baselines/minification/issue36-extended.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,21 @@ Source code:
TypeScript before transform:

declare const styled: any;
export const A = styled.div \`\\n border: \${"solid"} 10px;\\n\`;
styled.div \`\\n border: \${"solid"}// comment here\\n10px;\\n border: solid// comment here\\n10px;\\n\`;
styled.div \`\\n border: \${"solid"}/* comment here\\n*/10px;\\n border: \${"solid"}/* comment here\\n*/ 10px;\\n\`;
export const A = styled.div \`
border: \${"solid"} 10px;
\`;
styled.div \`
border: \${"solid"}// comment here
10px;
border: solid// comment here
10px;
\`;
styled.div \`
border: \${"solid"}/* comment here
*/10px;
border: \${"solid"}/* comment here
*/ 10px;
\`;


TypeScript after transform:
Expand Down
16 changes: 14 additions & 2 deletions src/__tests__/baselines/minification/issue36.tsx.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,20 @@ TypeScript before transform:

declare const keyframes: any;
declare const styled: any;
const rotate360 = keyframes \`\\n from {\\n transform: rotate(0deg);\\n }\\n to {\\n transform: rotate(360deg);\\n }\\n\`;
export const StyledDiv = styled.div \`\\n width: 100px;\\n height: 100px;\\n background-color: greenyellow;\\n animation: \${rotate360} 2s linear infinite;\\n\`;
const rotate360 = keyframes \`
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
\`;
export const StyledDiv = styled.div \`
width: 100px;
height: 100px;
background-color: greenyellow;
animation: \${rotate360} 2s linear infinite;
\`;


TypeScript after transform:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,21 @@ TypeScript before transform:
declare const css: any;
declare const createGlobalStyle: any;
declare const theColor: any;
const key = keyframes \`\\n to {\\n transform: rotate(360deg);\\n }\\n\`;
const color = css \`\\n color: \${theColor};\\n\`;
const MyRedBody = createGlobalStyle \`\\n body {\\n background-color: red; // comments\\n \${color} // comments\\n // it will be ignored, but still emitted \${color}\\n }\\n\`;
const key = keyframes \`
to {
transform: rotate(360deg);
}
\`;
const color = css \`
color: \${theColor};
\`;
const MyRedBody = createGlobalStyle \`
body {
background-color: red; // comments
\${color} // comments
// it will be ignored, but still emitted \${color}
}
\`;
export {};


Expand All @@ -52,7 +64,8 @@ TypeScript after transform:
declare const theColor: any;
const key = keyframes \`to{transform:rotate(360deg);}\`;
const color = css \`color:\${theColor};\`;
const MyRedBody = createGlobalStyle \`body{background-color:red;\${color}//\${color}\\n}\`;
const MyRedBody = createGlobalStyle \`body{background-color:red;\${color}//\${color}
}\`;
export {};


Expand Down
Loading