chore(deps): upgrade and make specialized deps optional (#1259) [skip ci]

This commit is contained in:
Simon Lecoq
2022-10-16 20:19:36 -04:00
committed by GitHub
parent 09c17d20ff
commit 948ec35697
4 changed files with 1076 additions and 998 deletions

View File

@@ -23,7 +23,6 @@ import prism_lang from "prismjs/components/index.js"
import _puppeteer from "puppeteer"
import purgecss from "purgecss"
import readline from "readline"
import rss from "rss-parser"
import htmlsanitize from "sanitize-html"
import sharp from "sharp"
import git from "simple-git"
@@ -35,7 +34,7 @@ import xmlformat from "xml-formatter"
prism_lang()
//Exports
export { axios, d3, D3node, emoji, fetch, fs, git, minimatch, opengraph, os, paths, processes, rss, sharp, url, util }
export { axios, d3, D3node, emoji, fetch, fs, git, minimatch, opengraph, os, paths, processes, sharp, url, util }
/**Returns module __dirname */
export function __module(module) {

View File

@@ -1,3 +1,6 @@
//Imports
import rss from "rss-parser"
//Setup
export default async function({login, q, imports, data, account}, {enabled = false, extras = false} = {}) {
//Plugin execution
@@ -12,7 +15,7 @@ export default async function({login, q, imports, data, account}, {enabled = fal
throw {error: {message: "RSS feed URL is not set"}}
//Load rss feed
const {title, description, link, items} = await (new imports.rss()).parseURL(source) //eslint-disable-line new-cap
const {title, description, link, items} = await (new rss()).parseURL(source) //eslint-disable-line new-cap
const feed = items.map(({title, link, isoDate: date}) => ({title, link, date: new Date(date)}))
//Limit feed