From 71840b441d5e16ea189d5e90368903b19ece0aa2 Mon Sep 17 00:00:00 2001 From: George Andredakis <22168172+JexSrs@users.noreply.github.com> Date: Mon, 19 Aug 2024 22:54:50 +0300 Subject: [PATCH] Cheerio fix & dependencies upgrade (#93) * Cheerio fix & dependencies upgrade * Updated node version in tests --- .github/workflows/tester.yml | 2 +- package.json | 24 ++++++++++++------------ src/components/Parser.ts | 1 - src/components/Utils.ts | 2 +- src/parsers/html.parser.ts | 2 +- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tester.yml b/.github/workflows/tester.yml index 363f4cd..3308e9c 100644 --- a/.github/workflows/tester.yml +++ b/.github/workflows/tester.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - node-version: [14.x, 16.x, 17.x, 18.x] + node-version: [18.x, 19.x, 20.x] steps: - uses: actions/checkout@v2 diff --git a/package.json b/package.json index c2018d9..f096ece 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@unistudents/saffron", - "version": "6.2.0", + "version": "6.2.1", "description": "A fairly intuitive & powerful framework that enables you to collect & save articles and news from all over the web. ", "license": "MIT", "homepage": "https://github.com/unistudents/saffron#readme", @@ -19,31 +19,31 @@ "build": "tsc -d" }, "dependencies": { - "axios": "1.7.1", + "axios": "1.7.4", "chalk": "^4.1.2", - "cheerio": "^1.0.0-rc.12", - "fast-xml-parser": "^4.4.0", - "glob": "^10.3.15", + "cheerio": "^1.0.0", + "fast-xml-parser": "^4.4.1", + "glob": "^11.0.0", "lodash": "^4.17.21", - "luxon": "^3.4.4", + "luxon": "^3.5.0", "rss-parser": "^3.13.0", "socket.io": "^4.7.5", "socket.io-client": "^4.7.5", "striptags": "^3.2.0" }, "devDependencies": { - "@types/chai": "^4.3.16", + "@types/chai": "^4.3.17", "@types/cheerio": "^0.22.35", "@types/express": "^4.17.21", "@types/glob": "^8.1.0", - "@types/lodash": "^4.17.4", + "@types/lodash": "^4.17.7", "@types/luxon": "^3.4.2", - "@types/mocha": "^10.0.6", - "chai": "^4.4.1", + "@types/mocha": "^10.0.7", + "chai": "^4.5.0", "express": "^4.19.2", - "mocha": "^10.4.0", + "mocha": "^10.7.3", "ts-node": "^10.9.2", - "typescript": "^5.4.5", + "typescript": "^5.5.4", "http-proxy-middleware": "^2.0.6" } } diff --git a/src/components/Parser.ts b/src/components/Parser.ts index eb31312..0940e77 100644 --- a/src/components/Parser.ts +++ b/src/components/Parser.ts @@ -1,7 +1,6 @@ import type {Instructions} from "./instructions"; import type {Article} from "./article"; import type {Utils} from "./Utils"; -import cheerio from "cheerio"; import type {RequestsResult, SourceScrape} from "./types"; export abstract class Parser { diff --git a/src/components/Utils.ts b/src/components/Utils.ts index 47f9a46..4adfcc9 100644 --- a/src/components/Utils.ts +++ b/src/components/Utils.ts @@ -1,4 +1,4 @@ -import cheerio from "cheerio"; +import * as cheerio from 'cheerio'; import type {Attachment} from "./article"; import https from "https"; import axios, {AxiosRequestConfig, AxiosResponse} from "axios"; diff --git a/src/parsers/html.parser.ts b/src/parsers/html.parser.ts index c1dde60..2058f6d 100644 --- a/src/parsers/html.parser.ts +++ b/src/parsers/html.parser.ts @@ -2,7 +2,7 @@ import {Parser} from "../components/Parser"; import type {Instructions} from "../components/instructions"; import {Article} from "../components/article"; import type {AxiosResponse} from "axios"; -import cheerio from "cheerio"; +import * as cheerio from 'cheerio'; import type {Utils} from "../components/Utils"; import type {HTMLAttribute, RequestsResult, SourceScrape} from "../components/types"; import type {ScrapeHTML} from "../components/parser.type";