Skip to content

Commit

Permalink
Merge pull request #20 from formsible/feat/typing
Browse files Browse the repository at this point in the history
update
  • Loading branch information
tewnut authored Oct 27, 2024
2 parents 97ed03e + a52ad1a commit bae03ef
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
6 changes: 5 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export default [
},
},
{
ignores: ['dist'],
files: ['**/*.d.ts'], // Add this block for .d.ts files
rules: {
'@typescript-eslint/no-empty-interface': 'off', // Disable the rule for .d.ts files
'@typescript-eslint/no-empty-object-type': 'off', // Disable for empty object type too
},
},
]
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"files": [
"dist"
],
"types": "dist/index.d.ts",
"main": "dist/element.umd.js",
"module": "dist/element.js",
"exports": {
Expand All @@ -18,7 +19,8 @@
"license": "MIT",
"scripts": {
"dev": "vite",
"build": "vite build",
"build": "vue-tsc && vite build",
"build:types": "vue-tsc --declaration --emitDeclarationOnly",
"serve": "vite preview",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
"~/*": ["src/*"]
}
},
"include": ["src/**/*.ts", "src/**/*.vue", "types/index.d.ts"]
"include": ["src/**/*.ts", "src/**/*.vue"]
}
19 changes: 17 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ export default defineConfig({
resolvers: [PrimeVueResolver()],
}),
Icons(),
dts()
dts({
include: ['src/components/**/*.vue', 'src/types/index.ts', 'src/index.ts'],
insertTypesEntry: true,
})
],
resolve: {
alias: {
Expand All @@ -28,10 +31,22 @@ export default defineConfig({
fileName: 'element',
},
rollupOptions: {
external: ['vue'],
external: [
'vue',
'@vueuse/core',
'@vueuse/integrations',
'primevue',
'primeicons',
'tailwindcss-primeui',
],
output: {
globals: {
vue: 'Vue',
'@vueuse/core': 'VueUseCore',
'@vueuse/integrations': 'VueUseIntegrations',
primevue: 'PrimeVue',
primeicons: 'PrimeIcons',
'tailwindcss-primeui': 'TailwindPrimeUI',
},
},
plugins: [
Expand Down

0 comments on commit bae03ef

Please sign in to comment.