mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-25 21:56:08 +00:00
fix: spinner
This commit is contained in:
@@ -19,8 +19,8 @@ import { handleError } from "@/src/utils/handle-error"
|
||||
import { highlighter } from "@/src/utils/highlighter"
|
||||
import { logger } from "@/src/utils/logger"
|
||||
import { getRegistryBaseColors, getRegistryStyles } from "@/src/utils/registry"
|
||||
import { spinner } from "@/src/utils/spinner"
|
||||
import { Command } from "commander"
|
||||
import ora from "ora"
|
||||
import prompts from "prompts"
|
||||
import { z } from "zod"
|
||||
|
||||
@@ -108,10 +108,10 @@ export async function runInit(
|
||||
}
|
||||
|
||||
// Write components.json.
|
||||
const spinner = ora(`Writing components.json.`).start()
|
||||
const componentSpinner = spinner(`Writing components.json.`).start()
|
||||
const targetPath = path.resolve(options.cwd, "components.json")
|
||||
await fs.writeFile(targetPath, JSON.stringify(config, null, 2), "utf8")
|
||||
spinner.succeed()
|
||||
componentSpinner.succeed()
|
||||
|
||||
// Add components.
|
||||
const fullConfig = await resolveConfigPaths(options.cwd, config)
|
||||
|
||||
@@ -3,9 +3,9 @@ import { initOptionsSchema } from "@/src/commands/init"
|
||||
import { getPackageManager } from "@/src/utils/get-package-manager"
|
||||
import { highlighter } from "@/src/utils/highlighter"
|
||||
import { logger } from "@/src/utils/logger"
|
||||
import { spinner } from "@/src/utils/spinner"
|
||||
import { execa } from "execa"
|
||||
import fs from "fs-extra"
|
||||
import ora from "ora"
|
||||
import prompts from "prompts"
|
||||
import { z } from "zod"
|
||||
|
||||
@@ -71,7 +71,7 @@ export async function createProject(
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const spinner = ora(`Creating a new Next.js project.`).start()
|
||||
const createSpinner = spinner(`Creating a new Next.js project.`).start()
|
||||
|
||||
// Note: pnpm fails here. Fallback to npx with --use-PACKAGE-MANAGER.
|
||||
const args = [
|
||||
@@ -100,7 +100,7 @@ export async function createProject(
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
spinner.succeed()
|
||||
createSpinner?.succeed()
|
||||
|
||||
return {
|
||||
projectPath,
|
||||
|
||||
@@ -6,7 +6,6 @@ import { highlighter } from "@/src/utils/highlighter"
|
||||
import { registryItemTailwindSchema } from "@/src/utils/registry/schema"
|
||||
import { spinner } from "@/src/utils/spinner"
|
||||
import deepmerge from "deepmerge"
|
||||
import ora from "ora"
|
||||
import objectToString from "stringify-object"
|
||||
import { type Config as TailwindConfig } from "tailwindcss"
|
||||
import {
|
||||
|
||||
@@ -52,6 +52,7 @@ Label.displayName = LabelPrimitive.Root.displayName
|
||||
export { Label }
|
||||
",
|
||||
"path": "ui/label.tsx",
|
||||
"target": "",
|
||||
"type": "registry:ui",
|
||||
},
|
||||
{
|
||||
@@ -155,6 +156,7 @@ Button.displayName = "Button"
|
||||
export { Button, buttonVariants }
|
||||
",
|
||||
"path": "ui/button.tsx",
|
||||
"target": "",
|
||||
"type": "registry:ui",
|
||||
},
|
||||
],
|
||||
@@ -231,6 +233,7 @@ Button.displayName = "Button"
|
||||
export { Button, buttonVariants }
|
||||
",
|
||||
"path": "ui/button.tsx",
|
||||
"target": "",
|
||||
"type": "registry:ui",
|
||||
},
|
||||
{
|
||||
@@ -261,6 +264,7 @@ Input.displayName = "Input"
|
||||
export { Input }
|
||||
",
|
||||
"path": "ui/input.tsx",
|
||||
"target": "",
|
||||
"type": "registry:ui",
|
||||
},
|
||||
{
|
||||
@@ -421,6 +425,7 @@ export {
|
||||
}
|
||||
",
|
||||
"path": "ui/command.tsx",
|
||||
"target": "",
|
||||
"type": "registry:ui",
|
||||
},
|
||||
{
|
||||
@@ -548,6 +553,7 @@ export {
|
||||
}
|
||||
",
|
||||
"path": "ui/dialog.tsx",
|
||||
"target": "",
|
||||
"type": "registry:ui",
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user