-
Notifications
You must be signed in to change notification settings - Fork 0
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
981e030
commit 3cf8e2c
Showing
86 changed files
with
9,319 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,23 @@ | ||
# 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 | ||
|
||
# Ensure UTF-8 encoding | ||
ENV LANG=C.UTF-8 | ||
ENV LC_ALL=C.UTF-8 | ||
|
||
# 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,66 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
- next | ||
|
||
jobs: | ||
lint: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
|
||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Bootstrap | ||
run: ./scripts/bootstrap | ||
|
||
- name: Check types | ||
run: ./scripts/lint | ||
|
||
build: | ||
name: build | ||
runs-on: ubuntu-latest | ||
|
||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Bootstrap | ||
run: ./scripts/bootstrap | ||
|
||
- name: Check build | ||
run: ./scripts/build | ||
test: | ||
name: test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Bootstrap | ||
run: ./scripts/bootstrap | ||
|
||
- name: Run tests | ||
run: ./scripts/test | ||
|
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 @@ | ||
.prism.log | ||
node_modules | ||
yarn-error.log | ||
codegen.log | ||
Brewfile.lock.json | ||
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,2 @@ | ||
configured_endpoints: 12 | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/maestro%2Fmaestro-arch-rpc-a04ce538c803bb8fd64c905a15cf7a02063faa72addd34cb7f31086f434fa666.yml |
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 @@ | ||
brew "node" |
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 set up the repository, run: | ||
|
||
```sh | ||
$ 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. Modifications to code will be persisted between generations, but may | ||
result in merge conflicts between manual patches and changes from the generator. The generator will never | ||
modify the contents of the `src/lib/` and `examples/` directories. | ||
|
||
## Adding and running examples | ||
|
||
All files in the `examples/` directory are not modified by the generator and can be freely edited or added to. | ||
|
||
```ts | ||
// 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: | ||
|
||
```sh | ||
$ npm install git+ssh://[email protected]:stainless-sdks/maestro-arch-rpc-node.git | ||
``` | ||
|
||
Alternatively, to link a local copy of the repo: | ||
|
||
```sh | ||
# Clone | ||
$ git clone https://www.github.com/stainless-sdks/maestro-arch-rpc-node | ||
$ cd maestro-arch-rpc-node | ||
|
||
# With yarn | ||
$ yarn link | ||
$ cd ../my-package | ||
$ yarn link maestro-arch-rpc | ||
|
||
# With pnpm | ||
$ pnpm link --global | ||
$ cd ../my-package | ||
$ pnpm link -—global maestro-arch-rpc | ||
``` | ||
|
||
## 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. | ||
|
||
```sh | ||
$ npx prism mock path/to/your/openapi.yml | ||
``` | ||
|
||
```sh | ||
$ 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: | ||
|
||
```sh | ||
$ yarn lint | ||
``` | ||
|
||
To format and fix all lint issues automatically: | ||
|
||
```sh | ||
$ 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/stainless-sdks/maestro-arch-rpc-node/actions/workflows/publish-npm.yml). This requires 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.