Skip to content

Commit 0c77d48

Browse files
committed
nf
1 parent 6c6de57 commit 0c77d48

42 files changed

Lines changed: 103 additions & 146 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/ui/README.md

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,16 @@ In Netlify dashboard:
324324

325325
1. Go to **Site settings****Build & deploy**
326326
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`
328331
4. Set **Publish directory** to: `public` (relative to base directory)
329332

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.
331337

332338
### Step 4: Deploy
333339

@@ -338,7 +344,7 @@ In Netlify dashboard:
338344
3. Connect your Git repository
339345
4. Configure:
340346
- **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)
342348
- **Publish directory**: `public`
343349
5. Add environment variables (see Step 1)
344350
6. Click **Deploy site**
@@ -431,6 +437,21 @@ If you see the error: `Deploy directory 'public' does not exist`
431437
- Ensure all dependencies are listed in `package.json`
432438
- Check that TypeScript files are being transpiled correctly
433439
- 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
434455

435456
### Netlify File Structure
436457

@@ -442,11 +463,22 @@ packages/ui/
442463
│ ├── strava-auth.ts
443464
│ ├── strava-auth-callback.ts
444465
│ └── root.ts
445-
├── public/ # Static files
446-
│ └── index.html
447-
├── routes/ # Route handlers (shared with Bun server)
448-
├── config/ # Configuration
449-
└── cookies/ # Cookie utilities
466+
├── server/ # Server-side code
467+
│ ├── server.ts # Bun server entry point
468+
│ ├── routes/ # Route handlers
469+
│ ├── templates/ # HTML template generators
470+
│ ├── config/ # Server configuration
471+
│ └── cookies/ # Cookie utilities
472+
├── browser/ # Browser-side code
473+
│ ├── index.ts # Components entry point
474+
│ ├── app.ts # Main client app script
475+
│ └── components/ # Web components (TypeScript)
476+
├── public/ # Static files and build output
477+
│ ├── index.html
478+
│ └── js/ # Built browser code (generated)
479+
│ ├── components.js
480+
│ └── app.js
481+
└── types.ts # Shared types
450482
```
451483

452484
### Important Notes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

packages/ui/src/components/loading-spinner/loading-spinner.ts renamed to packages/ui/browser/components/loading-spinner/loading-spinner.ts

File renamed without changes.

0 commit comments

Comments
 (0)