-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48105eb
commit a6c643b
Showing
80 changed files
with
8,376 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM debian:bookworm-slim AS stainless | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
nodejs \ | ||
npm \ | ||
yarnpkg \ | ||
&& apt-get clean autoclean | ||
|
||
# Yarn | ||
RUN ln -sf /usr/bin/yarnpkg /usr/bin/yarn | ||
|
||
WORKDIR /workspace | ||
|
||
COPY package.json yarn.lock /workspace/ | ||
|
||
RUN yarn install | ||
|
||
COPY . /workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/debian | ||
{ | ||
"name": "Debian", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
} | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint', 'unused-imports', 'prettier'], | ||
rules: { | ||
'no-unused-vars': 'off', | ||
'prettier/prettier': 'error', | ||
'unused-imports/no-unused-imports': 'error', | ||
}, | ||
root: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
|
||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
run: | | ||
yarn install | ||
- name: Check types | ||
run: | | ||
yarn build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules | ||
yarn-error.log | ||
codegen.log | ||
dist | ||
/deno | ||
/*.tgz | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CHANGELOG.md | ||
/ecosystem-tests | ||
/node_modules | ||
/deno | ||
|
||
# don't format tsc output, will break source maps | ||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"arrowParens": "always", | ||
"experimentalTernaries": true, | ||
"printWidth": 110, | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
configured_endpoints: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Changelog | ||
|
||
## 0.1.0 (2024-02-12) | ||
|
||
Full Changelog: [v0.0.1...v0.1.0](https://github.com/definitive-io/groqcloud-node/compare/v0.0.1...v0.1.0) | ||
|
||
### Features | ||
|
||
* Add initial Stainless SDK ([73f0686](https://github.com/definitive-io/groqcloud-node/commit/73f0686f4dc84d332cf0eb072cad15dbd8594dea)) | ||
* create default branch ([9a37669](https://github.com/definitive-io/groqcloud-node/commit/9a376697847c0e7d9463cf5ad55ff469f59577cb)) | ||
* OpenAPI spec update ([#1](https://github.com/definitive-io/groqcloud-node/issues/1)) ([9ab0d58](https://github.com/definitive-io/groqcloud-node/commit/9ab0d580b2c9fa77b8e60a61e7711c605cb24f48)) | ||
* OpenAPI spec update ([#10](https://github.com/definitive-io/groqcloud-node/issues/10)) ([66870af](https://github.com/definitive-io/groqcloud-node/commit/66870afc708e452df9d75487cfec39c73c883adf)) | ||
* OpenAPI spec update ([#11](https://github.com/definitive-io/groqcloud-node/issues/11)) ([af63094](https://github.com/definitive-io/groqcloud-node/commit/af630946df953c20cb6ddd9dbbcef70a016c4147)) | ||
* OpenAPI spec update ([#12](https://github.com/definitive-io/groqcloud-node/issues/12)) ([8f55f00](https://github.com/definitive-io/groqcloud-node/commit/8f55f00afa2efe4d41a969ac92cc7302686ea9fe)) | ||
* OpenAPI spec update ([#13](https://github.com/definitive-io/groqcloud-node/issues/13)) ([ec65a86](https://github.com/definitive-io/groqcloud-node/commit/ec65a86b21d632d8785ea86c83d9ea8fbd49997b)) | ||
* OpenAPI spec update ([#3](https://github.com/definitive-io/groqcloud-node/issues/3)) ([18ca5ad](https://github.com/definitive-io/groqcloud-node/commit/18ca5ad6efa200b8dc000603a3c1d2c4b64a1a7c)) | ||
* OpenAPI spec update ([#4](https://github.com/definitive-io/groqcloud-node/issues/4)) ([7d3354a](https://github.com/definitive-io/groqcloud-node/commit/7d3354ad7a086e6b935934d09052086e9ca5161b)) | ||
* OpenAPI spec update ([#5](https://github.com/definitive-io/groqcloud-node/issues/5)) ([8a029ec](https://github.com/definitive-io/groqcloud-node/commit/8a029ec0f29d7a544d4c6ad88ed2d5856df77ed8)) | ||
* OpenAPI spec update ([#6](https://github.com/definitive-io/groqcloud-node/issues/6)) ([d45a00d](https://github.com/definitive-io/groqcloud-node/commit/d45a00d6d2d7ec67302e5bce0eba89d85998dd75)) | ||
* OpenAPI spec update ([#7](https://github.com/definitive-io/groqcloud-node/issues/7)) ([9142dad](https://github.com/definitive-io/groqcloud-node/commit/9142dade7bb345f47e348f300be2fd7beaa7e7d7)) | ||
* OpenAPI spec update ([#8](https://github.com/definitive-io/groqcloud-node/issues/8)) ([d143ade](https://github.com/definitive-io/groqcloud-node/commit/d143ade1cec62b4261d1661f62cb7c88f2cd22fb)) | ||
* OpenAPI spec update ([#9](https://github.com/definitive-io/groqcloud-node/issues/9)) ([2849be2](https://github.com/definitive-io/groqcloud-node/commit/2849be292711a6f8bf597458aa80e37ecc8e9716)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
## Setting up the environment | ||
|
||
This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable). | ||
Other package managers may work but are not officially supported for development. | ||
|
||
To setup the repository, run: | ||
|
||
```bash | ||
yarn | ||
yarn build | ||
``` | ||
|
||
This will install all the required dependencies and build output files to `dist/`. | ||
|
||
## Modifying/Adding code | ||
|
||
Most of the SDK is generated code, and any modified code will be overridden on the next generation. The | ||
`src/lib/` and `examples/` directories are exceptions and will never be overridden. | ||
|
||
## Adding and running examples | ||
|
||
All files in the `examples/` directory are not modified by the Stainless generator and can be freely edited or | ||
added to. | ||
|
||
```bash | ||
// add an example to examples/<your-example>.ts | ||
|
||
#!/usr/bin/env -S npm run tsn -T | ||
… | ||
``` | ||
|
||
``` | ||
chmod +x examples/<your-example>.ts | ||
# run the example against your api | ||
yarn tsn -T examples/<your-example>.ts | ||
``` | ||
|
||
## Using the repository from source | ||
|
||
If you’d like to use the repository from source, you can either install from git or link to a cloned repository: | ||
|
||
To install via git: | ||
|
||
```bash | ||
npm install --save git+ssh://git@github.com:groq/groq-node.git | ||
``` | ||
|
||
Alternatively, to link a local copy of the repo: | ||
|
||
```bash | ||
# Clone | ||
git clone https://www.github.com/groq/groq-node | ||
cd groq-node | ||
|
||
# With yarn | ||
yarn link | ||
cd ../my-package | ||
yarn link groq | ||
|
||
# With pnpm | ||
pnpm link --global | ||
cd ../my-package | ||
pnpm link -—global groq | ||
``` | ||
|
||
## Running tests | ||
|
||
Most tests will require you to [setup a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. | ||
|
||
```bash | ||
npx prism path/to/your/openapi.yml | ||
``` | ||
|
||
```bash | ||
yarn run test | ||
``` | ||
|
||
## Linting and formatting | ||
|
||
This repository uses [prettier](https://www.npmjs.com/package/prettier) and | ||
[eslint](https://www.npmjs.com/package/eslint) to format the code in the repository. | ||
|
||
To lint: | ||
|
||
```bash | ||
yarn lint | ||
``` | ||
|
||
To format and fix all lint issues automatically: | ||
|
||
```bash | ||
yarn fix | ||
``` | ||
|
||
## Publishing and releases | ||
|
||
Changes made to this repository via the automated release PR pipeline should publish to npm automatically. If | ||
the changes aren't made through the automated pipeline, you may want to make releases manually. | ||
|
||
### Publish with a GitHub workflow | ||
|
||
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. | ||
|
||
### Publish manually | ||
|
||
If you need to manually release a package, you can run the `bin/publish-npm` script with an `NPM_TOKEN` set on | ||
the environment. |
Oops, something went wrong.