From 501e17bc35c7edb70483d4651f9885a40941f0e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 6 Nov 2021 07:04:14 +0000 Subject: [PATCH 1/3] build(deps-dev): bump marked from 3.0.8 to 4.0.0 Bumps [marked](https://github.com/markedjs/marked) from 3.0.8 to 4.0.0. - [Release notes](https://github.com/markedjs/marked/releases) - [Changelog](https://github.com/markedjs/marked/blob/master/.releaserc.json) - [Commits](https://github.com/markedjs/marked/compare/v3.0.8...v4.0.0) --- updated-dependencies: - dependency-name: marked dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index db4260e6..48683dba 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "get-port": "^5.1.1", "highlight.js": "^11.0.1", "husky": "^4.2.5", - "marked": "^3.0.0", + "marked": "^4.0.0", "tap": "15.0.10" }, "scripts": { From 0cc7676897a304654d4074e80d49e88fb4b420e7 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 13 Nov 2021 00:58:00 -0600 Subject: [PATCH 2/3] chore: fix marked import --- scripts/build-docs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-docs.js b/scripts/build-docs.js index fb0ecb53..d1678d4e 100644 --- a/scripts/build-docs.js +++ b/scripts/build-docs.js @@ -1,6 +1,6 @@ const fs = require('fs/promises') const path = require('path') -const marked = require('marked') +const { marked } = require('marked') const fm = require('front-matter') const { highlight } = require('highlight.js') From 66f30b566e69f329b11ba84e21689c4cdfcf5992 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 13 Nov 2021 01:08:01 -0600 Subject: [PATCH 3/3] chore: fix building docs --- scripts/build-docs.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/build-docs.js b/scripts/build-docs.js index d1678d4e..fb434002 100644 --- a/scripts/build-docs.js +++ b/scripts/build-docs.js @@ -7,7 +7,7 @@ const { highlight } = require('highlight.js') marked.use({ highlight: (code, lang) => { if (lang) { - return highlight(lang, code).value + return highlight(code, { language: lang }).value } return code @@ -100,7 +100,13 @@ async function createDocs () { const branding = path.join(docs, 'branding') const src = path.join(branding, 'public') - await fs.rmdir(dist, { recursive: true }) + try { + await fs.rm(dist, { recursive: true }) + } catch (ex) { + if (ex.code !== 'ENOENT') { + throw ex + } + } await copyRecursive(src, dist) const highlightjsStyles = path.resolve(__dirname, '..', 'node_modules', 'highlight.js', 'styles')