Skip to content

Commit

Permalink
type support added
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel007enirman committed Jun 23, 2023
1 parent 2bfaf2d commit ca08641
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/*.d.ts
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
],
"main": "./dist/vue-select.umd.js",
"module": "./dist/vue-select.es.js",
"types": "./dist/src/index.d.ts",
"exports": {
".": {
"import": "./dist/vue-select.es.js",
Expand Down Expand Up @@ -48,6 +49,7 @@
"vue": "3.x"
},
"devDependencies": {
"@babel/types": "^7.22.5",
"@rushstack/eslint-patch": "^1.2.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^8.0.7",
Expand All @@ -73,6 +75,7 @@
"semantic-release": "^19.0.5",
"typescript": "^4.9.3",
"vite": "^3.2.4",
"vite-plugin-dts": "^2.3.0",
"vitest": "^0.25.3",
"vue": "^3.2.45",
"vue-tsc": "^1.0.10"
Expand Down
7 changes: 4 additions & 3 deletions src/components/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
</div>
</template>

<script>
<script lang="ts">
import pointerScroll from '@/mixins/pointerScroll.js'
import typeAheadPointer from '@/mixins/typeAheadPointer.js'
import ajax from '@/mixins/ajax.js'
Expand All @@ -147,7 +147,8 @@ import uniqueId from '@/utility/uniqueId.js'
/**
* @name VueSelect
*/
export default {
import { defineComponent } from 'vue'
export default defineComponent({
components: { ...childComponents },
directives: { appendToBody },
Expand Down Expand Up @@ -1362,5 +1363,5 @@ export default {
}
},
},
}
})
</script>
File renamed without changes.
8 changes: 5 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { resolve } from 'path'
import { fileURLToPath, URL } from 'url'

import dts from 'vite-plugin-dts'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
plugins: [vue(), dts({
insertTypesEntry: true,
})],
publicDir: false,
resolve: {
alias: {
Expand All @@ -17,7 +19,7 @@ export default defineConfig({
build: {
target: 'es2015',
lib: {
entry: resolve(__dirname, 'src/index.js'),
entry: resolve(__dirname, 'src/index.ts'),
name: 'vue-select',
fileName: (format) => `vue-select.${format}.js`,
},
Expand Down

0 comments on commit ca08641

Please sign in to comment.