Merge branch 'dev' of https://github.com/sadeghbarati/shadcn-vue into update-www-docs

This commit is contained in:
Sadegh Barati 2023-09-12 23:02:43 +03:30
commit ba8e360e4b
6 changed files with 35 additions and 33 deletions

View File

@ -15,15 +15,15 @@ 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

View File

@ -20,9 +20,7 @@ const { config } = useConfigStore()
<Select v-model="config.style">
<SelectTrigger :class="cn('h-7 w-[145px] text-xs [&_svg]:h-4 [&_svg]:w-4', props.class)">
<span class="text-muted-foreground">Style: </span>
<SelectValue placeholder="Select style">
{{ styles.find(s => s.name === config.style)?.label }}
</SelectValue>
<SelectValue placeholder="Select style" />
</SelectTrigger>
<SelectContent>
<SelectItem v-for="style in styles" :key="style.name" :value="style.name" class="text-xs">

View File

@ -39,7 +39,7 @@
"@vue/compiler-dom": "^3.3.4",
"autoprefixer": "^10.4.15",
"lodash.template": "^4.5.0",
"radix-vue": "^0.1.33",
"radix-vue": "^0.1.34",
"rimraf": "^5.0.1",
"tailwind-merge": "^1.14.0",
"tailwindcss": "^3.3.3",

View File

@ -61,7 +61,7 @@
"node-fetch": "^3.3.2",
"ora": "^7.0.1",
"prompts": "^2.4.2",
"radix-vue": "^0.1.32",
"radix-vue": "^0.1.34",
"recast": "^0.23.4",
"rimraf": "^5.0.1",
"ts-morph": "^19.0.0",

View File

@ -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,11 +63,13 @@ export async function getConfig(cwd: string) {
}
export async function resolveConfigPaths(cwd: string, config: RawConfig) {
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)
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.
@ -81,14 +84,15 @@ export async function resolveConfigPaths(cwd: string, config: RawConfig) {
`Failed to load tsconfig.json. ${tsConfig.message ?? ''}`.trim(),
)
}
}
return configSchema.parse({
...config,
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,
},
})
}

View File

@ -115,8 +115,8 @@ importers:
specifier: ^4.5.0
version: 4.5.0
radix-vue:
specifier: ^0.1.33
version: 0.1.33(vue@3.3.4)
specifier: ^0.1.34
version: 0.1.34(vue@3.3.4)
rimraf:
specifier: ^5.0.1
version: 5.0.1
@ -196,8 +196,8 @@ importers:
specifier: ^2.4.2
version: 2.4.2
radix-vue:
specifier: ^0.1.32
version: 0.1.32(vue@3.3.4)
specifier: ^0.1.34
version: 0.1.34(vue@3.3.4)
recast:
specifier: ^0.23.4
version: 0.23.4
@ -6383,8 +6383,8 @@ packages:
resolution: {integrity: sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==}
dev: false
/radix-vue@0.1.32(vue@3.3.4):
resolution: {integrity: sha512-z6vlBDT0GuVP2vu2LKJjWnyQB8jDWwE0eGqgO3IlrpeLOq5zpDA+ReaOJyJjf8m1We539fy+9wubKaBnHfBalw==}
/radix-vue@0.1.34(vue@3.3.4):
resolution: {integrity: sha512-x5Mv8pFT43Ubz0md6gG/5+Zkz8QrOnZXnk2b1CFSrfHebykYNLAW3jX47sf4nmoDYYvH3mAi9QU1XMlCl7/h8Q==}
dependencies:
'@floating-ui/dom': 1.5.1
'@floating-ui/vue': 1.0.2(vue@3.3.4)