Skip to content

Commit d89476f

Browse files
chore(internal): minor sync
1 parent 508e385 commit d89476f

13 files changed

+172
-15
lines changed

.github/workflows/publish-npm.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow is triggered when a GitHub release is created.
2+
# It can also be run manually to re-publish to NPM in case it failed for some reason.
3+
# You can run this workflow by navigating to https://www.github.com/anthropics/anthropic-sdk-typescript/actions/workflows/publish-npm.yml
4+
name: Publish NPM
5+
on:
6+
workflow_dispatch:
7+
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
publish:
13+
name: publish
14+
runs-on: ubuntu-latest
15+
environment: production-release
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Node
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: '20'
24+
25+
- name: Install dependencies
26+
run: |
27+
yarn install
28+
29+
- name: Publish to NPM
30+
run: |
31+
yarn tsn scripts/publish-packages.ts
32+
33+
env:
34+
DATA: ${{ toJSON(steps.release.outputs) }}
35+
NPM_TOKEN: ${{ secrets.ANTHROPIC_NPM_TOKEN || secrets.NPM_TOKEN }}

.github/workflows/release-doctor.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release Doctor
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
jobs:
9+
release_doctor:
10+
name: release doctor
11+
runs-on: ubuntu-latest
12+
environment: production-release
13+
if: github.repository == 'anthropics/anthropic-sdk-typescript' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Check release environment
19+
run: |
20+
bash ./bin/check-release-environment
21+
env:
22+
NPM_TOKEN: ${{ secrets.ANTHROPIC_NPM_TOKEN || secrets.NPM_TOKEN }}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.0.1-alpha.0"
3+
}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 21
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-7015ea2d98991d6c2e7931c521e36448778fe868cc1b8a21173898d67b14b819.yml
33
openapi_spec_hash: 2007ff815a3f39af8cebe1976d50f17d
4-
config_hash: 4d0dcf47d77eae22d34624d2ac0f0b46
4+
config_hash: 55aeaebf89fb2ccfcd0b188fc4dc6aba

CONTRIBUTING.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ If you’d like to use the repository from source, you can either install from g
4242
To install via git:
4343

4444
```sh
45-
$ npm install git+ssh://[email protected]:stainless-sdks/anthropic-typescript.git
45+
$ npm install git+ssh://[email protected]:anthropics/anthropic-sdk-typescript.git
4646
```
4747

4848
Alternatively, to link a local copy of the repo:
4949

5050
```sh
5151
# Clone
52-
$ git clone https://www.github.com/stainless-sdks/anthropic-typescript
53-
$ cd anthropic-typescript
52+
$ git clone https://www.github.com/anthropics/anthropic-sdk-typescript
53+
$ cd anthropic-sdk-typescript
5454

5555
# With yarn
5656
$ yarn link
@@ -91,3 +91,17 @@ To format and fix all lint issues automatically:
9191
```sh
9292
$ yarn fix
9393
```
94+
95+
## Publishing and releases
96+
97+
Changes made to this repository via the automated release PR pipeline should publish to npm automatically. If
98+
the changes aren't made through the automated pipeline, you may want to make releases manually.
99+
100+
### Publish with a GitHub workflow
101+
102+
You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/anthropics/anthropic-sdk-typescript/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up.
103+
104+
### Publish manually
105+
106+
If you need to manually release a package, you can run the `bin/publish-npm` script with an `NPM_TOKEN` set on
107+
the environment.

MIGRATION.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ This affects the following methods:
8080

8181
### Removed `httpAgent` in favor of `fetchOptions`
8282

83-
The `httpAgent` client option has been removed in favor of a [platform-specific `fetchOptions` property](https://github.com/stainless-sdks/anthropic-typescript#fetch-options).
83+
The `httpAgent` client option has been removed in favor of a [platform-specific `fetchOptions` property](https://github.com/anthropics/anthropic-sdk-typescript#fetch-options).
8484
This change was made as `httpAgent` relied on `node:http` agents which are not supported by any runtime's builtin fetch implementation.
8585

86-
If you were using `httpAgent` for proxy support, check out the [new proxy documentation](https://github.com/stainless-sdks/anthropic-typescript#configuring-proxies).
86+
If you were using `httpAgent` for proxy support, check out the [new proxy documentation](https://github.com/anthropics/anthropic-sdk-typescript#configuring-proxies).
8787

8888
Before:
8989

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ The REST API documentation can be found on [docs.anthropic.com](https://docs.ant
99
## Installation
1010

1111
```sh
12-
npm install git+ssh://[email protected]:stainless-sdks/anthropic-typescript.git
12+
npm install @anthropic-ai/sdk
1313
```
1414

15-
> [!NOTE]
16-
> Once this package is [published to npm](https://app.stainless.com/docs/guides/publish), this will become: `npm install @anthropic-ai/sdk`
17-
1815
## Usage
1916

2017
The full API of this library can be found in [api.md](api.md).
@@ -450,7 +447,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
450447

451448
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
452449

453-
We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/anthropic-typescript/issues) with questions, bugs, or suggestions.
450+
We are keen for your feedback; please open an [issue](https://www.github.com/anthropics/anthropic-sdk-typescript/issues) with questions, bugs, or suggestions.
454451

455452
## Requirements
456453

bin/check-release-environment

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
errors=()
4+
5+
if [ -z "${NPM_TOKEN}" ]; then
6+
errors+=("The ANTHROPIC_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
7+
fi
8+
9+
lenErrors=${#errors[@]}
10+
11+
if [[ lenErrors -gt 0 ]]; then
12+
echo -e "Found the following errors in the release environment:\n"
13+
14+
for error in "${errors[@]}"; do
15+
echo -e "- $error\n"
16+
done
17+
18+
exit 1
19+
fi
20+
21+
echo "The environment is ready to push releases!"
22+

bin/cli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { spawnSync } = require('child_process');
55
const commands = {
66
migrate: {
77
description:
8-
'Run migrations to update your code using @anthropic-ai/sdk@0.39 to be compatible with @anthropic-ai/sdk@0.40',
8+
'Run migrations to update your code using @anthropic-ai/sdk@0.41 to be compatible with @anthropic-ai/sdk@0.50',
99
fn: () => {
1010
const result = spawnSync(
1111
'npx',

bin/migration-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"pkg": "@anthropic-ai/sdk",
3-
"githubRepo": "https://github.com/stainless-sdks/anthropic-typescript",
3+
"githubRepo": "https://github.com/anthropics/anthropic-sdk-typescript",
44
"clientClass": "Anthropic",
55
"baseClientClass": "BaseAnthropic",
66
"methods": []

0 commit comments

Comments
 (0)