feat(cli): add openapi suppport in orpc (#563)

This commit is contained in:
Aman Varshney
2025-09-04 15:08:44 +05:30
committed by GitHub
parent 50a1b9441f
commit a276addef8
15 changed files with 193 additions and 24 deletions

View File

@@ -54,7 +54,14 @@ function getApiDependencies(
> = {};
if (api === "orpc") {
deps.server = { dependencies: ["@orpc/server", "@orpc/client"] };
deps.server = {
dependencies: [
"@orpc/server",
"@orpc/client",
"@orpc/openapi",
"@orpc/zod",
],
};
} else if (api === "trpc") {
deps.server = { dependencies: ["@trpc/server", "@trpc/client"] };
}

View File

@@ -14,6 +14,7 @@ export async function displayPostInstallInstructions(
config: ProjectConfig & { depsInstalled: boolean },
) {
const {
api,
database,
relativePath,
packageManager,
@@ -158,6 +159,14 @@ export async function displayPostInstallInstructions(
if (!isConvex) {
output += `${pc.cyan("•")} Backend API: http://localhost:3000\n`;
if (api === "orpc") {
if (backend === "next") {
output += `${pc.cyan("•")} OpenAPI (Scalar UI): http://localhost:3000/rpc/api\n`;
} else {
output += `${pc.cyan("•")} OpenAPI (Scalar UI): http://localhost:3000/api\n`;
}
}
}
if (addons?.includes("starlight")) {