Skip to content

Commit 623cb33

Browse files
authored
v9.0.0 (#509)
* feat(app): remove questions for firebase config (it is loaded through bin script on first app start) * feat(app): update to firebase v9 (modules) * feat(app): update to reactfire v4 (support for firebase v9) * feat(app): update functions to firebase-admin v10 (modules) * feat(app): material-ui v5 (styling move to emotion) * feat(app): notistack v2 * feat(app): switch to `ProjectCard` (uses material-ui Card) with created at timestamp in place of `ProjectTile` * feat(app): switch `firebase-messaging-sw.js` to use newest firebase SDK and built in Firebase Hosting Init (meaning configs no longer need to be changed in SW file) * feat(app): add clear messaging to CI for case of missing secrets/variables * fix(app): correctly point to emulators within UI job in CI workflow
1 parent 498dc65 commit 623cb33

174 files changed

Lines changed: 4448 additions & 3580 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish.yml

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,28 @@ name: NPM Package Publish
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
- next
88

9+
concurrency:
10+
group: publish-${{ github.ref }}
11+
12+
env:
13+
NODE_VERSION: 14.x
14+
915
jobs:
1016
publish-npm:
1117
runs-on: ubuntu-latest
1218
steps:
13-
- name: Cancel Previous Runs
14-
uses: styfle/cancel-workflow-action@0.9.1
15-
with:
16-
access_token: ${{ github.token }}
17-
1819
- name: Checkout code
19-
uses: actions/checkout@v2
20+
uses: actions/checkout@v2.4.0
2021

21-
- name: Use Node 14
22-
uses: actions/setup-node@v2.4.1
22+
- name: Use Node ${{ env.NODE_VERSION }}
23+
uses: actions/setup-node@v2.5.0
2324
with:
24-
node-version: 14
25+
node-version: ${{ env.NODE_VERSION }}
2526
registry-url: https://registry.npmjs.org/
26-
27-
- name: Get yarn cache
28-
id: yarn-cache
29-
run: echo "::set-output name=dir::$(yarn cache dir)"
30-
31-
- uses: actions/cache@v2.1.6
32-
with:
33-
path: ${{ steps.yarn-cache.outputs.dir }}
34-
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
27+
cache: 'yarn'
3528

3629
- name: Install Dependencies
3730
env:
@@ -91,4 +84,4 @@ jobs:
9184
tag_name: v${{ steps.publish.outputs.version }}
9285
release_name: v${{ steps.publish.outputs.version }}
9386
draft: false
94-
prerelease: false
87+
prerelease: false

.github/workflows/verify.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: Verify
22

33
on: [pull_request]
44

5+
concurrency:
6+
group: verify-${{ github.head_ref }}
7+
cancel-in-progress: true
8+
59
jobs:
610
build:
711
name: Build
@@ -10,28 +14,14 @@ jobs:
1014
matrix:
1115
node-version: [12.x, 14.x]
1216
steps:
13-
- name: Cancel Previous Runs
14-
uses: styfle/cancel-workflow-action@0.9.1
15-
with:
16-
access_token: ${{ github.token }}
17-
1817
- name: Checkout code
19-
uses: actions/checkout@v2
18+
uses: actions/checkout@v2.4.0
2019

21-
- name: Use Node.js ${{ matrix.node-version }}
22-
uses: actions/setup-node@v2.4.1
20+
- name: Use Node ${{ matrix.node-version }}
21+
uses: actions/setup-node@v2.5.0
2322
with:
2423
node-version: ${{ matrix.node-version }}
25-
26-
- name: Get yarn cache
27-
id: yarn-cache
28-
run: echo "::set-output name=dir::$(yarn cache dir)"
29-
30-
# Setup dependency caching
31-
- uses: actions/cache@v2.1.6
32-
with:
33-
path: ${{ steps.yarn-cache.outputs.dir }}
34-
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
24+
cache: 'yarn'
3525

3626
- name: Install Dependencies
3727
env:

examples/react-firebase-redux/src/routes/Account/components/AccountEditor/AccountEditor.js

Lines changed: 0 additions & 53 deletions
This file was deleted.

examples/react-firebase-redux/src/routes/Account/components/AccountEditor/AccountEditor.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import React from 'react'
22
import Grid from '@material-ui/core/Grid'
3-
import { makeStyles } from '@material-ui/core/styles'
3+
import { styled } from '@mui/material/styles';
44
import { useSelector } from 'react-redux'
55
import { isLoaded, useFirebase } from 'react-redux-firebase'
66
import LoadingSpinner from 'components/LoadingSpinner'
77
import { useNotifications } from 'modules/notification'
88
import defaultUserImageUrl from 'static/User.png'
99
import AccountForm from '../AccountForm'
10-
import styles from './AccountEditor.styles'
1110

12-
const useStyles = makeStyles(styles)
11+
export const TileContent = styled(Paper)(() => ({
12+
display: 'flex',
13+
justifyContent: 'space-between',
14+
width: '100%'
15+
}));
1316

1417
function AccountEditor() {
15-
const classes = useStyles()
1618
const { showSuccess, showError } = useNotifications()
1719
const firebase = useFirebase()
1820

examples/react-firebase-redux/src/routes/Account/components/AccountForm/AccountForm.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
33
import { useForm } from 'react-hook-form'
4+
import { styled } from '@mui/material/styles'
45
import TextField from '@material-ui/core/TextField'
56
import Typography from '@material-ui/core/Typography'
6-
import { makeStyles } from '@material-ui/core/styles'
77
import Button from '@material-ui/core/Button'
88
import { validateEmail } from 'utils/form'
99
import ProviderDataForm from '../ProviderDataForm'
10-
import styles from './AccountForm.styles'
1110

12-
const useStyles = makeStyles(styles)
11+
export const Root = styled('form')(({ theme }) => ({
12+
...theme.flexColumnCenter,
13+
justifyContent: 'flex-start',
14+
width: '100%',
15+
height: '100%'
16+
}));
17+
18+
export const Content = styled('form')(() => ({
19+
width: '100%',
20+
marginBottom: '2rem'
21+
}));
1322

1423
function AccountForm({ account, onSubmit }) {
15-
const classes = useStyles()
1624
const {
1725
register,
1826
handleSubmit,
@@ -25,8 +33,8 @@ function AccountForm({ account, onSubmit }) {
2533
})
2634

2735
return (
28-
<form className={classes.root} onSubmit={handleSubmit(onSubmit)}>
29-
<div className={classes.fields}>
36+
<Root onSubmit={handleSubmit(onSubmit)}>
37+
<Content>
3038
<TextField
3139
name="displayName"
3240
label="Display Name"
@@ -54,7 +62,7 @@ function AccountForm({ account, onSubmit }) {
5462
inputRef={register}
5563
fullWidth
5664
/>
57-
</div>
65+
</Content>
5866
{!!account && !!account.providerData && (
5967
<div>
6068
<Typography variant="h6">Linked Accounts</Typography>
@@ -68,7 +76,7 @@ function AccountForm({ account, onSubmit }) {
6876
disabled={isSubmitting || !isValid}>
6977
{isSubmitting ? 'Saving' : 'Save'}
7078
</Button>
71-
</form>
79+
</Root>
7280
)
7381
}
7482

examples/react-firebase-redux/src/routes/Account/components/AccountForm/AccountForm.styles.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

examples/react-firebase-redux/src/routes/Account/components/AccountPage/AccountPage.js

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,38 @@ import React from 'react'
22
import Paper from '@material-ui/core/Paper'
33
import Grid from '@material-ui/core/Grid'
44
import Typography from '@material-ui/core/Typography'
5-
import { makeStyles } from '@material-ui/core/styles'
65
import AccountEditor from '../AccountEditor'
7-
import styles from './AccountPage.styles'
6+
import { styled } from '@mui/material/styles';
87

9-
const useStyles = makeStyles(styles)
8+
export const Root = styled(Grid)(({ theme }) => ({
9+
paddingTop: theme.spacing(3),
10+
paddingBottom: theme.spacing(3),
11+
overflowY: 'scroll'
12+
}));
13+
14+
export const Item = styled(Grid)(({ theme }) => ({
15+
textAlign: 'center',
16+
marginTop: theme.spacing(5)
17+
}));
18+
19+
export const Pane = styled(Paper)(({ theme }) => ({
20+
...theme.flexColumnCenter,
21+
justifyContent: 'space-around',
22+
padding: theme.spacing(6)
23+
}));
1024

1125
function AccountPage() {
1226
const classes = useStyles()
1327

1428
return (
15-
<Grid container className={classes.root} justifyContent="center">
16-
<Grid item xs={10} md={8} lg={6} className={classes.gridItem}>
17-
<Paper className={classes.pane}>
29+
<Root container justifyContent="center">
30+
<Item item xs={10} md={8} lg={6}>
31+
<Pane>
1832
<Typography variant="h4">Account</Typography>
1933
<AccountEditor />
20-
</Paper>
21-
</Grid>
22-
</Grid>
34+
</Pane>
35+
</Item>
36+
</Root>
2337
)
2438
}
2539

examples/react-firebase/.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ module.exports = {
3030
trailingComma: 'none',
3131
semi: false,
3232
bracketSpacing: true,
33-
jsxBracketSameLine: true,
3433
printWidth: 80,
3534
tabWidth: 2,
3635
useTabs: false

examples/react-firebase/config/local-emulators.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if (missingEnvVars.length) {
1111
}
1212

1313
const gcloudProject = process.env.GCLOUD_PROJECT
14-
const firestoreHost = `localhost:${emulators.firestore.port}`
14+
const authHost = `localhost:${emulators.auth.port}`
1515
const databaseHost = `localhost:${emulators.database.port}`
1616

1717
// Set emulator env vars so Firebase internals know that we're using the emulators
@@ -20,6 +20,7 @@ process.env.FIREBASE_DATABASE_EMULATOR_HOST = databaseHost
2020
const config = {
2121
cloudFunctionsUrl: `http://localhost:${emulators.functions.port}/${gcloudProject}/us-central1`,
2222
emulators: {
23+
authHost,
2324
databaseHost,
2425
functionsHost: `http://localhost:${emulators.functions.port}`
2526
},

examples/react-firebase/package.json

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,25 @@
3030
"author": "prescottprue (https://github.com/prescottprue)",
3131
"license": "MIT",
3232
"dependencies": {
33-
"@material-ui/core": "^4.12.2",
34-
"@material-ui/icons": "^4.11.2",
35-
"firebase": "^8.10.0",
36-
"notistack": "^1.0.10",
33+
"@emotion/react": "^11.4.1",
34+
"@emotion/styled": "^11.3.0",
35+
"@fontsource/roboto": "^4.5.1",
36+
"@mui/icons-material": "^5.0.3",
37+
"@mui/material": "^5.0.3",
38+
"@mui/styles": "^5.0.1",
39+
"firebase": "^9.1.2",
40+
"notistack": "^2.0.2",
3741
"prop-types": "^15.7.2",
3842
"react": "^17.0.2",
3943
"react-dom": "^17.0.2",
4044
"react-google-button": "^0.7.2",
41-
"react-hook-form": "^7.15.2",
45+
"react-hook-form": "^7.17.2",
4246
"react-router-dom": "^5.3.0",
43-
"reactfire": "^3.0.0-rc.0"
47+
"reactfire": "^4.2.0"
4448
},
4549
"devDependencies": {
46-
"@craco/craco": "6.2.0",
47-
"@sentry/cli": "^1.68.0",
50+
"@craco/craco": "6.3.0",
51+
"@sentry/cli": "^1.69.1",
4852
"babel-eslint": "^10.1.0",
4953
"config": "^3.3.6",
5054
"cross-env": "^7.0.3",
@@ -63,11 +67,11 @@
6367
"eslint-plugin-react-hooks": "^4.2.0",
6468
"eslint-plugin-standard": "^5.0.0",
6569
"firebase-ci": "^0.15.0",
66-
"firebase-tools": "^9.16.0",
70+
"firebase-tools": "^9.20.0",
6771
"husky": "^7.0.1",
68-
"lint-staged": "^11.1.2",
72+
"lint-staged": "^11.2.3",
6973
"minimist": "1.2.5",
70-
"prettier": "^2.3.2",
74+
"prettier": "^2.4.1",
7175
"react-scripts": "^4.0.3",
7276
"react-test-renderer": "^17.0.2"
7377
},

0 commit comments

Comments
 (0)