fix: missing dependencies after import
This commit is contained in:
parent
3e74fe7de6
commit
4657fe8ccc
|
|
@ -615,22 +615,22 @@ export const Index = {
|
|||
name: 'ActivityGoal',
|
||||
type: 'components:example',
|
||||
registryDependencies: ['button', 'card', 'themes', 'config'],
|
||||
component: () => import('../src/lib/registry/default/example/Cards/ActivityGoal.vue').then(m => m.default),
|
||||
files: ['../src/lib/registry/default/example/Cards/ActivityGoal.vue'],
|
||||
component: () => import('../src/lib/registry/default/example/ActivityGoal.vue').then(m => m.default),
|
||||
files: ['../src/lib/registry/default/example/ActivityGoal.vue'],
|
||||
},
|
||||
DataTable: {
|
||||
name: 'DataTable',
|
||||
type: 'components:example',
|
||||
registryDependencies: ['button', 'checkbox', 'dropdown-menu', 'input', 'table', 'card', 'utils'],
|
||||
component: () => import('../src/lib/registry/default/example/Cards/DataTable.vue').then(m => m.default),
|
||||
files: ['../src/lib/registry/default/example/Cards/DataTable.vue'],
|
||||
component: () => import('../src/lib/registry/default/example/DataTable.vue').then(m => m.default),
|
||||
files: ['../src/lib/registry/default/example/DataTable.vue'],
|
||||
},
|
||||
Metric: {
|
||||
name: 'Metric',
|
||||
type: 'components:example',
|
||||
registryDependencies: ['card', 'config'],
|
||||
component: () => import('../src/lib/registry/default/example/Cards/Metric.vue').then(m => m.default),
|
||||
files: ['../src/lib/registry/default/example/Cards/Metric.vue'],
|
||||
component: () => import('../src/lib/registry/default/example/Metric.vue').then(m => m.default),
|
||||
files: ['../src/lib/registry/default/example/Metric.vue'],
|
||||
},
|
||||
},
|
||||
'new-york': {
|
||||
|
|
@ -1247,22 +1247,22 @@ export const Index = {
|
|||
name: 'ActivityGoal',
|
||||
type: 'components:example',
|
||||
registryDependencies: ['button', 'card', 'themes', 'config'],
|
||||
component: () => import('../src/lib/registry/new-york/example/Cards/ActivityGoal.vue').then(m => m.default),
|
||||
files: ['../src/lib/registry/new-york/example/Cards/ActivityGoal.vue'],
|
||||
component: () => import('../src/lib/registry/new-york/example/ActivityGoal.vue').then(m => m.default),
|
||||
files: ['../src/lib/registry/new-york/example/ActivityGoal.vue'],
|
||||
},
|
||||
DataTable: {
|
||||
name: 'DataTable',
|
||||
type: 'components:example',
|
||||
registryDependencies: ['button', 'checkbox', 'dropdown-menu', 'input', 'table', 'card', 'utils'],
|
||||
component: () => import('../src/lib/registry/new-york/example/Cards/DataTable.vue').then(m => m.default),
|
||||
files: ['../src/lib/registry/new-york/example/Cards/DataTable.vue'],
|
||||
component: () => import('../src/lib/registry/new-york/example/DataTable.vue').then(m => m.default),
|
||||
files: ['../src/lib/registry/new-york/example/DataTable.vue'],
|
||||
},
|
||||
Metric: {
|
||||
name: 'Metric',
|
||||
type: 'components:example',
|
||||
registryDependencies: ['card', 'config'],
|
||||
component: () => import('../src/lib/registry/new-york/example/Cards/Metric.vue').then(m => m.default),
|
||||
files: ['../src/lib/registry/new-york/example/Cards/Metric.vue'],
|
||||
component: () => import('../src/lib/registry/new-york/example/Metric.vue').then(m => m.default),
|
||||
files: ['../src/lib/registry/new-york/example/Metric.vue'],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,10 +6,15 @@ import type { Registry } from '../../lib/registry'
|
|||
|
||||
const DEPENDENCIES = new Map<string, string[]>([
|
||||
['radix-vue', []],
|
||||
['@vueuse/core', []],
|
||||
['v-calendar', []],
|
||||
['@tanstack/vue-table', []],
|
||||
['vee-validate', ['@vee-validate/zod', 'zod']],
|
||||
])
|
||||
// Some dependencies latest tag were not compatible with Vue3.
|
||||
const DEPENDENCIES_WITH_TAGS = new Map<string, string>([
|
||||
['v-calendar', 'v-calendar@next'],
|
||||
])
|
||||
const REGISTRY_DEPENDENCY = '@/'
|
||||
|
||||
type ArrayItem<T> = T extends Array<infer X> ? X : never
|
||||
|
|
@ -139,7 +144,11 @@ async function getDependencies(filename: string) {
|
|||
Object.values(compiled.imports!).forEach((value) => {
|
||||
const source = value.source
|
||||
const peerDeps = DEPENDENCIES.get(source)
|
||||
const taggedDeps = DEPENDENCIES_WITH_TAGS.get(source)
|
||||
if (peerDeps !== undefined) {
|
||||
if (taggedDeps !== undefined)
|
||||
dependencies.add(taggedDeps)
|
||||
else
|
||||
dependencies.add(source)
|
||||
peerDeps.forEach(dep => dependencies.add(dep))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,8 @@
|
|||
{
|
||||
"name": "calendar",
|
||||
"dependencies": [
|
||||
"v-calendar"
|
||||
"@vueuse/core",
|
||||
"v-calendar@next"
|
||||
],
|
||||
"registryDependencies": [
|
||||
"utils"
|
||||
|
|
@ -302,7 +303,9 @@
|
|||
},
|
||||
{
|
||||
"name": "input",
|
||||
"dependencies": [],
|
||||
"dependencies": [
|
||||
"@vueuse/core"
|
||||
],
|
||||
"registryDependencies": [
|
||||
"utils"
|
||||
],
|
||||
|
|
@ -590,7 +593,9 @@
|
|||
},
|
||||
{
|
||||
"name": "textarea",
|
||||
"dependencies": [],
|
||||
"dependencies": [
|
||||
"@vueuse/core"
|
||||
],
|
||||
"registryDependencies": [
|
||||
"utils"
|
||||
],
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
"name": "calendar",
|
||||
"dependencies": [
|
||||
"v-calendar"
|
||||
"@vueuse/core",
|
||||
"v-calendar@next"
|
||||
],
|
||||
"registryDependencies": [
|
||||
"utils"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
{
|
||||
"name": "input",
|
||||
"dependencies": [],
|
||||
"dependencies": [
|
||||
"@vueuse/core"
|
||||
],
|
||||
"registryDependencies": [
|
||||
"utils"
|
||||
],
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
{
|
||||
"name": "textarea",
|
||||
"dependencies": [],
|
||||
"dependencies": [
|
||||
"@vueuse/core"
|
||||
],
|
||||
"registryDependencies": [
|
||||
"utils"
|
||||
],
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
"name": "calendar",
|
||||
"dependencies": [
|
||||
"v-calendar"
|
||||
"@vueuse/core",
|
||||
"v-calendar@next"
|
||||
],
|
||||
"registryDependencies": [
|
||||
"utils"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
{
|
||||
"name": "input",
|
||||
"dependencies": [],
|
||||
"dependencies": [
|
||||
"@vueuse/core"
|
||||
],
|
||||
"registryDependencies": [
|
||||
"utils"
|
||||
],
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
{
|
||||
"name": "textarea",
|
||||
"dependencies": [],
|
||||
"dependencies": [
|
||||
"@vueuse/core"
|
||||
],
|
||||
"registryDependencies": [
|
||||
"utils"
|
||||
],
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user