Skip to content

Commit ba3f5e5

Browse files
committed
fix type declarations
1 parent 3b63a20 commit ba3f5e5

8 files changed

+30
-18
lines changed

index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from "./src/hooks";
2+
import { plugin } from "./src/plugin";
3+
export default plugin;

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"type": "module",
66
"main": "dist/index.js",
77
"module": "dist/index.mjs",
8+
"types": "dist/types/index.d.ts",
89
"scripts": {
910
"dev": "vite",
1011
"size": "size-limit",

rollup.config.js

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import typescript from 'rollup-plugin-typescript2';
2-
import peerDepsExternal from 'rollup-plugin-peer-deps-external'
2+
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
33
import terser from '@rollup/plugin-terser';
44
import del from 'rollup-plugin-delete';
55
import { nodeResolve } from '@rollup/plugin-node-resolve';
66
import commonjs from '@rollup/plugin-commonjs';
77

88
export default [
99
{
10-
input: 'src/index.ts',
10+
input: 'index.ts',
1111
output: [
1212
{
1313
format: 'esm',
@@ -28,16 +28,9 @@ export default [
2828
nodeResolve(),
2929
commonjs(),
3030
typescript({
31-
tsconfig: 'tsconfig.node.json',
32-
check: false,
33-
tsconfigOverride: {
34-
compilerOptions: {
35-
sourceMap: true,
36-
declaration: true,
37-
declarationMap: true,
38-
}
39-
}
31+
tsconfig: './tsconfig.build.json',
32+
useTsconfigDeclarationDir: true
4033
})
4134
]
4235
}
43-
]
36+
];

src/App.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { useTelemetryDeck } from "./"
2+
import { useTelemetryDeck } from "../index.ts";
33
const { signal, queue, setClientUser } = useTelemetryDeck();
44
55
const changeClientUserClick = () => {

src/index.ts

-3
This file was deleted.

src/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createApp } from 'vue'
22
import './style.css'
33
import App from './App.vue'
4-
import TelemetryDeckPlugin from './'
4+
import TelemetryDeckPlugin from '../index.ts'
55

66
const app = createApp(App)
77
app.use(TelemetryDeckPlugin, {

tsconfig.app.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323
"noUnusedParameters": true,
2424
"noFallthroughCasesInSwitch": true
2525
},
26-
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
26+
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "index.ts", "vite-env.d.ts"]
2727
}

tsconfig.build.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"compilerOptions": {
3+
"sourceMap": true,
4+
"declaration": true,
5+
"declarationMap": true,
6+
"target": "ESNext",
7+
"module": "ESNext",
8+
"outDir": "./dist",
9+
"strict": true,
10+
"esModuleInterop": true,
11+
"skipLibCheck": true,
12+
"declarationDir": "./dist/types",
13+
"baseUrl": "./",
14+
"moduleResolution": "bundler",
15+
"allowSyntheticDefaultImports": true,
16+
},
17+
"include": ["vite.config.ts"]
18+
}

0 commit comments

Comments
 (0)