[chore]: add `.js` to the end of all imports

Merged
PI
9mo ago
+1130-1313

why

  • removes the need to append .js to all imports during esm build process
  • aligns us with the default standard for esm / esbuild js projects that also need to support cjs
  • this allows us to seamlessly support ESM, CJS, and TSX with no remapping needed

what changed

test plan


Summary by cubic

Standardized all internal imports and re-exports to include .js extensions to enable native ESM resolution, while keeping CJS and TS working without path remapping. Updated examples to use explicit index.js entrypoints and environment-driven config for easier local runs.

  • Refactors

    • Appended .js to all relative imports and barrel exports across core, v3 agent, DOM runtimes/locator scripts, caches, handlers, external clients, and index files.
    • Switched examples to ../lib/v3/index.js, fixed nested re-export paths, and added env-based config (BROWSERBASE_API_KEY, BROWSERBASE_PROJECT_ID, MODEL_API_KEY) passed into Stagehand/model.
    • Updated dotenv to ^17.3.1 in dev deps. No public API changes.
  • Migration

    • Most users importing from package entry points: no changes.
    • If importing internal files locally (e.g., examples or custom integrations), include .js in paths and prefer index.js for directories.