Skip to content

Commit a6c643b

Browse files
feat: Add initial Stainless SDK
1 parent 48105eb commit a6c643b

Some content is hidden

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

80 files changed

+8376
-1
lines changed

.devcontainer/Dockerfile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# syntax=docker/dockerfile:1
2+
FROM debian:bookworm-slim AS stainless
3+
4+
RUN apt-get update && apt-get install -y \
5+
nodejs \
6+
npm \
7+
yarnpkg \
8+
&& apt-get clean autoclean
9+
10+
# Yarn
11+
RUN ln -sf /usr/bin/yarnpkg /usr/bin/yarn
12+
13+
WORKDIR /workspace
14+
15+
COPY package.json yarn.lock /workspace/
16+
17+
RUN yarn install
18+
19+
COPY . /workspace

.devcontainer/devcontainer.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
3+
{
4+
"name": "Debian",
5+
"build": {
6+
"dockerfile": "Dockerfile"
7+
}
8+
9+
// Features to add to the dev container. More info: https://containers.dev/features.
10+
// "features": {},
11+
12+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
13+
// "forwardPorts": [],
14+
15+
// Configure tool-specific properties.
16+
// "customizations": {},
17+
18+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
19+
// "remoteUser": "root"
20+
}

.eslintrc.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
plugins: ['@typescript-eslint', 'unused-imports', 'prettier'],
4+
rules: {
5+
'no-unused-vars': 'off',
6+
'prettier/prettier': 'error',
7+
'unused-imports/no-unused-imports': 'error',
8+
},
9+
root: true,
10+
};

