Skip to content
Merged
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
46 changes: 33 additions & 13 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,47 @@ jobs:
- name: Ensure SHA pinned actions
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@70c4af2ed5282c51ba40566d026d6647852ffa3e # v5.0.1

js-build:
js-test:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [20, 22]
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm run build
- name: Generate docs
working-directory: js
run: pnpm run docs
- name: Run hermetic tests
working-directory: js
run: pnpm run test:checks

js-build:
runs-on: ubuntu-latest
timeout-minutes: 20
outputs:
artifact-name: ${{ steps.artifact.outputs.name }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ matrix.node-version }}
node-version: 20
registry-url: "https://registry.npmjs.org"
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
- name: Verify checks
shell: bash
run: |
make js-verify-checks
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm run build
- name: Determine artifact name
id: artifact
env:
Expand Down Expand Up @@ -162,7 +182,7 @@ jobs:
- name: Upload build artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ steps.artifact.outputs.name }}-${{ matrix.node-version }}-dist
name: ${{ steps.artifact.outputs.name }}-dist
path: |
js/artifacts/${{ steps.prepare_artifact.outputs.packed_tarball }}
js/artifacts/${{ steps.prepare_browser_artifact.outputs.packed_browser_tarball }}
Expand Down Expand Up @@ -273,10 +293,10 @@ jobs:
with:
node-version-file: .tool-versions
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
- name: Download build artifact (node 20)
- name: Download build artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: ${{ needs.js-build.outputs.artifact-name }}-20-dist
name: ${{ needs.js-build.outputs.artifact-name }}-dist
path: js/artifacts
run-id: ${{ github.run_id }}
github-token: ${{ github.token }}
Expand Down Expand Up @@ -439,11 +459,9 @@ jobs:
working-directory: ./js
run: |
pnpm run build
- name: Run hermetic JS tests
- name: Run hermetic tests
working-directory: ./js
shell: bash
run: |
make test-checks
run: pnpm run test:checks
- name: Run zod v3 tests
if: matrix.zod-version == '3.25.34'
working-directory: ./js
Expand All @@ -463,6 +481,7 @@ jobs:
- check-typings
- dead-code
- ensure-pinned-actions
- js-test
- js-build
- js-api-compatibility
- js-smoke-discover
Expand Down Expand Up @@ -494,6 +513,7 @@ jobs:
check_result "check-typings" "${{ needs.check-typings.result }}"
check_result "dead-code" "${{ needs.dead-code.result }}"
check_result "ensure-pinned-actions" "${{ needs.ensure-pinned-actions.result }}"
check_result "js-test" "${{ needs.js-test.result }}"
check_result "js-build" "${{ needs.js-build.result }}"
check_result "js-api-compatibility" "${{ needs.js-api-compatibility.result }}"
check_result "js-smoke-discover" "${{ needs.js-smoke-discover.result }}"
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- "turbo.json"
- "Makefile"
push:
branches: [main]

Expand All @@ -37,10 +36,14 @@ jobs:
node-version: ${{ matrix.node-version }}
registry-url: "https://registry.npmjs.org"
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
- name: Run provider-backed JS tests
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm run build
- name: Run provider-backed tests
working-directory: js
shell: bash
run: |
make js-test-external
run: pnpm run test:external

e2e:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-js-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
working-directory: js
env:
RELEASE_BRANCH: ${{ env.TARGET_BRANCH }}
run: make publish-sdk-js
run: pnpm run publish:validate

- name: Create and push release tag
run: |
Expand Down
1 change: 0 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ pnpm run formatting # Check formatting
pnpm run lint # Run lint checks
pnpm run fix:formatting # Auto-fix formatting
pnpm run fix:lint # Auto-fix lint issues
make test # Full JS-oriented test flow used in this repo
```
75 changes: 0 additions & 75 deletions Makefile

This file was deleted.

8 changes: 4 additions & 4 deletions PUBLISHING_JS.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,20 @@ The workflow writes a short run summary with the published version and recent co
If you do not want to open GitHub Actions manually, you can dispatch the same workflow from the terminal:

```bash
make release-js-sdk
./js/scripts/dispatch-release-workflow.sh
```

To target a different remote branch:

```bash
make release-js-sdk BRANCH=<branch>
BRANCH=<branch> ./js/scripts/dispatch-release-workflow.sh
```

To dispatch a prerelease or canary instead of a stable release:

```bash
make release-js-sdk RELEASE_TYPE=prerelease
make release-js-sdk RELEASE_TYPE=canary
RELEASE_TYPE=prerelease ./js/scripts/dispatch-release-workflow.sh
RELEASE_TYPE=canary ./js/scripts/dispatch-release-workflow.sh
```

Notes:
Expand Down
22 changes: 21 additions & 1 deletion js/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,27 @@ Run commands from the `js/` directory unless noted otherwise.
## Running Tests

```bash
make test # Full JS test suite (core + wrappers)
pnpm run test:checks # Hermetic tests (core + vitest wrapper)
pnpm run test:external # Provider-backed tests (OpenAI, Anthropic, etc.)
pnpm run test:all # Everything (checks + external)
pnpm test # Core vitest suite only
```

**Individual provider tests:**

```bash
pnpm run test:external:openai # OpenAI wrapper
pnpm run test:external:anthropic # Anthropic wrapper
pnpm run test:external:google-genai # Google GenAI wrapper
pnpm run test:external:ai-sdk # AI SDK (v5 + v6)
pnpm run test:external:claude-agent-sdk # Claude Agent SDK
```

**Test a specific version of a provider:**

```bash
./scripts/test-provider.sh test:openai openai@4.92.1
./scripts/test-provider.sh test:anthropic @anthropic-ai/sdk@0.39.0
```

**Run a single test:**
Expand Down
Loading
Loading