Skip to content

Commit

Permalink
refactor: update zod imports in /cli (#2473)
Browse files Browse the repository at this point in the history
updates in /cli
  • Loading branch information
kevinmitch14 authored Jan 28, 2024
1 parent ee94767 commit 343b20f
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/wet-eagles-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"shadcn-ui": patch
---

update zod imports
2 changes: 1 addition & 1 deletion packages/cli/src/commands/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Command } from "commander"
import { execa } from "execa"
import ora from "ora"
import prompts from "prompts"
import * as z from "zod"
import { z } from "zod"

const addOptionsSchema = z.object({
components: z.array(z.string()).optional(),
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { transform } from "@/src/utils/transformers"
import chalk from "chalk"
import { Command } from "commander"
import { diffLines, type Change } from "diff"
import * as z from "zod"
import { z } from "zod"

const updateOptionsSchema = z.object({
component: z.string().optional(),
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { execa } from "execa"
import template from "lodash.template"
import ora from "ora"
import prompts from "prompts"
import * as z from "zod"
import { z } from "zod"

import { applyPrefixesCss } from "../utils/transformers/transform-tw-prefix"

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/utils/get-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from "path"
import { resolveImport } from "@/src/utils/resolve-import"
import { cosmiconfig } from "cosmiconfig"
import { loadConfig } from "tsconfig-paths"
import * as z from "zod"
import { z } from "zod"

export const DEFAULT_STYLE = "default"
export const DEFAULT_COMPONENTS = "@/components"
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/utils/registry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from "@/src/utils/registry/schema"
import { HttpsProxyAgent } from "https-proxy-agent"
import fetch from "node-fetch"
import * as z from "zod"
import { z } from "zod"

const baseUrl = process.env.COMPONENTS_REGISTRY_URL ?? "https://ui.shadcn.com"
const agent = process.env.https_proxy
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/utils/registry/schema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as z from "zod"
import { z } from "zod"

// TODO: Extract this to a shared package.
export const registryItemSchema = z.object({
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/utils/transformers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { transformImport } from "@/src/utils/transformers/transform-import"
import { transformJsx } from "@/src/utils/transformers/transform-jsx"
import { transformRsc } from "@/src/utils/transformers/transform-rsc"
import { Project, ScriptKind, type SourceFile } from "ts-morph"
import * as z from "zod"
import { z } from "zod"

import { transformTwPrefixes } from "./transform-tw-prefix"

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/utils/transformers/transform-css-vars.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { registryBaseColorSchema } from "@/src/utils/registry/schema"
import { Transformer } from "@/src/utils/transformers"
import { ScriptKind, SyntaxKind } from "ts-morph"
import * as z from "zod"
import { z } from "zod"

export const transformCssVars: Transformer = async ({
sourceFile,
Expand Down

0 comments on commit 343b20f

Please sign in to comment.