Skip to content

Commit b1780ab

Browse files
feat(api): manual updates
1 parent 9868631 commit b1780ab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+17228
-10296
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"features": {
77
"ghcr.io/devcontainers/features/node:1": {}
88
},
9-
"postCreateCommand": "pnpm install",
9+
"postCreateCommand": "yarn install",
1010
"customizations": {
1111
"vscode": {
1212
"extensions": ["esbenp.prettier-vscode"]

.dockerignore

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Dependencies
2+
node_modules/
3+
**/node_modules/
4+
5+
# Build outputs
6+
dist/
7+
**/dist/
8+
9+
# Git
10+
.git/
11+
.gitignore
12+
13+
# CI/CD
14+
.github/
15+
.gitlab-ci.yml
16+
.travis.yml
17+
18+
# IDE
19+
.vscode/
20+
.idea/
21+
*.swp
22+
*.swo
23+
*~
24+
25+
# OS
26+
.DS_Store
27+
Thumbs.db
28+
29+
# Testing
30+
test/
31+
tests/
32+
__tests__/
33+
*.test.js
34+
*.spec.js
35+
coverage/
36+
.nyc_output/
37+
38+
# Logs
39+
*.log
40+
npm-debug.log*
41+
yarn-debug.log*
42+
yarn-error.log*
43+
44+
# Environment
45+
.env
46+
.env.*
47+
48+
# Temporary files
49+
*.tmp
50+
*.temp
51+
.cache/
52+
53+
# Examples and scripts
54+
examples/
55+
bin/
56+
57+
# Other packages (we only need mcp-server)
58+
packages/*/
59+
!packages/mcp-server/

.github/workflows/ci.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,7 @@ jobs:
2424
- name: Set up Node
2525
uses: actions/setup-node@v4
2626
with:
27-
node-version: '20'
28-
29-
- name: Set up pnpm
30-
uses: pnpm/action-setup@v4
31-
with:
32-
version: '10.30.1'
27+
node-version: '22'
3328

3429
- name: Bootstrap
3530
run: ./scripts/bootstrap
@@ -51,12 +46,7 @@ jobs:
5146
- name: Set up Node
5247
uses: actions/setup-node@v4
5348
with:
54-
node-version: '20'
55-
56-
- name: Set up pnpm
57-
uses: pnpm/action-setup@v4
58-
with:
59-
version: '10.30.1'
49+
node-version: '22'
6050

6151
- name: Bootstrap
6252
run: ./scripts/bootstrap
@@ -82,6 +72,17 @@ jobs:
8272
AUTH: ${{ steps.github-oidc.outputs.github_token }}
8373
SHA: ${{ github.sha }}
8474
run: ./scripts/utils/upload-artifact.sh
75+
76+
- name: Upload MCP Server tarball
77+
if: |-
78+
github.repository == 'stainless-sdks/context.dev-typescript' &&
79+
!startsWith(github.ref, 'refs/heads/stl/')
80+
env:
81+
URL: https://pkg.stainless.com/s?subpackage=mcp-server
82+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
83+
SHA: ${{ github.sha }}
84+
BASE_PATH: packages/mcp-server
85+
run: ./scripts/utils/upload-artifact.sh
8586
test:
8687
timeout-minutes: 10
8788
name: test
@@ -93,15 +94,13 @@ jobs:
9394
- name: Set up Node
9495
uses: actions/setup-node@v4
9596
with:
96-
node-version: '20'
97-
98-
- name: Set up pnpm
99-
uses: pnpm/action-setup@v4
100-
with:
101-
version: '10.30.1'
97+
node-version: '22'
10298

10399
- name: Bootstrap
104100
run: ./scripts/bootstrap
105101

102+
- name: Build
103+
run: ./scripts/build
104+
106105
- name: Run tests
107106
run: ./scripts/test

.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/brand-dot-dev/context-typescript-sdk/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@v6
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.CONTEXT_DEV_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/context_dev_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 == 'brand-dot-dev/context-typescript-sdk' && (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@v6
16+
17+
- name: Check release environment
18+
run: |
19+
bash ./bin/check-release-environment
20+
env:
21+
NPM_TOKEN: ${{ secrets.CONTEXT_DEV_NPM_TOKEN || secrets.NPM_TOKEN }}
22+

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ dist-deno
88
/*.tgz
99
.idea/
1010
.eslintcache
11-
11+
dist-bundle
12+
*.mcpb

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ CHANGELOG.md
44
/deno
55

66
# don't format tsc output, will break source maps
7-
/dist
7+
dist

.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"
3+
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 19
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-21652c2d2e6a5aab678ca435ba09ef698ff34270021f349660b84d5d98bf3923.yml
3-
openapi_spec_hash: 356a7298b2abac3fdf72ad5ee046b952
4-
config_hash: 44e5a212e49a8e96ae9ee64e273109d4
1+
configured_endpoints: 20
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-a69e6793d72c7f91069972b64ff2e35b4ddfa62cd35d6451b7d63f95d5957951.yml
3+
openapi_spec_hash: 8a77eef26c37dc2b63110169f0eef1f6
4+
config_hash: b4ed0bce9a80a785b53a4a8f5d530183

CONTRIBUTING.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
## Setting up the environment
22

3-
This repository uses [`pnpm`](https://pnpm.io/).
3+
This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install).
44
Other package managers may work but are not officially supported for development.
55

66
To set up the repository, run:
77

88
```sh
9-
$ pnpm install
10-
$ pnpm build
9+
$ yarn
10+
$ yarn build
1111
```
1212

1313
This will install all the required dependencies and build output files to `dist/`.
@@ -32,7 +32,7 @@ All files in the `examples/` directory are not modified by the generator and can
3232
```sh
3333
$ chmod +x examples/<your-example>.ts
3434
# run the example against your api
35-
$ pnpm tsn -T examples/<your-example>.ts
35+
$ yarn tsn -T examples/<your-example>.ts
3636
```
3737

3838
## Using the repository from source
@@ -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://git@github.com:stainless-sdks/context.dev-typescript.git
45+
$ npm install git+ssh://git@github.com:brand-dot-dev/context-typescript-sdk.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/context.dev-typescript
53-
$ cd context.dev-typescript
52+
$ git clone https://www.github.com/brand-dot-dev/context-typescript-sdk
53+
$ cd context-typescript-sdk
5454

5555
# With yarn
5656
$ yarn link
@@ -66,7 +66,7 @@ $ pnpm link --global context.dev
6666
## Running tests
6767

6868
```sh
69-
$ pnpm run test
69+
$ yarn run test
7070
```
7171

7272
## Linting and formatting
@@ -77,11 +77,25 @@ This repository uses [prettier](https://www.npmjs.com/package/prettier) and
7777
To lint:
7878

7979
```sh
80-
$ pnpm lint
80+
$ yarn lint
8181
```
8282

8383
To format and fix all lint issues automatically:
8484

8585
```sh
86-
$ pnpm fix
86+
$ yarn fix
8787
```
88+
89+
## Publishing and releases
90+
91+
Changes made to this repository via the automated release PR pipeline should publish to npm automatically. If
92+
the changes aren't made through the automated pipeline, you may want to make releases manually.
93+
94+
### Publish with a GitHub workflow
95+
96+
You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/brand-dot-dev/context-typescript-sdk/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up.
97+
98+
### Publish manually
99+
100+
If you need to manually release a package, you can run the `bin/publish-npm` script with an `NPM_TOKEN` set on
101+
the environment.

0 commit comments

Comments
 (0)