Skip to content

Commit 5220303

Browse files
wojteg1337michalchudziak
authored andcommitted
[REFACTOR] Workspace repo setup (#121)
* WIP: Workspace setup * fix: move scripts to root
1 parent ae81c16 commit 5220303

37 files changed

+1223
-795
lines changed

.circleci/config.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ jobs:
2626
- run:
2727
name: Jest
2828
command: yarn run test:jest
29-
- run:
30-
name: Build Android JavaScript Bundle
31-
command: yarn run test:detox:android:bundle:release
32-
- run:
33-
name: Build iOS JavaScript Bundle
34-
command: yarn run test:detox:ios:bundle:release
29+
# TODO: Uncomment after fixing detox setup
30+
# - run:
31+
# name: Build Android JavaScript Bundle
32+
# command: yarn run test:detox:android:bundle:release
33+
# - run:
34+
# name: Build iOS JavaScript Bundle
35+
# command: yarn run test:detox:ios:bundle:release
3536

3637
# To be uncommented as a part of https://github.com/react-native-community/react-native-slider/issues/34
3738
# publish:

.flowconfig

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55
; Ignore "BUCK" generated dirs
66
<PROJECT_ROOT>/\.buckd/
77

8-
; Ignore unexpected extra "@providesModule"
9-
.*/node_modules/.*/node_modules/fbjs/.*
10-
11-
; Ignore duplicate module providers
12-
; For RN Apps installed via npm, "Libraries" folder is inside
13-
; "node_modules/react-native" but in the source repo it is in the root
14-
node_modules/react-native/Libraries/react-native/React.js
15-
168
; Ignore polyfills
179
node_modules/react-native/Libraries/polyfills/.*
1810

@@ -21,7 +13,7 @@ node_modules/react-native/Libraries/polyfills/.*
2113
node_modules/warning/.*
2214

2315
; Flow doesn't support platforms
24-
.*/Libraries/Utilities/HMRLoadingView.js
16+
.*/Libraries/Utilities/LoadingView.js
2517

2618
[untyped]
2719
.*/node_modules/@react-native-community/cli/.*/.*
@@ -42,28 +34,11 @@ module.file_ext=.js
4234
module.file_ext=.json
4335
module.file_ext=.ios.js
4436

45-
module.system=haste
46-
module.system.haste.use_name_reducers=true
47-
# get basename
48-
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
49-
# strip .js or .js.flow suffix
50-
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
51-
# strip .ios suffix
52-
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
53-
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
54-
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
55-
module.system.haste.paths.blacklist=.*/__tests__/.*
56-
module.system.haste.paths.blacklist=.*/__mocks__/.*
57-
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
58-
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
59-
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/IntegrationTests/.*
60-
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation.js
61-
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
62-
6337
munge_underscores=true
6438

65-
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
66-
module.name_mapper='^\@react-native-community/slider\(.*\)$' -> '<PROJECT_ROOT>/js/Slider.js\1'
39+
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation'
40+
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
41+
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
6742

6843
suppress_type=$FlowIssue
6944
suppress_type=$FlowFixMe
@@ -97,4 +72,4 @@ untyped-import
9772
untyped-type-import
9873

9974
[version]
100-
^0.98.0
75+
^0.105.2

babel.config.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
11
module.exports = {
22
presets: ['module:metro-react-native-babel-preset'],
3-
plugins: [
4-
[
5-
'module-resolver',
6-
{
7-
alias: {
8-
'@react-native-community/slider': './js/Slider.js',
9-
},
10-
cwd: 'babelrc',
11-
},
12-
],
13-
],
143
};

example/android/app/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ import com.android.build.OutputFile
7676
*/
7777

7878
project.ext.react = [
79-
entryFile: "index.js"
79+
entryFile: "example/index.js",
80+
// TODO: remove once @esemesek's patch is merged
81+
cliPath: "../node_modules/react-native/cli.js"
8082
]
8183

8284
apply from: "../../../node_modules/react-native/react.gradle"
@@ -166,7 +168,6 @@ android {
166168
dependencies {
167169
implementation fileTree(dir: "libs", include: ["*.jar"])
168170
implementation "com.facebook.react:react-native:+" // From node_modules
169-
implementation project(':react-native-slider')
170171

171172
// JSC from node_modules
172173
if (useIntlJsc) {
@@ -185,4 +186,4 @@ task copyDownloadableDepsToLibs(type: Copy) {
185186

186187
apply from: file("../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
187188
// set custom root because we're in a monorepo
188-
applyNativeModulesAppBuildGradle(project, "../..")
189+
applyNativeModulesAppBuildGradle(project)

example/android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ buildscript {
66
minSdkVersion = 16
77
compileSdkVersion = 28
88
targetSdkVersion = 28
9-
supportLibVersion = "28.0.0"
109
}
1110
repositories {
1211
google()
1312
jcenter()
1413
}
1514
dependencies {
16-
classpath("com.android.tools.build:gradle:3.4.1")
15+
classpath("com.android.tools.build:gradle:3.4.2")
1716

1817
// NOTE: Do not place your application dependencies here; they belong
1918
// in the individual module build.gradle files
@@ -34,5 +33,6 @@ allprojects {
3433

3534
google()
3635
jcenter()
36+
maven { url 'https://jitpack.io' }
3737
}
3838
}

example/android/settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
rootProject.name = 'example'
22
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
33
// set custom root because we're in a monorepo
4-
applyNativeModulesSettingsGradle(settings, "../..")
5-
include ':app', ':react-native-slider'
4+
applyNativeModulesSettingsGradle(settings)
5+
include ':app'
66

example/ios/Podfile

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ require_relative "#{$node_modules_path}/@react-native-community/cli-platform-ios
66

77
target 'example' do
88
# Pods for example
9+
pod 'FBLazyVector', :path => "#{$node_modules_path}/react-native/Libraries/FBLazyVector"
10+
pod 'FBReactNativeSpec', :path => "#{$node_modules_path}/react-native/Libraries/FBReactNativeSpec"
11+
pod 'RCTRequired', :path => "#{$node_modules_path}/react-native/Libraries/RCTRequired"
12+
pod 'RCTTypeSafety', :path => "#{$node_modules_path}/react-native/Libraries/TypeSafety"
13+
914
pod 'React', :path => "#{$node_modules_path}/react-native"
10-
pod 'React-Core', :path => "#{$node_modules_path}/react-native/React"
11-
pod 'React-DevSupport', :path => "#{$node_modules_path}/react-native/React"
12-
pod 'React-fishhook', :path => "#{$node_modules_path}/react-native/Libraries/fishhook"
15+
pod 'React-CoreModules', :path => "#{$node_modules_path}/react-native/React/CoreModules"
16+
pod 'React-Core/DevSupport', :path => "#{$node_modules_path}/react-native/"
1317
pod 'React-RCTActionSheet', :path => "#{$node_modules_path}/react-native/Libraries/ActionSheetIOS"
1418
pod 'React-RCTAnimation', :path => "#{$node_modules_path}/react-native/Libraries/NativeAnimation"
1519
pod 'React-RCTBlob', :path => "#{$node_modules_path}/react-native/Libraries/Blob"
@@ -19,17 +23,19 @@ target 'example' do
1923
pod 'React-RCTSettings', :path => "#{$node_modules_path}/react-native/Libraries/Settings"
2024
pod 'React-RCTText', :path => "#{$node_modules_path}/react-native/Libraries/Text"
2125
pod 'React-RCTVibration', :path => "#{$node_modules_path}/react-native/Libraries/Vibration"
22-
pod 'React-RCTWebSocket', :path => "#{$node_modules_path}/react-native/Libraries/WebSocket"
26+
pod 'React-Core/RCTWebSocket', :path => "#{$node_modules_path}/react-native/"
2327

2428
pod 'React-cxxreact', :path => "#{$node_modules_path}/react-native/ReactCommon/cxxreact"
2529
pod 'React-jsi', :path => "#{$node_modules_path}/react-native/ReactCommon/jsi"
2630
pod 'React-jsiexecutor', :path => "#{$node_modules_path}/react-native/ReactCommon/jsiexecutor"
2731
pod 'React-jsinspector', :path => "#{$node_modules_path}/react-native/ReactCommon/jsinspector"
28-
pod 'yoga', :path => "#{$node_modules_path}/react-native/ReactCommon/yoga"
32+
pod 'ReactCommon/jscallinvoker', :path => "#{$node_modules_path}/react-native/ReactCommon"
33+
pod 'ReactCommon/turbomodule/core', :path => "#{$node_modules_path}/react-native/ReactCommon"
34+
pod 'Yoga', :path => "#{$node_modules_path}/react-native/ReactCommon/yoga"
2935

3036
pod 'DoubleConversion', :podspec => "#{$node_modules_path}/react-native/third-party-podspecs/DoubleConversion.podspec"
3137
pod 'glog', :podspec => "#{$node_modules_path}/react-native/third-party-podspecs/glog.podspec"
3238
pod 'Folly', :podspec => "#{$node_modules_path}/react-native/third-party-podspecs/Folly.podspec"
3339

34-
use_native_modules!("../..")
40+
use_native_modules!
3541
end

0 commit comments

Comments
 (0)