From 3e5085ee46fd788a21b590a7f230092bab7f928d Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Thu, 12 Dec 2019 15:55:00 +0100 Subject: [PATCH] feat: upgrade project and add example BREAKING CHANGE: Migrate to React Navigation 4.x --- packages/animated-switch/.eslintrc | 21 +- .../{release-it.json => .release-it.json} | 0 packages/animated-switch/commitlint.config.js | 2 - packages/animated-switch/example/.DS_Store | Bin 0 -> 6148 bytes packages/animated-switch/example/.eslintrc | 7 + packages/animated-switch/example/.gitignore | 3 + packages/animated-switch/example/App.js | 1 + packages/animated-switch/example/app.json | 27 + .../animated-switch/example/babel.config.js | 13 + .../animated-switch/example/metro.config.js | 46 + packages/animated-switch/example/package.json | 31 + .../animated-switch/example/src/index.tsx | 61 + packages/animated-switch/example/yarn.lock | 13066 ++++++++++++++++ packages/animated-switch/package.json | 44 +- packages/animated-switch/src/index.tsx | 103 +- packages/animated-switch/tsconfig.json | 7 +- packages/animated-switch/yarn.lock | 1566 +- 17 files changed, 14169 insertions(+), 829 deletions(-) rename packages/animated-switch/{release-it.json => .release-it.json} (100%) create mode 100644 packages/animated-switch/example/.DS_Store create mode 100644 packages/animated-switch/example/.eslintrc create mode 100644 packages/animated-switch/example/.gitignore create mode 100644 packages/animated-switch/example/App.js create mode 100644 packages/animated-switch/example/app.json create mode 100644 packages/animated-switch/example/babel.config.js create mode 100644 packages/animated-switch/example/metro.config.js create mode 100644 packages/animated-switch/example/package.json create mode 100644 packages/animated-switch/example/src/index.tsx create mode 100644 packages/animated-switch/example/yarn.lock diff --git a/packages/animated-switch/.eslintrc b/packages/animated-switch/.eslintrc index abaa2ce6..f9167c70 100644 --- a/packages/animated-switch/.eslintrc +++ b/packages/animated-switch/.eslintrc @@ -1,22 +1,3 @@ { - "extends": "eslint-config-satya164", - - "plugins": ["react-native-globals"], - - "settings": { - "react": { - "version": "detect" - } - }, - - "env": { - "es6": true, - "react-native-globals/all": true - }, - - "rules": { - "import/no-unresolved": "off", - "react/sort-comp": "off", - "jest/no-disabled-tests": "off" - } + "extends": "eslint-config-satya164" } diff --git a/packages/animated-switch/release-it.json b/packages/animated-switch/.release-it.json similarity index 100% rename from packages/animated-switch/release-it.json rename to packages/animated-switch/.release-it.json diff --git a/packages/animated-switch/commitlint.config.js b/packages/animated-switch/commitlint.config.js index cc8383f7..84dcb122 100644 --- a/packages/animated-switch/commitlint.config.js +++ b/packages/animated-switch/commitlint.config.js @@ -1,5 +1,3 @@ -/* eslint-disable import/no-commonjs */ - module.exports = { extends: ['@commitlint/config-conventional'], }; diff --git a/packages/animated-switch/example/.DS_Store b/packages/animated-switch/example/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..d6a9f41dd3166fcbc888b6a12745e2d124154f53 GIT binary patch literal 6148 zcmeH~&o2W(6vy9COpEA2!f`HcJ(QvxB%9*kCRyQt)NZz6leHt=t%g4Y512$%Q3aCu2kwW5k zlPf=x{=jV8VF_3Q|BV2ByOZESf=>(jzuy=CDhiXdT76|>?jL)&3VrC!)2>}9V!lm*$5Mk@{X7>EoFcz|Gt-eta^-W^2QL7<~wdw$i z2c7g#7Q||3zF)ZLrEEQ-1kC5cr$;nDo0cVD3H+P@?GFMAsbe(Ps%R7hca`;U^*Q8g_-9V&9&-qVCM3{%$u3Hp)mD!Twkc^z#Of% zwgfDJegfmVS*G)UcliCkKghN$0ZU+{2(ZGAyVJmw%-K4S9G$fS%NZ6jnwM);Ay}E? hSUGeQFJe)KV}cx1$7rq { + acc[name] = path.join(__dirname, 'node_modules', name); + return acc; + }, {}), + }, + + transformer: { + getTransformOptions: async () => ({ + transform: { + experimentalImportSupport: false, + inlineRequires: true, + }, + }), + }, +}; diff --git a/packages/animated-switch/example/package.json b/packages/animated-switch/example/package.json new file mode 100644 index 00000000..1b065a59 --- /dev/null +++ b/packages/animated-switch/example/package.json @@ -0,0 +1,31 @@ +{ + "name": "reanimated-switch-example", + "version": "0.0.1", + "description": "Example for Reanimated Switch Navigator", + "author": "", + "private": true, + "scripts": { + "start": "expo start", + "android": "expo android", + "ios": "expo ios" + }, + "main": "node_modules/expo/AppEntry.js", + "dependencies": { + "expo": "^36.0.0", + "expo-keep-awake": "~8.0.0", + "react": "16.9.0", + "react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz", + "react-native-gesture-handler": "~1.5.0", + "react-native-reanimated": "~1.4.0", + "react-navigation": "^4.0.10" + }, + "devDependencies": { + "babel-plugin-module-resolver": "^4.0.0", + "babel-preset-expo": "^8.0.0", + "escape-string-regexp": "^2.0.0", + "expo-cli": "^3.11.1" + }, + "resolutions": { + "**/react": "16.9.0" + } +} diff --git a/packages/animated-switch/example/src/index.tsx b/packages/animated-switch/example/src/index.tsx new file mode 100644 index 00000000..144db297 --- /dev/null +++ b/packages/animated-switch/example/src/index.tsx @@ -0,0 +1,61 @@ +import * as React from 'react'; +import { Text, View, Button, StyleSheet } from 'react-native'; +import { createAppContainer } from 'react-navigation'; +import createAnimatedSwitchNavigator, { + NavigationAnimatedSwitchProp, +} from 'react-navigation-animated-switch'; +import { Transition } from 'react-native-reanimated'; + +function Home({ navigation }: { navigation: NavigationAnimatedSwitchProp }) { + return ( + + Home screen +