From 88c8f372970ed9644516d9e443befe4a65c85ad7 Mon Sep 17 00:00:00 2001 From: Rafael Bardini Date: Mon, 2 Sep 2024 03:25:58 +0200 Subject: [PATCH] fix(deps): replace `html` with `@rbardini/html` --- components/awards.js | 2 +- components/certificates.js | 2 +- components/date.js | 2 +- components/duration.js | 2 +- components/education.js | 2 +- components/header.js | 2 +- components/interests.js | 2 +- components/languages.js | 2 +- components/link.js | 2 +- components/meta.js | 2 +- components/projects.js | 2 +- components/publications.js | 2 +- components/references.js | 2 +- components/skills.js | 2 +- components/volunteer.js | 2 +- components/work.js | 2 +- package-lock.json | 10 ++++++++++ package.json | 1 + resume.js | 2 +- utils/html.js | 15 --------------- 20 files changed, 28 insertions(+), 32 deletions(-) delete mode 100644 utils/html.js diff --git a/components/awards.js b/components/awards.js index 7c7a3ce..9cdba15 100644 --- a/components/awards.js +++ b/components/awards.js @@ -1,4 +1,4 @@ -import html from '../utils/html.js' +import { html } from '@rbardini/html' import markdown from '../utils/markdown.js' import Date from './date.js' diff --git a/components/certificates.js b/components/certificates.js index aa2eaa5..9c39bc5 100644 --- a/components/certificates.js +++ b/components/certificates.js @@ -1,4 +1,4 @@ -import html from '../utils/html.js' +import { html } from '@rbardini/html' import Date from './date.js' import Link from './link.js' diff --git a/components/date.js b/components/date.js index b4fbe6e..0f0c6be 100644 --- a/components/date.js +++ b/components/date.js @@ -1,4 +1,4 @@ -import html from '../utils/html.js' +import { html } from '@rbardini/html' /** * @param {string} dateString diff --git a/components/duration.js b/components/duration.js index f449553..c9877d4 100644 --- a/components/duration.js +++ b/components/duration.js @@ -1,4 +1,4 @@ -import html from '../utils/html.js' +import { html } from '@rbardini/html' import Date from './date.js' /** diff --git a/components/education.js b/components/education.js index bb4d4ee..1a66b8d 100644 --- a/components/education.js +++ b/components/education.js @@ -1,4 +1,4 @@ -import html from '../utils/html.js' +import { html } from '@rbardini/html' import markdown from '../utils/markdown.js' import Duration from './duration.js' import Link from './link.js' diff --git a/components/header.js b/components/header.js index 1685c07..4c022e5 100644 --- a/components/header.js +++ b/components/header.js @@ -1,4 +1,4 @@ -import html from '../utils/html.js' +import { html } from '@rbardini/html' import markdown from '../utils/markdown.js' import Icon from './icon.js' import Link from './link.js' diff --git a/components/interests.js b/components/interests.js index 3e854fd..4fe6319 100644 --- a/components/interests.js +++ b/components/interests.js @@ -1,4 +1,4 @@ -import html from '../utils/html.js' +import { html } from '@rbardini/html' /** * @param {import('../schema.d.ts').ResumeSchema['interests']} interests diff --git a/components/languages.js b/components/languages.js index 50f63b4..a74961e 100644 --- a/components/languages.js +++ b/components/languages.js @@ -1,4 +1,4 @@ -import html from '../utils/html.js' +import { html } from '@rbardini/html' /** * @param {import('../schema.d.ts').ResumeSchema['languages']} languages diff --git a/components/link.js b/components/link.js index e19c67a..528f09d 100644 --- a/components/link.js +++ b/components/link.js @@ -1,4 +1,4 @@ -import html from '../utils/html.js' +import { html } from '@rbardini/html' /** * @param {string} url diff --git a/components/meta.js b/components/meta.js index 394280f..7eeacf9 100644 --- a/components/meta.js +++ b/components/meta.js @@ -1,4 +1,4 @@ -import html from '../utils/html.js' +import { html } from '@rbardini/html' import markdown from '../utils/markdown.js' /** diff --git a/components/projects.js b/components/projects.js index 66de84b..e14e3aa 100644 --- a/components/projects.js +++ b/components/projects.js @@ -1,4 +1,4 @@ -import html from '../utils/html.js' +import { html } from '@rbardini/html' import markdown from '../utils/markdown.js' import Duration from './duration.js' import Link from './link.js' diff --git a/components/publications.js b/components/publications.js index 97be752..fc85b43 100644 --- a/components/publications.js +++ b/components/publications.js @@ -1,4 +1,4 @@ -import html from '../utils/html.js' +import { html } from '@rbardini/html' import markdown from '../utils/markdown.js' import Date from './date.js' import Link from './link.js' diff --git a/components/references.js b/components/references.js index de85e0e..f5aa4f7 100644 --- a/components/references.js +++ b/components/references.js @@ -1,4 +1,4 @@ -import html from '../utils/html.js' +import { html } from '@rbardini/html' import markdown from '../utils/markdown.js' /** diff --git a/components/skills.js b/components/skills.js index 5ef68fe..12e16ae 100644 --- a/components/skills.js +++ b/components/skills.js @@ -1,4 +1,4 @@ -import html from '../utils/html.js' +import { html } from '@rbardini/html' /** * @param {import('../schema.d.ts').ResumeSchema['skills']} skills diff --git a/components/volunteer.js b/components/volunteer.js index d24ab36..8f99186 100644 --- a/components/volunteer.js +++ b/components/volunteer.js @@ -1,4 +1,4 @@ -import html from '../utils/html.js' +import { html } from '@rbardini/html' import markdown from '../utils/markdown.js' import Duration from './duration.js' import Link from './link.js' diff --git a/components/work.js b/components/work.js index 6da9eb3..e49070b 100644 --- a/components/work.js +++ b/components/work.js @@ -1,4 +1,4 @@ -import html from '../utils/html.js' +import { html } from '@rbardini/html' import markdown from '../utils/markdown.js' import Duration from './duration.js' import Link from './link.js' diff --git a/package-lock.json b/package-lock.json index 8ca9187..eface11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.22.1", "license": "MIT", "dependencies": { + "@rbardini/html": "^1.0.0", "feather-icons": "^4.28.0", "micromark": "^2.11.0", "striptags": "^3.2.0" @@ -1034,6 +1035,15 @@ "url": "https://opencollective.com/unts" } }, + "node_modules/@rbardini/html": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rbardini/html/-/html-1.0.1.tgz", + "integrity": "sha512-sVnvDG2ujW5R0mfubZDCnxnxHSsM1kS4ExY+Z3j7XQkY4Y7RKnM4tPi6E8OkkUmbD3NUeVWV2ObSmgaaZUHIDw==", + "license": "MIT", + "engines": { + "node": ">=20" + } + }, "node_modules/@rollup/pluginutils": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", diff --git a/package.json b/package.json index 0f0232c..3564d2a 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "type-check": "tsc" }, "dependencies": { + "@rbardini/html": "^1.0.0", "feather-icons": "^4.28.0", "micromark": "^2.11.0", "striptags": "^3.2.0" diff --git a/resume.js b/resume.js index e609ee5..d2a0e4a 100644 --- a/resume.js +++ b/resume.js @@ -1,3 +1,4 @@ +import { html } from '@rbardini/html' import Awards from './components/awards.js' import Certificates from './components/certificates.js' import Education from './components/education.js' @@ -12,7 +13,6 @@ import Skills from './components/skills.js' import Volunteer from './components/volunteer.js' import Work from './components/work.js' import colors from './utils/colors.js' -import html from './utils/html.js' /** * @param {import('./schema.d.ts').ResumeSchema} resume diff --git a/utils/html.js b/utils/html.js deleted file mode 100644 index 40061db..0000000 --- a/utils/html.js +++ /dev/null @@ -1,15 +0,0 @@ -// Based on https://github.com/jimniels/html -/** - * @param {TemplateStringsArray} strings - * @param {...any} values - * @returns {string} - */ -export default function html(strings, ...values) { - return strings.reduce((acc, string, i) => { - const value = values[i] - - if (Array.isArray(value)) return acc + string + value.join('') - if (value != null && !!value !== value) return acc + string + value - return acc + string - }, '') -}