Skip to content

Enable production branch for templates in dashboard#99

Open
syd-shields wants to merge 2 commits into
productionfrom
dev
Open

Enable production branch for templates in dashboard#99
syd-shields wants to merge 2 commits into
productionfrom
dev

Conversation

@syd-shields
Copy link
Copy Markdown
Contributor

@syd-shields syd-shields commented May 26, 2026

This PR merges dev into production allowing templates to build in the /javascript directory once this PR merges. The CI process will behave like the test-production branch (ensure build works, on success push updates to the /javascript directory).


Note

Medium Risk
Workflows use contents: write and push bot commits to protected branches; generated javascript/ and template set depend on the live templates API and new validation rules.

Overview
Adds playground-focused CI for production and test-production: a reusable workflow runs pnpm run ci:playground, which loads playground-runnable templates from the public templates API, transpiles only those typescript/ folders into javascript/, validates sources for dashboard rules, and on push auto-commits regenerated javascript/ with contents: write.

Introduces scripts/build-javascript.mjs (full or filtered TS→JS mirror, adapted package.jsons) for local build:javascript, plus API-driven playground-ci, validate-playground-templates, and fetch-playground-typescript-dirs with template-flag→folder aliases. Root typescript devDependency and README clarify that typescript/ is source of truth and full-tree CI builds are gone.

CODEOWNERS requires @browserbase/dashboard on javascript/, playground scripts, and these workflows. smart-fetch-scraper (TS/Python) only gains comments about Fetch API markdown/json output options.

Reviewed by Cursor Bugbot for commit d0fa10a. Bugbot is set up for automated code reviews on this repo. Configure here.

syd-shields and others added 2 commits May 13, 2026 11:40
…#75)

* init

* add a build step that turns new ts templates into js in CI

* add file filter to build script

* add built js templates

* add exclude flag

* add comments to explain build filters

* add build step to run on dev branch in CI

* regen templats on each pr merge

* include all readme, package json and env examples in build

* get paths to build js files first so that the entire repo isn't deleted and rewritten with new build

* remove built js files

* only build js files to production branch

* remove build javascript workflow

* before recursing, skip directories whose basename is in DEFAULT_EXCLUDED_DIRS

* before recursing, skip directories whose basename is in DEFAULT_EXCLUDED_DIRS

* if there are zero playground compatible templates, do not call build-javascript.mjs

* add test-production branch support

* build js templates

* remove built js files

* add pkg.type = module to adaptPackageJsonForJavaScript so it's unconditionally set for all generated JS templates

* consolidate workflows to one plauground.yml file to remove need to make updates to it twice

* write contents to test-production and production branches

* use hardcoded branch names instead of unused var

* add --no-verify flag to build

* add stripLeadingTscBuildCommand to handle when multiple commands exist alongside tsc

* add parseBuildOptions to parse CLI flags at once instead of in multiple places to prevent drift
if (explicit && String(explicit).trim()) return String(explicit).trim();
const fromEnv = process.env.TEMPLATES_API_URL;
if (typeof fromEnv === "string" && fromEnv.trim()) return fromEnv.trim();
return "https://www.browserbase.com/website-api/templates";
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return "https://www.browserbase.com/website-api/templates";
return "https://www.browserbase.com/api/templates";

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to commit this change to point to the correct URL. Leave a thumbs up or commit the change if it's good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants