-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add babel-plugin-styled-components (smaller bundle size)
- Loading branch information
1 parent
8583547
commit fefe571
Showing
10 changed files
with
107 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/// <reference path="src/styled.d.ts" /> | ||
|
||
declare module '*.json' { | ||
const content: any; | ||
export = content; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import * as styledComponents from 'styled-components'; | ||
|
||
// Styled components typings for using babel-plugin BEFORE typescript | ||
declare module 'styled-components' { | ||
interface ThemedStyledFunction<P, T, O = P> { | ||
// adding "| string[]" for transpileTemplateLiterals and similar below | ||
( | ||
strings: TemplateStringsArray | string[], | ||
...interpolations: Interpolation<ThemedStyledProps<P, T>>[] | ||
): StyledComponentClass<P, T, O>; | ||
|
||
new <U>( | ||
strings: TemplateStringsArray | string[], | ||
...interpolations: Interpolation<ThemedStyledProps<P & U, T>>[] | ||
): StyledComponentClass<P & U, T, O & U>; | ||
|
||
// adding "withConfig" for transpileTemplateLiterals | ||
withConfig(config: any): ThemedStyledFunction<P, T, O>; | ||
} | ||
|
||
export interface ThemedCssFunction<T> { | ||
// adding "| string[]" for transpileTemplateLiterals and similar below | ||
( | ||
strings: TemplateStringsArray | string[], | ||
...interpolations: SimpleInterpolation[] | ||
): InterpolationValue[]; | ||
<P>( | ||
strings: TemplateStringsArray | string[], | ||
...interpolations: Interpolation<ThemedStyledProps<P, T>>[] | ||
): FlattenInterpolation<ThemedStyledProps<P, T>>[]; | ||
} | ||
|
||
interface ThemedStyledComponentsModule<T> { | ||
keyframes( | ||
strings: TemplateStringsArray | string[], | ||
...interpolations: SimpleInterpolation[] | ||
): string; | ||
injectGlobal( | ||
strings: TemplateStringsArray | string[], | ||
...interpolations: SimpleInterpolation[] | ||
): void; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,12 @@ | |
source-map "^0.5.0" | ||
trim-right "^1.0.1" | ||
|
||
"@babel/helper-annotate-as-pure@^7.0.0-beta.37": | ||
version "7.0.0-beta.42" | ||
resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0-beta.42.tgz#f2b0a3be684018b55fc308eb5408326f78479085" | ||
dependencies: | ||
"@babel/types" "7.0.0-beta.42" | ||
|
||
"@babel/[email protected]": | ||
version "7.0.0-beta.42" | ||
resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.42.tgz#b38b8f4f85168d1812c543dd700b5d549b0c4658" | ||
|
@@ -919,6 +925,14 @@ babel-plugin-jest-hoist@^22.4.1: | |
version "22.4.1" | ||
resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-22.4.1.tgz#d712fe5da8b6965f3191dacddbefdbdf4fb66d63" | ||
|
||
babel-plugin-styled-components@^1.5.1: | ||
version "1.5.1" | ||
resolved "https://registry.yarnpkg.com/babel-plugin-styled-components/-/babel-plugin-styled-components-1.5.1.tgz#31dbeb696d1354d1585e60d66c7905f5e474afcd" | ||
dependencies: | ||
"@babel/helper-annotate-as-pure" "^7.0.0-beta.37" | ||
babel-types "^6.26.0" | ||
stylis "^3.0.0" | ||
|
||
babel-plugin-syntax-async-functions@^6.8.0: | ||
version "6.13.0" | ||
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" | ||
|
@@ -8748,7 +8762,7 @@ stylis-rule-sheet@^0.0.10: | |
version "0.0.10" | ||
resolved "https://registry.yarnpkg.com/stylis-rule-sheet/-/stylis-rule-sheet-0.0.10.tgz#44e64a2b076643f4b52e5ff71efc04d8c3c4a430" | ||
|
||
stylis@^3.5.0: | ||
stylis@^3.0.0, stylis@^3.5.0: | ||
version "3.5.0" | ||
resolved "https://registry.yarnpkg.com/stylis/-/stylis-3.5.0.tgz#016fa239663d77f868fef5b67cf201c4b7c701e1" | ||
|
||
|