Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit b2c94f0

Browse files
committed
feat: have two tsp projects compile 👍
1 parent 8a3c0f7 commit b2c94f0

File tree

8 files changed

+1333
-6
lines changed

8 files changed

+1333
-6
lines changed

.github/workflows/deploy-openapi-spec.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,18 @@ jobs:
2121
with:
2222
node-version: "lts/*"
2323
cache: "npm"
24-
cache-dependency-path: "./polyproto/core/package-lock.json"
24+
cache-dependency-path: "./polyproto/package-lock.json"
2525
- name: Install TypeSpec and compile project
2626
run: |
27-
cd ./polyproto/core/
27+
cd ./polyproto/
2828
npm install -g @typespec/compiler
2929
npm install
3030
tsp compile .
3131
- name: Commit OpenAPI specification to repository
3232
run: |
3333
tree -L 2
34-
mv ./polyproto/core/tsp-output/schema/openapi.v1.0-beta.1.yaml ./build/core-openapi3.yaml
34+
mv ./polyproto/tsp-output/schema/openapi.polyproto.core.Routes.v1.0-beta.1.yaml ./build/core-openapi3.yaml
35+
mv ./polyproto/tsp-output/schema/openapi.polyproto.chat.v1.0-beta.1.yaml ./build/chat-openapi3.yaml
3536
git add ./build/*
3637
git commit -m "[bot]update openapi3 schema" || true
3738
git push || true

polyproto/chat/main.tsp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1+
import "../main.tsp";
2+
3+
using Http;
4+
using Versioning;
5+
using OpenAPI;
6+
7+
@service(#{ title: "polyproto chat APIs" })
8+
@info(#{
9+
license: #{
10+
name: "MIT License",
11+
url: "https://raw.githubusercontent.com/polyphony-chat/docs/refs/heads/main/LICENSE",
12+
},
13+
})
14+
@server("https://example.com", "Example endpoint")
15+
@route("/.p2/chat/v1/")
16+
@versioned(Version)
117
namespace polyproto.chat;
18+
19+
enum Version {
20+
`v1.0-beta.1`,
21+
}

polyproto/core/main.tsp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ import "@typespec/openapi3";
44
import "./routes";
55
import "./models";
66

7-
using Versioning;
8-
97
namespace polyproto.core;

polyproto/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
"dependencies": {
2222
"@typespec/versioning": "^0.70.0"
2323
}
24-
}
24+
}

polyproto/main.tsp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import "./chat/main.tsp";
2+
import "./core/main.tsp";
3+
4+
namespace polyproto;

0 commit comments

Comments
 (0)