Skip to content

Commit

Permalink
Merge pull request #657 from gympass/CODEME-1040
Browse files Browse the repository at this point in the history
[CODEME-1113] support for react-native 0.72.x projects 💣
  • Loading branch information
matheushdsbr authored Aug 3, 2023
2 parents 1f89be9 + 2dcf21c commit 4a8dc38
Show file tree
Hide file tree
Showing 105 changed files with 11,705 additions and 8,673 deletions.
5 changes: 1 addition & 4 deletions jest/config/native.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ module.exports = {
transform: { '^.+\\.jsx?$': 'babel-jest' },
displayName: 'native',
preset: 'react-native',
setupFilesAfterEnv: [
'<rootDir>/jest/setup/native.js',
'@testing-library/jest-native/extend-expect',
],
setupFilesAfterEnv: ['<rootDir>/jest/setup/native.js'],
moduleDirectories: [
'<rootDir>/node_modules',
'<rootDir>/packages/labnative/node_modules',
Expand Down
25 changes: 25 additions & 0 deletions jest/setup/native.js
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
import '@testing-library/jest-native/extend-expect';

const frameTime = 10;

/**
* This fix came to help with the RN's jest setup requestAnimationFrame issue that
* was affecting native's components tests that relate with animations.
* At the link below we can find more detailed description.
* * https://stackoverflow.com/questions/42268673/jest-test-animated-view-for-react-native-app/51067606#51067606
*/
global.requestAnimationFrame = cb => {
setTimeout(cb, frameTime);
};

/**
* This fix was originally proposed by the package react-16-node-hanging-test-fix
* (https://npmjs.com/package/react-16-node-hanging-test-fix). Actually, the problem
* this fix solves was not supposed to be hapenning since it was first observed in
* previous versions of packages we use here (jest, node, react, etc.). However,
* it seems to be back in latest version as we can see in issues like the one below.
* The link of the original issue describing the problem follows too.
* * https://github.com/callstack/react-native-testing-library/issues/1054#issuecomment-1575660634
* * https://github.com/facebook/react/issues/20756#issuecomment-780927519
* * https://github.com/callstack/react-native-testing-library/issues/1007
*/
delete global.MessageChannel;
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"@babel/preset-env": "^7.8.4",
"@babel/preset-react": "^7.8.4",
"@babel/runtime": "^7.8.4",
"@react-native-community/eslint-config": "^3.0.1",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/jest-native": "^4.0.2",
"@testing-library/react-native": "^9.1.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react-native": "^12.1.3",
"babel-plugin-import-glob": "^2.0.0",
"babel-plugin-module-resolver": "^3.2.0",
"commitizen": "^4.0.3",
Expand All @@ -59,13 +59,14 @@
"fs-extra": "^8.1.0",
"git-last-commit": "^1.0.0",
"husky": "3.0.5",
"jest": "^27.5.1",
"jest": "^29.6.2",
"jest-environment-jsdom": "^29.6.2",
"jest-styled-components": "^6.3.3",
"lerna": "^5.0.0",
"lint-staged": "9.2.5",
"metro-react-native-babel-preset": "^0.67.0",
"prettier": "2.6.2",
"react-native": "0.68.1",
"react-dom": "^18.0.0",
"tsup": "^7.1.0",
"yargs": "^15.1.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/doc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"polished": "^3.4.2",
"prism-react-renderer": "^0.1.7",
"prop-types": "^15.7.2",
"react": "17.0.2",
"react": "18.2.0",
"react-burgers": "^1.3.0",
"react-dom": "17.0.2",
"react-dom": "18.2.0",
"react-helmet": "^5.2.1",
"react-inspector": "5.1.1",
"react-live": "^2.2.0",
Expand Down
6 changes: 0 additions & 6 deletions packages/labnative/.buckconfig

This file was deleted.

67 changes: 0 additions & 67 deletions packages/labnative/.flowconfig

This file was deleted.

23 changes: 14 additions & 9 deletions packages/labnative/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
ios/.xcode.env.local

# Android/IntelliJ
#
Expand All @@ -29,18 +30,16 @@ build/
local.properties
*.iml
*.hprof
.cxx/
*.keystore
!debug.keystore

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
Expand All @@ -49,9 +48,10 @@ buck-out/
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots
**/fastlane/report.xml
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output

# Bundle artifact
*.jsbundle
Expand All @@ -62,4 +62,9 @@ buck-out/
# Ruby / CocoaPods
/ios/Pods/
/vendor/bundle/
.ruby-version

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*

# testing
/coverage
2 changes: 1 addition & 1 deletion packages/labnative/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{}
{}
4 changes: 2 additions & 2 deletions packages/labnative/Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '2.7.4'
ruby ">= 2.6.10"

gem 'cocoapods', '~> 1.11', '>= 1.11.2'
gem 'cocoapods', '~> 1.12'
42 changes: 20 additions & 22 deletions packages/labnative/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.5)
CFPropertyList (3.0.6)
rexml
activesupport (6.1.6)
activesupport (7.0.5)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.1.0)
cocoapods (1.11.3)
cocoapods (1.12.1)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.11.3)
cocoapods-core (= 1.12.1)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.4.0, < 2.0)
cocoapods-downloader (>= 1.6.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.4.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 1.0, < 3.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.21.0, < 2.0)
cocoapods-core (1.11.3)
activesupport (>= 5.0, < 7)
cocoapods-core (1.12.1)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
Expand All @@ -54,19 +53,19 @@ GEM
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.1.10)
concurrent-ruby (1.2.2)
escape (0.0.4)
ethon (0.15.0)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.15.5)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.10.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.6.1)
minitest (5.15.0)
json (2.6.3)
minitest (5.18.0)
molinillo (0.8.0)
nanaimo (0.3.0)
nap (1.1.0)
Expand All @@ -76,25 +75,24 @@ GEM
ruby-macho (2.5.1)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.4)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.21.0)
xcodeproj (1.22.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
zeitwerk (2.5.4)

PLATFORMS
ruby

DEPENDENCIES
cocoapods (~> 1.11, >= 1.11.2)
cocoapods (~> 1.12)

RUBY VERSION
ruby 2.7.4p191

BUNDLED WITH
2.1.4
2.4.13
55 changes: 0 additions & 55 deletions packages/labnative/android/app/_BUCK

This file was deleted.

Loading

0 comments on commit 4a8dc38

Please sign in to comment.