Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3cdb1e7
init
syd-shields Mar 30, 2026
2985f0f
add a build step that turns new ts templates into js in CI
syd-shields Mar 30, 2026
2942385
add file filter to build script
syd-shields Apr 8, 2026
6cc2dd6
add built js templates
syd-shields Apr 8, 2026
969f904
add exclude flag
syd-shields Apr 8, 2026
f3f7984
add comments to explain build filters
syd-shields Apr 8, 2026
ae17bb9
add build step to run on dev branch in CI
syd-shields Apr 8, 2026
48fc473
regen templats on each pr merge
syd-shields Apr 10, 2026
8ea723d
include all readme, package json and env examples in build
syd-shields Apr 10, 2026
c7dbcce
get paths to build js files first so that the entire repo isn't delet…
syd-shields Apr 14, 2026
fc8fd04
remove built js files
syd-shields May 4, 2026
3173ce4
only build js files to production branch
syd-shields May 4, 2026
ac53074
remove build javascript workflow
syd-shields May 4, 2026
541e995
before recursing, skip directories whose basename is in DEFAULT_EXCLU…
syd-shields May 4, 2026
b17759b
before recursing, skip directories whose basename is in DEFAULT_EXCLU…
syd-shields May 4, 2026
ed33a0c
if there are zero playground compatible templates, do not call build-…
syd-shields May 4, 2026
5b91a7e
add test-production branch support
syd-shields May 4, 2026
5d56277
build js templates
syd-shields May 4, 2026
0070df7
remove built js files
syd-shields May 11, 2026
009a835
add pkg.type = module to adaptPackageJsonForJavaScript so it's uncond…
syd-shields May 11, 2026
a240b02
consolidate workflows to one plauground.yml file to remove need to ma…
syd-shields May 11, 2026
a143d03
write contents to test-production and production branches
syd-shields May 11, 2026
1ba6a37
use hardcoded branch names instead of unused var
syd-shields May 11, 2026
3e85383
add --no-verify flag to build
syd-shields May 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# When merging changes under these paths to `production`, require review from the
# Dashboard team.
/javascript/ @browserbase/dashboard
/scripts/fetch-playground-typescript-dirs.mjs @browserbase/dashboard
/scripts/validate-playground-templates.mjs @browserbase/dashboard
/scripts/playground-ci.mjs @browserbase/dashboard
/scripts/lib/playground-checks.mjs @browserbase/dashboard
/.github/workflows/playground.yml @browserbase/dashboard
/.github/workflows/playground-production.yml @browserbase/dashboard
/.github/workflows/playground-test-production.yml @browserbase/dashboard
20 changes: 20 additions & 0 deletions .github/workflows/playground-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Triggers the shared playground workflow for the `production` branch.
# All CI steps live in playground.yml — edit there to change behavior.

name: Playground templates (production)

on:
pull_request:
branches:
- production
push:
branches:
- production
workflow_dispatch:

permissions:
contents: write

jobs:
playground-templates:
uses: ./.github/workflows/playground.yml
20 changes: 20 additions & 0 deletions .github/workflows/playground-test-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Triggers the shared playground workflow for the `test-production` branch.
# All CI steps live in playground.yml — edit there to change behavior.

name: Playground templates (test production)

on:
pull_request:
branches:
- test-production
push:
branches:
- test-production
workflow_dispatch:

permissions:
contents: write

jobs:
playground-templates:
uses: ./.github/workflows/playground.yml
53 changes: 53 additions & 0 deletions .github/workflows/playground.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Reusable workflow: validates TypeScript → JavaScript builds for playground-
# runnable templates and optionally commits the generated javascript/ tree.
#
# Called by playground-production.yml and playground-test-production.yml so that
# CI steps are defined in exactly one place.

name: Playground templates

on:
workflow_call:

permissions:
contents: write

jobs:
playground-templates:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Clean javascript output directory
run: rm -rf javascript && mkdir -p javascript

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build and validate playground TypeScript templates
env:
TEMPLATES_API_URL: ${{ vars.TEMPLATES_API_URL }}
run: pnpm run ci:playground

- name: Commit and push playground javascript (push only)
if: github.event_name == 'push'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A javascript/
if git diff --staged --quiet; then
echo "No javascript changes to commit."
else
git commit --no-verify -m "chore: regenerate playground javascript templates"
git push
fi
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ Templates use the Model Gateway to route LLM requests -- you only need your `BRO

Each template's README contains detailed installation steps, environment variable requirements, and troubleshooting guides.

### TypeScript and generated JavaScript

- **Source of truth:** edit templates under `typescript/`. The `javascript/` tree is generated output, not authored by hand for day-to-day changes.
- **Local only:** run `pnpm run build:javascript` when you want a full mirror of `typescript/` into `javascript/` on your machine (for example to smoke-test the transpiler or compare JS output). There is **no** GitHub Actions workflow that builds the full tree into the repo anymore.
- **Playground releases:** the `production` branch is updated by CI (`.github/workflows/playground-production.yml`), which builds and commits **only** templates that are playground-runnable per the public templates API, then validates them.

## Resources

### Documentation
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"private": true,
"type": "module",
"scripts": {
"build:javascript": "node scripts/build-javascript.mjs",
"ci:playground": "node scripts/playground-ci.mjs",
"validate:playground": "node scripts/validate-playground-templates.mjs",
"check:readme-template-index": "node scripts/check-readme-template-index.mjs",
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md,yml,yaml}\"",
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,md,yml,yaml}\"",
Expand All @@ -25,6 +28,7 @@
"husky": "^9.1.7",
"lint-staged": "^16.2.7",
"prettier": "^3.2.5",
"typescript": "^5.9.3",
"typescript-eslint": "^8.50.1"
},
"packageManager": "pnpm@9.0.0",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading