From a4dc8ab971f64838d7f1a4a84ca2fa05116bc1a4 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Mon, 11 Sep 2023 13:45:39 +0800 Subject: [PATCH 01/38] fix(cli): shouldn't load tsconfig when typescript disabled (#43) --- packages/cli/src/utils/get-config.ts | 38 +++++++++++++++------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/packages/cli/src/utils/get-config.ts b/packages/cli/src/utils/get-config.ts index 00e10c9c..8f9859b2 100644 --- a/packages/cli/src/utils/get-config.ts +++ b/packages/cli/src/utils/get-config.ts @@ -1,6 +1,7 @@ import path from 'node:path' import { existsSync } from 'node:fs' import { cosmiconfig } from 'cosmiconfig' +import type { ConfigLoaderResult } from 'tsconfig-paths' import { loadConfig } from 'tsconfig-paths' import * as z from 'zod' import { resolveImport } from '@/src/utils/resolve-import' @@ -62,24 +63,27 @@ export async function getConfig(cwd: string) { } export async function resolveConfigPaths(cwd: string, config: RawConfig) { - const TSCONFIG_PATH = config.framework === 'nuxt' ? '.nuxt/tsconfig.json' : './tsconfig.json' + let tsConfig: ConfigLoaderResult | undefined + if (config.typescript) { + const TSCONFIG_PATH = config.framework === 'nuxt' ? '.nuxt/tsconfig.json' : './tsconfig.json' - // Read tsconfig.json. - const tsconfigPath = path.resolve(cwd, TSCONFIG_PATH) - let tsConfig = loadConfig(tsconfigPath) + // Read tsconfig.json. + const tsconfigPath = path.resolve(cwd, TSCONFIG_PATH) + tsConfig = loadConfig(tsconfigPath) - // In new Vue project, tsconfig has references to tsconfig.app.json, which is causing the path not resolving correctly - // If no paths were found, try to load tsconfig.app.json. - if ('paths' in tsConfig && Object.keys(tsConfig.paths).length === 0) { - const FALLBACK_TSCONFIG_PATH = path.resolve(cwd, './tsconfig.app.json') - if (existsSync(FALLBACK_TSCONFIG_PATH)) - tsConfig = loadConfig(FALLBACK_TSCONFIG_PATH) - } + // In new Vue project, tsconfig has references to tsconfig.app.json, which is causing the path not resolving correctly + // If no paths were found, try to load tsconfig.app.json. + if ('paths' in tsConfig && Object.keys(tsConfig.paths).length === 0) { + const FALLBACK_TSCONFIG_PATH = path.resolve(cwd, './tsconfig.app.json') + if (existsSync(FALLBACK_TSCONFIG_PATH)) + tsConfig = loadConfig(FALLBACK_TSCONFIG_PATH) + } - if (tsConfig.resultType === 'failed') { - throw new Error( - `Failed to load tsconfig.json. ${tsConfig.message ?? ''}`.trim(), - ) + if (tsConfig.resultType === 'failed') { + throw new Error( + `Failed to load tsconfig.json. ${tsConfig.message ?? ''}`.trim(), + ) + } } return configSchema.parse({ @@ -87,8 +91,8 @@ export async function resolveConfigPaths(cwd: string, config: RawConfig) { resolvedPaths: { tailwindConfig: path.resolve(cwd, config.tailwind.config), tailwindCss: path.resolve(cwd, config.tailwind.css), - utils: await resolveImport(config.aliases.utils, tsConfig), - components: await resolveImport(config.aliases.components, tsConfig), + utils: tsConfig ? await resolveImport(config.aliases.utils, tsConfig) : config.aliases.utils, + components: tsConfig ? await resolveImport(config.aliases.components, tsConfig) : config.aliases.components, }, }) } From 6eb614b86292c415c028c338c2163d620b869dc0 Mon Sep 17 00:00:00 2001 From: Josh King <59017897+kn0wn@users.noreply.github.com> Date: Tue, 12 Sep 2023 10:37:15 +0100 Subject: [PATCH 02/38] chore: updated invalid link and correct shadecn naming (#46) --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7b3df7f3..e8ee038e 100644 --- a/README.md +++ b/README.md @@ -15,19 +15,19 @@ Accessible and customizable components that you can copy and paste into your app ## Documentation -Visit https://shadcn-vue.com/docs to view the documentation. +[View documentation here](https://www.shadcn-vue.com/docs/introduction.html) ## Credits All credits go to these open-source works and resources -- [Shadnc UI](https://ui.shadcn.com) for creating this beautiful project -- [Shadnc Svelte](https://shadcn-svelte.com) for some inspiration for registry -- [Radix Vue](https://radix-vue.com) for doing all the hard work to make sure components are accessible +- [Shadcn UI](https://ui.shadcn.com) for creating this beautiful project. +- [Shadcn Svelte](https://shadcn-svelte.com) for some inspiration for registry. +- [Radix Vue](https://radix-vue.com) for doing all the hard work to make sure components are accessible. - [VueUse](https://vueuse.org) for providing many useful utilities. - [ahmedmayara](https://github.com/ahmedmayara/shadcn-vue) for populating many components ## License -Licensed under the [MIT license](https://github.com/shadcn/ui/blob/main/LICENSE.md). \ No newline at end of file +Licensed under the [MIT license](https://github.com/shadcn/ui/blob/main/LICENSE.md). From 912be8edcf023eba4bdc0f4b0b68af71e0fd7f5d Mon Sep 17 00:00:00 2001 From: zernonia Date: Wed, 13 Sep 2023 00:32:12 +0800 Subject: [PATCH 03/38] chore: bump radix-vue version --- .../.vitepress/theme/components/StyleSwitcher.vue | 4 +--- apps/www/package.json | 2 +- packages/cli/package.json | 2 +- pnpm-lock.yaml | 12 ++++++------ 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/apps/www/.vitepress/theme/components/StyleSwitcher.vue b/apps/www/.vitepress/theme/components/StyleSwitcher.vue index b11f6e13..5c841fa3 100644 --- a/apps/www/.vitepress/theme/components/StyleSwitcher.vue +++ b/apps/www/.vitepress/theme/components/StyleSwitcher.vue @@ -20,9 +20,7 @@ const { config } = useConfigStore()