diff --git a/bun.lockb b/bun.lockb index 8a9d7af..5f0fac4 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 6977098..420cda1 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,29 @@ { "name": "ytmusic-api", - "version": "5.2.1", + "version": "5.2.2-alpha.7", "description": "YouTube Music API", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "./dist/cjs/index.js", + "module": "./dist/esm/index.js", + "types": "./dist/types/index.d.ts", + "files": [ + "dist" + ], "author": "zS1L3NT (http://www.zectan.com)", "license": "GPL-3.0", "repository": { "type": "git", "url": "https://github.com/zS1L3NT/ts-npm-ytmusic-api" }, + "exports": { + "./package.json": "./package.json", + ".": { + "types": "./dist/types/index.d.ts", + "require": "./dist/cjs/index.js", + "import": "./dist/esm/index.js" + } + }, "scripts": { - "build": "tsc && rm tsconfig.tsbuildinfo", + "build": "tsup src/index.ts --dts --format cjs,esm --clean --out-dir dist", "clean": "tsc --noEmit && eslint src --fix && prettier src --write && rm tsconfig.tsbuildinfo" }, "dependencies": { @@ -28,6 +40,7 @@ "eslint-config-prettier": "latest", "eslint-plugin-simple-import-sort": "latest", "prettier": "latest", + "tsup": "^8.0.2", "typescript": "latest" }, "keywords": [ diff --git a/tsconfig.json b/tsconfig.json index 1b4777f..aa8361c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,16 +3,17 @@ /** Transpiler */ "target": "esnext", "lib": ["esnext"], - "module": "commonjs", + "module": "esnext", "moduleResolution": "node", "esModuleInterop": true, "allowSyntheticDefaultImports": true, /** Project */ "rootDir": "src", - "outDir": "dist", + "outDir": "dist/esm", "types": ["bun-types"], "declaration": true, + "declarationDir": "dist/types", /** Type Checking */ "strict": true, @@ -31,12 +32,13 @@ "forceConsistentCasingInFileNames": true, /** Other */ - "noEmit": false, - "allowJs": true, - "jsx": "react-jsx", - "skipLibCheck": true, - "isolatedModules": true, - "incremental": true + // "noEmit": false, + // "allowJs": true, + // "jsx": "react-jsx", + // "skipLibCheck": true, + // "isolatedModules": true, + // "incremental": true }, - "include": ["src", "src/tests"] + "include": ["src"], + "exclude": ["src/tests"] }