mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
feat(cli): add openapi suppport in orpc (#563)
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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"] };
|
||||
}
|
||||
|
||||
@@ -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")) {
|
||||
|
||||
@@ -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 });
|
||||
|
||||
@@ -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 });
|
||||
|
||||
@@ -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 });
|
||||
|
||||
@@ -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 });
|
||||
|
||||
@@ -26,7 +26,6 @@ export async function setupSvelteAlchemyDeploy(
|
||||
...pkg.scripts,
|
||||
deploy: "alchemy deploy",
|
||||
destroy: "alchemy destroy",
|
||||
dev: "alchemy dev",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ export async function setupTanStackRouterAlchemyDeploy(
|
||||
...pkg.scripts,
|
||||
deploy: "alchemy deploy",
|
||||
destroy: "alchemy destroy",
|
||||
dev: "alchemy dev",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ export async function setupTanStackStartAlchemyDeploy(
|
||||
...pkg.scripts,
|
||||
deploy: "alchemy deploy",
|
||||
destroy: "alchemy destroy",
|
||||
dev: "alchemy dev",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user