create-airjam 0.2.0 → 0.2.1
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/dist/index.js +5 -0
- package/package.json +1 -1
- package/templates/pong/.env.example +2 -2
- package/templates/pong/README.md +5 -3
- package/templates/pong/_gitignore +5 -0
- package/templates/pong/airjam-docs/getting-started/quick-start/page.md +1 -1
- package/templates/pong/airjam-docs/sdk/hooks/page.md +2 -1
- package/templates/pong/vercel.json +19 -0
package/dist/index.js
CHANGED
|
@@ -82,6 +82,11 @@ Creating project in ${targetDir}...
|
|
|
82
82
|
return true;
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
|
+
const gitignorePlaceholderPath = path.join(targetDir, "_gitignore");
|
|
86
|
+
const gitignorePath = path.join(targetDir, ".gitignore");
|
|
87
|
+
if (fs.existsSync(gitignorePlaceholderPath)) {
|
|
88
|
+
await fs.move(gitignorePlaceholderPath, gitignorePath, { overwrite: true });
|
|
89
|
+
}
|
|
85
90
|
const pkgPath = path.join(targetDir, "package.json");
|
|
86
91
|
if (fs.existsSync(pkgPath)) {
|
|
87
92
|
const pkg = await fs.readJson(pkgPath);
|
package/package.json
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
# For production, set to your official Air Jam server URL: wss://api.air-jam.app
|
|
6
6
|
VITE_AIR_JAM_SERVER_URL=http://localhost:4000
|
|
7
7
|
|
|
8
|
-
# API Key - optional for local development (not required when using local server)
|
|
8
|
+
# Public API Key - optional for local development (not required when using local server)
|
|
9
9
|
# Required for production - get from Air Jam platform
|
|
10
|
-
|
|
10
|
+
VITE_AIR_JAM_PUBLIC_KEY=
|
|
11
11
|
|
|
12
12
|
# HTTPS host used only by `pnpm run dev:secure` (set by `pnpm run secure:init`)
|
|
13
13
|
# Example: https://my-game-dev.example.com
|
package/templates/pong/README.md
CHANGED
|
@@ -48,7 +48,7 @@ If you prefer to use the official Air Jam server instead of running locally:
|
|
|
48
48
|
2. Set in `.env.local`:
|
|
49
49
|
```bash
|
|
50
50
|
VITE_AIR_JAM_SERVER_URL=https://api.air-jam.app
|
|
51
|
-
|
|
51
|
+
VITE_AIR_JAM_PUBLIC_KEY=your-public-key-here
|
|
52
52
|
```
|
|
53
53
|
3. Run only the game:
|
|
54
54
|
```bash
|
|
@@ -108,7 +108,8 @@ src/
|
|
|
108
108
|
See `.env.example` for all available environment variables. Key variables:
|
|
109
109
|
|
|
110
110
|
- `VITE_AIR_JAM_SERVER_URL` - Server URL (defaults to localhost:4000 for local dev)
|
|
111
|
-
- `
|
|
111
|
+
- `VITE_AIR_JAM_PUBLIC_KEY` - Public API key (optional for local dev, required for production)
|
|
112
|
+
- `VITE_AIR_JAM_API_KEY` - Legacy public key variable (still supported)
|
|
112
113
|
- `AIR_JAM_SECURE_PUBLIC_HOST` - HTTPS hostname used by `dev:secure` for host/controller URLs
|
|
113
114
|
- `CLOUDFLARE_TUNNEL_NAME` - Named Cloudflare tunnel used by `dev:secure`
|
|
114
115
|
|
|
@@ -118,7 +119,7 @@ See `.env.example` for all available environment variables. Key variables:
|
|
|
118
119
|
|
|
119
120
|
1. Set environment variables in Vercel:
|
|
120
121
|
- `VITE_AIR_JAM_SERVER_URL` - Your official Air Jam server URL
|
|
121
|
-
- `
|
|
122
|
+
- `VITE_AIR_JAM_PUBLIC_KEY` - Your public API key from the Air Jam platform
|
|
122
123
|
|
|
123
124
|
2. Deploy:
|
|
124
125
|
```bash
|
|
@@ -126,6 +127,7 @@ See `.env.example` for all available environment variables. Key variables:
|
|
|
126
127
|
```
|
|
127
128
|
|
|
128
129
|
The game will connect to the official Air Jam server - no local server needed!
|
|
130
|
+
`vercel.json` is included in this template so `/controller?room=XXXX` and other SPA routes resolve correctly.
|
|
129
131
|
|
|
130
132
|
### Building for Production
|
|
131
133
|
|
|
@@ -93,7 +93,7 @@ When you're ready to share your game, you'll need to deploy it and connect it to
|
|
|
93
93
|
- Set the following environment variables in your deployment settings:
|
|
94
94
|
|
|
95
95
|
```bash
|
|
96
|
-
|
|
96
|
+
VITE_AIR_JAM_PUBLIC_KEY=your_public_key_here
|
|
97
97
|
VITE_AIR_JAM_SERVER_URL=wss://api.air-jam.app
|
|
98
98
|
```
|
|
99
99
|
|
|
@@ -43,7 +43,8 @@ const inputSchema = z.object({
|
|
|
43
43
|
The provider automatically reads from these environment variables if props aren't provided:
|
|
44
44
|
|
|
45
45
|
- `VITE_AIR_JAM_SERVER_URL` / `NEXT_PUBLIC_AIR_JAM_SERVER_URL` - WebSocket server URL
|
|
46
|
-
- `
|
|
46
|
+
- `VITE_AIR_JAM_PUBLIC_KEY` / `NEXT_PUBLIC_AIR_JAM_PUBLIC_KEY` - Public API key
|
|
47
|
+
- `VITE_AIR_JAM_API_KEY` / `NEXT_PUBLIC_AIR_JAM_API_KEY` - Legacy public key variable (still supported)
|
|
47
48
|
|
|
48
49
|
---
|
|
49
50
|
|