-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage--ARCHIVE.json
112 lines (74 loc) · 7.24 KB
/
package--ARCHIVE.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{
"name": "jailbreak",
"version": "0.1.0",
"private": true,
"scripts": {
"//------- HELPERS --------": "Usually to be called by other scripts",
"//firebase-emulate": "Runs Firebase emulators, importing data on-load & exporting on exit.",
"firebase-emulate": "firebase emulators:start --import=./emulator-data --export-on-exit",
"//next-dev": "Runs the Next.js hot-reloading front-end dev build & server. Need this as a helper so we can run it with the npm-run-all package.",
"next-dev": "next dev",
"//get-firebase-config": "Pulls-down the Firebase config for whatever the current Firebase CLI project context is (whichever project was specified by the last “firebase use bla” command). Code ingests this config to know which project to connect to.",
"get-firebase-config": "firebase apps:sdkconfig web --json > ./firebase-config.json",
"//gen-dev-local-env": "Generates an env file which will set the “USE EMULATORS” value to FALSE (non-default for dev) so the code will connect to a real backend (only needed for certain scenarios). This env file takes precedence over other existing env files (see Next.js env variables docs). The script which calls this should also delete the generated file so it only exists for one session.",
"gen-dev-local-env": "echo NEXT_PUBLIC_USE_FIREBASE_EMULATORS=false > .env.development.local",
"//delete-gen-dev-local-env": "Deletes the temporary env file that was generated by gen-dev-local-env",
"delete-gen-dev-local-env": "rm .env.development.local",
"//gen-prod-local-env": "Generates an env file which will set the “USE EMULATORS” value to TRUE so the code will connect to the Firebase emulators (only needed for certain scenarios). This env file takes precedence over other existing env files (see Next.js env variables docs). The script which calls this should also delete the generated file so it only exists for this session.",
"gen-prod-local-env": "echo NEXT_PUBLIC_USE_FIREBASE_EMULATORS=true > .env.production.local",
"//delete-gen-prod-local-env": "Deletes the temporary env file that was generated by gen-prod-local-env",
"delete-gen-prod-local-env": "rm .env.production.local",
"//------- RUNNING/BUILDING CODE ---------": "",
"//dev": "Runs hot-reloading front-end and the Firebase emulators backend simultaneously",
"dev": "npm run get-firebase-config && npm-run-all --parallel firebase-emulate next-dev",
"//dev:real-backend": "Runs hot-reloading front-end & generates environment variables which tells the code to connect to the 'real backend' instead of the emulators. Probably only needed occasionally to check for things like if a Firestore composite index is needed.",
"dev:real-backend": "npm run gen-dev-local-env && npm run get-firebase-config && next dev && npm run delete-gen-dev-local-env",
"//build": "Builds front-end code for production, then exports the static assets to be deployed.",
"build": "npm run get-firebase-config && next build && next export",
"//build-ci": "Build script for a CI/CD environment (GitHub actions). Part of build & deploy process is specified in the workflow yml file (it has to be done there due to GitHub action environment variable rules, it seems). I can not run get-firebase-config on the CI/CD environment due to not being able to specify the token here in this file.",
"build-ci": "next build && next export",
"//(1)build-ci:staging--TEMP": "Debugging why the firebase CLI commands in the build-ci:staging or get-firebase-config don't work.",
"//(2)build-ci:staging--TEMP": "echo $FIREBASE_TOKEN appears to render nothing (empty string?) on the GitHub action run. $secrets.FIREBASE_TOKEN renders '.FIREBASE_TOKEN'. I think that var may only be available to the workflow file.",
"build-ci:staging--TEMP": "echo $secrets.FIREBASE_TOKEN",
"//build-ci:staging": "Build script for a CI/CD environment (e.g., GitHub actions) for the staging build. The 'firebase use __' is needed to set the Firebase project context so that the other firebase cli command which grabs project config will work correctly.",
"build-ci:staging": "firebase use staging --token '$FIREBASE_TOKEN' && npm run build",
"//build-ci:prod": "Build script for a CI/CD environment (e.g., GitHub actions) for the prod build",
"build-ci:prod": "firebase use prod --token '$FIREBASE_TOKEN' && npm run build",
"//build:emulators": "Builds front-end code for production, exports the static assets, generates a temporary env file so the Firebase emulators will be used instead of real backend",
"build:emulators": "npm run gen-prod-local-env && npm run build && npm run firebase-emulate && npm run delete-gen-prod-local-env",
"//build:all": "Builds & exports for production: Both front-end code and Firebase cloud functions.",
"build:all": "npm run build && cd functions && npm i && cd .. && npm run lint:functions",
"//serve-static": "Serves pre-built production front-end assets",
"serve-static": "serve ./out",
"//start": "Runs a front-end production server",
"start": "next start",
"lint": "next lint",
"lint:functions": "cd functions && npm run lint",
"//------- ENVIRONMENT SWITCHING ---------": "Switching & setting several aspects such as git branch, Firebase CLI context, and Firebase config as an atomic-like action",
"//switch-to-dev": "Switches to a 'dev environment', which involves a git branch, firebase CLI project context for the staging project, and grabbing the Firebase config for that project.",
"switch-to-dev": "git checkout dev && firebase use staging && npm run get-firebase-config && echo \"Switched to DEV environment (git branch, Firebase CLI project context, Firebase project config for code). You should normally run a script which runs the emulators but if you don't then code will connect to the STAGING backend.\"",
"//switch-to-staging": "Switches to a 'staging environment', which involves a git branch, firebase CLI project context for the staging project, and grabbing the Firebase config for that project.",
"switch-to-staging": "git checkout staging && firebase use staging && npm run get-firebase-config && echo 'Switched to STAGING environment (git branch, Firebase CLI project context, Firebase project config for code)'",
"//switch-to-prod": "Switches to a 'production environment', which involves a git branch, firebase CLI project context for the production project, and grabbing the Firebase config for that project.",
"switch-to-prod": "git checkout main && firebase use prod && npm run get-firebase-config && echo 'Switched to PROD environment (git branch, Firebase CLI project context, Firebase project config for code)'"
},
"dependencies": {
"@emotion/react": "^11.8.1",
"@emotion/styled": "^11.8.1",
"@mui/icons-material": "^5.4.2",
"@mui/material": "^5.4.3",
"@mui/styled-engine-sc": "^5.4.2",
"firebase": "^9.6.7",
"next": "12.1.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-firebase-hooks": "^5.0.3",
"styled-components": "^5.3.3"
},
"devDependencies": {
"eslint": "8.9.0",
"eslint-config-next": "12.1.0",
"firebase-tools": "^10.8.0",
"npm-run-all": "^4.1.5"
}
}