Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

build(deps-dev): bump marked from 3.0.8 to 4.0.0 #768

Merged
merged 3 commits into from
Nov 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
12 changes: 9 additions & 3 deletions scripts/build-docs.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
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')

marked.use({
highlight: (code, lang) => {
if (lang) {
return highlight(lang, code).value
return highlight(code, { language: lang }).value
}

return code
Expand Down Expand Up @@ -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')
Expand Down