Skip to content

Commit 97731f3

Browse files
authored
v8.0.0 (#371)
## Breaking Changes * Drop support for node pre v12 * Switch to node 14 in CI workflows * Update to Node 14 Runtime in cloud functions ## Features/Updates * react-hook-form v6 to v7 * cypress v6 to v7 * Adding preview channel to verify workflow (with associated delete preview channel workflow which removes preview channel on merge) * Update `husky` v4 to v6 * Update `yeoman-generator` from v4 to v5 * Update `yeoman-test` from v2 to v6
1 parent 44afb7c commit 97731f3

124 files changed

Lines changed: 4236 additions & 3182 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.

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
plugins: ['babel', 'react', 'prettier'],
66
settings: {
77
react: {
8-
version: '16.10'
8+
version: '17.0.0'
99
}
1010
},
1111
rules: {

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
- name: Checkout code
1919
uses: actions/checkout@v2
2020

21-
- name: Use Node 12
21+
- name: Use Node 14
2222
uses: actions/setup-node@v2.1.5
2323
with:
24-
node-version: 12
24+
node-version: 14
2525
registry-url: https://registry.npmjs.org/
2626

2727
- name: Get yarn cache

.github/workflows/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
node-version: [10.x, 12.x, 14.x]
11+
node-version: [12.x, 14.x]
1212
steps:
1313
- name: Cancel Previous Runs
1414
uses: styfle/cancel-workflow-action@0.9.0

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lint-staged

examples/react-firebase-redux/src/routes/Projects/components/ProjectsList/ProjectsList.js

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

examples/react-firebase/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
plugins: ['import', 'react', 'react-hooks', 'prettier'],
66
settings: {
77
react: {
8-
version: '16.12'
8+
version: '17.0'
99
},
1010
'import/resolver': {
1111
node: {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"projects": {
33
"default": "redux-firebasev3",
4-
"master": "redux-firebasev3",
4+
"main": "redux-firebasev3",
55
"prod": "redux-firebasev3"
66
}
77
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Delete Preview Channel
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types: [closed]
8+
9+
jobs:
10+
check:
11+
name: remove channel
12+
runs-on: ${{ matrix.os }}
13+
timeout-minutes: 20
14+
strategy:
15+
matrix:
16+
os: [ubuntu-20.04]
17+
node-version: [14.x]
18+
steps:
19+
- name: Cancel previous runs
20+
uses: styfle/cancel-workflow-action@0.9.0
21+
with:
22+
access_token: ${{ github.token }}
23+
24+
- name: Checkout code
25+
uses: actions/checkout@v2
26+
27+
- name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
28+
uses: actions/setup-node@v2.1.5
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
32+
- name: Get Yarn cache
33+
id: yarn-cache
34+
run: echo "::set-output name=dir::$(yarn cache dir)"
35+
36+
- name: Cache Yarn dependencies
37+
uses: actions/cache@v2.1.5
38+
with:
39+
path: ${{ steps.yarn-cache.outputs.dir }}
40+
key: ${{ runner.os }}-yarn-${{ matrix.app }}-preview-remove-${{ hashFiles('yarn.lock') }}
41+
42+
- name: Install dependencies
43+
run: yarn install --frozen-lockfile
44+
45+
- name: Remove Preview Channel
46+
env:
47+
GCLOUD_PROJECT: redux-firebasev3
48+
PR_NUMBER: ${{ github.event.number }}
49+
APP_NAME: ${{ matrix.app }}
50+
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
51+
run: |
52+
./bin/remove-preview-channel.js --pullRequest=$PR_NUMBER

examples/react-firebase/.github/workflows/deploy.yml

Lines changed: 19 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Setup Node
2323
uses: actions/setup-node@v2.1.5
2424
with:
25-
node-version: 12
25+
node-version: 14
2626

2727
- name: Get Library Versions For Binary Caching
2828
id: cache-settings
@@ -43,70 +43,37 @@ jobs:
4343
yarn install --frozen-lockfile
4444
yarn --cwd functions install --frozen-lockfile
4545
46-
- name: Set App Environment Settings
47-
env:
48-
MASTER_SERVICE_ACCOUNT: ${{ secrets.MASTER_SERVICE_ACCOUNT }}
49-
PROD_SERVICE_ACCOUNT: ${{ secrets.PROD_SERVICE_ACCOUNT }}
50-
GITHUB_HEAD_REF: ${{ github.head_ref }}
51-
GITHUB_REF: ${{ github.ref }}
52-
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
46+
- name: Set environment
5347
run: |
54-
set -o pipefail
55-
56-
# Throw a clear error if FIREBASE_TOKEN secret is not set
57-
if [ -z "$FIREBASE_TOKEN" ];
58-
then
59-
errMsg="\"FIREBASE_TOKEN\" github secret is required to load project configuration. Visit https://github.com/${{ github.repository }}/settings/secrets to set."
60-
echo "::error ::$errMsg"
61-
exit 1
62-
fi
63-
6448
# Get branch name from github ref (i.e. refs/heads/master -> master)
6549
gitBranch=${GITHUB_REF##*/}
6650
6751
# Find the config associated to the firebase project in .firebaserc (falling back to default)
6852
gcloudProject=$(cat .firebaserc | jq -r --arg alias "$gitBranch" '.projects[$alias] // .projects.default')
6953
appName=react-firebase
54+
7055
echo "Setting environment for branch: $gitBranch, project: $gcloudProject, and app: $appName..."
7156
7257
# Set variables to environment to be used in later steps
7358
echo "GCLOUD_PROJECT=$gcloudProject" >> $GITHUB_ENV
59+
echo "NODE_CONFIG_ENV=$branch" >> $GITHUB_ENV
60+
echo "ENV=$branch" >> $GITHUB_ENV
7461
75-
# Get value of Service Account associated with branch (i.e. STAGE_SERVICE_ACCOUNT)
76-
branchPrefix=$(echo $gitBranch | tr a-z A-Z | tr - _)
77-
branchSaKey="${branchPrefix}_SERVICE_ACCOUNT"
78-
branchSa=$(eval echo \$${branchSaKey})
79-
if [[ ! -z "${branchSa}" ]]; then
80-
echo Using service account with key \"$branchSaKey\"
81-
serviceAccount=$branchSa
82-
else
83-
echo Falling back to service account with key "DEVELOP_SERVICE_ACCOUNT"
84-
serviceAccount=$DEVELOP_SERVICE_ACCOUNT
62+
- name: Generate Firebase SDK config for ${{ env.GCLOUD_PROJECT }}
63+
env:
64+
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
65+
run: |
66+
set -o pipefail
67+
68+
# Throw a clear error if FIREBASE_TOKEN secret is not set
69+
if [ -z "$FIREBASE_TOKEN" ];
70+
then
71+
missingTokenErrMsg="\"FIREBASE_TOKEN\" github secret is required to load project configuration. Visit https://github.com/${{ github.repository }}/settings/secrets to set."
72+
echo "::error ::$missingTokenErrMsg"
73+
exit 1
8574
fi
8675
87-
echo "Service Account selected for projectId $(echo $serviceAccount | jq .project_id)"
88-
89-
# Generate Service Account file required to prevent credential error during functions unit tests (jq used to format)
90-
echo "Generating Service Account File..."
91-
echo "$(echo $serviceAccount | jq .)" > $HOME/serviceAccount.json
92-
echo "GOOGLE_APPLICATION_CREDENTIALS=$HOME/serviceAccount.json" >> $GITHUB_ENV
93-
94-
# Use Firebase SDK API to get the app's configuration and export to REACT_APP prefixed environment variables
95-
# NOTE: databaseURL is intentionally removed since it is set above
96-
firebaseConfig=$(npx firebase --project $gcloudProject apps:sdkconfig WEB \
97-
$(npx firebase --project $gcloudProject apps:list WEB | grep $appName | awk '{ print $4}') | \
98-
tr '\n' ' ' | \
99-
sed 's/.*initializeApp(//g' | \
100-
sed 's/);//g' | \
101-
jq -r 'to_entries[] | [.key, (.value | tojson)] | join("::")' | \
102-
sed 's/::"/=/g; s/^/echo \"REACT_APP_FB_/g' \
103-
)
104-
105-
# Loop through each line of config and evaluate to export env vars
106-
while IFS= read -r line; do
107-
echo Evaluating: $line
108-
eval $line >> $GITHUB_ENV
109-
done <<< "$firebaseConfig"
76+
bin/generate-firebase-sdk-config.js --file ./config/default.json
11077
11178
- name: Verify App
11279
run: |
@@ -140,7 +107,7 @@ jobs:
140107
- name: Check if version has been updated
141108
if: github.ref == 'refs/heads/prod'
142109
id: check
143-
uses: EndBug/version-check@v1
110+
uses: EndBug/version-check@v2.0.1
144111

145112
- name: Create Github Release
146113
if: github.ref == 'refs/heads/prod' && steps.check.outputs.changed == 'true'

0 commit comments

Comments
 (0)