From 341d7aa63973fd544746367949329110c6323829 Mon Sep 17 00:00:00 2001 From: darren-trellis Date: Fri, 29 May 2026 16:46:59 -0700 Subject: [PATCH 1/2] fix example script by appending .env --- packages/core/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/package.json b/packages/core/package.json index a5e4de215..5fc97b675 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -36,7 +36,7 @@ "build:cjs": "tsx scripts/build-cjs.ts", "build:esm": "tsx scripts/build-esm.ts", "build": "pnpm --filter @browserbasehq/stagehand run --parallel \"/^build:(esm|cjs)$/\"", - "example": "node --import tsx -e \"const args=process.argv.slice(1).filter(a=>a!=='--'); const [p]=args; const n=(p||'example').replace(/^\\.\\//,'').replace(/\\.ts$/i,''); import('node:path').then(path=>import(new URL(path.resolve('examples', n + '.ts'), 'file:')));\" --", + "example": "node --import tsx --env-file=../../.env -e \"const args=process.argv.slice(1).filter(a=>a!=='--'); const [p]=args; const n=(p||'example').replace(/^\\.\\//,'').replace(/\\.ts$/i,''); import('node:path').then(path=>import(new URL(path.resolve('examples', n + '.ts'), 'file:')));\" --", "test": "pnpm -w --dir ../.. exec turbo run test:core test:e2e --filter=@browserbasehq/stagehand --", "test:core": "tsx scripts/test-core.ts", "test:e2e": "tsx scripts/test-e2e.ts", From 8ae0e0451e47eff1437b85e3d137e86fd40a7a1a Mon Sep 17 00:00:00 2001 From: darren-trellis Date: Fri, 29 May 2026 17:56:45 -0700 Subject: [PATCH 2/2] use env-if-exists --- packages/core/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/package.json b/packages/core/package.json index 5fc97b675..48140e484 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -36,7 +36,7 @@ "build:cjs": "tsx scripts/build-cjs.ts", "build:esm": "tsx scripts/build-esm.ts", "build": "pnpm --filter @browserbasehq/stagehand run --parallel \"/^build:(esm|cjs)$/\"", - "example": "node --import tsx --env-file=../../.env -e \"const args=process.argv.slice(1).filter(a=>a!=='--'); const [p]=args; const n=(p||'example').replace(/^\\.\\//,'').replace(/\\.ts$/i,''); import('node:path').then(path=>import(new URL(path.resolve('examples', n + '.ts'), 'file:')));\" --", + "example": "node --import tsx --env-file-if-exists=../../.env -e \"const args=process.argv.slice(1).filter(a=>a!=='--'); const [p]=args; const n=(p||'example').replace(/^\\.\\//,'').replace(/\\.ts$/i,''); import('node:path').then(path=>import(new URL(path.resolve('examples', n + '.ts'), 'file:')));\" --", "test": "pnpm -w --dir ../.. exec turbo run test:core test:e2e --filter=@browserbasehq/stagehand --", "test:core": "tsx scripts/test-core.ts", "test:e2e": "tsx scripts/test-e2e.ts",