Merge branch 'dev' into next-reka

This commit is contained in:
Sadegh Barati 2024-12-04 23:22:21 +03:30
commit b8f60e6883
8 changed files with 1415 additions and 1456 deletions

1
.npmrc
View File

@ -1 +1,2 @@
shell-emulator=true shell-emulator=true
auto-install-peers=true

View File

@ -403,6 +403,7 @@ By passing the `form` as props, you can control and use the method provided by `
```vue ```vue
<script setup lang="ts"> <script setup lang="ts">
import { AutoForm } from '@/components/ui/auto-form'
import { toTypedSchema } from '@vee-validate/zod' import { toTypedSchema } from '@vee-validate/zod'
import { useForm } from 'vee-validate' import { useForm } from 'vee-validate'
import * as z from 'zod' import * as z from 'zod'

View File

@ -44,12 +44,9 @@ Install `tailwindcss` and its peer dependencies, then generate your `tailwind.co
#### `vite.config` #### `vite.config`
```typescript {3,4,11-15} ```typescript {2,3,8-12}
import { fileURLToPath, URL } from 'node:url'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
import autoprefixer from 'autoprefixer' import autoprefixer from 'autoprefixer'
import tailwind from 'tailwindcss' import tailwind from 'tailwindcss'
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
@ -60,14 +57,7 @@ export default defineConfig({
plugins: [tailwind(), autoprefixer()], plugins: [tailwind(), autoprefixer()],
}, },
}, },
plugins: [ plugins: [vue()],
vue(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
}) })
``` ```
@ -125,12 +115,10 @@ Add the code below to the vite.config.ts so your app can resolve paths without e
npm i -D @types/node npm i -D @types/node
``` ```
```typescript {20-22} ```typescript {1,15-19}
import { fileURLToPath, URL } from 'node:url' import { fileURLToPath, URL } from 'node:url'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
import autoprefixer from 'autoprefixer' import autoprefixer from 'autoprefixer'
import tailwind from 'tailwindcss' import tailwind from 'tailwindcss'
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
@ -141,9 +129,7 @@ export default defineConfig({
plugins: [tailwind(), autoprefixer()], plugins: [tailwind(), autoprefixer()],
}, },
}, },
plugins: [ plugins: [vue()],
vue(),
],
resolve: { resolve: {
alias: { alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)) '@': fileURLToPath(new URL('./src', import.meta.url))

View File

@ -42,7 +42,7 @@ const itemsToDisplay = 3
const firstLabel = computed(() => items.value[0]?.label) const firstLabel = computed(() => items.value[0]?.label)
const allButLastTwoItems = computed(() => items.value.slice(1, -2)) const allButLastTwoItems = computed(() => items.value.slice(1, -2))
const remainingItems = computed(() => items.value.slice(-itemsToDisplay + 1)) const remainingItems = computed(() => items.value.slice(-Math.min(itemsToDisplay, items.value.length) + 1))
</script> </script>
<template> <template>

View File

@ -42,7 +42,7 @@ const itemsToDisplay = 3
const firstLabel = computed(() => items.value[0]?.label) const firstLabel = computed(() => items.value[0]?.label)
const allButLastTwoItems = computed(() => items.value.slice(1, -2)) const allButLastTwoItems = computed(() => items.value.slice(1, -2))
const remainingItems = computed(() => items.value.slice(-itemsToDisplay + 1)) const remainingItems = computed(() => items.value.slice(-Math.min(itemsToDisplay, items.value.length) + 1))
</script> </script>
<template> <template>

View File

@ -60,8 +60,6 @@
"diff": "^7.0.0", "diff": "^7.0.0",
"fast-glob": "^3.3.2", "fast-glob": "^3.3.2",
"fs-extra": "^11.2.0", "fs-extra": "^11.2.0",
"https-proxy-agent": "^7.0.5",
"kleur": "^4.1.5",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"magic-string": "^0.30.13", "magic-string": "^0.30.13",
"nypm": "^0.3.12", "nypm": "^0.3.12",
@ -72,11 +70,11 @@
"postcss": "^8.4.49", "postcss": "^8.4.49",
"prompts": "^2.4.2", "prompts": "^2.4.2",
"reka-ui": "catalog:", "reka-ui": "catalog:",
"semver": "^7.6.3",
"stringify-object": "^5.0.0", "stringify-object": "^5.0.0",
"tailwindcss": "^3.4.15", "tailwindcss": "^3.4.16",
"ts-morph": "^24.0.0", "ts-morph": "^24.0.0",
"tsconfig-paths": "^4.2.0", "tsconfig-paths": "^4.2.0",
"undici": "^7.0.0",
"vue-metamorph": "3.2.0", "vue-metamorph": "3.2.0",
"zod": "^3.23.8" "zod": "^3.23.8"
}, },

View File

@ -15,14 +15,14 @@ import {
} from '@/src/utils/registry/schema' } from '@/src/utils/registry/schema'
import { buildTailwindThemeColorsFromCssVars } from '@/src/utils/updaters/update-tailwind-config' import { buildTailwindThemeColorsFromCssVars } from '@/src/utils/updaters/update-tailwind-config'
import deepmerge from 'deepmerge' import deepmerge from 'deepmerge'
import { HttpsProxyAgent } from 'https-proxy-agent'
import { ofetch } from 'ofetch' import { ofetch } from 'ofetch'
import { ProxyAgent } from 'undici'
import { z } from 'zod' import { z } from 'zod'
const REGISTRY_URL = process.env.REGISTRY_URL ?? 'https://next.shadcn-vue.com/r' const REGISTRY_URL = process.env.REGISTRY_URL ?? 'https://next.shadcn-vue.com/r'
const agent = process.env.https_proxy const agent = process.env.https_proxy
? new HttpsProxyAgent(process.env.https_proxy) ? new ProxyAgent(process.env.https_proxy)
: undefined : undefined
export async function getRegistryIndex() { export async function getRegistryIndex() {
@ -182,7 +182,7 @@ async function fetchRegistry(paths: string[]) {
const results = await Promise.all( const results = await Promise.all(
paths.map(async (path) => { paths.map(async (path) => {
const url = getRegistryUrl(path) const url = getRegistryUrl(path)
const response = await ofetch(url, { agent, parseResponse: JSON.parse }) const response = await ofetch(url, { dispatcher: agent, parseResponse: JSON.parse })
.catch((error) => { .catch((error) => {
throw new Error(error.data) throw new Error(error.data)
}) })

File diff suppressed because it is too large Load Diff