Skip to content
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

feat: support react-native #382

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
43dee71
chore: new package
igorwessel Aug 20, 2022
571e9ad
package: @types/styled-components-react-native
igorwessel Aug 20, 2022
79c27d6
chore: copy create,theme fn from styled-components
igorwessel Aug 20, 2022
75fc8a5
feat: replace styled-components for native
igorwessel Aug 20, 2022
c28c5a7
feat: defaultTheme for react-native
igorwessel Aug 20, 2022
fae6893
chore: metro-react-native-preset in metro.config
igorwessel Aug 20, 2022
282118b
feat: use ReactNative to create elements
igorwessel Aug 21, 2022
2824026
chore(native): use ThemeProvider, x from index
igorwessel Aug 21, 2022
4993775
refactor: descriptive names for react native types
igorwessel Aug 21, 2022
ec1c050
chore: remove @types/styled-components-native root
igorwessel Aug 21, 2022
df9a778
tests(styled-components-native): fix settings
igorwessel Aug 21, 2022
960edf2
chore: remove package styled-components-native
igorwessel Aug 23, 2022
e52eed2
chore: update babel and jest for react-native
igorwessel Aug 23, 2022
00887c5
pkg: dev dependecies to styled-components/native
igorwessel Aug 23, 2022
b042a74
chore: add native package inside styled-components
igorwessel Aug 23, 2022
f9b882c
feat: separate define interface in functions
igorwessel Aug 23, 2022
4037a99
feat: move native to styled-components/native
igorwessel Aug 23, 2022
b33715a
feat: functions to define interface for native
igorwessel Aug 23, 2022
c4e2ced
refactor: better name for xstyled interface type
igorwessel Aug 24, 2022
bded83c
chore: remove .only in native/x.test
igorwessel Aug 24, 2022
993ea1c
fix: not can resolve peer-deps
igorwessel Sep 22, 2022
6106d90
feat(website): react-native docs
igorwessel Oct 6, 2022
cb0162f
chore: update @types/styled-components-react-native
igorwessel Nov 3, 2022
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
10 changes: 7 additions & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
module.exports = (api) => {
api.cache(true)

const config = {
return {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-react',
'@babel/preset-typescript',
],
overrides: [
{
test: /react-native/,
presets: ['module:metro-react-native-babel-preset'],
},
],
}

return config
}
41 changes: 30 additions & 11 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
module.exports = {
testEnvironment: 'jsdom',
transformIgnorePatterns: ['<rootDir>.*(node_modules)(?!.*@xstyled.*).*$'],
transform: {
'^.+\\.(j|t)sx?$': 'babel-jest',
},
testPathIgnorePatterns: ['/node_modules/', '/website/'],
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
moduleNameMapper: {
'styled-components':
'<rootDir>/node_modules/styled-components/dist/styled-components.browser.cjs.js',
},
projects: [
{
displayName: 'web',
testEnvironment: 'jsdom',
transformIgnorePatterns: ['<rootDir>.*(node_modules)(?!.*@xstyled.*).*$'],
transform: {
'^.+\\.(j|t)sx?$': 'babel-jest',
},
testPathIgnorePatterns: [
'/node_modules/',
'/website/',
'/packages/styled-components/src/native/',
],
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
moduleNameMapper: {
'styled-components':
'<rootDir>/node_modules/styled-components/dist/styled-components.browser.cjs.js',
},
},
{
displayName: 'native',
preset: 'react-native',
testPathIgnorePatterns: ['/node_modules/', '/website/'],
testMatch: [
'<rootDir>/packages/styled-components/src/native/__tests__/**/*.[jt]s?(x)',
'<rootDir>/packages/styled-components/src/native/**/?(*.)+(spec|test).[jt]s?(x)',
],
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
},
],
}
Loading