create-epicflare 1.0.0 → 1.1.0

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/index.ts +19 -5
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -2,13 +2,27 @@
2
2
 
3
3
  import { spawnSync } from 'node:child_process'
4
4
  import { join } from 'node:path'
5
+ import { createInterface } from 'node:readline'
5
6
 
6
- const appName = process.argv[2]
7
+ const appName = process.argv[2] || (await getAppName())
7
8
 
8
- if (!appName) {
9
- console.error('Error: Please provide an app name')
10
- console.error('Usage: bunx create-epicflare <app-name>')
11
- process.exit(1)
9
+ function getAppName() {
10
+ return new Promise<string>((resolve, reject) => {
11
+ const rl = createInterface({
12
+ input: process.stdin,
13
+ output: process.stdout,
14
+ })
15
+
16
+ rl.question('Please provide an app name: ', (answer: string) => {
17
+ if (!answer.trim()) {
18
+ reject(new Error('App name is required.'))
19
+ }
20
+ process.argv[2] = answer.trim()
21
+ rl.close()
22
+ // Re-run the script with the provided app name.
23
+ resolve(answer.trim())
24
+ })
25
+ })
12
26
  }
13
27
 
14
28
  const commands = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-epicflare",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "CLI tool to quickly create a new epicflare app",
5
5
  "type": "module",
6
6
  "bin": {