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

@@ -112,6 +112,8 @@ export const dependencyVersionMap = {
"@orpc/server": "^1.8.6",
"@orpc/client": "^1.8.6",
"@orpc/openapi": "^1.8.6",
"@orpc/zod": "^1.8.6",
"@orpc/tanstack-query": "^1.8.6",
"@trpc/tanstack-react-query": "^11.5.0",

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")) {

View File

@@ -25,7 +25,6 @@ export async function setupNextAlchemyDeploy(
...pkg.scripts,
deploy: "alchemy deploy",
destroy: "alchemy destroy",
dev: "alchemy dev",
};
}
await fs.writeJson(pkgPath, pkg, { spaces: 2 });

View File

@@ -26,7 +26,6 @@ export async function setupNuxtAlchemyDeploy(
...pkg.scripts,
deploy: "alchemy deploy",
destroy: "alchemy destroy",
dev: "alchemy dev",
};
}
await fs.writeJson(pkgPath, pkg, { spaces: 2 });

View File

@@ -25,7 +25,6 @@ export async function setupReactRouterAlchemyDeploy(
...pkg.scripts,
deploy: "alchemy deploy",
destroy: "alchemy destroy",
dev: "alchemy dev",
};
}
await fs.writeJson(pkgPath, pkg, { spaces: 2 });

View File

@@ -25,7 +25,6 @@ export async function setupSolidAlchemyDeploy(
...pkg.scripts,
deploy: "alchemy deploy",
destroy: "alchemy destroy",
dev: "alchemy dev",
};
}
await fs.writeJson(pkgPath, pkg, { spaces: 2 });

View File

@@ -26,7 +26,6 @@ export async function setupSvelteAlchemyDeploy(
...pkg.scripts,
deploy: "alchemy deploy",
destroy: "alchemy destroy",
dev: "alchemy dev",
};
}

View File

@@ -25,7 +25,6 @@ export async function setupTanStackRouterAlchemyDeploy(
...pkg.scripts,
deploy: "alchemy deploy",
destroy: "alchemy destroy",
dev: "alchemy dev",
};
}

View File

@@ -26,7 +26,6 @@ export async function setupTanStackStartAlchemyDeploy(
...pkg.scripts,
deploy: "alchemy deploy",
destroy: "alchemy destroy",
dev: "alchemy dev",
};
}