Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
51 changes: 51 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish to npm

on:
push:
tags: ['v*']

permissions:
contents: read
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v2

- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'

- run: bun install

# Type-check
- run: bun run build

# Run tests
- run: bun run --filter 'open-browser' test

# Build JS output for publishing
- run: bun run --filter 'open-browser' build:publish
- run: bun run --filter '@open-browser/cli' build:publish
- run: bun run --filter '@open-browser/sandbox' build:publish

# Publish packages in dependency order
- name: Publish open-browser (core)
run: npm publish --workspace=packages/core --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish @open-browser/sandbox
run: npm publish --workspace=packages/sandbox --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish @open-browser/cli
run: npm publish --workspace=packages/cli --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"workspaces": ["packages/*"],
"scripts": {
"build": "bun run --filter '*' build",
"build:publish": "bun run --filter '*' build:publish",
"clean": "bun run --filter '*' clean",
"test": "bun run --filter '*' test",
"lint": "biome check .",
"format": "biome format --write ."
Expand Down
43 changes: 40 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,54 @@
"type": "module",
"main": "src/index.ts",
"bin": {
"open-browser": "src/index.ts"
"open-browser": "dist/index.js"
},
"exports": {
".": {
"bun": "./src/index.ts",
"types": "./src/index.ts",
"import": "./dist/index.js",
"default": "./dist/index.js"
}
},
"files": [
"dist",
"src",
"LICENSE",
"README.md"
],
"scripts": {
"build": "tsc --noEmit",
"build:publish": "tsc -p tsconfig.build.json",
"clean": "rm -rf dist *.tsbuildinfo",
"prepublishOnly": "bun run clean && bun run build:publish",
"test": "bun test",
"start": "bun run src/index.ts"
},
"publishConfig": {
"access": "public"
},
"keywords": [
"browser",
"automation",
"ai",
"cli",
"agent"
],
"repository": {
"type": "git",
"url": "git+https://github.com/ntegrals/openbrowser.git",
"directory": "packages/cli"
},
"homepage": "https://github.com/ntegrals/openbrowser#readme",
"bugs": {
"url": "https://github.com/ntegrals/openbrowser/issues"
},
"author": "ntegrals",
"license": "MIT",
"dependencies": {
"open-browser": "workspace:*",
"commander": "^12.1.0",
"chalk": "^5.4.0"
},
"license": "MIT"
}
}
14 changes: 14 additions & 0 deletions packages/cli/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"noEmit": false,
"allowImportingTsExtensions": false,
"declaration": true,
"declarationMap": true,
"sourceMap": true
},
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.test.ts"]
}
40 changes: 37 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,48 @@
"main": "src/index.ts",
"types": "src/index.ts",
"exports": {
".": "./src/index.ts"
".": {
"bun": "./src/index.ts",
"types": "./src/index.ts",
"import": "./dist/index.js",
"default": "./dist/index.js"
}
},
"files": [
"dist",
"src",
"LICENSE",
"README.md"
],
"scripts": {
"build": "tsc --noEmit",
"build:publish": "tsc -p tsconfig.build.json",
"clean": "rm -rf dist *.tsbuildinfo",
"prepublishOnly": "bun run clean && bun run build:publish",
"test": "bun test",
"lint": "biome check src/"
},
"keywords": [
"browser",
"automation",
"ai",
"agent",
"web",
"scraping",
"playwright",
"llm"
],
"repository": {
"type": "git",
"url": "git+https://github.com/ntegrals/openbrowser.git",
"directory": "packages/core"
},
"homepage": "https://github.com/ntegrals/openbrowser#readme",
"bugs": {
"url": "https://github.com/ntegrals/openbrowser/issues"
},
"author": "ntegrals",
"license": "MIT",
"dependencies": {
"ai": "^4.2.0",
"@ai-sdk/openai": "^1.1.0",
Expand All @@ -35,6 +70,5 @@
"sharp": {
"optional": true
}
},
"license": "MIT"
}
}
14 changes: 14 additions & 0 deletions packages/core/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"noEmit": false,
"allowImportingTsExtensions": false,
"declaration": true,
"declarationMap": true,
"sourceMap": true
},
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.test.ts"]
}
39 changes: 36 additions & 3 deletions packages/sandbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,47 @@
"main": "src/index.ts",
"types": "src/index.ts",
"exports": {
".": "./src/index.ts"
".": {
"bun": "./src/index.ts",
"types": "./src/index.ts",
"import": "./dist/index.js",
"default": "./dist/index.js"
}
},
"files": [
"dist",
"src",
"LICENSE",
"README.md"
],
"scripts": {
"build": "tsc --noEmit",
"build:publish": "tsc -p tsconfig.build.json",
"clean": "rm -rf dist *.tsbuildinfo",
"prepublishOnly": "bun run clean && bun run build:publish",
"test": "bun test"
},
"publishConfig": {
"access": "public"
},
"keywords": [
"browser",
"automation",
"sandbox",
"agent"
],
"repository": {
"type": "git",
"url": "git+https://github.com/ntegrals/openbrowser.git",
"directory": "packages/sandbox"
},
"homepage": "https://github.com/ntegrals/openbrowser#readme",
"bugs": {
"url": "https://github.com/ntegrals/openbrowser/issues"
},
"author": "ntegrals",
"license": "MIT",
"dependencies": {
"open-browser": "workspace:*"
},
"license": "MIT"
}
}
14 changes: 14 additions & 0 deletions packages/sandbox/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"noEmit": false,
"allowImportingTsExtensions": false,
"declaration": true,
"declarationMap": true,
"sourceMap": true
},
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.test.ts"]
}