Skip to content

Commit 99e810a

Browse files
committed
feat: scaffold kreuzberg-cloud-sdk multi-language client monorepo
Initial scaffold of the multi-language SDK monorepo for the Kreuzberg Cloud REST API. Vendored OpenAPI 3.1 spec under spec/openapi.yaml, single-version source of truth (VERSION file) propagated via scripts/sync-versions.py. Packages: - packages/python (PyPI: kreuzberg-cloud) — hatchling build, httpx-based client, openapi-python-client generator, ruff + mypy strict, pytest + respx, 6 smoke tests passing - packages/typescript (npm: @kreuzberg/cloud) — ESM-only, tsdown bundler (Rolldown/oxc), openapi-typescript types + openapi-fetch runtime, vitest + msw, 4 smoke tests passing - packages/go/v1 (github.com/kreuzberg-dev/kreuzberg-cloud-sdk/go/v1) — stdlib net/http, oapi-codegen as Go tool dependency, golangci-lint + govulncheck, 7 client tests passing CI: validate (prek run), per-language ci-{python,typescript,go}, publish-{python,typescript} (tag-triggered, trusted publishing / provenance), spec-sync (weekly drift PR). Known: oapi-codegen does not yet support OpenAPI 3.1 nested nullable oneOfs (oapi-codegen#373); Go generation is wired but blocked on upstream until oapi-codegen ships 3.1 support or the API emits 3.0. The hand-written Go client builds and tests cleanly without the generated layer. License: MIT.
0 parents  commit 99e810a

56 files changed

Lines changed: 9428 additions & 0 deletions

Some content is hidden

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

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
* text=auto eol=lf
2+
*.png binary
3+
*.jpg binary
4+
*.pdf binary
5+
spec/openapi.yaml linguist-generated=false
6+
packages/python/src/kreuzberg_cloud/_generated/** linguist-generated=true
7+
packages/typescript/src/_generated/** linguist-generated=true
8+
packages/go/v1/generated.go linguist-generated=true

.github/workflows/ci-go.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: ci-go
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
paths:
7+
- "packages/go/**"
8+
- "spec/openapi.yaml"
9+
- "tasks/go.yml"
10+
- "go.work"
11+
- ".github/workflows/ci-go.yml"
12+
push:
13+
branches: [main]
14+
paths:
15+
- "packages/go/**"
16+
- "spec/openapi.yaml"
17+
- "tasks/go.yml"
18+
- "go.work"
19+
20+
concurrency:
21+
group: ci-go-${{ github.ref }}
22+
cancel-in-progress: true
23+
24+
permissions:
25+
contents: read
26+
27+
jobs:
28+
test:
29+
name: test (go${{ matrix.go }} on ${{ matrix.os }})
30+
runs-on: ${{ matrix.os }}
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
os: [ubuntu-latest, macos-latest]
35+
go: ["1.26"]
36+
steps:
37+
- uses: actions/checkout@v6
38+
- uses: actions/setup-go@v6
39+
with:
40+
go-version: ${{ matrix.go }}
41+
cache: true
42+
- name: Install task
43+
uses: arduino/setup-task@v2
44+
with:
45+
version: 3.x
46+
repo-token: ${{ secrets.GITHUB_TOKEN }}
47+
- name: Install golangci-lint
48+
uses: golangci/golangci-lint-action@v8
49+
with:
50+
version: latest
51+
working-directory: packages/go/v1
52+
- name: Install govulncheck
53+
run: go install golang.org/x/vuln/cmd/govulncheck@latest
54+
- name: Generate client
55+
run: task go:generate
56+
- name: Lint
57+
run: task go:lint
58+
- name: Test (with coverage)
59+
run: task go:test:cov

.github/workflows/ci-python.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: ci-python
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
paths:
7+
- "packages/python/**"
8+
- "spec/openapi.yaml"
9+
- "tasks/python.yml"
10+
- "pyproject.toml"
11+
- ".github/workflows/ci-python.yml"
12+
push:
13+
branches: [main]
14+
paths:
15+
- "packages/python/**"
16+
- "spec/openapi.yaml"
17+
- "tasks/python.yml"
18+
- "pyproject.toml"
19+
20+
concurrency:
21+
group: ci-python-${{ github.ref }}
22+
cancel-in-progress: true
23+
24+
permissions:
25+
contents: read
26+
27+
jobs:
28+
test:
29+
name: test (py${{ matrix.python }} on ${{ matrix.os }})
30+
runs-on: ${{ matrix.os }}
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
os: [ubuntu-latest, macos-latest]
35+
python: ["3.10", "3.11", "3.12", "3.13"]
36+
steps:
37+
- uses: actions/checkout@v6
38+
- uses: astral-sh/setup-uv@v6
39+
with:
40+
enable-cache: true
41+
- name: Pin Python
42+
run: uv python install ${{ matrix.python }}
43+
- name: Install task
44+
uses: arduino/setup-task@v2
45+
with:
46+
version: 3.x
47+
repo-token: ${{ secrets.GITHUB_TOKEN }}
48+
- name: Install deps
49+
run: uv sync
50+
- name: Generate client
51+
run: task python:generate
52+
- name: Lint
53+
run: task python:lint
54+
- name: Test (with coverage)
55+
run: task python:test:cov
56+
- name: Build wheel + sdist
57+
run: task python:build
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: ci-typescript
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
paths:
7+
- "packages/typescript/**"
8+
- "spec/openapi.yaml"
9+
- "tasks/typescript.yml"
10+
- "package.json"
11+
- "pnpm-workspace.yaml"
12+
- "tsconfig.base.json"
13+
- ".github/workflows/ci-typescript.yml"
14+
push:
15+
branches: [main]
16+
paths:
17+
- "packages/typescript/**"
18+
- "spec/openapi.yaml"
19+
- "tasks/typescript.yml"
20+
- "package.json"
21+
- "pnpm-workspace.yaml"
22+
- "tsconfig.base.json"
23+
24+
concurrency:
25+
group: ci-typescript-${{ github.ref }}
26+
cancel-in-progress: true
27+
28+
permissions:
29+
contents: read
30+
31+
jobs:
32+
test:
33+
name: test (node${{ matrix.node }} on ${{ matrix.os }})
34+
runs-on: ${{ matrix.os }}
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
os: [ubuntu-latest, macos-latest]
39+
node: ["20", "22", "24"]
40+
steps:
41+
- uses: actions/checkout@v6
42+
- uses: pnpm/action-setup@v4
43+
with:
44+
version: 11.0.8
45+
- uses: actions/setup-node@v5
46+
with:
47+
node-version: ${{ matrix.node }}
48+
cache: pnpm
49+
- name: Install task
50+
uses: arduino/setup-task@v2
51+
with:
52+
version: 3.x
53+
repo-token: ${{ secrets.GITHUB_TOKEN }}
54+
- name: Install deps
55+
run: pnpm install
56+
- name: Generate client
57+
run: task typescript:generate
58+
- name: Typecheck + lint
59+
run: task typescript:lint
60+
- name: Test (with coverage)
61+
run: task typescript:test:cov
62+
- name: Build
63+
run: task typescript:build
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: publish-python
2+
3+
on:
4+
push:
5+
tags:
6+
- "python-v*"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
publish:
14+
name: publish to PyPI
15+
runs-on: ubuntu-latest
16+
environment:
17+
name: pypi
18+
url: https://pypi.org/p/kreuzberg-cloud
19+
permissions:
20+
id-token: write
21+
steps:
22+
- uses: actions/checkout@v6
23+
- uses: astral-sh/setup-uv@v6
24+
with:
25+
enable-cache: true
26+
- name: Install task
27+
uses: arduino/setup-task@v2
28+
with:
29+
version: 3.x
30+
repo-token: ${{ secrets.GITHUB_TOKEN }}
31+
- name: Install deps
32+
run: uv sync
33+
- name: Generate client
34+
run: task python:generate
35+
- name: Build wheel + sdist
36+
run: task python:build
37+
- name: Publish to PyPI (trusted publishing)
38+
run: cd packages/python && uv publish --trusted-publishing always
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: publish-typescript
2+
3+
on:
4+
push:
5+
tags:
6+
- "ts-v*"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
publish:
14+
name: publish to npm
15+
runs-on: ubuntu-latest
16+
permissions:
17+
id-token: write
18+
contents: read
19+
steps:
20+
- uses: actions/checkout@v6
21+
- uses: pnpm/action-setup@v4
22+
with:
23+
version: 11.0.8
24+
- uses: actions/setup-node@v5
25+
with:
26+
node-version: "20"
27+
registry-url: "https://registry.npmjs.org"
28+
cache: pnpm
29+
- name: Install task
30+
uses: arduino/setup-task@v2
31+
with:
32+
version: 3.x
33+
repo-token: ${{ secrets.GITHUB_TOKEN }}
34+
- name: Install deps
35+
run: pnpm install
36+
- name: Generate client
37+
run: task typescript:generate
38+
- name: Build
39+
run: task typescript:build
40+
- name: Publish to npm (with provenance)
41+
run: cd packages/typescript && pnpm publish --access public --provenance --no-git-checks
42+
env:
43+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/spec-sync.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: spec-sync
2+
3+
on:
4+
schedule:
5+
- cron: "0 6 * * 1"
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
sync:
14+
name: refresh vendored OpenAPI spec
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v6
18+
- name: Checkout sibling kreuzberg-cloud
19+
uses: actions/checkout@v6
20+
with:
21+
repository: kreuzberg-dev/kreuzberg-cloud
22+
path: _kreuzberg-cloud
23+
ref: main
24+
- name: Copy spec
25+
run: cp _kreuzberg-cloud/frontend/openapi-backend.yaml spec/openapi.yaml
26+
- name: Detect drift
27+
id: diff
28+
run: |
29+
if git diff --quiet -- spec/openapi.yaml; then
30+
echo "changed=false" >> "$GITHUB_OUTPUT"
31+
else
32+
echo "changed=true" >> "$GITHUB_OUTPUT"
33+
fi
34+
- name: Open PR
35+
if: steps.diff.outputs.changed == 'true'
36+
uses: peter-evans/create-pull-request@v7
37+
with:
38+
commit-message: "chore(spec): sync openapi.yaml from kreuzberg-cloud"
39+
title: "chore(spec): sync openapi.yaml from kreuzberg-cloud"
40+
body: |
41+
Automated sync of `spec/openapi.yaml` from `kreuzberg-dev/kreuzberg-cloud@main`.
42+
43+
Run `task generate` and review per-language diffs before merging.
44+
branch: chore/spec-sync
45+
delete-branch: true
46+
add-paths: spec/openapi.yaml

.github/workflows/validate.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: validate
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: validate-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
prek:
19+
name: prek run --all-files
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v6
23+
- uses: astral-sh/setup-uv@v6
24+
with:
25+
enable-cache: true
26+
- uses: pnpm/action-setup@v4
27+
with:
28+
version: 11.0.8
29+
- uses: actions/setup-node@v5
30+
with:
31+
node-version: "20"
32+
cache: pnpm
33+
- uses: actions/setup-go@v6
34+
with:
35+
go-version: "1.26"
36+
- name: Install prek
37+
run: uv tool install prek
38+
- name: Install workspace deps
39+
run: |
40+
uv sync
41+
pnpm install
42+
(cd packages/go/v1 && go mod download)
43+
- name: Run prek
44+
run: prek run --all-files --show-diff-on-failure

0 commit comments

Comments
 (0)