.github/workflows/ci.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
jobs:
11+
lint:
12+
name: lint
13+
runs-on: ubuntu-latest
14+
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '18'
23+
24+
- name: Install dependencies
25+
run: |
26+
yarn install
27+
28+
- name: Check types
29+
run: |
30+
yarn build

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
yarn-error.log
3+
codegen.log
4+
dist
5+
/deno
6+
/*.tgz
7+
.idea/

.prettierignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CHANGELOG.md
2+
/ecosystem-tests
3+
/node_modules
4+
/deno
5+
6+
# don't format tsc output, will break source maps
7+
/dist

.prettierrc.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"arrowParens": "always",
3+
"experimentalTernaries": true,
4+
"printWidth": 110,
5+
"singleQuote": true,
6+
"trailingComma": "all"
7+
}

.stats.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
configured_endpoints: 4

CHANGELOG.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Changelog
2+
3+
## 0.1.0 (2024-02-12)
4+
5+
Full Changelog: [v0.0.1...v0.1.0](https://github.com/definitive-io/groqcloud-node/compare/v0.0.1...v0.1.0)
6+
7+
### Features
8+
9+
* Add initial Stainless SDK ([73f0686](https://github.com/definitive-io/groqcloud-node/commit/73f0686f4dc84d332cf0eb072cad15dbd8594dea))
10+
* create default branch ([9a37669](https://github.com/definitive-io/groqcloud-node/commit/9a376697847c0e7d9463cf5ad55ff469f59577cb))
11+
* OpenAPI spec update ([#1](https://github.com/definitive-io/groqcloud-node/issues/1)) ([9ab0d58](https://github.com/definitive-io/groqcloud-node/commit/9ab0d580b2c9fa77b8e60a61e7711c605cb24f48))
12+
* OpenAPI spec update ([#10](https://github.com/definitive-io/groqcloud-node/issues/10)) ([66870af](https://github.com/definitive-io/groqcloud-node/commit/66870afc708e452df9d75487cfec39c73c883adf))
13+
* OpenAPI spec update ([#11](https://github.com/definitive-io/groqcloud-node/issues/11)) ([af63094](https://github.com/definitive-io/groqcloud-node/commit/af630946df953c20cb6ddd9dbbcef70a016c4147))
14+
* OpenAPI spec update ([#12](https://github.com/definitive-io/groqcloud-node/issues/12)) ([8f55f00](https://github.com/definitive-io/groqcloud-node/commit/8f55f00afa2efe4d41a969ac92cc7302686ea9fe))
15+
* OpenAPI spec update ([#13](https://github.com/definitive-io/groqcloud-node/issues/13)) ([ec65a86](https://github.com/definitive-io/groqcloud-node/commit/ec65a86b21d632d8785ea86c83d9ea8fbd49997b))
16+
* OpenAPI spec update ([#3](https://github.com/definitive-io/groqcloud-node/issues/3)) ([18ca5ad](https://github.com/definitive-io/groqcloud-node/commit/18ca5ad6efa200b8dc000603a3c1d2c4b64a1a7c))
17+
* OpenAPI spec update ([#4](https://github.com/definitive-io/groqcloud-node/issues/4)) ([7d3354a](https://github.com/definitive-io/groqcloud-node/commit/7d3354ad7a086e6b935934d09052086e9ca5161b))
18+
* OpenAPI spec update ([#5](https://github.com/definitive-io/groqcloud-node/issues/5)) ([8a029ec](https://github.com/definitive-io/groqcloud-node/commit/8a029ec0f29d7a544d4c6ad88ed2d5856df77ed8))
19+
* OpenAPI spec update ([#6](https://github.com/definitive-io/groqcloud-node/issues/6)) ([d45a00d](https://github.com/definitive-io/groqcloud-node/commit/d45a00d6d2d7ec67302e5bce0eba89d85998dd75))
20+
* OpenAPI spec update ([#7](https://github.com/definitive-io/groqcloud-node/issues/7)) ([9142dad](https://github.com/definitive-io/groqcloud-node/commit/9142dade7bb345f47e348f300be2fd7beaa7e7d7))
21+
* OpenAPI spec update ([#8](https://github.com/definitive-io/groqcloud-node/issues/8)) ([d143ade](https://github.com/definitive-io/groqcloud-node/commit/d143ade1cec62b4261d1661f62cb7c88f2cd22fb))
22+
* OpenAPI spec update ([#9](https://github.com/definitive-io/groqcloud-node/issues/9)) ([2849be2](https://github.com/definitive-io/groqcloud-node/commit/2849be292711a6f8bf597458aa80e37ecc8e9716))

CONTRIBUTING.md

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
## Setting up the environment
2+
3+
This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable).
4+
Other package managers may work but are not officially supported for development.
5+
6+
To setup the repository, run:
7+
8+
```bash
9+
yarn
10+
yarn build
11+
```
12+
13+
This will install all the required dependencies and build output files to `dist/`.
14+
15+
## Modifying/Adding code
16+
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.
19+
20+
## Adding and running examples
21+
22+
All files in the `examples/` directory are not modified by the Stainless generator and can be freely edited or
23+
added to.
24+
25+
```bash
26+
// add an example to examples/<your-example>.ts
27+
28+
#!/usr/bin/env -S npm run tsn -T
29+
30+
```
31+
32+
```
33+
chmod +x examples/<your-example>.ts
34+
# run the example against your api
35+
yarn tsn -T examples/<your-example>.ts
36+
```
37+
38+
## Using the repository from source
39+
40+
If you’d like to use the repository from source, you can either install from git or link to a cloned repository:
41+
42+
To install via git:
43+
44+
```bash
45+
npm install --save git+ssh://[email protected]:groq/groq-node.git
46+
```
47+
48+
Alternatively, to link a local copy of the repo:
49+
50+
```bash
51+
# Clone
52+
git clone https://www.github.com/groq/groq-node
53+
cd groq-node
54+
55+
# With yarn
56+
yarn link
57+
cd ../my-package
58+
yarn link groq
59+
60+
# With pnpm
61+
pnpm link --global
62+
cd ../my-package
63+
pnpm link -—global groq
64+
```
65+
66+
## Running tests
67+
68+
Most tests will require you to [setup a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
69+
70+
```bash
71+
npx prism path/to/your/openapi.yml
72+
```
73+
74+
```bash
75+
yarn run test
76+
```
77+
78+
## Linting and formatting
79+
80+
This repository uses [prettier](https://www.npmjs.com/package/prettier) and
81+
[eslint](https://www.npmjs.com/package/eslint) to format the code in the repository.
82+
83+
To lint:
84+
85+
```bash
86+
yarn lint
87+
```
88+
89+
To format and fix all lint issues automatically:
90+
91+
```bash
92+
yarn fix
93+
```
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/groq/groq-node/actions/workflows/publish-npm.yml). This will require 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.

0 commit comments

Comments
 (0)