@edgedev/create-edge-app 1.0.8 → 1.0.12

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.
Files changed (2) hide show
  1. package/bin/cli.js +59 -58
  2. package/package.json +4 -2
package/bin/cli.js CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
+ console.log('Script started')
2
3
  const { execSync } = require('child_process')
3
- const fs = require('fs')
4
- const readline = require('readline')
4
+ // const fs = require('fs')
5
+ // const readline = require('readline')
5
6
 
6
7
  const runCommand = (command) => {
7
8
  try {
@@ -15,57 +16,57 @@ const runCommand = (command) => {
15
16
  return true
16
17
  }
17
18
 
18
- const promptForProjectId = () => {
19
- const rl = readline.createInterface({
20
- input: process.stdin,
21
- output: process.stdout,
22
- })
23
-
24
- return new Promise((resolve, reject) => {
25
- rl.question('Please enter your Firebase project ID: ', (projectId) => {
26
- rl.close()
27
- resolve(projectId)
28
- })
29
- })
30
- }
31
-
32
- const initializeFirebase = async (projectId, repoName) => {
33
- if (!projectId) {
34
- console.error('Error: Firebase project ID cannot be empty.')
35
- process.exit(1)
36
- }
37
-
38
- try {
39
- execSync('firebase --version', { stdio: 'inherit' })
40
- }
41
- catch (err) {
42
- console.error('Firebase CLI could not be found. Please install it and try again.')
43
- process.exit(1)
44
- }
45
-
46
- const pathToFirebaseJson = `${repoName}/firebase.json`
47
- const pathToFirestoreRules = `${repoName}/firestore.rules`
48
-
49
- if (fs.existsSync(pathToFirebaseJson)) {
50
- fs.renameSync(pathToFirebaseJson, `${pathToFirebaseJson}.temp`)
51
- }
52
-
53
- if (fs.existsSync(pathToFirestoreRules)) {
54
- fs.renameSync(pathToFirestoreRules, `${pathToFirestoreRules}.temp`)
55
- }
56
-
57
- console.log(`Initializing Firebase for ${repoName}...`)
58
- runCommand(`cd ${repoName} && firebase use --add ${projectId} --alias default`)
59
- runCommand(`cd ${repoName} && firebase init firestore functions hosting storage emulators --project default`)
60
-
61
- if (fs.existsSync(`${pathToFirebaseJson}.temp`)) {
62
- fs.renameSync(`${pathToFirebaseJson}.temp`, pathToFirebaseJson)
63
- }
64
-
65
- if (fs.existsSync(`${pathToFirestoreRules}.temp`)) {
66
- fs.renameSync(`${pathToFirestoreRules}.temp`, pathToFirestoreRules)
67
- }
68
- }
19
+ // const promptForProjectId = () => {
20
+ // const rl = readline.createInterface({
21
+ // input: process.stdin,
22
+ // output: process.stdout,
23
+ // })
24
+
25
+ // return new Promise((resolve, reject) => {
26
+ // rl.question('Please enter your Firebase project ID: ', (projectId) => {
27
+ // rl.close()
28
+ // resolve(projectId)
29
+ // })
30
+ // })
31
+ // }
32
+
33
+ // const initializeFirebase = async (projectId, repoName) => {
34
+ // if (!projectId) {
35
+ // console.error('Error: Firebase project ID cannot be empty.')
36
+ // process.exit(1)
37
+ // }
38
+
39
+ // try {
40
+ // execSync('firebase --version', { stdio: 'inherit' })
41
+ // }
42
+ // catch (err) {
43
+ // console.error('Firebase CLI could not be found. Please install it and try again.')
44
+ // process.exit(1)
45
+ // }
46
+
47
+ // const pathToFirebaseJson = `${repoName}/firebase.json`
48
+ // const pathToFirestoreRules = `${repoName}/firestore.rules`
49
+
50
+ // if (fs.existsSync(pathToFirebaseJson)) {
51
+ // fs.renameSync(pathToFirebaseJson, `${pathToFirebaseJson}.temp`)
52
+ // }
53
+
54
+ // if (fs.existsSync(pathToFirestoreRules)) {
55
+ // fs.renameSync(pathToFirestoreRules, `${pathToFirestoreRules}.temp`)
56
+ // }
57
+
58
+ // console.log(`Initializing Firebase for ${repoName}...`)
59
+ // runCommand(`cd ${repoName} && firebase use --add ${projectId} --alias default`)
60
+ // runCommand(`cd ${repoName} && firebase init firestore functions hosting storage emulators --project default`)
61
+
62
+ // if (fs.existsSync(`${pathToFirebaseJson}.temp`)) {
63
+ // fs.renameSync(`${pathToFirebaseJson}.temp`, pathToFirebaseJson)
64
+ // }
65
+
66
+ // if (fs.existsSync(`${pathToFirestoreRules}.temp`)) {
67
+ // fs.renameSync(`${pathToFirestoreRules}.temp`, pathToFirestoreRules)
68
+ // }
69
+ // }
69
70
 
70
71
  const repoName = process.argv[2]
71
72
  const gitCheckoutCommand = `git clone --depth 1 https://github.com/Edge-Marketing-and-Design/edgeApp.git ${repoName}`
@@ -92,9 +93,9 @@ if (!installedFunctionDeps) {
92
93
 
93
94
  console.log(`Successfully created ${repoName}!`)
94
95
 
95
- const main = async () => {
96
- const projectId = await promptForProjectId()
97
- await initializeFirebase(projectId, repoName)
98
- }
96
+ // const main = async () => {
97
+ // const projectId = await promptForProjectId()
98
+ // await initializeFirebase(projectId, repoName)
99
+ // }
99
100
 
100
- main()
101
+ // main()
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "@edgedev/create-edge-app",
3
- "version": "1.0.8",
3
+ "version": "1.0.12",
4
4
  "description": "Create Edge Starter App",
5
- "bin": "./bin/cli.js",
5
+ "bin": {
6
+ "create-edge-app": "./bin/cli.js"
7
+ },
6
8
  "scripts": {
7
9
  "build": "nuxt build",
8
10
  "dev": "nuxt dev",