From f4ad2e01fdbce16bdd3572e9333be48e6e7fa96a Mon Sep 17 00:00:00 2001 From: Mateusz Rostkowski Date: Tue, 30 Jan 2024 17:09:02 +0100 Subject: [PATCH 01/24] chore: add expo router lib --- app.json | 5 +- package.json | 2 + yarn.lock | 228 +++++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 220 insertions(+), 15 deletions(-) diff --git a/app.json b/app.json index ece771cb..660fdbf7 100644 --- a/app.json +++ b/app.json @@ -22,6 +22,9 @@ }, "userInterfaceStyle": "automatic", "version": "2.1.0", - "plugins": ["expo-font", "expo-localization", "expo-secure-store"] + "plugins": ["expo-font", "expo-localization", "expo-secure-store", "expo-router"], + "web": { + "bundler": "metro" + } } } diff --git a/package.json b/package.json index 0ded92dc..0ce4922f 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "eslint", "prettier" ], + "main": "expo-router/entry", "repository": { "type": "git", "url": "https://github.com/binarapps/baca-react-native-template.git" @@ -116,6 +117,7 @@ "expo-localization": "~14.8.3", "expo-network": "~5.8.0", "expo-notifications": "~0.27.5", + "expo-router": "~3.4.6", "expo-screen-orientation": "~6.4.1", "expo-secure-store": "~12.8.1", "expo-splash-screen": "~0.26.4", diff --git a/yarn.lock b/yarn.lock index b25e555a..8f3bfca9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1166,7 +1166,7 @@ resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== -"@babel/runtime@^7.0.0", "@babel/runtime@^7.18.6", "@babel/runtime@^7.20.0", "@babel/runtime@^7.22.5", "@babel/runtime@^7.23.2", "@babel/runtime@^7.8.4": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.18.6", "@babel/runtime@^7.20.0", "@babel/runtime@^7.22.5", "@babel/runtime@^7.23.2", "@babel/runtime@^7.8.4": version "7.23.9" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.9.tgz#47791a15e4603bb5f905bc0753801cf21d6345f7" integrity sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw== @@ -1601,6 +1601,11 @@ resolve-from "^5.0.0" sucrase "3.34.0" +"@expo/metro-runtime@3.1.2": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@expo/metro-runtime/-/metro-runtime-3.1.2.tgz#4cc4fe53aa8f716307f584c67db76268d38c2ed7" + integrity sha512-Wekv2AZ3HY0NG9Im8AMB1KHGyHjmALg6xekVK34724I/DLtcocLKtQEP04oI9GcAZBotAhROHH5E4ADhJAEgYg== + "@expo/osascript@^2.0.31": version "2.1.0" resolved "https://registry.yarnpkg.com/@expo/osascript/-/osascript-2.1.0.tgz#c407dfe839b5e898829d31e6accd962f91adac1c" @@ -1695,6 +1700,16 @@ resolved "https://registry.yarnpkg.com/@expo/sdk-runtime-versions/-/sdk-runtime-versions-1.0.0.tgz#d7ebd21b19f1c6b0395e50d78da4416941c57f7c" integrity sha512-Doz2bfiPndXYFPMRwPyGa1k5QaKDVpY806UJj570epIiMzWaYyCtobasyfC++qfIXVb5Ocy7r3tP9d62hAQ7IQ== +"@expo/server@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@expo/server/-/server-0.3.0.tgz#b16767999382b0f5ea88d86609a5ceabcff1388c" + integrity sha512-5oIqedpLVMnf1LGI9Xd5OOGmK3DjgH9VpuqVN4e/6DwLT05RZJMyI7ylfG6QSy1e44yOgjv242tLyg0e/zdZ+A== + dependencies: + "@remix-run/node" "^1.19.3" + abort-controller "^3.0.0" + debug "^4.3.4" + source-map-support "~0.5.21" + "@expo/spawn-async@1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@expo/spawn-async/-/spawn-async-1.5.0.tgz#799827edd8c10ef07eb1a2ff9dcfe081d596a395" @@ -2246,6 +2261,21 @@ resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== +"@radix-ui/react-compose-refs@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-compose-refs/-/react-compose-refs-1.0.0.tgz#37595b1f16ec7f228d698590e78eeed18ff218ae" + integrity sha512-0KaSv6sx787/hK3eF53iOkiSLwAGlFMx5lotrqD2pTjB18KbybKoEIgkNZTKC60YECDQTKGTRcDBILwZVqVKvA== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-slot@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-slot/-/react-slot-1.0.1.tgz#e7868c669c974d649070e9ecbec0b367ee0b4d81" + integrity sha512-avutXAFL1ehGvAXtPquu0YK5oz6ctS474iM3vNGQIkswrVhdrS52e3uoMQBzZhNRAIE0jBnUyXWNmSjGHhCFcw== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-compose-refs" "1.0.0" + "@react-native-async-storage/async-storage@1.21.0": version "1.21.0" resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.21.0.tgz#d7e370028e228ab84637016ceeb495878b7a44c8" @@ -2623,7 +2653,7 @@ invariant "^2.2.4" nullthrows "^1.1.1" -"@react-navigation/bottom-tabs@^6.5.11": +"@react-navigation/bottom-tabs@^6.5.11", "@react-navigation/bottom-tabs@~6.5.7": version "6.5.11" resolved "https://registry.yarnpkg.com/@react-navigation/bottom-tabs/-/bottom-tabs-6.5.11.tgz#b6e67a3aa19e60ed9c1139fa0253586c479832d5" integrity sha512-CBN/NOdxnMvmjw+AJQI1kltOYaClTZmGec5pQ3ZNTPX86ytbIOylDIITKMfTgHZcIEFQDymx1SHeS++PIL3Szw== @@ -2649,7 +2679,7 @@ resolved "https://registry.yarnpkg.com/@react-navigation/elements/-/elements-1.3.21.tgz#debac6becc6b6692da09ec30e705e476a780dfe1" integrity sha512-eyS2C6McNR8ihUoYfc166O1D8VYVh9KIl0UQPI8/ZJVsStlfSTgeEEh+WXge6+7SFPnZ4ewzEJdSAHH+jzcEfg== -"@react-navigation/native-stack@^6.9.17": +"@react-navigation/native-stack@^6.9.17", "@react-navigation/native-stack@~6.9.12": version "6.9.17" resolved "https://registry.yarnpkg.com/@react-navigation/native-stack/-/native-stack-6.9.17.tgz#4fc370b14be07296423ae8c00940fb002c6001b5" integrity sha512-X8p8aS7JptQq7uZZNFEvfEcPf6tlK4PyVwYDdryRbG98B4bh2wFQYMThxvqa+FGEN7USEuHdv2mF0GhFKfX0ew== @@ -2657,7 +2687,7 @@ "@react-navigation/elements" "^1.3.21" warn-once "^0.1.0" -"@react-navigation/native@^6.1.9": +"@react-navigation/native@^6.1.9", "@react-navigation/native@~6.1.6": version "6.1.9" resolved "https://registry.yarnpkg.com/@react-navigation/native/-/native-6.1.9.tgz#8ef87095cd9c2ed094308c726157c7f6fc28796e" integrity sha512-AMuJDpwXE7UlfyhIXaUCCynXmv69Kb8NzKgKJO7v0k0L+u6xUTbt6xvshmJ79vsvaFyaEH9Jg5FMzek5/S5qNw== @@ -2683,6 +2713,81 @@ color "^4.2.3" warn-once "^0.1.0" +"@remix-run/node@^1.19.3": + version "1.19.3" + resolved "https://registry.yarnpkg.com/@remix-run/node/-/node-1.19.3.tgz#d27e2f742fc45379525cb3fca466a883ca06d6c9" + integrity sha512-z5qrVL65xLXIUpU4mkR4MKlMeKARLepgHAk4W5YY3IBXOreRqOGUC70POViYmY7x38c2Ia1NwqL80H+0h7jbMw== + dependencies: + "@remix-run/server-runtime" "1.19.3" + "@remix-run/web-fetch" "^4.3.6" + "@remix-run/web-file" "^3.0.3" + "@remix-run/web-stream" "^1.0.4" + "@web3-storage/multipart-parser" "^1.0.0" + abort-controller "^3.0.0" + cookie-signature "^1.1.0" + source-map-support "^0.5.21" + stream-slice "^0.1.2" + +"@remix-run/router@1.7.2": + version "1.7.2" + resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.7.2.tgz#cba1cf0a04bc04cb66027c51fa600e9cbc388bc8" + integrity sha512-7Lcn7IqGMV+vizMPoEl5F0XDshcdDYtMI6uJLQdQz5CfZAwy3vvGKYSUk789qndt5dEC4HfSjviSYlSoHGL2+A== + +"@remix-run/server-runtime@1.19.3": + version "1.19.3" + resolved "https://registry.yarnpkg.com/@remix-run/server-runtime/-/server-runtime-1.19.3.tgz#206b55337c266c5bc254878f8ff3cd5677cc60fb" + integrity sha512-KzQ+htUsKqpBgKE2tWo7kIIGy3MyHP58Io/itUPvV+weDjApwr9tQr9PZDPA3yAY6rAzLax7BU0NMSYCXWFY5A== + dependencies: + "@remix-run/router" "1.7.2" + "@types/cookie" "^0.4.1" + "@web3-storage/multipart-parser" "^1.0.0" + cookie "^0.4.1" + set-cookie-parser "^2.4.8" + source-map "^0.7.3" + +"@remix-run/web-blob@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@remix-run/web-blob/-/web-blob-3.1.0.tgz#e0c669934c1eb6028960047e57a13ed38bbfb434" + integrity sha512-owGzFLbqPH9PlKb8KvpNJ0NO74HWE2euAn61eEiyCXX/oteoVzTVSN8mpLgDjaxBf2btj5/nUllSUgpyd6IH6g== + dependencies: + "@remix-run/web-stream" "^1.1.0" + web-encoding "1.1.5" + +"@remix-run/web-fetch@^4.3.6": + version "4.4.2" + resolved "https://registry.yarnpkg.com/@remix-run/web-fetch/-/web-fetch-4.4.2.tgz#ce7aedef72cc26e15060e8cf84674029f92809b6" + integrity sha512-jgKfzA713/4kAW/oZ4bC3MoLWyjModOVDjFPNseVqcJKSafgIscrYL9G50SurEYLswPuoU3HzSbO0jQCMYWHhA== + dependencies: + "@remix-run/web-blob" "^3.1.0" + "@remix-run/web-file" "^3.1.0" + "@remix-run/web-form-data" "^3.1.0" + "@remix-run/web-stream" "^1.1.0" + "@web3-storage/multipart-parser" "^1.0.0" + abort-controller "^3.0.0" + data-uri-to-buffer "^3.0.1" + mrmime "^1.0.0" + +"@remix-run/web-file@^3.0.3", "@remix-run/web-file@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@remix-run/web-file/-/web-file-3.1.0.tgz#07219021a2910e90231bc30ca1ce693d0e9d3825" + integrity sha512-dW2MNGwoiEYhlspOAXFBasmLeYshyAyhIdrlXBi06Duex5tDr3ut2LFKVj7tyHLmn8nnNwFf1BjNbkQpygC2aQ== + dependencies: + "@remix-run/web-blob" "^3.1.0" + +"@remix-run/web-form-data@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@remix-run/web-form-data/-/web-form-data-3.1.0.tgz#47f9ad8ce8bf1c39ed83eab31e53967fe8e3df6a" + integrity sha512-NdeohLMdrb+pHxMQ/Geuzdp0eqPbea+Ieo8M8Jx2lGC6TBHsgHzYcBvr0LyPdPVycNRDEpWpiDdCOdCryo3f9A== + dependencies: + web-encoding "1.1.5" + +"@remix-run/web-stream@^1.0.4", "@remix-run/web-stream@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@remix-run/web-stream/-/web-stream-1.1.0.tgz#b93a8f806c2c22204930837c44d81fdedfde079f" + integrity sha512-KRJtwrjRV5Bb+pM7zxcTJkhIqWWSy+MYsIxHK+0m5atcznsf15YwUBWHWulZerV2+vvHH1Lp1DD7pw6qKW8SgA== + dependencies: + web-streams-polyfill "^3.1.1" + "@segment/loosely-validate-event@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@segment/loosely-validate-event/-/loosely-validate-event-2.0.0.tgz#87dfc979e5b4e7b82c5f1d8b722dfd5d77644681" @@ -2833,6 +2938,11 @@ dependencies: "@types/node" "*" +"@types/cookie@^0.4.1": + version "0.4.1" + resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.4.1.tgz#bfd02c1f2224567676c1545199f87c3a861d878d" + integrity sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q== + "@types/eslint-scope@^3.7.3": version "3.7.7" resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" @@ -3306,6 +3416,11 @@ "@urql/core" ">=2.3.1" wonka "^4.0.14" +"@web3-storage/multipart-parser@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@web3-storage/multipart-parser/-/multipart-parser-1.0.0.tgz#6b69dc2a32a5b207ba43e556c25cc136a56659c4" + integrity sha512-BEO6al7BYqcnfX15W2cnGR+Q566ACXAT9UQykORCWW80lmkpWsnEob6zJS1ZVBKsSJC8+7vJkHwlp+lXG1UCdw== + "@webassemblyjs/ast@1.11.6", "@webassemblyjs/ast@^1.11.5": version "1.11.6" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.6.tgz#db046555d3c413f8966ca50a95176a0e2c642e24" @@ -3459,6 +3574,11 @@ resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== +"@zxing/text-encoding@0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@zxing/text-encoding/-/text-encoding-0.9.0.tgz#fb50ffabc6c7c66a0c96b4c03e3d9be74864b70b" + integrity sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA== + abab@^2.0.5, abab@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" @@ -4757,11 +4877,21 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== +cookie-signature@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.2.1.tgz#790dea2cce64638c7ae04d9fabed193bd7ccf3b4" + integrity sha512-78KWk9T26NhzXtuL26cIJ8/qNHANyJ/ZYrmEXFzUmhZdjpBv+DlWlOANRTGBt48YcyslsLrj0bMLFTmXvLRCOw== + cookie@0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== +cookie@^0.4.1: + version "0.4.2" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" + integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== + copy-webpack-plugin@^10.2.0: version "10.2.4" resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-10.2.4.tgz#6c854be3fdaae22025da34b9112ccf81c63308fe" @@ -5019,6 +5149,11 @@ dag-map@~1.0.0: resolved "https://registry.yarnpkg.com/dag-map/-/dag-map-1.0.2.tgz#e8379f041000ed561fc515475c1ed2c85eece8d7" integrity sha512-+LSAiGFwQ9dRnRdOeaj7g47ZFJcOUPukAP8J3A3fuZ1g9Y44BG+P1sgApjLXTQPOzC4+7S9Wr8kXsfpINM4jpw== +data-uri-to-buffer@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz#594b8973938c5bc2c33046535785341abc4f3636" + integrity sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og== + data-urls@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-3.0.2.tgz#9cf24a477ae22bcef5cd5f6f0bfbc1d2d3be9143" @@ -6109,6 +6244,21 @@ expo-pwa@0.0.127: commander "2.20.0" update-check "1.5.3" +expo-router@~3.4.6: + version "3.4.6" + resolved "https://registry.yarnpkg.com/expo-router/-/expo-router-3.4.6.tgz#ef0c8b06e7e0e370ca8d0a1c4564996f788feb38" + integrity sha512-yxl0QE4KAqLmLyH8AxWsGSV3M34jsAE8X75cOB2oaK0+Pu9VHSUf6w3iRi93IiJ0rOUXm8jKrjhfhZOrrNh7EA== + dependencies: + "@expo/metro-runtime" "3.1.2" + "@expo/server" "^0.3.0" + "@radix-ui/react-slot" "1.0.1" + "@react-navigation/bottom-tabs" "~6.5.7" + "@react-navigation/native" "~6.1.6" + "@react-navigation/native-stack" "~6.9.12" + expo-splash-screen "0.26.4" + react-helmet-async "^1.3.0" + schema-utils "^4.0.1" + expo-screen-orientation@~6.4.1: version "6.4.1" resolved "https://registry.yarnpkg.com/expo-screen-orientation/-/expo-screen-orientation-6.4.1.tgz#1c4428a058921e48b5caa45367e626b8bec10e24" @@ -6119,6 +6269,13 @@ expo-secure-store@~12.8.1: resolved "https://registry.yarnpkg.com/expo-secure-store/-/expo-secure-store-12.8.1.tgz#369a570702fa1dc0c49ea41a5ab18aca2a986d38" integrity sha512-Ju3jmkHby4w7rIzdYAt9kQyQ7HhHJ0qRaiQOInknhOLIltftHjEgF4I1UmzKc7P5RCfGNmVbEH729Pncp/sHXQ== +expo-splash-screen@0.26.4, expo-splash-screen@~0.26.4: + version "0.26.4" + resolved "https://registry.yarnpkg.com/expo-splash-screen/-/expo-splash-screen-0.26.4.tgz#bc1fb226c6eae03ee351a3ebe5521a37f868cbc7" + integrity sha512-2DwofTQ0FFQCsvDysm/msENsbyNsJiAJwK3qK/oXeizECAPqD7bK19J4z9kuEbr7ORPX9MLnTQYKl6kmX3keUg== + dependencies: + "@expo/prebuild-config" "6.7.4" + expo-splash-screen@~0.17.0: version "0.17.5" resolved "https://registry.yarnpkg.com/expo-splash-screen/-/expo-splash-screen-0.17.5.tgz#a18dc59c1cc28ebbedbf0a7529a419d18ab0b311" @@ -6127,13 +6284,6 @@ expo-splash-screen@~0.17.0: "@expo/configure-splash-screen" "^0.6.0" "@expo/prebuild-config" "5.0.7" -expo-splash-screen@~0.26.4: - version "0.26.4" - resolved "https://registry.yarnpkg.com/expo-splash-screen/-/expo-splash-screen-0.26.4.tgz#bc1fb226c6eae03ee351a3ebe5521a37f868cbc7" - integrity sha512-2DwofTQ0FFQCsvDysm/msENsbyNsJiAJwK3qK/oXeizECAPqD7bK19J4z9kuEbr7ORPX9MLnTQYKl6kmX3keUg== - dependencies: - "@expo/prebuild-config" "6.7.4" - expo-status-bar@~1.11.1: version "1.11.1" resolved "https://registry.yarnpkg.com/expo-status-bar/-/expo-status-bar-1.11.1.tgz#a11318741d361048c11db2b16c4364a79a74af30" @@ -9145,6 +9295,11 @@ mri@^1.2.0: resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== +mrmime@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-1.0.1.tgz#5f90c825fad4bdd41dc914eff5d1a8cfdaf24f27" + integrity sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw== + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -10457,11 +10612,27 @@ react-error-overlay@6.0.9: resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.9.tgz#3c743010c9359608c375ecd6bc76f35d93995b0a" integrity sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew== +react-fast-compare@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.2.tgz#929a97a532304ce9fee4bcae44234f1ce2c21d49" + integrity sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ== + react-freeze@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/react-freeze/-/react-freeze-1.0.3.tgz#5e3ca90e682fed1d73a7cb50c2c7402b3e85618d" integrity sha512-ZnXwLQnGzrDpHBHiC56TXFXvmolPeMjTn1UOm610M4EXGzbEDR7oOIyS2ZiItgbs6eZc4oU/a0hpk8PrcKvv5g== +react-helmet-async@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/react-helmet-async/-/react-helmet-async-1.3.0.tgz#7bd5bf8c5c69ea9f02f6083f14ce33ef545c222e" + integrity sha512-9jZ57/dAn9t3q6hneQS0wukqC2ENOBgMNVEhb/ZG9ZSxUetzVIw4iAmEU38IaVg3QGYauQPhSeUTuIUtFglWpg== + dependencies: + "@babel/runtime" "^7.12.5" + invariant "^2.2.4" + prop-types "^15.7.2" + react-fast-compare "^3.2.0" + shallowequal "^1.1.0" + react-hook-form@^7.49.3: version "7.49.3" resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.49.3.tgz#576a4567f8a774830812f4855e89f5da5830435c" @@ -11088,7 +11259,7 @@ schema-utils@^3.1.1, schema-utils@^3.2.0: ajv "^6.12.5" ajv-keywords "^3.5.2" -schema-utils@^4.0.0: +schema-utils@^4.0.0, schema-utils@^4.0.1: version "4.2.0" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.2.0.tgz#70d7c93e153a273a805801882ebd3bff20d89c8b" integrity sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw== @@ -11210,6 +11381,11 @@ set-blocking@^2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== +set-cookie-parser@^2.4.8: + version "2.6.0" + resolved "https://registry.yarnpkg.com/set-cookie-parser/-/set-cookie-parser-2.6.0.tgz#131921e50f62ff1a66a461d7d62d7b21d5d15a51" + integrity sha512-RVnVQxTXuerk653XfuliOxBP81Sf0+qfQE73LIYKcyMYHG94AuH0kgrQpRDuTZnSmjpysHmzxJXKNfa6PjFhyQ== + set-function-length@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.0.tgz#2f81dc6c16c7059bda5ab7c82c11f03a515ed8e1" @@ -11252,6 +11428,11 @@ shallow-clone@^3.0.0: dependencies: kind-of "^6.0.2" +shallowequal@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8" + integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ== + shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -11406,7 +11587,7 @@ source-map-support@0.5.13: buffer-from "^1.0.0" source-map "^0.6.0" -source-map-support@^0.5.16, source-map-support@~0.5.20, source-map-support@~0.5.21: +source-map-support@^0.5.16, source-map-support@^0.5.21, source-map-support@~0.5.20, source-map-support@~0.5.21: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== @@ -11544,6 +11725,11 @@ stream-buffers@2.2.x: resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4" integrity sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg== +stream-slice@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/stream-slice/-/stream-slice-0.1.2.tgz#2dc4f4e1b936fb13f3eb39a2def1932798d07a4b" + integrity sha512-QzQxpoacatkreL6jsxnVb7X5R/pGw9OUv2qWTYWnmLpg4NdN31snPy/f3TdQE1ZUXaThRvj1Zw4/OGg0ZkaLMA== + strict-uri-encode@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" @@ -12352,7 +12538,7 @@ util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -util@^0.12.5: +util@^0.12.3, util@^0.12.5: version "0.12.5" resolved "https://registry.yarnpkg.com/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" integrity sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA== @@ -12460,6 +12646,20 @@ wcwidth@^1.0.1: dependencies: defaults "^1.0.3" +web-encoding@1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/web-encoding/-/web-encoding-1.1.5.tgz#fc810cf7667364a6335c939913f5051d3e0c4864" + integrity sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA== + dependencies: + util "^0.12.3" + optionalDependencies: + "@zxing/text-encoding" "0.9.0" + +web-streams-polyfill@^3.1.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.3.2.tgz#32e26522e05128203a7de59519be3c648004343b" + integrity sha512-3pRGuxRF5gpuZc0W+EpwQRmCD7gRqcDOMt688KmdlDAgAyaB1XlN0zq2njfDNm44XVdIouE7pZ6GzbdyH47uIQ== + webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" From b36366a2df438b8704b49d08838d121ff3c202d9 Mon Sep 17 00:00:00 2001 From: Mateusz Rostkowski Date: Tue, 30 Jan 2024 17:09:21 +0100 Subject: [PATCH 02/24] fix: improve i18n types --- src/types/i18next.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/types/i18next.d.ts b/src/types/i18next.d.ts index 8819e31b..ae30cf94 100644 --- a/src/types/i18next.d.ts +++ b/src/types/i18next.d.ts @@ -1,7 +1,14 @@ import 'i18next' +import english from '~i18n/translations/en.json' + +type EN = typeof english declare module 'i18next' { interface CustomTypeOptions { + defaultNS: 'en' returnNull: false + resources: { + en: EN + } } } From 934281d1f9535c7dc3cee1a464a49e82ffbbcbc9 Mon Sep 17 00:00:00 2001 From: Mateusz Rostkowski Date: Tue, 30 Jan 2024 17:12:34 +0100 Subject: [PATCH 03/24] feat: experimental expo router support --- App.tsx | 17 +- app/(tabs)/_layout.tsx | 41 ++++ app/(tabs)/example/_layout.tsx | 5 + app/(tabs)/example/colors.tsx | 31 +++ app/(tabs)/example/components.tsx | 97 ++++++++++ app/(tabs)/example/data-from-be.tsx | 45 +++++ app/(tabs)/example/index.tsx | 47 +++++ app/(tabs)/example/settings.tsx | 45 +++++ app/(tabs)/example/test-form.tsx | 208 +++++++++++++++++++++ app/(tabs)/example/typography.tsx | 68 +++++++ app/(tabs)/home/_layout.tsx | 5 + app/(tabs)/home/details.tsx | 40 ++++ app/(tabs)/home/index.tsx | 46 +++++ app/(tabs)/two.tsx | 10 + app/+html.tsx | 46 +++++ app/[...unmatched].tsx | 19 ++ app/_layout.tsx | 41 ++++ app/modal.tsx | 14 ++ app/sign-in.tsx | 127 +++++++++++++ app/sign-up.tsx | 102 ++++++++++ src/components/AppLoading.tsx | 5 +- src/components/LanguagePicker.tsx | 4 +- src/hooks/navigation/index.ts | 1 + src/hooks/navigation/useNavigationTheme.ts | 3 + src/hooks/navigation/useScreenOptions.ts | 10 + 25 files changed, 1062 insertions(+), 15 deletions(-) create mode 100644 app/(tabs)/_layout.tsx create mode 100644 app/(tabs)/example/_layout.tsx create mode 100644 app/(tabs)/example/colors.tsx create mode 100644 app/(tabs)/example/components.tsx create mode 100644 app/(tabs)/example/data-from-be.tsx create mode 100644 app/(tabs)/example/index.tsx create mode 100644 app/(tabs)/example/settings.tsx create mode 100644 app/(tabs)/example/test-form.tsx create mode 100644 app/(tabs)/example/typography.tsx create mode 100644 app/(tabs)/home/_layout.tsx create mode 100644 app/(tabs)/home/details.tsx create mode 100644 app/(tabs)/home/index.tsx create mode 100644 app/(tabs)/two.tsx create mode 100644 app/+html.tsx create mode 100644 app/[...unmatched].tsx create mode 100644 app/_layout.tsx create mode 100644 app/modal.tsx create mode 100644 app/sign-in.tsx create mode 100644 app/sign-up.tsx create mode 100644 src/hooks/navigation/useScreenOptions.ts diff --git a/App.tsx b/App.tsx index d7211dba..e22bc10e 100644 --- a/App.tsx +++ b/App.tsx @@ -1,12 +1,15 @@ // FIXME: see how why did you render works // import './wdyr' + +// This is added to support web for reaniamted: https://github.com/software-mansion/react-native-reanimated/issues/4140#issuecomment-1455209588 import 'setimmediate' import 'react-native-reanimated' + +// Rest imports import '~i18n' import * as Device from 'expo-device' +import 'expo-router/entry' -import { Navigation } from '~navigation' -import { Providers } from '~providers' import { enableAndroidBackgroundNotificationListener, startMockedServer } from '~services' // FIXME: there is some issue with miragejs that causes console.log to not work @@ -27,13 +30,3 @@ if (DISABLE_CONSOLE_ENABLE_MOCKED_SERVER) { if (Device.isDevice) { enableAndroidBackgroundNotificationListener() } - -const App = (): JSX.Element => { - return ( - - - - ) -} - -export default App diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx new file mode 100644 index 00000000..fa8c47fa --- /dev/null +++ b/app/(tabs)/_layout.tsx @@ -0,0 +1,41 @@ +import { Tabs } from 'expo-router' + +import { Icon } from '~components' +import { useNavigationTheme } from '~hooks' +import { IconNames } from '~types/icon' + +export const unstable_settings = { + initialRouteName: 'home', +} + +function TabBarIcon(props: { name: IconNames; color: ColorNames }) { + return +} + +export default function TabLayout() { + const { tabBarTheme } = useNavigationTheme() + + return ( + null, + }} + > + , + }} + /> + , + }} + /> + + ) +} diff --git a/app/(tabs)/example/_layout.tsx b/app/(tabs)/example/_layout.tsx new file mode 100644 index 00000000..a13fa3ad --- /dev/null +++ b/app/(tabs)/example/_layout.tsx @@ -0,0 +1,5 @@ +import { Stack } from 'expo-router' + +export default function DynamicLayout() { + return +} diff --git a/app/(tabs)/example/colors.tsx b/app/(tabs)/example/colors.tsx new file mode 100644 index 00000000..109ed368 --- /dev/null +++ b/app/(tabs)/example/colors.tsx @@ -0,0 +1,31 @@ +import { Text, Center, ScrollView } from '~components' + +const colorsVariants: NestedKeys[] = [ + 'primary', + 'secondary', + 'tertiary', + 'danger', + 'success', + 'warning', + 'info', + 'light', +] + +const ColorsScreen = (): JSX.Element => ( + + {colorsVariants.map((colorVariant) => ( +
+ {colorVariant} +
+ ))} +
+) + +export default ColorsScreen diff --git a/app/(tabs)/example/components.tsx b/app/(tabs)/example/components.tsx new file mode 100644 index 00000000..309187b9 --- /dev/null +++ b/app/(tabs)/example/components.tsx @@ -0,0 +1,97 @@ +import * as Linking from 'expo-linking' + +import { Icon, Loader, Box, Text, Button, Center, ScrollView } from '~components' +import { useCallback, useNotifications, useTranslation } from '~hooks' + +const headingSizes = ['xs', 'sm', 'md', 'lg', '2xl', '3xl', '4xl'] as const +const loaderVariants = [ + { + type: 'circle', + headerText: 'components_screen.loader_variants.circle', + }, + { + type: 'bubbles', + headerText: 'components_screen.loader_variants.bubbles', + }, + { + type: 'bricks', + headerText: 'components_screen.loader_variants.bricks', + }, + { + type: 'disk', + headerText: 'components_screen.loader_variants.disk', + }, + { + type: 'default', + headerText: 'components_screen.loader_variants.default', + }, +] as const + +const ComponentsScreen = (): JSX.Element => { + const { notify } = useNotifications() + const { t } = useTranslation() + const testNotification = useCallback( + () => + notify('info', { + params: { + title: t('components_screen.notification.title'), + description: t('components_screen.notification.description'), + onPress: () => { + Linking.openURL('https://thewidlarzgroup.github.io/react-native-notificated/') + }, + }, + }), + [notify, t] + ) + + return ( + + + {t('components_screen.test_notification')} + + + + {t('components_screen.typography.label')} + + {headingSizes.map((size) => ( + + {t(`components_screen.typography.${size}`)} + + ))} + + {t('components_screen.button_variants.header')} + + + } + rightIcon={} + title={t('components_screen.button_variants.with_icons')} + /> + + + + + + + + + + + + + + ) +} + +export default ExamplesScreen diff --git a/app/(tabs)/example/settings.tsx b/app/(tabs)/example/settings.tsx new file mode 100644 index 00000000..545ce3b5 --- /dev/null +++ b/app/(tabs)/example/settings.tsx @@ -0,0 +1,45 @@ +import { Version, Spacer, Button, Center, Text, ScrollView } from '~components' +import { colorSchemesList } from '~constants' +import { useColorScheme } from '~contexts' +import { useAuth, useCallback, useTranslation } from '~hooks' +import { noop } from '~utils' + +const SettingsScreen = (): JSX.Element => { + const { t } = useTranslation() + const { setColorSchemeSetting, colorSchemeSetting } = useColorScheme() + const { signOut } = useAuth() + + const handleColorSchemeSettingChange = useCallback( + (scheme: typeof colorSchemeSetting) => () => { + setColorSchemeSetting(scheme) + }, + [setColorSchemeSetting] + ) + + return ( + +
+ + {t('settings_screen.current_theme', { theme: colorSchemeSetting })} + + {colorSchemesList.map((scheme) => { + const isSelected = scheme === colorSchemeSetting + + return ( + + ) + })} + + + {t('settings_screen.sign_out')} + + + +
+
+ ) +} + +export default SettingsScreen diff --git a/app/(tabs)/example/test-form.tsx b/app/(tabs)/example/test-form.tsx new file mode 100644 index 00000000..b5c0ae4e --- /dev/null +++ b/app/(tabs)/example/test-form.tsx @@ -0,0 +1,208 @@ +import { Controller } from 'react-hook-form' +import { StyleSheet } from 'react-native' + +import { ControlledField, KeyboardAwareScrollView, TextArea, Button, Text } from '~components' +import { useMemo, useTestForm, useTranslation } from '~hooks' + +const shoeSizes = [ + '34', + '35', + '36', + '37', + '38', + '39', + '40', + '41', + '42', + '43', + '44', + '45', + '46', + '47', +] +const AGES = ['18-30', '31-40', '41-50', '51-60', '61-70', '71-80', '81-90', '91-100'] +const MUSICS = ['Metal', 'Heavy Metal', 'Rock', 'Pop', 'Rap'] + +const TestFormScreen = (): JSX.Element => { + const { t } = useTranslation() + const { control, errors, submit, VALIDATION, setFocus } = useTestForm() + + const INTERESTS = useMemo( + () => [ + 'IT', + t('test_form.cooking'), + t('test_form.sport'), + t('test_form.games'), + t('test_form.dancing'), + ], + [t] + ) + + const education = useMemo( + () => + [ + t('test_form.primary'), + t('test_form.middle'), + t('test_form.secondary'), + t('test_form.postsecondary'), + ]?.map((item) => ({ + value: item, + label: item, + labelInDropdown: item, + })), + [t] + ) + + const mappedShoeSizes = useMemo( + () => + shoeSizes?.map((item) => ({ + value: item, + label: item, + labelInDropdown: item, + })), + [] + ) + + return ( + + + {t('test_form.contact_data')} + + + + + + + + + + + + + + + {t('test_form.additiona_comment')} + + ( +