Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@typescript-eslint"
],
"settings": {
"react": { "version": "detect" },
"import/resolver": {
"node": {
"paths": ["src"],
Expand Down Expand Up @@ -61,6 +62,10 @@
"@typescript-eslint/no-empty-function": ["off"],
"jsx-a11y/label-has-associated-control": "off",
"react/jsx-one-expression-per-line": "off",
"import/prefer-default-export": "off"
"import/prefer-default-export": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"],
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error"
}
}
}
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v10.22.0
14.15.1
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
3 changes: 3 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"rules": "storage.rules"
},
"emulators": {
"auth": {
"port": "9099"
},
"functions": {
"port": 5001
},
Expand Down
1 change: 1 addition & 0 deletions functions/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12.19.1
3,142 changes: 2,399 additions & 743 deletions functions/package-lock.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@
"logs": "firebase functions:log"
},
"engines": {
"node": "10"
"node": "12"
},
"main": "lib/index.js",
"dependencies": {
"date-fns": "^2.16.1",
"date-fns-tz": "^1.0.10",
"firebase-admin": "^8.10.0",
"firebase-functions": "^3.6.1",
"jsonwebtoken": "^8.5.1"
"firebase-admin": "^9.6.0",
"firebase-functions": "^3.13.2",
"jsonwebtoken": "^8.5.1",
"npm-check-updates": "^11.3.0"
},
"devDependencies": {
"@types/jsonwebtoken": "^8.5.0",
"firebase-functions-test": "^0.2.0",
"typescript": "^3.8.0"
"typescript": "^4.2.3"
},
"private": true
}
3 changes: 3 additions & 0 deletions functions/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018"
],
"module": "commonjs",
"noImplicitReturns": true,
"noUnusedLocals": true,
Expand Down
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@
"@hookform/resolvers": "^0.1.1",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"@types/jest": "^24.0.0",
"@types/node": "^12.0.0",
"@types/react": "^16.9.0",
"@types/react-dom": "^16.9.0",
"@testing-library/jest-dom": "^5.11.10",
"@testing-library/react": "^11.2.6",
"@testing-library/user-event": "^13.1.1",
"@types/jest": "^26.0.22",
"@types/node": "^14.14.37",
"@types/react": "^17.0.3",
"@types/react-dom": "^17.0.3",
"date-fns": "^2.16.1",
"firebase": "^7.17.2",
"firebase": "^8.3.2",
"firebaseui": "^4.6.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-firebase-hooks": "^2.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-firebase-hooks": "^3.0.3",
"react-hook-form": "^6.8.3",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1",
"typescript": "~3.7.2",
"yup": "^0.29.3"
"react-scripts": "4.0.3",
"typescript": "^4.2.3",
"yup": "^0.32.9"
},
"scripts": {
"start": "react-scripts start",
Expand Down Expand Up @@ -64,15 +64,15 @@
"@types/react-router-dom": "^5.1.5",
"@types/styled-components": "^5.1.2",
"@types/yup": "^0.29.7",
"@typescript-eslint/eslint-plugin": "^3.8.0",
"@typescript-eslint/parser": "^3.8.0",
"@typescript-eslint/eslint-plugin": "^4.20.0",
"@typescript-eslint/parser": "^4.20.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.5",
"firebase-tools": "^8.9.0",
"firebase-tools": "^9.8.0",
"husky": "^4.2.5",
"lint-staged": "^10.2.11",
"prettier": "^2.0.5"
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/OtherDrawer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react'
import * as firebase from 'firebase/app'
import firebase from 'firebase/app'

import { useTheme } from '@material-ui/core/styles'
import Drawer from '@material-ui/core/Drawer'
Expand Down
4 changes: 0 additions & 4 deletions src/components/templates/RegisterApprover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import { useSharedStyles } from 'styles'
import SettingNickName from 'components/molecules/SettingNickName'
import NextActionText from 'components/molecules/NextActionText'

interface FormInputs {
nickname: string
}

interface Props {
registerApprovalUser: (nickname: string) => void
}
Expand Down
8 changes: 3 additions & 5 deletions src/config/firebase.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as firebase from 'firebase/app'
import firebase from 'firebase/app'
import 'firebase/firestore'
import 'firebase/functions'

Expand All @@ -25,13 +25,11 @@ const initializeFirebase = (): void => {
host: 'localhost:8080',
ssl: false,
})
functions.useFunctionsEmulator('http://localhost:5001')
functions.useEmulator('http://localhost', 5001)
}
}

