Add TypeScript declaration files support with vite-plugin-dts

This commit is contained in:
hibna
2025-10-29 11:05:54 +03:00
parent 516a1aabbd
commit 64b2bd9383
5 changed files with 622 additions and 37 deletions
-34
View File
@@ -2,40 +2,6 @@
Modern, özellik zengin React video player kütüphanesi. HLS streaming, altyazılar, klavye kısayolları, dokunmatik hareketler ve daha fazlasını destekler.
## 📦 Kurulum
### Gitea Self-Hosted Registry'den Yükleme
1. **Projenizde `.npmrc` dosyası oluşturun:**
```ini
@alper:registry=https://gitea.yourdomain.com/api/packages/your-username/npm/
//gitea.yourdomain.com/api/packages/your-username/npm/:_authToken=${GITEA_TOKEN}
```
2. **Environment variable ayarlayın (önerilen):**
```bash
# Linux/Mac
export GITEA_TOKEN=your-gitea-access-token
# Windows (PowerShell)
$env:GITEA_TOKEN="your-gitea-access-token"
# veya .env dosyasına ekleyin
GITEA_TOKEN=your-gitea-access-token
```
3. **Paketi yükleyin:**
```bash
pnpm add @alper/video-player
# veya
npm install @alper/video-player
# veya
yarn add @alper/video-player
```
---
## 🚀 Temel Kullanım
+3 -2
View File
@@ -20,7 +20,7 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"build:lib": "tsc && vite build --config vite.config.lib.ts",
"build:lib": "vite build --config vite.config.lib.ts",
"preview": "vite preview",
"lint": "eslint . --report-unused-disable-directives --max-warnings 0"
},
@@ -42,7 +42,8 @@
"react": "^19.2.0",
"react-dom": "^19.2.0",
"typescript": "^5.9.3",
"vite": "^7.1.12"
"vite": "^7.1.12",
"vite-plugin-dts": "^4.5.4"
},
"optionalDependencies": {
"hls.js": "^1.6.13"
+592
View File
File diff suppressed because it is too large Load Diff
+17
View File
@@ -0,0 +1,17 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": false,
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "./dist",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"strict": false,
"skipLibCheck": true
},
"include": ["src"],
"exclude": ["src/**/*.test.ts", "src/**/*.test.tsx", "examples"]
}
+10 -1
View File
@@ -1,10 +1,19 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import dts from 'vite-plugin-dts'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [
react(),
dts({
include: ['src/**/*'],
exclude: ['src/**/*.test.ts', 'src/**/*.test.tsx', 'examples'],
outDir: 'dist',
insertTypesEntry: true,
}),
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),