add ts declaration
This commit is contained in:
+2
-1
@@ -23,7 +23,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "cross-env tsc && tsup",
|
"clean": "rm -rf dist",
|
||||||
|
"build": "npm run clean && tsc && tsup",
|
||||||
"test": "vitest"
|
"test": "vitest"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import path from 'path';
|
|||||||
import {episodePatterns, seasonAndEpisodePatterns, seasonPatterns, soloEp} from "./config/SeasonAndEpisodePatterns.js";
|
import {episodePatterns, seasonAndEpisodePatterns, seasonPatterns, soloEp} from "./config/SeasonAndEpisodePatterns.js";
|
||||||
import {extraEpKeyWords, keywordsArray, substringArray} from "./config/KeywordsArray.js";
|
import {extraEpKeyWords, keywordsArray, substringArray} from "./config/KeywordsArray.js";
|
||||||
import {existsSync, readFileSync} from "fs";
|
import {existsSync, readFileSync} from "fs";
|
||||||
import {extensionMappings} from "./config/ExtentionsMapping";
|
import {extensionMappings} from "./config/ExtentionsMapping.js";
|
||||||
import {mimeTypeMappings} from "./config/MimeTypeMapping";
|
import {mimeTypeMappings} from "./config/MimeTypeMapping.js";
|
||||||
import {FileNameVideoMetaExtractor, VideoFileMetadata} from "./FileNameVideoMetaExtractor";
|
import {FileNameVideoMetaExtractor, VideoFileMetadata} from "./FileNameVideoMetaExtractor.js";
|
||||||
import {FileTypeConfigurable} from "./tools/FileTypeConfigurable";
|
import {FileTypeConfigurable} from "./tools/FileTypeConfigurable.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Result of file metadata extraction
|
* Result of file metadata extraction
|
||||||
|
|||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
import {FileTypeConfigurable} from "./tools/FileTypeConfigurable";
|
import {FileTypeConfigurable} from "./tools/FileTypeConfigurable.js";
|
||||||
import {extensionMappings} from "./config/ExtentionsMapping";
|
import {extensionMappings} from "./config/ExtentionsMapping.js";
|
||||||
import {mimeTypeMappings} from "./config/MimeTypeMapping";
|
import {mimeTypeMappings} from "./config/MimeTypeMapping.js";
|
||||||
|
|
||||||
export class FileType extends FileTypeConfigurable {
|
export class FileType extends FileTypeConfigurable {
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {SimpleFileType} from "../SimpleFileType";
|
import {SimpleFileType} from "../SimpleFileType.js";
|
||||||
|
|
||||||
export const extensionMappings: { [key: string]: SimpleFileType } = {
|
export const extensionMappings: { [key: string]: SimpleFileType } = {
|
||||||
// Audio
|
// Audio
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {SimpleFileType} from "../SimpleFileType";
|
import {SimpleFileType} from "../SimpleFileType.js";
|
||||||
|
|
||||||
export const mimeTypeMappings: { [key: string]: SimpleFileType } = {
|
export const mimeTypeMappings: { [key: string]: SimpleFileType } = {
|
||||||
'text/plain': 'undefined',//text could be anything document or subtitle or other
|
'text/plain': 'undefined',//text could be anything document or subtitle or other
|
||||||
|
|||||||
+17
-18
@@ -1,20 +1,19 @@
|
|||||||
export * from './FileNameMetaExtractor';
|
export * from './FileNameMetaExtractor.js';
|
||||||
export * from './FileNameVideoMetaExtractor';
|
export * from './FileNameVideoMetaExtractor.js';
|
||||||
export * from './SimpleFileType';
|
export * from './SimpleFileType.js';
|
||||||
export * from './FileType';
|
export * from './FileType.js';
|
||||||
|
|
||||||
export * from './tools/folder/FolderTool';
|
export * from './tools/folder/FolderTool.js';
|
||||||
export * from "./tools/lang/LanguageTool";
|
export * from './tools/lang/LanguageTool.js';
|
||||||
export * from './tools/video/SerieFilesNamaAnalysisTool';
|
export * from './tools/video/SerieFilesNamaAnalysisTool.js';
|
||||||
export * from './tools/FileNameCleaner';
|
export * from './tools/FileNameCleaner.js';
|
||||||
export * from './tools/FileNameStringOperation';
|
export * from './tools/FileNameStringOperation.js';
|
||||||
export * from './tools/FileTypeConfigurable';
|
export * from './tools/FileTypeConfigurable.js';
|
||||||
export * from './tools/StringArrayOperation';
|
export * from './tools/StringArrayOperation.js';
|
||||||
export * from './tools/TwoStringsOperation';
|
export * from './tools/TwoStringsOperation.js';
|
||||||
|
|
||||||
export * from './config/AnimeKeywords';
|
|
||||||
export * from './config/ExtentionsMapping';
|
|
||||||
export * from './config/KeywordsArray';
|
|
||||||
export * from './config/MimeTypeMapping';
|
|
||||||
export * from './config/SeasonAndEpisodePatterns';
|
|
||||||
|
|
||||||
|
export * from './config/AnimeKeywords.js';
|
||||||
|
export * from './config/ExtentionsMapping.js';
|
||||||
|
export * from './config/KeywordsArray.js';
|
||||||
|
export * from './config/MimeTypeMapping.js';
|
||||||
|
export * from './config/SeasonAndEpisodePatterns.js';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {fileTypeFromFile} from 'file-type';
|
import {fileTypeFromFile} from 'file-type';
|
||||||
import {SimpleFileType} from "../SimpleFileType";
|
import {SimpleFileType} from "../SimpleFileType.js";
|
||||||
|
|
||||||
export class FileTypeConfigurable {
|
export class FileTypeConfigurable {
|
||||||
|
|
||||||
|
|||||||
+9
-5
@@ -1,15 +1,19 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"module": "esnext",
|
"module": "NodeNext",
|
||||||
"target": "esnext",
|
"target": "ESNext",
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"noEmit": true,
|
"declaration": true,
|
||||||
"moduleResolution": "node",
|
"declarationDir": "./dist",
|
||||||
"baseUrl": "./",
|
"emitDeclarationOnly": true,
|
||||||
|
"moduleResolution": "NodeNext",
|
||||||
|
"outDir": "./dist",
|
||||||
|
"rootDir": "./src/lib",
|
||||||
|
"baseUrl": "./"
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/lib"
|
"src/lib"
|
||||||
|
|||||||
+2
-2
@@ -8,8 +8,8 @@ export default defineConfig({
|
|||||||
splitting: true,
|
splitting: true,
|
||||||
treeshake: true,
|
treeshake: true,
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
clean: true,
|
clean: false, // Don't clean - tsc generates .d.ts files first
|
||||||
dts:true,
|
dts: false, // Let tsc handle declaration files for NodeNext compatibility
|
||||||
minify: false,
|
minify: false,
|
||||||
format: ['cjs', 'esm'],
|
format: ['cjs', 'esm'],
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user