Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add replacement for Node's core modules and globals. #10

Merged
merged 1 commit into from Jul 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions android/app/build.gradle
Expand Up @@ -137,6 +137,7 @@ android {
}

dependencies {
compile project(':react-native-randombytes')
compile project(':react-native-vector-icons')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
Expand Down
2 changes: 2 additions & 0 deletions android/app/src/main/java/com/anchorx/MainApplication.java
Expand Up @@ -3,6 +3,7 @@
import android.app.Application;

import com.facebook.react.ReactApplication;
import com.bitgo.randombytes.RandomBytesPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
Expand All @@ -24,6 +25,7 @@ public boolean getUseDeveloperSupport() {
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RandomBytesPackage(),
new VectorIconsPackage()
);
}
Expand Down
2 changes: 2 additions & 0 deletions android/settings.gradle
@@ -1,4 +1,6 @@
rootProject.name = 'AnchorX'
include ':react-native-randombytes'
project(':react-native-randombytes').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-randombytes/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')

Expand Down
1 change: 1 addition & 0 deletions index.js
@@ -1,3 +1,4 @@
import 'node-libs-react-native/globals'
import { AppRegistry } from 'react-native';
import App from './App';
AppRegistry.registerComponent('AnchorX', () => App);
28 changes: 28 additions & 0 deletions ios/AnchorX.xcodeproj/project.pbxproj
Expand Up @@ -52,6 +52,8 @@
20476C0591B8469AAC191B97 /* SimpleLineIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5BE195DF16F64D92924D688D /* SimpleLineIcons.ttf */; };
C1F965C06FED482D8614C84D /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = F02C37F44AE64DD4BF8513C3 /* Zocial.ttf */; };
7E0C686F234C404CA048B01C /* libRNVectorIcons.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 65888D2EDFED429D945BB93D /* libRNVectorIcons.a */; };
78CA6A84C4F14DBB985E1579 /* libRNRandomBytes.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E3610A7F00FB4392B358D769 /* libRNRandomBytes.a */; };
0D8427C7DBC649B09D648141 /* libRNRandomBytes-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B3CB66773754281B8EC5CAA /* libRNRandomBytes-tvOS.a */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -373,6 +375,9 @@
F02C37F44AE64DD4BF8513C3 /* Zocial.ttf */ = {isa = PBXFileReference; name = "Zocial.ttf"; path = "../node_modules/native-base/Fonts/Zocial.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
178C94D49A4A4A6A8C316126 /* RNVectorIcons.xcodeproj */ = {isa = PBXFileReference; name = "RNVectorIcons.xcodeproj"; path = "../node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
65888D2EDFED429D945BB93D /* libRNVectorIcons.a */ = {isa = PBXFileReference; name = "libRNVectorIcons.a"; path = "libRNVectorIcons.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
70ADA0A46A23469B8DAFDA5C /* RNRandomBytes.xcodeproj */ = {isa = PBXFileReference; name = "RNRandomBytes.xcodeproj"; path = "../node_modules/react-native-randombytes/RNRandomBytes.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
E3610A7F00FB4392B358D769 /* libRNRandomBytes.a */ = {isa = PBXFileReference; name = "libRNRandomBytes.a"; path = "libRNRandomBytes.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
6B3CB66773754281B8EC5CAA /* libRNRandomBytes-tvOS.a */ = {isa = PBXFileReference; name = "libRNRandomBytes-tvOS.a"; path = "libRNRandomBytes-tvOS.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -402,6 +407,7 @@
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
7E0C686F234C404CA048B01C /* libRNVectorIcons.a in Frameworks */,
78CA6A84C4F14DBB985E1579 /* libRNRandomBytes.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -417,6 +423,7 @@
2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */,
2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */,
2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */,
0D8427C7DBC649B09D648141 /* libRNRandomBytes-tvOS.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -589,6 +596,7 @@
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
178C94D49A4A4A6A8C316126 /* RNVectorIcons.xcodeproj */,
70ADA0A46A23469B8DAFDA5C /* RNRandomBytes.xcodeproj */,
);
name = Libraries;
sourceTree = "<group>";
Expand Down Expand Up @@ -1253,10 +1261,13 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/react-native-randombytes",
);
};
name = Debug;
Expand All @@ -1278,10 +1289,13 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/react-native-randombytes",
);
};
name = Release;
Expand All @@ -1304,6 +1318,7 @@
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/react-native-randombytes",
);
};
name = Debug;
Expand All @@ -1325,6 +1340,7 @@
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/react-native-randombytes",
);
};
name = Release;
Expand Down Expand Up @@ -1355,10 +1371,13 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/react-native-randombytes",
);
};
name = Debug;
Expand Down Expand Up @@ -1389,10 +1408,13 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/react-native-randombytes",
);
};
name = Release;
Expand Down Expand Up @@ -1422,10 +1444,13 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/react-native-randombytes",
);
};
name = Debug;
Expand Down Expand Up @@ -1455,10 +1480,13 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/react-native-randombytes",
);
};
name = Release;
Expand Down
5 changes: 4 additions & 1 deletion package.json
Expand Up @@ -71,11 +71,14 @@
"graphql": "^0.13.2",
"graphql-tag": "^2.9.2",
"native-base": "^2.7.1",
"node-libs-react-native": "^1.0.2",
"react": "16.3.1",
"react-apollo": "^2.1.9",
"react-native": "~0.55.2",
"react-native-randombytes": "^3.4.0",
"react-native-style-tachyons": "^3.7.0",
"react-native-vector-icons": "^4.6.0",
"react-navigation": "^2.6.2"
"react-navigation": "^2.6.2",
"vm-browserify": "^1.1.0"
}
}
7 changes: 5 additions & 2 deletions rn-cli.config.js
@@ -1,9 +1,12 @@
const extraNodeModules = require('node-libs-react-native')
extraNodeModules.vm = require.resolve('vm-browserify')

module.exports = {
getTransformModulePath() {
return require.resolve("react-native-typescript-transformer");
},
getSourceExts() {
return ["ts", "tsx"];
}
},
extraNodeModules
};