Skip to content

Commit 73776ae

Browse files
committed
Fix index.d.ts build
1 parent aa8b0af commit 73776ae

File tree

6 files changed

+332
-13
lines changed

6 files changed

+332
-13
lines changed

examples/react-router-6/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"react": "^18.1.0",
1212
"react-dom": "^18.1.0",
1313
"react-router-dom": "^6.3.0",
14-
"react-router-loading": "1.0.0-beta.2"
14+
"react-router-loading": "1.0.0-beta.3"
1515
},
1616
"devDependencies": {
1717
"@types/react": "^18.0.9",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
declare module 'topbar' {
2+
export interface TopBarConfig {
3+
autoRun?: boolean;
4+
barThickness?: number;
5+
barColors?: Record<number, string>;
6+
shadowBlur?: number;
7+
shadowColor?: string;
8+
className?: string;
9+
}
10+
11+
export function show(): void;
12+
export function hide(): void;
13+
export function config(configuration: TopBarConfig): void;
14+
export function progress(value: number | string): void;
15+
}

packages/react-router-loading/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router-loading",
3-
"version": "1.0.0-beta.2",
3+
"version": "1.0.0-beta.3",
44
"description": "Wrapper for react-router that allows you to load data before switching the screen",
55
"author": "Victor Trusov",
66
"repository": {
@@ -31,9 +31,8 @@
3131
"scripts": {
3232
"dev": "vite",
3333
"build": "tsc && vite build",
34-
"build:types": "tsc --declaration --emitDeclarationOnly --allowSyntheticDefaultImports --esModuleInterop --isolatedModules false -jsx react-jsx --outFile dist/index.d.ts lib/index.ts",
3534
"preview": "vite preview",
36-
"publish": "build && build:types && cp -fr ../../README.md . && npm publish"
35+
"pre-publish": "yarn build && cp -fr ../../README.md ."
3736
},
3837
"peerDependencies": {
3938
"react": ">=16.8",
@@ -49,7 +48,8 @@
4948
"react": "^18.1.0",
5049
"react-router": "^6.3.0",
5150
"typescript": "^4.6.3",
52-
"vite": "^2.9.9"
51+
"vite": "^2.9.9",
52+
"vite-plugin-dts": "^1.2.0"
5353
},
5454
"files": [
5555
"dist"

packages/react-router-loading/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"jsx": "react-jsx"
2222
},
2323
"include": [
24-
"src"
24+
"lib"
2525
],
2626
"references": [
2727
{

packages/react-router-loading/vite.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
import { defineConfig } from 'vite';
22
import path from 'node:path';
33
import react from '@vitejs/plugin-react';
4+
import dts from 'vite-plugin-dts';
45

56
const resolvePath = (str: string) => path.resolve(__dirname, str);
67

78
// https://vitejs.dev/config/
89
export default defineConfig({
910
plugins: [
10-
react()
11+
react(),
12+
dts({
13+
insertTypesEntry: true,
14+
rollupTypes: true
15+
}),
1116
],
1217
build: {
1318
lib: {

0 commit comments

Comments
 (0)