@edgedev/create-edge-app 1.0.14 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -59
- package/bin/cli.js +1 -1
- package/firebase_init.sh +39 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,63 +1,6 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
|
|
4
|
-
|
|
1
|
+
# Edge Firebase Starter
|
|
5
2
|
## Setup
|
|
6
3
|
|
|
7
|
-
Make sure to install the dependencies:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
# npm
|
|
11
|
-
npm install
|
|
12
|
-
|
|
13
|
-
# pnpm
|
|
14
|
-
pnpm install
|
|
15
|
-
|
|
16
|
-
# yarn
|
|
17
|
-
yarn install
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Development Server
|
|
21
|
-
|
|
22
|
-
Start the development server on `http://localhost:3000`:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
# npm
|
|
26
|
-
npm run dev
|
|
27
|
-
|
|
28
|
-
# pnpm
|
|
29
|
-
pnpm run dev
|
|
30
|
-
|
|
31
|
-
# yarn
|
|
32
|
-
yarn dev
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Production
|
|
36
|
-
|
|
37
|
-
Build the application for production:
|
|
38
|
-
|
|
39
4
|
```bash
|
|
40
|
-
|
|
41
|
-
npm run build
|
|
42
|
-
|
|
43
|
-
# pnpm
|
|
44
|
-
pnpm run build
|
|
45
|
-
|
|
46
|
-
# yarn
|
|
47
|
-
yarn build
|
|
5
|
+
npx @edgedev/create-edge-app yourappname
|
|
48
6
|
```
|
|
49
|
-
|
|
50
|
-
Locally preview production build:
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
# npm
|
|
54
|
-
npm run preview
|
|
55
|
-
|
|
56
|
-
# pnpm
|
|
57
|
-
pnpm run preview
|
|
58
|
-
|
|
59
|
-
# yarn
|
|
60
|
-
yarn preview
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
|
package/bin/cli.js
CHANGED
|
@@ -56,8 +56,8 @@ const initializeFirebase = async (projectId, repoName) => {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
console.log(`Initializing Firebase for ${repoName}...`)
|
|
59
|
-
runCommand(`cd ${repoName} && firebase init firestore functions hosting storage emulators --project default`)
|
|
60
59
|
runCommand(`cd ${repoName} && firebase use --add ${projectId} --alias default`)
|
|
60
|
+
runCommand(`cd ${repoName} && firebase init firestore functions hosting storage emulators --project default`)
|
|
61
61
|
|
|
62
62
|
if (fs.existsSync(`${pathToFirebaseJson}.temp`)) {
|
|
63
63
|
fs.renameSync(`${pathToFirebaseJson}.temp`, pathToFirebaseJson)
|
package/firebase_init.sh
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Prompt for the project ID
|
|
2
|
+
echo "Please enter your Firebase project ID:"
|
|
3
|
+
read project_id
|
|
4
|
+
|
|
5
|
+
# Check if project_id is empty
|
|
6
|
+
if [ -z "$project_id" ]; then
|
|
7
|
+
echo "Error: Firebase project ID cannot be empty."
|
|
8
|
+
exit 1
|
|
9
|
+
fi
|
|
10
|
+
|
|
11
|
+
# Check if firebase is installed
|
|
12
|
+
if ! command -v firebase &> /dev/null; then
|
|
13
|
+
echo "Firebase CLI could not be found. Please install it and try again."
|
|
14
|
+
exit 1
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
# Check if firebase.json exists and make a backup
|
|
18
|
+
if [ -f ./firebase.json ]; then
|
|
19
|
+
cp ./firebase.json ./firebase.json.temp
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# Check if firestore.rules exists and make a backup
|
|
23
|
+
if [ -f ./firestore.rules ]; then
|
|
24
|
+
cp ./firestore.rules ./firestore.rules.temp
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
# Initialize Firebase
|
|
28
|
+
firebase use --add $project_id --alias default
|
|
29
|
+
firebase init firestore functions hosting storage emulators --project default
|
|
30
|
+
|
|
31
|
+
# Restore firebase.json from backup
|
|
32
|
+
if [ -f ./firebase.json.temp ]; then
|
|
33
|
+
mv ./firebase.json.temp ./firebase.json
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
# Restore firestore.rules from backup
|
|
37
|
+
if [ -f ./firestore.rules.temp ]; then
|
|
38
|
+
mv ./firestore.rules.temp ./firestore.rules
|
|
39
|
+
fi
|