diff --git a/package.json b/package.json index 7bd8a69..7eb7701 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "homepage": "https://status-indicator.webcomponent.io", "module": "./dist/status-indicator.js", + "types": "./dist/status-indicator.d.ts", "exports": { ".": { "default": "./dist/status-indicator.js", @@ -19,6 +20,7 @@ } }, "files": [ + "src", "dist", "README.md", "LICENSE", @@ -35,8 +37,8 @@ "@types/node": "^25.6.2", "eslint": "^10.3.0", "husky": "^9.1.7", - "unplugin-dts": "^1.0.0", - "vite": "^8.0.11" + "vite": "^8.0.11", + "vite-plugin-dts": "^5.0.0" }, "peerDependencies": { "web-component-base": "^4.1.2" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ced7aa8..f5fdb06 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,12 +21,12 @@ importers: husky: specifier: ^9.1.7 version: 9.1.7 - unplugin-dts: - specifier: ^1.0.0 - version: 1.0.0(typescript@6.0.3)(vite@8.0.11(@types/node@25.6.2)) vite: specifier: ^8.0.11 version: 8.0.11(@types/node@25.6.2) + vite-plugin-dts: + specifier: ^5.0.0 + version: 5.0.0(typescript@6.0.3)(vite@8.0.11(@types/node@25.6.2)) packages: @@ -665,6 +665,20 @@ packages: uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + vite-plugin-dts@5.0.0: + resolution: {integrity: sha512-VLNAUttBq7pLxxL/m/ztjd5zj5yiviiC7ijfPFVLK5c45FLcibvieBsdjSka3a4ag1qdrAF9K3OysH4/lW+rPQ==} + peerDependencies: + '@microsoft/api-extractor': '>=7' + rollup: '>=3' + vite: '>=3' + peerDependenciesMeta: + '@microsoft/api-extractor': + optional: true + rollup: + optional: true + vite: + optional: true + vite@8.0.11: resolution: {integrity: sha512-Jz1mxtUBR5xTT65VOdJZUUeoyLtqljmFkiUXhPTLZka3RDc9vpi/xXkyrnsdRcm2lIi3l3GPMnAidTsEGIj3Ow==} engines: {node: ^20.19.0 || >=22.12.0} @@ -1286,6 +1300,20 @@ snapshots: dependencies: punycode: 2.3.1 + vite-plugin-dts@5.0.0(typescript@6.0.3)(vite@8.0.11(@types/node@25.6.2)): + dependencies: + unplugin-dts: 1.0.0(typescript@6.0.3)(vite@8.0.11(@types/node@25.6.2)) + optionalDependencies: + vite: 8.0.11(@types/node@25.6.2) + transitivePeerDependencies: + - '@rspack/core' + - '@vue/language-core' + - esbuild + - rolldown + - supports-color + - typescript + - webpack + vite@8.0.11(@types/node@25.6.2): dependencies: lightningcss: 1.32.0 diff --git a/src/status-indicator.ts b/src/status-indicator.ts index da948b3..e0f161a 100644 --- a/src/status-indicator.ts +++ b/src/status-indicator.ts @@ -30,6 +30,7 @@ class StatusIndicator extends WebComponent { } get template(): any { + // @ts-ignore: Needs fixing on the base class const statusColor = this.#indicatorColor[this.props.status] return html` diff --git a/vite-lib.config.ts b/vite-lib.config.ts index 4ef302c..3fde9f8 100644 --- a/vite-lib.config.ts +++ b/vite-lib.config.ts @@ -1,23 +1,21 @@ import { resolve } from 'node:path' import { defineConfig } from 'vite' -import dts from 'unplugin-dts/vite' +import dts from 'vite-plugin-dts' export default defineConfig({ build: { lib: { - entry: resolve(import.meta.dirname, 'src/status-indicator.js'), + entry: resolve(import.meta.dirname, 'src/status-indicator.ts'), name: 'StatusIndicator', fileName: 'status-indicator', - formats: ['es'] }, rolldownOptions: { external: ['web-component-base'], output: { globals: { - 'WebComponent': 'WebComponent', - 'html': 'html' + 'web-component-base': 'web-component-base', } - } + }, } }, plugins: [dts()]