From ac51344f5b37d7e542b374d79b339ebe71351e0d Mon Sep 17 00:00:00 2001 From: Pigges Date: Mon, 21 Apr 2025 04:10:38 +0200 Subject: [PATCH] removed bloat and updated packages --- .babelrc | 16 +- .travis.yml | 2 +- app/components/markdown.js | 19 +- app/components/playground.js | 5 +- app/helpers/fetch-metadata.js | 7 +- app/helpers/lbrytv-sdk.js | 127 +- app/index.js | 3 +- app/sass/bundle.scss | 2 +- app/views/api.js | 22 +- index.js | 1 - package-lock.json | 7713 ++------------------------------- package.json | 66 +- 12 files changed, 432 insertions(+), 7551 deletions(-) diff --git a/.babelrc b/.babelrc index 33a6399..7d98451 100644 --- a/.babelrc +++ b/.babelrc @@ -3,14 +3,14 @@ "@babel/env" ], "plugins": [ - "@babel/proposal-class-properties", - "@babel/proposal-export-namespace-from", - "@babel/proposal-function-sent", - "@babel/proposal-json-strings", - "@babel/proposal-numeric-separator", - "@babel/proposal-throw-expressions", - "@babel/syntax-dynamic-import", - "@babel/syntax-import-meta" + // "@babel/proposal-class-properties", + // "@babel/proposal-export-namespace-from", + // "@babel/proposal-function-sent", + // "@babel/proposal-json-strings", + // "@babel/proposal-numeric-separator", + // "@babel/proposal-throw-expressions", + // "@babel/syntax-dynamic-import", + // "@babel/syntax-import-meta" ], "ignore": [ "app/dist/*.js" diff --git a/.travis.yml b/.travis.yml index 6746f7c..da02d68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: node_js node_js: - - "10.2" + - "22" before_install: - npm i -g npm@latest diff --git a/app/components/markdown.js b/app/components/markdown.js index 35d8ccd..2965229 100644 --- a/app/components/markdown.js +++ b/app/components/markdown.js @@ -4,10 +4,9 @@ // I M P O R T S -import decamelize from "decamelize"; -import exists from "fs-exists-sync"; +// import decamelize from "decamelize"; +import fs from "fs"; import fm from "front-matter"; -import fs from "graceful-fs"; import html from "choo/html"; import m from "markdown-it"; import markdownAnchor from "markdown-it-anchor"; @@ -65,10 +64,10 @@ function partialFinder(markdownBody) { if (partials) { for (const partial of partials) { - const filename = decamelize(partial, "-").replace("<", "") + const filename = decamelize(partial).replace("<", "") .replace("/>", "") .trim(); - const fileExistsTest = exists(`./app/components/${filename}.js`); + const fileExistsTest = fs.existsSync(`./app/components/${filename}.js`); if (!fileExistsTest) markdownBody = markdownBody.replace(partial, ""); @@ -95,3 +94,13 @@ function wikiFinder(markdownBody) { match.input; }); } + +function decamelize(str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + return str + .replace(/([a-z])([A-Z])/g, '$1-$2') + .replace(/([A-Z])([A-Z][a-z])/g, '$1-$2') + .toLowerCase(); +} diff --git a/app/components/playground.js b/app/components/playground.js index 3fda5f3..6c749cc 100644 --- a/app/components/playground.js +++ b/app/components/playground.js @@ -4,7 +4,6 @@ // I M P O R T S -import dedent from "dedent"; import html from "choo/html"; import raw from "choo/html/raw"; @@ -12,7 +11,7 @@ import raw from "choo/html/raw"; // E X P O R T -export default () => dedent` +export default () => html`