From a21a14a7cca5bc449342dfa4ca0338c4fbd6c067 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Sun, 19 Apr 2020 17:29:37 +0200 Subject: [PATCH 01/46] Allow to include own style(s) into HTML produced by CLI Resolves #6 --- packages/ipynb2html-cli/src/cli.ts | 38 +++++++++++++++++++++++------ packages/ipynb2html-cli/src/page.ts | 14 ++++++----- 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/packages/ipynb2html-cli/src/cli.ts b/packages/ipynb2html-cli/src/cli.ts index d7d0f6f..78c640d 100644 --- a/packages/ipynb2html-cli/src/cli.ts +++ b/packages/ipynb2html-cli/src/cli.ts @@ -3,7 +3,7 @@ import minimist from 'minimist' import minimistOptions from 'minimist-options' import { Document } from 'nodom' import { exit } from 'process' -import { $INLINE_JSON } from 'ts-transformer-inline-file' +import { $INLINE_FILE, $INLINE_JSON } from 'ts-transformer-inline-file' import * as ipynb2html from 'ipynb2html' @@ -11,6 +11,8 @@ import renderPage from './page' const { version, bugs: bugsUrl } = $INLINE_JSON('../package.json') +const notebookCss = $INLINE_FILE('../../ipynb2html/styles/notebook.css') +const pageCss = $INLINE_FILE('./page.css') const progName = 'ipynb2html' const helpMsg = `\ @@ -24,13 +26,20 @@ Arguments: provided, the output will be written to STDOUT. Options: - -d --debug Print debug messages. - -h --help Show this message and exit. - -V --version Print version and exit. + -d --debug Print debug messages. + + -s --style Comma separated stylesheet(s) to embed into the output + HTML. The stylesheet may be a path to a CSS file, + "@base" for the base ipynb2html style, or "@default" + for the default full page style. Default is @default. + + -h --help Show this message and exit. + + -V --version Print version and exit. Exit Codes: - 1 Generic error code. - 2 Missing required arguments or invalid option. + 1 Generic error code. + 2 Missing required arguments or invalid option. Please report bugs at <${bugsUrl}>. ` @@ -39,9 +48,14 @@ function logErr (msg: string): void { console.error(`${progName}: ${msg}`) } +function arrify (obj: T | T[]): T[] { + return Array.isArray(obj) ? obj : [obj] +} + function parseCliArgs (argv: string[]) { const opts = minimist(argv, minimistOptions({ debug: { alias: 'd', type: 'boolean' }, + style: { alias: 's', type: 'string', default: '@default' }, version: { alias: 'V', type: 'boolean' }, help: { alias: 'h', type: 'boolean' }, arguments: 'string', @@ -73,24 +87,34 @@ function parseCliArgs (argv: string[]) { const [input, output] = opts._ return { + styles: arrify(opts.style).join(',').split(/,\s*/), debug: opts.debug as boolean, input: input === '-' ? 0 : input, // 0 = stdin output, } } +function loadStyle (name: string): string { + switch (name) { + case '@base': return notebookCss + case '@default': return pageCss + notebookCss + default: return fs.readFileSync(name, 'utf8') + } +} + export default (argv: string[]): void => { const opts = parseCliArgs(argv) try { const notebook = JSON.parse(fs.readFileSync(opts.input, 'utf-8')) + const style = opts.styles.map(loadStyle).join('\n') const title = ipynb2html.readNotebookTitle(notebook) ?? 'Notebook' const renderNotebook = ipynb2html.createRenderer(new Document()) const contents = renderNotebook(notebook).outerHTML - const html = renderPage(contents, title) + const html = renderPage({ contents, title, style }) if (opts.output) { fs.writeFileSync(opts.output, html) diff --git a/packages/ipynb2html-cli/src/page.ts b/packages/ipynb2html-cli/src/page.ts index ad8083e..8552e4c 100644 --- a/packages/ipynb2html-cli/src/page.ts +++ b/packages/ipynb2html-cli/src/page.ts @@ -1,11 +1,13 @@ import { version } from 'ipynb2html' -import { $INLINE_FILE } from 'ts-transformer-inline-file' - -const notebookCss = $INLINE_FILE('../../ipynb2html/styles/notebook.css') -const pageCss = $INLINE_FILE('./page.css') -export default (contents: string, title: string): string => `\ +export type Options = { + contents: string, + title: string, + style: string, +} + +export default ({ contents, title, style }: Options): string => `\ @@ -22,7 +24,7 @@ export default (contents: string, title: string): string => `\ integrity="sha384-BdGj8xC2eZkQaxoQ8nSLefg4AV4/AwB3Fj+8SUSo7pnKP6Eoy18liIKTPn9oBYNG" crossorigin="anonymous"> From 6461e84fe7495baada3140c9898cb2c160d12002 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Sun, 19 Apr 2020 18:19:01 +0200 Subject: [PATCH 02/46] Bump @babel/* from ^7.8.7 to ^7.9.0 This should fix build error on Node.js 13, https://www.reddit.com/r/Nuxt/comments/g32jr5/babel_breaking_changes/. --- package.json | 4 +- yarn.lock | 335 ++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 239 insertions(+), 100 deletions(-) diff --git a/package.json b/package.json index 485ecb5..fdbf309 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,8 @@ "node": ">=10.13.0" }, "devDependencies": { - "@babel/core": "^7.8.7", - "@babel/preset-env": "^7.8.7", + "@babel/core": "^7.9.0", + "@babel/preset-env": "^7.9.0", "@rollup/plugin-commonjs": "^11.0.1", "@rollup/plugin-node-resolve": "^7.0.0", "@types/dedent": "^0.7.0", diff --git a/yarn.lock b/yarn.lock index 0008d9b..277d6ca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18,6 +18,15 @@ invariant "^2.2.4" semver "^5.5.0" +"@babel/compat-data@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.9.0.tgz#04815556fc90b0c174abd2c0c1bb966faa036a6c" + integrity sha512-zeFQrr+284Ekvd9e7KAX954LkapWiOmQtsfHirhxqfdlX6MEC32iRE+pqUGlYIBchdevaCwvzxWGSy/YBNI85g== + dependencies: + browserslist "^4.9.1" + invariant "^2.2.4" + semver "^5.5.0" + "@babel/core@^7.1.0", "@babel/core@^7.7.5": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.8.3.tgz#30b0ebb4dd1585de6923a0b4d179e0b9f5d82941" @@ -39,22 +48,23 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/core@^7.8.7": - version "7.8.7" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.8.7.tgz#b69017d221ccdeb203145ae9da269d72cf102f3b" - integrity sha512-rBlqF3Yko9cynC5CCFy6+K/w2N+Sq/ff2BPy+Krp7rHlABIr5epbA7OxVeKoMHB39LZOp1UY5SuLjy6uWi35yA== +"@babel/core@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.9.0.tgz#ac977b538b77e132ff706f3b8a4dbad09c03c56e" + integrity sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w== dependencies: "@babel/code-frame" "^7.8.3" - "@babel/generator" "^7.8.7" - "@babel/helpers" "^7.8.4" - "@babel/parser" "^7.8.7" + "@babel/generator" "^7.9.0" + "@babel/helper-module-transforms" "^7.9.0" + "@babel/helpers" "^7.9.0" + "@babel/parser" "^7.9.0" "@babel/template" "^7.8.6" - "@babel/traverse" "^7.8.6" - "@babel/types" "^7.8.7" + "@babel/traverse" "^7.9.0" + "@babel/types" "^7.9.0" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.1" - json5 "^2.1.0" + json5 "^2.1.2" lodash "^4.17.13" resolve "^1.3.2" semver "^5.4.1" @@ -70,7 +80,7 @@ lodash "^4.17.13" source-map "^0.5.0" -"@babel/generator@^7.8.6", "@babel/generator@^7.8.7": +"@babel/generator@^7.8.6": version "7.8.7" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.8.7.tgz#870b3cf7984f5297998152af625c4f3e341400f7" integrity sha512-DQwjiKJqH4C3qGiyQCAExJHoZssn49JTMJgZ8SANGgVFdkupcUhLOdkAeoC6kmHZCPfoDG5M0b6cFlSN5wW7Ew== @@ -80,6 +90,16 @@ lodash "^4.17.13" source-map "^0.5.0" +"@babel/generator@^7.9.0", "@babel/generator@^7.9.5": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.9.5.tgz#27f0917741acc41e6eaaced6d68f96c3fa9afaf9" + integrity sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ== + dependencies: + "@babel/types" "^7.9.5" + jsesc "^2.5.1" + lodash "^4.17.13" + source-map "^0.5.0" + "@babel/helper-annotate-as-pure@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.8.3.tgz#60bc0bc657f63a0924ff9a4b4a0b24a13cf4deee" @@ -95,15 +115,6 @@ "@babel/helper-explode-assignable-expression" "^7.8.3" "@babel/types" "^7.8.3" -"@babel/helper-call-delegate@^7.8.7": - version "7.8.7" - resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.8.7.tgz#28a279c2e6c622a6233da548127f980751324cab" - integrity sha512-doAA5LAKhsFCR0LAFIf+r2RSMmC+m8f/oQ+URnUET/rWeEzC0yTRmAGyWkD4sSu3xwbS7MYQ2u+xlt1V5R56KQ== - dependencies: - "@babel/helper-hoist-variables" "^7.8.3" - "@babel/traverse" "^7.8.3" - "@babel/types" "^7.8.7" - "@babel/helper-compilation-targets@^7.8.7": version "7.8.7" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.8.7.tgz#dac1eea159c0e4bd46e309b5a1b04a66b53c1dde" @@ -123,6 +134,15 @@ "@babel/helper-regex" "^7.8.3" regexpu-core "^4.6.0" +"@babel/helper-create-regexp-features-plugin@^7.8.8": + version "7.8.8" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.8.8.tgz#5d84180b588f560b7864efaeea89243e58312087" + integrity sha512-LYVPdwkrQEiX9+1R29Ld/wTrmQu1SSKYnuOk3g0CkcZMA1p0gsNxJFj/3gBdaJ7Cg0Fnek5z0DsMULePP7Lrqg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.8.3" + "@babel/helper-regex" "^7.8.3" + regexpu-core "^4.7.0" + "@babel/helper-define-map@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.8.3.tgz#a0655cad5451c3760b726eba875f1cd8faa02c15" @@ -149,6 +169,15 @@ "@babel/template" "^7.8.3" "@babel/types" "^7.8.3" +"@babel/helper-function-name@^7.9.5": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz#2b53820d35275120e1874a82e5aabe1376920a5c" + integrity sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw== + dependencies: + "@babel/helper-get-function-arity" "^7.8.3" + "@babel/template" "^7.8.3" + "@babel/types" "^7.9.5" + "@babel/helper-get-function-arity@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz#b894b947bd004381ce63ea1db9f08547e920abd5" @@ -177,16 +206,17 @@ dependencies: "@babel/types" "^7.8.3" -"@babel/helper-module-transforms@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.8.3.tgz#d305e35d02bee720fbc2c3c3623aa0c316c01590" - integrity sha512-C7NG6B7vfBa/pwCOshpMbOYUmrYQDfCpVL/JCRu0ek8B5p8kue1+BCXpg2vOYs7w5ACB9GTOBYQ5U6NwrMg+3Q== +"@babel/helper-module-transforms@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz#43b34dfe15961918707d247327431388e9fe96e5" + integrity sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA== dependencies: "@babel/helper-module-imports" "^7.8.3" + "@babel/helper-replace-supers" "^7.8.6" "@babel/helper-simple-access" "^7.8.3" "@babel/helper-split-export-declaration" "^7.8.3" - "@babel/template" "^7.8.3" - "@babel/types" "^7.8.3" + "@babel/template" "^7.8.6" + "@babel/types" "^7.9.0" lodash "^4.17.13" "@babel/helper-optimise-call-expression@^7.8.3": @@ -254,6 +284,11 @@ dependencies: "@babel/types" "^7.8.3" +"@babel/helper-validator-identifier@^7.9.5": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz#90977a8e6fbf6b431a7dc31752eee233bf052d80" + integrity sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g== + "@babel/helper-wrap-function@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.8.3.tgz#9dbdb2bb55ef14aaa01fe8c99b629bd5352d8610" @@ -273,14 +308,14 @@ "@babel/traverse" "^7.8.3" "@babel/types" "^7.8.3" -"@babel/helpers@^7.8.4": - version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.8.4.tgz#754eb3ee727c165e0a240d6c207de7c455f36f73" - integrity sha512-VPbe7wcQ4chu4TDQjimHv/5tj73qz88o12EPkO2ValS2QiQS/1F2SsjyIGNnAD0vF/nZS6Cf9i+vW6HIlnaR8w== +"@babel/helpers@^7.9.0": + version "7.9.2" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.9.2.tgz#b42a81a811f1e7313b88cba8adc66b3d9ae6c09f" + integrity sha512-JwLvzlXVPjO8eU9c/wF9/zOIN7X6h8DYf7mG4CiFRZRvZNKEF5dQ3H3V+ASkHoIB3mWhatgl5ONhyqHRI6MppA== dependencies: "@babel/template" "^7.8.3" - "@babel/traverse" "^7.8.4" - "@babel/types" "^7.8.3" + "@babel/traverse" "^7.9.0" + "@babel/types" "^7.9.0" "@babel/highlight@^7.8.3": version "7.8.3" @@ -296,11 +331,16 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.3.tgz#790874091d2001c9be6ec426c2eed47bc7679081" integrity sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ== -"@babel/parser@^7.8.6", "@babel/parser@^7.8.7": +"@babel/parser@^7.8.6": version "7.8.7" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.7.tgz#7b8facf95d25fef9534aad51c4ffecde1a61e26a" integrity sha512-9JWls8WilDXFGxs0phaXAZgpxTZhSk/yOYH2hTHC0X1yC7Z78IJfvR1vJ+rmJKq3I35td2XzXzN6ZLYlna+r/A== +"@babel/parser@^7.9.0": + version "7.9.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.9.4.tgz#68a35e6b0319bbc014465be43828300113f2f2e8" + integrity sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA== + "@babel/plugin-proposal-async-generator-functions@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.8.3.tgz#bad329c670b382589721b27540c7d288601c6e6f" @@ -334,13 +374,22 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0" -"@babel/plugin-proposal-object-rest-spread@^7.8.3": +"@babel/plugin-proposal-numeric-separator@^7.8.3": version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.8.3.tgz#eb5ae366118ddca67bed583b53d7554cad9951bb" - integrity sha512-8qvuPwU/xxUCt78HocNlv0mXXo0wdh9VT1R04WU8HGOfaOob26pF+9P5/lYjN/q7DHOX1bvX60hnhOvuQUJdbA== + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.8.3.tgz#5d6769409699ec9b3b68684cd8116cedff93bad8" + integrity sha512-jWioO1s6R/R+wEHizfaScNsAx+xKgwTLNXSh7tTC4Usj3ItsPEhYkEpU4h+lpnBwq7NBVOJXfO6cRFYcX69JUQ== + dependencies: + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.8.3" + +"@babel/plugin-proposal-object-rest-spread@^7.9.5": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.5.tgz#3fd65911306d8746014ec0d0cf78f0e39a149116" + integrity sha512-VP2oXvAf7KCYTthbUHwBlewbl1Iq059f6seJGsxMizaCdgHIeczOr7FBqELhSqfkIl04Fi8okzWzl63UKbQmmg== dependencies: "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-object-rest-spread" "^7.8.0" + "@babel/plugin-transform-parameters" "^7.9.5" "@babel/plugin-proposal-optional-catch-binding@^7.8.3": version "7.8.3" @@ -350,14 +399,22 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-optional-catch-binding" "^7.8.0" -"@babel/plugin-proposal-optional-chaining@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.8.3.tgz#ae10b3214cb25f7adb1f3bc87ba42ca10b7e2543" - integrity sha512-QIoIR9abkVn+seDE3OjA08jWcs3eZ9+wJCKSRgo3WdEU2csFYgdScb+8qHB3+WXsGJD55u+5hWCISI7ejXS+kg== +"@babel/plugin-proposal-optional-chaining@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.9.0.tgz#31db16b154c39d6b8a645292472b98394c292a58" + integrity sha512-NDn5tu3tcv4W30jNhmc2hyD5c56G6cXx4TesJubhxrJeCvuuMpttxr0OnNCqbZGhFjLrg+NIhxxC+BK5F6yS3w== dependencies: "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-optional-chaining" "^7.8.0" +"@babel/plugin-proposal-unicode-property-regex@^7.4.4": + version "7.8.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.8.8.tgz#ee3a95e90cdc04fe8cd92ec3279fa017d68a0d1d" + integrity sha512-EVhjVsMpbhLw9ZfHWSx2iy13Q8Z/eg8e8ccVWt23sWQK5l1UdkoLJPN5w69UA4uITGBnEZD2JOe4QOHycYKv8A== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.8.8" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-proposal-unicode-property-regex@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.8.3.tgz#b646c3adea5f98800c9ab45105ac34d06cd4a47f" @@ -401,6 +458,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" +"@babel/plugin-syntax-numeric-separator@^7.8.0", "@babel/plugin-syntax-numeric-separator@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.8.3.tgz#0e3fb63e09bea1b11e96467271c8308007e7c41f" + integrity sha512-H7dCMAdN83PcCmqmkHB5dtp+Xa9a6LKSvA2hiFBC/5alSHxM5VgWZXFqDi0YFe8XNGT6iCa+z4V4zSt/PdZ7Dw== + dependencies: + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-syntax-object-rest-spread@^7.0.0", "@babel/plugin-syntax-object-rest-spread@^7.8.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" @@ -460,14 +524,14 @@ "@babel/helper-plugin-utils" "^7.8.3" lodash "^4.17.13" -"@babel/plugin-transform-classes@^7.8.6": - version "7.8.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.8.6.tgz#77534447a477cbe5995ae4aee3e39fbc8090c46d" - integrity sha512-k9r8qRay/R6v5aWZkrEclEhKO6mc1CCQr2dLsVHBmOQiMpN6I2bpjX3vgnldUWeEI1GHVNByULVxZ4BdP4Hmdg== +"@babel/plugin-transform-classes@^7.9.5": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.9.5.tgz#800597ddb8aefc2c293ed27459c1fcc935a26c2c" + integrity sha512-x2kZoIuLC//O5iA7PEvecB105o7TLzZo8ofBVhP79N+DO3jaX+KYfww9TQcfBEZD0nikNyYcGB1IKtRq36rdmg== dependencies: "@babel/helper-annotate-as-pure" "^7.8.3" "@babel/helper-define-map" "^7.8.3" - "@babel/helper-function-name" "^7.8.3" + "@babel/helper-function-name" "^7.9.5" "@babel/helper-optimise-call-expression" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" "@babel/helper-replace-supers" "^7.8.6" @@ -481,14 +545,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-destructuring@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.8.3.tgz#20ddfbd9e4676906b1056ee60af88590cc7aaa0b" - integrity sha512-H4X646nCkiEcHZUZaRkhE2XVsoz0J/1x3VVujnn96pSoGCtKPA99ZZA+va+gK+92Zycd6OBKCD8tDb/731bhgQ== +"@babel/plugin-transform-destructuring@^7.9.5": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.9.5.tgz#72c97cf5f38604aea3abf3b935b0e17b1db76a50" + integrity sha512-j3OEsGel8nHL/iusv/mRd5fYZ3DrOxWC82x0ogmdN/vHfAP4MYw+AFKYanzWlktNwikKvlzUV//afBW5FTp17Q== dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-dotall-regex@^7.8.3": +"@babel/plugin-transform-dotall-regex@^7.4.4", "@babel/plugin-transform-dotall-regex@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.8.3.tgz#c3c6ec5ee6125c6993c5cbca20dc8621a9ea7a6e" integrity sha512-kLs1j9Nn4MQoBYdRXH6AeaXMbEJFaFu/v1nQkvib6QzTj8MZI5OQzqmD83/2jEM1z0DLilra5aWO5YpyC0ALIw== @@ -511,10 +575,10 @@ "@babel/helper-builder-binary-assignment-operator-visitor" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-for-of@^7.8.6": - version "7.8.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.8.6.tgz#a051bd1b402c61af97a27ff51b468321c7c2a085" - integrity sha512-M0pw4/1/KI5WAxPsdcUL/w2LJ7o89YHN3yLkzNjg7Yl15GlVGgzHyCU+FMeAxevHGsLVmUqbirlUIKTafPmzdw== +"@babel/plugin-transform-for-of@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.9.0.tgz#0f260e27d3e29cd1bb3128da5e76c761aa6c108e" + integrity sha512-lTAnWOpMwOXpyDx06N+ywmF3jNbafZEqZ96CGYabxHrxNX8l5ny7dt4bK/rGwAh9utyP2b2Hv7PlZh1AAS54FQ== dependencies: "@babel/helper-plugin-utils" "^7.8.3" @@ -540,41 +604,41 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-modules-amd@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.8.3.tgz#65606d44616b50225e76f5578f33c568a0b876a5" - integrity sha512-MadJiU3rLKclzT5kBH4yxdry96odTUwuqrZM+GllFI/VhxfPz+k9MshJM+MwhfkCdxxclSbSBbUGciBngR+kEQ== +"@babel/plugin-transform-modules-amd@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.9.0.tgz#19755ee721912cf5bb04c07d50280af3484efef4" + integrity sha512-vZgDDF003B14O8zJy0XXLnPH4sg+9X5hFBBGN1V+B2rgrB+J2xIypSN6Rk9imB2hSTHQi5OHLrFWsZab1GMk+Q== dependencies: - "@babel/helper-module-transforms" "^7.8.3" + "@babel/helper-module-transforms" "^7.9.0" "@babel/helper-plugin-utils" "^7.8.3" babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-commonjs@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.8.3.tgz#df251706ec331bd058a34bdd72613915f82928a5" - integrity sha512-JpdMEfA15HZ/1gNuB9XEDlZM1h/gF/YOH7zaZzQu2xCFRfwc01NXBMHHSTT6hRjlXJJs5x/bfODM3LiCk94Sxg== +"@babel/plugin-transform-modules-commonjs@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.9.0.tgz#e3e72f4cbc9b4a260e30be0ea59bdf5a39748940" + integrity sha512-qzlCrLnKqio4SlgJ6FMMLBe4bySNis8DFn1VkGmOcxG9gqEyPIOzeQrA//u0HAKrWpJlpZbZMPB1n/OPa4+n8g== dependencies: - "@babel/helper-module-transforms" "^7.8.3" + "@babel/helper-module-transforms" "^7.9.0" "@babel/helper-plugin-utils" "^7.8.3" "@babel/helper-simple-access" "^7.8.3" babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-systemjs@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.8.3.tgz#d8bbf222c1dbe3661f440f2f00c16e9bb7d0d420" - integrity sha512-8cESMCJjmArMYqa9AO5YuMEkE4ds28tMpZcGZB/jl3n0ZzlsxOAi3mC+SKypTfT8gjMupCnd3YiXCkMjj2jfOg== +"@babel/plugin-transform-modules-systemjs@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.9.0.tgz#e9fd46a296fc91e009b64e07ddaa86d6f0edeb90" + integrity sha512-FsiAv/nao/ud2ZWy4wFacoLOm5uxl0ExSQ7ErvP7jpoihLR6Cq90ilOFyX9UXct3rbtKsAiZ9kFt5XGfPe/5SQ== dependencies: "@babel/helper-hoist-variables" "^7.8.3" - "@babel/helper-module-transforms" "^7.8.3" + "@babel/helper-module-transforms" "^7.9.0" "@babel/helper-plugin-utils" "^7.8.3" babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-umd@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.8.3.tgz#592d578ce06c52f5b98b02f913d653ffe972661a" - integrity sha512-evhTyWhbwbI3/U6dZAnx/ePoV7H6OUG+OjiJFHmhr9FPn0VShjwC2kdxqIuQ/+1P50TMrneGzMeyMTFOjKSnAw== +"@babel/plugin-transform-modules-umd@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.9.0.tgz#e909acae276fec280f9b821a5f38e1f08b480697" + integrity sha512-uTWkXkIVtg/JGRSIABdBoMsoIeoHQHPTL0Y2E7xf5Oj7sLqwVsNXOkNk0VJc7vF0IMBsPeikHxFjGe+qmwPtTQ== dependencies: - "@babel/helper-module-transforms" "^7.8.3" + "@babel/helper-module-transforms" "^7.9.0" "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-transform-named-capturing-groups-regex@^7.8.3": @@ -599,12 +663,11 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/helper-replace-supers" "^7.8.3" -"@babel/plugin-transform-parameters@^7.8.7": - version "7.8.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.8.7.tgz#66fa2f1de4129b4e0447509223ac71bda4955395" - integrity sha512-brYWaEPTRimOctz2NDA3jnBbDi7SVN2T4wYuu0aqSzxC3nozFZngGaw29CJ9ZPweB7k+iFmZuoG3IVPIcXmD2g== +"@babel/plugin-transform-parameters@^7.9.5": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.9.5.tgz#173b265746f5e15b2afe527eeda65b73623a0795" + integrity sha512-0+1FhHnMfj6lIIhVvS4KGQJeuhe1GI//h5uptK4PvLt+BGBxsoUJbd3/IW002yk//6sZPlFgsG1hY6OHLcy6kA== dependencies: - "@babel/helper-call-delegate" "^7.8.7" "@babel/helper-get-function-arity" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" @@ -674,12 +737,12 @@ "@babel/helper-create-regexp-features-plugin" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" -"@babel/preset-env@^7.8.7": - version "7.8.7" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.8.7.tgz#1fc7d89c7f75d2d70c2b6768de6c2e049b3cb9db" - integrity sha512-BYftCVOdAYJk5ASsznKAUl53EMhfBbr8CJ1X+AJLfGPscQkwJFiaV/Wn9DPH/7fzm2v6iRYJKYHSqyynTGw0nw== +"@babel/preset-env@^7.9.0": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.9.5.tgz#8ddc76039bc45b774b19e2fc548f6807d8a8919f" + integrity sha512-eWGYeADTlPJH+wq1F0wNfPbVS1w1wtmMJiYk55Td5Yu28AsdR9AsC97sZ0Qq8fHqQuslVSIYSGJMcblr345GfQ== dependencies: - "@babel/compat-data" "^7.8.6" + "@babel/compat-data" "^7.9.0" "@babel/helper-compilation-targets" "^7.8.7" "@babel/helper-module-imports" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" @@ -687,14 +750,16 @@ "@babel/plugin-proposal-dynamic-import" "^7.8.3" "@babel/plugin-proposal-json-strings" "^7.8.3" "@babel/plugin-proposal-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-proposal-object-rest-spread" "^7.8.3" + "@babel/plugin-proposal-numeric-separator" "^7.8.3" + "@babel/plugin-proposal-object-rest-spread" "^7.9.5" "@babel/plugin-proposal-optional-catch-binding" "^7.8.3" - "@babel/plugin-proposal-optional-chaining" "^7.8.3" + "@babel/plugin-proposal-optional-chaining" "^7.9.0" "@babel/plugin-proposal-unicode-property-regex" "^7.8.3" "@babel/plugin-syntax-async-generators" "^7.8.0" "@babel/plugin-syntax-dynamic-import" "^7.8.0" "@babel/plugin-syntax-json-strings" "^7.8.0" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0" + "@babel/plugin-syntax-numeric-separator" "^7.8.0" "@babel/plugin-syntax-object-rest-spread" "^7.8.0" "@babel/plugin-syntax-optional-catch-binding" "^7.8.0" "@babel/plugin-syntax-optional-chaining" "^7.8.0" @@ -703,24 +768,24 @@ "@babel/plugin-transform-async-to-generator" "^7.8.3" "@babel/plugin-transform-block-scoped-functions" "^7.8.3" "@babel/plugin-transform-block-scoping" "^7.8.3" - "@babel/plugin-transform-classes" "^7.8.6" + "@babel/plugin-transform-classes" "^7.9.5" "@babel/plugin-transform-computed-properties" "^7.8.3" - "@babel/plugin-transform-destructuring" "^7.8.3" + "@babel/plugin-transform-destructuring" "^7.9.5" "@babel/plugin-transform-dotall-regex" "^7.8.3" "@babel/plugin-transform-duplicate-keys" "^7.8.3" "@babel/plugin-transform-exponentiation-operator" "^7.8.3" - "@babel/plugin-transform-for-of" "^7.8.6" + "@babel/plugin-transform-for-of" "^7.9.0" "@babel/plugin-transform-function-name" "^7.8.3" "@babel/plugin-transform-literals" "^7.8.3" "@babel/plugin-transform-member-expression-literals" "^7.8.3" - "@babel/plugin-transform-modules-amd" "^7.8.3" - "@babel/plugin-transform-modules-commonjs" "^7.8.3" - "@babel/plugin-transform-modules-systemjs" "^7.8.3" - "@babel/plugin-transform-modules-umd" "^7.8.3" + "@babel/plugin-transform-modules-amd" "^7.9.0" + "@babel/plugin-transform-modules-commonjs" "^7.9.0" + "@babel/plugin-transform-modules-systemjs" "^7.9.0" + "@babel/plugin-transform-modules-umd" "^7.9.0" "@babel/plugin-transform-named-capturing-groups-regex" "^7.8.3" "@babel/plugin-transform-new-target" "^7.8.3" "@babel/plugin-transform-object-super" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.8.7" + "@babel/plugin-transform-parameters" "^7.9.5" "@babel/plugin-transform-property-literals" "^7.8.3" "@babel/plugin-transform-regenerator" "^7.8.7" "@babel/plugin-transform-reserved-words" "^7.8.3" @@ -730,13 +795,25 @@ "@babel/plugin-transform-template-literals" "^7.8.3" "@babel/plugin-transform-typeof-symbol" "^7.8.4" "@babel/plugin-transform-unicode-regex" "^7.8.3" - "@babel/types" "^7.8.7" - browserslist "^4.8.5" + "@babel/preset-modules" "^0.1.3" + "@babel/types" "^7.9.5" + browserslist "^4.9.1" core-js-compat "^3.6.2" invariant "^2.2.2" levenary "^1.1.1" semver "^5.5.0" +"@babel/preset-modules@^0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.3.tgz#13242b53b5ef8c883c3cf7dddd55b36ce80fbc72" + integrity sha512-Ra3JXOHBq2xd56xSF7lMKXdjBn3T772Y1Wet3yWnkDly9zHvJki029tAFzvAAK5cf4YV3yoxuP61crYRol6SVg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" + "@babel/plugin-transform-dotall-regex" "^7.4.4" + "@babel/types" "^7.4.4" + esutils "^2.0.2" + "@babel/runtime@^7.7.6": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.8.3.tgz#0811944f73a6c926bb2ad35e918dcc1bfab279f1" @@ -784,7 +861,7 @@ globals "^11.1.0" lodash "^4.17.13" -"@babel/traverse@^7.8.4", "@babel/traverse@^7.8.6": +"@babel/traverse@^7.8.6": version "7.8.6" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.8.6.tgz#acfe0c64e1cd991b3e32eae813a6eb564954b5ff" integrity sha512-2B8l0db/DPi8iinITKuo7cbPznLCEk0kCxDoB9/N6gGNg/gxOXiR/IcymAFPiBwk5w6TtQ27w4wpElgp9btR9A== @@ -799,6 +876,21 @@ globals "^11.1.0" lodash "^4.17.13" +"@babel/traverse@^7.9.0": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.9.5.tgz#6e7c56b44e2ac7011a948c21e283ddd9d9db97a2" + integrity sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ== + dependencies: + "@babel/code-frame" "^7.8.3" + "@babel/generator" "^7.9.5" + "@babel/helper-function-name" "^7.9.5" + "@babel/helper-split-export-declaration" "^7.8.3" + "@babel/parser" "^7.9.0" + "@babel/types" "^7.9.5" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.13" + "@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.8.3.tgz#5a383dffa5416db1b73dedffd311ffd0788fb31c" @@ -808,6 +900,15 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@babel/types@^7.4.4", "@babel/types@^7.9.0", "@babel/types@^7.9.5": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.9.5.tgz#89231f82915a8a566a703b3b20133f73da6b9444" + integrity sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg== + dependencies: + "@babel/helper-validator-identifier" "^7.9.5" + lodash "^4.17.13" + to-fast-properties "^2.0.0" + "@babel/types@^7.8.6", "@babel/types@^7.8.7": version "7.8.7" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.8.7.tgz#1fc9729e1acbb2337d5b6977a63979b4819f5d1d" @@ -3989,6 +4090,13 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" +json5@^2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.3.tgz#c9b0f7fa9233bfe5807fe66fcf3a5617ed597d43" + integrity sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA== + dependencies: + minimist "^1.2.5" + jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" @@ -5068,6 +5176,13 @@ regenerate-unicode-properties@^8.1.0: dependencies: regenerate "^1.4.0" +regenerate-unicode-properties@^8.2.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz#e5de7111d655e7ba60c057dbe9ff37c87e65cdec" + integrity sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA== + dependencies: + regenerate "^1.4.0" + regenerate@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" @@ -5121,6 +5236,18 @@ regexpu-core@^4.6.0: unicode-match-property-ecmascript "^1.0.4" unicode-match-property-value-ecmascript "^1.1.0" +regexpu-core@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.7.0.tgz#fcbf458c50431b0bb7b45d6967b8192d91f3d938" + integrity sha512-TQ4KXRnIn6tz6tjnrXEkD/sshygKH/j5KzK86X8MkeHyZ8qst/LZ89j3X4/8HEIfHANTFIP/AbXakeRhWIl5YQ== + dependencies: + regenerate "^1.4.0" + regenerate-unicode-properties "^8.2.0" + regjsgen "^0.5.1" + regjsparser "^0.6.4" + unicode-match-property-ecmascript "^1.0.4" + unicode-match-property-value-ecmascript "^1.2.0" + registry-auth-token@^3.0.1: version "3.4.0" resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.4.0.tgz#d7446815433f5d5ed6431cd5dca21048f66b397e" @@ -5136,7 +5263,7 @@ registry-url@^3.0.3: dependencies: rc "^1.0.1" -regjsgen@^0.5.0: +regjsgen@^0.5.0, regjsgen@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.1.tgz#48f0bf1a5ea205196929c0d9798b42d1ed98443c" integrity sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg== @@ -5148,6 +5275,13 @@ regjsparser@^0.6.0: dependencies: jsesc "~0.5.0" +regjsparser@^0.6.4: + version "0.6.4" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.4.tgz#a769f8684308401a66e9b529d2436ff4d0666272" + integrity sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw== + dependencies: + jsesc "~0.5.0" + remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" @@ -6257,6 +6391,11 @@ unicode-match-property-value-ecmascript@^1.1.0: resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz#5b4b426e08d13a80365e0d657ac7a6c1ec46a277" integrity sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g== +unicode-match-property-value-ecmascript@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz#0d91f600eeeb3096aa962b1d6fc88876e64ea531" + integrity sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ== + unicode-property-aliases-ecmascript@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz#a9cc6cc7ce63a0a3023fc99e341b94431d405a57" From 19b41d9c22e4496cbab62d0069a629fc3bfad178 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Sun, 19 Apr 2020 17:29:37 +0200 Subject: [PATCH 03/46] Allow to include own style(s) into HTML produced by CLI Resolves #6 --- packages/ipynb2html-cli/src/cli.ts | 38 +++++++++++++++++++++++------ packages/ipynb2html-cli/src/page.ts | 14 ++++++----- 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/packages/ipynb2html-cli/src/cli.ts b/packages/ipynb2html-cli/src/cli.ts index d7d0f6f..78c640d 100644 --- a/packages/ipynb2html-cli/src/cli.ts +++ b/packages/ipynb2html-cli/src/cli.ts @@ -3,7 +3,7 @@ import minimist from 'minimist' import minimistOptions from 'minimist-options' import { Document } from 'nodom' import { exit } from 'process' -import { $INLINE_JSON } from 'ts-transformer-inline-file' +import { $INLINE_FILE, $INLINE_JSON } from 'ts-transformer-inline-file' import * as ipynb2html from 'ipynb2html' @@ -11,6 +11,8 @@ import renderPage from './page' const { version, bugs: bugsUrl } = $INLINE_JSON('../package.json') +const notebookCss = $INLINE_FILE('../../ipynb2html/styles/notebook.css') +const pageCss = $INLINE_FILE('./page.css') const progName = 'ipynb2html' const helpMsg = `\ @@ -24,13 +26,20 @@ Arguments: provided, the output will be written to STDOUT. Options: - -d --debug Print debug messages. - -h --help Show this message and exit. - -V --version Print version and exit. + -d --debug Print debug messages. + + -s --style Comma separated stylesheet(s) to embed into the output + HTML. The stylesheet may be a path to a CSS file, + "@base" for the base ipynb2html style, or "@default" + for the default full page style. Default is @default. + + -h --help Show this message and exit. + + -V --version Print version and exit. Exit Codes: - 1 Generic error code. - 2 Missing required arguments or invalid option. + 1 Generic error code. + 2 Missing required arguments or invalid option. Please report bugs at <${bugsUrl}>. ` @@ -39,9 +48,14 @@ function logErr (msg: string): void { console.error(`${progName}: ${msg}`) } +function arrify (obj: T | T[]): T[] { + return Array.isArray(obj) ? obj : [obj] +} + function parseCliArgs (argv: string[]) { const opts = minimist(argv, minimistOptions({ debug: { alias: 'd', type: 'boolean' }, + style: { alias: 's', type: 'string', default: '@default' }, version: { alias: 'V', type: 'boolean' }, help: { alias: 'h', type: 'boolean' }, arguments: 'string', @@ -73,24 +87,34 @@ function parseCliArgs (argv: string[]) { const [input, output] = opts._ return { + styles: arrify(opts.style).join(',').split(/,\s*/), debug: opts.debug as boolean, input: input === '-' ? 0 : input, // 0 = stdin output, } } +function loadStyle (name: string): string { + switch (name) { + case '@base': return notebookCss + case '@default': return pageCss + notebookCss + default: return fs.readFileSync(name, 'utf8') + } +} + export default (argv: string[]): void => { const opts = parseCliArgs(argv) try { const notebook = JSON.parse(fs.readFileSync(opts.input, 'utf-8')) + const style = opts.styles.map(loadStyle).join('\n') const title = ipynb2html.readNotebookTitle(notebook) ?? 'Notebook' const renderNotebook = ipynb2html.createRenderer(new Document()) const contents = renderNotebook(notebook).outerHTML - const html = renderPage(contents, title) + const html = renderPage({ contents, title, style }) if (opts.output) { fs.writeFileSync(opts.output, html) diff --git a/packages/ipynb2html-cli/src/page.ts b/packages/ipynb2html-cli/src/page.ts index ad8083e..8552e4c 100644 --- a/packages/ipynb2html-cli/src/page.ts +++ b/packages/ipynb2html-cli/src/page.ts @@ -1,11 +1,13 @@ import { version } from 'ipynb2html' -import { $INLINE_FILE } from 'ts-transformer-inline-file' - -const notebookCss = $INLINE_FILE('../../ipynb2html/styles/notebook.css') -const pageCss = $INLINE_FILE('./page.css') -export default (contents: string, title: string): string => `\ +export type Options = { + contents: string, + title: string, + style: string, +} + +export default ({ contents, title, style }: Options): string => `\ @@ -22,7 +24,7 @@ export default (contents: string, title: string): string => `\ integrity="sha384-BdGj8xC2eZkQaxoQ8nSLefg4AV4/AwB3Fj+8SUSo7pnKP6Eoy18liIKTPn9oBYNG" crossorigin="anonymous"> From 3a312385f604167027010f92687b0ffe8c04e043 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Sun, 19 Apr 2020 18:50:36 +0200 Subject: [PATCH 04/46] Wrap cells in
instead of
--- packages/ipynb2html-core/src/renderer.ts | 6 +++--- packages/ipynb2html-core/test/renderer.test.tsx | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/ipynb2html-core/src/renderer.ts b/packages/ipynb2html-core/src/renderer.ts index 9914444..494148b 100644 --- a/packages/ipynb2html-core/src/renderer.ts +++ b/packages/ipynb2html-core/src/renderer.ts @@ -165,11 +165,11 @@ class NbRenderer extends CallableInstance> { } renderMarkdownCell (cell: MarkdownCell, _notebook: Notebook): TElement { - return this.el('div', ['cell', 'markdown-cell'], this.renderMarkdown(joinText(cell.source))) + return this.el('section', ['cell', 'markdown-cell'], this.renderMarkdown(joinText(cell.source))) } renderRawCell (cell: RawCell, _notebook: Notebook): TElement { - return this.el('div', ['cell', 'raw-cell'], joinText(cell.source)) + return this.el('section', ['cell', 'raw-cell'], joinText(cell.source)) } renderCodeCell (cell: CodeCell, notebook: Notebook): TElement { @@ -180,7 +180,7 @@ class NbRenderer extends CallableInstance> { const outputs = coalesceStreams(cell.outputs ?? []) .map(output => this.renderOutput(output, cell)) - return this.el('div', ['cell', 'code-cell'], [source, ...outputs]) + return this.el('section', ['cell', 'code-cell'], [source, ...outputs]) } renderSource (cell: CodeCell, notebook: Notebook): TElement { diff --git a/packages/ipynb2html-core/test/renderer.test.tsx b/packages/ipynb2html-core/test/renderer.test.tsx index 3618204..352e8a6 100644 --- a/packages/ipynb2html-core/test/renderer.test.tsx +++ b/packages/ipynb2html-core/test/renderer.test.tsx @@ -102,11 +102,11 @@ describe('built renderer', () => { eachMultilineVariant(fixtures.MarkdownCell, 'source', (cell) => { const source = join(cell.source) - it('returns div.cell.markdown-cell with the $source converted using markdownRenderer() as content', () => { + it('returns section.cell.markdown-cell with the $source converted using markdownRenderer() as content', () => { expect( renderer.renderMarkdownCell(cell, notebook) ).toHtmlEqual( -
+
{{__html: mockLastResult(markdownRenderer) }} -
+
) expect( markdownRenderer ).toBeCalledWith(source) }) @@ -117,11 +117,11 @@ describe('built renderer', () => { describe('.renderRawCell', () => { eachMultilineVariant(fixtures.RawCell, 'source', (cell) => { - it('returns div.cell.raw-cell with the $source as content', () => { + it('returns section.cell.raw-cell with the $source as content', () => { expect( renderer.renderRawCell(cell, notebook) ).toHtmlEqual( -
+
{{__html: join(cell.source) }} -
+ ) }) }) @@ -139,9 +139,9 @@ describe('built renderer', () => { result = renderer.renderCodeCell(cell, notebook) }) - it('returns div.cell.code-cell', () => { + it('returns section.cell.code-cell', () => { expect( result ).toMatchElement( -
+
) }) From e4549711f100bc3eeef24392068f486e5b96330f Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Sun, 19 Apr 2020 19:09:39 +0200 Subject: [PATCH 05/46] Fix font-size of

inside
See https://stackoverflow.com/a/26291186/2217862. --- packages/ipynb2html-cli/src/page.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/ipynb2html-cli/src/page.css b/packages/ipynb2html-cli/src/page.css index 51c1677..a6e45d7 100644 --- a/packages/ipynb2html-cli/src/page.css +++ b/packages/ipynb2html-cli/src/page.css @@ -15,6 +15,9 @@ h1, h2, h3, h4, h5, h6 { margin-top: 1.6em; position: relative; } +h1 { + font-size: 2em; +} h1 .anchor, h2 .anchor, From 1d9ce38eb4db0622ee7f2d99266809e204696c34 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Sun, 26 Apr 2020 18:10:41 +0200 Subject: [PATCH 06/46] Bump @types/marked from ^0.7.2 to ^0.7.4 --- package.json | 2 +- patches/@types+marked+0.7.2.patch | 38 ------------------------------- yarn.lock | 8 +++---- 3 files changed, 5 insertions(+), 43 deletions(-) delete mode 100644 patches/@types+marked+0.7.2.patch diff --git a/package.json b/package.json index fdbf309..64e6c7f 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@types/highlight.js": "^9.12.3", "@types/jest": "^24.9.0", "@types/katex": "^0.11.0", - "@types/marked": "^0.7.2", + "@types/marked": "^0.7.4", "@types/node": "^10.13.0", "@typescript-eslint/eslint-plugin": "^2.17.0", "@typescript-eslint/parser": "^2.17.0", diff --git a/patches/@types+marked+0.7.2.patch b/patches/@types+marked+0.7.2.patch deleted file mode 100644 index 981c8a0..0000000 --- a/patches/@types+marked+0.7.2.patch +++ /dev/null @@ -1,38 +0,0 @@ -Remove after https://github.com/DefinitelyTyped/DefinitelyTyped/pull/43732 -is merged and released. - -diff --git a/node_modules/@types/marked/index.d.ts b/node_modules/@types/marked/index.d.ts -index e89b2cf..2dc01dc 100644 ---- a/node_modules/@types/marked/index.d.ts -+++ b/node_modules/@types/marked/index.d.ts -@@ -129,8 +129,8 @@ declare namespace marked { - codespan(code: string): string; - br(): string; - del(text: string): string; -- link(href: string, title: string, text: string): string; -- image(href: string, title: string, text: string): string; -+ link(href: string | null, title: string | null, text: string): string; -+ image(href: string | null, title: string | null, text: string): string; - text(text: string): string; - } - -@@ -140,8 +140,8 @@ declare namespace marked { - codespan(text: string): string; - del(text: string): string; - text(text: string): string; -- link(href: string, title: string, text: string): string; -- image(href: string, title: string, text: string): string; -+ link(href: string | null, title: string | null, text: string): string; -+ image(href: string | null, title: string | null, text: string): string; - br(): string; - } - -@@ -182,7 +182,7 @@ declare namespace marked { - - type TokensList = Token[] & { - links: { -- [key: string]: { href: string; title: string; } -+ [key: string]: { href: string | null; title: string | null; } - } - }; - diff --git a/yarn.lock b/yarn.lock index 277d6ca..5a6590f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1255,10 +1255,10 @@ resolved "https://registry.yarnpkg.com/@types/katex/-/katex-0.11.0.tgz#b16c54ee670925ffef0616beae9e90c557e17334" integrity sha512-27BfE8zASRLYfSBNMk5/+KIjr2CBBrH0i5lhsO04fca4TGirIIMay73v3zNkzqmsaeIa/Mi5kejWDcxPLAmkvA== -"@types/marked@^0.7.2": - version "0.7.2" - resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.7.2.tgz#1393f076773b55cc7078c0fbeb86a497c69db97e" - integrity sha512-A3EDyNaq6OCcpaOia2HQ/tu2QYt8DKuj4ExP21VU3cU3HTo2FLslvbqa2T1vux910RHvuSVqpwKnnykSFcRWOA== +"@types/marked@^0.7.4": + version "0.7.4" + resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.7.4.tgz#607685669bb1bbde2300bc58ba43486cbbee1f0a" + integrity sha512-fdg0NO4qpuHWtZk6dASgsrBggY+8N4dWthl1bAQG9ceKUNKFjqpHaDKCAhRUI6y8vavG7hLSJ4YBwJtZyZEXqw== "@types/minimist@^1.2.0": version "1.2.0" From 9685b5d8b8f032c8718f3d09ba27063018982455 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Mon, 15 Jun 2020 18:06:20 +0200 Subject: [PATCH 07/46] Bump marked to 1.0.0 The latest version is 1.1.0 but they changed rendering of img from `` to `` which breaks our tests. --- README.adoc | 2 +- examples/bundle.html | 2 +- packages/ipynb2html/package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.adoc b/README.adoc index f731df7..bb1cac8 100644 --- a/README.adoc +++ b/README.adoc @@ -6,7 +6,7 @@ :ansiup-version: 4.0.4 :hljs-version: 9.15.10 :katex-version: 0.11.1 -:marked-version: 0.7.0 +:marked-version: 1.0.0 :vs-marketplace-uri: https://marketplace.visualstudio.com/items?itemName= ifdef::env-github[] diff --git a/examples/bundle.html b/examples/bundle.html index 82f7a1e..5950a11 100644 --- a/examples/bundle.html +++ b/examples/bundle.html @@ -13,7 +13,7 @@ rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.15.10/build/styles/default.min.css" crossorigin="anonymous"> - + diff --git a/packages/ipynb2html/package.json b/packages/ipynb2html/package.json index 0455154..0295e87 100644 --- a/packages/ipynb2html/package.json +++ b/packages/ipynb2html/package.json @@ -47,7 +47,7 @@ "highlight.js": "^9.18.1", "ipynb2html-core": "0.2.1", "katex": "^0.11.1", - "marked": "^0.8.2" + "marked": "^1.0.0" }, "peerDependencies": { "nodom": "^2.3.0" diff --git a/yarn.lock b/yarn.lock index 5a6590f..5589d6c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4352,10 +4352,10 @@ markdown-table@1.1.3: resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.3.tgz#9fcb69bcfdb8717bfd0398c6ec2d93036ef8de60" integrity sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q== -marked@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/marked/-/marked-0.8.2.tgz#4faad28d26ede351a7a1aaa5fec67915c869e355" - integrity sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw== +marked@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/marked/-/marked-1.1.0.tgz#62504ad4d11550c942935ccc5e39d64e5a4c4e50" + integrity sha512-EkE7RW6KcXfMHy2PA7Jg0YJE1l8UPEZE8k45tylzmZM30/r1M1MUXWQfJlrSbsTeh7m/XTwHbWUENvAJZpp1YA== mdn-data@2.0.4: version "2.0.4" From 76c9a1e67fb8be4fc855e8f8a6eaac76284453b5 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Mon, 15 Jun 2020 18:08:57 +0200 Subject: [PATCH 08/46] Bump node-html-parser from ^1.2.14 to ^1.2.19 --- package.json | 2 +- patches/node-html-parser+1.2.14.patch | 25 ------------------------- yarn.lock | 8 ++++---- 3 files changed, 5 insertions(+), 30 deletions(-) delete mode 100644 patches/node-html-parser+1.2.14.patch diff --git a/package.json b/package.json index 64e6c7f..fbb9e6e 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "fs-extra": "^8.1.0", "jest": "^25.1.0", "jest-chain": "^1.1.2", - "node-html-parser": "^1.2.14", + "node-html-parser": "^1.2.19", "nodom": "^2.3.0", "npm-run-all": "^4.1.5", "patch-package": "^6.2.0", diff --git a/patches/node-html-parser+1.2.14.patch b/patches/node-html-parser+1.2.14.patch deleted file mode 100644 index d6558c7..0000000 --- a/patches/node-html-parser+1.2.14.patch +++ /dev/null @@ -1,25 +0,0 @@ -Remove after https://github.com/taoqf/node-html-parser/pull/39 -is merged and released. - -diff --git a/node_modules/node-html-parser/dist/nodes/html.js b/node_modules/node-html-parser/dist/nodes/html.js -index a3c33b1..8b4c2b2 100644 ---- a/node_modules/node-html-parser/dist/nodes/html.js -+++ b/node_modules/node-html-parser/dist/nodes/html.js -@@ -176,15 +176,11 @@ var HTMLElement = /** @class */ (function (_super) { - HTMLElement.prototype.toString = function () { - var tag = this.tagName; - if (tag) { -- var is_un_closed = /^meta$/i.test(tag); -- var is_self_closed = /^(img|br|hr|area|base|input|doctype|link)$/i.test(tag); -+ const is_void = /^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/i.test(tag); - var attrs = this.rawAttrs ? ' ' + this.rawAttrs : ''; -- if (is_un_closed) { -+ if (is_void) { - return "<" + tag + attrs + ">"; - } -- else if (is_self_closed) { -- return "<" + tag + attrs + " />"; -- } - else { - return "<" + tag + attrs + ">" + this.innerHTML + ""; - } diff --git a/yarn.lock b/yarn.lock index 5589d6c..0ee5196 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4532,10 +4532,10 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== -node-html-parser@^1.2.14: - version "1.2.14" - resolved "https://registry.yarnpkg.com/node-html-parser/-/node-html-parser-1.2.14.tgz#5570fe4ad03744f80dde3b470aa980fefc6893a1" - integrity sha512-Jzdpk6xrZGgR4zB2L85uPvcGN9Z667RxN5mS9RHpv7I0ACcNOS3x8dbKMkQrKMl6N4+xveuQNfxXL4RZRib7Mw== +node-html-parser@^1.2.19: + version "1.2.19" + resolved "https://registry.yarnpkg.com/node-html-parser/-/node-html-parser-1.2.19.tgz#2cb14ce7981dfe2c0f5af53cf8654a3d49cded7d" + integrity sha512-MQvBz+qk7SbqNPp0c7hR0F8lRTPXK5n2tww4eFmXf+cXp5hZHtL5rJHlAWlcjzRep+T5Pd5lz3lqFgN7IFYEiw== dependencies: he "1.1.1" From d9bea2feb2a995319d5f6e8bf14fc59f9d4867bc Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Wed, 17 Jun 2020 00:34:52 +0200 Subject: [PATCH 09/46] Bump highlight.js to 10.1.1 --- README.adoc | 2 +- examples/bundle-full.html | 2 +- examples/bundle.html | 4 ++-- package.json | 2 +- packages/ipynb2html-cli/src/page.ts | 4 ++-- packages/ipynb2html/package.json | 2 +- .../ipynb2html/test/markdownRenderer.test.tsx | 6 ++++-- yarn.lock | 16 ++++++++-------- 8 files changed, 20 insertions(+), 18 deletions(-) diff --git a/README.adoc b/README.adoc index bb1cac8..ecedd64 100644 --- a/README.adoc +++ b/README.adoc @@ -4,7 +4,7 @@ :gh-branch: master :version: 0.2.1 :ansiup-version: 4.0.4 -:hljs-version: 9.15.10 +:hljs-version: 10.1.1 :katex-version: 0.11.1 :marked-version: 1.0.0 :vs-marketplace-uri: https://marketplace.visualstudio.com/items?itemName= diff --git a/examples/bundle-full.html b/examples/bundle-full.html index 0778c40..a9d97f0 100644 --- a/examples/bundle-full.html +++ b/examples/bundle-full.html @@ -11,7 +11,7 @@ crossorigin="anonymous">