From eb1309c5a19fcbc2e147a09ce046b51f6e0c11a3 Mon Sep 17 00:00:00 2001 From: Zechariah Date: Sat, 5 Feb 2022 15:40:45 +0800 Subject: [PATCH] Updated project configuration --- .gitignore | 12 ++++++------ .npmignore | 4 ++-- package.json | 6 +++--- src/YTMusic.ts | 2 +- tsconfig.json | 45 +++++++++++++++++++++++++++++++++------------ 5 files changed, 45 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 04bbd55..38e1684 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ -/node_modules -/.idea -/build -config.json -*.test.ts -.rest \ No newline at end of file +**/node_modules +**/.idea +**/dist +**/config.json +**/*.test.ts +**/.vscode \ No newline at end of file diff --git a/.npmignore b/.npmignore index 0fcd733..32d7a6f 100644 --- a/.npmignore +++ b/.npmignore @@ -3,5 +3,5 @@ .gitignore .prettierrc .editorconfig -nodemon.json -tsconfig.json \ No newline at end of file +tsconfig.json +babel.config.js \ No newline at end of file diff --git a/package.json b/package.json index 5aa67c2..d08786c 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "ytmusic-api", - "version": "1.0.3", + "version": "1.0.4", "description": "YouTube Music API", - "main": "build/index.js", - "types": "build/index.d.ts", + "main": "dist/index.js", + "types": "dist/index.d.ts", "author": "zS1L3NT (http://www.zectan.com)", "license": "ISC", "repository": { diff --git a/src/YTMusic.ts b/src/YTMusic.ts index 0b70f01..b84e350 100644 --- a/src/YTMusic.ts +++ b/src/YTMusic.ts @@ -138,7 +138,7 @@ export default class YTMusic { const searchParams = new URLSearchParams({ ...query, alt: "json", - key: this.config.INNERTUBE_API_KEY + key: this.config.INNERTUBE_API_KEY! }) const res = await this.client.post( diff --git a/tsconfig.json b/tsconfig.json index 82c6baf..80d01a2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,22 +1,43 @@ { "compilerOptions": { + /** Transpiler */ "target": "esnext", - "allowSyntheticDefaultImports": true, - "forceConsistentCasingInFileNames": true, - "module": "commonjs", + "lib": ["esnext"], // "dom", "dom.iterable", "esnext" + "module": "commonjs", // esnext "moduleResolution": "node", "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + + /** Project */ + "rootDir": "src", + "outDir": "dist", + "typeRoots": ["./node_modules/@types", "./src/@types"], + "declaration": true, + + /** Type Checking */ "strict": true, - "alwaysStrict": true, - "noImplicitAny": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "resolveJsonModule": true, "strictNullChecks": true, "strictFunctionTypes": true, - "outDir": "build", - "rootDir": "src", - "declaration": true + "strictBindCallApply": true, + "strictPropertyInitialization": true, + "noImplicitThis": true, + "useUnknownInCatchVariables": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, + "allowUnusedLabels": true, + "resolveJsonModule": true, + "forceConsistentCasingInFileNames": true + + /** Other */ + // "noEmit": true, + // "allowJs": true, + // "jsx": "react-jsx", + // "skipLibCheck": true, + // "isolatedModules": true, + // "incremental": true }, - "exclude": ["**/*.test.*", "**/tests"] + "include": ["src"], + "exclude": ["src/__tests__"] }