-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(cli): convert CLI to class and use zod for validation
- Loading branch information
1 parent
407ef2d
commit 2bda7f0
Showing
4 changed files
with
141 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
export type Category_VM = "staging" | "production"; | ||
import { z } from "zod"; | ||
|
||
export interface Info_VM { | ||
baseUrl: string; | ||
destination: Category_VM; | ||
} | ||
export type Environment_Cli = "staging" | "production"; | ||
|
||
export interface Options_Cli { | ||
build?: boolean; | ||
delete?: boolean; | ||
environment?: Category_VM; | ||
force?: boolean; | ||
packages?: string[]; | ||
skipEnv?: boolean; | ||
user?: string; | ||
} | ||
export const Schema_Options_Cli = z.object({ | ||
clientId: z.string().optional(), | ||
environment: z.enum(["staging", "production"]).optional(), | ||
force: z.boolean().optional(), | ||
packages: z.array(z.string()).optional(), | ||
user: z.string().optional(), | ||
}); | ||
|
||
export type Options_Cli = z.infer<typeof Schema_Options_Cli>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters