fix: demo component paths incorrect with subfolder

This commit is contained in:
zernonia 2023-11-06 12:38:41 +08:00
parent 4657fe8ccc
commit f2fe72efc5
5 changed files with 22 additions and 22 deletions

View File

@ -14,5 +14,6 @@ module.exports = {
'no-invalid-character': 'off',
'import/first': 'off',
'@stylistic/js/no-tabs': 'off',
'n/prefer-global/process': 'off',
},
}

View File

@ -615,22 +615,22 @@ export const Index = {
name: 'ActivityGoal',
type: 'components:example',
registryDependencies: ['button', 'card', 'themes', 'config'],
component: () => import('../src/lib/registry/default/example/ActivityGoal.vue').then(m => m.default),
files: ['../src/lib/registry/default/example/ActivityGoal.vue'],
component: () => import('../src/lib/registry/default/example/Cards/ActivityGoal.vue').then(m => m.default),
files: ['../src/lib/registry/default/example/Cards/ActivityGoal.vue'],
},
DataTable: {
name: 'DataTable',
type: 'components:example',
registryDependencies: ['button', 'checkbox', 'dropdown-menu', 'input', 'table', 'card', 'utils'],
component: () => import('../src/lib/registry/default/example/DataTable.vue').then(m => m.default),
files: ['../src/lib/registry/default/example/DataTable.vue'],
component: () => import('../src/lib/registry/default/example/Cards/DataTable.vue').then(m => m.default),
files: ['../src/lib/registry/default/example/Cards/DataTable.vue'],
},
Metric: {
name: 'Metric',
type: 'components:example',
registryDependencies: ['card', 'config'],
component: () => import('../src/lib/registry/default/example/Metric.vue').then(m => m.default),
files: ['../src/lib/registry/default/example/Metric.vue'],
component: () => import('../src/lib/registry/default/example/Cards/Metric.vue').then(m => m.default),
files: ['../src/lib/registry/default/example/Cards/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/ActivityGoal.vue').then(m => m.default),
files: ['../src/lib/registry/new-york/example/ActivityGoal.vue'],
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'],
},
DataTable: {
name: 'DataTable',
type: 'components:example',
registryDependencies: ['button', 'checkbox', 'dropdown-menu', 'input', 'table', 'card', 'utils'],
component: () => import('../src/lib/registry/new-york/example/DataTable.vue').then(m => m.default),
files: ['../src/lib/registry/new-york/example/DataTable.vue'],
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'],
},
Metric: {
name: 'Metric',
type: 'components:example',
registryDependencies: ['card', 'config'],
component: () => import('../src/lib/registry/new-york/example/Metric.vue').then(m => m.default),
files: ['../src/lib/registry/new-york/example/Metric.vue'],
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'],
},
},
}

View File

@ -46,9 +46,7 @@ for (const style of styles) {
name: "${item.name}",
type: "${item.type}",
registryDependencies: ${JSON.stringify(item.registryDependencies)},
component: () => import("../src/lib/registry/${style.name}/${type}/${
item.name
}.vue").then((m) => m.default),
component: () => import("${resolveFiles[0]}").then((m) => m.default),
files: [${resolveFiles.map(file => `"${file}"`)}],
},`
}
@ -375,7 +373,7 @@ export const THEME_STYLES_WITH_VARIABLES = `
--ring: <%- colors.dark["ring"] %>;
}`
const themeCSS = []
const themeCSS: Array<string> = []
for (const theme of themes) {
themeCSS.push(
template(THEME_STYLES_WITH_VARIABLES)({

View File

@ -67,7 +67,7 @@ async function crawlExample(rootPath: string) {
if (dirent.isFile()) {
const [name] = dirent.name.split('.vue')
const file_path = join('example', dirent.name)
const file_path = join('example', dirent.path.split('/example')[1], dirent.name)
const { dependencies, registryDependencies }
= await getDependencies(join(dirent.path, dirent.name))

View File

@ -3,18 +3,19 @@
"display": "Default",
"compilerOptions": {
"composite": false,
"module": "ESNext",
"moduleResolution": "node",
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"inlineSources": false,
"isolatedModules": true,
"moduleResolution": "node",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"preserveWatchOutput": true,
"skipLibCheck": true,
"strict": true
"skipLibCheck": true
},
"exclude": ["node_modules"]
}