create-epicflare 1.0.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 (3) hide show
  1. package/README.md +25 -0
  2. package/index.ts +57 -0
  3. package/package.json +17 -0
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # create-epicflare
2
+
3
+ A simple CLI tool to quickly create a new epicflare app.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ bunx create-epicflare <app-name>
9
+ ```
10
+
11
+ This will:
12
+
13
+ 1. Clone the epicflare template using `degit`
14
+ 2. Install dependencies with `bun install`
15
+ 3. Run the guided post-download setup script
16
+ 4. Start the dev server
17
+
18
+ ## Example
19
+
20
+ ```bash
21
+ bunx create-epicflare my-epicflare-app
22
+ ```
23
+
24
+ This creates a new directory called `my-epicflare-app` with a fresh epicflare
25
+ installation, runs the setup wizard, and starts the development server.
package/index.ts ADDED
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env bun
2
+
3
+ import { spawnSync } from 'node:child_process'
4
+ import { join } from 'node:path'
5
+
6
+ const appName = process.argv[2]
7
+
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)
12
+ }
13
+
14
+ const commands = [
15
+ {
16
+ cmd: 'bunx',
17
+ args: ['degit', 'epicweb-dev/epicflare', appName],
18
+ description: `Cloning epicflare template to ${appName}...`,
19
+ },
20
+ {
21
+ cmd: 'bun',
22
+ args: ['install'],
23
+ description: 'Installing dependencies...',
24
+ cwd: appName,
25
+ },
26
+ {
27
+ cmd: 'bun',
28
+ args: ['./docs/post-download.ts', '--guided'],
29
+ description: 'Running post-download setup...',
30
+ cwd: appName,
31
+ },
32
+ {
33
+ cmd: 'bun',
34
+ args: ['run', 'dev'],
35
+ description: 'Starting dev server...',
36
+ cwd: appName,
37
+ },
38
+ ]
39
+
40
+ for (const { cmd, args, description, cwd } of commands) {
41
+ console.log(description)
42
+ const result = spawnSync(cmd, args, {
43
+ stdio: 'inherit',
44
+ cwd: cwd ? join(process.cwd(), cwd) : process.cwd(),
45
+ shell: false,
46
+ })
47
+
48
+ if (result.error) {
49
+ console.error(`Error running ${cmd} ${args.join(' ')}:`, result.error)
50
+ process.exit(1)
51
+ }
52
+
53
+ if (result.status !== 0) {
54
+ console.error(`Command failed: ${cmd} ${args.join(' ')}`)
55
+ process.exit(result.status ?? 1)
56
+ }
57
+ }
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "create-epicflare",
3
+ "version": "1.0.0",
4
+ "description": "CLI tool to quickly create a new epicflare app",
5
+ "type": "module",
6
+ "bin": {
7
+ "create-epicflare": "./index.ts"
8
+ },
9
+ "keywords": [
10
+ "epicflare",
11
+ "cli",
12
+ "cloudflare",
13
+ "remix"
14
+ ],
15
+ "author": "Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com/)",
16
+ "license": "MIT"
17
+ }