export const serverTimeDocument = (): firebase.firestore.DocumentReference<
firebase.firestore.DocumentData
> => {
export const serverTimeDocument = (): firebase.firestore.DocumentReference<firebase.firestore.DocumentData> => {
return firebase.firestore().doc('serverTime/now')
}

Expand Down
19 changes: 9 additions & 10 deletions src/contexts/AuthorizedProvider/useInjection.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
import * as firebase from 'firebase/app'
import firebase from 'firebase/app'
import { useAuthState } from 'react-firebase-hooks/auth'
import { useDocument } from 'react-firebase-hooks/firestore'

import { userDocument, serverTimeDocument } from 'config/firebase'
import { Roles, Status, Now } from 'types/index'

export interface InjectionResult {
isAuthorizeContextLoaded: boolean
authenticated: firebase.User | undefined
isAuthLoading: boolean
authError: firebase.auth.Error | undefined
userInfo: UserInfo | null
now: Now
}

interface UserInfo {
role: Roles | null
nickname: string
Expand All @@ -22,6 +13,14 @@ interface UserInfo {
year?: string
month?: string
}
export interface InjectionResult {
isAuthorizeContextLoaded: boolean
authenticated: firebase.User | undefined | null
isAuthLoading: boolean
authError: firebase.auth.Error | undefined
userInfo: UserInfo | null
now: Now
}

const useInjection = (): InjectionResult => {
const [authenticated, isAuthLoading, authError] = useAuthState(
Expand Down
1 change: 1 addition & 0 deletions src/contexts/ContentsProvider/converter.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import firebase from 'firebase/app'
import { Item, Budget, Deal } from 'types'

type Props =
Expand Down
2 changes: 1 addition & 1 deletion src/contexts/ContentsProvider/useInjection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useEffect, useContext } from 'react'
import * as firebase from 'firebase/app'
import firebase from 'firebase/app'

import { useCollection, useDocument } from 'react-firebase-hooks/firestore'
import {
Expand Down
5 changes: 1 addition & 4 deletions src/domain/firestore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as firebase from 'firebase/app'
import firebase from 'firebase/app'
import { Roles, Status, Item, Budget, Now } from 'types'
import {
serverTimeDocument,
Expand Down Expand Up @@ -30,9 +30,6 @@ export const registerApprovalUser = async (nickname: string): Promise<void> => {
})
}

interface FetchInviteOnetimeUrlParams {
isUpdate?: boolean
}
export const fetchInviteOnetimeUrl = async (
isUpdate?: boolean
): Promise<firebase.functions.HttpsCallableResult> => {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/LoginPage/useLogin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect } from 'react'
import * as firebase from 'firebase/app'
import firebase from 'firebase/app'
import * as firebaseui from 'firebaseui'
import 'firebaseui/dist/firebaseui.css'
import { useAuthState } from 'react-firebase-hooks/auth'
Expand All @@ -21,7 +21,7 @@ const uiConfig = {
}

const useLogin = (): [
firebase.User | undefined,
firebase.User | undefined | null,
boolean,
firebase.auth.Error | undefined
] => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/SettingApproverPage/useInjection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useEffect, useContext } from 'react'
import * as firebase from 'firebase/app'
import firebase from 'firebase/app'

import { Roles, Status, Deal } from 'types'
import { AuthorizedContext } from 'contexts/AuthorizedProvider'
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react",
"jsx": "react-jsx",
"incremental": true,
"noFallthroughCasesInSwitch": true
},
"include": [
"src"
Expand Down
Loading