Skip to content

Commit

Permalink
hotfix: update dependencies to fix vulnerabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
williamjesusdev committed Mar 4, 2022
1 parent 391b306 commit 40b5379
Show file tree
Hide file tree
Showing 15 changed files with 9,994 additions and 12,429 deletions.
4 changes: 2 additions & 2 deletions DevRadar/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"dev": "nodemon src/index.js"
},
"dependencies": {
"axios": "^0.19.1",
"axios": "^0.26.0",
"cors": "^2.8.5",
"express": "^4.17.1",
"mongoose": "^5.8.7",
"socket.io": "^2.3.0"
"socket.io": "^4.4.1"
},
"devDependencies": {
"dotenv": "^8.2.0",
Expand Down
1,640 changes: 807 additions & 833 deletions DevRadar/backend/yarn.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions DevRadar/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"@fortawesome/fontawesome-svg-core": "^1.2.26",
"@fortawesome/free-solid-svg-icons": "^5.12.0",
"@fortawesome/react-fontawesome": "^0.1.8",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"axios": "^0.19.1",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^13.5.0",
"axios": "^0.26.0",
"express": "^4.17.1",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-scripts": "3.4.0",
"react-scripts": "5.0.0",
"socket.io-client": "^2.3.0"
},
"scripts": {
Expand Down
14,114 changes: 5,963 additions & 8,151 deletions DevRadar/frontend/yarn.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions DevRadar/mobile/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Basic
LOCALE='WORK'
HOME_API='http://192.168.0.1:3333'
WORK_API='http://192.168.2.5:3333'
PROD_API='https://'
11 changes: 8 additions & 3 deletions DevRadar/mobile/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node_modules/**/*
.expo/*
/node_modules
/.expo*
npm-debug.*
*.jks
*.p8
Expand All @@ -10,5 +10,10 @@ npm-debug.*
web-build/
web-report/

# macOS
# misc
.DS_Store
.env
.env.development.local
.env.test.local
.env.production
.env.production.local
4 changes: 2 additions & 2 deletions DevRadar/mobile/App.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import { StatusBar, YellowBox } from "react-native";
import { StatusBar, LogBox } from "react-native";

import Routes from "./src/routes";
YellowBox.ignoreWarnings(["Unrecognized WebSocket"]);
LogBox.ignoreLogs(["Unrecognized WebSocket"]);

export default function App() {
return (
Expand Down
11 changes: 8 additions & 3 deletions DevRadar/mobile/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
"name": "DevRadar",
"slug": "DevRadar",
"privacy": "public",
"sdkVersion": "36.0.0",
"platforms": ["ios", "android", "web"],
"platforms": [
"ios",
"android",
"web"
],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
Expand All @@ -16,7 +19,9 @@
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": ["**/*"],
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
}
Expand Down
4 changes: 2 additions & 2 deletions DevRadar/mobile/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = function(api) {
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
presets: ["babel-preset-expo", "module:react-native-dotenv"],
};
};
34 changes: 18 additions & 16 deletions DevRadar/mobile/package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"dev": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"@react-native-community/masked-view": "^0.1.6",
"axios": "^0.19.1",
"expo": "~36.0.0",
"expo-location": "~8.0.0",
"react": "~16.9.0",
"react-dom": "~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-maps": "0.26.1",
"react-native-reanimated": "~1.4.0",
"react-native-safe-area-context": "0.6.0",
"react-native-screens": "2.0.0-alpha.12",
"react-native-web": "~0.11.7",
"react-native-webview": "7.4.3",
"axios": "^0.26.0",
"expo": "^44.0.0",
"expo-constants": "~13.0.1",
"expo-location": "~14.0.1",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-dotenv": "^0.2.0",
"react-native-gesture-handler": "~2.1.0",
"react-native-maps": "0.29.4",
"react-native-reanimated": "~2.3.1",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.10.1",
"react-native-web": "0.17.1",
"react-native-webview": "11.15.0",
"react-navigation": "^4.0.10",
"react-navigation-stack": "^2.0.15",
"socket.io-client": "^2.3.0"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"babel-preset-expo": "~8.0.0"
"@babel/core": "^7.12.9",
"babel-preset-expo": "9.0.2"
},
"private": true
}
46 changes: 25 additions & 21 deletions DevRadar/mobile/src/pages/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { useEffect, useState } from "react";
import { Image, View, Text, TextInput, TouchableOpacity } from "react-native";
import Mapview, { Marker, Callout } from "react-native-maps";
import {
requestPermissionsAsync,
getCurrentPositionAsync
requestForegroundPermissionsAsync,
getCurrentPositionAsync,
} from "expo-location";
import { MaterialIcons } from "@expo/vector-icons";

Expand All @@ -20,17 +20,17 @@ function Main({ navigation }) {

useEffect(() => {
async function loadInitialPosition() {
const { granted } = await requestPermissionsAsync();
const { granted } = await requestForegroundPermissionsAsync();
if (granted) {
const { coords } = await getCurrentPositionAsync({
enableHighAccuracy: true
enableHighAccuracy: true,
});
const { latitude, longitude } = coords;
const region = {
latitude,
longitude,
latitudeDelta: 0.015,
longitudeDelta: 0.011
longitudeDelta: 0.011,
};
setCurrentRegion(region);
setInitialRegion(region);
Expand All @@ -41,7 +41,7 @@ function Main({ navigation }) {
}, []);

useEffect(() => {
subscribeToNewDevs(dev => setDevs([...devs, dev]));
subscribeToNewDevs((dev) => setDevs([...devs, dev]));
}, [devs]);

function setupWebSocket() {
Expand All @@ -54,16 +54,20 @@ function Main({ navigation }) {

async function loadDevs() {
const { latitude, longitude } = currentRegion;
const response = await api.get("/search", {
params: {
latitude,
longitude,
techs
}
});
setDevs(response.data.devs);
setInitialRegion(null);
setupWebSocket();
api
.get("/search", {
params: {
latitude,
longitude,
techs,
},
})
.then((response) => {
setDevs(response.data.devs);
setInitialRegion(null);
setupWebSocket();
})
.catch((err) => console.error({ ...err }));
}

async function loadLocation() {
Expand Down Expand Up @@ -92,7 +96,7 @@ function Main({ navigation }) {
key="initial"
coordinate={{
latitude: initialRegion.latitude,
longitude: initialRegion.longitude
longitude: initialRegion.longitude,
}}
>
<MaterialIcons name="room" size={50} color="#8e4dff" />
Expand All @@ -108,24 +112,24 @@ function Main({ navigation }) {
</Callout>
</Marker>
) : (
devs.map(dev => (
devs.map((dev) => (
<Marker
key={dev._id}
coordinate={{
latitude: dev.location.coordinates[1],
longitude: dev.location.coordinates[0]
longitude: dev.location.coordinates[0],
}}
>
<Image
style={styles.avatar}
source={{
uri: dev.avatar_url
uri: dev.avatar_url,
}}
/>
<Callout
onPress={() => {
navigation.navigate("Profile", {
github_username: dev.github_username
github_username: dev.github_username,
});
}}
>
Expand Down
8 changes: 4 additions & 4 deletions DevRadar/mobile/src/services/api.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import axios from "axios";
import { LOCALE, WORK_API, HOME_API, PROD_API } from "react-native-dotenv";

const API_URL = process.env.API_URL || "http://backend-devradar.herokuapp.com/";
const api = axios.create();

const api = axios.create({
baseURL: API_URL
});
api.defaults.baseURL =
LOCALE === "HOME" ? HOME_API : LOCALE === "WORK" ? WORK_API : PROD_API;

export default api;
Loading

0 comments on commit 40b5379

Please sign in to comment.