Skip to content

Commit 025368f

Browse files
authored
Merge pull request #194 from Flakebi/deps
Update all dependencies
2 parents 82c6ecf + d50ba88 commit 025368f

6 files changed

Lines changed: 35 additions & 35 deletions

File tree

‎package.json‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,32 @@
1515
"homepage": "https://github.com/RelaxedJS",
1616
"license": "ISC",
1717
"dependencies": {
18-
"@iktakahiro/markdown-it-katex": "^3.1.0",
18+
"@iktakahiro/markdown-it-katex": "^4.0.1",
1919
"cheerio": "^1.0.0-rc.2",
20-
"chokidar": "^2.0.3",
20+
"chokidar": "^3.5.3",
2121
"colors": "^1.3.0",
22-
"commander": "^2.15.1",
22+
"commander": "^9.1.0",
2323
"csvtojson": "^2.0.3",
2424
"deptree": "^1.0.0",
25-
"filesize": "^3.6.1",
25+
"filesize": "^8.0.7",
2626
"html2jade": "^0.8.6",
27-
"jimp": "^0.5.4",
28-
"js-yaml": "^3.12.0",
27+
"jimp": "^0.16.1",
28+
"js-yaml": "^4.1.0",
2929
"jstransformer-highlight": "^2.0.0",
3030
"jstransformer-markdown-it": "^2.1.0",
31-
"katex": "^0.11.1",
32-
"markdown-it": "^10.0.0",
33-
"markdown-it-footnote": "^3.0.2",
31+
"katex": "^0.15.3",
32+
"markdown-it": "^12.3.0",
33+
"markdown-it-footnote": "^3.0.3",
3434
"mathjax-node-page": "^3.0.1",
3535
"mermaid": "^8.0.0-rc.8",
36-
"node-sass": "^7.0.1",
37-
"pug": "^2.0.3",
38-
"puppeteer": "^1.8.0"
36+
"pug": "^3.0.2",
37+
"puppeteer": "^13.5.1",
38+
"sass": "^1.49.9"
3939
},
4040
"devDependencies": {
41-
"diff": "^3.5.0",
42-
"mocha": "^5.2.0",
41+
"diff": "^5.0.0",
42+
"mocha": "^9.2.2",
4343
"pdf-image": "^2.0.0",
4444
"pixel-diff": "^1.0.1"
4545
}
46-
}
46+
}

‎src/builtin_plugins/katex/head.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
rel="stylesheet"
33
href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css"
44
integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq"
5-
crossorigin="anonymous">
5+
crossorigin="anonymous" />

‎src/builtin_plugins/markdown/index.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exports.constructor = async function (params) {
77
var href = "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css"
88
return {
99
pugFilters: { markdown: MarkdownPugFilter },
10-
headElements: `<link rel="stylesheet" href="${href}"></link>`
10+
headElements: `<link rel="stylesheet" href="${href}" />`
1111
}
1212
}
1313
function MarkdownPugFilter (text, options) {
@@ -28,5 +28,3 @@ function MarkdownPugFilter (text, options) {
2828
md.use(mdKatex)
2929
return md.render(text)
3030
}
31-
32-

‎src/builtin_plugins/scss/index.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const sass = require('node-sass')
1+
const sass = require('sass')
22

33
exports.constructor = async function (params) {
44
return {
@@ -7,7 +7,7 @@ exports.constructor = async function (params) {
77
}
88

99
function ScssPugFilter (text, options) {
10-
var file = options.filename
11-
options = file.endsWith('scss') ? { file } : { data: text }
12-
return sass.renderSync(options).css.toString('utf8')
10+
if (options.filename.endsWith('scss'))
11+
return sass.compile(options.filename).css
12+
return sass.compileString(text).css
1313
}

‎src/index.js‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ program
3434
// ARGUMENTS PARSING AND SETUP
3535

3636
program.parse(process.argv)
37+
const options = program.opts()
3738

3839
if (!input || fs.lstatSync(input).isDirectory()) {
3940
input = autodetectMasterFile(input)
@@ -59,14 +60,14 @@ if (!output) {
5960
const outputPath = path.resolve(output)
6061

6162
var tempDir
62-
if (program.temp) {
63-
var validTempPath = fs.existsSync(program.temp) && fs.statSync(program.temp).isDirectory()
63+
if (options.temp) {
64+
var validTempPath = fs.existsSync(options.temp) && fs.statSync(options.temp).isDirectory()
6465

6566
if (validTempPath) {
66-
tempDir = path.resolve(program.temp)
67+
tempDir = path.resolve(options.temp)
6768
} else {
6869
console.error(colors.red('ReLaXed error: Could not find specified --temp directory: ' +
69-
program.temp))
70+
options.temp))
7071
process.exit(1)
7172
}
7273
} else {
@@ -77,16 +78,16 @@ const tempHTMLPath = path.join(tempDir, inputFilenameNoExt + '_temp.htm')
7778

7879
// Default and additional watch locations
7980
let watchLocations = [inputDir]
80-
if (program.watch) {
81-
watchLocations = watchLocations.concat(program.watch)
81+
if (options.watch) {
82+
watchLocations = watchLocations.concat(options.watch)
8283
}
8384

84-
let locals = parseLocals(program.locals, inputDir)
85+
let locals = parseLocals(options.locals, inputDir)
8586

8687
// Google Chrome headless configuration
8788
const puppeteerConfig = {
8889
headless: true,
89-
args: (!program.sandbox ? ['--no-sandbox'] : []).concat([
90+
args: (!options.sandbox ? ['--no-sandbox'] : []).concat([
9091
'--disable-translate',
9192
'--disable-extensions',
9293
'--disable-sync'
@@ -104,7 +105,7 @@ const relaxedGlobals = {
104105
busy: false,
105106
config: {},
106107
configPlugins: [],
107-
basedir: program.basedir || inputDir
108+
basedir: options.basedir || inputDir
108109
}
109110

110111
var updateConfig = async function () {
@@ -114,7 +115,7 @@ var updateConfig = async function () {
114115
if (configPath.endsWith('.json')) {
115116
relaxedGlobals.config = JSON.parse(data)
116117
} else {
117-
relaxedGlobals.config = yaml.safeLoad(data)
118+
relaxedGlobals.config = yaml.load(data)
118119
}
119120
}
120121
await plugins.updateRegisteredPlugins(relaxedGlobals, inputDir)
@@ -141,7 +142,7 @@ async function main () {
141142

142143
await build(inputPath)
143144

144-
if (program.buildOnce) {
145+
if (options.buildOnce) {
145146
process.exit(0)
146147
} else {
147148
watch()
@@ -163,7 +164,7 @@ async function build (filepath) {
163164

164165
var updatedLocals = false
165166
if (isLastLocalJsonPath(filepath)) {
166-
locals = parseLocals(program.locals, inputDir)
167+
locals = parseLocals(options.locals, inputDir)
167168
updatedLocals = true
168169
}
169170

‎src/masterToPDF.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ exports.masterToPDF = async function (masterPath, relaxedGlobals, tempHTMLPath,
5050
*/
5151
var head = pluginHooks.headElements.map(e => e.instance).join(`\n\n`)
5252
html = `
53+
<!DOCTYPE html>
5354
<html>
5455
<head>
5556
<meta charset="UTF-8">

0 commit comments

Comments
 (0)