diff --git a/.eslintrc.cjs b/.eslintrc.cjs index d901d874..87256eee 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -14,5 +14,6 @@ module.exports = { 'no-invalid-character': 'off', 'import/first': 'off', '@stylistic/js/no-tabs': 'off', + 'n/prefer-global/process': 'off', }, } diff --git a/apps/www/__registry__/index.ts b/apps/www/__registry__/index.ts index 68423122..61fbc8ca 100644 --- a/apps/www/__registry__/index.ts +++ b/apps/www/__registry__/index.ts @@ -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'], }, }, } diff --git a/apps/www/scripts/build-registry.ts b/apps/www/scripts/build-registry.ts index 07550cc1..6ab0ccf2 100644 --- a/apps/www/scripts/build-registry.ts +++ b/apps/www/scripts/build-registry.ts @@ -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 = [] for (const theme of themes) { themeCSS.push( template(THEME_STYLES_WITH_VARIABLES)({ diff --git a/apps/www/src/lib/registry/registry.ts b/apps/www/src/lib/registry/registry.ts index 959c5f21..77a69b7b 100644 --- a/apps/www/src/lib/registry/registry.ts +++ b/apps/www/src/lib/registry/registry.ts @@ -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)) diff --git a/tsconfig.json b/tsconfig.json index d72a9f3a..b6cea744 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -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"] }