11## Setting up the environment
22
3- This repository uses [ ` yarn@v1 ` ] ( https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable ) .
3+ This repository uses [ ` yarn@v1 ` ] ( https://classic.yarnpkg.com/lang/en/docs/install ) .
44Other package managers may work but are not officially supported for development.
55
66To set up the repository, run:
77
8- ``` bash
9- yarn
10- yarn build
8+ ``` sh
9+ $ yarn
10+ $ yarn build
1111```
1212
1313This will install all the required dependencies and build output files to ` dist/ ` .
1414
1515## Modifying/Adding code
1616
17- Most of the SDK is generated code, and any modified code will be overridden on the next generation. The
18- ` src/lib/ ` and ` examples/ ` directories are exceptions and will never be overridden.
17+ Most of the SDK is generated code. Modifications to code will be persisted between generations, but may
18+ result in merge conflicts between manual patches and changes from the generator. The generator will never
19+ modify the contents of the ` src/lib/ ` and ` examples/ ` directories.
1920
2021## Adding and running examples
2122
22- All files in the ` examples/ ` directory are not modified by the Stainless generator and can be freely edited or
23- added to.
23+ All files in the ` examples/ ` directory are not modified by the generator and can be freely edited or added to.
2424
25- ``` bash
25+ ``` ts
2626// add an example to examples/<your-example>.ts
2727
2828#! / usr / bin / env - S npm run tsn - T
2929…
3030```
3131
32- ```
33- chmod +x examples/<your-example>.ts
32+ ``` sh
33+ $ chmod +x examples/< your-example> .ts
3434# run the example against your api
35- yarn tsn -T examples/<your-example>.ts
35+ $ yarn tsn -T examples/< your-example> .ts
3636```
3737
3838## Using the repository from source
@@ -41,38 +41,38 @@ If you’d like to use the repository from source, you can either install from g
4141
4242To install via git:
4343
44- ``` bash
45- npm install git+ssh://
[email protected] :cloudflare/cloudflare-typescript.git
44+ ``` sh
45+ $ npm install git+ssh://
[email protected] :cloudflare/cloudflare-typescript.git
4646```
4747
4848Alternatively, to link a local copy of the repo:
4949
50- ``` bash
50+ ``` sh
5151# Clone
52- git clone https://www.github.com/cloudflare/cloudflare-typescript
53- cd cloudflare-typescript
52+ $ git clone https://www.github.com/cloudflare/cloudflare-typescript
53+ $ cd cloudflare-typescript
5454
5555# With yarn
56- yarn link
57- cd ../my-package
58- yarn link cloudflare
56+ $ yarn link
57+ $ cd ../my-package
58+ $ yarn link cloudflare
5959
6060# With pnpm
61- pnpm link --global
62- cd ../my-package
63- pnpm link -—global cloudflare
61+ $ pnpm link --global
62+ $ cd ../my-package
63+ $ pnpm link -—global cloudflare
6464```
6565
6666## Running tests
6767
6868Most tests require you to [ set up a mock server] ( https://github.com/stoplightio/prism ) against the OpenAPI spec to run the tests.
6969
70- ``` bash
71- npx prism mock path/to/your/openapi.yml
70+ ``` sh
71+ $ npx prism mock path/to/your/openapi.yml
7272```
7373
74- ``` bash
75- yarn run test
74+ ``` sh
75+ $ yarn run test
7676```
7777
7878## Linting and formatting
@@ -82,14 +82,14 @@ This repository uses [prettier](https://www.npmjs.com/package/prettier) and
8282
8383To lint:
8484
85- ``` bash
86- yarn lint
85+ ``` sh
86+ $ yarn lint
8787```
8888
8989To format and fix all lint issues automatically:
9090
91- ``` bash
92- yarn fix
91+ ``` sh
92+ $ yarn fix
9393```
9494
9595## Publishing and releases
0 commit comments