Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from tkh44/react-version
initial work for adding styled components type api
- Loading branch information
Showing
23 changed files
with
364 additions
and
641 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
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,34 @@ | ||
import fs from 'fs' | ||
import babel from 'rollup-plugin-babel' | ||
import resolve from 'rollup-plugin-node-resolve' | ||
import commonjs from 'rollup-plugin-commonjs' | ||
|
||
const pkg = JSON.parse(fs.readFileSync('./package.json')) | ||
|
||
export default { | ||
entry: 'src/react.js', | ||
external: ['react', 'prop-types', 'glam'], | ||
exports: 'named', | ||
globals: { react: 'React', 'prop-types': 'PropTypes', glam: 'glam' }, | ||
useStrict: false, | ||
sourceMap: true, | ||
plugins: [ | ||
babel({ | ||
exclude: 'node_modules/**' | ||
}), | ||
resolve({ | ||
jsnext: false, | ||
main: true, | ||
browser: true | ||
}), | ||
commonjs({ | ||
ignoreGlobal: true, | ||
include: 'node_modules/**' | ||
}) | ||
], | ||
targets: [ | ||
{dest: pkg.main, format: 'cjs'}, | ||
{dest: pkg.module, format: 'es'}, | ||
{dest: pkg['umd:main'], format: 'umd', moduleName: pkg.name} | ||
] | ||
} |
File renamed without changes.
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,60 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`emotion/glam babel css prop StringLiteral css prop value 1`] = `"<div className={css('css-jf1v9l')}></div>;"`; | ||
|
||
exports[`emotion/glam babel css prop basic 1`] = `"<div className={\\"a\\" + \\" \\" + css('css-jf1v9l')}></div>;"`; | ||
|
||
exports[`emotion/glam babel css prop className as expression 1`] = `"<div className={variable + \\" \\" + css('css-jf1v9l')}></div>;"`; | ||
|
||
exports[`emotion/glam babel css prop className as expression string 1`] = `"<div className={\`test__class\` + \\" \\" + css('css-jf1v9l')} this={\`hello\`}></div>;"`; | ||
exports[`emotion/glam babel css prop css empty 1`] = `"<div className={css('css-0')}></div>;"`; | ||
exports[`emotion/glam babel css prop emptyClassName 1`] = `"<div className={\\"\\" + \\" \\" + css('css-jf1v9l')}></div>;"`; | ||
exports[`emotion/glam babel css prop no css attr 1`] = `"<div></div>;"`; | ||
exports[`emotion/glam babel css prop noClassName 1`] = `"<div className={css('css-jf1v9l')}></div>;"`; | ||
exports[`emotion/glam real basic 1`] = ` | ||
<p | ||
className="css-jk0pkr" | ||
> | ||
hello world | ||
</p> | ||
`; | ||
exports[`emotion/glam real kitchen sink 1`] = ` | ||
<div | ||
className="css__legacy-stuff css-1170hdn vars-k1238z frag-15qcrjv frag-mdk64u" | ||
> | ||
<h1 | ||
className="css-wjhr0q vars-11t1jtz frag-1wh34bm vars-telb2o" | ||
> | ||
BOOM | ||
</h1> | ||
<p | ||
className="test_class1 css-14jcta0" | ||
> | ||
Hello | ||
</p> | ||
<p | ||
className="test_class1 test___class45 css-1gdxe9e" | ||
> | ||
World | ||
</p> | ||
<p | ||
className="css-1g8ltio vars-bs2yjn" | ||
> | ||
hello world | ||
</p> | ||
</div> | ||
`; | ||
exports[`emotion/glam real string expression 1`] = ` | ||
<p | ||
className="css-7sqgip" | ||
> | ||
hello world | ||
</p> | ||
`; |
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,38 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`glam react babel glam component basic 1`] = `"glam(\\"h1\\", ['css-8xpzga', [fontSize]]);"`; | ||
|
||
exports[`glam react babel glam component function call 1`] = `"glam(MyComponent, ['css-8xpzga', [fontSize]]);"`; | ||
|
||
exports[`glam react basic render 1`] = ` | ||
<h1 | ||
className=" css-13wdnau vars-nujrf4" | ||
> | ||
hello world | ||
</h1> | ||
`; | ||
|
||
exports[`glam react call expression 1`] = ` | ||
<h1 | ||
className="legacy__class css-13wdnau vars-nujrf4" | ||
> | ||
hello world | ||
</h1> | ||
`; | ||
|
||
exports[`glam react composition 1`] = ` | ||
<h1 | ||
className="legacy__class css-vxb7tq vars-3na0zv css-13wdnau vars-nujrf4" | ||
> | ||
hello world | ||
</h1> | ||
`; | ||
|
||
exports[`glam react function in expression 1`] = ` | ||
<h1 | ||
className="legacy__class css-vxb7tq vars-prycnx css-13wdnau vars-nujrf4" | ||
scale={2} | ||
> | ||
hello world | ||
</h1> | ||
`; |
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
File renamed without changes.
Oops, something went wrong.