Skip to content

Commit

Permalink
Merge pull request #430 from jpudysz/fix/exports
Browse files Browse the repository at this point in the history
fix: components exports
  • Loading branch information
jpudysz authored Dec 13, 2024
2 parents 0c74711 + bae7a62 commit 2d5d0ae
Show file tree
Hide file tree
Showing 22 changed files with 140 additions and 77 deletions.
3 changes: 3 additions & 0 deletions components/native/ActivityIndicator/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "../../../lib/commonjs/components/native/ActivityIndicator.js"
}
3 changes: 3 additions & 0 deletions components/native/FlatList/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "../../../lib/commonjs/components/native/FlatList.js"
}
3 changes: 3 additions & 0 deletions components/native/Image/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "../../../lib/commonjs/components/native/Image.js"
}
3 changes: 3 additions & 0 deletions components/native/ImageBackground/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "../../../lib/commonjs/components/native/ImageBackground.js"
}
3 changes: 3 additions & 0 deletions components/native/KeyboardAvoidingView/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "../../../lib/commonjs/components/native/KeyboardAvoidingView.js"
}
3 changes: 3 additions & 0 deletions components/native/Pressable/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "../../../lib/commonjs/components/native/Pressable.js"
}
3 changes: 3 additions & 0 deletions components/native/RefreshControl/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "../../../lib/commonjs/components/native/RefreshControl.js"
}
3 changes: 3 additions & 0 deletions components/native/ScrollView/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "../../../lib/commonjs/components/native/ScrollView.js"
}
3 changes: 3 additions & 0 deletions components/native/SectionList/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "../../../lib/commonjs/components/native/SectionList.js"
}
3 changes: 3 additions & 0 deletions components/native/Switch/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "../../../lib/commonjs/components/native/Switch.js"
}
3 changes: 3 additions & 0 deletions components/native/Text/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "../../../lib/commonjs/components/native/Text.js"
}
3 changes: 3 additions & 0 deletions components/native/TextInput/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "../../../lib/commonjs/components/native/TextInput.js"
}
3 changes: 3 additions & 0 deletions components/native/TouchableHighlight/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "../../../lib/commonjs/components/native/TouchableHighlight.js"
}
3 changes: 3 additions & 0 deletions components/native/TouchableOpacity/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "../../../lib/commonjs/components/native/TouchableOpacity.js"
}
3 changes: 3 additions & 0 deletions components/native/View/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "../../../lib/commonjs/components/native/View.js"
}
3 changes: 3 additions & 0 deletions components/native/VirtualizedList/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "../../../lib/commonjs/components/native/VirtualizedList.js"
}
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@
"types": "lib/typescript/src/index.d.ts",
"react-native": "src/index",
"source": "src/index",
"exports": {
".": {
"types": "./lib/typescript/src/index.d.ts",
"module": "./lib/module/index",
"default": "./lib/commonjs/index"
},
"./components/native/*": {
"module": "./lib/module/components/native/*",
"default": "./lib/commonjs/components/native/*"
},
"./plugin": {
"module": "./plugin/index.js",
"default": "./plugin/index.js"
}
},
"files": [
"src",
"lib",
Expand Down
40 changes: 20 additions & 20 deletions plugin/__tests__/dependencies.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ pluginTester({
}))
`,
output: `
import { Text } from 'react-native-unistyles/src/components/native/Text'
import { View } from 'react-native-unistyles/src/components/native/View'
import { Text } from 'react-native-unistyles/components/native/Text'
import { View } from 'react-native-unistyles/components/native/View'
import { StyleSheet } from 'react-native-unistyles'
Expand Down Expand Up @@ -102,8 +102,8 @@ pluginTester({
}))
`,
output: `
import { Text } from 'react-native-unistyles/src/components/native/Text'
import { View } from 'react-native-unistyles/src/components/native/View'
import { Text } from 'react-native-unistyles/components/native/Text'
import { View } from 'react-native-unistyles/components/native/View'
import { StyleSheet } from 'react-native-unistyles'
Expand Down Expand Up @@ -154,8 +154,8 @@ pluginTester({
}))
`,
output: `
import { Text } from 'react-native-unistyles/src/components/native/Text'
import { View } from 'react-native-unistyles/src/components/native/View'
import { Text } from 'react-native-unistyles/components/native/Text'
import { View } from 'react-native-unistyles/components/native/View'
import { StyleSheet } from 'react-native-unistyles'
Expand Down Expand Up @@ -264,8 +264,8 @@ pluginTester({
}))
`,
output: `
import { Text } from 'react-native-unistyles/src/components/native/Text'
import { View } from 'react-native-unistyles/src/components/native/View'
import { Text } from 'react-native-unistyles/components/native/Text'
import { View } from 'react-native-unistyles/components/native/View'
import { StyleSheet } from 'react-native-unistyles'
Expand Down Expand Up @@ -386,8 +386,8 @@ pluginTester({
}))
`,
output: `
import { Text } from 'react-native-unistyles/src/components/native/Text'
import { View } from 'react-native-unistyles/src/components/native/View'
import { Text } from 'react-native-unistyles/components/native/Text'
import { View } from 'react-native-unistyles/components/native/View'
import { StyleSheet } from 'react-native-unistyles'
Expand Down Expand Up @@ -441,8 +441,8 @@ pluginTester({
}))
`,
output: `
import { Text } from 'react-native-unistyles/src/components/native/Text'
import { View } from 'react-native-unistyles/src/components/native/View'
import { Text } from 'react-native-unistyles/components/native/Text'
import { View } from 'react-native-unistyles/components/native/View'
import { StyleSheet } from 'react-native-unistyles'
Expand Down Expand Up @@ -488,8 +488,8 @@ pluginTester({
}))
`,
output: `
import { Text } from 'react-native-unistyles/src/components/native/Text'
import { View } from 'react-native-unistyles/src/components/native/View'
import { Text } from 'react-native-unistyles/components/native/Text'
import { View } from 'react-native-unistyles/components/native/View'
import { StyleSheet } from 'react-native-unistyles'
Expand Down Expand Up @@ -538,8 +538,8 @@ pluginTester({
}))
`,
output: `
import { Text } from 'react-native-unistyles/src/components/native/Text'
import { View } from 'react-native-unistyles/src/components/native/View'
import { Text } from 'react-native-unistyles/components/native/Text'
import { View } from 'react-native-unistyles/components/native/View'
import { StyleSheet } from 'react-native-unistyles'
Expand Down Expand Up @@ -608,8 +608,8 @@ pluginTester({
}))
`,
output: `
import { Text } from 'react-native-unistyles/src/components/native/Text'
import { View } from 'react-native-unistyles/src/components/native/View'
import { Text } from 'react-native-unistyles/components/native/Text'
import { View } from 'react-native-unistyles/components/native/View'
import { StyleSheet } from 'react-native-unistyles'
Expand Down Expand Up @@ -680,8 +680,8 @@ pluginTester({
}))
`,
output: `
import { Text } from 'react-native-unistyles/src/components/native/Text'
import { View } from 'react-native-unistyles/src/components/native/View'
import { Text } from 'react-native-unistyles/components/native/Text'
import { View } from 'react-native-unistyles/components/native/View'
import { StyleSheet } from 'react-native-unistyles'
Expand Down
32 changes: 16 additions & 16 deletions plugin/__tests__/ref.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ pluginTester({
})
`,
output: `
import { Text } from 'react-native-unistyles/src/components/native/Text'
import { View } from 'react-native-unistyles/src/components/native/View'
import { Text } from 'react-native-unistyles/components/native/Text'
import { View } from 'react-native-unistyles/components/native/View'
export const Example = () => {
return (
Expand Down Expand Up @@ -112,7 +112,7 @@ pluginTester({
})
`,
output: `
import { View } from 'react-native-unistyles/src/components/native/View'
import { View } from 'react-native-unistyles/components/native/View'
import { Text } from 'custom-lib'
Expand Down Expand Up @@ -161,8 +161,8 @@ pluginTester({
})
`,
output: `
import { Text } from 'react-native-unistyles/src/components/native/Text'
import { View } from 'react-native-unistyles/src/components/native/View'
import { Text } from 'react-native-unistyles/components/native/Text'
import { View } from 'react-native-unistyles/components/native/View'
import React from 'react'
import { StyleSheet } from 'react-native-unistyles'
Expand Down Expand Up @@ -217,8 +217,8 @@ pluginTester({
})
`,
output: `
import { Text } from 'react-native-unistyles/src/components/native/Text'
import { View } from 'react-native-unistyles/src/components/native/View'
import { Text } from 'react-native-unistyles/components/native/Text'
import { View } from 'react-native-unistyles/components/native/View'
import { useRef } from 'react'
import { StyleSheet } from 'react-native-unistyles'
Expand Down Expand Up @@ -283,8 +283,8 @@ pluginTester({
})
`,
output: `
import { Text } from 'react-native-unistyles/src/components/native/Text'
import { View } from 'react-native-unistyles/src/components/native/View'
import { Text } from 'react-native-unistyles/components/native/Text'
import { View } from 'react-native-unistyles/components/native/View'
import React from 'react'
import { StyleSheet } from 'react-native-unistyles'
Expand Down Expand Up @@ -354,8 +354,8 @@ pluginTester({
})
`,
output: `
import { Text } from 'react-native-unistyles/src/components/native/Text'
import { View } from 'react-native-unistyles/src/components/native/View'
import { Text } from 'react-native-unistyles/components/native/Text'
import { View } from 'react-native-unistyles/components/native/View'
import React from 'react'
import { StyleSheet } from 'react-native-unistyles'
Expand Down Expand Up @@ -423,8 +423,8 @@ pluginTester({
})
`,
output: `
import { Text } from 'react-native-unistyles/src/components/native/Text'
import { View } from 'react-native-unistyles/src/components/native/View'
import { Text } from 'react-native-unistyles/components/native/Text'
import { View } from 'react-native-unistyles/components/native/View'
import React from 'react'
import { StyleSheet } from 'react-native-unistyles'
Expand Down Expand Up @@ -486,7 +486,7 @@ pluginTester({
}))
`,
output: `
import { View } from 'react-native-unistyles/src/components/native/View'
import { View } from 'react-native-unistyles/components/native/View'
import { StyleSheet } from 'react-native-unistyles'
Expand Down Expand Up @@ -538,7 +538,7 @@ pluginTester({
}))
`,
output: `
import { View } from 'react-native-unistyles/src/components/native/View'
import { View } from 'react-native-unistyles/components/native/View'
import { StyleSheet } from 'react-native-unistyles'
Expand Down Expand Up @@ -582,7 +582,7 @@ pluginTester({
}))
`,
output: `
import { View } from 'react-native-unistyles/src/components/native/View'
import { View } from 'react-native-unistyles/components/native/View'
import { StyleSheet } from 'react-native-unistyles'
Expand Down
Loading

0 comments on commit 2d5d0ae

Please sign in to comment.