mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-08 22:45:47 +00:00
* chore(shadcn): implement registries poc * feat(shadcn): refactor our initial implementation * feat(shadcn): properly resolve namespaced registryDependencies * feat(shadcn): resolve namespaced registries recursively * fix * feat(shadcn): implement dotenv support * test(shadcn): mock shadcn registry * fix * fix * fix * refactor(shadcn): update functions and tests * refactor(shadcn): add fetchFromRegistry (#7937) * fix * feat(shadcn): add shadcn as a built-in registry * fix * feat(shadcn): update no framework and shadcn
29 lines
679 B
TypeScript
29 lines
679 B
TypeScript
import { existsSync } from "fs"
|
|
import { join } from "path"
|
|
import { logger } from "@/src/utils/logger"
|
|
|
|
export async function loadEnvFiles(cwd: string = process.cwd()): Promise<void> {
|
|
try {
|
|
const { config } = await import("@dotenvx/dotenvx")
|
|
const envFiles = [
|
|
".env.local",
|
|
".env.development.local",
|
|
".env.development",
|
|
".env",
|
|
]
|
|
|
|
for (const envFile of envFiles) {
|
|
const envPath = join(cwd, envFile)
|
|
if (existsSync(envPath)) {
|
|
config({
|
|
path: envPath,
|
|
overload: false,
|
|
quiet: true,
|
|
})
|
|
}
|
|
}
|
|
} catch (error) {
|
|
logger.warn("Failed to load env files:", error)
|
|
}
|
|
}
|