diff --git a/packages/reveal-test/dist/reveal-test.cjs b/packages/reveal-test/dist/reveal-test.cjs index 03d620e..5760a41 100644 --- a/packages/reveal-test/dist/reveal-test.cjs +++ b/packages/reveal-test/dist/reveal-test.cjs @@ -6,7 +6,7 @@ var compilerExplorerDirectives = require('compiler-explorer-directives'); var MarkdownIt = require('markdown-it'); var fs = require('fs'); var cheerio = require('cheerio'); -var dedent = require('dedent'); +var dedent = require('dedent-js'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } diff --git a/packages/reveal-test/dist/reveal-test.cjs.map b/packages/reveal-test/dist/reveal-test.cjs.map index 0eedb6c..8401cd6 100644 --- a/packages/reveal-test/dist/reveal-test.cjs.map +++ b/packages/reveal-test/dist/reveal-test.cjs.map @@ -1 +1 @@ -{"version":3,"file":"reveal-test.cjs","sources":["../src/reveal-test.js"],"sourcesContent":["'use strict';\n\nimport { parseCode, compile as origCompile, CompileError } from 'compiler-explorer-directives';\nimport MarkdownIt from 'markdown-it';\nimport { promises } from 'fs';\nimport cheerio from 'cheerio';\nimport dedent from 'dedent';\n\nclass ParseError extends Error {\n constructor(message) {\n super(message);\n this.name = 'ParseError';\n }\n}\n\nconst elementLineNumber = (container, index) => {\n // https://stackoverflow.com/a/14482123/621176\n const nthIndex = (str, pat, n) => {\n var L = str.length, i = -1;\n while (n-- && i++ < L) {\n i = str.indexOf(pat, i);\n if (i < 0) break;\n }\n return i;\n };\n\n var upToElement = container.substr(0, nthIndex(container, \" {\n const md = new MarkdownIt({ html: true, breaks: true });\n const result = md.parse(markdown, {});\n const codeBlocks = result\n .filter(({ type, tag }) => type === 'fence' && tag === 'code')\n .map(({ content, info, map }) => { return { content: content, language: info.replace(/(\\w+).*/, '$1'), line: map[0] + 1 }; })\n .concat(result\n .filter(({ type }) => type === 'html_block').flatMap(({ content, info, map }) => {\n const $ = cheerio.load(content);\n return $('pre code').map(function (index) {\n return {\n content: dedent($(this).text().replace(/(\\n)/g, '$1 ')),\n language: $(this).attr(\"class\"),\n line: map[0] + 1 + elementLineNumber(content, index)\n };\n }).toArray();\n }))\n .sort((a, b) => a.line - b.line);\n return []\n .concat\n .apply([], await Promise.all(codeBlocks\n .flatMap(async ({ content, language, line }) => {\n content.replace(/<\\/?mark>/, '');\n const error = message => new ParseError(`${line}:\\n${message}`);\n config = Object.assign(config, {\n directives: [\n ['fails=(.*)', (matches, info) => matches.slice(1).forEach(match => {\n if (info.hasOwnProperty('expectedOutput')) {\n throw error('cannot have \"fails\" and \"output\" together');\n }\n info.failReason = match;\n })],\n ['output=(.*)', (matches, info) => matches.slice(1).forEach(match => {\n if (info.hasOwnProperty('failReason')) {\n throw error('cannot have \"fails\" and \"output\" together');\n }\n info.expectedOutput = matches[1].replace(/\\\\n/g, '\\n');\n })]\n ]\n });\n const parsed = await parseCode(content.replace(//g, ''), language, config);\n if (!parsed) {\n return []\n }\n parsed.line = line;\n return [parsed];\n })));\n};\n\nconst parseMarkdownFile = async (path, config = {}) => {\n try {\n const markdown = await promises.readFile(path, 'utf-8');\n const parsed = await parseMarkdown(markdown, config);\n return parsed.map(codeInfo => {\n codeInfo.path = `${path}:${codeInfo.line}`;\n delete codeInfo.line;\n return codeInfo;\n });\n } catch (err) {\n if (err instanceof ParseError) {\n throw new ParseError(`${path}:${err.message}`)\n } else {\n throw err;\n }\n }\n}\n\nconst compile = async (info, retryOptions = {}) => {\n const error = (text) => {\n return `${info.path}:\\n${text}`;\n };\n const failureMismatch = (output) => {\n return new CompileError(-1, error(`should have failed with '${info.failReason}'${output.length > 0 ? `\\nactual output is:\\n${output}` : ''}`));\n };\n if (info.failReason) {\n try {\n const result = await origCompile(info, retryOptions);\n throw failureMismatch(result);\n } catch (err) {\n if (!err.message.includes(info.failReason)) {\n throw failureMismatch(err.message);\n }\n return err.message;\n }\n } else {\n const result = await (async () => {\n try {\n return await origCompile(info, retryOptions);\n } catch (err) {\n const code = err.hasOwnProperty('code') ? err.code : -2;\n throw new CompileError(err.code, error(err.message));\n }\n })();\n\n if (info.hasOwnProperty('expectedOutput') && !result.includes(info.expectedOutput)) {\n throw new CompileError(-3, error(`output mismatch:\\nactual: ${result}\\nexpected: ${info.expectedOutput}`));\n }\n\n return result;\n }\n};\n\nexport { parseMarkdown, parseMarkdownFile, compile, CompileError };\n"],"names":["MarkdownIt","cheerio","dedent","parseCode","promises","CompileError","origCompile"],"mappings":";;;;;;;;;;;;;;;;AAQA,MAAM,UAAU,SAAS,KAAK,CAAC;AAC/B,EAAE,WAAW,CAAC,OAAO,EAAE;AACvB,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;AACnB,IAAI,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;AAC7B,GAAG;AACH,CAAC;AACD;AACA,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,KAAK,KAAK;AAChD;AACA,EAAE,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK;AACpC,IAAI,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/B,IAAI,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE;AAC3B,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAC9B,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM;AACvB,KAAK;AACL,IAAI,OAAO,CAAC,CAAC;AACb,GAAG,CAAC;AACJ;AACA,EAAE,IAAI,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;AACjF,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC;AACpD,EAAC;AACD;AACK,MAAC,aAAa,GAAG,OAAO,QAAQ,EAAE,MAAM,GAAG,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MA,kCAAW,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AACrD,OAAO,CAAC,OAAO,GAAG,EAAE;AACpB,QAAQ,MAAM,IAAI,GAAG,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;AAChE,QAAQ,MAAM,IAAID,uCAAY,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7D,OAAO;AACP,KAAK,GAAG,CAAC;AACT;AACA,IAAI,IAAI,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE;AACxF,MAAM,MAAM,IAAIA,uCAAY,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,0BAA0B,EAAE,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AACjH,KAAK;AACL;AACA,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG;AACH;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"reveal-test.cjs","sources":["../src/reveal-test.js"],"sourcesContent":["'use strict';\n\nimport { parseCode, compile as origCompile, CompileError } from 'compiler-explorer-directives';\nimport MarkdownIt from 'markdown-it';\nimport { promises } from 'fs';\nimport cheerio from 'cheerio';\nimport dedent from 'dedent-js';\n\nclass ParseError extends Error {\n constructor(message) {\n super(message);\n this.name = 'ParseError';\n }\n}\n\nconst elementLineNumber = (container, index) => {\n // https://stackoverflow.com/a/14482123/621176\n const nthIndex = (str, pat, n) => {\n var L = str.length, i = -1;\n while (n-- && i++ < L) {\n i = str.indexOf(pat, i);\n if (i < 0) break;\n }\n return i;\n };\n\n var upToElement = container.substr(0, nthIndex(container, \" {\n const md = new MarkdownIt({ html: true, breaks: true });\n const result = md.parse(markdown, {});\n const codeBlocks = result\n .filter(({ type, tag }) => type === 'fence' && tag === 'code')\n .map(({ content, info, map }) => { return { content: content, language: info.replace(/(\\w+).*/, '$1'), line: map[0] + 1 }; })\n .concat(result\n .filter(({ type }) => type === 'html_block').flatMap(({ content, info, map }) => {\n const $ = cheerio.load(content);\n return $('pre code').map(function (index) {\n return {\n content: dedent($(this).text().replace(/(\\n)/g, '$1 ')),\n language: $(this).attr(\"class\"),\n line: map[0] + 1 + elementLineNumber(content, index)\n };\n }).toArray();\n }))\n .sort((a, b) => a.line - b.line);\n return []\n .concat\n .apply([], await Promise.all(codeBlocks\n .flatMap(async ({ content, language, line }) => {\n content.replace(/<\\/?mark>/, '');\n const error = message => new ParseError(`${line}:\\n${message}`);\n config = Object.assign(config, {\n directives: [\n ['fails=(.*)', (matches, info) => matches.slice(1).forEach(match => {\n if (info.hasOwnProperty('expectedOutput')) {\n throw error('cannot have \"fails\" and \"output\" together');\n }\n info.failReason = match;\n })],\n ['output=(.*)', (matches, info) => matches.slice(1).forEach(match => {\n if (info.hasOwnProperty('failReason')) {\n throw error('cannot have \"fails\" and \"output\" together');\n }\n info.expectedOutput = matches[1].replace(/\\\\n/g, '\\n');\n })]\n ]\n });\n const parsed = await parseCode(content.replace(//g, ''), language, config);\n if (!parsed) {\n return []\n }\n parsed.line = line;\n return [parsed];\n })));\n};\n\nconst parseMarkdownFile = async (path, config = {}) => {\n try {\n const markdown = await promises.readFile(path, 'utf-8');\n const parsed = await parseMarkdown(markdown, config);\n return parsed.map(codeInfo => {\n codeInfo.path = `${path}:${codeInfo.line}`;\n delete codeInfo.line;\n return codeInfo;\n });\n } catch (err) {\n if (err instanceof ParseError) {\n throw new ParseError(`${path}:${err.message}`)\n } else {\n throw err;\n }\n }\n}\n\nconst compile = async (info, retryOptions = {}) => {\n const error = (text) => {\n return `${info.path}:\\n${text}`;\n };\n const failureMismatch = (output) => {\n return new CompileError(-1, error(`should have failed with '${info.failReason}'${output.length > 0 ? `\\nactual output is:\\n${output}` : ''}`));\n };\n if (info.failReason) {\n try {\n const result = await origCompile(info, retryOptions);\n throw failureMismatch(result);\n } catch (err) {\n if (!err.message.includes(info.failReason)) {\n throw failureMismatch(err.message);\n }\n return err.message;\n }\n } else {\n const result = await (async () => {\n try {\n return await origCompile(info, retryOptions);\n } catch (err) {\n const code = err.hasOwnProperty('code') ? err.code : -2;\n throw new CompileError(err.code, error(err.message));\n }\n })();\n\n if (info.hasOwnProperty('expectedOutput') && !result.includes(info.expectedOutput)) {\n throw new CompileError(-3, error(`output mismatch:\\nactual: ${result}\\nexpected: ${info.expectedOutput}`));\n }\n\n return result;\n }\n};\n\nexport { parseMarkdown, parseMarkdownFile, compile, CompileError };\n"],"names":["MarkdownIt","cheerio","dedent","parseCode","promises","CompileError","origCompile"],"mappings":";;;;;;;;;;;;;;;;AAQA,MAAM,UAAU,SAAS,KAAK,CAAC;AAC/B,EAAE,WAAW,CAAC,OAAO,EAAE;AACvB,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;AACnB,IAAI,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;AAC7B,GAAG;AACH,CAAC;AACD;AACA,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,KAAK,KAAK;AAChD;AACA,EAAE,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK;AACpC,IAAI,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/B,IAAI,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE;AAC3B,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAC9B,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM;AACvB,KAAK;AACL,IAAI,OAAO,CAAC,CAAC;AACb,GAAG,CAAC;AACJ;AACA,EAAE,IAAI,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAA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QAAQ,MAAM,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC3C,OAAO;AACP,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC;AACzB,KAAK;AACL,GAAG,MAAM;AACT,IAAI,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY;AACtC,MAAM,IAAI;AACV,QAAQ,OAAO,MAAMA,kCAAW,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AACrD,OAAO,CAAC,OAAO,GAAG,EAAE;AACpB,QAAQ,MAAM,IAAI,GAAG,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;AAChE,QAAQ,MAAM,IAAID,uCAAY,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7D,OAAO;AACP,KAAK,GAAG,CAAC;AACT;AACA,IAAI,IAAI,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE;AACxF,MAAM,MAAM,IAAIA,uCAAY,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,0BAA0B,EAAE,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AACjH,KAAK;AACL;AACA,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG;AACH;;;;;;;;;;;;"} \ No newline at end of file diff --git a/packages/reveal-test/rollup.config.js b/packages/reveal-test/rollup.config.js index 67e68a9..834d36e 100644 --- a/packages/reveal-test/rollup.config.js +++ b/packages/reveal-test/rollup.config.js @@ -19,6 +19,6 @@ export default { 'markdown-it', 'fs', 'cheerio', - 'dedent', + 'dedent-js', ] }; diff --git a/packages/reveal-test/src/reveal-test.js b/packages/reveal-test/src/reveal-test.js index ba73a37..36e5c01 100644 --- a/packages/reveal-test/src/reveal-test.js +++ b/packages/reveal-test/src/reveal-test.js @@ -4,7 +4,7 @@ import { parseCode, compile as origCompile, CompileError } from 'compiler-explor import MarkdownIt from 'markdown-it'; import { promises } from 'fs'; import cheerio from 'cheerio'; -import dedent from 'dedent'; +import dedent from 'dedent-js'; class ParseError extends Error { constructor(message) {