Skip to content

Commit 40f5ee9

Browse files
feat(api): move node to typescript generator
1 parent e6f697f commit 40f5ee9

File tree

15 files changed

+205
-38
lines changed

15 files changed

+205
-38
lines changed

.github/workflows/publish-npm.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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/Finch-API/finch-api-node/actions/workflows/publish-npm.yml
4+
name: Publish NPM
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
path:
9+
description: The path to run the release in, e.g. '.' or 'packages/mcp-server'
10+
required: true
11+
12+
release:
13+
types: [published]
14+
15+
jobs:
16+
publish:
17+
name: publish
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up Node
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: '20'
29+
30+
- name: Install dependencies
31+
run: |
32+
yarn install
33+
34+
- name: Publish to NPM
35+
run: |
36+
if [ -n "${{ github.event.inputs.path }}" ]; then
37+
PATHS_RELEASED='[\"${{ github.event.inputs.path }}\"]'
38+
else
39+
PATHS_RELEASED='[\".\", \"packages/mcp-server\"]'
40+
fi
41+
yarn tsn scripts/publish-packages.ts "{ \"paths_released\": \"$PATHS_RELEASED\" }"
42+
env:
43+
NPM_TOKEN: ${{ secrets.FINCH_NPM_TOKEN || secrets.NPM_TOKEN }}
44+
45+
- name: Upload MCP Server DXT GitHub release asset
46+
run: |
47+
gh release upload ${{ github.event.release.tag_name }} \
48+
packages/mcp-server/tryfinch_finch_api_api.mcpb
49+
env:
50+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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+
pull_request:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
jobs:
9+
release_doctor:
10+
name: release doctor
11+
runs-on: ubuntu-latest
12+
if: github.repository == 'Finch-API/finch-api-node' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Check release environment
18+
run: |
19+
bash ./bin/check-release-environment
20+
env:
21+
NPM_TOKEN: ${{ secrets.FINCH_NPM_TOKEN || secrets.NPM_TOKEN }}
22+

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "6.38.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: 46
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-b817e7a30a6366c063a8c9a334d5be281eb8d93e21acc8c8219d3bdc95043deb.yml
33
openapi_spec_hash: d4cc4a5cba9f13986e38d148d330aa00
4-
config_hash: 5c64f384746e7570c10f19fe241062a7
4+
config_hash: 87775d204161dc65d5231647162ea0e8

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/finch-typescript.git
45+
$ npm install git+ssh://[email protected]:Finch-API/finch-api-node.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/finch-typescript
53-
$ cd finch-typescript
52+
$ git clone https://www.github.com/Finch-API/finch-api-node
53+
$ cd finch-api-node
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/Finch-API/finch-api-node/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
@@ -122,10 +122,10 @@ client.example.list(undefined, { headers: { ... } });
122122

123123
### Removed `httpAgent` in favor of `fetchOptions`
124124

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

128-
If you were using `httpAgent` for proxy support, check out the [new proxy documentation](https://github.com/stainless-sdks/finch-typescript#configuring-proxies).
128+
If you were using `httpAgent` for proxy support, check out the [new proxy documentation](https://github.com/Finch-API/finch-api-node#configuring-proxies).
129129

130130
Before:
131131

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ It is generated with [Stainless](https://www.stainless.com/).
1111
## Installation
1212

1313
```sh
14-
npm install git+ssh://[email protected]:stainless-sdks/finch-typescript.git
14+
npm install @tryfinch/finch-api
1515
```
1616

17-
> [!NOTE]
18-
> Once this package is [published to npm](https://www.stainless.com/docs/guides/publish), this will become: `npm install @tryfinch/finch-api`
19-
2017
## Usage
2118

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

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

418-
We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/finch-typescript/issues) with questions, bugs, or suggestions.
415+
We are keen for your feedback; please open an [issue](https://www.github.com/Finch-API/finch-api-node/issues) with questions, bugs, or suggestions.
419416

420417
## Requirements
421418

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 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/migration-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"pkg": "@tryfinch/finch-api",
3-
"githubRepo": "https://github.com/stainless-sdks/finch-typescript",
3+
"githubRepo": "https://github.com/Finch-API/finch-api-node",
44
"clientClass": "Finch",
55
"methods": []
66
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"types": "dist/index.d.ts",
77
"main": "dist/index.js",
88
"type": "commonjs",
9-
"repository": "github:stainless-sdks/finch-typescript",
9+
"repository": "github:Finch-API/finch-api-node",
1010
"license": "Apache-2.0",
1111
"packageManager": "[email protected]",
1212
"files": [

0 commit comments

Comments
 (0)