From a4e6e4186ae010af16098d9a1931b7d4d132fd61 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Tue, 16 Jun 2020 21:04:07 +0200 Subject: [PATCH 01/28] replace highlightjs with prismjs --- package.json | 3 +- scm-ui/eslint-config/package.json | 2 +- scm-ui/ui-components/package.json | 5 +- .../ui-components/src/SyntaxHighlighter.tsx | 7 +- .../src/repos/TokenizedDiffView.tsx | 18 +++++- .../src/repos/annotate/Annotate.tsx | 7 +- .../src/repos/refractorAdapter.ts | 22 ++----- scm-ui/ui-plugins/package.json | 2 +- yarn.lock | 64 ++++++++++++++----- 9 files changed, 85 insertions(+), 45 deletions(-) diff --git a/package.json b/package.json index 35682ca3de..907484ede3 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "resolutions": { "babel-core": "7.0.0-bridge.0", "gitdiff-parser": "https://github.com/scm-manager/gitdiff-parser#617747460280bf4522bb84d217a9064ac8eb6d3d", - "lowlight": "1.13.1" + "refractor": "3.0.0", + "prismjs": "1.20.0" }, "babel": { "presets": [ diff --git a/scm-ui/eslint-config/package.json b/scm-ui/eslint-config/package.json index b4823af85e..eecd993c1e 100644 --- a/scm-ui/eslint-config/package.json +++ b/scm-ui/eslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/eslint-config", - "version": "2.0.0", + "version": "2.1.0-SNAPSHOT", "description": "ESLint configuration for scm-manager and its plugins", "main": "src/index.js", "author": "Sebastian Sdorra ", diff --git a/scm-ui/ui-components/package.json b/scm-ui/ui-components/package.json index e5d82f9617..68d2de41a6 100644 --- a/scm-ui/ui-components/package.json +++ b/scm-ui/ui-components/package.json @@ -33,6 +33,7 @@ "@types/react-router-dom": "^5.1.0", "@types/react-select": "^2.0.19", "@types/react-syntax-highlighter": "^11.0.1", + "@types/refractor": "^2.8.0", "@types/storybook__addon-storyshots": "^5.1.1", "@types/styled-components": "^5.1.0", "enzyme-context": "^1.1.2", @@ -52,6 +53,7 @@ "date-fns": "^2.4.1", "gitdiff-parser": "^0.1.2", "lowlight": "^1.13.0", + "prism-themes": "^1.4.0", "query-string": "5", "react": "^16.8.6", "react-diff-view": "^2.4.1", @@ -60,7 +62,8 @@ "react-markdown": "^4.0.6", "react-router-dom": "^5.1.2", "react-select": "^2.1.2", - "react-syntax-highlighter": "https://github.com/conorhastings/react-syntax-highlighter#08bcf49b1aa7877ce94f7208e73dfa6bef8b26e7" + "react-syntax-highlighter": "https://github.com/conorhastings/react-syntax-highlighter#08bcf49b1aa7877ce94f7208e73dfa6bef8b26e7", + "refractor": "^3.0.0" }, "babel": { "presets": [ diff --git a/scm-ui/ui-components/src/SyntaxHighlighter.tsx b/scm-ui/ui-components/src/SyntaxHighlighter.tsx index bcbf05d53d..84f1458db5 100644 --- a/scm-ui/ui-components/src/SyntaxHighlighter.tsx +++ b/scm-ui/ui-components/src/SyntaxHighlighter.tsx @@ -23,9 +23,8 @@ */ import React from "react"; -import { LightAsync as ReactSyntaxHighlighter } from "react-syntax-highlighter"; -// @ts-ignore -import { arduinoLight } from "react-syntax-highlighter/dist/cjs/styles/hljs"; +import { PrismAsyncLight as ReactSyntaxHighlighter } from "react-syntax-highlighter"; +import { ghcolors } from "react-syntax-highlighter/dist/esm/styles/prism"; type Props = { language?: string; @@ -50,7 +49,7 @@ class SyntaxHighlighter extends React.Component { render() { const language = this.getLanguage(); return ( - + {this.props.value} ); diff --git a/scm-ui/ui-components/src/repos/TokenizedDiffView.tsx b/scm-ui/ui-components/src/repos/TokenizedDiffView.tsx index c012742dbd..3f004272f8 100644 --- a/scm-ui/ui-components/src/repos/TokenizedDiffView.tsx +++ b/scm-ui/ui-components/src/repos/TokenizedDiffView.tsx @@ -29,7 +29,7 @@ import { File } from "./DiffTypes"; // styling for the diff tokens // this must be aligned with th style, which is used in the SyntaxHighlighter component -import "highlight.js/styles/arduino-light.css"; +import "prism-themes/themes/prism-ghcolors.css"; const DiffView = styled(Diff)` /* align line numbers */ @@ -58,6 +58,22 @@ const DiffView = styled(Diff)` &.unified .diff-widget-content .is-indented-line { padding-left: 6.5rem; } + + /* conflict between prism and bulma number class */ + .number { + align-items: inherit; + background-color: inherit; + border-radius: inherit; + display: initial; + font-size: inherit; + height: inherit; + justify-content: inherit; + margin-right: inherit; + margin-left: 0; + min-width: inherit; + padding: 0; + text-align: inherit; + } `; // WebWorker which creates tokens for syntax highlighting diff --git a/scm-ui/ui-components/src/repos/annotate/Annotate.tsx b/scm-ui/ui-components/src/repos/annotate/Annotate.tsx index b7a67a6d8d..0a0a871891 100644 --- a/scm-ui/ui-components/src/repos/annotate/Annotate.tsx +++ b/scm-ui/ui-components/src/repos/annotate/Annotate.tsx @@ -24,10 +24,9 @@ import React, { FC, useReducer } from "react"; import { Repository, AnnotatedSource, AnnotatedLine } from "@scm-manager/ui-types"; - // @ts-ignore -import { LightAsync as ReactSyntaxHighlighter, createElement } from "react-syntax-highlighter"; -import { arduinoLight } from "react-syntax-highlighter/dist/cjs/styles/hljs"; +import { PrismAsyncLight as ReactSyntaxHighlighter, createElement } from "react-syntax-highlighter"; +import { ghcolors } from "react-syntax-highlighter/dist/esm/styles/prism"; import { DateInput } from "../../dates"; import Popover from "./Popover"; import AnnotateLine from "./AnnotateLine"; @@ -145,7 +144,7 @@ const Annotate: FC = ({ source, repository, baseDate }) => { {code} diff --git a/scm-ui/ui-components/src/repos/refractorAdapter.ts b/scm-ui/ui-components/src/repos/refractorAdapter.ts index acb56fa396..0bac53e4d2 100644 --- a/scm-ui/ui-components/src/repos/refractorAdapter.ts +++ b/scm-ui/ui-components/src/repos/refractorAdapter.ts @@ -22,16 +22,11 @@ * SOFTWARE. */ -import lowlight from "lowlight/lib/core"; - -// adapter to let lowlight look like refractor -// this is required because react-diff-view does only support refractor, -// but we want same highlighting as in the source code browser. +import refractor from "refractor/core"; const isLanguageRegistered = (lang: string) => { - // @ts-ignore listLanguages seems unknown to type - const registeredLanguages = lowlight.listLanguages(); - return !!registeredLanguages[lang]; + const registeredLanguages = refractor.listLanguages(); + return registeredLanguages.includes(lang); }; const loadLanguage = (lang: string, callback: () => void) => { @@ -39,22 +34,19 @@ const loadLanguage = (lang: string, callback: () => void) => { callback(); } else { import( - /* webpackChunkName: "tokenizer-lowlight-[request]" */ - `highlight.js/lib/languages/${lang}` + /* webpackChunkName: "tokenizer-refractor-[request]" */ + `refractor/lang/${lang}` ).then(loadedLanguage => { - lowlight.registerLanguage(lang, loadedLanguage.default); + refractor.register(loadedLanguage.default); callback(); }); } }; const refractorAdapter = { - ...lowlight, isLanguageRegistered, loadLanguage, - highlight: (value: string, language: string) => { - return lowlight.highlight(language, value).value; - } + ...refractor }; export default refractorAdapter; diff --git a/scm-ui/ui-plugins/package.json b/scm-ui/ui-plugins/package.json index 3b49f342f7..14e3dffdad 100644 --- a/scm-ui/ui-plugins/package.json +++ b/scm-ui/ui-plugins/package.json @@ -19,7 +19,7 @@ }, "devDependencies": { "@scm-manager/babel-preset": "^2.0.0", - "@scm-manager/eslint-config": "^2.0.0", + "@scm-manager/eslint-config": "^2.1.0-SNAPSHOT", "@scm-manager/jest-preset": "^2.0.0", "@scm-manager/prettier-config": "^2.0.0", "@scm-manager/tsconfig": "^2.0.0", diff --git a/yarn.lock b/yarn.lock index 2b7e82ef4d..e9c1859ab6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3191,6 +3191,11 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.0.1.tgz#b6e98083f13faa1e5231bfa3bdb1b0feff536b6d" integrity sha512-boy4xPNEtiw6N3abRhBi/e7hNvy3Tt8E9ZRAQrwAGzoCGZS/1wjo9KY7JHhnfnEsG5wSjDbymCozUM9a3ea7OQ== +"@types/prismjs@*": + version "1.16.1" + resolved "https://registry.yarnpkg.com/@types/prismjs/-/prismjs-1.16.1.tgz#50b82947207847db6abcbcd14caa89e3b897c259" + integrity sha512-RNgcK3FEc1GpeOkamGDq42EYkb6yZW5OWQwTS56NJIB8WL0QGISQglA7En7NUx9RGP8AC52DOe+squqbAckXlA== + "@types/prop-types@*": version "15.7.3" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" @@ -3291,6 +3296,13 @@ "@types/prop-types" "*" csstype "^2.2.0" +"@types/refractor@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@types/refractor/-/refractor-2.8.0.tgz#2e17b69f27e89c1ea076f49b599abe3567c54e01" + integrity sha512-l3wSB96RFZnvB8bnbF8UmYsDD1MQl+u7jtYq+DgI/vo3RD5pdbK3OitGEvMO3DNJhTYmCEhXLVWyyWTddzwNzQ== + dependencies: + "@types/prismjs" "*" + "@types/source-list-map@*": version "0.1.2" resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9" @@ -7488,7 +7500,7 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= -fault@^1.0.0: +fault@^1.0.0, fault@^1.0.2: version "1.0.4" resolved "https://registry.yarnpkg.com/fault/-/fault-1.0.4.tgz#eafcfc0a6d214fc94601e170df29954a4f842f13" integrity sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA== @@ -10823,7 +10835,7 @@ lower-case@^2.0.1: dependencies: tslib "^1.10.0" -lowlight@1.13.1, lowlight@^1.13.0, lowlight@~1.11.0: +lowlight@^1.13.0: version "1.13.1" resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.13.1.tgz#c4f0e03906ebd23fedf2d258f6ab2f6324cf90eb" integrity sha512-kQ71/T6RksEVz9AlPq07/2m+SU/1kGvt9k39UtvHX760u4SaWakaYH7hYgH5n6sTsCWk4MVYzUzLU59aN5CSmQ== @@ -10831,6 +10843,14 @@ lowlight@1.13.1, lowlight@^1.13.0, lowlight@~1.11.0: fault "^1.0.0" highlight.js "~9.16.0" +lowlight@~1.11.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.11.0.tgz#1304d83005126d4e8b1dc0f07981e9b689ec2efc" + integrity sha512-xrGGN6XLL7MbTMdPD6NfWPwY43SNkjf/d0mecSx/CW36fUZTjRHEq0/Cdug3TWKtRXLWi7iMl1eP0olYxj/a4A== + dependencies: + fault "^1.0.2" + highlight.js "~9.13.0" + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -12175,7 +12195,7 @@ parse-asn1@^5.0.0, parse-asn1@^5.1.5: pbkdf2 "^3.0.3" safe-buffer "^5.1.1" -parse-entities@^1.1.0, parse-entities@^1.1.2: +parse-entities@^1.1.0: version "1.2.2" resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.2.2.tgz#c31bf0f653b6661354f8973559cb86dd1d5edf50" integrity sha512-NzfpbxW/NPrzZ/yYSoQxyqUZMZXIdCfE0OIN4ESsnptHJECoUk3FZktxNuzQf4tjt5UEopnxpYJbvYuxIFDdsg== @@ -12187,6 +12207,18 @@ parse-entities@^1.1.0, parse-entities@^1.1.2: is-decimal "^1.0.0" is-hexadecimal "^1.0.0" +parse-entities@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-2.0.0.tgz#53c6eb5b9314a1f4ec99fa0fdf7ce01ecda0cbe8" + integrity sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ== + dependencies: + character-entities "^1.0.0" + character-entities-legacy "^1.0.0" + character-reference-invalid "^1.0.0" + is-alphanumerical "^1.0.0" + is-decimal "^1.0.0" + is-hexadecimal "^1.0.0" + parse-github-repo-url@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz#9e7d8bb252a6cb6ba42595060b7bf6df3dbc1f50" @@ -12910,20 +12942,18 @@ pretty-hrtime@^1.0.3: resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= -prismjs@^1.16.0, prismjs@^1.8.4: +prism-themes@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/prism-themes/-/prism-themes-1.4.0.tgz#2f93a33450532577c7962928655d7b4305fa843d" + integrity sha512-VTy6t69sS1FavspBsodoF/x/eduPydUXyZH+++Jkun0VQ4X7lCZVvsfGsYKzkUan2PJNcV2mA4lAFcr7KKXD1g== + +prismjs@1.20.0, prismjs@^1.16.0, prismjs@^1.8.4, prismjs@~1.20.0: version "1.20.0" resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.20.0.tgz#9b685fc480a3514ee7198eac6a3bf5024319ff03" integrity sha512-AEDjSrVNkynnw6A+B1DsFkd6AVdTnp+/WoUixFRULlCLZVRZlVQMVWio/16jv7G1FscUxQxOQhWwApgbnxr6kQ== optionalDependencies: clipboard "^2.0.0" -prismjs@~1.17.0: - version "1.17.1" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.17.1.tgz#e669fcbd4cdd873c35102881c33b14d0d68519be" - integrity sha512-PrEDJAFdUGbOP6xK/UsfkC5ghJsPJviKgnQOoxaDbBjwc8op68Quupwt1DeAFoG8GImPhiKXAvvsH7wDSLsu1Q== - optionalDependencies: - clipboard "^2.0.0" - private@^0.1.8, private@~0.1.5: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" @@ -13847,14 +13877,14 @@ reflect.ownkeys@^0.2.0: resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460" integrity sha1-dJrO7H8/34tj+SegSAnpDFwLNGA= -refractor@^2.10.1, refractor@^2.4.1: - version "2.10.1" - resolved "https://registry.yarnpkg.com/refractor/-/refractor-2.10.1.tgz#166c32f114ed16fd96190ad21d5193d3afc7d34e" - integrity sha512-Xh9o7hQiQlDbxo5/XkOX6H+x/q8rmlmZKr97Ie1Q8ZM32IRRd3B/UxuA/yXDW79DBSXGWxm2yRTbcTVmAciJRw== +refractor@3.0.0, refractor@^2.10.1, refractor@^2.4.1, refractor@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/refractor/-/refractor-3.0.0.tgz#7c8072eaf49dbc1b333e7acc64fb52a1c9b17c75" + integrity sha512-eCGK/oP4VuyW/ERqjMZRZHxl2QsztbkedkYy/SxqE/+Gh1gLaAF17tWIOcVJDiyGhar1NZy/0B9dFef7J0+FDw== dependencies: hastscript "^5.0.0" - parse-entities "^1.1.2" - prismjs "~1.17.0" + parse-entities "^2.0.0" + prismjs "~1.20.0" regenerate-unicode-properties@^8.2.0: version "8.2.0" From 17f5f4b46e99699bea07537e07f5ea2ab1b0cdb6 Mon Sep 17 00:00:00 2001 From: Konstantin Schaper Date: Mon, 12 Oct 2020 18:53:31 +0200 Subject: [PATCH 02/28] implement custom highlighting theme --- package.json | 4 +- scm-ui/ui-components/package.json | 2 +- .../ui-components/src/SyntaxHighlighter.tsx | 5 +- .../src/repos/TokenizedDiffView.tsx | 3 +- .../src/repos/annotate/Annotate.tsx | 4 +- scm-ui/ui-styles/package.json | 3 + .../build-syntax-highlighting-javascript.js | 85 +++++ scm-ui/ui-styles/src/syntax-highlighting.css | 309 ++++++++++++++++++ scm-ui/ui-styles/src/syntax-highlighting.js | 195 +++++++++++ 9 files changed, 602 insertions(+), 8 deletions(-) create mode 100644 scm-ui/ui-styles/scripts/build-syntax-highlighting-javascript.js create mode 100644 scm-ui/ui-styles/src/syntax-highlighting.css create mode 100644 scm-ui/ui-styles/src/syntax-highlighting.js diff --git a/package.json b/package.json index 9beb5f891f..51e71936e3 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,8 @@ "resolutions": { "babel-core": "7.0.0-bridge.0", "gitdiff-parser": "https://github.com/scm-manager/gitdiff-parser#420d6cfa17a6a8f9bf1a517a2c629dcb332dbe13", - "refractor": "3.0.0", - "prismjs": "1.20.0" + "refractor": "3.2.0", + "prismjs": "1.22.0" }, "babel": { "presets": [ diff --git a/scm-ui/ui-components/package.json b/scm-ui/ui-components/package.json index 2ceb3c5f62..95058b976f 100644 --- a/scm-ui/ui-components/package.json +++ b/scm-ui/ui-components/package.json @@ -62,7 +62,7 @@ "react-markdown": "^4.0.6", "react-router-dom": "^5.1.2", "react-select": "^2.1.2", - "react-syntax-highlighter": "https://github.com/conorhastings/react-syntax-highlighter#08bcf49b1aa7877ce94f7208e73dfa6bef8b26e7", + "react-syntax-highlighter": "^15.2.1", "refractor": "^3.0.0" }, "babel": { diff --git a/scm-ui/ui-components/src/SyntaxHighlighter.tsx b/scm-ui/ui-components/src/SyntaxHighlighter.tsx index 93a0c4c555..f47251a4b0 100644 --- a/scm-ui/ui-components/src/SyntaxHighlighter.tsx +++ b/scm-ui/ui-components/src/SyntaxHighlighter.tsx @@ -24,7 +24,8 @@ import React from "react"; import { PrismAsyncLight as ReactSyntaxHighlighter } from "react-syntax-highlighter"; -import { ghcolors } from "react-syntax-highlighter/dist/esm/styles/prism"; +// eslint-disable-next-line no-restricted-imports +import highlightingTheme from "@scm-manager/ui-styles/src/syntax-highlighting.js"; type Props = { language?: string; @@ -52,7 +53,7 @@ class SyntaxHighlighter extends React.Component { const { showLineNumbers } = this.props; const language = this.getLanguage(); return ( - + {this.props.value} ); diff --git a/scm-ui/ui-components/src/repos/TokenizedDiffView.tsx b/scm-ui/ui-components/src/repos/TokenizedDiffView.tsx index 3f004272f8..020b7bf95b 100644 --- a/scm-ui/ui-components/src/repos/TokenizedDiffView.tsx +++ b/scm-ui/ui-components/src/repos/TokenizedDiffView.tsx @@ -29,7 +29,8 @@ import { File } from "./DiffTypes"; // styling for the diff tokens // this must be aligned with th style, which is used in the SyntaxHighlighter component -import "prism-themes/themes/prism-ghcolors.css"; +// eslint-disable-next-line no-restricted-imports +import "@scm-manager/ui-styles/src/syntax-highlighting.css"; const DiffView = styled(Diff)` /* align line numbers */ diff --git a/scm-ui/ui-components/src/repos/annotate/Annotate.tsx b/scm-ui/ui-components/src/repos/annotate/Annotate.tsx index 90ed0f9207..35e42cba48 100644 --- a/scm-ui/ui-components/src/repos/annotate/Annotate.tsx +++ b/scm-ui/ui-components/src/repos/annotate/Annotate.tsx @@ -26,7 +26,7 @@ import React, { FC, useReducer } from "react"; import { Repository, AnnotatedSource, AnnotatedLine } from "@scm-manager/ui-types"; // @ts-ignore import { PrismAsyncLight as ReactSyntaxHighlighter, createElement } from "react-syntax-highlighter"; -import { ghcolors } from "react-syntax-highlighter/dist/esm/styles/prism"; +import highlightingTheme from "@scm-manager/ui-styles/src/syntax-highlighting.js"; import { DateInput } from "../../useDateFormatter"; import Popover from "./Popover"; import AnnotateLine from "./AnnotateLine"; @@ -144,7 +144,7 @@ const Annotate: FC = ({ source, repository, baseDate }) => { {code} diff --git a/scm-ui/ui-styles/package.json b/scm-ui/ui-styles/package.json index 3e216fbeba..9cfef11c10 100644 --- a/scm-ui/ui-styles/package.json +++ b/scm-ui/ui-styles/package.json @@ -16,10 +16,13 @@ "react-diff-view": "^2.4.1" }, "devDependencies": { + "css": "^3.0.0", "css-loader": "^3.2.0", + "prettier": "^2.1.2", "sass": "^1.26.3", "sass-loader": "^8.0.0", "style-loader": "^1.0.0", + "to-camel-case": "^1.0.0", "webpack": "^4.41.5", "webpack-dev-server": "^3.10.1" }, diff --git a/scm-ui/ui-styles/scripts/build-syntax-highlighting-javascript.js b/scm-ui/ui-styles/scripts/build-syntax-highlighting-javascript.js new file mode 100644 index 0000000000..f28ef55580 --- /dev/null +++ b/scm-ui/ui-styles/scripts/build-syntax-highlighting-javascript.js @@ -0,0 +1,85 @@ +/* + * MIT License + * + * Copyright (c) 2020-present Cloudogu GmbH and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +const path = require("path"); +const fs = require("fs"); +const css = require("css"); +const camel = require("to-camel-case"); +const prettier = require("prettier"); + +function createJavascriptStyleSheet(directory, inputFile, outputFile) { + fs.readFile(path.join(__dirname, `${directory}/${inputFile}`), "utf-8", (err, data) => { + const javacriptStylesheet = css.parse(data).stylesheet.rules.reduce((sheet, rule) => { + if (rule.type === "rule") { + const style = rule.selectors.reduce((selectors, selector) => { + const selectorObject = rule.declarations.reduce((declarations, declaration) => { + if (declaration.type === "declaration" && declaration.property) { + const camelCaseDeclarationProp = camel(declaration.property); + const key = + camelCaseDeclarationProp.includes("moz") || + camelCaseDeclarationProp.includes("webkit") || + (camelCaseDeclarationProp[0] === "o" && !camelCaseDeclarationProp.includes("overflow")) + ? `${camelCaseDeclarationProp.substring(0, 1).toUpperCase()}${camelCaseDeclarationProp.substring(1)}` + : camelCaseDeclarationProp; + declarations[key] = declaration.value; + } + return declarations; + }, {}); + + if (selector.substring(0, 6) === ".token") { + selector = selector.substring(7); + + // Regex to fix Prism theme selectors + // - Remove further `.token` classes + // - Remove the space (descendant combinator) + // to allow for styling multiple classes + // Ref: https://github.com/react-syntax-highlighter/react-syntax-highlighter/pull/305 + selector = selector.replace(/(?<=\w) (\.token)?(?=\.)/g, ""); + } + selectors[selector] = selectorObject; + return selectors; + }, {}); + sheet = Object.keys(style).reduce((stylesheet, selector) => { + if (stylesheet[selector]) { + stylesheet[selector] = { ...stylesheet[selector], ...style[selector] }; + } else { + stylesheet[selector] = style[selector]; + } + return stylesheet; + }, sheet); + } + return sheet; + }, {}); + fs.writeFile( + path.join(__dirname, directory, outputFile), + prettier.format(`/* --- DO NOT EDIT --- */ +/* Auto-generated from ${inputFile} */ + + export default ${JSON.stringify(javacriptStylesheet, null, 2)}`), + () => {} + ); + }); +} + +createJavascriptStyleSheet(path.join("..", "src"), "syntax-highlighting.css", "syntax-highlighting.js"); diff --git a/scm-ui/ui-styles/src/syntax-highlighting.css b/scm-ui/ui-styles/src/syntax-highlighting.css new file mode 100644 index 0000000000..7fbe8e70c9 --- /dev/null +++ b/scm-ui/ui-styles/src/syntax-highlighting.css @@ -0,0 +1,309 @@ +/* + * MIT License + * + * Copyright (c) 2020-present Cloudogu GmbH and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* Generated with http://k88hudson.github.io/syntax-highlighting-theme-generator/www */ + +/* http://k88hudson.github.io/react-markdocs */ + +/** + + * @author k88hudson + + * + + * Based on prism.js default theme for JavaScript, CSS and HTML + + * Based on dabblet (http://dabblet.com) + + * @author Lea Verou + + */ + +/********************************************************* + +* General + +*/ + +pre[class*="language-"], + +code[class*="language-"] { + + color: #363636; + + font-size: 13px; + + text-shadow: none; + + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + + direction: ltr; + + text-align: left; + + white-space: pre; + + word-spacing: normal; + + word-break: normal; + + line-height: 1.5; + + -moz-tab-size: 4; + + -o-tab-size: 4; + + tab-size: 4; + + -webkit-hyphens: none; + + -moz-hyphens: none; + + -ms-hyphens: none; + + hyphens: none; + +} + +pre[class*="language-"]::selection, + +code[class*="language-"]::selection, + +pre[class*="language-"]::mozselection, + +code[class*="language-"]::mozselection { + + text-shadow: none; + + background: #7fe3cd; + +} + +@media print { + + pre[class*="language-"], + + code[class*="language-"] { + + text-shadow: none; + + } + +} + +pre[class*="language-"] { + + padding: 1em; + + margin: .5em 0; + + overflow: auto; + + background: #ffffff; + +} + +:not(pre) > code[class*="language-"] { + + padding: .1em .3em; + + border-radius: .3em; + + color: #ff3860; + + background: #fbe7eb; + +} + +/********************************************************* + +* Tokens + +*/ + +.namespace { + + opacity: .7; + +} + +.token.comment, + +.token.prolog, + +.token.doctype, + +.token.cdata { + + color: #9a9a9a; + +} + +.token.punctuation { + + color: #9a9a9a; + +} + +.token.property, + +.token.tag, + +.token.boolean, + +.token.number, + +.token.constant, + +.token.symbol, + +.token.deleted { + + color: #2c99c7; + +} + +.token.selector, + +.token.attr-name, + +.token.string, + +.token.char, + +.token.builtin, + +.token.inserted { + + color: #cca201; + +} + +.token.operator, + +.token.entity, + +.token.url, + +.language-css .token.string, + +.style .token.string { + + color: #686868; + + background: #ffffff; + +} + +.token.atrule, + +.token.attr-value, + +.token.keyword { + + color: #00a984; + +} + +.token.function { + + color: #ff3860; + +} + +.token.regex, + +.token.important, + +.token.variable { + + color: #a74eb2; + +} + +.token.important, + +.token.bold { + + font-weight: bold; + +} + +.token.italic { + + font-style: italic; + +} + +.token.entity { + + cursor: help; + +} + +/********************************************************* + +* Line highlighting + +*/ + +pre[data-line] { + + position: relative; + +} + +pre[class*="language-"] > code[class*="language-"] { + + position: relative; + + z-index: 1; + +} + +.line-highlight { + + position: absolute; + + left: 0; + + right: 0; + + padding: inherit 0; + + margin-top: 1em; + + background: #f5f5f5; + + box-shadow: inset 5px 0 0 #99d8f3; + + z-index: 0; + + pointer-events: none; + + line-height: inherit; + + white-space: pre; + +} diff --git a/scm-ui/ui-styles/src/syntax-highlighting.js b/scm-ui/ui-styles/src/syntax-highlighting.js new file mode 100644 index 0000000000..f96fa51771 --- /dev/null +++ b/scm-ui/ui-styles/src/syntax-highlighting.js @@ -0,0 +1,195 @@ +/* --- DO NOT EDIT --- */ +/* Auto-generated from syntax-highlighting.css */ + +export default { + 'pre[class*="language-"]': { + color: "#363636", + fontSize: "13px", + textShadow: "none", + fontFamily: "Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace", + direction: "ltr", + textAlign: "left", + whiteSpace: "pre", + wordSpacing: "normal", + wordBreak: "normal", + lineHeight: "1.5", + MozTabSize: "4", + OTabSize: "4", + tabSize: "4", + WebkitHyphens: "none", + MozHyphens: "none", + msHyphens: "none", + hyphens: "none", + padding: "1em", + margin: ".5em 0", + overflow: "auto", + background: "#ffffff" + }, + 'code[class*="language-"]': { + color: "#363636", + fontSize: "13px", + textShadow: "none", + fontFamily: "Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace", + direction: "ltr", + textAlign: "left", + whiteSpace: "pre", + wordSpacing: "normal", + wordBreak: "normal", + lineHeight: "1.5", + MozTabSize: "4", + OTabSize: "4", + tabSize: "4", + WebkitHyphens: "none", + MozHyphens: "none", + msHyphens: "none", + hyphens: "none" + }, + 'pre[class*="language-"]::selection': { + textShadow: "none", + background: "#7fe3cd" + }, + 'code[class*="language-"]::selection': { + textShadow: "none", + background: "#7fe3cd" + }, + 'pre[class*="language-"]::mozselection': { + textShadow: "none", + background: "#7fe3cd" + }, + 'code[class*="language-"]::mozselection': { + textShadow: "none", + background: "#7fe3cd" + }, + ':not(pre) > code[class*="language-"]': { + padding: ".1em .3em", + borderRadius: ".3em", + color: "#ff3860", + background: "#fbe7eb" + }, + ".namespace": { + Opacity: ".7" + }, + comment: { + color: "#9a9a9a" + }, + prolog: { + color: "#9a9a9a" + }, + doctype: { + color: "#9a9a9a" + }, + cdata: { + color: "#9a9a9a" + }, + punctuation: { + color: "#9a9a9a" + }, + property: { + color: "#2c99c7" + }, + tag: { + color: "#2c99c7" + }, + boolean: { + color: "#2c99c7" + }, + number: { + color: "#2c99c7" + }, + constant: { + color: "#2c99c7" + }, + symbol: { + color: "#2c99c7" + }, + deleted: { + color: "#2c99c7" + }, + selector: { + color: "#cca201" + }, + "attr-name": { + color: "#cca201" + }, + string: { + color: "#cca201" + }, + char: { + color: "#cca201" + }, + builtin: { + color: "#cca201" + }, + inserted: { + color: "#cca201" + }, + operator: { + color: "#686868", + background: "#ffffff" + }, + entity: { + color: "#686868", + background: "#ffffff", + cursor: "help" + }, + url: { + color: "#686868", + background: "#ffffff" + }, + ".language-css .token.string": { + color: "#686868", + background: "#ffffff" + }, + ".style .token.string": { + color: "#686868", + background: "#ffffff" + }, + atrule: { + color: "#00a984" + }, + "attr-value": { + color: "#00a984" + }, + keyword: { + color: "#00a984" + }, + function: { + color: "#ff3860" + }, + regex: { + color: "#a74eb2" + }, + important: { + color: "#a74eb2", + fontWeight: "bold" + }, + variable: { + color: "#a74eb2" + }, + bold: { + fontWeight: "bold" + }, + italic: { + fontStyle: "italic" + }, + "pre[data-line]": { + position: "relative" + }, + 'pre[class*="language-"] > code[class*="language-"]': { + position: "relative", + zIndex: "1" + }, + ".line-highlight": { + position: "absolute", + left: "0", + right: "0", + padding: "inherit 0", + marginTop: "1em", + background: "#f5f5f5", + boxShadow: "inset 5px 0 0 #99d8f3", + zIndex: "0", + pointerEvents: "none", + lineHeight: "inherit", + whiteSpace: "pre" + } +}; From 22d5176d1aa0cd645ef4079609bc7ba101afb8a3 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Tue, 13 Oct 2020 16:38:22 +0200 Subject: [PATCH 03/28] Translate SystemJS bundle names before loading We remove @scm-manager/ prefix and add append .bundle.js before loading modules. --- scm-ui/ui-webapp/src/containers/loadBundle.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scm-ui/ui-webapp/src/containers/loadBundle.ts b/scm-ui/ui-webapp/src/containers/loadBundle.ts index 8096e70ec4..7586f93984 100644 --- a/scm-ui/ui-webapp/src/containers/loadBundle.ts +++ b/scm-ui/ui-webapp/src/containers/loadBundle.ts @@ -47,7 +47,15 @@ type PluginModule = { const BundleLoader = { name: "bundle-loader", fetch: (plugin: PluginModule) => { - return fetch(plugin.address, { + let url = plugin.address; + if (!url.endsWith(".bundle.js")) { + url += ".bundle.js"; + } + + if (url.includes("@scm-manager/")) { + url = url.replace("@scm-manager/", ""); + } + return fetch(url, { credentials: "same-origin", headers: { Cache: "no-cache", From 5172fdb27d87eb6feb5c3e1f3677a63b4a43b858 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Tue, 13 Oct 2020 16:43:56 +0200 Subject: [PATCH 04/28] Treat every scm-manager plugin as external dependency --- scm-ui/ui-scripts/src/createPluginConfig.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scm-ui/ui-scripts/src/createPluginConfig.js b/scm-ui/ui-scripts/src/createPluginConfig.js index f82c6f55eb..61ab0e1cf8 100644 --- a/scm-ui/ui-scripts/src/createPluginConfig.js +++ b/scm-ui/ui-scripts/src/createPluginConfig.js @@ -29,7 +29,7 @@ const root = process.cwd(); const packageJsonPath = path.join(root, "package.json"); const packageJSON = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: "UTF-8" })); -let name = packageJSON.name; +let { name } = packageJSON; const orgaIndex = name.indexOf("/"); if (orgaIndex > 0) { name = name.substring(orgaIndex + 1); @@ -62,7 +62,8 @@ module.exports = function(mode) { "classnames", "query-string", "redux", - "react-redux" + "react-redux", + /^@scm-manager\/scm-.*-plugin$/i ], module: { rules: [ @@ -90,9 +91,9 @@ module.exports = function(mode) { extensions: [".ts", ".tsx", ".js", ".jsx", ".css", ".scss", ".json"] }, output: { - path: path.join(root, "target", name + "-" + packageJSON.version, "webapp", "assets"), + path: path.join(root, "target", `${name}-${packageJSON.version}`, "webapp", "assets"), filename: "[name].bundle.js", - chunkFilename: name + ".[name].chunk.js", + chunkFilename: `${name}.[name].chunk.js`, library: name, libraryTarget: "amd" } From a94993274a886da6533d5d1e422e7ecec8ea81da Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Wed, 14 Oct 2020 08:06:15 +0200 Subject: [PATCH 05/28] Resolve plugin SystemJS modules to their correct bundle location --- scm-ui/ui-webapp/src/containers/loadBundle.ts | 33 ++++++++++++++----- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/scm-ui/ui-webapp/src/containers/loadBundle.ts b/scm-ui/ui-webapp/src/containers/loadBundle.ts index 7586f93984..fcb82d8f01 100644 --- a/scm-ui/ui-webapp/src/containers/loadBundle.ts +++ b/scm-ui/ui-webapp/src/containers/loadBundle.ts @@ -47,15 +47,7 @@ type PluginModule = { const BundleLoader = { name: "bundle-loader", fetch: (plugin: PluginModule) => { - let url = plugin.address; - if (!url.endsWith(".bundle.js")) { - url += ".bundle.js"; - } - - if (url.includes("@scm-manager/")) { - url = url.replace("@scm-manager/", ""); - } - return fetch(url, { + return fetch(plugin.address, { credentials: "same-origin", headers: { Cache: "no-cache", @@ -82,6 +74,29 @@ SystemJS.config({ } }); +// We have to patch the resolve methods of SystemJS +// in order to resolve the correct bundle url for plugins + +const resolveModuleUrl = (key: string) => { + if (key.startsWith("@scm-manager/scm-") && key.endsWith("-plugin")) { + const pluginName = key.replace("@scm-manager/", ""); + return urls.withContextPath(`/assets/${pluginName}.bundle.js`); + } + return key; +}; + +const defaultResolve = SystemJS.resolve; +SystemJS.resolve = function(key, parentName) { + const module = resolveModuleUrl(key); + return defaultResolve.apply(this, [module, parentName]); +}; + +const defaultResolveSync = SystemJS.resolveSync; +SystemJS.resolveSync = function(key, parentName) { + const module = resolveModuleUrl(key); + return defaultResolveSync.apply(this, [module, parentName]); +}; + const expose = (name: string, cmp: any, defaultCmp?: any) => { let mod = cmp; if (defaultCmp) { From 47aa05dfe01a6d7bcbabf543cbdb3619dd3549d9 Mon Sep 17 00:00:00 2001 From: Konstantin Schaper Date: Fri, 16 Oct 2020 09:40:10 +0200 Subject: [PATCH 06/28] fix lint warnings --- pom.xml | 1 + .../src/repos/annotate/Annotate.tsx | 4 + .../build-syntax-highlighting-javascript.js | 49 +++++++- scm-ui/ui-styles/src/syntax-highlighting.css | 28 ----- ...highlighting.js => syntax-highlighting.ts} | 112 +++++++++++------- 5 files changed, 117 insertions(+), 77 deletions(-) rename scm-ui/ui-styles/src/{syntax-highlighting.js => syntax-highlighting.ts} (55%) diff --git a/pom.xml b/pom.xml index 7ce1d3c1c0..1d3719af5f 100644 --- a/pom.xml +++ b/pom.xml @@ -772,6 +772,7 @@ **/logback.ci.xml **/pkg/ourPackage/scm-source.properties **/.vagrant/** + **/*.css SLASHSTAR_STYLE diff --git a/scm-ui/ui-components/src/repos/annotate/Annotate.tsx b/scm-ui/ui-components/src/repos/annotate/Annotate.tsx index 35e42cba48..c517e21159 100644 --- a/scm-ui/ui-components/src/repos/annotate/Annotate.tsx +++ b/scm-ui/ui-components/src/repos/annotate/Annotate.tsx @@ -24,8 +24,12 @@ import React, { FC, useReducer } from "react"; import { Repository, AnnotatedSource, AnnotatedLine } from "@scm-manager/ui-types"; +// eslint-disable-next-line @typescript-eslint/ban-ts-ignore // @ts-ignore import { PrismAsyncLight as ReactSyntaxHighlighter, createElement } from "react-syntax-highlighter"; +// eslint-disable-next-line @typescript-eslint/ban-ts-ignore +// @ts-ignore +// eslint-disable-next-line no-restricted-imports import highlightingTheme from "@scm-manager/ui-styles/src/syntax-highlighting.js"; import { DateInput } from "../../useDateFormatter"; import Popover from "./Popover"; diff --git a/scm-ui/ui-styles/scripts/build-syntax-highlighting-javascript.js b/scm-ui/ui-styles/scripts/build-syntax-highlighting-javascript.js index f28ef55580..ca1ac2ed69 100644 --- a/scm-ui/ui-styles/scripts/build-syntax-highlighting-javascript.js +++ b/scm-ui/ui-styles/scripts/build-syntax-highlighting-javascript.js @@ -22,11 +22,41 @@ * SOFTWARE. */ +// eslint-disable-next-line import/no-extraneous-dependencies +const css = require("css"); + +// eslint-disable-next-line import/no-extraneous-dependencies +const prettier = require("prettier"); + +// eslint-disable-next-line import/no-extraneous-dependencies +const camel = require("to-camel-case"); + const path = require("path"); const fs = require("fs"); -const css = require("css"); -const camel = require("to-camel-case"); -const prettier = require("prettier"); + +const licenseHeader = `/* + * MIT License + * + * Copyright (c) 2020-present Cloudogu GmbH and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */`; function createJavascriptStyleSheet(directory, inputFile, outputFile) { fs.readFile(path.join(__dirname, `${directory}/${inputFile}`), "utf-8", (err, data) => { @@ -42,12 +72,14 @@ function createJavascriptStyleSheet(directory, inputFile, outputFile) { (camelCaseDeclarationProp[0] === "o" && !camelCaseDeclarationProp.includes("overflow")) ? `${camelCaseDeclarationProp.substring(0, 1).toUpperCase()}${camelCaseDeclarationProp.substring(1)}` : camelCaseDeclarationProp; + // eslint-disable-next-line no-param-reassign declarations[key] = declaration.value; } return declarations; }, {}); if (selector.substring(0, 6) === ".token") { + // eslint-disable-next-line no-param-reassign selector = selector.substring(7); // Regex to fix Prism theme selectors @@ -55,15 +87,20 @@ function createJavascriptStyleSheet(directory, inputFile, outputFile) { // - Remove the space (descendant combinator) // to allow for styling multiple classes // Ref: https://github.com/react-syntax-highlighter/react-syntax-highlighter/pull/305 + // eslint-disable-next-line no-param-reassign selector = selector.replace(/(?<=\w) (\.token)?(?=\.)/g, ""); } + // eslint-disable-next-line no-param-reassign selectors[selector] = selectorObject; return selectors; }, {}); + // eslint-disable-next-line no-param-reassign sheet = Object.keys(style).reduce((stylesheet, selector) => { if (stylesheet[selector]) { + // eslint-disable-next-line stylesheet[selector] = { ...stylesheet[selector], ...style[selector] }; } else { + // eslint-disable-next-line no-param-reassign stylesheet[selector] = style[selector]; } return stylesheet; @@ -73,7 +110,9 @@ function createJavascriptStyleSheet(directory, inputFile, outputFile) { }, {}); fs.writeFile( path.join(__dirname, directory, outputFile), - prettier.format(`/* --- DO NOT EDIT --- */ + prettier.format(`${licenseHeader} + +/* --- DO NOT EDIT --- */ /* Auto-generated from ${inputFile} */ export default ${JSON.stringify(javacriptStylesheet, null, 2)}`), @@ -82,4 +121,4 @@ function createJavascriptStyleSheet(directory, inputFile, outputFile) { }); } -createJavascriptStyleSheet(path.join("..", "src"), "syntax-highlighting.css", "syntax-highlighting.js"); +createJavascriptStyleSheet(path.join("..", "src"), "syntax-highlighting.css", "syntax-highlighting.ts"); diff --git a/scm-ui/ui-styles/src/syntax-highlighting.css b/scm-ui/ui-styles/src/syntax-highlighting.css index 7fbe8e70c9..797a0ebc70 100644 --- a/scm-ui/ui-styles/src/syntax-highlighting.css +++ b/scm-ui/ui-styles/src/syntax-highlighting.css @@ -47,7 +47,6 @@ */ pre[class*="language-"], - code[class*="language-"] { color: #363636; @@ -87,11 +86,8 @@ code[class*="language-"] { } pre[class*="language-"]::selection, - code[class*="language-"]::selection, - pre[class*="language-"]::mozselection, - code[class*="language-"]::mozselection { text-shadow: none; @@ -103,7 +99,6 @@ code[class*="language-"]::mozselection { @media print { pre[class*="language-"], - code[class*="language-"] { text-shadow: none; @@ -149,11 +144,8 @@ pre[class*="language-"] { } .token.comment, - .token.prolog, - .token.doctype, - .token.cdata { color: #9a9a9a; @@ -167,17 +159,11 @@ pre[class*="language-"] { } .token.property, - .token.tag, - .token.boolean, - .token.number, - .token.constant, - .token.symbol, - .token.deleted { color: #2c99c7; @@ -185,15 +171,10 @@ pre[class*="language-"] { } .token.selector, - .token.attr-name, - .token.string, - .token.char, - .token.builtin, - .token.inserted { color: #cca201; @@ -201,13 +182,9 @@ pre[class*="language-"] { } .token.operator, - .token.entity, - .token.url, - .language-css .token.string, - .style .token.string { color: #686868; @@ -217,9 +194,7 @@ pre[class*="language-"] { } .token.atrule, - .token.attr-value, - .token.keyword { color: #00a984; @@ -233,9 +208,7 @@ pre[class*="language-"] { } .token.regex, - .token.important, - .token.variable { color: #a74eb2; @@ -243,7 +216,6 @@ pre[class*="language-"] { } .token.important, - .token.bold { font-weight: bold; diff --git a/scm-ui/ui-styles/src/syntax-highlighting.js b/scm-ui/ui-styles/src/syntax-highlighting.ts similarity index 55% rename from scm-ui/ui-styles/src/syntax-highlighting.js rename to scm-ui/ui-styles/src/syntax-highlighting.ts index f96fa51771..3318b805d6 100644 --- a/scm-ui/ui-styles/src/syntax-highlighting.js +++ b/scm-ui/ui-styles/src/syntax-highlighting.ts @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2020-present Cloudogu GmbH and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + /* --- DO NOT EDIT --- */ /* Auto-generated from syntax-highlighting.css */ @@ -23,7 +47,7 @@ export default { padding: "1em", margin: ".5em 0", overflow: "auto", - background: "#ffffff" + background: "#ffffff", }, 'code[class*="language-"]': { color: "#363636", @@ -42,142 +66,142 @@ export default { WebkitHyphens: "none", MozHyphens: "none", msHyphens: "none", - hyphens: "none" + hyphens: "none", }, 'pre[class*="language-"]::selection': { textShadow: "none", - background: "#7fe3cd" + background: "#7fe3cd", }, 'code[class*="language-"]::selection': { textShadow: "none", - background: "#7fe3cd" + background: "#7fe3cd", }, 'pre[class*="language-"]::mozselection': { textShadow: "none", - background: "#7fe3cd" + background: "#7fe3cd", }, 'code[class*="language-"]::mozselection': { textShadow: "none", - background: "#7fe3cd" + background: "#7fe3cd", }, ':not(pre) > code[class*="language-"]': { padding: ".1em .3em", borderRadius: ".3em", color: "#ff3860", - background: "#fbe7eb" + background: "#fbe7eb", }, ".namespace": { - Opacity: ".7" + Opacity: ".7", }, comment: { - color: "#9a9a9a" + color: "#9a9a9a", }, prolog: { - color: "#9a9a9a" + color: "#9a9a9a", }, doctype: { - color: "#9a9a9a" + color: "#9a9a9a", }, cdata: { - color: "#9a9a9a" + color: "#9a9a9a", }, punctuation: { - color: "#9a9a9a" + color: "#9a9a9a", }, property: { - color: "#2c99c7" + color: "#2c99c7", }, tag: { - color: "#2c99c7" + color: "#2c99c7", }, boolean: { - color: "#2c99c7" + color: "#2c99c7", }, number: { - color: "#2c99c7" + color: "#2c99c7", }, constant: { - color: "#2c99c7" + color: "#2c99c7", }, symbol: { - color: "#2c99c7" + color: "#2c99c7", }, deleted: { - color: "#2c99c7" + color: "#2c99c7", }, selector: { - color: "#cca201" + color: "#cca201", }, "attr-name": { - color: "#cca201" + color: "#cca201", }, string: { - color: "#cca201" + color: "#cca201", }, char: { - color: "#cca201" + color: "#cca201", }, builtin: { - color: "#cca201" + color: "#cca201", }, inserted: { - color: "#cca201" + color: "#cca201", }, operator: { color: "#686868", - background: "#ffffff" + background: "#ffffff", }, entity: { color: "#686868", background: "#ffffff", - cursor: "help" + cursor: "help", }, url: { color: "#686868", - background: "#ffffff" + background: "#ffffff", }, ".language-css .token.string": { color: "#686868", - background: "#ffffff" + background: "#ffffff", }, ".style .token.string": { color: "#686868", - background: "#ffffff" + background: "#ffffff", }, atrule: { - color: "#00a984" + color: "#00a984", }, "attr-value": { - color: "#00a984" + color: "#00a984", }, keyword: { - color: "#00a984" + color: "#00a984", }, function: { - color: "#ff3860" + color: "#ff3860", }, regex: { - color: "#a74eb2" + color: "#a74eb2", }, important: { color: "#a74eb2", - fontWeight: "bold" + fontWeight: "bold", }, variable: { - color: "#a74eb2" + color: "#a74eb2", }, bold: { - fontWeight: "bold" + fontWeight: "bold", }, italic: { - fontStyle: "italic" + fontStyle: "italic", }, "pre[data-line]": { - position: "relative" + position: "relative", }, 'pre[class*="language-"] > code[class*="language-"]': { position: "relative", - zIndex: "1" + zIndex: "1", }, ".line-highlight": { position: "absolute", @@ -190,6 +214,6 @@ export default { zIndex: "0", pointerEvents: "none", lineHeight: "inherit", - whiteSpace: "pre" - } + whiteSpace: "pre", + }, }; From 9b874e7eaba7831c8d51c53803711cee71ce10b1 Mon Sep 17 00:00:00 2001 From: Konstantin Schaper Date: Mon, 19 Oct 2020 20:47:59 +0200 Subject: [PATCH 07/28] fix imports --- scm-ui/ui-components/src/SyntaxHighlighter.tsx | 2 +- scm-ui/ui-components/src/repos/annotate/Annotate.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scm-ui/ui-components/src/SyntaxHighlighter.tsx b/scm-ui/ui-components/src/SyntaxHighlighter.tsx index f47251a4b0..dd87020403 100644 --- a/scm-ui/ui-components/src/SyntaxHighlighter.tsx +++ b/scm-ui/ui-components/src/SyntaxHighlighter.tsx @@ -25,7 +25,7 @@ import React from "react"; import { PrismAsyncLight as ReactSyntaxHighlighter } from "react-syntax-highlighter"; // eslint-disable-next-line no-restricted-imports -import highlightingTheme from "@scm-manager/ui-styles/src/syntax-highlighting.js"; +import highlightingTheme from "@scm-manager/ui-styles/src/syntax-highlighting"; type Props = { language?: string; diff --git a/scm-ui/ui-components/src/repos/annotate/Annotate.tsx b/scm-ui/ui-components/src/repos/annotate/Annotate.tsx index c517e21159..cc7ba88aab 100644 --- a/scm-ui/ui-components/src/repos/annotate/Annotate.tsx +++ b/scm-ui/ui-components/src/repos/annotate/Annotate.tsx @@ -30,7 +30,7 @@ import { PrismAsyncLight as ReactSyntaxHighlighter, createElement } from "react- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore // @ts-ignore // eslint-disable-next-line no-restricted-imports -import highlightingTheme from "@scm-manager/ui-styles/src/syntax-highlighting.js"; +import highlightingTheme from "@scm-manager/ui-styles/src/syntax-highlighting"; import { DateInput } from "../../useDateFormatter"; import Popover from "./Popover"; import AnnotateLine from "./AnnotateLine"; From 8c78b058a3961c39031af2cfae86fb7b9679494a Mon Sep 17 00:00:00 2001 From: Konstantin Schaper Date: Tue, 20 Oct 2020 11:08:49 +0200 Subject: [PATCH 08/28] add ui publishing mechanism for plugins --- pom.xml | 3 +- scm-ui/ui-scripts/bin/ui-scripts.js | 4 +- .../ui-scripts/src/commands/plugin-publish.js | 45 +++++ scm-ui/ui-scripts/src/lerna.js | 16 +- scm-ui/ui-scripts/src/yarn.js | 52 ++++++ scm-ui/ui-styles/src/syntax-highlighting.css | 2 +- yarn.lock | 170 ++++++++++++++---- 7 files changed, 240 insertions(+), 52 deletions(-) create mode 100644 scm-ui/ui-scripts/src/commands/plugin-publish.js create mode 100644 scm-ui/ui-scripts/src/yarn.js diff --git a/pom.xml b/pom.xml index 1d3719af5f..192705ba6b 100644 --- a/pom.xml +++ b/pom.xml @@ -580,7 +580,7 @@ sonia.scm.maven smp-maven-plugin - 1.2.0 + 1.3.0 @@ -772,7 +772,6 @@ **/logback.ci.xml **/pkg/ourPackage/scm-source.properties **/.vagrant/** - **/*.css SLASHSTAR_STYLE diff --git a/scm-ui/ui-scripts/bin/ui-scripts.js b/scm-ui/ui-scripts/bin/ui-scripts.js index 0386f49e3d..0b3b645736 100755 --- a/scm-ui/ui-scripts/bin/ui-scripts.js +++ b/scm-ui/ui-scripts/bin/ui-scripts.js @@ -25,7 +25,7 @@ /* eslint-disable no-console */ const { spawnSync } = require("child_process"); -const commands = ["plugin", "plugin-watch", "publish", "version"]; +const commands = ["plugin", "plugin-watch", "plugin-publish", "publish", "version"]; const args = process.argv.slice(2); @@ -39,7 +39,7 @@ const nodeArgs = commandIndex > 0 ? args.slice(0, commandIndex) : []; if (commands.includes(command)) { const result = spawnSync( "node", - nodeArgs.concat(require.resolve("../src/commands/" + command)).concat(args.slice(commandIndex + 1)), + nodeArgs.concat(require.resolve(`../src/commands/${command}`)).concat(args.slice(commandIndex + 1)), { stdio: "inherit" } ); if (result.signal) { diff --git a/scm-ui/ui-scripts/src/commands/plugin-publish.js b/scm-ui/ui-scripts/src/commands/plugin-publish.js new file mode 100644 index 0000000000..5b80cbfad2 --- /dev/null +++ b/scm-ui/ui-scripts/src/commands/plugin-publish.js @@ -0,0 +1,45 @@ +/* + * MIT License + * + * Copyright (c) 2020-present Cloudogu GmbH and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +const yarn = require("../yarn"); +const versions = require("../versions"); + +const args = process.argv.slice(2); + +if (args.length < 1) { + console.log("usage ui-scripts publish "); + process.exit(1); +} + +const version = args[0]; +const index = version.indexOf("-SNAPSHOT"); +if (index > 0) { + const snapshotVersion = `${version.substring(0, index)}-${versions.createSnapshotVersion()}`; + console.log(`publish snapshot release ${snapshotVersion}`); + yarn.version(snapshotVersion); + yarn.publish(snapshotVersion); + yarn.version(version); +} else { + // ?? not sure + yarn.publish(version); +} diff --git a/scm-ui/ui-scripts/src/lerna.js b/scm-ui/ui-scripts/src/lerna.js index 3b9af49e3a..dac170f07f 100644 --- a/scm-ui/ui-scripts/src/lerna.js +++ b/scm-ui/ui-scripts/src/lerna.js @@ -21,21 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -const { spawnSync } = require("child_process"); -const os = require("os"); - -const yarnCmd = os.platform() === "win32" ? "yarn.cmd" : "yarn"; - -const yarn = args => { - const result = spawnSync(yarnCmd, args, { stdio: "inherit" }); - if (result.error) { - console.log("could not start yarn command:", result.error); - process.exit(2); - } else if (result.status !== 0) { - console.log("yarn process ends with status code:", result.status); - process.exit(3); - } -}; +const { yarn } = require("./yarn"); const version = v => { yarn(["run", "lerna", "--no-git-tag-version", "--no-push", "version", "--force-publish", "--yes", v]); diff --git a/scm-ui/ui-scripts/src/yarn.js b/scm-ui/ui-scripts/src/yarn.js new file mode 100644 index 0000000000..2ff27b0c5f --- /dev/null +++ b/scm-ui/ui-scripts/src/yarn.js @@ -0,0 +1,52 @@ +/* + * MIT License + * + * Copyright (c) 2020-present Cloudogu GmbH and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +const { spawnSync } = require("child_process"); +const os = require("os"); + +const yarnCmd = os.platform() === "win32" ? "yarn.cmd" : "yarn"; + +const yarn = args => { + const result = spawnSync(yarnCmd, args, { stdio: "inherit" }); + if (result.error) { + console.log("could not start yarn command:", result.error); + process.exit(2); + } else if (result.status !== 0) { + console.log("yarn process ends with status code:", result.status); + process.exit(3); + } +}; + +const version = v => { + yarn(["version", "--no-git-tag-version", "--new-version", v]); +}; + +const publish = v => { + yarn(["publish", "--new-version", v]); +}; + +module.exports = { + version, + publish, + yarn +}; diff --git a/scm-ui/ui-styles/src/syntax-highlighting.css b/scm-ui/ui-styles/src/syntax-highlighting.css index 797a0ebc70..4423c62319 100644 --- a/scm-ui/ui-styles/src/syntax-highlighting.css +++ b/scm-ui/ui-styles/src/syntax-highlighting.css @@ -1,4 +1,4 @@ -/* +/** * MIT License * * Copyright (c) 2020-present Cloudogu GmbH and Contributors diff --git a/yarn.lock b/yarn.lock index 7060aa1f76..6ff76264a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3529,6 +3529,13 @@ dependencies: "@types/node" "*" +"@types/hast@^2.0.0": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@types/hast/-/hast-2.3.1.tgz#b16872f2a6144c7025f296fb9636a667ebb79cd9" + integrity sha512-viwwrB+6xGzw+G1eWpF9geV3fnsDgXqHG+cqgiHrvQfDUW5hzhCyV7Sy3UJxhfRFBsgky2SSW33qi/YrIkjX5Q== + dependencies: + "@types/unist" "*" + "@types/history@*", "@types/history@^4.7.3": version "4.7.8" resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.8.tgz#49348387983075705fe8f4e02fb67f7daaec4934" @@ -3710,6 +3717,11 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.1.1.tgz#be148756d5480a84cde100324c03a86ae5739fb5" integrity sha512-2zs+O+UkDsJ1Vcp667pd3f8xearMdopz/z54i99wtRDI5KLmngk7vlrYZD0ZjKHaROR03EznlBbVY9PfAEyJIQ== +"@types/prismjs@*": + version "1.16.1" + resolved "https://registry.yarnpkg.com/@types/prismjs/-/prismjs-1.16.1.tgz#50b82947207847db6abcbcd14caa89e3b897c259" + integrity sha512-RNgcK3FEc1GpeOkamGDq42EYkb6yZW5OWQwTS56NJIB8WL0QGISQglA7En7NUx9RGP8AC52DOe+squqbAckXlA== + "@types/prop-types@*": version "15.7.3" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" @@ -3844,6 +3856,13 @@ dependencies: redux "^4.0.0" +"@types/refractor@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@types/refractor/-/refractor-2.8.0.tgz#2e17b69f27e89c1ea076f49b599abe3567c54e01" + integrity sha512-l3wSB96RFZnvB8bnbF8UmYsDD1MQl+u7jtYq+DgI/vo3RD5pdbK3OitGEvMO3DNJhTYmCEhXLVWyyWTddzwNzQ== + dependencies: + "@types/prismjs" "*" + "@types/sinonjs__fake-timers@^6.0.1": version "6.0.2" resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.2.tgz#3a84cf5ec3249439015e14049bd3161419bf9eae" @@ -3898,6 +3917,11 @@ dependencies: source-map "^0.6.1" +"@types/unist@*": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e" + integrity sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ== + "@types/webpack-env@^1.15.0", "@types/webpack-env@^1.15.2": version "1.15.3" resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.15.3.tgz#fb602cd4c2f0b7c0fb857e922075fdf677d25d84" @@ -6709,6 +6733,15 @@ css-what@^3.2.1: resolved "https://registry.yarnpkg.com/css-what/-/css-what-3.3.0.tgz#10fec696a9ece2e591ac772d759aacabac38cd39" integrity sha512-pv9JPyatiPaQ6pf4OvD/dbfm0o5LviWmwxNWzblYf/1u9QZd0ihV+PMwy5jdQWQ3349kZmKEx9WXuSka2dM4cg== +css@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/css/-/css-3.0.0.tgz#4447a4d58fdd03367c516ca9f64ae365cee4aa5d" + integrity sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ== + dependencies: + inherits "^2.0.4" + source-map "^0.6.1" + source-map-resolve "^0.6.0" + cssesc@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" @@ -8329,7 +8362,7 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= -fault@^1.0.0: +fault@^1.0.0, fault@^1.0.2: version "1.0.4" resolved "https://registry.yarnpkg.com/fault/-/fault-1.0.4.tgz#eafcfc0a6d214fc94601e170df29954a4f842f13" integrity sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA== @@ -9279,11 +9312,12 @@ hast-util-parse-selector@^2.0.0: resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-2.2.4.tgz#60c99d0b519e12ab4ed32e58f150ec3f61ed1974" integrity sha512-gW3sxfynIvZApL4L07wryYF4+C9VvH3AUi7LAnVXV4MneGEgwOByXvFo18BgmTWnm7oHAe874jKbIB1YhHSIzA== -hastscript@^5.0.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-5.1.2.tgz#bde2c2e56d04c62dd24e8c5df288d050a355fb8a" - integrity sha512-WlztFuK+Lrvi3EggsqOkQ52rKbxkXL3RwB6t5lwoa8QLMemoWfBuL43eDrwOamJyR7uKQKdmKYaBH1NZBiIRrQ== +hastscript@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-6.0.0.tgz#e8768d7eac56c3fdeac8a92830d58e811e5bf640" + integrity sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w== dependencies: + "@types/hast" "^2.0.0" comma-separated-tokens "^1.0.0" hast-util-parse-selector "^2.0.0" property-information "^5.0.0" @@ -9299,12 +9333,17 @@ hex-color-regex@^1.1.0: resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ== +highlight.js@^10.1.1, highlight.js@~10.3.0: + version "10.3.1" + resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.3.1.tgz#3ca6bf007377faae347e8135ff25900aac734b9a" + integrity sha512-jeW8rdPdhshYKObedYg5XGbpVgb1/DT4AHvDFXhkU7UnGSIjy9kkJ7zHG7qplhFHMitTSzh5/iClKQk3Kb2RFQ== + highlight.js@~9.13.0: version "9.13.1" resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.13.1.tgz#054586d53a6863311168488a0f58d6c505ce641e" integrity sha512-Sc28JNQNDzaH6PORtRLMvif9RSn1mYuOoX3omVjnb0+HbpPygU2ALBI0R/wsiqCb4/fcp07Gdo8g+fhtFrQl6A== -highlight.js@~9.15.1: +highlight.js@~9.15.0, highlight.js@~9.15.1: version "9.15.10" resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.15.10.tgz#7b18ed75c90348c045eef9ed08ca1319a2219ad2" integrity sha512-RoV7OkQm0T3os3Dd2VHLNMoaoDVx77Wygln3n9l5YV172XonWG6rgQD3XnF/BuFFZw9A0TJgmMSO8FEWQgvcXw== @@ -12006,7 +12045,15 @@ lower-case@^2.0.1: dependencies: tslib "^1.10.0" -lowlight@1.12.1, lowlight@1.13.1, lowlight@^1.13.0, lowlight@~1.11.0: +lowlight@1.12.1: + version "1.12.1" + resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.12.1.tgz#014acf8dd73a370e02ff1cc61debcde3bb1681eb" + integrity sha512-OqaVxMGIESnawn+TU/QMV5BJLbUghUfjDWPAtFqDYDmDtr4FnB+op8xM+pR7nKlauHNUHXGt0VgWatFB8voS5w== + dependencies: + fault "^1.0.2" + highlight.js "~9.15.0" + +lowlight@^1.13.0: version "1.13.1" resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.13.1.tgz#c4f0e03906ebd23fedf2d258f6ab2f6324cf90eb" integrity sha512-kQ71/T6RksEVz9AlPq07/2m+SU/1kGvt9k39UtvHX760u4SaWakaYH7hYgH5n6sTsCWk4MVYzUzLU59aN5CSmQ== @@ -12014,6 +12061,22 @@ lowlight@1.12.1, lowlight@1.13.1, lowlight@^1.13.0, lowlight@~1.11.0: fault "^1.0.0" highlight.js "~9.16.0" +lowlight@^1.14.0: + version "1.16.0" + resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.16.0.tgz#9d904370d0b20bca0893d73559cf27428fecbf7e" + integrity sha512-ECLdzIJvBEjK4ef51sWiGZyz21yx4IEPaF/62DRxLehoOHkWqN3OsLB1GUMfc6Mcf87rR5eW7z6lI9cNEXZDsQ== + dependencies: + fault "^1.0.0" + highlight.js "~10.3.0" + +lowlight@~1.11.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.11.0.tgz#1304d83005126d4e8b1dc0f07981e9b689ec2efc" + integrity sha512-xrGGN6XLL7MbTMdPD6NfWPwY43SNkjf/d0mecSx/CW36fUZTjRHEq0/Cdug3TWKtRXLWi7iMl1eP0olYxj/a4A== + dependencies: + fault "^1.0.2" + highlight.js "~9.13.0" + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -13366,7 +13429,7 @@ parse-asn1@^5.0.0, parse-asn1@^5.1.5: pbkdf2 "^3.0.3" safe-buffer "^5.1.1" -parse-entities@^1.1.0, parse-entities@^1.1.2: +parse-entities@^1.1.0: version "1.2.2" resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.2.2.tgz#c31bf0f653b6661354f8973559cb86dd1d5edf50" integrity sha512-NzfpbxW/NPrzZ/yYSoQxyqUZMZXIdCfE0OIN4ESsnptHJECoUk3FZktxNuzQf4tjt5UEopnxpYJbvYuxIFDdsg== @@ -13378,6 +13441,18 @@ parse-entities@^1.1.0, parse-entities@^1.1.2: is-decimal "^1.0.0" is-hexadecimal "^1.0.0" +parse-entities@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-2.0.0.tgz#53c6eb5b9314a1f4ec99fa0fdf7ce01ecda0cbe8" + integrity sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ== + dependencies: + character-entities "^1.0.0" + character-entities-legacy "^1.0.0" + character-reference-invalid "^1.0.0" + is-alphanumerical "^1.0.0" + is-decimal "^1.0.0" + is-hexadecimal "^1.0.0" + parse-github-repo-url@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz#9e7d8bb252a6cb6ba42595060b7bf6df3dbc1f50" @@ -14085,6 +14160,11 @@ prettier@^1.19.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== +prettier@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5" + integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg== + pretty-bytes@^5.3.0: version "5.4.1" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.4.1.tgz#cd89f79bbcef21e3d21eb0da68ffe93f803e884b" @@ -14133,17 +14213,15 @@ pretty-hrtime@^1.0.3: resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= -prismjs@^1.16.0, prismjs@^1.8.4: - version "1.21.0" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.21.0.tgz#36c086ec36b45319ec4218ee164c110f9fc015a3" - integrity sha512-uGdSIu1nk3kej2iZsLyDoJ7e9bnPzIgY0naW/HdknGj61zScaprVEVGHrPoXqI+M9sP0NDnTK2jpkvmldpuqDw== - optionalDependencies: - clipboard "^2.0.0" +prism-themes@^1.4.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/prism-themes/-/prism-themes-1.4.1.tgz#2e1b5877792e3d19fa365b1f0462335ae348aceb" + integrity sha512-Sxk5+Wr63WxMq/sU/JYxnq5WbB0CTjv9dscGGMF91iBo3rHEJFfhZVxEsepEOMRbOQ9Exc+xySuAEaX4ATxtIQ== -prismjs@~1.17.0: - version "1.17.1" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.17.1.tgz#e669fcbd4cdd873c35102881c33b14d0d68519be" - integrity sha512-PrEDJAFdUGbOP6xK/UsfkC5ghJsPJviKgnQOoxaDbBjwc8op68Quupwt1DeAFoG8GImPhiKXAvvsH7wDSLsu1Q== +prismjs@1.22.0, prismjs@^1.21.0, prismjs@^1.8.4, prismjs@~1.22.0: + version "1.22.0" + resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.22.0.tgz#73c3400afc58a823dd7eed023f8e1ce9fd8977fa" + integrity sha512-lLJ/Wt9yy0AiSYBf212kK3mM5L8ycwlyTlSxHBAneXLR0nzFMlZ5y7riFPF3E33zXOF2IH95xdY5jIyZbM9z/w== optionalDependencies: clipboard "^2.0.0" @@ -14801,15 +14879,16 @@ react-syntax-highlighter@^12.2.1: prismjs "^1.8.4" refractor "^2.4.1" -"react-syntax-highlighter@https://github.com/conorhastings/react-syntax-highlighter#08bcf49b1aa7877ce94f7208e73dfa6bef8b26e7": - version "12.0.2" - resolved "https://github.com/conorhastings/react-syntax-highlighter#08bcf49b1aa7877ce94f7208e73dfa6bef8b26e7" +react-syntax-highlighter@^15.2.1: + version "15.2.1" + resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-15.2.1.tgz#63a42be96a645407a394cd7b93b99622f3ea179f" + integrity sha512-xrSfqX5Rztf9x4Fa6W+DbbKaJmi5zvh+tAvG2MnktZPDLeX/iMkumwxJdGYn5M1jM3d4+EJTloVAB8UvD7O0nA== dependencies: "@babel/runtime" "^7.3.1" - highlight.js "~9.13.0" - lowlight "~1.11.0" - prismjs "^1.16.0" - refractor "^2.10.1" + highlight.js "^10.1.1" + lowlight "^1.14.0" + prismjs "^1.21.0" + refractor "^3.1.0" react-test-renderer@^16.0.0-0, react-test-renderer@^16.10.2: version "16.13.1" @@ -15125,14 +15204,14 @@ reflect.ownkeys@^0.2.0: resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460" integrity sha1-dJrO7H8/34tj+SegSAnpDFwLNGA= -refractor@^2.10.1, refractor@^2.4.1: - version "2.10.1" - resolved "https://registry.yarnpkg.com/refractor/-/refractor-2.10.1.tgz#166c32f114ed16fd96190ad21d5193d3afc7d34e" - integrity sha512-Xh9o7hQiQlDbxo5/XkOX6H+x/q8rmlmZKr97Ie1Q8ZM32IRRd3B/UxuA/yXDW79DBSXGWxm2yRTbcTVmAciJRw== +refractor@3.2.0, refractor@^2.4.1, refractor@^3.0.0, refractor@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/refractor/-/refractor-3.2.0.tgz#bc46f7cfbb6adbf45cd304e8e299b7fa854804e0" + integrity sha512-hSo+EyMIZTLBvNNgIU5lW4yjCzNYMZ4dcEhBq/3nReGfqzd2JfVhdlPDfU9rEsgcAyWx+OimIIUoL4ZU7NtYHQ== dependencies: - hastscript "^5.0.0" - parse-entities "^1.1.2" - prismjs "~1.17.0" + hastscript "^6.0.0" + parse-entities "^2.0.0" + prismjs "~1.22.0" regenerate-unicode-properties@^8.2.0: version "8.2.0" @@ -16034,6 +16113,14 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" +source-map-resolve@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2" + integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w== + dependencies: + atob "^2.1.2" + decode-uri-component "^0.2.0" + source-map-support@^0.5.16, source-map-support@^0.5.6, source-map-support@~0.5.12: version "0.5.19" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" @@ -16919,11 +17006,23 @@ to-arraybuffer@^1.0.0: resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= +to-camel-case@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/to-camel-case/-/to-camel-case-1.0.0.tgz#1a56054b2f9d696298ce66a60897322b6f423e46" + integrity sha1-GlYFSy+daWKYzmamCJcyK29CPkY= + dependencies: + to-space-case "^1.0.0" + to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= +to-no-case@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/to-no-case/-/to-no-case-1.0.2.tgz#c722907164ef6b178132c8e69930212d1b4aa16a" + integrity sha1-xyKQcWTvaxeBMsjmmTAhLRtKoWo= + to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" @@ -16956,6 +17055,13 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" +to-space-case@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/to-space-case/-/to-space-case-1.0.0.tgz#b052daafb1b2b29dc770cea0163e5ec0ebc9fc17" + integrity sha1-sFLar7Gysp3HcM6gFj5ewOvJ/Bc= + dependencies: + to-no-case "^1.0.0" + toggle-selection@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/toggle-selection/-/toggle-selection-1.0.6.tgz#6e45b1263f2017fa0acc7d89d78b15b8bf77da32" From 3b9fa12d71b1edc922b431f6b849409d74f2b962 Mon Sep 17 00:00:00 2001 From: Konstantin Schaper Date: Tue, 20 Oct 2020 12:21:05 +0200 Subject: [PATCH 09/28] fix visual glitch in annotate view --- scm-ui/ui-components/src/repos/annotate/AnnotateLine.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scm-ui/ui-components/src/repos/annotate/AnnotateLine.tsx b/scm-ui/ui-components/src/repos/annotate/AnnotateLine.tsx index 7d8401aa70..eb57c9d339 100644 --- a/scm-ui/ui-components/src/repos/annotate/AnnotateLine.tsx +++ b/scm-ui/ui-components/src/repos/annotate/AnnotateLine.tsx @@ -80,7 +80,7 @@ const Metadata = styled(LineElement)` `; const EmptyMetadata = styled(LineElement)` - width: 16.7em; + width: 16.5em; `; const dispatchDeferred = (dispatch: Dispatch, action: Action) => { From cfa44df41a2d9d42fd43ca14ac91ab3c03162d19 Mon Sep 17 00:00:00 2001 From: Konstantin Schaper Date: Wed, 21 Oct 2020 11:36:19 +0200 Subject: [PATCH 10/28] update storyshots due to editor theme changes --- .../src/__snapshots__/storyshots.test.ts.snap | 6423 +++++++++++++++-- 1 file changed, 5660 insertions(+), 763 deletions(-) diff --git a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap index eec24b0966..690b599378 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -14,15 +14,53 @@ exports[`Storyshots Annotate Default 1`] = `
-      
+      
         
@@ -62,9 +100,10 @@ exports[`Storyshots Annotate Default 1`] = ` style={Object {}} > @@ -83,7 +122,7 @@ exports[`Storyshots Annotate Default 1`] = ` className="AnnotateLine__Line-h9c4md-4 cjyweO" >
@@ -160,9 +200,10 @@ exports[`Storyshots Annotate Default 1`] = ` @@ -181,7 +222,7 @@ exports[`Storyshots Annotate Default 1`] = ` className="AnnotateLine__Line-h9c4md-4 cjyweO" >
func main - () + ( + + + ) - { + + + + { + + + @@ -331,21 +394,62 @@ exports[`Storyshots Annotate Default 1`] = ` - fmt.Println( + fmt + . + + + Println + + + ( + + "Hello World" ) + + + @@ -389,8 +493,27 @@ exports[`Storyshots Annotate Default 1`] = ` - } + + + + + } + + + +
@@ -398,7 +521,7 @@ exports[`Storyshots Annotate Default 1`] = ` className="AnnotateLine__Line-h9c4md-4 cjyweO" >
- +
@@ -496,9 +657,10 @@ exports[`Storyshots Annotate With Avatars 1`] = ` style={Object {}} > @@ -517,7 +679,7 @@ exports[`Storyshots Annotate With Avatars 1`] = ` className="AnnotateLine__Line-h9c4md-4 cjyweO" >
@@ -599,9 +762,10 @@ exports[`Storyshots Annotate With Avatars 1`] = ` @@ -620,7 +784,7 @@ exports[`Storyshots Annotate With Avatars 1`] = ` className="AnnotateLine__Line-h9c4md-4 cjyweO" >
func main - () + ( + + + ) - { + + + + { + + + @@ -780,21 +966,62 @@ exports[`Storyshots Annotate With Avatars 1`] = ` - fmt.Println( + fmt + . + + + Println + + + ( + + "Hello World" ) + + + @@ -843,8 +1070,27 @@ exports[`Storyshots Annotate With Avatars 1`] = ` - } + + + + + } + + + +
@@ -852,7 +1098,7 @@ exports[`Storyshots Annotate With Avatars 1`] = ` className="AnnotateLine__Line-h9c4md-4 cjyweO" >
@@ -4142,7 +4388,7 @@ exports[`Storyshots Diff Binaries 1`] = ` className="panel-block is-paddingless" >
@@ -4870,7 +5116,7 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = ` className="panel-block is-paddingless" >
@@ -5711,7 +5957,7 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = ` className="panel-block is-paddingless" >
@@ -6148,7 +6394,7 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = ` className="panel-block is-paddingless" >
@@ -6710,7 +6956,7 @@ exports[`Storyshots Diff Default 1`] = ` className="panel-block is-paddingless" >
@@ -7274,7 +7520,7 @@ exports[`Storyshots Diff Default 1`] = ` className="panel-block is-paddingless" >
@@ -8115,7 +8361,7 @@ exports[`Storyshots Diff Default 1`] = ` className="panel-block is-paddingless" >
@@ -8552,7 +8798,7 @@ exports[`Storyshots Diff Default 1`] = ` className="panel-block is-paddingless" >
@@ -8989,7 +9235,7 @@ exports[`Storyshots Diff Default 1`] = ` className="panel-block is-paddingless" >
@@ -10033,7 +10279,7 @@ exports[`Storyshots Diff Default 1`] = ` className="panel-block is-paddingless" >
@@ -10554,7 +10800,7 @@ exports[`Storyshots Diff Expandable 1`] = ` className="panel-block is-paddingless" >
@@ -11155,7 +11401,7 @@ exports[`Storyshots Diff Expandable 1`] = ` className="panel-block is-paddingless" >
@@ -12093,7 +12339,7 @@ exports[`Storyshots Diff Expandable 1`] = ` className="panel-block is-paddingless" >
@@ -12602,7 +12848,7 @@ exports[`Storyshots Diff Expandable 1`] = ` className="panel-block is-paddingless" >
@@ -13111,7 +13357,7 @@ exports[`Storyshots Diff Expandable 1`] = ` className="panel-block is-paddingless" >
@@ -14310,7 +14556,7 @@ exports[`Storyshots Diff Expandable 1`] = ` className="panel-block is-paddingless" >
@@ -14872,7 +15118,7 @@ exports[`Storyshots Diff File Annotation 1`] = ` src/main/java/com/cloudogu/scm/review/events/EventListener.java

@@ -15440,7 +15686,7 @@ exports[`Storyshots Diff File Annotation 1`] = ` src/main/js/ChangeNotification.tsx

@@ -16285,7 +16531,7 @@ exports[`Storyshots Diff File Annotation 1`] = ` src/main/resources/locales/de/plugins.json

@@ -16726,7 +16972,7 @@ exports[`Storyshots Diff File Annotation 1`] = ` src/main/resources/locales/en/plugins.json

@@ -17167,7 +17413,7 @@ exports[`Storyshots Diff File Annotation 1`] = ` src/test/java/com/cloudogu/scm/review/events/ClientTest.java

@@ -18215,7 +18461,7 @@ exports[`Storyshots Diff File Annotation 1`] = ` Main.java

@@ -18754,7 +19000,7 @@ exports[`Storyshots Diff File Controls 1`] = ` className="panel-block is-paddingless" >
@@ -19336,7 +19582,7 @@ exports[`Storyshots Diff File Controls 1`] = ` className="panel-block is-paddingless" >
@@ -20195,7 +20441,7 @@ exports[`Storyshots Diff File Controls 1`] = ` className="panel-block is-paddingless" >
@@ -20650,7 +20896,7 @@ exports[`Storyshots Diff File Controls 1`] = ` className="panel-block is-paddingless" >
@@ -21105,7 +21351,7 @@ exports[`Storyshots Diff File Controls 1`] = ` className="panel-block is-paddingless" >
@@ -22167,7 +22413,7 @@ exports[`Storyshots Diff File Controls 1`] = ` className="panel-block is-paddingless" >
@@ -22688,7 +22934,7 @@ exports[`Storyshots Diff Hunks 1`] = ` className="panel-block is-paddingless" >
@@ -23516,7 +23762,7 @@ exports[`Storyshots Diff Line Annotation 1`] = ` className="panel-block is-paddingless" >
@@ -24092,7 +24338,7 @@ exports[`Storyshots Diff Line Annotation 1`] = ` className="panel-block is-paddingless" >
@@ -24945,7 +25191,7 @@ exports[`Storyshots Diff Line Annotation 1`] = ` className="panel-block is-paddingless" >
@@ -25382,7 +25628,7 @@ exports[`Storyshots Diff Line Annotation 1`] = ` className="panel-block is-paddingless" >
@@ -25819,7 +26065,7 @@ exports[`Storyshots Diff Line Annotation 1`] = ` className="panel-block is-paddingless" >
@@ -26863,7 +27109,7 @@ exports[`Storyshots Diff Line Annotation 1`] = ` className="panel-block is-paddingless" >
@@ -27396,7 +27642,7 @@ exports[`Storyshots Diff OnClick 1`] = ` className="panel-block is-paddingless" >
@@ -28000,7 +28246,7 @@ exports[`Storyshots Diff OnClick 1`] = ` className="panel-block is-paddingless" >
@@ -28903,7 +29149,7 @@ exports[`Storyshots Diff OnClick 1`] = ` className="panel-block is-paddingless" >
@@ -29370,7 +29616,7 @@ exports[`Storyshots Diff OnClick 1`] = ` className="panel-block is-paddingless" >
@@ -29837,7 +30083,7 @@ exports[`Storyshots Diff OnClick 1`] = ` className="panel-block is-paddingless" >
@@ -30957,7 +31203,7 @@ exports[`Storyshots Diff OnClick 1`] = ` className="panel-block is-paddingless" >
@@ -31514,7 +31760,7 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` className="panel-block is-paddingless" >
@@ -32171,7 +32417,7 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` className="panel-block is-paddingless" >
@@ -33102,7 +33348,7 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` className="panel-block is-paddingless" >
@@ -33591,7 +33837,7 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` className="panel-block is-paddingless" >
@@ -34080,7 +34326,7 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` className="panel-block is-paddingless" >
@@ -35293,7 +35539,7 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` className="panel-block is-paddingless" >
@@ -35887,7 +36133,7 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` className="panel-block is-paddingless" >
@@ -36451,7 +36697,7 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` className="panel-block is-paddingless" >
@@ -37292,7 +37538,7 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` className="panel-block is-paddingless" >
@@ -37729,7 +37975,7 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` className="panel-block is-paddingless" >
@@ -38166,7 +38412,7 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` className="panel-block is-paddingless" >
@@ -39210,7 +39456,7 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` className="panel-block is-paddingless" >
@@ -39731,7 +39977,7 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` className="panel-block is-paddingless" >
@@ -40332,7 +40578,7 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` className="panel-block is-paddingless" >
@@ -41270,7 +41516,7 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` className="panel-block is-paddingless" >
@@ -41779,7 +42025,7 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` className="panel-block is-paddingless" >
@@ -42288,7 +42534,7 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` className="panel-block is-paddingless" >
@@ -43487,7 +43733,7 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` className="panel-block is-paddingless" >
@@ -45345,20 +45591,75 @@ exports[`Storyshots MarkdownView Code without Lang 1`] = `
-        
+        
           
@@ -46082,19 +46383,52 @@ Deserunt officia esse aliquip consectetur duis ut labore laborum commodo aliquip
       
         
@@ -46204,7 +46538,29 @@ Deserunt officia esse aliquip consectetur duis ut labore laborum commodo aliquip
 
           
         
-        
+        
           package main
 
 import (
@@ -46467,20 +46823,75 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
       
-        
+        
           
@@ -46647,38 +47058,54 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
             
           
           
             <
           
           
             project
           
           
-             [
+             
           
           
-            ...
+            [...]
           
           
-            ]>
+            >
           
           
           
             <
           
           
             build
           
           
             >
           
@@ -46731,24 +47166,32 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
                 
           
           
             <
           
           
             plugins
           
           
             >
           
@@ -46770,24 +47213,32 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
                   
           
           
             <
           
           
             plugin
           
           
             >
           
@@ -46803,24 +47254,32 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
                     
           
           
             <
           
           
             groupId
           
           
             >
           
@@ -46830,24 +47289,32 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
             org.apache.maven.plugins
           
           
             </
           
           
             groupId
           
           
             >
           
@@ -46863,24 +47330,32 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
                     
           
           
             <
           
           
             artifactId
           
           
             >
           
@@ -46890,24 +47365,32 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
             maven-enforcer-plugin
           
           
             </
           
           
             artifactId
           
           
             >
           
@@ -46923,24 +47406,32 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
                   
           
           
             </
           
           
             plugin
           
           
             >
           
@@ -46956,24 +47447,32 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
                   
           
           
             <
           
           
             plugin
           
           
             >
           
@@ -46989,24 +47488,32 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
                     
           
           
             <
           
           
             groupId
           
           
             >
           
@@ -47016,24 +47523,32 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
             org.codehaus.mojo
           
           
             </
           
           
             groupId
           
           
             >
           
@@ -47049,24 +47564,32 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
                     
           
           
             <
           
           
             artifactId
           
           
             >
           
@@ -47076,24 +47599,32 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
             animal-sniffer-maven-plugin
           
           
             </
           
           
             artifactId
           
           
             >
           
@@ -47109,24 +47640,32 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
                   
           
           
             </
           
           
             plugin
           
           
             >
           
@@ -47142,24 +47681,32 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
                 
           
           
             </
           
           
             plugins
           
           
             >
           
@@ -47175,24 +47722,32 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
               
           
           
             </
           
           
             build
           
           
             >
           
@@ -47214,24 +47769,32 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = `
             
           
           
             </
           
           
             project
           
           
             >
           
@@ -48188,20 +48751,75 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = `
   
-    
+    
       
@@ -48326,9 +48944,10 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = `
         
       
       
@@ -48348,9 +48967,10 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = `
         
       
       
@@ -48359,7 +48979,22 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = `
       
-         (
+         
+      
+      
+        (
+      
+      
+        
 
       
       
       
@@ -48388,9 +49024,10 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = `
           
       
       
@@ -48402,8 +49039,27 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = `
         
 
       
-      )
+      
+        
+      
+      
+        )
+      
+      
+        
 
+      
       
 
       
       
         func
       
       
          
       
       
         main
       
       
-        ()
+        (
+      
+      
+        )
       
       
-         {
+         
+      
+      
+        {
+      
+      
+        
 
       
       
-          http.HandleFunc(
+          http
       
       
+        .
+      
+      
+        HandleFunc
+      
+      
+        (
+      
+      
         "/"
       
       
-        , 
-      
-      
+        ,
+      
+      
+         
+      
+      
         func
       
       
          
       
       
-        (w http.ResponseWriter, r *http.Request)
+        (
       
       
-         {
+        w http
+      
+      
+        .
+      
+      
+        ResponseWriter
+      
+      
+        ,
+      
+      
+         r 
+      
+      
+        *
+      
+      
+        http
+      
+      
+        .
+      
+      
+        Request
+      
+      
+        )
+      
+      
+         
+      
+      
+        {
+      
+      
+        
 
       
       
-            fmt.Fprintf(w, 
+            fmt
       
       
+        .
+      
+      
+        Fprintf
+      
+      
+        (
+      
+      
+        w
+      
+      
+        ,
+      
+      
+         
+      
+      
         "Welcome to my website!"
       
       
         )
+      
+      
+        
 
       
-        })
+      
+          
+      
+      
+        }
+      
+      
+        )
+      
+      
+        
 
+      
       
 
       
-          fs := http.FileServer(http.Dir(
+          fs 
       
       
+        :=
+      
+      
+         http
+      
+      
+        .
+      
+      
+        FileServer
+      
+      
+        (
+      
+      
+        http
+      
+      
+        .
+      
+      
+        Dir
+      
+      
+        (
+      
+      
         "static/"
       
+      
+        )
+      
+      
+        )
+      
       
-        ))
+        
 
       
       
-          http.Handle(
+          http
       
       
+        .
+      
+      
+        Handle
+      
+      
+        (
+      
+      
         "/static/"
       
       
-        , http.StripPrefix(
-      
-      
+        ,
+      
+      
+         http
+      
+      
+        .
+      
+      
+        StripPrefix
+      
+      
+        (
+      
+      
         "/static/"
       
+      
+        ,
+      
       
-        , fs))
+         fs
+      
+      
+        )
+      
+      
+        )
+      
+      
+        
 
       
       
@@ -48591,39 +49697,110 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = `
       
-          http.ListenAndServe(
+          http
       
       
+        .
+      
+      
+        ListenAndServe
+      
+      
+        (
+      
+      
         ":80"
       
       
-        , 
-      
-      
+        ,
+      
+      
+         
+      
+      
         nil
       
       
         )
+      
+      
+        
 
       
-      }
+      
+        
+      
+      
+        }
+      
+      
+        
 
+      
       
 
     
@@ -48638,20 +49815,75 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
   
-    
+    
       
@@ -48874,9 +50106,10 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
         
       
       
@@ -48885,7 +50118,44 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
       
-         com.example;
+         
+      
+      
+        com
+      
+      
+        .
+      
+      
+        example
+      
+      
+        ;
+      
+      
+        
 
       
       
@@ -48896,9 +50166,10 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
         
       
       
@@ -48907,7 +50178,60 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
       
-         java.io.IOException;
+         
+      
+      
+        java
+      
+      
+        .
+      
+      
+        io
+      
+      
+        .
+      
+      
+        IOException
+      
+      
+        ;
+      
+      
+        
 
       
       
       
@@ -48927,7 +50252,60 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
       
-         java.io.OutputStream;
+         
+      
+      
+        java
+      
+      
+        .
+      
+      
+        io
+      
+      
+        .
+      
+      
+        OutputStream
+      
+      
+        ;
+      
+      
+        
 
       
       
       
@@ -48947,7 +50326,60 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
       
-         java.net.InetSocketAddress;
+         
+      
+      
+        java
+      
+      
+        .
+      
+      
+        net
+      
+      
+        .
+      
+      
+        InetSocketAddress
+      
+      
+        ;
+      
+      
+        
 
       
       
@@ -48958,9 +50390,10 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
         
       
       
@@ -48969,7 +50402,92 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
       
-         com.sun.net.httpserver.HttpExchange;
+         
+      
+      
+        com
+      
+      
+        .
+      
+      
+        sun
+      
+      
+        .
+      
+      
+        net
+      
+      
+        .
+      
+      
+        httpserver
+      
+      
+        .
+      
+      
+        HttpExchange
+      
+      
+        ;
+      
+      
+        
 
       
       
       
@@ -48989,7 +50508,92 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
       
-         com.sun.net.httpserver.HttpHandler;
+         
+      
+      
+        com
+      
+      
+        .
+      
+      
+        sun
+      
+      
+        .
+      
+      
+        net
+      
+      
+        .
+      
+      
+        httpserver
+      
+      
+        .
+      
+      
+        HttpHandler
+      
+      
+        ;
+      
+      
+        
 
       
       
       
@@ -49009,7 +50614,92 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
       
-         com.sun.net.httpserver.HttpServer;
+         
+      
+      
+        com
+      
+      
+        .
+      
+      
+        sun
+      
+      
+        .
+      
+      
+        net
+      
+      
+        .
+      
+      
+        httpserver
+      
+      
+        .
+      
+      
+        HttpServer
+      
+      
+        ;
+      
+      
+        
 
       
       
@@ -49020,9 +50710,10 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
         
       
       
@@ -49034,42 +50725,45 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
          
       
       
         class
       
       
          
       
       
         Test
       
       
          
       
       
         {
+      
+      
+        
 
       
       
@@ -49080,121 +50774,231 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
           
       
       
         public
       
       
          
       
       
         static
       
       
          
       
       
         void
       
       
          
       
       
         main
       
       
-        (String[] args)
+        (
       
       
+        String
+      
+      
+        [
+      
+      
+        ]
+      
+      
+         args
+      
+      
+        )
+      
+      
          
       
       
         throws
       
       
-         Exception 
+         
+      
+      
+        Exception
       
       
+         
+      
+      
         {
+      
+      
+        
 
       
       
-            HttpServer server = HttpServer.create(
+            
       
       
+        HttpServer
+      
+      
+         server 
+      
+      
+        =
+      
+      
+         
+      
+      
+        HttpServer
+      
+      
+        .
+      
+      
+        create
+      
+      
+        (
+      
+      
@@ -49203,60 +51007,160 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
       
-         InetSocketAddress(
+         
       
       
+        InetSocketAddress
+      
+      
+        (
+      
+      
         8000
       
       
-        ), 
-      
-      
+        )
+      
+      
+        ,
+      
+      
+         
+      
+      
         0
       
+      
+        )
+      
+      
+        ;
+      
       
-        );
+        
 
       
       
-            server.createContext(
+            server
       
       
+        .
+      
+      
+        createContext
+      
+      
+        (
+      
+      
         "/test"
       
       
-        , 
-      
-      
+        ,
+      
+      
+         
+      
+      
@@ -49265,32 +51169,135 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
       
-         MyHandler());
+         
+      
+      
+        MyHandler
+      
+      
+        (
+      
+      
+        )
+      
+      
+        )
+      
+      
+        ;
+      
+      
+        
 
       
       
-            server.setExecutor(
+            server
       
       
+        .
+      
+      
+        setExecutor
+      
+      
+        (
+      
+      
         null
       
       
-        ); 
-      
-      
+        )
+      
+      
+        ;
+      
+      
+         
+      
+      
@@ -49302,10 +51309,88 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
         
 
       
-          server.start();
-
+      
+            server
+      
+      
+        .
+      
+      
+        start
+      
+      
+        (
+      
+      
+        )
+      
+      
+        ;
+      
+      
+        
 
+      
+      
+          
+      
+      
+        }
+      
+      
+        
+
+      
       
 
       
       
@@ -49328,75 +51414,71 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
          
       
       
         class
       
       
          
       
       
         MyHandler
       
       
          
       
       
         implements
       
       
          
       
       
         HttpHandler
       
       
          
       
       
         {
+      
+      
+        
 
       
       
       
@@ -49425,148 +51508,627 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
             
       
       
         public
       
       
          
       
       
         void
       
       
          
       
       
         handle
       
       
-        (HttpExchange t)
+        (
       
       
+        HttpExchange
+      
+      
+         t
+      
+      
+        )
+      
+      
          
       
       
         throws
       
       
-         IOException 
+         
+      
+      
+        IOException
       
       
+         
+      
+      
         {
+      
+      
+        
 
       
       
-              String response = 
+              
       
       
+        String
+      
+      
+         response 
+      
+      
+        =
+      
+      
+         
+      
+      
         "This is the response"
       
       
         ;
+      
+      
+        
 
       
       
-              t.sendResponseHeaders(
+              t
       
       
+        .
+      
+      
+        sendResponseHeaders
+      
+      
+        (
+      
+      
         200
       
+      
+        ,
+      
       
-        , response.length());
+         response
+      
+      
+        .
+      
+      
+        length
+      
+      
+        (
+      
+      
+        )
+      
+      
+        )
+      
+      
+        ;
+      
+      
+        
 
       
-            OutputStream os = t.getResponseBody();
-
-            os.write(response.getBytes());
-
-            os.close();
-
+      
+              
+      
+      
+        OutputStream
+      
+      
+         os 
+      
+      
+        =
+      
+      
+         t
+      
+      
+        .
+      
+      
+        getResponseBody
+      
+      
+        (
+      
+      
+        )
+      
+      
+        ;
+      
+      
+        
 
+      
+      
+              os
+      
+      
+        .
+      
+      
+        write
+      
+      
+        (
+      
+      
+        response
+      
+      
+        .
+      
+      
+        getBytes
+      
+      
+        (
+      
+      
+        )
+      
+      
+        )
+      
+      
+        ;
+      
+      
+        
+
+      
+      
+              os
+      
+      
+        .
+      
+      
+        close
+      
+      
+        (
+      
+      
+        )
+      
+      
+        ;
+      
+      
+        
+
+      
+      
+            
+      
+      
+        }
+      
+      
+        
+
+      
+      
+          
+      
+      
+        }
+      
+      
+        
+
+      
       
 
-      }
+      
+        
+      
+      
+        }
+      
+      
+        
 
+      
       
 
     
@@ -49581,20 +52143,75 @@ exports[`Storyshots SyntaxHighlighter Javascript 1`] = `
   
-    
+    
       
@@ -49649,9 +52266,10 @@ exports[`Storyshots SyntaxHighlighter Javascript 1`] = `
         
       
       
@@ -49660,35 +52278,78 @@ exports[`Storyshots SyntaxHighlighter Javascript 1`] = `
       
-         http = 
+         http 
       
       
+        =
+      
+      
+         
+      
+      
         require
       
       
         (
       
       
         'http'
       
+      
+        )
+      
+      
+        ;
+      
       
-        );
+        
 
       
       
@@ -49696,139 +52357,478 @@ exports[`Storyshots SyntaxHighlighter Javascript 1`] = `
       
-        http.createServer(
+        http
       
       
+        .
+      
+      
+        createServer
+      
+      
+        (
+      
+      
         function
       
       
-         (
+         
       
       
-        req, res
+        (
       
       
+        req
+      
+      
-        ) 
+        ,
+      
+      
+         res
+      
+      
+        )
       
       
+         
+      
+      
         {
+      
+      
+        
 
       
       
-          res.writeHead(
+          res
       
       
+        .
+      
+      
+        writeHead
+      
+      
+        (
+      
+      
         200
       
       
-        , {
-      
-      
+        ,
+      
+      
+         
+      
+      
+        {
+      
+      
         'Content-Type'
       
       
-        : 
-      
-      
+        :
+      
+      
+         
+      
+      
         'text/plain'
       
+      
+        }
+      
+      
+        )
+      
+      
+        ;
+      
       
-        });
+        
 
       
       
-          res.write(
+          res
       
       
+        .
+      
+      
+        write
+      
+      
+        (
+      
+      
         'Hello World!'
       
       
-        );
-
-      
-        res.end();
-
-      
-        }).listen(
-      
-      
+        )
+      
+      
+        ;
+      
+      
+        
+
+      
+      
+          res
+      
+      
+        .
+      
+      
+        end
+      
+      
+        (
+      
+      
+        )
+      
+      
+        ;
+      
+      
+        
+
+      
+      
+        
+      
+      
+        }
+      
+      
+        )
+      
+      
+        .
+      
+      
+        listen
+      
+      
+        (
+      
+      
         8080
       
+      
+        )
+      
+      
+        ;
+      
       
-        );
+        
 
       
       
@@ -49845,20 +52845,75 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
   
-    
+    
       
@@ -50004,9 +53059,10 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
         
       
       
@@ -50018,9 +53074,10 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
          BaseHTTPServer 
       
       
@@ -50029,7 +53086,22 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
       
-         BaseHTTPRequestHandler,HTTPServer
+         BaseHTTPRequestHandler
+      
+      
+        ,
+      
+      
+        HTTPServer
 
       
       
@@ -50037,12 +53109,29 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
       
-        PORT_NUMBER = 
+        PORT_NUMBER 
       
       
+        =
+      
+      
+         
+      
+      
@@ -50062,41 +53151,58 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
         
       
       
         class
       
       
          
       
       
         myHandler
       
       
-        (BaseHTTPRequestHandler)
+        (
       
       
+        BaseHTTPRequestHandler
+      
+      
+        )
+      
+      
         :
       
@@ -50114,47 +53220,60 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
           
       
       
         def
       
       
          
       
       
         do_GET
       
       
-        (self)
+        (
       
       
+        self
+      
+      
+        )
+      
+      
@@ -50169,77 +53288,250 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
       
-            self.send_response(
+            self
       
       
+        .
+      
+      
+        send_response
+      
+      
+        (
+      
+      
         200
       
       
         )
+      
+      
+        
 
       
       
-            self.send_header(
+            self
       
       
+        .
+      
+      
+        send_header
+      
+      
+        (
+      
+      
         'Content-type'
       
       
         ,
       
       
         'text/html'
       
       
-        )
-
-      
-          self.end_headers()
-
-      
-            self.wfile.write(
-      
-      
+        )
+      
+      
+        
+
+      
+      
+            self
+      
+      
+        .
+      
+      
+        end_headers
+      
+      
+        (
+      
+      
+        )
+      
+      
+        
+
+      
+      
+            self
+      
+      
+        .
+      
+      
+        wfile
+      
+      
+        .
+      
+      
+        write
+      
+      
+        (
+      
+      
         "Hello World !"
       
       
         )
+      
+      
+        
 
       
       
       
@@ -50270,38 +53563,136 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
         
       
       
         try
       
       
         :
+      
+      
+        
 
       
       
-          server = HTTPServer((
+          server 
       
       
+        =
+      
+      
+         HTTPServer
+      
+      
+        (
+      
+      
+        (
+      
+      
         ''
       
+      
+        ,
+      
       
-        , PORT_NUMBER), myHandler)
+         PORT_NUMBER
+      
+      
+        )
+      
+      
+        ,
+      
+      
+         myHandler
+      
+      
+        )
+      
+      
+        
 
       
       
       
@@ -50324,9 +53716,10 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
          
       
       
@@ -50335,20 +53728,80 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
       
-         , PORT_NUMBER
+         
+      
+      
+        ,
+      
+      
+         PORT_NUMBER
 
       
-        server.serve_forever()
+      
+          server
+      
+      
+        .
+      
+      
+        serve_forever
+      
+      
+        (
+      
+      
+        )
+      
+      
+        
 
+      
       
         
       
       
@@ -50357,7 +53810,22 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
       
-         KeyboardInterrupt:
+         KeyboardInterrupt
+      
+      
+        :
+      
+      
+        
 
       
       
       
@@ -50380,9 +53849,10 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
          
       
       
@@ -50394,8 +53864,67 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
         
 
       
-        server.socket.close()
+      
+          server
+      
+      
+        .
+      
+      
+        socket
+      
+      
+        .
+      
+      
+        close
+      
+      
+        (
+      
+      
+        )
+      
+      
+        
 
+      
       
 
     
@@ -50410,19 +53939,58 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
   
-    
+    
       
@@ -50431,7 +53999,44 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
       
-         com.example;
+         
+      
+      
+        com
+      
+      
+        .
+      
+      
+        example
+      
+      
+        ;
+      
+      
+        
 
       
       
@@ -50442,9 +54047,10 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
         
       
       
@@ -50453,7 +54059,60 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
       
-         java.io.IOException;
+         
+      
+      
+        java
+      
+      
+        .
+      
+      
+        io
+      
+      
+        .
+      
+      
+        IOException
+      
+      
+        ;
+      
+      
+        
 
       
       
       
@@ -50473,7 +54133,60 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
       
-         java.io.OutputStream;
+         
+      
+      
+        java
+      
+      
+        .
+      
+      
+        io
+      
+      
+        .
+      
+      
+        OutputStream
+      
+      
+        ;
+      
+      
+        
 
       
       
       
@@ -50493,7 +54207,60 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
       
-         java.net.InetSocketAddress;
+         
+      
+      
+        java
+      
+      
+        .
+      
+      
+        net
+      
+      
+        .
+      
+      
+        InetSocketAddress
+      
+      
+        ;
+      
+      
+        
 
       
       
@@ -50504,9 +54271,10 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
         
       
       
@@ -50515,7 +54283,92 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
       
-         com.sun.net.httpserver.HttpExchange;
+         
+      
+      
+        com
+      
+      
+        .
+      
+      
+        sun
+      
+      
+        .
+      
+      
+        net
+      
+      
+        .
+      
+      
+        httpserver
+      
+      
+        .
+      
+      
+        HttpExchange
+      
+      
+        ;
+      
+      
+        
 
       
       
       
@@ -50535,7 +54389,92 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
       
-         com.sun.net.httpserver.HttpHandler;
+         
+      
+      
+        com
+      
+      
+        .
+      
+      
+        sun
+      
+      
+        .
+      
+      
+        net
+      
+      
+        .
+      
+      
+        httpserver
+      
+      
+        .
+      
+      
+        HttpHandler
+      
+      
+        ;
+      
+      
+        
 
       
       
       
@@ -50555,7 +54495,92 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
       
-         com.sun.net.httpserver.HttpServer;
+         
+      
+      
+        com
+      
+      
+        .
+      
+      
+        sun
+      
+      
+        .
+      
+      
+        net
+      
+      
+        .
+      
+      
+        httpserver
+      
+      
+        .
+      
+      
+        HttpServer
+      
+      
+        ;
+      
+      
+        
 
       
       
@@ -50566,9 +54591,10 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
         
       
       
@@ -50580,42 +54606,45 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
          
       
       
         class
       
       
          
       
       
         Test
       
       
          
       
       
         {
+      
+      
+        
 
       
       
@@ -50626,121 +54655,231 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
           
       
       
         public
       
       
          
       
       
         static
       
       
          
       
       
         void
       
       
          
       
       
         main
       
       
-        (String[] args)
+        (
       
       
+        String
+      
+      
+        [
+      
+      
+        ]
+      
+      
+         args
+      
+      
+        )
+      
+      
          
       
       
         throws
       
       
-         Exception 
+         
+      
+      
+        Exception
       
       
+         
+      
+      
         {
+      
+      
+        
 
       
       
-            HttpServer server = HttpServer.create(
+            
       
       
+        HttpServer
+      
+      
+         server 
+      
+      
+        =
+      
+      
+         
+      
+      
+        HttpServer
+      
+      
+        .
+      
+      
+        create
+      
+      
+        (
+      
+      
@@ -50749,60 +54888,160 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
       
-         InetSocketAddress(
+         
       
       
+        InetSocketAddress
+      
+      
+        (
+      
+      
         8000
       
       
-        ), 
-      
-      
+        )
+      
+      
+        ,
+      
+      
+         
+      
+      
         0
       
+      
+        )
+      
+      
+        ;
+      
       
-        );
+        
 
       
       
-            server.createContext(
+            server
       
       
+        .
+      
+      
+        createContext
+      
+      
+        (
+      
+      
         "/test"
       
       
-        , 
-      
-      
+        ,
+      
+      
+         
+      
+      
@@ -50811,32 +55050,135 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
       
-         MyHandler());
+         
+      
+      
+        MyHandler
+      
+      
+        (
+      
+      
+        )
+      
+      
+        )
+      
+      
+        ;
+      
+      
+        
 
       
       
-            server.setExecutor(
+            server
       
       
+        .
+      
+      
+        setExecutor
+      
+      
+        (
+      
+      
         null
       
       
-        ); 
-      
-      
+        )
+      
+      
+        ;
+      
+      
+         
+      
+      
@@ -50848,10 +55190,88 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
         
 
       
-          server.start();
-
+      
+            server
+      
+      
+        .
+      
+      
+        start
+      
+      
+        (
+      
+      
+        )
+      
+      
+        ;
+      
+      
+        
 
+      
+      
+          
+      
+      
+        }
+      
+      
+        
+
+      
       
 
       
       
@@ -50874,75 +55295,71 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
          
       
       
         class
       
       
          
       
       
         MyHandler
       
       
          
       
       
         implements
       
       
          
       
       
         HttpHandler
       
       
          
       
       
         {
+      
+      
+        
 
       
       
       
@@ -50971,148 +55389,627 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
             
       
       
         public
       
       
          
       
       
         void
       
       
          
       
       
         handle
       
       
-        (HttpExchange t)
+        (
       
       
+        HttpExchange
+      
+      
+         t
+      
+      
+        )
+      
+      
          
       
       
         throws
       
       
-         IOException 
+         
+      
+      
+        IOException
       
       
+         
+      
+      
         {
+      
+      
+        
 
       
       
-              String response = 
+              
       
       
+        String
+      
+      
+         response 
+      
+      
+        =
+      
+      
+         
+      
+      
         "This is the response"
       
       
         ;
+      
+      
+        
 
       
       
-              t.sendResponseHeaders(
+              t
       
       
+        .
+      
+      
+        sendResponseHeaders
+      
+      
+        (
+      
+      
         200
       
+      
+        ,
+      
       
-        , response.length());
+         response
+      
+      
+        .
+      
+      
+        length
+      
+      
+        (
+      
+      
+        )
+      
+      
+        )
+      
+      
+        ;
+      
+      
+        
 
       
-            OutputStream os = t.getResponseBody();
-
-            os.write(response.getBytes());
-
-            os.close();
-
+      
+              
+      
+      
+        OutputStream
+      
+      
+         os 
+      
+      
+        =
+      
+      
+         t
+      
+      
+        .
+      
+      
+        getResponseBody
+      
+      
+        (
+      
+      
+        )
+      
+      
+        ;
+      
+      
+        
 
+      
+      
+              os
+      
+      
+        .
+      
+      
+        write
+      
+      
+        (
+      
+      
+        response
+      
+      
+        .
+      
+      
+        getBytes
+      
+      
+        (
+      
+      
+        )
+      
+      
+        )
+      
+      
+        ;
+      
+      
+        
+
+      
+      
+              os
+      
+      
+        .
+      
+      
+        close
+      
+      
+        (
+      
+      
+        )
+      
+      
+        ;
+      
+      
+        
+
+      
+      
+            
+      
+      
+        }
+      
+      
+        
+
+      
+      
+          
+      
+      
+        }
+      
+      
+        
+
+      
       
 
-      }
+      
+        
+      
+      
+        }
+      
+      
+        
 
+      
       
 
     

From a289fe00a9f2faecc62527d842f364efe2369070 Mon Sep 17 00:00:00 2001
From: Konstantin Schaper 
Date: Wed, 21 Oct 2020 11:51:17 +0200
Subject: [PATCH 11/28] remove unnecessary background color definition for
 tokens and string literals

---
 scm-ui/ui-styles/src/syntax-highlighting.css | 3 ---
 scm-ui/ui-styles/src/syntax-highlighting.ts  | 5 -----
 2 files changed, 8 deletions(-)

diff --git a/scm-ui/ui-styles/src/syntax-highlighting.css b/scm-ui/ui-styles/src/syntax-highlighting.css
index 4423c62319..68ab444015 100644
--- a/scm-ui/ui-styles/src/syntax-highlighting.css
+++ b/scm-ui/ui-styles/src/syntax-highlighting.css
@@ -188,9 +188,6 @@ pre[class*="language-"] {
 .style .token.string {
 
   color: #686868;
-
-  background: #ffffff;
-
 }
 
 .token.atrule,
diff --git a/scm-ui/ui-styles/src/syntax-highlighting.ts b/scm-ui/ui-styles/src/syntax-highlighting.ts
index 3318b805d6..004013a2a1 100644
--- a/scm-ui/ui-styles/src/syntax-highlighting.ts
+++ b/scm-ui/ui-styles/src/syntax-highlighting.ts
@@ -149,24 +149,19 @@ export default {
   },
   operator: {
     color: "#686868",
-    background: "#ffffff",
   },
   entity: {
     color: "#686868",
-    background: "#ffffff",
     cursor: "help",
   },
   url: {
     color: "#686868",
-    background: "#ffffff",
   },
   ".language-css .token.string": {
     color: "#686868",
-    background: "#ffffff",
   },
   ".style .token.string": {
     color: "#686868",
-    background: "#ffffff",
   },
   atrule: {
     color: "#00a984",

From 01333176f5feeb461979c7002b89c8cb4e473604 Mon Sep 17 00:00:00 2001
From: Konstantin Schaper 
Date: Wed, 21 Oct 2020 12:23:38 +0200
Subject: [PATCH 12/28] update storyshots

---
 .../src/__snapshots__/storyshots.test.ts.snap | 2601 +++++++++++------
 1 file changed, 1648 insertions(+), 953 deletions(-)

diff --git a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap
index 690b599378..06e6ae59b1 100644
--- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap
+++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap
@@ -39,6 +39,7 @@ exports[`Storyshots Annotate Default 1`] = `
       }
     >
       
       
         
-          
-            
-              1
-
-            
-          
+            1
+          
           
@@ -46539,6 +46524,7 @@ Deserunt officia esse aliquip consectetur duis ut labore laborum commodo aliquip
           
         
         
         
-          
-            
-              1
-
-            
-            
-              2
-
-            
-            
-              3
-
-            
-            
-              4
-
-            
-            
-              5
-
-            
-            
-              6
-
-            
-            
-              7
-
-            
-            
-              8
-
-            
-            
-              9
-
-            
-            
-              10
-
-            
-            
-              11
-
-            
-            
-              12
-
-            
-            
-              13
-
-            
-            
-              14
-
-            
-            
-              15
-
-            
-            
-              16
-
-            
-            
-              17
-
-            
-            
-              18
-
-            
-            
-              19
-
-            
-            
-              20
-
-            
-            
-              21
-
-            
-            
-              22
-
-            
-            
-              23
-
-            
-          
+            1
+          
           
           
           
           
+          
+            2
+          
           
 
+          
+            3
+          
             [...]
 
+          
+            4
+          
           
 
+          
+            5
+          
           
               
           
           
           
           
             
 
+          
+          
+            6
           
           
           
           
           
+          
+            7
+          
           
 
+          
+            8
+          
                 [...]
 
+          
+            9
+          
           
 
+          
+            10
+          
           
                   
           
           
           
           
             
 
+          
+          
+            11
           
           
           
           
           
           
           
           
             
 
+          
+          
+            12
           
           
           
           
           
           
           
           
             
 
+          
+          
+            13
           
           
           
           
           
             
 
+          
+          
+            14
           
           
           
           
           
             
 
+          
+          
+            15
           
           
           
           
           
           
           
           
             
 
+          
+          
+            16
           
           
           
           
           
           
           
           
             
 
+          
+          
+            17
           
           
           
           
           
             
 
+          
+          
+            18
           
           
           
           
           
             
 
+          
+          
+            19
           
           
           
           
           
+          
+            20
+          
           
 
+          
+            21
+          
             [...]
 
+          
+            22
+          
           
 
+          
+            23
+          
           
             
           
           
           
           
     
-      
-        
-          1
-
-        
-        
-          2
-
-        
-        
-          3
-
-        
-        
-          4
-
-        
-        
-          5
-
-        
-        
-          6
-
-        
-        
-          7
-
-        
-        
-          8
-
-        
-        
-          9
-
-        
-        
-          10
-
-        
-        
-          11
-
-        
-        
-          12
-
-        
-        
-          13
-
-        
-        
-          14
-
-        
-        
-          15
-
-        
-        
-          16
-
-        
-        
-          17
-
-        
-      
+        1
+      
       
+      
+        2
+      
       
 
+      
+        3
+      
       
@@ -48996,6 +49042,21 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = `
       >
         
 
+      
+      
+        4
       
       
         
 
+      
+      
+        5
       
       
         
 
+      
+      
+        6
       
       
+      
+        7
+      
       
 
+      
+        8
+      
       
@@ -49132,6 +49253,21 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = `
       >
         
 
+      
+      
+        9
       
       
         
 
+      
+      
+        10
       
       
         
 
+      
+      
+        11
       
       
+      
+        12
+      
       
 
+      
+        13
+      
       
@@ -49438,7 +49633,6 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = `
         className="token"
         style={
           Object {
-            "background": "#ffffff",
             "color": "#686868",
           }
         }
@@ -49550,6 +49744,21 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = `
       >
         
 
+      
+      
+        14
       
       
+      
+        15
+      
       
 
+      
+        16
+      
       
@@ -49779,6 +50018,21 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = `
       >
         
 
+      
+      
+        17
       
       
+      
+        18
+      
       
 
     
@@ -49840,6 +50109,7 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
     }
   >
     
-      
-        
-          1
-
-        
-        
-          2
-
-        
-        
-          3
-
-        
-        
-          4
-
-        
-        
-          5
-
-        
-        
-          6
-
-        
-        
-          7
-
-        
-        
-          8
-
-        
-        
-          9
-
-        
-        
-          10
-
-        
-        
-          11
-
-        
-        
-          12
-
-        
-        
-          13
-
-        
-        
-          14
-
-        
-        
-          15
-
-        
-        
-          16
-
-        
-        
-          17
-
-        
-        
-          18
-
-        
-        
-          19
-
-        
-        
-          20
-
-        
-        
-          21
-
-        
-        
-          22
-
-        
-        
-          23
-
-        
-        
-          24
-
-        
-        
-          25
-
-        
-        
-          26
-
-        
-        
-          27
-
-        
-        
-          28
-
-        
-        
-          29
-
-        
-        
-          30
-
-        
-        
-          31
-
-        
-      
+        1
+      
       
       
         com
       
       
       
         example
@@ -50158,8 +50200,38 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
         
 
       
+      
+        2
+      
       
 
+      
+        3
+      
       
@@ -50181,13 +50253,13 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
          
       
       
         java
       
       
       
         io
@@ -50233,6 +50305,21 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
       >
         
 
+      
+      
+        4
       
       
       
         java
       
       
       
         io
@@ -50307,6 +50394,21 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
       >
         
 
+      
+      
+        5
       
       
       
         java
       
       
       
         net
@@ -50382,8 +50484,38 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
         
 
       
+      
+        6
+      
       
 
+      
+        7
+      
       
@@ -50405,13 +50537,13 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
          
       
       
         com
       
       
       
         sun
       
       
       
         net
       
       
       
         httpserver
@@ -50489,6 +50621,21 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
       >
         
 
+      
+      
+        8
       
       
       
         com
       
       
       
         sun
       
       
       
         net
       
       
       
         httpserver
@@ -50595,6 +50742,21 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
       >
         
 
+      
+      
+        9
       
       
       
         com
       
       
       
         sun
       
       
       
         net
       
       
       
         httpserver
@@ -50702,8 +50864,38 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
         
 
       
+      
+        10
+      
       
 
+      
+        11
+      
       
@@ -50766,8 +50958,38 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
         
 
       
+      
+        12
+      
       
 
+      
+        13
+      
       
@@ -50925,6 +51147,21 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
       >
         
 
+      
+      
+        14
       
       
         
 
+      
+      
+        15
       
       
         
 
+      
+      
+        16
       
       
         
 
+      
+      
+        17
       
       
         
 
+      
+      
+        18
       
       
+      
+        19
+      
       
 
+      
+        20
+      
       
@@ -51480,6 +51806,21 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
       >
         
 
+      
+      
+        21
       
       
         
 
+      
+      
+        22
       
       
         
 
+      
+      
+        23
       
       
         
 
+      
+      
+        24
       
       
         
 
+      
+      
+        25
       
       
         
 
+      
+      
+        26
       
       
         
 
+      
+      
+        27
       
       
         
 
+      
+      
+        28
       
       
         
 
+      
+      
+        29
       
       
+      
+        30
+      
       
 
+      
+        31
+      
       
@@ -52129,6 +52618,21 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = `
         
 
       
+      
+        32
+      
       
 
     
@@ -52168,6 +52672,7 @@ exports[`Storyshots SyntaxHighlighter Javascript 1`] = `
     }
   >
     
-      
-        
-          1
-
-        
-        
-          2
-
-        
-        
-          3
-
-        
-        
-          4
-
-        
-        
-          5
-
-        
-        
-          6
-
-        
-        
-          7
-
-        
-      
+        1
+      
       
+      
+        2
+      
       
 
+      
+        3
+      
       
@@ -52421,7 +52895,7 @@ exports[`Storyshots SyntaxHighlighter Javascript 1`] = `
         req
       
       
         
 
+      
+      
+        4
       
       
@@ -52607,6 +53096,21 @@ exports[`Storyshots SyntaxHighlighter Javascript 1`] = `
       >
         
 
+      
+      
+        5
       
       
         
 
+      
+      
+        6
       
       
         
 
+      
+      
+        7
       
       
+      
+        8
+      
       
 
     
@@ -52870,6 +53419,7 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
     }
   >
     
-      
-        
-          1
-
-        
-        
-          2
-
-        
-        
-          3
-
-        
-        
-          4
-
-        
-        
-          5
-
-        
-        
-          6
-
-        
-        
-          7
-
-        
-        
-          8
-
-        
-        
-          9
-
-        
-        
-          10
-
-        
-        
-          11
-
-        
-        
-          12
-
-        
-        
-          13
-
-        
-        
-          14
-
-        
-        
-          15
-
-        
-        
-          16
-
-        
-        
-          17
-
-        
-        
-          18
-
-        
-        
-          19
-
-        
-        
-          20
-
-        
-      
+        1
+      
       
+      
+        2
+      
       
 
+      
+        3
+      
       
@@ -53115,7 +53544,6 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
         className="token"
         style={
           Object {
-            "background": "#ffffff",
             "color": "#686868",
           }
         }
@@ -53143,8 +53571,38 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
         
 
       
+      
+        4
+      
       
 
+      
+        5
+      
       
@@ -53212,8 +53670,38 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
         
 
       
+      
+        6
+      
       
 
+      
+        7
+      
       
@@ -53284,6 +53772,21 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
       >
         
 
+      
+      
+        8
       
       
         
 
+      
+      
+        9
       
       
         
 
+      
+      
+        10
       
       
         
 
+      
+      
+        11
       
       
         
 
+      
+      
+        12
       
       
+      
+        13
+      
       
 
+      
+        14
+      
       
@@ -53587,6 +54180,21 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
       >
         
 
+      
+      
+        15
       
       
         
 
+      
+      
+        16
       
       
+      
+        17
+      
       
@@ -53791,6 +54428,21 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = `
       >
         
 
+      
+      
+        18
       
       
         
 
+      
+      
+        19
       
       
         
 
+      
+      
+        20
       
       
+      
+        21
+      
       
 
     
@@ -53964,6 +54661,7 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
     }
   >
     
       
         com
       
       
       
         example
@@ -54062,13 +54760,13 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
          
       
       
         java
       
       
       
         io
@@ -54136,13 +54834,13 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
          
       
       
         java
       
       
       
         io
@@ -54210,13 +54908,13 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
          
       
       
         java
       
       
       
         net
@@ -54286,13 +54984,13 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
          
       
       
         com
       
       
       
         sun
       
       
       
         net
       
       
       
         httpserver
@@ -54392,13 +55090,13 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
          
       
       
         com
       
       
       
         sun
       
       
       
         net
       
       
       
         httpserver
@@ -54498,13 +55196,13 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
          
       
       
         com
       
       
       
         sun
       
       
       
         net
       
       
       
         httpserver
@@ -54827,7 +55525,6 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
         className="token"
         style={
           Object {
-            "background": "#ffffff",
             "color": "#686868",
           }
         }
@@ -55526,7 +56223,6 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
         className="token"
         style={
           Object {
-            "background": "#ffffff",
             "color": "#686868",
           }
         }
@@ -55710,7 +56406,6 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = `
         className="token"
         style={
           Object {
-            "background": "#ffffff",
             "color": "#686868",
           }
         }

From 626f322b88758ddf869627f5008dc8f45916851b Mon Sep 17 00:00:00 2001
From: Konstantin Schaper 
Date: Wed, 21 Oct 2020 13:19:50 +0200
Subject: [PATCH 13/28] update changelog

---
 CHANGELOG.md | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index e6810df880..bd15187c92 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ## Unreleased
 ### Added
 - Generation of email addresses for users, where none is configured ([#1370](https://github.com/scm-manager/scm-manager/pull/1370))
+- add mechanism for deploying ui content ([#1382](https://github.com/scm-manager/scm-manager/pull/1382))
+
+### Changed
+- Centralise syntax highlighting ([#1382](https://github.com/scm-manager/scm-manager/pull/1382))
 
 ## [2.7.1] - 2020-10-14
 ### Fixed

From 405ab925752115de257cab37ed654aca76653f7c Mon Sep 17 00:00:00 2001
From: Konstantin Schaper 
Date: Wed, 21 Oct 2020 13:20:01 +0200
Subject: [PATCH 14/28] fix typo

---
 CHANGELOG.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index bd15187c92..c7eec3b53f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ## Unreleased
 ### Added
 - Generation of email addresses for users, where none is configured ([#1370](https://github.com/scm-manager/scm-manager/pull/1370))
-- add mechanism for deploying ui content ([#1382](https://github.com/scm-manager/scm-manager/pull/1382))
+- Add mechanism for deploying ui content ([#1382](https://github.com/scm-manager/scm-manager/pull/1382))
 
 ### Changed
 - Centralise syntax highlighting ([#1382](https://github.com/scm-manager/scm-manager/pull/1382))

From 79882725c93d107846df05e1ed85d892a43a1a12 Mon Sep 17 00:00:00 2001
From: Konstantin Schaper 
Date: Wed, 21 Oct 2020 14:15:44 +0200
Subject: [PATCH 15/28] Update CHANGELOG.md

---
 CHANGELOG.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 09c7454ad9..f57a9fe8ae 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## Unreleased
 ### Added
-- Generation of email addresses for users, where none is configured ([#1370](https://github.com/scm-manager/scm-manager/pull/1370))- Add mechanism for deploying ui content ([#1382](https://github.com/scm-manager/scm-manager/pull/1382))
+- Generation of email addresses for users, where none is configured ([#1370](https://github.com/scm-manager/scm-manager/pull/1370))
+- Add mechanism for deploying ui content ([#1382](https://github.com/scm-manager/scm-manager/pull/1382))
 
 ### Changed
 - Centralise syntax highlighting ([#1382](https://github.com/scm-manager/scm-manager/pull/1382))

From 66abe18fa24ade1825db288118e1383f6aa621bf Mon Sep 17 00:00:00 2001
From: Konstantin Schaper 
Date: Wed, 21 Oct 2020 14:16:19 +0200
Subject: [PATCH 16/28] Update CHANGELOG.md

---
 CHANGELOG.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index f57a9fe8ae..84b68d3018 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,10 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ### Added
 - Generation of email addresses for users, where none is configured ([#1370](https://github.com/scm-manager/scm-manager/pull/1370))
 - Add mechanism for deploying ui content ([#1382](https://github.com/scm-manager/scm-manager/pull/1382))
+- Source code fullscreen view ([#1376](https://github.com/scm-manager/scm-manager/pull/1376))
 
 ### Changed
 - Centralise syntax highlighting ([#1382](https://github.com/scm-manager/scm-manager/pull/1382))
-- Source code fullscreen view ([#1376](https://github.com/scm-manager/scm-manager/pull/1376))
 
 ## [2.6.3] - 2020-10-16
 ### Fixed

From 74f180f14a80bac78653f5094cd1177ae6412a73 Mon Sep 17 00:00:00 2001
From: Konstantin Schaper 
Date: Wed, 21 Oct 2020 14:28:52 +0200
Subject: [PATCH 17/28] fix ui annotate glitch

---
 scm-ui/ui-components/src/repos/annotate/AnnotateLine.tsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scm-ui/ui-components/src/repos/annotate/AnnotateLine.tsx b/scm-ui/ui-components/src/repos/annotate/AnnotateLine.tsx
index eb57c9d339..c32d172e89 100644
--- a/scm-ui/ui-components/src/repos/annotate/AnnotateLine.tsx
+++ b/scm-ui/ui-components/src/repos/annotate/AnnotateLine.tsx
@@ -77,10 +77,11 @@ const Line = styled.div`
 
 const Metadata = styled(LineElement)`
   cursor: help;
+  width: 217px;
 `;
 
 const EmptyMetadata = styled(LineElement)`
-  width: 16.5em;
+  width: 217px;
 `;
 
 const dispatchDeferred = (dispatch: Dispatch, action: Action) => {

From bd5b54d6de69f2676f12d8d48ee97c47a2d29163 Mon Sep 17 00:00:00 2001
From: Konstantin Schaper 
Date: Wed, 21 Oct 2020 15:22:15 +0200
Subject: [PATCH 18/28] update storyshots

---
 .../src/__snapshots__/storyshots.test.ts.snap | 32 +++++++++----------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap
index cd79a5424a..77b1f1ebc5 100644
--- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap
+++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap
@@ -66,7 +66,7 @@ exports[`Storyshots Annotate Default 1`] = `
           className="AnnotateLine__Line-h9c4md-4 cjyweO"
         >
           
@@ -123,7 +123,7 @@ exports[`Storyshots Annotate Default 1`] = ` className="AnnotateLine__Line-h9c4md-4 cjyweO" >
@@ -223,7 +223,7 @@ exports[`Storyshots Annotate Default 1`] = ` className="AnnotateLine__Line-h9c4md-4 cjyweO" >
@@ -358,7 +358,7 @@ exports[`Storyshots Annotate Default 1`] = ` className="AnnotateLine__Line-h9c4md-4 cjyweO" >
@@ -460,7 +460,7 @@ exports[`Storyshots Annotate Default 1`] = ` className="AnnotateLine__Line-h9c4md-4 cjyweO" >
@@ -522,7 +522,7 @@ exports[`Storyshots Annotate Default 1`] = ` className="AnnotateLine__Line-h9c4md-4 cjyweO" >
@@ -681,7 +681,7 @@ exports[`Storyshots Annotate With Avatars 1`] = ` className="AnnotateLine__Line-h9c4md-4 cjyweO" >
@@ -786,7 +786,7 @@ exports[`Storyshots Annotate With Avatars 1`] = ` className="AnnotateLine__Line-h9c4md-4 cjyweO" >
@@ -926,7 +926,7 @@ exports[`Storyshots Annotate With Avatars 1`] = ` className="AnnotateLine__Line-h9c4md-4 cjyweO" >
@@ -1033,7 +1033,7 @@ exports[`Storyshots Annotate With Avatars 1`] = ` className="AnnotateLine__Line-h9c4md-4 cjyweO" >
@@ -1100,7 +1100,7 @@ exports[`Storyshots Annotate With Avatars 1`] = ` className="AnnotateLine__Line-h9c4md-4 cjyweO" >
Date: Wed, 21 Oct 2020 15:39:02 +0200 Subject: [PATCH 19/28] update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84b68d3018..05ff4a8a18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased ### Added - Generation of email addresses for users, where none is configured ([#1370](https://github.com/scm-manager/scm-manager/pull/1370)) -- Add mechanism for deploying ui content ([#1382](https://github.com/scm-manager/scm-manager/pull/1382)) +- Plugins can now expose ui components to be shared with other plugins ([#1382](https://github.com/scm-manager/scm-manager/pull/1382)) - Source code fullscreen view ([#1376](https://github.com/scm-manager/scm-manager/pull/1376)) ### Changed From a9ed357f75d4dc3ff9d68e988cfe3f8178ef4e97 Mon Sep 17 00:00:00 2001 From: Konstantin Schaper Date: Wed, 21 Oct 2020 19:42:43 +0200 Subject: [PATCH 20/28] improve string literal highlighting color contrast --- scm-ui/ui-styles/src/syntax-highlighting.css | 2 +- scm-ui/ui-styles/src/syntax-highlighting.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scm-ui/ui-styles/src/syntax-highlighting.css b/scm-ui/ui-styles/src/syntax-highlighting.css index 68ab444015..71c052bdcf 100644 --- a/scm-ui/ui-styles/src/syntax-highlighting.css +++ b/scm-ui/ui-styles/src/syntax-highlighting.css @@ -177,7 +177,7 @@ pre[class*="language-"] { .token.builtin, .token.inserted { - color: #cca201; + color: #005f9a; } diff --git a/scm-ui/ui-styles/src/syntax-highlighting.ts b/scm-ui/ui-styles/src/syntax-highlighting.ts index 004013a2a1..46c319d15e 100644 --- a/scm-ui/ui-styles/src/syntax-highlighting.ts +++ b/scm-ui/ui-styles/src/syntax-highlighting.ts @@ -130,22 +130,22 @@ export default { color: "#2c99c7", }, selector: { - color: "#cca201", + color: "#005f9a", }, "attr-name": { - color: "#cca201", + color: "#005f9a", }, string: { - color: "#cca201", + color: "#005f9a", }, char: { - color: "#cca201", + color: "#005f9a", }, builtin: { - color: "#cca201", + color: "#005f9a", }, inserted: { - color: "#cca201", + color: "#005f9a", }, operator: { color: "#686868", From 0442a28f7c4c7a20523643445a86566169d83fe8 Mon Sep 17 00:00:00 2001 From: Konstantin Schaper Date: Wed, 21 Oct 2020 20:07:56 +0200 Subject: [PATCH 21/28] update storyshots --- .../src/__snapshots__/storyshots.test.ts.snap | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap index 77b1f1ebc5..2129da9f5e 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -204,7 +204,7 @@ exports[`Storyshots Annotate Default 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -431,7 +431,7 @@ exports[`Storyshots Annotate Default 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -767,7 +767,7 @@ exports[`Storyshots Annotate With Avatars 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -1004,7 +1004,7 @@ exports[`Storyshots Annotate With Avatars 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -48062,7 +48062,7 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -50223,7 +50223,7 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -50259,7 +50259,7 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -50464,7 +50464,7 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -50680,7 +50680,7 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -50869,7 +50869,7 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -50955,7 +50955,7 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -51010,7 +51010,7 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -51128,7 +51128,7 @@ exports[`Storyshots SyntaxHighlighter Go 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -52542,7 +52542,7 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -53187,7 +53187,7 @@ exports[`Storyshots SyntaxHighlighter Java 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -53920,7 +53920,7 @@ exports[`Storyshots SyntaxHighlighter Javascript 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -54186,7 +54186,7 @@ exports[`Storyshots SyntaxHighlighter Javascript 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -54211,7 +54211,7 @@ exports[`Storyshots SyntaxHighlighter Javascript 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -54307,7 +54307,7 @@ exports[`Storyshots SyntaxHighlighter Javascript 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -55049,7 +55049,7 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -55069,7 +55069,7 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -55216,7 +55216,7 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -55396,7 +55396,7 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -55497,7 +55497,7 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -55675,7 +55675,7 @@ exports[`Storyshots SyntaxHighlighter Python 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -56869,7 +56869,7 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > @@ -57394,7 +57394,7 @@ exports[`Storyshots SyntaxHighlighter Without line numbers 1`] = ` className="token" style={ Object { - "color": "#cca201", + "color": "#005f9a", } } > From 88286623a81fb98ecfcc53e4550d0c1be7c6204d Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Thu, 22 Oct 2020 10:17:51 +0200 Subject: [PATCH 22/28] Move syntax-highlighter theme from ui-styles to ui-components --- scm-ui/ui-components/package.json | 4 ++ .../build-syntax-highlighting-javascript.js | 0 .../ui-components/src/SyntaxHighlighter.tsx | 2 +- .../src/__snapshots__/storyshots.test.ts.snap | 2 +- .../src/repos/TokenizedDiffView.tsx | 2 +- .../src/repos/annotate/Annotate.tsx | 2 +- .../src/syntax-highlighting.css | 0 .../src/syntax-highlighting.ts | 0 scm-ui/ui-styles/package.json | 2 - yarn.lock | 54 +++++++++++++++---- 10 files changed, 51 insertions(+), 17 deletions(-) rename scm-ui/{ui-styles => ui-components}/scripts/build-syntax-highlighting-javascript.js (100%) rename scm-ui/{ui-styles => ui-components}/src/syntax-highlighting.css (100%) rename scm-ui/{ui-styles => ui-components}/src/syntax-highlighting.ts (100%) diff --git a/scm-ui/ui-components/package.json b/scm-ui/ui-components/package.json index cc0773fff1..c4c8eb61fe 100644 --- a/scm-ui/ui-components/package.json +++ b/scm-ui/ui-components/package.json @@ -23,6 +23,7 @@ "@storybook/addon-storyshots": "^5.2.3", "@storybook/react": "^5.2.3", "@types/classnames": "^2.2.9", + "@types/css": "^0.0.31", "@types/enzyme": "^3.10.3", "@types/fetch-mock": "^7.3.1", "@types/jest": "^24.0.19", @@ -36,6 +37,8 @@ "@types/refractor": "^2.8.0", "@types/storybook__addon-storyshots": "^5.1.1", "@types/styled-components": "^5.1.0", + "@types/to-camel-case": "^1.0.0", + "css": "^3.0.0", "enzyme-context": "^1.1.2", "enzyme-context-react-router-4": "^2.0.0", "fetch-mock": "^7.5.1", @@ -43,6 +46,7 @@ "raf": "^3.4.0", "react-test-renderer": "^16.10.2", "storybook-addon-i18next": "^1.2.1", + "to-camel-case": "^1.0.0", "typescript": "^3.7.2", "worker-plugin": "^3.2.0" }, diff --git a/scm-ui/ui-styles/scripts/build-syntax-highlighting-javascript.js b/scm-ui/ui-components/scripts/build-syntax-highlighting-javascript.js similarity index 100% rename from scm-ui/ui-styles/scripts/build-syntax-highlighting-javascript.js rename to scm-ui/ui-components/scripts/build-syntax-highlighting-javascript.js diff --git a/scm-ui/ui-components/src/SyntaxHighlighter.tsx b/scm-ui/ui-components/src/SyntaxHighlighter.tsx index dd87020403..852335e161 100644 --- a/scm-ui/ui-components/src/SyntaxHighlighter.tsx +++ b/scm-ui/ui-components/src/SyntaxHighlighter.tsx @@ -25,7 +25,7 @@ import React from "react"; import { PrismAsyncLight as ReactSyntaxHighlighter } from "react-syntax-highlighter"; // eslint-disable-next-line no-restricted-imports -import highlightingTheme from "@scm-manager/ui-styles/src/syntax-highlighting"; +import highlightingTheme from "./syntax-highlighting"; type Props = { language?: string; diff --git a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap index 2129da9f5e..c2b467e9b6 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -4391,7 +4391,7 @@ exports[`Storyshots Diff Binaries 1`] = ` - add + modify
Date: Thu, 22 Oct 2020 10:31:03 +0200 Subject: [PATCH 23/28] Do not check generation scripts of ui-components --- scm-ui/ui-components/tsconfig.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scm-ui/ui-components/tsconfig.json b/scm-ui/ui-components/tsconfig.json index 7e3ee63a2d..9aa573a38d 100644 --- a/scm-ui/ui-components/tsconfig.json +++ b/scm-ui/ui-components/tsconfig.json @@ -1,3 +1,6 @@ { - "extends": "@scm-manager/tsconfig" + "extends": "@scm-manager/tsconfig", + "exclude": [ + "./scripts" + ] } From 49607236e5c77bd6d270e160c3a6c487333dd7b7 Mon Sep 17 00:00:00 2001 From: Konstantin Schaper Date: Thu, 22 Oct 2020 10:52:56 +0200 Subject: [PATCH 24/28] update storyshots --- scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap index c2b467e9b6..2129da9f5e 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -4391,7 +4391,7 @@ exports[`Storyshots Diff Binaries 1`] = ` - modify + add
Date: Thu, 22 Oct 2020 14:39:09 +0200 Subject: [PATCH 25/28] Reduce logging of ApiTokenRealm --- CHANGELOG.md | 1 + .../src/main/java/sonia/scm/security/ApiKeyRealm.java | 10 ++++++---- .../java/sonia/scm/security/ApiKeyTokenHandler.java | 5 ++--- .../test/java/sonia/scm/security/ApiKeyRealmTest.java | 10 ++++++++++ 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05ff4a8a18..d455122b12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Source code fullscreen view ([#1376](https://github.com/scm-manager/scm-manager/pull/1376)) ### Changed +- Reduce logging of ApiTokenRealm ([#1385](https://github.com/scm-manager/scm-manager/pull/1385)) - Centralise syntax highlighting ([#1382](https://github.com/scm-manager/scm-manager/pull/1382)) ## [2.6.3] - 2020-10-16 diff --git a/scm-webapp/src/main/java/sonia/scm/security/ApiKeyRealm.java b/scm-webapp/src/main/java/sonia/scm/security/ApiKeyRealm.java index 672f972dab..a447388d97 100644 --- a/scm-webapp/src/main/java/sonia/scm/security/ApiKeyRealm.java +++ b/scm-webapp/src/main/java/sonia/scm/security/ApiKeyRealm.java @@ -24,6 +24,7 @@ package sonia.scm.security; +import com.google.common.io.BaseEncoding; import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationToken; import org.apache.shiro.authc.UsernamePasswordToken; @@ -61,13 +62,14 @@ public class ApiKeyRealm extends AuthenticatingRealm { } @Override + @SuppressWarnings("java:S4738") // java.util.Base64 has no canDecode method public boolean supports(AuthenticationToken token) { if (token instanceof UsernamePasswordToken || token instanceof BearerToken) { - boolean containsDot = getPassword(token).contains("."); - if (containsDot) { - LOG.debug("Ignoring token with at least one dot ('.'); this is probably a JWT token"); + boolean isBase64 = BaseEncoding.base64().canDecode(getPassword(token)); + if (!isBase64) { + LOG.debug("Ignoring non base 64 token; this is probably a JWT token or a normal password"); } - return !containsDot; + return isBase64; } return false; } diff --git a/scm-webapp/src/main/java/sonia/scm/security/ApiKeyTokenHandler.java b/scm-webapp/src/main/java/sonia/scm/security/ApiKeyTokenHandler.java index 34ee392060..71478e7bc5 100644 --- a/scm-webapp/src/main/java/sonia/scm/security/ApiKeyTokenHandler.java +++ b/scm-webapp/src/main/java/sonia/scm/security/ApiKeyTokenHandler.java @@ -28,7 +28,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import io.jsonwebtoken.io.Decoder; import io.jsonwebtoken.io.Decoders; -import io.jsonwebtoken.io.DecodingException; import io.jsonwebtoken.io.Encoder; import io.jsonwebtoken.io.Encoders; import lombok.AllArgsConstructor; @@ -62,8 +61,8 @@ class ApiKeyTokenHandler { Optional readToken(String token) { try { return of(OBJECT_MAPPER.readValue(decoder.decode(token), Token.class)); - } catch (IOException | DecodingException e) { - LOG.warn("error reading api token", e); + } catch (IOException e) { + LOG.debug("failed to read api token, perhaps it is a jwt token or a normal password", e); return empty(); } } diff --git a/scm-webapp/src/test/java/sonia/scm/security/ApiKeyRealmTest.java b/scm-webapp/src/test/java/sonia/scm/security/ApiKeyRealmTest.java index 0f4171b8d9..f53e845bf2 100644 --- a/scm-webapp/src/test/java/sonia/scm/security/ApiKeyRealmTest.java +++ b/scm-webapp/src/test/java/sonia/scm/security/ApiKeyRealmTest.java @@ -25,6 +25,7 @@ package sonia.scm.security; import org.apache.shiro.authc.AuthenticationToken; +import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.authz.AuthorizationException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -105,6 +106,15 @@ class ApiKeyRealmTest { assertThat(supports).isFalse(); } + @Test + void shouldIgnoreNonBase64Tokens() { + UsernamePasswordToken token = new UsernamePasswordToken("trillian", "My&SecretPassword"); + + boolean supports = realm.supports(token); + + assertThat(supports).isFalse(); + } + void verifyScopeSet(String... permissions) { verify(authenticationInfoBuilder).withScope(argThat(scope -> { assertThat(scope).containsExactly(permissions); From 86b4dfb92a0d1d9d044f1d02d95f35526558fe58 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Thu, 22 Oct 2020 14:46:40 +0200 Subject: [PATCH 26/28] log stacktrace of failed api token parsing only if trace is enabled --- .../src/main/java/sonia/scm/security/ApiKeyTokenHandler.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scm-webapp/src/main/java/sonia/scm/security/ApiKeyTokenHandler.java b/scm-webapp/src/main/java/sonia/scm/security/ApiKeyTokenHandler.java index 71478e7bc5..3fa6e7359f 100644 --- a/scm-webapp/src/main/java/sonia/scm/security/ApiKeyTokenHandler.java +++ b/scm-webapp/src/main/java/sonia/scm/security/ApiKeyTokenHandler.java @@ -62,7 +62,10 @@ class ApiKeyTokenHandler { try { return of(OBJECT_MAPPER.readValue(decoder.decode(token), Token.class)); } catch (IOException e) { - LOG.debug("failed to read api token, perhaps it is a jwt token or a normal password", e); + LOG.debug("failed to read api token, perhaps it is a jwt token or a normal password"); + if (LOG.isTraceEnabled()) { + LOG.trace("failed to parse token", e); + } return empty(); } } From 1195026fe644219794bcd341e149200bf0fe042d Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Thu, 22 Oct 2020 14:09:52 +0200 Subject: [PATCH 27/28] Fix handling of snapshot plugin dependencies --- CHANGELOG.md | 3 +++ .../src/main/java/sonia/scm/version/Version.java | 13 +++++++++++-- .../test/java/sonia/scm/version/VersionTest.java | 7 +++++++ .../scm/plugin/PluginInstallationVerifierTest.java | 11 +++++++++++ 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05ff4a8a18..544c29ae20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Centralise syntax highlighting ([#1382](https://github.com/scm-manager/scm-manager/pull/1382)) +### Fixed +- Handling of snapshot plugin dependencies ([#1384](https://github.com/scm-manager/scm-manager/pull/1384)) + ## [2.6.3] - 2020-10-16 ### Fixed - Missing default permission to manage public gpg keys ([#1377](https://github.com/scm-manager/scm-manager/pull/1377)) diff --git a/scm-core/src/main/java/sonia/scm/version/Version.java b/scm-core/src/main/java/sonia/scm/version/Version.java index c6edb05daa..a47a3ba9af 100644 --- a/scm-core/src/main/java/sonia/scm/version/Version.java +++ b/scm-core/src/main/java/sonia/scm/version/Version.java @@ -31,6 +31,8 @@ import com.google.common.base.Preconditions; import com.google.common.collect.ComparisonChain; import java.util.Locale; +import java.util.regex.Matcher; +import java.util.regex.Pattern; //~--- JDK imports ------------------------------------------------------------ @@ -43,6 +45,8 @@ import java.util.Locale; public final class Version implements Comparable { + private static final Pattern MAVEN_UNIQUE_SNAPSHOT = Pattern.compile("-[0-9]{8}\\.[0-9]{6}-[0-9]+"); + /** * Constructs a new version object * @@ -388,10 +392,15 @@ public final class Version implements Comparable { String qualifier = qualifierPart.trim().toLowerCase(Locale.ENGLISH); - if (qualifier.contains("snapshot")) - { + if (qualifier.contains("snapshot")) { snapshot = true; qualifier = qualifier.replace("snapshot", ""); + } else { + Matcher matcher = MAVEN_UNIQUE_SNAPSHOT.matcher(qualifier); + if (matcher.matches()) { + snapshot = true; + qualifier = matcher.replaceAll("-"); + } } if (qualifier.length() > 0) diff --git a/scm-core/src/test/java/sonia/scm/version/VersionTest.java b/scm-core/src/test/java/sonia/scm/version/VersionTest.java index b58d355831..db96e76163 100644 --- a/scm-core/src/test/java/sonia/scm/version/VersionTest.java +++ b/scm-core/src/test/java/sonia/scm/version/VersionTest.java @@ -145,4 +145,11 @@ class VersionTest { void testUnparseable() { assertThrows(VersionParseException.class, () -> Version.parse("aaaa")); } + + @Test + void shouldDetectUniqueMavenSnapshotVersion() { + Version version = Version.parse("1.0.0-20201022.094711-15"); + assertThat(version.isSnapshot()).isTrue(); + assertThat(version).hasToString("1.0.0-SNAPSHOT"); + } } diff --git a/scm-webapp/src/test/java/sonia/scm/plugin/PluginInstallationVerifierTest.java b/scm-webapp/src/test/java/sonia/scm/plugin/PluginInstallationVerifierTest.java index 37597c806f..791f874235 100644 --- a/scm-webapp/src/test/java/sonia/scm/plugin/PluginInstallationVerifierTest.java +++ b/scm-webapp/src/test/java/sonia/scm/plugin/PluginInstallationVerifierTest.java @@ -144,6 +144,17 @@ class PluginInstallationVerifierTest { PluginInstallationVerifier.verify(context, descriptor); } + @Test + @SuppressWarnings("squid:S2699") // we are happy if no exception is thrown + void shouldVerifyPluginWithSnapshotDependencies() { + matchConditions(); + + PluginInstallationContext context = mockInstallationOf(IID_PLUGIN, "1.0.0-SNAPSHOT"); + mockDependingOf(IID_PLUGIN, "1.0.0-20201022.094711-15"); + + PluginInstallationVerifier.verify(context, descriptor); + } + @Test @SuppressWarnings("squid:S2699") // we are happy if no exception is thrown void shouldVerifyPluginWithOptionalDependency() { From 3be2d5acb4b421b18561b79815d66b6f98754639 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Thu, 22 Oct 2020 16:05:34 +0200 Subject: [PATCH 28/28] Revert removal of DecodingException catch --- .../src/main/java/sonia/scm/security/ApiKeyTokenHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scm-webapp/src/main/java/sonia/scm/security/ApiKeyTokenHandler.java b/scm-webapp/src/main/java/sonia/scm/security/ApiKeyTokenHandler.java index 3fa6e7359f..de38346aec 100644 --- a/scm-webapp/src/main/java/sonia/scm/security/ApiKeyTokenHandler.java +++ b/scm-webapp/src/main/java/sonia/scm/security/ApiKeyTokenHandler.java @@ -28,6 +28,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import io.jsonwebtoken.io.Decoder; import io.jsonwebtoken.io.Decoders; +import io.jsonwebtoken.io.DecodingException; import io.jsonwebtoken.io.Encoder; import io.jsonwebtoken.io.Encoders; import lombok.AllArgsConstructor; @@ -61,7 +62,7 @@ class ApiKeyTokenHandler { Optional readToken(String token) { try { return of(OBJECT_MAPPER.readValue(decoder.decode(token), Token.class)); - } catch (IOException e) { + } catch (IOException | DecodingException e) { LOG.debug("failed to read api token, perhaps it is a jwt token or a normal password"); if (LOG.isTraceEnabled()) { LOG.trace("failed to parse token", e);