[chore]: simplify build for browser-side scripts
Merged
SE
7mo ago+225+225+012345678901234567890123456789-353-353-012345678901234567890123456789
why
what changed
test plan
Summary by cubic
Unifies the build for browser-injected DOM scripts by replacing four generators with a single builder. Simplifies the pipeline and removes redundant file copying, with no runtime changes expected.
-
Refactors
- Added
scripts/build-dom-scripts.tsto build all DOM-injected assets: IIFE strings forpiercer.entry.tsandrerenderMissingShadows.entry.ts; bootstrap + per-function sources forlocator(__stagehandLocatorScripts) anda11y(__stagehandA11yScripts); sources-only forscreenshotscripts. - Removed
genDomScripts.ts,genLocatorScripts.ts,genScreenshotScripts.ts,genA11yScripts.ts. - Updated
packages/core/package.jsonto a singlebuild-dom-scriptscommand and simplifiedturbo.jsonto one task withlib/v3/dom/build/**outputs. - Removed JS copy steps from
scripts/build-cjs.tsandscripts/build-esm.ts; generated TS emits compile with the rest of the package. - Updated
tsconfig.jsonto include generated files (removed oldgen*.tsexclude).
- Added
-
Migration
- Use
pnpm run build-dom-scripts; the oldbuild-dom-scripts:*scripts are removed.
- Use