From 0d39c5a90e549e0bd220d3571f2d18515db40e68 Mon Sep 17 00:00:00 2001 From: Daniel Cufino Date: Sat, 3 Feb 2024 13:46:00 -0600 Subject: [PATCH] Revert "Expo camera (#13)" This reverts commit e28386692a64c6b5ba7586264238f2e96608fcc9. --- hmns-app/client/app/(tabs)/index.tsx | 38 +-- hmns-app/client/app/(tabs)/two.tsx | 22 +- hmns-app/client/assets/images/gallery.jpg | Bin 8519 -> 0 bytes hmns-app/client/babel.config.js | 16 +- .../components/.CameraComponent.tsx.swo | Bin 4096 -> 0 bytes .../client/components/CameraComponent.tsx | 264 ------------------ hmns-app/client/components/EditScreenInfo.tsx | 128 ++++----- hmns-app/client/components/ExternalLink.tsx | 48 ++-- hmns-app/client/components/StyledText.tsx | 4 +- hmns-app/client/components/Themed.tsx | 40 +-- .../components/__tests__/StyledText-test.js | 10 + hmns-app/client/constants/Colors.ts | 32 +-- hmns-app/client/metro.config.js | 7 +- hmns-app/client/package-lock.json | 21 -- hmns-app/client/package.json | 7 +- hmns-app/server/package-lock.json | 23 -- hmns-app/server/package.json | 1 - 17 files changed, 181 insertions(+), 480 deletions(-) delete mode 100644 hmns-app/client/assets/images/gallery.jpg delete mode 100644 hmns-app/client/components/.CameraComponent.tsx.swo delete mode 100644 hmns-app/client/components/CameraComponent.tsx create mode 100644 hmns-app/client/components/__tests__/StyledText-test.js diff --git a/hmns-app/client/app/(tabs)/index.tsx b/hmns-app/client/app/(tabs)/index.tsx index 4b731d0..a293c0d 100644 --- a/hmns-app/client/app/(tabs)/index.tsx +++ b/hmns-app/client/app/(tabs)/index.tsx @@ -3,43 +3,33 @@ import { StyleSheet } from "react-native"; import EditScreenInfo from "../../components/EditScreenInfo"; import { Text, View } from "../../components/Themed"; -export default function TabOneScreen() { +export default function TabOneScreen () { return ( - - Tab One - - - + Tab One + + ); } - + const styles = StyleSheet.create({ container: { - flex: 1, - }, - header: { alignItems: "center", - justifyContent: "center", - // Adjust the flex value or height as needed - flex: 0.45, + flex: 1, + justifyContent: "center" }, separator: { height: 1, marginVertical: 30, - width: "80%", + width: "80%" }, title: { fontSize: 20, - fontWeight: "bold", - }, - camera: { - flex: 1, // Take up all available space - }, + fontWeight: "bold" + } }); - diff --git a/hmns-app/client/app/(tabs)/two.tsx b/hmns-app/client/app/(tabs)/two.tsx index 88cb8d4..15d9ff8 100644 --- a/hmns-app/client/app/(tabs)/two.tsx +++ b/hmns-app/client/app/(tabs)/two.tsx @@ -1,17 +1,31 @@ import { StyleSheet } from "react-native"; -import CameraComponent from "../../components/CameraComponent"; -import { View } from "../../components/Themed"; -export default function TabTwoScreen() { +import EditScreenInfo from "../../components/EditScreenInfo"; +import { Text, View } from "../../components/Themed"; + +export default function TabTwoScreen () { return ( - + Tab Two + + ); } const styles = StyleSheet.create({ container: { + alignItems: "center", flex: 1, + justifyContent: "center" + }, + separator: { + height: 1, + marginVertical: 30, + width: "80%" }, + title: { + fontSize: 20, + fontWeight: "bold" + } }); diff --git a/hmns-app/client/assets/images/gallery.jpg b/hmns-app/client/assets/images/gallery.jpg deleted file mode 100644 index 7371f70561e751ed5637afb6797fae28979195fa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8519 zcmcI|2Urx#wr)*khA?CiL2?izgCYV$jw(TdBAYbiEJ;KJMI{T03W|ZGB8s3OAVEix z7?2z!r;SRIK?O&`%cSIwfqPLcoC5=W;j94o`G*8q8tMohIcg_}`3x8V z9K06d$eTmzF0R2uKL|eq z0C|fT7!(2knl2YP5fVtpPz9VpP=FAQr(=%|e2b1^m9V<&+NT&gs5+-NoAP)do z+90`L7|{dr!9s?xyuYiLKLB_^2y6QJ1-L@k3Br<)P9TKo{#9N6=Evi2*xA`-%crxm z#}?k;0$D->>v;tS`Z}LnzxkiM`1yuH`C2dH(3QzE$jB0EIib9L^a(JfV;N|W?y4suaH_ky2+8Ap%)W@1Gr~Cir>1Mp? zAHfpgX=Mw^aR4Ah!@O+hPXr5uWrKYV)8m0+K&VG}>eA)wIzge9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Hl(7`NW5Y3wlo=wf7Wgv`m+d6#ifeh&W{@5Jxv4g6C%dP zG;lr_-mSSxj0;e=pVs0I(mNK_m5 z&Rt|^BhHb(WKRw&fc9zRr?QK0i$hL1CI8GKrkm!MGt{J+w0b=~K4ith99d5;rs5P< zbR*@+d$P!%LfX}Ra=uhYm%1#7XD$7F%C^=RtDh!O=Yg#$uf1R|2_hF4NK5gQ$`xJ8 zP?TV#Wv^>j=>AZ){@o^mF)d<#@6s0xFC-)0s+aCOn(*li;UHBqGJ5S!lsx5AQ(bgL z^s9@(bwyrc9oHbAOlJ+jmT?)9>ziIH_7j%|$A$1V%M4IhJHJ`4q=y zYCaXOxI5T)Y&z`lpx=r~ZD7kC`xSV>WrsbJT1?f)5UM*H??u;IlDte0?mv*~*tx1O ze%r?&+0diNyI-yKVg0ko?e4}R2d7UCm5P2FNDy7sSRjn2rba1JdMzk%3(`k2?0Xjt s&^`$|#W?u~@n*0b?;_YiYgzpf2{cmPlZL}^N@Z(_1j zetx!YKvBM4PJVJ?4zjj7xPkgEsm0kP`33qxnaQb+1qH?W8M%27LN~FXKtDMrGc~V7 zKRG|QAU_YtD%N*S%uOvybcPA&l@wPX8$HS%4S~@RAQ%F?48}%=;H<8!q^KY)6iQIX isDjZD7!85Z5Eu=C(GVC7fzc2c4S~@R7!85p69NF~P&H2g diff --git a/hmns-app/client/components/CameraComponent.tsx b/hmns-app/client/components/CameraComponent.tsx deleted file mode 100644 index 595bef2..0000000 --- a/hmns-app/client/components/CameraComponent.tsx +++ /dev/null @@ -1,264 +0,0 @@ -import React, { useState, useEffect, useRef } from "react"; -import { View, Text, StyleSheet, TouchableOpacity, Image } from "react-native"; -import { Camera } from "expo-camera"; -import FontAwesome from "@expo/vector-icons/FontAwesome"; -import { Pressable, useColorScheme } from "react-native"; -import Colors from "../constants/Colors"; -import * as MediaLibrary from "expo-media-library"; -import { StatusBar } from "react-native"; - - -export default function CameraComponent() { - const [hasPermission, setHasPermission] = useState(null); - // State to store the captured photo - const [photo, setPhoto] = useState(null); - // Reference to the camera component - const cameraRef = useRef(null); - // Function to show photo-taking tips - const showPhotoTips = () => { - alert("Photo-taking Tips:\n1. Keep your hands steady.\n2. Make sure there's enough light.\n3. Focus on the butterfly you want to search up before taking the photo."); - }; - const [confirmVisible, setConfirmVisible] = useState(false); - - - // Request camera permissions when the component mounts - useEffect(() => { - (async () => { - // Request camera permission - const cameraStatus = await Camera.requestCameraPermissionsAsync(); - setHasPermission(cameraStatus.status === "granted"); - - - // Request media library permission - const mediaLibraryStatus = await MediaLibrary.requestPermissionsAsync(); - if (mediaLibraryStatus.status !== "granted") { - alert("Sorry, we need camera roll permissions to save the image!"); - } - })(); - }, []); - - - // // Capture a photo and save it to photo album - // const takePhoto = async () => { - // if (cameraRef.current) { - // const options = { quality: 0.5, base64: true, skipProcessing: true }; - // let newPhoto = await cameraRef.current.takePictureAsync(options); - // setPhoto(newPhoto); - - - // // Save the photo to the gallery - // const asset = await MediaLibrary.createAssetAsync(newPhoto.uri); - // await MediaLibrary.createAlbumAsync('HMNS', asset, false); // Replace 'YourAppName' with your app's name or any other desired album name. - // } - // }; - const takePhoto = async () => { - if (cameraRef.current) { - const options = { quality: 0.5, base64: true, skipProcessing: true }; - const newPhoto = await cameraRef.current.takePictureAsync(options); - setPhoto(newPhoto); - setConfirmVisible(true); // Show the confirmation screen - } - }; - - - // Retake the photo - const retakePhoto = () => { - setPhoto(null); - setConfirmVisible(false); // Hide the confirmation screen - }; - - - // Accept the photo and save it - const acceptPhoto = async () => { - if (photo) { - try { - // Save the photo to the gallery here - const asset = await MediaLibrary.createAssetAsync(photo.uri); - await MediaLibrary.createAlbumAsync("YourAppName", asset, false); - - // Handle any operation after saving the photo, such as navigation or state reset - setConfirmVisible(false); // Hide confirmation screen - setPhoto(null); // Reset photo state - } catch (error) { - // Handle any errors here - console.error("Error saving photo", error); - alert("Error saving photo"); - } - } - }; - - - // If confirmation screen should be visible, show the taken photo and options - if (confirmVisible && photo) { - return ( - - - - - Retake - - - Accept - - - - ); - } - - - - - - - // If permissions are still being requested, return an empty view - if (hasPermission === null) { - return ; - } - // If camera access is denied, inform the user - if (hasPermission === false) { - return No access to camera; - } - - - // Make sure to hide the status bar to provide a full-screen experience - StatusBar.setHidden(true); - - - return ( - - - {/* Overlay the UI components on the camera preview */} - - - {/* Info Button */} - - - - - - - {/* Photo Button */} - - - - - - - - - - ); -} - - -const styles = StyleSheet.create({ - container: { - flex: 1, - backgroundColor: "black", - }, - camera: { - flex: 1, - justifyContent: "space-between", - }, - uiContainer: { - flex: 1, - backgroundColor: "transparent", - flexDirection: "column", - justifyContent: "space-between", - }, - topToolbar: { - flex: 0.1, - flexDirection: "row", - justifyContent: "space-between", - alignItems: "flex-start", - paddingTop: 20, - paddingHorizontal: 20, - }, - bottomToolbar: { - padding: 20, - flexDirection: "row", - justifyContent: "center", - alignItems: "center", - backgroundColor: "rgba(0, 0, 0, 0.5)" - }, - captureButton: { - width: 70, - height: 70, - borderWidth: 4, - borderColor: "white", - borderRadius: 35, - backgroundColor: "white", - alignSelf: "center", - justifyContent: "center", - alignItems:"center", - }, - captureButtonRing: { - width: 65, - height: 65, - borderWidth: 2, - borderColor: "black", - borderRadius: 32.5, - position: "absolute", - }, - galleryButton: { - width: 50, - height: 50, - borderRadius: 10, - alignSelf: "center", - overflow: "hidden", - backgroundColor: "white", - }, - thumbnail: { - width: 45, - height: 45, - backgroundColor: "transparent", - }, - tipsButton: { - // Style your button as needed - position: 'absolute', - borderRadius: 10, - padding: 10, - top: 20, - left: 10, - }, - confirmContainer: { - flex: 1, - justifyContent: "center", - alignItems: "center", - }, - confirmButtons: { - flexDirection: "row", - //justifyContent: "space-around", - width: "100%", - padding: 20, - }, - confirmButton: { - flex: 1, - alignItems: "center", - justifyContent: "center", - marginHorizontal: 10, - paddingVertical: 10, - borderRadius: 5, - backgroundColor: "rgba(0,0,0,0.5)", - }, - preview: { - width: "100%", // You may need to adjust this - height: "80%", // You may need to adjust this - borderRadius: 4, - }, - confirmButtonText: { - // Style for the text inside your confirm buttons - color: "white", - fontSize: 18, - textAlign: "center", - }, -}); - - - - diff --git a/hmns-app/client/components/EditScreenInfo.tsx b/hmns-app/client/components/EditScreenInfo.tsx index 6ab103a..12bebe9 100644 --- a/hmns-app/client/components/EditScreenInfo.tsx +++ b/hmns-app/client/components/EditScreenInfo.tsx @@ -1,77 +1,77 @@ -import React from "react"; -import { StyleSheet } from "react-native"; +import React from 'react'; +import { StyleSheet } from 'react-native'; -import Colors from "../constants/Colors"; -import { ExternalLink } from "./ExternalLink"; -import { MonoText } from "./StyledText"; -import { Text, View } from "./Themed"; +import Colors from '../constants/Colors'; +import { ExternalLink } from './ExternalLink'; +import { MonoText } from './StyledText'; +import { Text, View } from './Themed'; export default function EditScreenInfo({ path }: { path: string }) { - return ( - - - + return ( + + + Open up the code for this screen: - + - - {path} - + + {path} + - + Change any of the text, save the file, and your app will automatically update. - - + + - - - - Tap here if your app doesnt automatically update after making changes - - - - - ); + + + + Tap here if your app doesn't automatically update after making changes + + + + + ); } const styles = StyleSheet.create({ - getStartedContainer: { - alignItems: "center", - marginHorizontal: 50, - }, - homeScreenFilename: { - marginVertical: 7, - }, - codeHighlightContainer: { - borderRadius: 3, - paddingHorizontal: 4, - }, - getStartedText: { - fontSize: 17, - lineHeight: 24, - textAlign: "center", - }, - helpContainer: { - marginTop: 15, - marginHorizontal: 20, - alignItems: "center", - }, - helpLink: { - paddingVertical: 15, - }, - helpLinkText: { - textAlign: "center", - }, + getStartedContainer: { + alignItems: 'center', + marginHorizontal: 50, + }, + homeScreenFilename: { + marginVertical: 7, + }, + codeHighlightContainer: { + borderRadius: 3, + paddingHorizontal: 4, + }, + getStartedText: { + fontSize: 17, + lineHeight: 24, + textAlign: 'center', + }, + helpContainer: { + marginTop: 15, + marginHorizontal: 20, + alignItems: 'center', + }, + helpLink: { + paddingVertical: 15, + }, + helpLinkText: { + textAlign: 'center', + }, }); diff --git a/hmns-app/client/components/ExternalLink.tsx b/hmns-app/client/components/ExternalLink.tsx index 397a61e..c535be9 100644 --- a/hmns-app/client/components/ExternalLink.tsx +++ b/hmns-app/client/components/ExternalLink.tsx @@ -1,28 +1,28 @@ -import { Link } from "expo-router"; -import * as WebBrowser from "expo-web-browser"; -import React from "react"; -import { Platform } from "react-native"; +import { Link } from 'expo-router'; +import * as WebBrowser from 'expo-web-browser'; +import React from 'react'; +import { Platform } from 'react-native'; export function ExternalLink( - props: Omit, "href"> & { href: string } + props: Omit, 'href'> & { href: string } ) { - return ( - { - if (Platform.OS !== "web") { - // Prevent the default behavior of linking to the default browser on native. - e.preventDefault(); - // Open the link in an in-app browser. - WebBrowser.openBrowserAsync(props.href as string); - } - }} - /> - ); + return ( + { + if (Platform.OS !== 'web') { + // Prevent the default behavior of linking to the default browser on native. + e.preventDefault(); + // Open the link in an in-app browser. + WebBrowser.openBrowserAsync(props.href as string); + } + }} + /> + ); } diff --git a/hmns-app/client/components/StyledText.tsx b/hmns-app/client/components/StyledText.tsx index b064091..aa3977c 100644 --- a/hmns-app/client/components/StyledText.tsx +++ b/hmns-app/client/components/StyledText.tsx @@ -1,5 +1,5 @@ -import { Text, TextProps } from "./Themed"; +import { Text, TextProps } from './Themed'; export function MonoText(props: TextProps) { - return ; + return ; } diff --git a/hmns-app/client/components/Themed.tsx b/hmns-app/client/components/Themed.tsx index 9b9e02a..6399846 100644 --- a/hmns-app/client/components/Themed.tsx +++ b/hmns-app/client/components/Themed.tsx @@ -3,42 +3,42 @@ * https://docs.expo.io/guides/color-schemes/ */ -import { Text as DefaultText, useColorScheme, View as DefaultView } from "react-native"; +import { Text as DefaultText, useColorScheme, View as DefaultView } from 'react-native'; -import Colors from "../constants/Colors"; +import Colors from '../constants/Colors'; type ThemeProps = { lightColor?: string; darkColor?: string; }; -export type TextProps = ThemeProps & DefaultText["props"]; -export type ViewProps = ThemeProps & DefaultView["props"]; +export type TextProps = ThemeProps & DefaultText['props']; +export type ViewProps = ThemeProps & DefaultView['props']; export function useThemeColor( - props: { light?: string; dark?: string }, - colorName: keyof typeof Colors.light & keyof typeof Colors.dark + props: { light?: string; dark?: string }, + colorName: keyof typeof Colors.light & keyof typeof Colors.dark ) { - const theme = useColorScheme() ?? "light"; - const colorFromProps = props[theme]; - - if (colorFromProps) { - return colorFromProps; - } else { - return Colors[theme][colorName]; - } + const theme = useColorScheme() ?? 'light'; + const colorFromProps = props[theme]; + + if (colorFromProps) { + return colorFromProps; + } else { + return Colors[theme][colorName]; + } } export function Text(props: TextProps) { - const { style, lightColor, darkColor, ...otherProps } = props; - const color = useThemeColor({ light: lightColor, dark: darkColor }, "text"); + const { style, lightColor, darkColor, ...otherProps } = props; + const color = useThemeColor({ light: lightColor, dark: darkColor }, 'text'); - return ; + return ; } export function View(props: ViewProps) { - const { style, lightColor, darkColor, ...otherProps } = props; - const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor }, "background"); + const { style, lightColor, darkColor, ...otherProps } = props; + const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor }, 'background'); - return ; + return ; } diff --git a/hmns-app/client/components/__tests__/StyledText-test.js b/hmns-app/client/components/__tests__/StyledText-test.js new file mode 100644 index 0000000..f569ce8 --- /dev/null +++ b/hmns-app/client/components/__tests__/StyledText-test.js @@ -0,0 +1,10 @@ +import * as React from 'react'; +import renderer from 'react-test-renderer'; + +import { MonoText } from '../StyledText'; + +it(`renders correctly`, () => { + const tree = renderer.create(Snapshot test!).toJSON(); + + expect(tree).toMatchSnapshot(); +}); diff --git a/hmns-app/client/constants/Colors.ts b/hmns-app/client/constants/Colors.ts index 3a81a77..1c706c7 100644 --- a/hmns-app/client/constants/Colors.ts +++ b/hmns-app/client/constants/Colors.ts @@ -1,19 +1,19 @@ -const tintColorLight = "#2f95dc"; -const tintColorDark = "#fff"; +const tintColorLight = '#2f95dc'; +const tintColorDark = '#fff'; export default { - light: { - text: "#000", - background: "#fff", - tint: tintColorLight, - tabIconDefault: "#ccc", - tabIconSelected: tintColorLight, - }, - dark: { - text: "#fff", - background: "#000", - tint: tintColorDark, - tabIconDefault: "#ccc", - tabIconSelected: tintColorDark, - }, + light: { + text: '#000', + background: '#fff', + tint: tintColorLight, + tabIconDefault: '#ccc', + tabIconSelected: tintColorLight, + }, + dark: { + text: '#fff', + background: '#000', + tint: tintColorDark, + tabIconDefault: '#ccc', + tabIconSelected: tintColorDark, + }, }; diff --git a/hmns-app/client/metro.config.js b/hmns-app/client/metro.config.js index 8fb7b51..c5033a3 100644 --- a/hmns-app/client/metro.config.js +++ b/hmns-app/client/metro.config.js @@ -1,11 +1,10 @@ -/* eslint-disable */ // Learn more https://docs.expo.io/guides/customizing-metro -const {getDefaultConfig} = require("expo/metro-config"); +const { getDefaultConfig } = require('expo/metro-config'); /** @type {import('expo/metro-config').MetroConfig} */ const config = getDefaultConfig(__dirname, { - // [Web-only]: Enables CSS support in Metro. - isCSSEnabled: true, + // [Web-only]: Enables CSS support in Metro. + isCSSEnabled: true, }); module.exports = config; diff --git a/hmns-app/client/package-lock.json b/hmns-app/client/package-lock.json index b5d63ef..45f9406 100644 --- a/hmns-app/client/package-lock.json +++ b/hmns-app/client/package-lock.json @@ -13,10 +13,8 @@ "@react-navigation/native": "^6.0.2", "@types/react": "~18.2.14", "expo": "~49.0.13", - "expo-camera": "~13.4.4", "expo-font": "~11.4.0", "expo-linking": "~5.0.2", - "expo-media-library": "~15.4.1", "expo-router": "^2.0.0", "expo-splash-screen": "~0.20.5", "expo-status-bar": "~1.6.0", @@ -6547,17 +6545,6 @@ "url-parse": "^1.5.9" } }, - "node_modules/expo-camera": { - "version": "13.4.4", - "resolved": "https://registry.npmjs.org/expo-camera/-/expo-camera-13.4.4.tgz", - "integrity": "sha512-7k54APbpSulUDR2CrD5SrmKjCdfdg4tqKRpbBOKc2J2MIBHhunExU77435JDYSejHRY5bfRHZsEp3yKwR862uw==", - "dependencies": { - "invariant": "^2.2.4" - }, - "peerDependencies": { - "expo": "*" - } - }, "node_modules/expo-constants": { "version": "14.4.2", "resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-14.4.2.tgz", @@ -6625,14 +6612,6 @@ "url-parse": "^1.5.9" } }, - "node_modules/expo-media-library": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/expo-media-library/-/expo-media-library-15.4.1.tgz", - "integrity": "sha512-lpWcT4pynWcE7TyNMUkLFH4YcueCTnq7UOJYRR0vewPEJeQXwRscka7zBtrhA+RSsJda013Q0615K+5lRLt14Q==", - "peerDependencies": { - "expo": "*" - } - }, "node_modules/expo-modules-autolinking": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/expo-modules-autolinking/-/expo-modules-autolinking-1.5.1.tgz", diff --git a/hmns-app/client/package.json b/hmns-app/client/package.json index ed922ea..10d3428 100644 --- a/hmns-app/client/package.json +++ b/hmns-app/client/package.json @@ -7,8 +7,7 @@ "android": "expo start --android", "ios": "expo start --ios", "web": "expo start --web", - "test": "jest --watchAll", - "lint": "eslint --fix ." + "test": "jest --watchAll" }, "dependencies": { "@apollo/client": "^3.8.5", @@ -30,8 +29,6 @@ "react-native-screens": "~3.22.0", "react-native-web": "~0.19.6", "typescript": "^5.1.3", - "@types/react": "~18.2.14", - "expo-camera": "~13.4.4", - "expo-media-library": "~15.4.1" + "@types/react": "~18.2.14" } } diff --git a/hmns-app/server/package-lock.json b/hmns-app/server/package-lock.json index 9c18e00..414c4a3 100644 --- a/hmns-app/server/package-lock.json +++ b/hmns-app/server/package-lock.json @@ -10,7 +10,6 @@ "license": "ISC", "dependencies": { "apollo-server-express": "^3.12.1", - "config": "^3.3.9", "express": "^4.18.2", "graphql": "^16.8.1", "mongoose": "^7.6.2" @@ -947,17 +946,6 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, - "node_modules/config": { - "version": "3.3.9", - "resolved": "https://registry.npmjs.org/config/-/config-3.3.9.tgz", - "integrity": "sha512-G17nfe+cY7kR0wVpc49NCYvNtelm/pPy8czHoFkAgtV1lkmcp7DHtWCdDu+C9Z7gb2WVqa9Tm3uF9aKaPbCfhg==", - "dependencies": { - "json5": "^2.2.3" - }, - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -1402,17 +1390,6 @@ "node": ">=0.12.0" } }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/kareem": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.5.1.tgz", diff --git a/hmns-app/server/package.json b/hmns-app/server/package.json index ea73b95..c37a5c1 100644 --- a/hmns-app/server/package.json +++ b/hmns-app/server/package.json @@ -20,7 +20,6 @@ }, "dependencies": { "apollo-server-express": "^3.12.1", - "config": "^3.3.9", "express": "^4.18.2", "graphql": "^16.8.1", "mongoose": "^7.6.2"