Skip to content

Commit b413eed

Browse files
authored
chore: clarify use of yarn for development and npm/yarn/pnpm for users (#51)
1 parent cdbe50b commit b413eed

File tree

7 files changed

+1599
-1205
lines changed

7 files changed

+1599
-1205
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.prism.log
22
node_modules
33
yarn-error.log
4+
package-lock.json
45
codegen.log
56
Brewfile.lock.json
67
dist

CONTRIBUTING.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ All files in the `examples/` directory are not modified by the generator and can
2525
```ts
2626
// add an example to examples/<your-example>.ts
2727

28-
#!/usr/bin/env -S npm run tsn -T
28+
#!/usr/bin/env -S yarn tsn -T
2929
3030
```
3131

@@ -37,7 +37,7 @@ $ yarn tsn -T examples/<your-example>.ts
3737

3838
## Using the repository from source
3939

40-
If youd like to use the repository from source, you can either install from git or link to a cloned repository:
40+
If you'd like to use the repository from source, you can either install from git or link to a cloned repository:
4141

4242
To install via git:
4343

@@ -57,6 +57,11 @@ $ yarn link
5757
$ cd ../my-package
5858
$ yarn link llama-stack-client
5959

60+
# With npm
61+
$ npm link
62+
$ cd ../my-package
63+
$ npm link llama-stack-client
64+
6065
# With pnpm
6166
$ pnpm link --global
6267
$ cd ../my-package
@@ -68,7 +73,7 @@ $ pnpm link -—global llama-stack-client
6873
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
6974

7075
```sh
71-
$ npx prism mock path/to/your/openapi.yml
76+
$ npx @stainless-api/[email protected] prism mock path/to/your/openapi.yml
7277
```
7378

7479
```sh

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@ If you are interested in other runtime environments, please open or upvote an is
348348

349349
See [the contributing documentation](./CONTRIBUTING.md).
350350

351+
Note: This project uses [yarn](https://classic.yarnpkg.com/) v1 as its package manager for development. Please ensure you have yarn installed before contributing.
352+
351353
## License
352354

353355
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

package.json

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,27 @@
3838
"devDependencies": {
3939
"@swc/core": "^1.3.102",
4040
"@swc/jest": "^0.2.29",
41-
"@types/jest": "^29.4.0",
42-
"@typescript-eslint/eslint-plugin": "^6.7.0",
43-
"@typescript-eslint/parser": "^6.7.0",
44-
"eslint": "^8.49.0",
41+
"@types/jest": "^30.0.0",
42+
"@typescript-eslint/eslint-plugin": "^8.0.0",
43+
"@typescript-eslint/parser": "^8.0.0",
44+
"eslint": "^9.0.0",
4545
"eslint-plugin-prettier": "^5.0.1",
46-
"eslint-plugin-unused-imports": "^3.0.0",
46+
"eslint-plugin-unused-imports": "^4.0.0",
4747
"iconv-lite": "^0.6.3",
48-
"jest": "^29.4.0",
48+
"jest": "^30.0.0",
4949
"prettier": "^3.0.0",
50-
"ts-jest": "^29.1.0",
50+
"ts-jest": "^29.4.0",
5151
"ts-node": "^10.5.0",
5252
"tsc-multi": "^1.1.0",
5353
"tsconfig-paths": "^4.0.0",
5454
"typescript": "^4.8.2"
5555
},
56+
"resolutions": {
57+
"@babel/core": "^7.28.5",
58+
"@babel/helpers": "^7.28.4",
59+
"js-yaml": "^4.1.1",
60+
"brace-expansion": "^2.0.1"
61+
},
5662
"sideEffects": [
5763
"./_shims/index.js",
5864
"./_shims/index.mjs",

scripts/bootstrap

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ fi
2121

2222
echo "==> Installing Node dependencies…"
2323

24-
PACKAGE_MANAGER=$(command -v yarn >/dev/null 2>&1 && echo "yarn" || echo "npm")
24+
if ! command -v yarn >/dev/null 2>&1; then
25+
echo "Error: yarn is required but not installed."
26+
echo "Please install yarn: https://classic.yarnpkg.com/en/docs/install"
27+
exit 1
28+
fi
2529

26-
$PACKAGE_MANAGER install
30+
yarn install

tests/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ describe('instantiate client', () => {
123123

124124
const spy = jest.spyOn(client, 'request');
125125

126-
await expect(client.get('/foo', { signal: controller.signal })).rejects.toThrowError(APIUserAbortError);
126+
await expect(client.get('/foo', { signal: controller.signal })).rejects.toThrow(APIUserAbortError);
127127
expect(spy).toHaveBeenCalledTimes(1);
128128
});
129129

0 commit comments

Comments
 (0)