From ac56f71b50ffcb53163040c1950c5abf627f86c2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 19:33:09 +0000 Subject: [PATCH] docs: improve and reference contributing documentation (#539) --- CONTRIBUTING.md | 46 +++++++++++++++++++++++----------------------- README.md | 4 ++++ 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3e407fe6..9a869b0f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,9 +5,9 @@ Other package managers may work but are not officially supported for development To set up the repository, run: -```bash -yarn -yarn build +```sh +$ yarn +$ yarn build ``` This will install all the required dependencies and build output files to `dist/`. @@ -22,7 +22,7 @@ modify the contents of the `src/lib/` and `examples/` directories. All files in the `examples/` directory are not modified by the generator and can be freely edited or added to. -```bash +```ts // add an example to examples/.ts #!/usr/bin/env -S npm run tsn -T @@ -41,38 +41,38 @@ If you’d like to use the repository from source, you can either install from g To install via git: -```bash -npm install git+ssh://git@github.com:anthropics/anthropic-sdk-typescript.git +```sh +$ npm install git+ssh://git@github.com:anthropics/anthropic-sdk-typescript.git ``` Alternatively, to link a local copy of the repo: -```bash +```sh # Clone -git clone https://www.github.com/anthropics/anthropic-sdk-typescript -cd anthropic-sdk-typescript +$ git clone https://www.github.com/anthropics/anthropic-sdk-typescript +$ cd anthropic-sdk-typescript # With yarn -yarn link -cd ../my-package -yarn link @anthropic-ai/sdk +$ yarn link +$ cd ../my-package +$ yarn link @anthropic-ai/sdk # With pnpm -pnpm link --global -cd ../my-package -pnpm link -—global @anthropic-ai/sdk +$ pnpm link --global +$ cd ../my-package +$ pnpm link -—global @anthropic-ai/sdk ``` ## Running tests Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. -```bash -npx prism mock path/to/your/openapi.yml +```sh +$ npx prism mock path/to/your/openapi.yml ``` -```bash -yarn run test +```sh +$ yarn run test ``` ## Linting and formatting @@ -82,14 +82,14 @@ This repository uses [prettier](https://www.npmjs.com/package/prettier) and To lint: -```bash -yarn lint +```sh +$ yarn lint ``` To format and fix all lint issues automatically: -```bash -yarn fix +```sh +$ yarn fix ``` ## Publishing and releases diff --git a/README.md b/README.md index b8b024d8..757e3fbf 100644 --- a/README.md +++ b/README.md @@ -386,3 +386,7 @@ The following runtimes are supported: Note that React Native is not supported at this time. If you are interested in other runtime environments, please open or upvote an issue on GitHub. + +## Contributing + +See [the contributing documentation](./CONTRIBUTING.md).