You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/ui/README.md
+40-8Lines changed: 40 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -324,10 +324,16 @@ In Netlify dashboard:
324
324
325
325
1. Go to **Site settings** → **Build & deploy**
326
326
2. Set **Base directory** to: `packages/ui`
327
-
3. Set **Build command** to: (leave empty - netlify.toml handles it)
327
+
3. Set **Build command** to: (default from `netlify.toml` is recommended)
328
+
- Default: `curl -fsSL https://bun.sh/install | bash && export PATH="$HOME/.bun/bin:$PATH" && bun run build`
329
+
- This installs Bun if needed, then builds browser code from `browser/` to `public/js/`
330
+
- If Bun is already available in your build environment, you can use: `bun run build`
328
331
4. Set **Publish directory** to: `public` (relative to base directory)
329
332
330
-
**Important**: The `publish` directory must be set in the Netlify dashboard, not in `netlify.toml`, because Netlify resolves paths in `netlify.toml` relative to the repo root, not the base directory.
333
+
**Important**:
334
+
- The `publish` directory must be set in the Netlify dashboard, not in `netlify.toml`, because Netlify resolves paths in `netlify.toml` relative to the repo root, not the base directory.
335
+
- The build command is required to bundle browser components from TypeScript to JavaScript.
336
+
- Static files in `public/js/` (like `components.js` and `app.js`) are served automatically by Netlify before redirects are processed.
331
337
332
338
### Step 4: Deploy
333
339
@@ -338,7 +344,7 @@ In Netlify dashboard:
338
344
3. Connect your Git repository
339
345
4. Configure:
340
346
-**Base directory**: `packages/ui`
341
-
-**Build command**: (leave empty or use `echo 'No build step needed'`)
347
+
-**Build command**: `bun run build` (or `npm run build` if Bun is not available)
342
348
-**Publish directory**: `public`
343
349
5. Add environment variables (see Step 1)
344
350
6. Click **Deploy site**
@@ -431,6 +437,21 @@ If you see the error: `Deploy directory 'public' does not exist`
431
437
- Ensure all dependencies are listed in `package.json`
432
438
- Check that TypeScript files are being transpiled correctly
433
439
- Verify that `node_bundler = "esbuild"` is set in `netlify.toml`
440
+
- Ensure the build command runs successfully (check build logs)
441
+
442
+
#### Build Command Fails
443
+
444
+
If `bun run build` fails in Netlify:
445
+
446
+
1.**Install Bun in build environment**: Add a build command that installs Bun first:
447
+
```
448
+
curl -fsSL https://bun.sh/install | bash && export PATH="$HOME/.bun/bin:$PATH" && bun run build
449
+
```
450
+
Or set it in Netlify dashboard: **Build & deploy** → **Build command**
451
+
452
+
2.**Alternative**: Commit the built files (`public/js/components.js` and `public/js/app.js`) to the repository so the build step isn't required (not recommended for production)
453
+
454
+
3.**Check build logs**: Look for errors in the Netlify build logs to see what's failing
434
455
435
456
### Netlify File Structure
436
457
@@ -442,11 +463,22 @@ packages/ui/
442
463
│ ├── strava-auth.ts
443
464
│ ├── strava-auth-callback.ts
444
465
│ └── root.ts
445
-
├── public/ # Static files
446
-
│ └── index.html
447
-
├── routes/ # Route handlers (shared with Bun server)
0 commit comments