mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
cli: update deps
This commit is contained in:
@@ -72,9 +72,7 @@ export async function addAddonsToProject(
|
||||
}
|
||||
|
||||
log.info(
|
||||
pc.green(
|
||||
`Adding ${input.addons.join(", ")} to ${config.frontend.join("/")}`,
|
||||
),
|
||||
`Adding ${input.addons.join(", ")} to ${config.frontend.join("/")}`,
|
||||
);
|
||||
|
||||
await setupAddonsTemplate(projectDir, config);
|
||||
|
||||
@@ -209,13 +209,11 @@ export async function addAddonsHandler(input: AddInput): Promise<void> {
|
||||
});
|
||||
} else {
|
||||
log.info(
|
||||
pc.yellow(
|
||||
`Run ${pc.bold(`${packageManager} install`)} to install dependencies`,
|
||||
),
|
||||
`Run ${pc.bold(`${packageManager} install`)} to install dependencies`,
|
||||
);
|
||||
}
|
||||
|
||||
outro(pc.green("Add command completed successfully!"));
|
||||
outro("Add command completed successfully!");
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { intro, log } from "@clack/prompts";
|
||||
import { consola } from "consola";
|
||||
import pc from "picocolors";
|
||||
import { createCli, trpcServer, zod as z } from "trpc-cli";
|
||||
import { createCli, trpcServer } from "trpc-cli";
|
||||
import z from "zod";
|
||||
import {
|
||||
addAddonsHandler,
|
||||
createProjectHandler,
|
||||
@@ -32,34 +33,32 @@ const router = t.router({
|
||||
.meta({
|
||||
description: "Create a new Better-T Stack project",
|
||||
default: true,
|
||||
negateBooleans: true,
|
||||
})
|
||||
.input(
|
||||
z.tuple([
|
||||
ProjectNameSchema.optional(),
|
||||
z
|
||||
.object({
|
||||
yes: z
|
||||
.boolean()
|
||||
.optional()
|
||||
.default(false)
|
||||
.describe("Use default configuration"),
|
||||
database: DatabaseSchema.optional(),
|
||||
orm: ORMSchema.optional(),
|
||||
auth: z.boolean().optional(),
|
||||
frontend: z.array(FrontendSchema).optional(),
|
||||
addons: z.array(AddonsSchema).optional(),
|
||||
examples: z.array(ExamplesSchema).optional(),
|
||||
git: z.boolean().optional(),
|
||||
packageManager: PackageManagerSchema.optional(),
|
||||
install: z.boolean().optional(),
|
||||
dbSetup: DatabaseSetupSchema.optional(),
|
||||
backend: BackendSchema.optional(),
|
||||
runtime: RuntimeSchema.optional(),
|
||||
api: APISchema.optional(),
|
||||
webDeploy: WebDeploySchema.optional(),
|
||||
})
|
||||
.optional()
|
||||
.default({}),
|
||||
z.object({
|
||||
yes: z
|
||||
.boolean()
|
||||
.optional()
|
||||
.default(false)
|
||||
.describe("Use default configuration"),
|
||||
database: DatabaseSchema.optional(),
|
||||
orm: ORMSchema.optional(),
|
||||
auth: z.boolean().optional(),
|
||||
frontend: z.array(FrontendSchema).optional(),
|
||||
addons: z.array(AddonsSchema).optional(),
|
||||
examples: z.array(ExamplesSchema).optional(),
|
||||
git: z.boolean().optional(),
|
||||
packageManager: PackageManagerSchema.optional(),
|
||||
install: z.boolean().optional(),
|
||||
dbSetup: DatabaseSetupSchema.optional(),
|
||||
backend: BackendSchema.optional(),
|
||||
runtime: RuntimeSchema.optional(),
|
||||
api: APISchema.optional(),
|
||||
webDeploy: WebDeploySchema.optional(),
|
||||
}),
|
||||
]),
|
||||
)
|
||||
.mutation(async ({ input }) => {
|
||||
@@ -77,22 +76,17 @@ const router = t.router({
|
||||
})
|
||||
.input(
|
||||
z.tuple([
|
||||
z
|
||||
.object({
|
||||
addons: z.array(AddonsSchema).optional().default([]),
|
||||
webDeploy: WebDeploySchema.optional(),
|
||||
projectDir: z.string().optional(),
|
||||
install: z
|
||||
.boolean()
|
||||
.optional()
|
||||
.default(false)
|
||||
.describe(
|
||||
"Install dependencies after adding addons or deployment",
|
||||
),
|
||||
packageManager: PackageManagerSchema.optional(),
|
||||
})
|
||||
.optional()
|
||||
.default({}),
|
||||
z.object({
|
||||
addons: z.array(AddonsSchema).optional().default([]),
|
||||
webDeploy: WebDeploySchema.optional(),
|
||||
projectDir: z.string().optional(),
|
||||
install: z
|
||||
.boolean()
|
||||
.optional()
|
||||
.default(false)
|
||||
.describe("Install dependencies after adding addons or deployment"),
|
||||
packageManager: PackageManagerSchema.optional(),
|
||||
}),
|
||||
]),
|
||||
)
|
||||
.mutation(async ({ input }) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { z } from "zod";
|
||||
import z from "zod";
|
||||
|
||||
export const DatabaseSchema = z
|
||||
.enum(["none", "sqlite", "postgres", "mysql", "mongodb"])
|
||||
|
||||
Reference in New Issue
Block a user