Skip to content

Commit

Permalink
feat(types): emit component types with vue-tsc
Browse files Browse the repository at this point in the history
  • Loading branch information
bnjm committed Aug 11, 2023
1 parent b711cc9 commit 9924165
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@
"types": "./dist/index.d.ts",
"scripts": {
"watch": "vite build --watch",
"build": "vite build",
"build:component-types": "vue-tsc --emitDeclarationOnly --declaration -p tsconfig.build.json --outDir dist",
"build": "vite build && npm run build:component-types",
"prepublishOnly": "npm run build",
"serve": "vite preview",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"typecheck": "vue-tsc --noEmit",
"typecheck": "vue-tsc --noEmit -p tsconfig.build.json",
"lint": "npx eslint --ext .ts,.js,.vue --ignore-path .gitignore --fix src",
"format": "prettier . -w -u --loglevel silent",
"codecheck": "npm run typecheck && npm run lint && npm run format",
Expand Down
6 changes: 0 additions & 6 deletions src/typings/vue-shims.d.ts

This file was deleted.

8 changes: 5 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@ export default defineConfig({
lib: {
entry: {
main: path.resolve(__dirname, './src/index.ts'),
components: path.resolve(__dirname, './src/components/index.ts'),
composables: path.resolve(__dirname, './src/composables/index.ts')
'components/index': path.resolve(__dirname, './src/components/index.ts'),
'composables/index': path.resolve(__dirname, './src/composables/index.ts'),
'colors/index': path.resolve(__dirname, './src/colors/index.ts')
}
},
rollupOptions: {
external: ['vue', '@headlessui/vue'],
output: {
globals: {
vue: 'Vue'
}
},
exports: 'named'
}
}
},
Expand Down

0 comments on commit 9924165

Please sign in to comment.