├── .gitignore ├── shared-code-with-uikit-bridge ├── .watchmanconfig ├── index.js ├── jest.setup.js ├── src │ ├── ui │ │ ├── components │ │ │ ├── Text │ │ │ │ ├── index.ts │ │ │ │ ├── Text.definition.ts │ │ │ │ ├── Text.tsx │ │ │ │ └── Text.native.tsx │ │ │ ├── View │ │ │ │ ├── index.ts │ │ │ │ ├── View.native.tsx │ │ │ │ ├── View.definition.ts │ │ │ │ └── View.tsx │ │ │ ├── Icon │ │ │ │ ├── index.ts │ │ │ │ ├── Icon.tsx │ │ │ │ ├── Icon.native.tsx │ │ │ │ └── Icon.definition.ts │ │ │ ├── Image │ │ │ │ ├── index.ts │ │ │ │ ├── Image.definition.ts │ │ │ │ ├── Image.native.tsx │ │ │ │ └── Image.tsx │ │ │ ├── Loading │ │ │ │ ├── index.ts │ │ │ │ ├── Loading.tsx │ │ │ │ └── Loading.native.tsx │ │ │ ├── Container │ │ │ │ ├── index.ts │ │ │ │ ├── Container.definition.ts │ │ │ │ ├── Container.native.tsx │ │ │ │ └── Container.tsx │ │ │ ├── Pressable │ │ │ │ ├── index.ts │ │ │ │ ├── Pressable.definition.ts │ │ │ │ ├── Pressable.tsx │ │ │ │ └── Pressable.native.tsx │ │ │ ├── ScrollView │ │ │ │ ├── index.ts │ │ │ │ ├── ScrollView.definition.tsx │ │ │ │ ├── ScrollView.native.tsx │ │ │ │ └── ScrollView.tsx │ │ │ └── index.ts │ │ ├── screens │ │ │ ├── PokemonList │ │ │ │ ├── index.ts │ │ │ │ ├── PokemonCard.tsx │ │ │ │ └── PokemonList.tsx │ │ │ ├── PokemonDetail │ │ │ │ ├── index.ts │ │ │ │ ├── _components │ │ │ │ │ ├── PokemonInfo.tsx │ │ │ │ │ └── PokemonSummary.tsx │ │ │ │ └── PokemonDetail.tsx │ │ │ ├── index.ts │ │ │ └── __test__ │ │ │ │ └── PokemonList.test.tsx │ │ └── router │ │ │ ├── index.ts │ │ │ ├── __mocks__ │ │ │ └── index.ts │ │ │ ├── useParams.ts │ │ │ ├── useNavigator.ts │ │ │ ├── useNavigator.native.ts │ │ │ ├── useParams.native.ts │ │ │ ├── Router.tsx │ │ │ ├── Router.definition.ts │ │ │ └── Router.native.tsx │ ├── react-app-env.d.ts │ ├── __test__ │ │ └── testing │ │ │ ├── index.ts │ │ │ └── index.native.ts │ ├── index.native.tsx │ ├── assets │ │ └── fonts │ │ │ └── FontAwesome.ttf │ ├── index.tsx │ ├── App.tsx │ ├── core │ │ ├── services │ │ │ └── PokemonService.ts │ │ ├── domain │ │ │ └── model │ │ │ │ └── Pokemon.ts │ │ └── infraestructure │ │ │ └── PokemonRepository.ts │ └── index.css ├── .editorconfig ├── app.json ├── react-native.config.js ├── public │ ├── robots.txt │ ├── favicon.ico │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── index.html ├── android │ ├── app │ │ ├── src │ │ │ ├── main │ │ │ │ ├── res │ │ │ │ │ ├── values │ │ │ │ │ │ ├── strings.xml │ │ │ │ │ │ └── styles.xml │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ └── mipmap-xxxhdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── assets │ │ │ │ │ └── fonts │ │ │ │ │ │ └── FontAwesome.ttf │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── pokedex │ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ │ └── MainApplication.java │ │ │ │ └── AndroidManifest.xml │ │ │ └── debug │ │ │ │ └── AndroidManifest.xml │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ ├── build_defs.bzl │ │ └── _BUCK │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── settings.gradle │ ├── build.gradle │ ├── gradle.properties │ └── gradlew.bat ├── ios │ ├── UIKit │ │ ├── Images.xcassets │ │ │ ├── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ ├── blue_pokeball.png │ │ │ │ └── Contents.json │ │ ├── AppDelegate.h │ │ ├── main.m │ │ ├── Info.plist │ │ └── AppDelegate.m │ ├── UIKit.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── Podfile │ └── UIKitTests │ │ ├── Info.plist │ │ └── UIKitTests.m ├── .buckconfig ├── .gitattributes ├── .prettierrc.js ├── metro.config.js ├── babel.config.js ├── jest.config.web.js ├── .eslintrc.js ├── tsconfig.json ├── .gitignore ├── jest.config.native.js ├── patches │ └── react-scripts+4.0.3.patch └── package.json ├── isolated-fronts-shared-core ├── .gitignore ├── packages │ ├── mobile │ │ ├── .watchmanconfig │ │ ├── .editorconfig │ │ ├── src │ │ │ ├── ui │ │ │ │ ├── components │ │ │ │ │ ├── Icon │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── Icon.tsx │ │ │ │ │ │ └── Icon.definition.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── Container.tsx │ │ │ │ │ └── Text.tsx │ │ │ │ └── screens │ │ │ │ │ ├── PokemonList │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── PokemonCard.tsx │ │ │ │ │ └── PokemonList.tsx │ │ │ │ │ ├── PokemonDetail │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── _components │ │ │ │ │ │ ├── PokemonInfo.tsx │ │ │ │ │ │ └── PokemonSummary.tsx │ │ │ │ │ └── PokemonDetail.tsx │ │ │ │ │ ├── index.ts │ │ │ │ │ └── __test__ │ │ │ │ │ └── PokemonList.test.tsx │ │ │ ├── assets │ │ │ │ └── fonts │ │ │ │ │ └── FontAwesome.ttf │ │ │ └── App.tsx │ │ ├── app.json │ │ ├── react-native.config.js │ │ ├── .eslintrc.js │ │ ├── android │ │ │ ├── app │ │ │ │ ├── src │ │ │ │ │ ├── main │ │ │ │ │ │ ├── res │ │ │ │ │ │ │ ├── values │ │ │ │ │ │ │ │ ├── strings.xml │ │ │ │ │ │ │ │ └── styles.xml │ │ │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ │ │ └── mipmap-xxxhdpi │ │ │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ │ ├── assets │ │ │ │ │ │ │ └── fonts │ │ │ │ │ │ │ │ └── FontAwesome.ttf │ │ │ │ │ │ ├── java │ │ │ │ │ │ │ └── com │ │ │ │ │ │ │ │ └── pokedex │ │ │ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ │ │ │ └── MainApplication.java │ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ │ └── debug │ │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ ├── debug.keystore │ │ │ │ ├── proguard-rules.pro │ │ │ │ ├── build_defs.bzl │ │ │ │ └── _BUCK │ │ │ ├── gradle │ │ │ │ └── wrapper │ │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── settings.gradle │ │ │ ├── build.gradle │ │ │ ├── gradle.properties │ │ │ └── gradlew.bat │ │ ├── ios │ │ │ ├── SharedCore │ │ │ │ ├── Images.xcassets │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ │ ├── yellow_pokeball.png │ │ │ │ │ │ └── Contents.json │ │ │ │ ├── AppDelegate.h │ │ │ │ ├── main.m │ │ │ │ ├── Info.plist │ │ │ │ └── AppDelegate.m │ │ │ ├── SharedCore.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ ├── SharedCoreTests │ │ │ │ ├── Info.plist │ │ │ │ └── SharedCoreTests.m │ │ │ └── Podfile │ │ ├── .buckconfig │ │ ├── .gitattributes │ │ ├── .prettierrc.js │ │ ├── index.js │ │ ├── babel.config.js │ │ ├── __tests__ │ │ │ └── App-test.tsx │ │ ├── metro.config.js │ │ ├── tsconfig.json │ │ ├── .gitignore │ │ └── package.json │ ├── web │ │ ├── src │ │ │ ├── react-app-env.d.ts │ │ │ ├── ui │ │ │ │ └── screens │ │ │ │ │ └── Pokedex │ │ │ │ │ ├── index.tsx │ │ │ │ │ ├── components │ │ │ │ │ └── Sidebar.tsx │ │ │ │ │ └── Pokedex.tsx │ │ │ ├── setupTests.js │ │ │ ├── index.tsx │ │ │ └── index.css │ │ ├── public │ │ │ ├── robots.txt │ │ │ ├── favicon.ico │ │ │ ├── manifest.json │ │ │ └── index.html │ │ ├── .gitignore │ │ ├── tsconfig.json │ │ ├── craco.config.js │ │ └── package.json │ └── core │ │ ├── package.json │ │ ├── index.ts │ │ ├── services │ │ └── PokemonService.ts │ │ ├── domain │ │ └── model │ │ │ └── Pokemon.ts │ │ └── infraestructure │ │ └── PokemonRepository.ts ├── yarn.lock └── package.json ├── shared-code-with-RNWeb ├── .gitattributes ├── src │ ├── ui │ │ ├── components │ │ │ ├── Icon │ │ │ │ ├── index.ts │ │ │ │ ├── Icon.tsx │ │ │ │ └── Icon.definition.ts │ │ │ ├── index.ts │ │ │ ├── Container.tsx │ │ │ └── Text.tsx │ │ └── screens │ │ │ ├── PokemonList │ │ │ ├── index.ts │ │ │ ├── PokemonCard.tsx │ │ │ └── PokemonList.tsx │ │ │ ├── PokemonDetail │ │ │ ├── index.ts │ │ │ ├── _components │ │ │ │ ├── DetailDisplay.ts │ │ │ │ ├── DetailDisplay.web.ts │ │ │ │ ├── PokemonInfo.tsx │ │ │ │ └── PokemonSummary.tsx │ │ │ └── PokemonDetail.tsx │ │ │ ├── index.ts │ │ │ └── __test__ │ │ │ └── PokemonList.test.tsx │ ├── react-app-env.d.ts │ ├── assets │ │ └── fonts │ │ │ └── FontAwesome.ttf │ ├── core │ │ ├── services │ │ │ └── PokemonService.ts │ │ ├── domain │ │ │ └── model │ │ │ │ └── Pokemon.ts │ │ └── infraestructure │ │ │ └── PokemonRepository.ts │ ├── index.ts │ └── App.tsx ├── app.json ├── react-native.config.js ├── public │ ├── robots.txt │ ├── favicon.ico │ ├── manifest.json │ └── index.html ├── index.js ├── android │ ├── app │ │ ├── src │ │ │ ├── main │ │ │ │ ├── res │ │ │ │ │ ├── values │ │ │ │ │ │ ├── strings.xml │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── mipmap-xhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── assets │ │ │ │ │ └── fonts │ │ │ │ │ │ └── FontAwesome.ttf │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── example │ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ │ └── MainApplication.java │ │ │ │ └── AndroidManifest.xml │ │ │ └── debug │ │ │ │ └── AndroidManifest.xml │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ ├── build_defs.bzl │ │ └── BUCK │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── settings.gradle │ ├── build.gradle │ └── gradle.properties ├── ios │ ├── RNWeb │ │ ├── Images.xcassets │ │ │ ├── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ ├── pokeball copy.png │ │ │ │ └── Contents.json │ │ ├── AppDelegate.h │ │ ├── main.m │ │ ├── Info.plist │ │ └── AppDelegate.m │ ├── RNWeb.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── RNWebTests │ │ ├── Info.plist │ │ └── RNWebTests.m │ ├── RNWeb-tvOSTests │ │ └── Info.plist │ ├── Podfile │ └── RNWeb-tvOS │ │ └── Info.plist ├── metro.config.js ├── .prettierrc.js ├── babel.config.js ├── jest.setup.js ├── .eslintrc.js ├── tsconfig.json ├── jest.config.js ├── .gitignore ├── patches │ ├── react-native-web-hover+0.2.9.patch │ └── react-scripts+4.0.3.patch └── package.json └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_Store 3 | .vs 4 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /isolated-fronts-shared-core/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/index.js: -------------------------------------------------------------------------------- 1 | import './src/index' 2 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/jest.setup.js: -------------------------------------------------------------------------------- 1 | jest.mock('./src/ui/router') 2 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/ui/components/Icon/index.ts: -------------------------------------------------------------------------------- 1 | export { Icon } from './Icon' 2 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/ui/components/index.ts: -------------------------------------------------------------------------------- 1 | export { Container } from './Container' 2 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Text/index.ts: -------------------------------------------------------------------------------- 1 | export {Text} from './Text' 2 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/View/index.ts: -------------------------------------------------------------------------------- 1 | export {View} from './View' 2 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RNWeb", 3 | "displayName": "RNWeb" 4 | } 5 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/.editorconfig: -------------------------------------------------------------------------------- 1 | # Windows files 2 | [*.bat] 3 | end_of_line = crlf 4 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "UIKit", 3 | "displayName": "UIKit" 4 | } -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Icon/index.ts: -------------------------------------------------------------------------------- 1 | export { Icon } from './Icon' 2 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Image/index.ts: -------------------------------------------------------------------------------- 1 | export {Image} from './Image' 2 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/__test__/testing/index.ts: -------------------------------------------------------------------------------- 1 | export * from '@testing-library/react'; 2 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Loading/index.ts: -------------------------------------------------------------------------------- 1 | export {Loading} from './Loading' 2 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/web/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/ui/screens/PokemonList/index.ts: -------------------------------------------------------------------------------- 1 | export { PokemonList } from './PokemonList' 2 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Container/index.ts: -------------------------------------------------------------------------------- 1 | export {Container} from './Container' 2 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Pressable/index.ts: -------------------------------------------------------------------------------- 1 | export {Pressable} from './Pressable' 2 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/.editorconfig: -------------------------------------------------------------------------------- 1 | # Windows files 2 | [*.bat] 3 | end_of_line = crlf 4 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/src/ui/components/Icon/index.ts: -------------------------------------------------------------------------------- 1 | export { Icon } from './Icon' 2 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/react-native.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | assets: ['./src/assets/fonts'] 3 | } 4 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/ui/screens/PokemonDetail/index.ts: -------------------------------------------------------------------------------- 1 | export { PokemonDetail } from './PokemonDetail' 2 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/ScrollView/index.ts: -------------------------------------------------------------------------------- 1 | export {ScrollView} from './ScrollView' 2 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/screens/PokemonList/index.ts: -------------------------------------------------------------------------------- 1 | export { PokemonList } from './PokemonList' 2 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/src/ui/components/index.ts: -------------------------------------------------------------------------------- 1 | export { Container } from './Container' 2 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/web/src/ui/screens/Pokedex/index.tsx: -------------------------------------------------------------------------------- 1 | export { Pokedex } from './Pokedex'; 2 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/react-native.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | assets: ['./src/assets/fonts'] 3 | } 4 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/__test__/testing/index.native.ts: -------------------------------------------------------------------------------- 1 | export * from '@testing-library/react-native' 2 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SharedCore", 3 | "displayName": "SharedCore" 4 | } -------------------------------------------------------------------------------- /shared-code-with-RNWeb/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/screens/PokemonDetail/index.ts: -------------------------------------------------------------------------------- 1 | export { PokemonDetail } from './PokemonDetail' 2 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/src/ui/screens/PokemonList/index.ts: -------------------------------------------------------------------------------- 1 | export { PokemonList } from './PokemonList' 2 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/react-native.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | assets: ['./src/assets/fonts'] 3 | } 4 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/src/ui/screens/PokemonDetail/index.ts: -------------------------------------------------------------------------------- 1 | export { PokemonDetail } from './PokemonDetail' 2 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/index.js: -------------------------------------------------------------------------------- 1 | import 'react-native-gesture-handler' 2 | import { App } from './src' 3 | 4 | export default App 5 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/web/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native-community', 4 | }; 5 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | RNWeb 3 | 4 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/ui/screens/index.ts: -------------------------------------------------------------------------------- 1 | export { PokemonList } from './PokemonList' 2 | export { PokemonDetail } from './PokemonDetail' 3 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/ios/RNWeb/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | UIKit 3 | 4 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/screens/index.ts: -------------------------------------------------------------------------------- 1 | export { PokemonList } from './PokemonList' 2 | export { PokemonDetail } from './PokemonDetail' 3 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/ios/UIKit/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-RNWeb/public/favicon.ico -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@540/core", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "index.ts" 6 | } 7 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/src/ui/screens/index.ts: -------------------------------------------------------------------------------- 1 | export { PokemonList } from './PokemonList' 2 | export { PokemonDetail } from './PokemonDetail' 3 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | SharedCore 3 | 4 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Loading/Loading.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | //to do 4 | export const Loading = () => Loading... 5 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/ios/SharedCore/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-RNWeb/android/app/debug.keystore -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-uikit-bridge/public/favicon.ico -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-uikit-bridge/public/logo192.png -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-uikit-bridge/public/logo512.png -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/router/index.ts: -------------------------------------------------------------------------------- 1 | export {useParams} from './useParams' 2 | export {useNavigator} from './useNavigator' 3 | export {Router} from './Router' 4 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/.gitattributes: -------------------------------------------------------------------------------- 1 | # Windows files should use crlf line endings 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | *.bat text eol=crlf 4 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/router/__mocks__/index.ts: -------------------------------------------------------------------------------- 1 | export const Router = () => null 2 | export const useParams = jest.fn() 3 | export const useNavigator = jest.fn() 4 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/core/index.ts: -------------------------------------------------------------------------------- 1 | export type { Pokemon, FullPokemon } from './domain/model/Pokemon' 2 | export { PokemonService } from './services/PokemonService' 3 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/index.native.tsx: -------------------------------------------------------------------------------- 1 | import {AppRegistry} from 'react-native'; 2 | import {App} from './App'; 3 | 4 | AppRegistry.registerComponent('UIKit', () => App); 5 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-RNWeb/src/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-uikit-bridge/android/app/debug.keystore -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/.gitattributes: -------------------------------------------------------------------------------- 1 | # Windows files should use crlf line endings 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | *.bat text eol=crlf 4 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/web/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/isolated-fronts-shared-core/packages/web/public/favicon.ico -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Container/Container.definition.ts: -------------------------------------------------------------------------------- 1 | import {ReactNode} from 'react'; 2 | 3 | export interface ContainerProps { 4 | children: ReactNode 5 | } 6 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/ScrollView/ScrollView.definition.tsx: -------------------------------------------------------------------------------- 1 | import {ReactNode} from 'react'; 2 | 3 | export interface ScrollViewProps { 4 | children: ReactNode 5 | } 6 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-RNWeb/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-uikit-bridge/src/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: false, 3 | jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'all', 6 | arrowParens: 'avoid', 7 | }; 8 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/isolated-fronts-shared-core/packages/mobile/android/app/debug.keystore -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-uikit-bridge/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Pressable/Pressable.definition.ts: -------------------------------------------------------------------------------- 1 | import {ReactNode} from 'react'; 2 | 3 | export interface PressableProps { 4 | children: ReactNode 5 | onPress: () => void 6 | } 7 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/android/app/src/main/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-RNWeb/android/app/src/main/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {render} from 'react-dom'; 3 | import './index.css' 4 | import {App} from './App'; 5 | 6 | render(, document.getElementById('root')); 7 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: false, 3 | jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'all', 6 | arrowParens: 'avoid', 7 | }; 8 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/src/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/isolated-fronts-shared-core/packages/mobile/src/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /shared-code-with-RNWeb/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-RNWeb/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Image/Image.definition.ts: -------------------------------------------------------------------------------- 1 | export interface ImageProps { 2 | height?: number | string 3 | width?: number | string 4 | aspectRatio?: number 5 | sourceUri: string 6 | } 7 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/src/main/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-uikit-bridge/android/app/src/main/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/index.js: -------------------------------------------------------------------------------- 1 | import {AppRegistry} from 'react-native'; 2 | import {App} from './src/App'; 3 | import {name as appName} from './app.json'; 4 | 5 | AppRegistry.registerComponent(appName, () => App); 6 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/ui/screens/PokemonDetail/_components/DetailDisplay.ts: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components/native' 2 | 3 | export const DetailDisplay = styled.View` 4 | backgroundColor: white; 5 | height: 100%; 6 | ` 7 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'RNWeb' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/isolated-fronts-shared-core/packages/mobile/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /shared-code-with-RNWeb/ios/RNWeb/Images.xcassets/AppIcon.appiconset/pokeball copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-RNWeb/ios/RNWeb/Images.xcassets/AppIcon.appiconset/pokeball copy.png -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'UIKit' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-uikit-bridge/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/src/main/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/isolated-fronts-shared-core/packages/mobile/android/app/src/main/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/core/services/PokemonService.ts: -------------------------------------------------------------------------------- 1 | import { PokemonRepository } from 'core/infraestructure/PokemonRepository' 2 | 3 | export const PokemonService = { 4 | getList: PokemonRepository.getList, 5 | getById: PokemonRepository.getById 6 | } 7 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/ios/UIKit/Images.xcassets/AppIcon.appiconset/blue_pokeball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/shared-code-with-uikit-bridge/ios/UIKit/Images.xcassets/AppIcon.appiconset/blue_pokeball.png -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'SharedCore' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/core/services/PokemonService.ts: -------------------------------------------------------------------------------- 1 | import { PokemonRepository } from '../infraestructure/PokemonRepository' 2 | 3 | export const PokemonService = { 4 | getList: PokemonRepository.getList, 5 | getById: PokemonRepository.getById 6 | } 7 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /shared-code-with-RNWeb/ios/RNWeb/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/metro.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | transformer: { 3 | getTransformOptions: async () => ({ 4 | transform: { 5 | experimentalImportSupport: false, 6 | inlineRequires: false 7 | } 8 | }) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/App.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {Container} from './ui/components'; 3 | import {Router} from './ui/router'; 4 | 5 | export const App = () => ( 6 | 7 | 8 | 9 | ) 10 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/core/services/PokemonService.ts: -------------------------------------------------------------------------------- 1 | import { PokemonRepository } from 'core/infraestructure/PokemonRepository' 2 | 3 | export const PokemonService = { 4 | getList: PokemonRepository.getList, 5 | getById: PokemonRepository.getById 6 | } 7 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/ios/UIKit/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /shared-code-with-RNWeb/ios/RNWeb/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/metro.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | transformer: { 3 | getTransformOptions: async () => ({ 4 | transform: { 5 | experimentalImportSupport: false, 6 | inlineRequires: true, 7 | }, 8 | }), 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /shared-code-with-RNWeb/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/ios/UIKit/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Text/Text.definition.ts: -------------------------------------------------------------------------------- 1 | import {ReactNode} from 'react'; 2 | 3 | export interface TextProps { 4 | children: ReactNode 5 | fontSize?: number 6 | color?: string 7 | bold?: boolean 8 | capitalize?: boolean 9 | } 10 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/ios/SharedCore/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Loading/Loading.native.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {ActivityIndicator, SafeAreaView} from 'react-native' 3 | 4 | export const Loading = () => ( 5 | 6 | ) 7 | 8 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/ios/SharedCore/Images.xcassets/AppIcon.appiconset/yellow_pokeball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/540/cross-platform-code-sharing-strategies/master/isolated-fronts-shared-core/packages/mobile/ios/SharedCore/Images.xcassets/AppIcon.appiconset/yellow_pokeball.png -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/ios/SharedCore/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/web/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "semi": false, 3 | "useTabs": false, 4 | "tabWidth": 2, 5 | "singleQuote": true, 6 | "trailingComma": "none", 7 | "jsxBracketSameLine": true, 8 | "bracketSpacing": true, 9 | "arrowParens": "avoid", 10 | "printWidth": 120 11 | } 12 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/core/domain/model/Pokemon.ts: -------------------------------------------------------------------------------- 1 | export interface Pokemon { 2 | id: number 3 | name: string 4 | picture: string 5 | } 6 | 7 | export interface FullPokemon { 8 | id: number 9 | name: string 10 | picture: string 11 | height: number 12 | weight: number 13 | types: string[] 14 | } 15 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/index.ts: -------------------------------------------------------------------------------- 1 | import { AppRegistry, Platform } from 'react-native' 2 | import { App } from './App' 3 | 4 | AppRegistry.registerComponent('RNWeb', () => App) 5 | if (Platform.OS === 'web') { 6 | AppRegistry.runApplication('RNWeb', { 7 | rootTag: document.getElementById('root') 8 | }) 9 | } 10 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/ui/screens/PokemonDetail/_components/DetailDisplay.web.ts: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components' 2 | 3 | export const DetailDisplay = styled.div` 4 | display: flex; 5 | flex-direction: column; 6 | @media (min-width: 768px) { 7 | flex-direction: row; 8 | } 9 | height: 100vh; 10 | ` 11 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/core/domain/model/Pokemon.ts: -------------------------------------------------------------------------------- 1 | export interface Pokemon { 2 | id: number 3 | name: string 4 | picture: string 5 | } 6 | 7 | export interface FullPokemon { 8 | id: number 9 | name: string 10 | picture: string 11 | height: number 12 | weight: number 13 | types: string[] 14 | } 15 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/ios/RNWeb.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/core/domain/model/Pokemon.ts: -------------------------------------------------------------------------------- 1 | export interface Pokemon { 2 | id: number 3 | name: string 4 | picture: string 5 | } 6 | 7 | export interface FullPokemon { 8 | id: number 9 | name: string 10 | picture: string 11 | height: number 12 | weight: number 13 | types: string[] 14 | } 15 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/ios/RNWeb.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/ios/UIKit.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/index.ts: -------------------------------------------------------------------------------- 1 | export {Text} from './Text' 2 | export {Container} from './Container' 3 | export {ScrollView} from './ScrollView' 4 | export {Icon} from './Icon' 5 | export {Image} from './Image' 6 | export {Pressable} from './Pressable' 7 | export {Loading} from './Loading' 8 | export {View} from './View' 9 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/router/useParams.ts: -------------------------------------------------------------------------------- 1 | import { useLocation} from "react-router-dom"; 2 | import {RouterParams} from './Router.definition'; 3 | 4 | export const useParams = () => { 5 | const {state: params} : {state: RouterParams[Screen]} = useLocation(); 6 | 7 | return params 8 | } 9 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/web/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import { Pokedex } from './ui/screens/Pokedex'; 5 | 6 | ReactDOM.render( 7 | 8 | 9 | , 10 | document.getElementById('root') 11 | ); 12 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/ios/UIKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/router/useNavigator.ts: -------------------------------------------------------------------------------- 1 | import {useHistory} from "react-router-dom"; 2 | 3 | export const useNavigator = () => { 4 | const history = useHistory(); 5 | 6 | return { 7 | goToPokemonDetail: (pokemonId: number) => history.push('/detail', {pokemonId}), 8 | goBack: history.goBack 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/ios/SharedCore.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/ios/SharedCore.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | plugins: [ 4 | [ 5 | require.resolve('babel-plugin-module-resolver'), 6 | { 7 | root: ['.'], 8 | alias: { 9 | ui: './src/ui', 10 | } 11 | } 12 | ] 13 | ] 14 | }; 15 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Pressable/Pressable.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {PressableProps} from './Pressable.definition'; 3 | 4 | export const Pressable = ({children, onPress}: PressableProps & { className?: string }) => ( 5 | < button onClick={onPress}> 6 | {children} 7 | 8 | ) 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Container/Container.native.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {SafeAreaView} from 'react-native' 3 | import {ContainerProps} from './Container.definition'; 4 | 5 | export const Container = ({children}: ContainerProps) => ( 6 | 7 | {children} 8 | 9 | ) 10 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Image/Image.native.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {Image as BaseImage} from 'react-native' 3 | import {ImageProps} from './Image.definition'; 4 | 5 | export const Image = ({width, height, aspectRatio, sourceUri}: ImageProps) => ( 6 | 7 | ) 8 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | plugins: [ 4 | [ 5 | require.resolve('babel-plugin-module-resolver'), 6 | { 7 | root: ['.'], 8 | alias: { 9 | ui: './src/ui', 10 | core: './src/core' 11 | } 12 | } 13 | ] 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/router/useNavigator.native.ts: -------------------------------------------------------------------------------- 1 | import {useNavigation} from '@react-navigation/native'; 2 | 3 | export const useNavigator = () => { 4 | const {navigate, goBack} = useNavigation(); 5 | 6 | return { 7 | goToPokemonDetail: (pokemonId: number) => navigate('PokemonDetail', {pokemonId}), 8 | goBack: goBack 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/router/useParams.native.ts: -------------------------------------------------------------------------------- 1 | import {RouteProp, useRoute} from '@react-navigation/native'; 2 | import {RouterParams} from './Router.definition'; 3 | 4 | export const useParams = () => { 5 | const {params}: RouteProp = useRoute>(); 6 | 7 | return params 8 | } 9 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/__tests__/App-test.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import 'react-native'; 6 | import React from 'react'; 7 | import App from '../App'; 8 | 9 | // Note: test renderer must be required after react-native. 10 | import renderer from 'react-test-renderer'; 11 | 12 | it('renders correctly', () => { 13 | renderer.create(); 14 | }); 15 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Pokedex", 3 | "name": "Pokedex", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Pressable/Pressable.native.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {Pressable as BasePressable} from 'react-native' 3 | import {PressableProps} from './Pressable.definition'; 4 | 5 | export const Pressable = ({children, onPress}: PressableProps) => ( 6 | 7 | {children} 8 | 9 | ) 10 | 11 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | 8 | module.exports = { 9 | transformer: { 10 | getTransformOptions: async () => ({ 11 | transform: { 12 | experimentalImportSupport: false, 13 | inlineRequires: true, 14 | }, 15 | }), 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | plugins: [ 4 | [ 5 | require.resolve('babel-plugin-module-resolver'), 6 | { 7 | root: ['.'], 8 | alias: { 9 | ui: './src/ui', 10 | core: './src/core', 11 | __test__: './src/__test__' 12 | } 13 | } 14 | ] 15 | ] 16 | }; 17 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/router/Router.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {BrowserRouter as Navigator, Route as Screen} from 'react-router-dom'; 3 | import {routes} from './Router.definition'; 4 | 5 | export const Router = () => ( 6 | 7 | {routes.map(route => 8 | 9 | )} 10 | 11 | ); 12 | 13 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/ScrollView/ScrollView.native.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {ScrollView as BaseScrollView} from 'react-native' 3 | import {ScrollViewProps} from './ScrollView.definition'; 4 | 5 | export const ScrollView = ({children}: ScrollViewProps) => ( 6 | 7 | {children} 8 | 9 | ) 10 | 11 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/web/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/web/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/android/app/src/main/java/com/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. This is used to schedule 9 | * rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "RNWeb"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/src/main/java/com/pokedex/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.pokedex; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. This is used to schedule 9 | * rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "UIKit"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/screens/PokemonDetail/_components/PokemonInfo.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {FullPokemon} from 'core/domain/model/Pokemon' 3 | import {Text, View} from 'ui/components' 4 | 5 | interface Props { 6 | pokemon: FullPokemon 7 | } 8 | 9 | export const PokemonInfo = ({pokemon}: Props) => ( 10 | 11 | Height: {pokemon.height} 12 | Weight: {pokemon.weight} 13 | 14 | ) 15 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/src/main/java/com/pokedex/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.pokedex; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. This is used to schedule 9 | * rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "SharedCore"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "isolated-fronts-shared-core", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "install": "yarn --cwd packages/web install && yarn --cwd packages/mobile install", 7 | "web": "yarn --cwd packages/web start", 8 | "mobile": "yarn --cwd packages/mobile start", 9 | "ios": "yarn --cwd packages/mobile ios", 10 | "android": "yarn --cwd packages/mobile android", 11 | "test": "echo TEST NOT CONFIGURED" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Image/Image.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import styled from 'styled-components' 3 | import {ImageProps} from './Image.definition'; 4 | 5 | const BaseImage = ({className, sourceUri}: ImageProps & { className?: string }) => ( 6 | 7 | ) 8 | 9 | 10 | export const Image = styled(BaseImage)`${props => ` 11 | width: ${props.width}px; 12 | height: ${props.height}px; 13 | aspect-ratio: ${props.aspectRatio}; 14 | `}` 15 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/jest.setup.js: -------------------------------------------------------------------------------- 1 | export const mockNavigation = { 2 | goBack: jest.fn(), 3 | navigate: jest.fn(), 4 | push: jest.fn(), 5 | popToTop: jest.fn() 6 | } 7 | jest.mock('@react-navigation/native', () => { 8 | return { 9 | useRoute: () => jest.fn(), 10 | useNavigation: () => ({ 11 | goBack: mockNavigation.goBack, 12 | navigate: mockNavigation.navigate, 13 | push: mockNavigation.push, 14 | popToTop: mockNavigation.popToTop 15 | }) 16 | } 17 | }) 18 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Container/Container.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import styled from 'styled-components' 3 | import {ContainerProps} from './Container.definition'; 4 | 5 | const BaseContainer = ({className, children}: ContainerProps & { className?: string }) => ( 6 |

7 | {children} 8 |

9 | ) 10 | 11 | export const Container = styled(BaseContainer)` 12 | display: flex; 13 | flex-direction: column; 14 | height: 100vh; 15 | width: 100vw; 16 | overflow: hidden; 17 | ` 18 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Icon/Icon.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import styled from 'styled-components' 3 | import {GlyphMap, IconProps} from './Icon.definition'; 4 | 5 | const BaseIcon = ({className, name, onPress }: IconProps & { className?: string }) => ( 6 | 7 | {String.fromCharCode(GlyphMap[name])} 8 | 9 | ) 10 | 11 | export const Icon = styled(BaseIcon)`${props => ` 12 | font-family: FontAwesome; 13 | font-size: 25px; 14 | color: ${props.color}; 15 | `}` 16 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/ui/screens/PokemonDetail/_components/PokemonInfo.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { StyleProp, View, ViewStyle } from 'react-native' 3 | import { FullPokemon } from 'core/domain/model/Pokemon' 4 | import { Text } from 'ui/components/Text' 5 | 6 | interface Props { 7 | pokemon: FullPokemon 8 | style: StyleProp 9 | } 10 | 11 | export const PokemonInfo = ({ pokemon, style }: Props) => ( 12 | 13 | Height: {pokemon.height} 14 | Weight: {pokemon.weight} 15 | 16 | ) 17 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/View/View.native.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {View as BaseView} from 'react-native' 3 | import {ViewProps} from './View.definition'; 4 | 5 | export const View = ({children, centerItems, center, direction,hideOverflow, ...props}: ViewProps) => ( 6 | 12 | {children} 13 | 14 | ) 15 | 16 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/ScrollView/ScrollView.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import styled from 'styled-components' 3 | import {ScrollViewProps} from './ScrollView.definition'; 4 | 5 | const BaseScrollView = ({className, children}: ScrollViewProps & { className?: string }) => ( 6 | 7 | {children} 8 | 9 | ) 10 | 11 | 12 | export const ScrollView = styled(BaseScrollView)` 13 | overflow: scroll; 14 | display: flex; 15 | flex:1; 16 | flex-wrap: wrap; 17 | justify-content: space-around; 18 | ` 19 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/src/ui/screens/PokemonDetail/_components/PokemonInfo.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { StyleProp, View, ViewStyle } from 'react-native' 3 | import { FullPokemon } from '@540/core/domain/model/Pokemon' 4 | import { Text } from 'ui/components/Text' 5 | 6 | interface Props { 7 | pokemon: FullPokemon 8 | style: StyleProp 9 | } 10 | 11 | export const PokemonInfo = ({ pokemon, style }: Props) => ( 12 | 13 | Height: {pokemon.height} 14 | Weight: {pokemon.weight} 15 | 16 | ) 17 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Text/Text.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import styled from 'styled-components' 3 | import {TextProps} from './Text.definition'; 4 | 5 | const BaseText = ({className, children}: TextProps & { className?: string }) => ( 6 |

7 | {children} 8 |

9 | ) 10 | 11 | 12 | export const Text = styled(BaseText)`${props => ` 13 | font-size: ${props.fontSize}px; 14 | color: ${props.color}; 15 | ${props.bold ? 'font-weight: bold;' : ''} 16 | ${props.capitalize ? 'text-transform: capitalize;' : ''} 17 | `}` 18 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/router/Router.definition.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {PokemonDetail, PokemonList} from 'ui/screens'; 3 | 4 | export type RouterParams = { 5 | PokemonList: undefined 6 | PokemonDetail: { pokemonId: number } 7 | } 8 | interface Route { 9 | name: keyof RouterParams, 10 | component: React.ComponentType; 11 | path: string 12 | } 13 | 14 | export const routes : Route[] = [ 15 | { name: 'PokemonList', component: PokemonList, path: '/'}, 16 | { name: 'PokemonDetail', component: PokemonDetail, path: '/detail/:pokemonId?'} 17 | ] 18 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/web/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Text/Text.native.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {StyleSheet, Text as BaseText} from 'react-native' 3 | import {TextProps} from './Text.definition'; 4 | 5 | export const Text = ({children, fontSize = 17, color = 'black', bold = false, capitalize = false}: TextProps) => ( 6 | 9 | {children} 10 | 11 | ) 12 | 13 | const styles = StyleSheet.create({ 14 | bold: {fontWeight: '600'}, 15 | capitalize: {textTransform: 'capitalize'} 16 | }) 17 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/screens/__test__/PokemonList.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { render } from '__test__/testing' 3 | 4 | import { PokemonList } from '../PokemonList' 5 | import {PokemonService} from 'core/services/PokemonService'; 6 | 7 | const aPokemon = {id: 1, name: 'pokemon name', picture: 'url'} 8 | 9 | it('should render correctly', async () => { 10 | jest.spyOn(PokemonService, 'getList').mockResolvedValue([aPokemon]) 11 | 12 | const {findByText } = render() 13 | 14 | expect(await findByText('Pokedex')).toBeDefined() 15 | expect(await findByText(`${aPokemon.id} - ${aPokemon.name}`)).toBeDefined() 16 | }) 17 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/ui/components/Container.tsx: -------------------------------------------------------------------------------- 1 | import React, { ReactElement } from 'react' 2 | import { Platform, StyleSheet, View } from 'react-native' 3 | 4 | type Props = { 5 | children: React.ReactElement | ReactElement[] 6 | testID?: string 7 | } 8 | 9 | export function Container({ children, testID }: Props): React.ReactElement { 10 | return ( 11 | 12 | {children} 13 | 14 | ) 15 | } 16 | 17 | export const styles = StyleSheet.create({ 18 | center: { 19 | alignItems: 'center', 20 | justifyContent: 'center', 21 | height: Platform.OS === 'web' ? '100vh' : '100%' 22 | } 23 | }) 24 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/web/src/ui/screens/Pokedex/components/Sidebar.tsx: -------------------------------------------------------------------------------- 1 | import { Pokemon } from '@540/core' 2 | 3 | interface Props { 4 | pokemons: Pokemon[] 5 | onSelectPokemon: (id: number) => void 6 | } 7 | 8 | export const Sidebar: React.VFC = ({ pokemons, onSelectPokemon }) => { 9 | return ( 10 | 19 | ) 20 | } 21 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/ui/screens/__test__/PokemonList.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { render } from '@testing-library/react-native' 3 | 4 | import { PokemonList } from '../PokemonList' 5 | import {PokemonService} from '../../../core/services/PokemonService'; 6 | 7 | const aPokemon = {id: 1, name: 'pokemon name', picture: 'url'} 8 | 9 | it('should render correctly', async () => { 10 | jest.spyOn(PokemonService, 'getList').mockResolvedValue([aPokemon]) 11 | 12 | const {findByText } = render() 13 | 14 | expect(await findByText('Pokedex')).toBeDefined() 15 | expect(await findByText(`${aPokemon.id} - ${aPokemon.name}`)).toBeDefined() 16 | }) 17 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/src/ui/components/Container.tsx: -------------------------------------------------------------------------------- 1 | import React, { ReactElement } from 'react' 2 | import { Platform, StyleSheet, View } from 'react-native' 3 | 4 | type Props = { 5 | children: React.ReactElement | ReactElement[] 6 | testID?: string 7 | } 8 | 9 | export function Container({ children, testID }: Props): React.ReactElement { 10 | return ( 11 | 12 | {children} 13 | 14 | ) 15 | } 16 | 17 | export const styles = StyleSheet.create({ 18 | center: { 19 | alignItems: 'center', 20 | justifyContent: 'center', 21 | height: Platform.OS === 'web' ? '100vh' : '100%' 22 | } 23 | }) 24 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/src/ui/screens/__test__/PokemonList.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { render } from '@testing-library/react-native' 3 | 4 | import { PokemonList } from '../PokemonList' 5 | import {PokemonService} from '@540/core/services/PokemonService'; 6 | 7 | const aPokemon = {id: 1, name: 'pokemon name', picture: 'url'} 8 | 9 | it('should render correctly', async () => { 10 | jest.spyOn(PokemonService, 'getList').mockResolvedValue([aPokemon]) 11 | 12 | const {findByText } = render() 13 | 14 | expect(await findByText('Pokedex')).toBeDefined() 15 | expect(await findByText(`${aPokemon.id} - ${aPokemon.name}`)).toBeDefined() 16 | }) 17 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/web/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "target": "es5", 5 | "lib": [ 6 | "dom", 7 | "dom.iterable", 8 | "esnext" 9 | ], 10 | "allowJs": true, 11 | "skipLibCheck": true, 12 | "esModuleInterop": true, 13 | "allowSyntheticDefaultImports": true, 14 | "strict": true, 15 | "forceConsistentCasingInFileNames": true, 16 | "noFallthroughCasesInSwitch": true, 17 | "module": "esnext", 18 | "moduleResolution": "node", 19 | "resolveJsonModule": true, 20 | "isolatedModules": true, 21 | "noEmit": true, 22 | "jsx": "react-jsx" 23 | }, 24 | "include": [ 25 | "src" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/core/infraestructure/PokemonRepository.ts: -------------------------------------------------------------------------------- 1 | import { Pokemon, FullPokemon } from 'core/domain/model/Pokemon' 2 | import { PokemonSerializer } from './PokemonSerializer' 3 | 4 | export const PokemonRepository = { 5 | getList: async (): Promise => { 6 | let response = await fetch('https://pokeapi.co/api/v2/pokemon?limit=200') 7 | let json = await response.json() 8 | return PokemonSerializer.parsePokemonList(json.results) 9 | }, 10 | getById: async (id: number): Promise => { 11 | let response = await fetch(`https://pokeapi.co/api/v2/pokemon/${id}`) 12 | let json = await response.json() 13 | return PokemonSerializer.parseFullPokemon(json) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/core/infraestructure/PokemonRepository.ts: -------------------------------------------------------------------------------- 1 | import { Pokemon, FullPokemon } from '../domain/model/Pokemon' 2 | import { PokemonSerializer } from './PokemonSerializer' 3 | 4 | export const PokemonRepository = { 5 | getList: async (): Promise => { 6 | let response = await fetch('https://pokeapi.co/api/v2/pokemon?limit=200') 7 | let json = await response.json() 8 | return PokemonSerializer.parsePokemonList(json.results) 9 | }, 10 | getById: async (id: number): Promise => { 11 | let response = await fetch(`https://pokeapi.co/api/v2/pokemon/${id}`) 12 | let json = await response.json() 13 | return PokemonSerializer.parseFullPokemon(json) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/core/infraestructure/PokemonRepository.ts: -------------------------------------------------------------------------------- 1 | import { Pokemon, FullPokemon } from 'core/domain/model/Pokemon' 2 | import { PokemonSerializer } from './PokemonSerializer' 3 | 4 | export const PokemonRepository = { 5 | getList: async (): Promise => { 6 | let response = await fetch('https://pokeapi.co/api/v2/pokemon?limit=200') 7 | let json = await response.json() 8 | return PokemonSerializer.parsePokemonList(json.results) 9 | }, 10 | getById: async (id: number): Promise => { 11 | let response = await fetch(`https://pokeapi.co/api/v2/pokemon/${id}`) 12 | let json = await response.json() 13 | return PokemonSerializer.parseFullPokemon(json) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Icon/Icon.native.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {Pressable, StyleSheet, Text} from 'react-native' 3 | import {GlyphMap, IconProps} from './Icon.definition' 4 | 5 | export const Icon = ({name, color = 'black', onPress}: IconProps) => ( 6 | onPress?.()} disabled={!onPress} hitSlop={{top: 10, bottom: 10, left: 10, right: 10}}> 7 | 8 | {String.fromCharCode(GlyphMap[name])} 9 | 10 | 11 | ) 12 | 13 | const styles = StyleSheet.create({ 14 | icon: { 15 | fontSize: 25, 16 | fontFamily: 'FontAwesome' 17 | } 18 | }) 19 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding:0px; 3 | margin: 0px; 4 | border: none; 5 | background: transparent; 6 | } 7 | 8 | html, body, #root{ 9 | height: 100vh; 10 | width: 100vw; 11 | } 12 | 13 | body { 14 | overflow: hidden; 15 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 16 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 17 | sans-serif; 18 | -webkit-font-smoothing: antialiased; 19 | -moz-osx-font-smoothing: grayscale; 20 | } 21 | 22 | code { 23 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 24 | monospace; 25 | } 26 | 27 | @font-face { 28 | font-family: 'FontAwesome'; 29 | src: url(./assets/fonts/FontAwesome.ttf); 30 | } 31 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/jest.config.web.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'ts-jest', 3 | testEnvironment: 'jsdom', 4 | transform: { 5 | '^.+\\.jsx?$': 'babel-jest', 6 | '^.+\\.tsx?$': 'ts-jest', 7 | }, 8 | globals: { 9 | 'ts-jest': { 10 | babelConfig: true, 11 | diagnostics: true 12 | } 13 | }, 14 | modulePathIgnorePatterns: ['native'], 15 | verbose: false, 16 | moduleDirectories: ['node_modules', '/src'], 17 | moduleNameMapper: { 18 | '^@(.*)/(.*)$': '/node_modules/@$1/$2', 19 | '^ui/(.*)$': '/src/ui/$1', 20 | '^__test__/(.*)$': '/src/__test__/$1' 21 | }, 22 | moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'css'], 23 | setupFiles: ['./jest.setup.js'] 24 | }; 25 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/ui/components/Text.tsx: -------------------------------------------------------------------------------- 1 | import React, { ReactNode } from 'react' 2 | import { StyleProp, StyleSheet, Text as BaseText, ViewStyle } from 'react-native' 3 | 4 | interface Props { 5 | children: ReactNode 6 | fontSize?: number 7 | color?: string 8 | bold?: boolean 9 | capitalize?: boolean 10 | style?: StyleProp 11 | } 12 | 13 | export const Text = ({ children, fontSize = 17, color = 'black', bold = false, capitalize = false, style }: Props) => ( 14 | 17 | {children} 18 | 19 | ) 20 | 21 | const styles = StyleSheet.create({ 22 | bold: { fontWeight: '600' }, 23 | capitalize: { textTransform: 'capitalize' } 24 | }) 25 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/App.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { NavigationContainer } from '@react-navigation/native' 3 | import { createStackNavigator } from '@react-navigation/stack' 4 | import { PokemonDetail, PokemonList } from 'ui/screens' 5 | 6 | export type StackParams = { 7 | PokemonList: undefined 8 | PokemonDetail: { pokemonId: number } 9 | } 10 | 11 | const Stack = createStackNavigator() 12 | 13 | export const App = () => { 14 | return ( 15 | 16 | 17 | 18 | 19 | 20 | 21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/ui/components/Icon/Icon.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Pressable, StyleSheet, Text } from 'react-native' 3 | import { GlyphMap, IconName } from './Icon.definition' 4 | 5 | interface Props { 6 | name: IconName 7 | color?: string 8 | onPress?: () => void 9 | } 10 | 11 | export const Icon = ({ name, color = 'black', onPress }: Props) => ( 12 | onPress?.()} disabled={!onPress} hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}> 13 | 14 | {String.fromCharCode(GlyphMap[name])} 15 | 16 | 17 | ) 18 | 19 | const styles = StyleSheet.create({ 20 | icon: { 21 | fontSize: 25, 22 | fontFamily: 'FontAwesome' 23 | } 24 | }) 25 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/src/ui/components/Text.tsx: -------------------------------------------------------------------------------- 1 | import React, { ReactNode } from 'react' 2 | import { StyleProp, StyleSheet, Text as BaseText, ViewStyle } from 'react-native' 3 | 4 | interface Props { 5 | children: ReactNode 6 | fontSize?: number 7 | color?: string 8 | bold?: boolean 9 | capitalize?: boolean 10 | style?: StyleProp 11 | } 12 | 13 | export const Text = ({ children, fontSize = 17, color = 'black', bold = false, capitalize = false, style }: Props) => ( 14 | 17 | {children} 18 | 19 | ) 20 | 21 | const styles = StyleSheet.create({ 22 | bold: { fontWeight: '600' }, 23 | capitalize: { textTransform: 'capitalize' } 24 | }) 25 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/src/App.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { NavigationContainer } from '@react-navigation/native' 3 | import { createStackNavigator } from '@react-navigation/stack' 4 | import { PokemonDetail, PokemonList } from 'ui/screens' 5 | 6 | export type StackParams = { 7 | PokemonList: undefined 8 | PokemonDetail: { pokemonId: number } 9 | } 10 | 11 | const Stack = createStackNavigator() 12 | 13 | export const App = () => { 14 | return ( 15 | 16 | 17 | 18 | 19 | 20 | 21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/src/ui/components/Icon/Icon.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Pressable, StyleSheet, Text } from 'react-native' 3 | import { GlyphMap, IconName } from './Icon.definition' 4 | 5 | interface Props { 6 | name: IconName 7 | color?: string 8 | onPress?: () => void 9 | } 10 | 11 | export const Icon = ({ name, color = 'black', onPress }: Props) => ( 12 | onPress?.()} disabled={!onPress} hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}> 13 | 14 | {String.fromCharCode(GlyphMap[name])} 15 | 16 | 17 | ) 18 | 19 | const styles = StyleSheet.create({ 20 | icon: { 21 | fontSize: 25, 22 | fontFamily: 'FontAwesome' 23 | } 24 | }) 25 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/web/craco.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { getLoader, loaderByName } = require('@craco/craco'); 3 | 4 | const absolutePath = path.join(__dirname, '../core'); 5 | 6 | const core = path.join( 7 | __dirname, 8 | './node_modules/@540/core', 9 | ); 10 | 11 | module.exports = { 12 | webpack: { 13 | configure: (webpackConfig) => { 14 | const { isFound, match } = getLoader( 15 | webpackConfig, 16 | loaderByName('babel-loader'), 17 | ); 18 | if (isFound) { 19 | const include = Array.isArray(match.loader.include) 20 | ? match.loader.include 21 | : [match.loader.include]; 22 | match.loader.include = include.concat(absolutePath, core); 23 | } 24 | 25 | return webpackConfig; 26 | }, 27 | }, 28 | 29 | }; 30 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: '@typescript-eslint/parser', 4 | plugins: ['@typescript-eslint', 'react', 'prettier', 'jest', 'testing-library'], 5 | extends: [ 6 | '@react-native-community', 7 | 'eslint:recommended', 8 | 'plugin:react/recommended', 9 | 'prettier', 10 | 'plugin:jest/recommended', 11 | 'plugin:testing-library/react' 12 | ], 13 | ignorePatterns: ['node_modules/', 'coverage/', 'android/', 'ios/'], 14 | settings: { 15 | react: { 16 | pragma: 'React', 17 | version: '16.3' 18 | } 19 | }, 20 | rules: { 21 | 'prettier/prettier': 'warn', 22 | 'no-unused-vars': 'off', //Causes duplicates with typescript-eslint/no-unused-vars, 23 | 'react/jsx-uses-react': 'off', 24 | 'react/react-in-jsx-scope': 'off' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: '@typescript-eslint/parser', 4 | plugins: ['@typescript-eslint', 'react', 'prettier', 'jest', 'testing-library'], 5 | extends: [ 6 | '@react-native-community', 7 | 'eslint:recommended', 8 | 'plugin:react/recommended', 9 | 'prettier', 10 | 'plugin:jest/recommended', 11 | 'plugin:testing-library/react' 12 | ], 13 | ignorePatterns: ['node_modules/', 'coverage/', 'android/', 'ios/'], 14 | settings: { 15 | react: { 16 | pragma: 'React', 17 | version: '16.3' 18 | } 19 | }, 20 | rules: { 21 | 'prettier/prettier': 'warn', 22 | 'no-unused-vars': 'off', //Causes duplicates with typescript-eslint/no-unused-vars, 23 | 'react/jsx-uses-react': 'off', 24 | 'react/react-in-jsx-scope': 'off' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/router/Router.native.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {NavigationContainer} from '@react-navigation/native' 3 | import {createStackNavigator} from '@react-navigation/stack' 4 | import {RouterParams, routes} from './Router.definition'; 5 | 6 | const Stack = createStackNavigator() 7 | 8 | export const Router = () => ( 9 | 10 | 11 | {routes.map(route => 12 | 18 | )} 19 | 20 | 21 | ) 22 | 23 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/ios/RNWebTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/screens/PokemonList/PokemonCard.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {Pokemon} from 'core/domain/model/Pokemon' 3 | import {Image, Pressable, Text, View} from 'ui/components' 4 | 5 | interface Props { 6 | pokemon: Pokemon 7 | onPress: () => void 8 | } 9 | 10 | export const PokemonCard = ({pokemon, onPress}: Props) => ( 11 | 12 | 13 | 14 | 15 | 16 | 17 | {`${pokemon.id} - ${pokemon.name}`} 18 | 19 | 20 | 21 | ) 22 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/ios/RNWeb-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '11.0' 5 | 6 | target 'UIKit' do 7 | config = use_native_modules! 8 | 9 | use_react_native!( 10 | :path => config[:reactNativePath], 11 | # to enable hermes on iOS, change `false` to `true` and then install pods 12 | :hermes_enabled => false 13 | ) 14 | 15 | target 'UIKitTests' do 16 | inherit! :complete 17 | # Pods for testing 18 | end 19 | 20 | # Enables Flipper. 21 | # 22 | # Note that if you have use_frameworks! enabled, Flipper will not work and 23 | # you should disable the next line. 24 | use_flipper!() 25 | 26 | post_install do |installer| 27 | react_native_post_install(installer) 28 | end 29 | end -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/ios/UIKitTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/ios/SharedCoreTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '11.0' 5 | 6 | target 'SharedCore' do 7 | config = use_native_modules! 8 | 9 | use_react_native!( 10 | :path => config[:reactNativePath], 11 | # to enable hermes on iOS, change `false` to `true` and then install pods 12 | :hermes_enabled => false 13 | ) 14 | 15 | target 'SharedCoreTests' do 16 | inherit! :complete 17 | # Pods for testing 18 | end 19 | 20 | # Enables Flipper. 21 | # 22 | # Note that if you have use_frameworks! enabled, Flipper will not work and 23 | # you should disable the next line. 24 | use_flipper!() 25 | 26 | post_install do |installer| 27 | react_native_post_install(installer) 28 | end 29 | end -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/web/src/ui/screens/Pokedex/Pokedex.tsx: -------------------------------------------------------------------------------- 1 | import './Pokedex.css' 2 | import { Pokemon, FullPokemon, PokemonService } from '@540/core' 3 | import { useEffect, useState } from 'react' 4 | import { Sidebar } from './components/Sidebar' 5 | import { PokedexDetail } from './components/PokedexDetail' 6 | 7 | export function Pokedex() { 8 | const [pokemons, setPokemons] = useState([]) 9 | const [currentPokemon, setCurrentPokemon] = useState() 10 | 11 | useEffect(() => { 12 | PokemonService.getList().then(setPokemons) 13 | }, [setPokemons]) 14 | 15 | const handleSelectPokemon = (id: number) => { 16 | PokemonService.getById(id).then(setCurrentPokemon) 17 | } 18 | 19 | return ( 20 | <> 21 | 22 | 23 | 24 | ) 25 | } 26 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/View/View.definition.ts: -------------------------------------------------------------------------------- 1 | import {ReactNode} from 'react'; 2 | 3 | export interface ViewProps { 4 | children?: ReactNode 5 | width?: number | string 6 | height?:number | string 7 | margin?: number 8 | marginHorizontal?: number 9 | marginVertical?: number 10 | marginTop?: number 11 | marginBottom?: number 12 | marginRight?: number 13 | marginLeft?: number 14 | padding?: number 15 | paddingHorizontal?: number 16 | paddingVertical?: number 17 | paddingTop?: number 18 | paddingBottom?: number 19 | paddingRight?: number 20 | paddingLeft?: number 21 | flexGrow?: number 22 | backgroundColor?: string 23 | borderRadius?: number 24 | flex?: number 25 | direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse'; 26 | centerItems?: boolean 27 | center?: boolean 28 | hideOverflow?: boolean 29 | } 30 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/ui/components/Icon/Icon.definition.ts: -------------------------------------------------------------------------------- 1 | export const GlyphMap = { 2 | bin: 35, 3 | lock: 40, 4 | unlock: 41, 5 | cross: 42, 6 | plus: 43, 7 | refresh: 48, 8 | less: 60, 9 | greater: 62, 10 | question: 63, 11 | star: 74, 12 | key: 75, 13 | message: 77, 14 | picture: 80, 15 | filledStar: 83, 16 | user: 85, 17 | edit: 87, 18 | graphic: 89, 19 | calendar: 92, 20 | menu1: 106, 21 | menu2: 107, 22 | menu3: 108, 23 | menu4: 109, 24 | lemon: 111, 25 | twitter: 112, 26 | facebook: 113, 27 | search: 115, 28 | camera: 118, 29 | conversation: 119, 30 | settings: 120, 31 | brokenbar: 166, 32 | arrowup: 178, 33 | arrowdown: 179, 34 | clock: 188, 35 | file: 189, 36 | download: 190, 37 | music: 208, 38 | reload: 215, 39 | user2: 221, 40 | film: 253, 41 | tick: 254, 42 | heart: 322, 43 | zoomin: 381, 44 | zoomout: 382, 45 | play: 8722 46 | } 47 | 48 | export type IconName = keyof typeof GlyphMap 49 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '10.0' 5 | 6 | target 'RNWeb' do 7 | config = use_native_modules! 8 | 9 | use_react_native!(:path => config["reactNativePath"]) 10 | 11 | target 'RNWebTests' do 12 | inherit! :complete 13 | # Pods for testing 14 | end 15 | 16 | # Enables Flipper. 17 | # 18 | # Note that if you have use_frameworks! enabled, Flipper will not work and 19 | # you should disable these next few lines. 20 | use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' }) 21 | post_install do |installer| 22 | flipper_post_install(installer) 23 | end 24 | end 25 | 26 | target 'RNWeb-tvOS' do 27 | # Pods for RNWeb-tvOS 28 | 29 | target 'RNWeb-tvOSTests' do 30 | inherit! :search_paths 31 | # Pods for testing 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/src/ui/components/Icon/Icon.definition.ts: -------------------------------------------------------------------------------- 1 | export const GlyphMap = { 2 | bin: 35, 3 | lock: 40, 4 | unlock: 41, 5 | cross: 42, 6 | plus: 43, 7 | refresh: 48, 8 | less: 60, 9 | greater: 62, 10 | question: 63, 11 | star: 74, 12 | key: 75, 13 | message: 77, 14 | picture: 80, 15 | filledStar: 83, 16 | user: 85, 17 | edit: 87, 18 | graphic: 89, 19 | calendar: 92, 20 | menu1: 106, 21 | menu2: 107, 22 | menu3: 108, 23 | menu4: 109, 24 | lemon: 111, 25 | twitter: 112, 26 | facebook: 113, 27 | search: 115, 28 | camera: 118, 29 | conversation: 119, 30 | settings: 120, 31 | brokenbar: 166, 32 | arrowup: 178, 33 | arrowdown: 179, 34 | clock: 188, 35 | file: 189, 36 | download: 190, 37 | music: 208, 38 | reload: 215, 39 | user2: 221, 40 | film: 253, 41 | tick: 254, 42 | heart: 322, 43 | zoomin: 381, 44 | zoomout: 382, 45 | play: 8722 46 | } 47 | 48 | export type IconName = keyof typeof GlyphMap 49 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "jsx": "react", 4 | "target": "es5", 5 | "lib": [ 6 | "dom", 7 | "dom.iterable", 8 | "esnext" 9 | ], 10 | "module": "esnext", 11 | "moduleResolution": "node", 12 | "allowJs": true, 13 | "skipLibCheck": true, 14 | "esModuleInterop": true, 15 | "allowSyntheticDefaultImports": true, 16 | "strict": true, 17 | "forceConsistentCasingInFileNames": true, 18 | "resolveJsonModule": true, 19 | "isolatedModules": true, 20 | "noEmit": true, 21 | "noImplicitAny": true, 22 | "strictNullChecks": true, 23 | "strictFunctionTypes": true, 24 | "strictBindCallApply": true, 25 | "noImplicitThis": true, 26 | "strictPropertyInitialization": true, 27 | "alwaysStrict": true, 28 | "noUnusedLocals": true, 29 | "noUnusedParameters": true, 30 | "noImplicitReturns": true, 31 | "noFallthroughCasesInSwitch": true, 32 | "baseUrl": "src" 33 | }, 34 | "include": [ 35 | "src/**/*" 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/screens/PokemonDetail/PokemonDetail.tsx: -------------------------------------------------------------------------------- 1 | import React, {useEffect, useState} from 'react'; 2 | import {FullPokemon} from 'core/domain/model/Pokemon'; 3 | import {PokemonService} from 'core/services/PokemonService'; 4 | import {PokemonSummary} from './_components/PokemonSummary'; 5 | import {PokemonInfo} from './_components/PokemonInfo'; 6 | import {Loading, View} from 'ui/components'; 7 | import {useParams} from 'ui/router'; 8 | 9 | export const PokemonDetail = () => { 10 | const {pokemonId} = useParams<'PokemonDetail'>(); 11 | 12 | const [pokemon, setPokemon] = useState(undefined); 13 | 14 | useEffect(() => { 15 | PokemonService.getById(pokemonId).then(setPokemon); 16 | }, [pokemonId]); 17 | 18 | if (!pokemon) { 19 | return ; 20 | } 21 | 22 | return ( 23 | 24 | 25 | 26 | 27 | ); 28 | }; 29 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "jsx": "react", 4 | "target": "es5", 5 | "lib": [ 6 | "dom", 7 | "dom.iterable", 8 | "esnext" 9 | ], 10 | "module": "esnext", 11 | "moduleResolution": "node", 12 | "allowJs": true, 13 | "skipLibCheck": true, 14 | "esModuleInterop": true, 15 | "allowSyntheticDefaultImports": true, 16 | "strict": true, 17 | "forceConsistentCasingInFileNames": true, 18 | "resolveJsonModule": true, 19 | "isolatedModules": true, 20 | "noEmit": true, 21 | "noImplicitAny": true, 22 | "strictNullChecks": true, 23 | "strictFunctionTypes": true, 24 | "strictBindCallApply": true, 25 | "noImplicitThis": true, 26 | "strictPropertyInitialization": true, 27 | "alwaysStrict": true, 28 | "noUnusedLocals": true, 29 | "noUnusedParameters": true, 30 | "noImplicitReturns": true, 31 | "noFallthroughCasesInSwitch": true, 32 | "baseUrl": "src" 33 | }, 34 | "include": [ 35 | "src/**/*" 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/jest.config.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | preset: 'react-native', 4 | moduleFileExtensions: ['ts', 'tsx', 'js', 'json'], 5 | testRegex: 'test\\.(ts|js|jsx|tsx)$', 6 | moduleNameMapper: { 7 | '^@(.*)/(.*)$': '/node_modules/@$1/$2', 8 | '^ui/(.*)$': '/src/ui/$1' 9 | }, 10 | transform: { 11 | '^.+\\.(ts|tsx)$': 'ts-jest', 12 | '^.+\\.js$': '/node_modules/react-native/jest/preprocessor.js', 13 | '^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$': '/node_modules/react-native/jest/assetFileTransformer.js' 14 | }, 15 | transformIgnorePatterns: [ 16 | 'node_modules/(?!(jest-)?native-base|react-native|react-navigation|react-navigation-redux-helpers|@react-navigation/.*)' 17 | ], 18 | modulePathIgnorePatterns: ['android', 'ios'], 19 | globals: { 20 | 'ts-jest': { 21 | babelConfig: true, 22 | diagnostics: true 23 | } 24 | }, 25 | resetMocks: true, 26 | setupFiles: ['./jest.setup.js', './node_modules/react-native-gesture-handler/jestSetup.js'] 27 | } 28 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "jsx": "react-jsx", 4 | "target": "es5", 5 | "lib": [ 6 | "dom", 7 | "dom.iterable", 8 | "esnext" 9 | ], 10 | "module": "esnext", 11 | "moduleResolution": "node", 12 | "allowJs": true, 13 | "skipLibCheck": true, 14 | "esModuleInterop": true, 15 | "allowSyntheticDefaultImports": true, 16 | "strict": true, 17 | "forceConsistentCasingInFileNames": true, 18 | "resolveJsonModule": true, 19 | "isolatedModules": true, 20 | "noEmit": true, 21 | "noImplicitAny": true, 22 | "strictNullChecks": true, 23 | "strictFunctionTypes": true, 24 | "strictBindCallApply": true, 25 | "noImplicitThis": true, 26 | "strictPropertyInitialization": true, 27 | "alwaysStrict": true, 28 | "noUnusedLocals": true, 29 | "noUnusedParameters": true, 30 | "noImplicitReturns": true, 31 | "noFallthroughCasesInSwitch": true, 32 | "baseUrl": "src" 33 | }, 34 | "include": [ 35 | "src" 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | yarn-error.log 37 | 38 | # BUCK 39 | buck-out/ 40 | \.buckd/ 41 | *.keystore 42 | !debug.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | 58 | # CocoaPods 59 | /ios/Pods/ 60 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/Icon/Icon.definition.ts: -------------------------------------------------------------------------------- 1 | export const GlyphMap = { 2 | bin: 35, 3 | lock: 40, 4 | unlock: 41, 5 | cross: 42, 6 | plus: 43, 7 | refresh: 48, 8 | less: 60, 9 | greater: 62, 10 | question: 63, 11 | star: 74, 12 | key: 75, 13 | message: 77, 14 | picture: 80, 15 | filledStar: 83, 16 | user: 85, 17 | edit: 87, 18 | graphic: 89, 19 | calendar: 92, 20 | menu1: 106, 21 | menu2: 107, 22 | menu3: 108, 23 | menu4: 109, 24 | lemon: 111, 25 | twitter: 112, 26 | facebook: 113, 27 | search: 115, 28 | camera: 118, 29 | conversation: 119, 30 | settings: 120, 31 | brokenbar: 166, 32 | arrowup: 178, 33 | arrowdown: 179, 34 | clock: 188, 35 | file: 189, 36 | download: 190, 37 | music: 208, 38 | reload: 215, 39 | user2: 221, 40 | film: 253, 41 | tick: 254, 42 | heart: 322, 43 | zoomin: 381, 44 | zoomout: 382, 45 | play: 8722 46 | } 47 | 48 | 49 | export interface IconProps { 50 | name: IconName 51 | color?: string 52 | onPress?: () => void 53 | } 54 | 55 | export type IconName = keyof typeof GlyphMap 56 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | yarn-error.log 37 | 38 | # BUCK 39 | buck-out/ 40 | \.buckd/ 41 | *.keystore 42 | !debug.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | 58 | # CocoaPods 59 | /ios/Pods/ 60 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/jest.config.native.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | preset: 'react-native', 4 | moduleFileExtensions: ['native.js', 'js', 'native.jsx', 'jsx', 'native.ts', 'ts', 'native.tsx', 'tsx'], 5 | testRegex: 'test\\.(ts|js|jsx|tsx)$', 6 | moduleNameMapper: { 7 | '^@(.*)/(.*)$': '/node_modules/@$1/$2', 8 | '^ui/(.*)$': '/src/ui/$1', 9 | '^__test__/(.*)$': '/src/__test__/$1' 10 | }, 11 | transform: { 12 | '^.+\\.(ts|tsx)$': 'ts-jest', 13 | '^.+\\.js$': '/node_modules/react-native/jest/preprocessor.js', 14 | '^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$': '/node_modules/react-native/jest/assetFileTransformer.js' 15 | }, 16 | transformIgnorePatterns: [ 17 | 'node_modules/(?!(jest-)?@react-native|react-native)' 18 | ], 19 | modulePathIgnorePatterns: ['android', 'ios'], 20 | globals: { 21 | 'ts-jest': { 22 | babelConfig: true, 23 | diagnostics: true 24 | } 25 | }, 26 | resetMocks: true, 27 | setupFiles: ['./jest.setup.js', './node_modules/react-native-gesture-handler/jestSetup.js'], 28 | } 29 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | yarn-error.log 37 | 38 | # BUCK 39 | buck-out/ 40 | \.buckd/ 41 | *.keystore 42 | !debug.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | 58 | # CocoaPods 59 | /ios/Pods/ 60 | 61 | .eslintcache 62 | coverage/ -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/src/ui/screens/PokemonList/PokemonCard.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {Image, Pressable, StyleProp, StyleSheet, View, ViewStyle} from 'react-native' 3 | import { Pokemon } from '@540/core/domain/model/Pokemon' 4 | 5 | import { Text } from 'ui/components/Text' 6 | 7 | interface Props { 8 | pokemon: Pokemon 9 | onPress: () => void 10 | style: StyleProp 11 | } 12 | 13 | export const PokemonCard = ({ pokemon, onPress, style }: Props) => ( 14 | 17 | 18 | 19 | {`${pokemon.id} - ${pokemon.name}`} 20 | 21 | 22 | ) 23 | 24 | const styles = StyleSheet.create({ 25 | container: { 26 | padding: 5 27 | }, 28 | image: { 29 | height: 100, 30 | width: 100, 31 | marginBottom: 10 32 | }, 33 | flexContainer: { 34 | padding: 10, 35 | backgroundColor: 'lightgrey', 36 | borderRadius: 30, 37 | flex: 1, 38 | alignItems: 'center' 39 | } 40 | }) 41 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "29.0.2" 6 | minSdkVersion = 16 7 | compileSdkVersion = 29 8 | targetSdkVersion = 29 9 | } 10 | repositories { 11 | google() 12 | jcenter() 13 | } 14 | dependencies { 15 | classpath("com.android.tools.build:gradle:3.5.3") 16 | // NOTE: Do not place your application dependencies here; they belong 17 | // in the individual module build.gradle files 18 | } 19 | } 20 | 21 | allprojects { 22 | repositories { 23 | mavenLocal() 24 | maven { 25 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 26 | url("$rootDir/../node_modules/react-native/android") 27 | } 28 | maven { 29 | // Android JSC is installed from npm 30 | url("$rootDir/../node_modules/jsc-android/dist") 31 | } 32 | 33 | google() 34 | jcenter() 35 | maven { url 'https://www.jitpack.io' } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@540/core": "file:../core", 7 | "@craco/craco": "^6.2.0", 8 | "@testing-library/jest-dom": "^5.14.1", 9 | "@testing-library/react": "^11.2.7", 10 | "@testing-library/user-event": "^12.8.3", 11 | "@types/jest": "^27.0.1", 12 | "@types/node": "^16.6.1", 13 | "@types/react": "^17.0.18", 14 | "@types/react-dom": "^17.0.9", 15 | "react": "^17.0.2", 16 | "react-dom": "^17.0.2", 17 | "react-scripts": "^4.0.3", 18 | "typescript": "^4.3.5" 19 | }, 20 | "scripts": { 21 | "start": "craco start", 22 | "build": "craco build", 23 | "test": "craco test", 24 | "eject": "craco eject" 25 | }, 26 | "eslintConfig": { 27 | "extends": [ 28 | "react-app", 29 | "react-app/jest" 30 | ] 31 | }, 32 | "browserslist": { 33 | "production": [ 34 | ">0.2%", 35 | "not dead", 36 | "not op_mini all" 37 | ], 38 | "development": [ 39 | "last 1 chrome version", 40 | "last 1 firefox version", 41 | "last 1 safari version" 42 | ] 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/ios/RNWeb/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "filename" : "pokeball copy.png", 35 | "idiom" : "iphone", 36 | "scale" : "2x", 37 | "size" : "60x60" 38 | }, 39 | { 40 | "idiom" : "iphone", 41 | "scale" : "3x", 42 | "size" : "60x60" 43 | }, 44 | { 45 | "idiom" : "ios-marketing", 46 | "scale" : "1x", 47 | "size" : "1024x1024" 48 | } 49 | ], 50 | "info" : { 51 | "author" : "xcode", 52 | "version" : 1 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/ios/UIKit/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "filename" : "blue_pokeball.png", 35 | "idiom" : "iphone", 36 | "scale" : "2x", 37 | "size" : "60x60" 38 | }, 39 | { 40 | "idiom" : "iphone", 41 | "scale" : "3x", 42 | "size" : "60x60" 43 | }, 44 | { 45 | "idiom" : "ios-marketing", 46 | "scale" : "1x", 47 | "size" : "1024x1024" 48 | } 49 | ], 50 | "info" : { 51 | "author" : "xcode", 52 | "version" : 1 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/ios/SharedCore/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "filename" : "yellow_pokeball.png", 35 | "idiom" : "iphone", 36 | "scale" : "2x", 37 | "size" : "60x60" 38 | }, 39 | { 40 | "idiom" : "iphone", 41 | "scale" : "3x", 42 | "size" : "60x60" 43 | }, 44 | { 45 | "idiom" : "ios-marketing", 46 | "scale" : "1x", 47 | "size" : "1024x1024" 48 | } 49 | ], 50 | "info" : { 51 | "author" : "xcode", 52 | "version" : 1 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "30.0.2" 6 | minSdkVersion = 21 7 | compileSdkVersion = 30 8 | targetSdkVersion = 30 9 | ndkVersion = "20.1.5948944" 10 | } 11 | repositories { 12 | google() 13 | mavenCentral() 14 | } 15 | dependencies { 16 | classpath("com.android.tools.build:gradle:4.2.1") 17 | // NOTE: Do not place your application dependencies here; they belong 18 | // in the individual module build.gradle files 19 | } 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | mavenCentral() 25 | mavenLocal() 26 | maven { 27 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 28 | url("$rootDir/../node_modules/react-native/android") 29 | } 30 | maven { 31 | // Android JSC is installed from npm 32 | url("$rootDir/../node_modules/jsc-android/dist") 33 | } 34 | 35 | google() 36 | maven { url 'https://www.jitpack.io' } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/ui/screens/PokemonList/PokemonCard.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Image, StyleProp, StyleSheet, View, ViewStyle } from 'react-native' 3 | import { Pokemon } from 'core/domain/model/Pokemon' 4 | import { Pressable } from 'react-native-web-hover' 5 | import { Text } from 'ui/components/Text' 6 | 7 | interface Props { 8 | pokemon: Pokemon 9 | onPress: () => void 10 | style: StyleProp 11 | } 12 | 13 | export const PokemonCard = ({ pokemon, onPress, style }: Props) => ( 14 | [styles.container, style, hovered && { transform: [{ scale: 1.1 }] }]}> 17 | 18 | 19 | {`${pokemon.id} - ${pokemon.name}`} 20 | 21 | 22 | ) 23 | 24 | const styles = StyleSheet.create({ 25 | container: { 26 | padding: 5 27 | }, 28 | image: { 29 | height: 100, 30 | width: 100, 31 | marginBottom: 10 32 | }, 33 | flexContainer: { 34 | padding: 10, 35 | backgroundColor: 'lightgrey', 36 | borderRadius: 30, 37 | flex: 1, 38 | alignItems: 'center' 39 | } 40 | }) 41 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "30.0.2" 6 | minSdkVersion = 21 7 | compileSdkVersion = 30 8 | targetSdkVersion = 30 9 | ndkVersion = "20.1.5948944" 10 | } 11 | repositories { 12 | google() 13 | mavenCentral() 14 | } 15 | dependencies { 16 | classpath("com.android.tools.build:gradle:4.2.1") 17 | // NOTE: Do not place your application dependencies here; they belong 18 | // in the individual module build.gradle files 19 | } 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | mavenCentral() 25 | mavenLocal() 26 | maven { 27 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 28 | url("$rootDir/../node_modules/react-native/android") 29 | } 30 | maven { 31 | // Android JSC is installed from npm 32 | url("$rootDir/../node_modules/jsc-android/dist") 33 | } 34 | 35 | google() 36 | maven { url 'https://www.jitpack.io' } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/screens/PokemonList/PokemonList.tsx: -------------------------------------------------------------------------------- 1 | import React, {useEffect, useState} from 'react'; 2 | import {PokemonService} from 'core/services/PokemonService'; 3 | import {Pokemon} from 'core/domain/model/Pokemon'; 4 | import {PokemonCard} from './PokemonCard'; 5 | import {Loading, ScrollView, Text, View} from 'ui/components'; 6 | import {useNavigator} from 'ui/router'; 7 | 8 | export const PokemonList = () => { 9 | const navigator = useNavigator() 10 | const [pokemons, setPokemons] = useState([]); 11 | 12 | useEffect(() => { 13 | PokemonService.getList().then(setPokemons); 14 | }, [setPokemons]); 15 | 16 | if (pokemons.length === 0) { 17 | return ; 18 | } 19 | 20 | return ( 21 | 22 | 23 | 24 | Pokedex 25 | 26 | 27 | 28 | {pokemons.map(pokemon => ( 29 | navigator.goToPokemonDetail(pokemon.id)} 33 | /> 34 | ))} 35 | 36 | 37 | ); 38 | }; 39 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.54.0 29 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.93.0 29 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.93.0 29 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/ui/screens/PokemonDetail/PokemonDetail.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from 'react' 2 | import { ActivityIndicator, SafeAreaView, StyleSheet } from 'react-native' 3 | import { RouteProp, useRoute } from '@react-navigation/native' 4 | import { StackParams } from 'App' 5 | import { FullPokemon } from 'core/domain/model/Pokemon' 6 | import { PokemonService } from 'core/services/PokemonService' 7 | import { PokemonSummary } from './_components/PokemonSummary' 8 | import { PokemonInfo } from './_components/PokemonInfo' 9 | import { DetailDisplay } from './_components/DetailDisplay' 10 | 11 | type RouteProps = RouteProp 12 | export const PokemonDetail = () => { 13 | const { 14 | params: { pokemonId } 15 | } = useRoute() 16 | 17 | const [pokemon, setPokemon] = useState(undefined) 18 | 19 | useEffect(() => { 20 | PokemonService.getById(pokemonId).then(setPokemon) 21 | }, [pokemonId]) 22 | 23 | if (!pokemon) { 24 | return 25 | } 26 | 27 | return ( 28 | 29 | 30 | 31 | 32 | 33 | 34 | ) 35 | } 36 | 37 | const styles = StyleSheet.create({ 38 | block: { flex: 1, padding: 15 } 39 | }) 40 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/src/ui/screens/PokemonDetail/PokemonDetail.tsx: -------------------------------------------------------------------------------- 1 | import React, {useEffect, useState} from 'react'; 2 | import {ActivityIndicator, SafeAreaView, StyleSheet} from 'react-native'; 3 | import {RouteProp, useRoute} from '@react-navigation/native'; 4 | import {StackParams} from 'App'; 5 | import {FullPokemon} from '@540/core/domain/model/Pokemon'; 6 | import {PokemonService} from '@540/core/services/PokemonService'; 7 | import {PokemonSummary} from './_components/PokemonSummary'; 8 | import {PokemonInfo} from './_components/PokemonInfo'; 9 | 10 | type RouteProps = RouteProp; 11 | export const PokemonDetail = () => { 12 | const { 13 | params: {pokemonId}, 14 | } = useRoute(); 15 | 16 | const [pokemon, setPokemon] = useState(undefined); 17 | 18 | useEffect(() => { 19 | PokemonService.getById(pokemonId).then(setPokemon); 20 | }, [pokemonId]); 21 | 22 | if (!pokemon) { 23 | return ; 24 | } 25 | 26 | return ( 27 | 28 | 29 | 30 | 31 | ); 32 | }; 33 | 34 | const styles = StyleSheet.create({ 35 | container: { 36 | backgroundColor: 'white', 37 | height: '100%', 38 | }, 39 | block: { 40 | flex: 1, 41 | padding: 15, 42 | }, 43 | }); 44 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.example", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.example", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/_BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.pokedex", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.pokedex", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/components/View/View.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import styled from 'styled-components' 3 | import {ViewProps} from './View.definition'; 4 | 5 | 6 | const BaseView = ({className, children}: ViewProps & { className?: string }) => ( 7 |

8 | {children} 9 |

10 | ) 11 | 12 | export const View = styled(BaseView)`${props => ` 13 | display: flex; 14 | height:${( typeof props.height === 'string' ? props.height : props.height+'px')}; 15 | width:${( typeof props.width === 'string' ? props.width : props.width+'px')}; 16 | background-color: ${props.backgroundColor}; 17 | border-radius: ${props.borderRadius}px; 18 | margin: ${props.margin}px; 19 | margin-top: ${props.marginTop ?? props.marginVertical}px; 20 | margin-bottom: ${props.marginBottom ?? props.marginVertical}px; 21 | margin-right: ${props.marginRight ?? props.marginHorizontal}px; 22 | margin-left: ${props.marginLeft ?? props.marginHorizontal}px; 23 | padding: ${props.padding}px; 24 | padding-top: ${props.paddingTop ?? props.paddingVertical}px; 25 | padding-bottom: ${ props.paddingBottom ??props.paddingVertical}px; 26 | padding-left: ${props.paddingLeft ?? props.paddingHorizontal}px; 27 | padding-right: ${props.paddingRight ?? props.paddingHorizontal}px; 28 | flex-direction: ${props.direction ?? 'column'}; 29 | ${props.hideOverflow ? `overflow: hidden;` : '' } 30 | ${props.center ? `align-self: center;` : '' } 31 | ${props.centerItems ? `align-items: center;` : '' } 32 | `}` 33 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/_BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.pokedex", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.pokedex", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pokedex", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "start": "react-native start", 9 | "test": "jest", 10 | "lint": "eslint . --ext .js,.jsx,.ts,.tsx" 11 | }, 12 | "dependencies": { 13 | "@540/core": "file:../core", 14 | "@react-navigation/native": "^6.0.4", 15 | "@react-navigation/stack": "^6.0.9", 16 | "react": "17.0.2", 17 | "react-native": "0.65.1", 18 | "react-native-gesture-handler": "^1.10.3", 19 | "react-native-safe-area-context": "^3.3.2", 20 | "react-native-screens": "^3.8.0" 21 | }, 22 | "devDependencies": { 23 | "@babel/core": "^7.12.9", 24 | "@babel/runtime": "^7.12.5", 25 | "@react-native-community/eslint-config": "^2.0.0", 26 | "@testing-library/react-native": "^7.2.0", 27 | "@types/jest": "^26.0.23", 28 | "@types/react": "^17", 29 | "@types/react-native": "^0.65.0", 30 | "@types/react-test-renderer": "^17.0.1", 31 | "babel-jest": "^26.6.3", 32 | "babel-plugin-module-resolver": "^4.0.0", 33 | "eslint": "^7.14.0", 34 | "jest": "^26.6.3", 35 | "metro-react-native-babel-preset": "^0.66.0", 36 | "react-native-codegen": "^0.0.7", 37 | "react-test-renderer": "17.0.2", 38 | "typescript": "^3.8.3" 39 | }, 40 | "jest": { 41 | "preset": "react-native", 42 | "moduleFileExtensions": [ 43 | "ts", 44 | "tsx", 45 | "js", 46 | "jsx", 47 | "json", 48 | "node" 49 | ] 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/ios/RNWeb-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSExceptionDomains 28 | 29 | localhost 30 | 31 | NSExceptionAllowsInsecureHTTPLoads 32 | 33 | 34 | 35 | 36 | NSLocationWhenInUseUsageDescription 37 | 38 | UILaunchStoryboardName 39 | LaunchScreen 40 | UIRequiredDeviceCapabilities 41 | 42 | armv7 43 | 44 | UISupportedInterfaceOrientations 45 | 46 | UIInterfaceOrientationPortrait 47 | UIInterfaceOrientationLandscapeLeft 48 | UIInterfaceOrientationLandscapeRight 49 | 50 | UIViewControllerBasedStatusBarAppearance 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/ios/UIKit/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | UIKit 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | localhost 32 | 33 | NSExceptionAllowsInsecureHTTPLoads 34 | 35 | 36 | 37 | 38 | NSLocationWhenInUseUsageDescription 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UIViewControllerBasedStatusBarAppearance 53 | 54 | UIAppFonts 55 | 56 | FontAwesome.ttf 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/src/ui/screens/PokemonDetail/_components/PokemonSummary.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {FullPokemon} from 'core/domain/model/Pokemon'; 3 | import {Icon, Image, Text, View} from 'ui/components'; 4 | import {useNavigator} from 'ui/router'; 5 | 6 | interface Props { 7 | pokemon: FullPokemon; 8 | } 9 | 10 | export const PokemonSummary = ({pokemon}: Props) => { 11 | const navigator = useNavigator() 12 | 13 | return ( 14 | 15 | 16 | 17 | {pokemon.name} 18 | 19 | 20 | {pokemon.types.map((type) => ( 21 | 22 | {type} 23 | 24 | ))} 25 | 26 | 27 | 28 | 29 | 30 | ); 31 | }; 32 | 33 | const POKEMON_TYPE_COLORS: Record = { 34 | normal: '#A8A878', 35 | fighting: '#C03028', 36 | flying: '#A890F0', 37 | poison: '#A040A0', 38 | ground: '#E0C068', 39 | rock: '#B8A038', 40 | bug: '#A8B820', 41 | ghost: '#705898', 42 | steel: '#B8B8D0', 43 | fire: '#FA6C6C', 44 | water: '#6890F0', 45 | grass: '#48CFB2', 46 | electric: '#FFCE4B', 47 | psychic: '#F85888', 48 | ice: '#98D8D8', 49 | dragon: '#7038F8', 50 | dark: '#705848', 51 | fairy: '#EE99AC', 52 | }; 53 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | RNWeb 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/ios/SharedCore/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | SharedCore 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | localhost 32 | 33 | NSExceptionAllowsInsecureHTTPLoads 34 | 35 | 36 | 37 | 38 | NSLocationWhenInUseUsageDescription 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UIViewControllerBasedStatusBarAppearance 53 | 54 | UIAppFonts 55 | 56 | FontAwesome.ttf 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React App 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/web/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | Pokedex 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/ui/screens/PokemonList/PokemonList.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from 'react' 2 | import { ActivityIndicator, SafeAreaView, ScrollView, StyleSheet } from 'react-native' 3 | import { PokemonService } from 'core/services/PokemonService' 4 | import { Pokemon } from 'core/domain/model/Pokemon' 5 | import { useNavigation } from '@react-navigation/native' 6 | import { StackNavigationProp } from '@react-navigation/stack' 7 | import { StackParams } from 'App' 8 | import { PokemonCard } from './PokemonCard' 9 | import { Text } from 'ui/components/Text' 10 | 11 | type NavigationProps = StackNavigationProp 12 | 13 | export const PokemonList = () => { 14 | const { navigate } = useNavigation() 15 | const [pokemons, setPokemons] = useState([]) 16 | 17 | useEffect(() => { 18 | PokemonService.getList().then(setPokemons) 19 | }, [setPokemons]) 20 | 21 | if (pokemons.length === 0) { 22 | return 23 | } 24 | 25 | return ( 26 | 27 | 28 | Pokedex 29 | 30 | 31 | {pokemons.map(pokemon => ( 32 | navigate('PokemonDetail', { pokemonId: pokemon.id })} 36 | style={styles.card} 37 | /> 38 | ))} 39 | 40 | 41 | ) 42 | } 43 | const styles = StyleSheet.create({ 44 | title: { 45 | marginHorizontal: 10 46 | }, 47 | container: { 48 | margin: 10, 49 | flex: 1 50 | }, 51 | scrollView: { 52 | flexWrap: 'wrap', 53 | flexDirection: 'row' 54 | }, 55 | card: { 56 | width: 175, 57 | flexGrow: 1 58 | } 59 | }) 60 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/ios/RNWeb/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | RNWeb 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | NSExceptionDomains 32 | 33 | localhost 34 | 35 | NSExceptionAllowsInsecureHTTPLoads 36 | 37 | 38 | 39 | 40 | NSLocationWhenInUseUsageDescription 41 | 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIRequiredDeviceCapabilities 45 | 46 | armv7 47 | 48 | UISupportedInterfaceOrientations 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | UIViewControllerBasedStatusBarAppearance 55 | 56 | UIAppFonts 57 | 58 | FontAwesome.ttf 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/src/ui/screens/PokemonList/PokemonList.tsx: -------------------------------------------------------------------------------- 1 | import React, {useEffect, useState} from 'react'; 2 | import { 3 | ActivityIndicator, 4 | SafeAreaView, 5 | ScrollView, 6 | StyleSheet, 7 | } from 'react-native'; 8 | import {useNavigation} from '@react-navigation/native'; 9 | import {StackNavigationProp} from '@react-navigation/stack'; 10 | import {PokemonService} from '@540/core/services/PokemonService'; 11 | import {Pokemon} from '@540/core/domain/model/Pokemon'; 12 | import {Text} from 'ui/components/Text'; 13 | import {StackParams} from 'App'; 14 | import {PokemonCard} from './PokemonCard'; 15 | 16 | type NavigationProps = StackNavigationProp; 17 | 18 | export const PokemonList = () => { 19 | const {navigate} = useNavigation(); 20 | const [pokemons, setPokemons] = useState([]); 21 | 22 | useEffect(() => { 23 | PokemonService.getList().then(setPokemons); 24 | }, [setPokemons]); 25 | 26 | if (pokemons.length === 0) { 27 | return ; 28 | } 29 | 30 | return ( 31 | 32 | 33 | Pokedex 34 | 35 | 36 | {pokemons.map(pokemon => ( 37 | navigate('PokemonDetail', {pokemonId: pokemon.id})} 41 | style={styles.card} 42 | /> 43 | ))} 44 | 45 | 46 | ); 47 | }; 48 | const styles = StyleSheet.create({ 49 | title: { 50 | marginHorizontal: 10, 51 | }, 52 | container: { 53 | margin: 10, 54 | flex: 1, 55 | }, 56 | scrollView: { 57 | flexWrap: 'wrap', 58 | flexDirection: 'row', 59 | }, 60 | card: { 61 | width: 175, 62 | flexGrow: 1, 63 | }, 64 | }); 65 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/ios/RNWebTests/RNWebTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import 5 | #import 6 | 7 | #define TIMEOUT_SECONDS 600 8 | #define TEXT_TO_LOOK_FOR @"Welcome to React" 9 | 10 | @interface RNWebTests : XCTestCase 11 | 12 | @end 13 | 14 | @implementation RNWebTests 15 | 16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 17 | { 18 | if (test(view)) { 19 | return YES; 20 | } 21 | for (UIView *subview in [view subviews]) { 22 | if ([self findSubviewInView:subview matching:test]) { 23 | return YES; 24 | } 25 | } 26 | return NO; 27 | } 28 | 29 | - (void)testRendersWelcomeScreen 30 | { 31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 33 | BOOL foundElement = NO; 34 | 35 | __block NSString *redboxError = nil; 36 | #ifdef DEBUG 37 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 38 | if (level >= RCTLogLevelError) { 39 | redboxError = message; 40 | } 41 | }); 42 | #endif 43 | 44 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 45 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 46 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 47 | 48 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 49 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 50 | return YES; 51 | } 52 | return NO; 53 | }]; 54 | } 55 | 56 | #ifdef DEBUG 57 | RCTSetLogFunction(RCTDefaultLogFunction); 58 | #endif 59 | 60 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 61 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 62 | } 63 | 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/ios/UIKitTests/UIKitTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import 5 | #import 6 | 7 | #define TIMEOUT_SECONDS 600 8 | #define TEXT_TO_LOOK_FOR @"Welcome to React" 9 | 10 | @interface UIKitTests : XCTestCase 11 | 12 | @end 13 | 14 | @implementation UIKitTests 15 | 16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 17 | { 18 | if (test(view)) { 19 | return YES; 20 | } 21 | for (UIView *subview in [view subviews]) { 22 | if ([self findSubviewInView:subview matching:test]) { 23 | return YES; 24 | } 25 | } 26 | return NO; 27 | } 28 | 29 | - (void)testRendersWelcomeScreen 30 | { 31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 33 | BOOL foundElement = NO; 34 | 35 | __block NSString *redboxError = nil; 36 | #ifdef DEBUG 37 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 38 | if (level >= RCTLogLevelError) { 39 | redboxError = message; 40 | } 41 | }); 42 | #endif 43 | 44 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 45 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 46 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 47 | 48 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 49 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 50 | return YES; 51 | } 52 | return NO; 53 | }]; 54 | } 55 | 56 | #ifdef DEBUG 57 | RCTSetLogFunction(RCTDefaultLogFunction); 58 | #endif 59 | 60 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 61 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 62 | } 63 | 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/patches/react-native-web-hover+0.2.9.patch: -------------------------------------------------------------------------------- 1 | diff --git a/node_modules/react-native-web-hover/lib/typescript/src/index.d.ts b/node_modules/react-native-web-hover/lib/typescript/src/index.d.ts 2 | index e011736..6ae0461 100644 3 | --- a/node_modules/react-native-web-hover/lib/typescript/src/index.d.ts 4 | +++ b/node_modules/react-native-web-hover/lib/typescript/src/index.d.ts 5 | @@ -1,5 +1,5 @@ 6 | import * as React from 'react'; 7 | -import type { ViewProps, StyleProp, ViewStyle, PressableStateCallbackType, FlatListProps, VirtualizedListProps, ScrollViewProps } from 'react-native'; 8 | +import type { ViewProps, StyleProp, ViewStyle, PressableStateCallbackType, FlatListProps, VirtualizedListProps, ScrollViewProps, PressableProps as NativePressableProps } from 'react-native'; 9 | interface PressableStateCallbackTypeWeb extends PressableStateCallbackType { 10 | focused?: boolean; 11 | hovered?: boolean; 12 | @@ -11,7 +11,7 @@ interface HoverableProps extends ViewProps { 13 | hovered: boolean; 14 | }) => React.ReactNode); 15 | } 16 | -interface PressableProps extends Omit { 17 | +interface PressableProps extends Omit { 18 | children: ChildrenType; 19 | style?: StylesType; 20 | } 21 | diff --git a/node_modules/react-native-web-hover/src/index.tsx b/node_modules/react-native-web-hover/src/index.tsx 22 | index a2a1c4d..143470a 100644 23 | --- a/node_modules/react-native-web-hover/src/index.tsx 24 | +++ b/node_modules/react-native-web-hover/src/index.tsx 25 | @@ -7,6 +7,7 @@ import type { 26 | FlatListProps, 27 | VirtualizedListProps, 28 | ScrollViewProps, 29 | + PressableProps as NativePressableProps 30 | } from 'react-native'; 31 | 32 | import { 33 | @@ -44,7 +45,7 @@ interface HoverableProps extends ViewProps { 34 | | ((state: { hovered: boolean }) => React.ReactNode); 35 | } 36 | 37 | -interface PressableProps extends Omit { 38 | +interface PressableProps extends Omit { 39 | children: ChildrenType; 40 | style?: StylesType; 41 | } 42 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/ios/SharedCoreTests/SharedCoreTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import 5 | #import 6 | 7 | #define TIMEOUT_SECONDS 600 8 | #define TEXT_TO_LOOK_FOR @"Welcome to React" 9 | 10 | @interface SharedCoreTests : XCTestCase 11 | 12 | @end 13 | 14 | @implementation SharedCoreTests 15 | 16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 17 | { 18 | if (test(view)) { 19 | return YES; 20 | } 21 | for (UIView *subview in [view subviews]) { 22 | if ([self findSubviewInView:subview matching:test]) { 23 | return YES; 24 | } 25 | } 26 | return NO; 27 | } 28 | 29 | - (void)testRendersWelcomeScreen 30 | { 31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 33 | BOOL foundElement = NO; 34 | 35 | __block NSString *redboxError = nil; 36 | #ifdef DEBUG 37 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 38 | if (level >= RCTLogLevelError) { 39 | redboxError = message; 40 | } 41 | }); 42 | #endif 43 | 44 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 45 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 46 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 47 | 48 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 49 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 50 | return YES; 51 | } 52 | return NO; 53 | }]; 54 | } 55 | 56 | #ifdef DEBUG 57 | RCTSetLogFunction(RCTDefaultLogFunction); 58 | #endif 59 | 60 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 61 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 62 | } 63 | 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cross platform code sharing strategies 2 | 3 | ## Requirements 4 | 5 | - node (>= 12) 6 | - yarn 7 | - watchman 8 | - iOS 9 | - Xcode 10 | - Android 11 | - Java Development Kit (>= 8) 12 | - Android Studio (Android SDK, Android SDK Platform, Performance (Intel ® HAXM), Android Virtual Device) 13 | - Android SDK Platform 14 | 15 | (https://reactnative.dev/docs/environment-setup) 16 | 17 | ## Run examples 18 | For each project example: 19 | 20 | - `yarn install`: installs dependencies 21 | - `yarn web`: runs the app on localhost in development mode 22 | - `yarn mobile`: starts mobile bundler 23 | - `yarn android`: installs & runs app on android 24 | - `yarn ios`: installs & runs app on iOS 25 | - `yarn test`: runs tests 26 | 27 | 28 | ## Shared logic and view 29 | 30 | ### [Shared code with RNWeb](https://github.com/540/cross-platform-code-sharing-strategies/tree/master/shared-code-with-uikit-bridge) 31 | [React Native Web](https://necolas.github.io/react-native-web/) is a compatibility layer between React DOM and React Native. It allows you to build ios, android and web apps from React Native api and components. 32 | 33 | Screenshot 2022-03-07 at 08 14 05 34 | 35 | ### [Shared code wiith UIKit bridge](https://github.com/540/cross-platform-code-sharing-strategies/tree/master/shared-code-with-uikit-bridge) 36 | Another option is to define a custom UIkit that works as a bridge and create an implementation for each platform. 37 | 38 | 39 | Screenshot 2022-03-07 at 08 14 57 40 | 41 | ## Shared logic, different view 42 | 43 | ### [Isolated fronts shared core](https://github.com/540/cross-platform-code-sharing-strategies/tree/master/isolated-fronts-shared-core) 44 | In this example, we shared the core written in JS and each platform implements his own view. 45 | 46 | Screenshot 2022-03-07 at 08 31 47 47 | 48 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/src/ui/screens/PokemonDetail/_components/PokemonSummary.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {Image, StyleProp, StyleSheet, View, ViewStyle} from 'react-native'; 3 | import {useNavigation} from '@react-navigation/native'; 4 | import {FullPokemon} from '@540/core/domain/model/Pokemon'; 5 | import {Icon} from 'ui/components/Icon'; 6 | import {Text} from 'ui/components/Text'; 7 | 8 | interface Props { 9 | pokemon: FullPokemon; 10 | style: StyleProp; 11 | } 12 | 13 | export const PokemonSummary = ({pokemon, style}: Props) => { 14 | const navigation = useNavigation(); 15 | 16 | return ( 17 | 19 | 20 | 21 | {pokemon.name} 22 | 23 | 24 | {pokemon.types.map((type, index) => ( 25 | 26 | {type} 27 | 28 | ))} 29 | 30 | 31 | 32 | ); 33 | }; 34 | 35 | const styles = StyleSheet.create({ 36 | image: { 37 | height: '70%', 38 | aspectRatio: 1, 39 | alignSelf: 'center', 40 | }, 41 | typesContainer: { 42 | marginTop: 10, 43 | flexDirection: 'row', 44 | }, 45 | type: { 46 | borderRadius: 20, 47 | backgroundColor: 'rgba(52, 52, 52, 0.2)', 48 | marginRight: 5, 49 | paddingVertical: 7, 50 | paddingHorizontal: 15, 51 | }, 52 | }); 53 | 54 | const POKEMON_TYPE_COLORS: Record = { 55 | normal: '#A8A878', 56 | fighting: '#C03028', 57 | flying: '#A890F0', 58 | poison: '#A040A0', 59 | ground: '#E0C068', 60 | rock: '#B8A038', 61 | bug: '#A8B820', 62 | ghost: '#705898', 63 | steel: '#B8B8D0', 64 | fire: '#FA6C6C', 65 | water: '#6890F0', 66 | grass: '#48CFB2', 67 | electric: '#FFCE4B', 68 | psychic: '#F85888', 69 | ice: '#98D8D8', 70 | dragon: '#7038F8', 71 | dark: '#705848', 72 | fairy: '#EE99AC', 73 | }; 74 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/patches/react-scripts+4.0.3.patch: -------------------------------------------------------------------------------- 1 | diff --git a/node_modules/react-scripts/config/webpack.config.js b/node_modules/react-scripts/config/webpack.config.js 2 | index 26c2a65..621d7d8 100644 3 | --- a/node_modules/react-scripts/config/webpack.config.js 4 | +++ b/node_modules/react-scripts/config/webpack.config.js 5 | @@ -756,6 +756,8 @@ module.exports = function (webpackEnv) { 6 | !disableESLintPlugin && 7 | new ESLintPlugin({ 8 | // Plugin options 9 | + failOnError: false, 10 | + emitWarning: true, 11 | extensions: ['js', 'mjs', 'jsx', 'ts', 'tsx'], 12 | formatter: require.resolve('react-dev-utils/eslintFormatter'), 13 | eslintPath: require.resolve('eslint'), 14 | diff --git a/node_modules/react-scripts/scripts/utils/verifyTypeScriptSetup.js b/node_modules/react-scripts/scripts/utils/verifyTypeScriptSetup.js 15 | index 949f34a..d533f3c 100644 16 | --- a/node_modules/react-scripts/scripts/utils/verifyTypeScriptSetup.js 17 | +++ b/node_modules/react-scripts/scripts/utils/verifyTypeScriptSetup.js 18 | @@ -145,17 +145,17 @@ function verifyTypeScriptSetup() { 19 | resolveJsonModule: { value: true, reason: 'to match webpack loader' }, 20 | isolatedModules: { value: true, reason: 'implementation limitation' }, 21 | noEmit: { value: true }, 22 | - jsx: { 23 | - parsedValue: 24 | - hasJsxRuntime && semver.gte(ts.version, '4.1.0-beta') 25 | - ? ts.JsxEmit.ReactJSX 26 | - : ts.JsxEmit.React, 27 | - value: 28 | - hasJsxRuntime && semver.gte(ts.version, '4.1.0-beta') 29 | - ? 'react-jsx' 30 | - : 'react', 31 | - reason: 'to support the new JSX transform in React 17', 32 | - }, 33 | + // jsx: { 34 | + // parsedValue: 35 | + // hasJsxRuntime && semver.gte(ts.version, '4.1.0-beta') 36 | + // ? ts.JsxEmit.ReactJSX 37 | + // : ts.JsxEmit.React, 38 | + // value: 39 | + // hasJsxRuntime && semver.gte(ts.version, '4.1.0-beta') 40 | + // ? 'react-jsx' 41 | + // : 'react', 42 | + // reason: 'to support the new JSX transform in React 17', 43 | + // }, 44 | paths: { value: undefined, reason: 'aliased imports are not supported' }, 45 | }; 46 | 47 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/patches/react-scripts+4.0.3.patch: -------------------------------------------------------------------------------- 1 | diff --git a/node_modules/react-scripts/config/webpack.config.js b/node_modules/react-scripts/config/webpack.config.js 2 | index 26c2a65..621d7d8 100644 3 | --- a/node_modules/react-scripts/config/webpack.config.js 4 | +++ b/node_modules/react-scripts/config/webpack.config.js 5 | @@ -756,6 +756,8 @@ module.exports = function (webpackEnv) { 6 | !disableESLintPlugin && 7 | new ESLintPlugin({ 8 | // Plugin options 9 | + failOnError: false, 10 | + emitWarning: true, 11 | extensions: ['js', 'mjs', 'jsx', 'ts', 'tsx'], 12 | formatter: require.resolve('react-dev-utils/eslintFormatter'), 13 | eslintPath: require.resolve('eslint'), 14 | diff --git a/node_modules/react-scripts/scripts/utils/verifyTypeScriptSetup.js b/node_modules/react-scripts/scripts/utils/verifyTypeScriptSetup.js 15 | index 949f34a..d533f3c 100644 16 | --- a/node_modules/react-scripts/scripts/utils/verifyTypeScriptSetup.js 17 | +++ b/node_modules/react-scripts/scripts/utils/verifyTypeScriptSetup.js 18 | @@ -145,17 +145,17 @@ function verifyTypeScriptSetup() { 19 | resolveJsonModule: { value: true, reason: 'to match webpack loader' }, 20 | isolatedModules: { value: true, reason: 'implementation limitation' }, 21 | noEmit: { value: true }, 22 | - jsx: { 23 | - parsedValue: 24 | - hasJsxRuntime && semver.gte(ts.version, '4.1.0-beta') 25 | - ? ts.JsxEmit.ReactJSX 26 | - : ts.JsxEmit.React, 27 | - value: 28 | - hasJsxRuntime && semver.gte(ts.version, '4.1.0-beta') 29 | - ? 'react-jsx' 30 | - : 'react', 31 | - reason: 'to support the new JSX transform in React 17', 32 | - }, 33 | + // jsx: { 34 | + // parsedValue: 35 | + // hasJsxRuntime && semver.gte(ts.version, '4.1.0-beta') 36 | + // ? ts.JsxEmit.ReactJSX 37 | + // : ts.JsxEmit.React, 38 | + // value: 39 | + // hasJsxRuntime && semver.gte(ts.version, '4.1.0-beta') 40 | + // ? 'react-jsx' 41 | + // : 'react', 42 | + // reason: 'to support the new JSX transform in React 17', 43 | + // }, 44 | paths: { value: undefined, reason: 'aliased imports are not supported' }, 45 | }; 46 | 47 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/src/ui/screens/PokemonDetail/_components/PokemonSummary.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Image, Platform, StyleProp, StyleSheet, View, ViewStyle } from 'react-native' 3 | import { useNavigation } from '@react-navigation/native' 4 | import { FullPokemon } from 'core/domain/model/Pokemon' 5 | import { Icon } from 'ui/components/Icon' 6 | import { Text } from 'ui/components/Text' 7 | 8 | interface Props { 9 | pokemon: FullPokemon 10 | style: StyleProp 11 | } 12 | 13 | export const PokemonSummary = ({ pokemon, style }: Props) => { 14 | const navigation = useNavigation() 15 | 16 | return ( 17 | 18 | 19 | 20 | {pokemon.name} 21 | 22 | 23 | {pokemon.types.map((type, index) => ( 24 | 25 | {type} 26 | 27 | ))} 28 | 29 | 30 | 31 | ) 32 | } 33 | 34 | const styles = StyleSheet.create({ 35 | image: { 36 | maxHeight: 500, 37 | flex: 1, 38 | aspectRatio: 1, 39 | alignSelf: Platform.OS === 'web' ? undefined : 'center', 40 | resizeMode: 'contain' 41 | }, 42 | typesContainer: { 43 | marginTop: 10, 44 | flexDirection: 'row' 45 | }, 46 | type: { 47 | borderRadius: 20, 48 | backgroundColor: 'rgba(52, 52, 52, 0.2)', 49 | marginRight: 5, 50 | paddingVertical: 7, 51 | paddingHorizontal: 15 52 | } 53 | }) 54 | 55 | const POKEMON_TYPE_COLORS: Record = { 56 | normal: '#A8A878', 57 | fighting: '#C03028', 58 | flying: '#A890F0', 59 | poison: '#A040A0', 60 | ground: '#E0C068', 61 | rock: '#B8A038', 62 | bug: '#A8B820', 63 | ghost: '#705898', 64 | steel: '#B8B8D0', 65 | fire: '#FA6C6C', 66 | water: '#6890F0', 67 | grass: '#48CFB2', 68 | electric: '#FFCE4B', 69 | psychic: '#F85888', 70 | ice: '#98D8D8', 71 | dragon: '#7038F8', 72 | dark: '#705848', 73 | fairy: '#EE99AC' 74 | } 75 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pokedex", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "mobile": "react-native start", 9 | "web": "react-scripts start", 10 | "test": "yarn test:web && yarn test:mobile", 11 | "test:web": "jest -c jest.config.web.js ", 12 | "test:mobile": "jest -c jest.config.native.js ", 13 | "lint": "eslint . --ext .js,.jsx,.ts,.tsx", 14 | "build": "react-scripts build", 15 | "postinstall": "patch-package" 16 | }, 17 | "dependencies": { 18 | "@react-navigation/native": "^6.0.4", 19 | "@react-navigation/stack": "^6.0.9", 20 | "react": "17.0.2", 21 | "react-dom": "^17.0.2", 22 | "react-native": "0.65.1", 23 | "react-native-gesture-handler": "^1.10.3", 24 | "react-native-safe-area-context": "^3.3.2", 25 | "react-native-screens": "^3.8.0", 26 | "react-router-dom": "^5.3.0", 27 | "react-scripts": "4.0.3", 28 | "styled-components": "^5.3.1" 29 | }, 30 | "devDependencies": { 31 | "@babel/core": "^7.15.5", 32 | "@babel/runtime": "^7.15.4", 33 | "@react-native-community/eslint-config": "^3.0.1", 34 | "@testing-library/react": "^12.1.2", 35 | "@testing-library/react-native": "^7.2.0", 36 | "@types/jest": "^27.0.2", 37 | "@types/node": "^16.10.3", 38 | "@types/react": "^17.0.27", 39 | "@types/react-dom": "^17.0.9", 40 | "@types/react-native": "^0.65.5", 41 | "@types/react-router-dom": "^5.3.0", 42 | "@types/react-test-renderer": "^17.0.1", 43 | "@types/styled-components": "^5.1.14", 44 | "babel-plugin-module-resolver": "^4.1.0", 45 | "eslint": "^7.32.0", 46 | "metro-react-native-babel-preset": "^0.66.2", 47 | "patch-package": "^6.4.7", 48 | "postinstall-postinstall": "^2.1.0", 49 | "react-native-codegen": "^0.0.8", 50 | "react-test-renderer": "^17.0.2", 51 | "ts-jest": "^27.0.5", 52 | "typescript": "^4.4.3", 53 | "@babel/preset-env": "^7.15.6", 54 | "@babel/preset-react": "^7.14.5" 55 | }, 56 | "resolutions": { 57 | "@types/react": "^17" 58 | }, 59 | "browserslist": { 60 | "production": [ 61 | ">0.2%", 62 | "not dead", 63 | "not op_mini all" 64 | ], 65 | "development": [ 66 | "last 1 chrome version", 67 | "last 1 firefox version", 68 | "last 1 safari version" 69 | ] 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/ios/RNWeb/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | #ifdef FB_SONARKIT_ENABLED 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import 14 | 15 | static void InitializeFlipper(UIApplication *application) { 16 | FlipperClient *client = [FlipperClient sharedClient]; 17 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; 18 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; 19 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; 20 | [client addPlugin:[FlipperKitReactPlugin new]]; 21 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; 22 | [client start]; 23 | } 24 | #endif 25 | 26 | @implementation AppDelegate 27 | 28 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 29 | { 30 | #ifdef FB_SONARKIT_ENABLED 31 | InitializeFlipper(application); 32 | #endif 33 | 34 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 35 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 36 | moduleName:@"RNWeb" 37 | initialProperties:nil]; 38 | 39 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 40 | 41 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 42 | UIViewController *rootViewController = [UIViewController new]; 43 | rootViewController.view = rootView; 44 | self.window.rootViewController = rootViewController; 45 | [self.window makeKeyAndVisible]; 46 | return YES; 47 | } 48 | 49 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 50 | { 51 | #if DEBUG 52 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 53 | #else 54 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 55 | #endif 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/ios/UIKit/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | #ifdef FB_SONARKIT_ENABLED 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import 14 | 15 | static void InitializeFlipper(UIApplication *application) { 16 | FlipperClient *client = [FlipperClient sharedClient]; 17 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; 18 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; 19 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; 20 | [client addPlugin:[FlipperKitReactPlugin new]]; 21 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; 22 | [client start]; 23 | } 24 | #endif 25 | 26 | @implementation AppDelegate 27 | 28 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 29 | { 30 | #ifdef FB_SONARKIT_ENABLED 31 | InitializeFlipper(application); 32 | #endif 33 | 34 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 35 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 36 | moduleName:@"UIKit" 37 | initialProperties:nil]; 38 | 39 | if (@available(iOS 13.0, *)) { 40 | rootView.backgroundColor = [UIColor systemBackgroundColor]; 41 | } else { 42 | rootView.backgroundColor = [UIColor whiteColor]; 43 | } 44 | 45 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 46 | UIViewController *rootViewController = [UIViewController new]; 47 | rootViewController.view = rootView; 48 | self.window.rootViewController = rootViewController; 49 | [self.window makeKeyAndVisible]; 50 | return YES; 51 | } 52 | 53 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 54 | { 55 | #if DEBUG 56 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 57 | #else 58 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 59 | #endif 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/ios/SharedCore/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | #ifdef FB_SONARKIT_ENABLED 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import 14 | 15 | static void InitializeFlipper(UIApplication *application) { 16 | FlipperClient *client = [FlipperClient sharedClient]; 17 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; 18 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; 19 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; 20 | [client addPlugin:[FlipperKitReactPlugin new]]; 21 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; 22 | [client start]; 23 | } 24 | #endif 25 | 26 | @implementation AppDelegate 27 | 28 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 29 | { 30 | #ifdef FB_SONARKIT_ENABLED 31 | InitializeFlipper(application); 32 | #endif 33 | 34 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 35 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 36 | moduleName:@"SharedCore" 37 | initialProperties:nil]; 38 | 39 | if (@available(iOS 13.0, *)) { 40 | rootView.backgroundColor = [UIColor systemBackgroundColor]; 41 | } else { 42 | rootView.backgroundColor = [UIColor whiteColor]; 43 | } 44 | 45 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 46 | UIViewController *rootViewController = [UIViewController new]; 47 | rootViewController.view = rootView; 48 | self.window.rootViewController = rootViewController; 49 | [self.window makeKeyAndVisible]; 50 | return YES; 51 | } 52 | 53 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 54 | { 55 | #if DEBUG 56 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 57 | #else 58 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 59 | #endif 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RNWeb", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "mobile": "react-native start", 9 | "web": "react-scripts start", 10 | "test": "jest", 11 | "build": "react-scripts build", 12 | "lint": "tsc && eslint '**/*.[jt]s?(x)' --cache --fix", 13 | "reset": "watchman watch-del-all; rm -rf /tmp/metro-bundler-cache-*; rm -rf ./android/build; rm -rf ./android/.gradle; rm -rf ./android/app/build; rm -rf ~/Library/Developer/Xcode/DerivedData; rm -rf /tmp/haste-map-react-native-packager-*; rm -rf ./ios/build; jest --clearCache; cd ios; pod install --repo-update; cd ..; npx jetify; cd android; ./gradlew clean; cd ..; react-native start --reset-cache", 14 | "postinstall": "patch-package" 15 | }, 16 | "dependencies": { 17 | "@react-native-community/masked-view": "^0.1.10", 18 | "@react-navigation/native": "^5.9.2", 19 | "@react-navigation/stack": "^5.14.2", 20 | "react": "^16.14.0", 21 | "react-dom": "^16.14.0", 22 | "react-native": "0.63.4", 23 | "react-native-gesture-handler": "^1.10.1", 24 | "react-native-reanimated": "^1.13.2", 25 | "react-native-safe-area-context": "^3.1.9", 26 | "react-native-screens": "^2.17.1", 27 | "react-native-web": "^0.15.0", 28 | "react-scripts": "^4.0.3", 29 | "react-native-web-hover": "^0.2.9", 30 | "styled-components": "^5.3.0" 31 | }, 32 | "devDependencies": { 33 | "@babel/core": "^7.12.17", 34 | "@babel/runtime": "^7.12.18", 35 | "@react-native-community/eslint-config": "^2.0.0", 36 | "@types/react": "^17.0.2", 37 | "@types/react-native": "^0.63.50", 38 | "@typescript-eslint/eslint-plugin": "^4.25.0", 39 | "@typescript-eslint/parser": "^4.25.0", 40 | "babel-plugin-module-resolver": "^4.0.0", 41 | "eslint-plugin-prettier": "^3.4.0", 42 | "eslint-plugin-react": "^7.23.2", 43 | "metro-react-native-babel-preset": "^0.65.1", 44 | "typescript": "^4.0.5", 45 | "patch-package": "^6.4.7", 46 | "postinstall-postinstall": "^2.1.0", 47 | "ts-jest": "^26.5.6", 48 | "babel-jest": "^26.6.3", 49 | "@testing-library/react-native": "^7.2.0", 50 | "eslint-plugin-testing-library": "^4.10.1", 51 | "eslint-plugin-jest": "^24.4.0", 52 | "@types/jest": "^26.0.20", 53 | "@types/styled-components": "^5.1.14", 54 | "@types/styled-components-react-native": "^5.1.1", 55 | "react-test-renderer": "^17.0.2" 56 | }, 57 | "browserslist": { 58 | "production": [ 59 | ">0.2%", 60 | "not dead", 61 | "not op_mini all" 62 | ], 63 | "development": [ 64 | "last 1 chrome version", 65 | "last 1 firefox version", 66 | "last 1 safari version" 67 | ] 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /shared-code-with-RNWeb/android/app/src/main/java/com/example/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.soloader.SoLoader; 11 | import java.lang.reflect.InvocationTargetException; 12 | import java.util.List; 13 | 14 | public class MainApplication extends Application implements ReactApplication { 15 | 16 | private final ReactNativeHost mReactNativeHost = 17 | new ReactNativeHost(this) { 18 | @Override 19 | public boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | @SuppressWarnings("UnnecessaryLocalVariable") 26 | List packages = new PackageList(this).getPackages(); 27 | // Packages that cannot be autolinked yet can be added manually here, for example: 28 | // packages.add(new MyReactNativePackage()); 29 | return packages; 30 | } 31 | 32 | @Override 33 | protected String getJSMainModuleName() { 34 | return "index"; 35 | } 36 | }; 37 | 38 | @Override 39 | public ReactNativeHost getReactNativeHost() { 40 | return mReactNativeHost; 41 | } 42 | 43 | @Override 44 | public void onCreate() { 45 | super.onCreate(); 46 | SoLoader.init(this, /* native exopackage */ false); 47 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 48 | } 49 | 50 | /** 51 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like 52 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 53 | * 54 | * @param context 55 | * @param reactInstanceManager 56 | */ 57 | private static void initializeFlipper( 58 | Context context, ReactInstanceManager reactInstanceManager) { 59 | if (BuildConfig.DEBUG) { 60 | try { 61 | /* 62 | We use reflection here to pick up the class that initializes Flipper, 63 | since Flipper library is not available in release mode 64 | */ 65 | Class aClass = Class.forName("com.example.ReactNativeFlipper"); 66 | aClass 67 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 68 | .invoke(null, context, reactInstanceManager); 69 | } catch (ClassNotFoundException e) { 70 | e.printStackTrace(); 71 | } catch (NoSuchMethodException e) { 72 | e.printStackTrace(); 73 | } catch (IllegalAccessException e) { 74 | e.printStackTrace(); 75 | } catch (InvocationTargetException e) { 76 | e.printStackTrace(); 77 | } 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/app/src/main/java/com/pokedex/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.pokedex; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.soloader.SoLoader; 11 | import java.lang.reflect.InvocationTargetException; 12 | import java.util.List; 13 | 14 | public class MainApplication extends Application implements ReactApplication { 15 | 16 | private final ReactNativeHost mReactNativeHost = 17 | new ReactNativeHost(this) { 18 | @Override 19 | public boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | @SuppressWarnings("UnnecessaryLocalVariable") 26 | List packages = new PackageList(this).getPackages(); 27 | // Packages that cannot be autolinked yet can be added manually here, for example: 28 | // packages.add(new MyReactNativePackage()); 29 | return packages; 30 | } 31 | 32 | @Override 33 | protected String getJSMainModuleName() { 34 | return "index"; 35 | } 36 | }; 37 | 38 | @Override 39 | public ReactNativeHost getReactNativeHost() { 40 | return mReactNativeHost; 41 | } 42 | 43 | @Override 44 | public void onCreate() { 45 | super.onCreate(); 46 | SoLoader.init(this, /* native exopackage */ false); 47 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 48 | } 49 | 50 | /** 51 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like 52 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 53 | * 54 | * @param context 55 | * @param reactInstanceManager 56 | */ 57 | private static void initializeFlipper( 58 | Context context, ReactInstanceManager reactInstanceManager) { 59 | if (BuildConfig.DEBUG) { 60 | try { 61 | /* 62 | We use reflection here to pick up the class that initializes Flipper, 63 | since Flipper library is not available in release mode 64 | */ 65 | Class aClass = Class.forName("com.pokedex.ReactNativeFlipper"); 66 | aClass 67 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 68 | .invoke(null, context, reactInstanceManager); 69 | } catch (ClassNotFoundException e) { 70 | e.printStackTrace(); 71 | } catch (NoSuchMethodException e) { 72 | e.printStackTrace(); 73 | } catch (IllegalAccessException e) { 74 | e.printStackTrace(); 75 | } catch (InvocationTargetException e) { 76 | e.printStackTrace(); 77 | } 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/app/src/main/java/com/pokedex/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.pokedex; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.soloader.SoLoader; 11 | import java.lang.reflect.InvocationTargetException; 12 | import java.util.List; 13 | 14 | public class MainApplication extends Application implements ReactApplication { 15 | 16 | private final ReactNativeHost mReactNativeHost = 17 | new ReactNativeHost(this) { 18 | @Override 19 | public boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | @SuppressWarnings("UnnecessaryLocalVariable") 26 | List packages = new PackageList(this).getPackages(); 27 | // Packages that cannot be autolinked yet can be added manually here, for example: 28 | // packages.add(new MyReactNativePackage()); 29 | return packages; 30 | } 31 | 32 | @Override 33 | protected String getJSMainModuleName() { 34 | return "index"; 35 | } 36 | }; 37 | 38 | @Override 39 | public ReactNativeHost getReactNativeHost() { 40 | return mReactNativeHost; 41 | } 42 | 43 | @Override 44 | public void onCreate() { 45 | super.onCreate(); 46 | SoLoader.init(this, /* native exopackage */ false); 47 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 48 | } 49 | 50 | /** 51 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like 52 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 53 | * 54 | * @param context 55 | * @param reactInstanceManager 56 | */ 57 | private static void initializeFlipper( 58 | Context context, ReactInstanceManager reactInstanceManager) { 59 | if (BuildConfig.DEBUG) { 60 | try { 61 | /* 62 | We use reflection here to pick up the class that initializes Flipper, 63 | since Flipper library is not available in release mode 64 | */ 65 | Class aClass = Class.forName("com.pokedex.ReactNativeFlipper"); 66 | aClass 67 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 68 | .invoke(null, context, reactInstanceManager); 69 | } catch (ClassNotFoundException e) { 70 | e.printStackTrace(); 71 | } catch (NoSuchMethodException e) { 72 | e.printStackTrace(); 73 | } catch (IllegalAccessException e) { 74 | e.printStackTrace(); 75 | } catch (InvocationTargetException e) { 76 | e.printStackTrace(); 77 | } 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /shared-code-with-uikit-bridge/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /isolated-fronts-shared-core/packages/mobile/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | --------------------------------------------------------------------------------