update dependencies

This commit is contained in:
Blake Joynes
2024-06-09 11:25:19 -04:00
parent fc44bcf425
commit 730afebd7d
9 changed files with 921 additions and 3032 deletions

View File

@@ -1,4 +0,0 @@
node_modules
dist
lib
coverage

View File

@@ -1,22 +0,0 @@
module.exports = {
env: {
browser: false,
es2021: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 12,
sourceType: "module",
},
rules:{
'linebreak-style': ['off', 'unix'],
},
plugins: ["@typescript-eslint"],
};

2
.nvmrc
View File

@@ -1 +1 @@
v18.16.0 v20.14.0

23
eslint.config.mjs Normal file
View File

@@ -0,0 +1,23 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
export default [
{
files: ["src/*.ts"],
ignores:[
"node_modules",
"dist",
"lib",
"coverage"
],
languageOptions: {
globals: globals.browser,
}
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
eslintPluginPrettierRecommended,
];

3857
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,13 @@
{ {
"name": "tmdb-ts", "name": "tmdb-ts",
"version": "1.8.0", "version": "2.0.0",
"description": "TMDB v3 library wrapper", "description": "TMDB v3 library wrapper",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"scripts": { "scripts": {
"compile": "rm -rf dist && tsc -d", "compile": "rm -rf dist && tsc -d",
"lint": "eslint --ext .ts src/", "lint": "eslint src/",
"lint:fix": "eslint --ext .ts src/ --fix", "lint:fix": "eslint --fix",
"format": "npx prettier --write src", "format": "npx prettier --write src",
"pre-commit": "npm run lint" "pre-commit": "npm run lint"
}, },
@@ -29,27 +29,23 @@
"author": "Blake Joynes", "author": "Blake Joynes",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@types/node": "^18.15.11", "@eslint/js": "^9.4.0",
"@types/node-fetch": "^2.5.10", "@types/eslint__js": "^8.42.3",
"@typescript-eslint/eslint-plugin": "^5.58.0", "@types/node": "^20.14.2",
"@typescript-eslint/parser": "^5.58.0", "@types/node-fetch": "^3.0.3",
"dotenv": "^9.0.2", "dotenv": "^16.4.5",
"eslint": "^8.38.0", "eslint": "^9.4.0",
"eslint-config-airbnb-typescript": "^17.0.0", "eslint-config-prettier": "^9.1.0",
"eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-prettier": "^4.2.1", "globals": "^15.4.0",
"husky": "^8.0.3", "husky": "^9.0.11",
"prettier": "^2.8.7", "prettier": "^3.3.1",
"ts-node": "^10.9.1", "ts-node": "^10.9.2",
"typescript": "^4.9.5" "typescript": "^5.4.5",
"typescript-eslint": "^7.12.0"
}, },
"dependencies": { "dependencies": {
"cross-fetch": "^3.1.4" "cross-fetch": "^4.0.0"
},
"volta": {
"node": "18.16.0",
"yarn": "1.22.4",
"npm": "9.5.1"
}, },
"husky": { "husky": {
"hooks": { "hooks": {

View File

@@ -1,8 +1,7 @@
import fetch from 'cross-fetch'; import fetch from 'cross-fetch';
import { parseOptions } from './utils'; import { parseOptions } from './utils';
import { ErrorResponse } from './types'; import { ErrorResponse } from './types';
import { BASE_URL_V3 } from './common/constants';
const BASE_URL_V3 = 'https://api.themoviedb.org/3';
export class Api { export class Api {
constructor(private accessToken: string) { constructor(private accessToken: string) {

1
src/common/constants.ts Normal file
View File

@@ -0,0 +1 @@
export const BASE_URL_V3 = 'https://api.themoviedb.org/3';

View File

@@ -1,4 +1,3 @@
export function parseOptions(options?: Record<string, any>): string { export function parseOptions(options?: Record<string, any>): string {
/* eslint-disable @typescript-eslint/no-explicit-any */
return options ? new URLSearchParams(Object.entries(options)).toString() : ''; return options ? new URLSearchParams(Object.entries(options)).toString() : '';
} }