From 54214435beaa43aaa5836925c3ca850b51d66b8c Mon Sep 17 00:00:00 2001 From: Stas Kobzar Date: Tue, 15 Nov 2022 21:21:51 -0500 Subject: [PATCH] add types to build --- package-lock.json | 4 ++-- package.json | 6 ++++-- src/composables/useProps/index.ts | 3 --- tsconfig.build-types.json | 17 +++++++++++++++++ 4 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 tsconfig.build-types.json diff --git a/package-lock.json b/package-lock.json index 1ac289a..f1c3d1c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vue-audio-visual", - "version": "3.0.1", + "version": "3.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vue-audio-visual", - "version": "3.0.1", + "version": "3.0.2", "dependencies": { "@vueuse/core": "^9.1.0", "vue": "^3.2.37" diff --git a/package.json b/package.json index 980216a..35629d4 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,13 @@ { "name": "vue-audio-visual", - "version": "3.0.1", + "version": "3.0.2", "type": "module", "files": [ "dist" ], "main": "./dist/vue-audio-visual.umd.cjs", "module": "./dist/vue-audio-visual.js", + "types": "./dist/types/src/plugin.d.ts", "exports": { ".": { "import": "./dist/vue-audio-visual.js", @@ -15,12 +16,13 @@ }, "scripts": { "dev": "vite", - "build": "run-p type-check build-demo build-dist", + "build": "run-p type-check build-demo build-dist build-types", "preview": "vite preview --port 4173", "test:unit": "vitest --environment jsdom", "test:ci": "vitest --environment jsdom --run --coverage", "build-demo": "vite build --base=/vue-audio-visual/", "build-dist": "vite build --config vite.config.dist.ts", + "build-types": "vue-tsc -p tsconfig.build-types.json --declaration --emitDeclarationOnly --outDir dist/types", "type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false", "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore" }, diff --git a/src/composables/useProps/index.ts b/src/composables/useProps/index.ts index 3945102..9f818f2 100644 --- a/src/composables/useProps/index.ts +++ b/src/composables/useProps/index.ts @@ -4,9 +4,6 @@ export * from './Line' export * from './Circle' export * from './Waveform' export * from './Media' -import { commonProps } from './common' - -export const PropsCommon = commonProps export interface Props { canvWidth: number diff --git a/tsconfig.build-types.json b/tsconfig.build-types.json new file mode 100644 index 0000000..86fec4a --- /dev/null +++ b/tsconfig.build-types.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.app.json", + "exclude": [ + "src/**/__tests__/*", + "src/App.vue", + "src/main.ts", + "node_modules" + ], + "compilerOptions": { + "composite": true, + "lib": [], + "types": [ + "node", + "jsdom" + ] + } +}