release: New major refactor of diff2html to Typescript

:breaking:
This commit is contained in:
Rodrigo Fernandes 2020-01-19 01:48:00 +00:00
parent df4481fdbf
commit fd1a13c1e2
No known key found for this signature in database
GPG key ID: 67157D2E3D4258B4
4 changed files with 23 additions and 11 deletions

View file

@ -10,16 +10,15 @@ jobs:
- run:
name: Get next version
command: |
# Hack: Set a unique fake name for the release branch to avoid releasing master as the new 3.x major release for now
export NEXT_VERSION="$(/bin/git-version --folder=$PWD --release-branch=FAKE-RELEASE-BRANCH-NAME)"
export NEXT_VERSION="$(/bin/git-version --folder=$PWD --release-branch=master)"
echo "Next version is ${NEXT_VERSION}"
echo "${NEXT_VERSION}" > .version
- run:
name: Get next npm tag name
command: |
if [ "${GITHUB_REF#refs/heads/}" = "master" ]; then
if [ "${CIRCLE_BRANCH}" = "master" ]; then
export PUBLISH_TAG="latest"
elif [ "${GITHUB_REF#refs/heads/}" = "next" ]; then
elif [ "${CIRCLE_BRANCH}" = "next" ]; then
export PUBLISH_TAG="next"
else
export PUBLISH_TAG="pr"

View file

@ -11,7 +11,7 @@
[![node](https://img.shields.io/node/v/diff2html.svg)]() [![npm](https://img.shields.io/npm/l/diff2html.svg)]()
[![npm](https://img.shields.io/npm/dm/diff2html.svg)](https://www.npmjs.com/package/diff2html)
[![All Contributors](https://img.shields.io/badge/all_contributors-22-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-22-orange.svg?style=flat-square)](#contributors)
[![Gitter](https://badges.gitter.im/rtfpessoa/diff2html.svg)](https://gitter.im/rtfpessoa/diff2html?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
diff2html generates pretty HTML diffs from git diff or unified diff output.
@ -25,13 +25,14 @@ diff2html generates pretty HTML diffs from git diff or unified diff output.
- [Features](#features)
- [Online Example](#online-example)
- [Distributions](#distributions)
- [Usage](#usage)
- [Diff2Html Usage](#diff2html-usage)
- [Diff2Html API](#diff2html-api)
- [Diff2Html Configuration](#diff2html-configuration)
- [Diff2Html Browser](#diff2html-browser)
- [Diff2Html NPM / Node.js Library](#diff2html-npm--nodejs-library)
- [Diff2Html Examples](#diff2html-examples)
- [Diff2HtmlUI](#diff2htmlui)
- [Diff2HtmlUI Usage](#diff2htmlui-usage)
- [Diff2HtmlUI API](#diff2htmlui-api)
- [Diff2HtmlUI Configuration](#diff2htmlui-configuration)
- [Diff2HtmlUI Browser](#diff2htmlui-browser)
@ -101,6 +102,17 @@ diff2html generates pretty HTML diffs from git diff or unified diff output.
including a `highlight.js` implementation. You can use it without syntax highlight or by passing your own
implementation with the languages you prefer
## Usage
Diff2Html can be used in various ways as listed in the [distributions](#distributions) section. The two main ways are:
- [Diff2Html](#diff2html-usage): using the parser and html generator directly from the library gives you complete
control about what you can do with the json or html generated.
- [Diff2HtmlUI](#diff2htmlui-usage): using this wrapper makes it easy to inject the html in the DOM and adds some nice
features to the diff, like syntax highlight.
Bellow you can find more details and exemples about each option.
## Diff2Html Usage
To load correctly in the Browser you always need to include the stylesheet in the final HTML.
@ -266,7 +278,7 @@ export default {
</script>
```
## Diff2HtmlUI
## Diff2HtmlUI Usage
> Simple wrapper to ease simple tasks in the browser such as: code highlight and js effects

View file

@ -48,8 +48,9 @@
"build:css": "rm -rf ./bundles/css; postcss --config ./postcss.config.js --no-map -o ./bundles/css/diff2html.min.css ./src/ui/css/diff2html.css",
"build:templates": "ts-node ./scripts/hulk.ts --wrapper ts --variable 'defaultTemplates' ./src/templates/*.mustache > ./src/diff2html-templates.ts",
"build:website": "rm -rf docs; webpack ---display-reasons --display-modules --mode production --config webpack.website.ts",
"build:toc-base": "markdown-toc --maxdepth 3 --bullets='-' -i",
"build:toc": "yarn run build:toc-base README.md",
"gen": "yarn run gen:toc",
"gen:toc-base": "markdown-toc --maxdepth 3 --bullets='-' -i",
"gen:toc": "yarn run gen:toc-base README.md",
"test": "is-ci 'test:coverage' 'test:watch'",
"test:coverage": "jest --coverage",
"test:watch": "jest --watch",
@ -82,7 +83,7 @@
"git add"
],
"README.md": [
"yarn run build:toc-base",
"yarn run gen:toc-base",
"git add"
]
},

View file

@ -60,7 +60,7 @@
<a class="navbar-item" href="index.html#install">Getting Started</a>
<a class="navbar-item" href="index.html#cli">CLI</a>
<a class="navbar-item" href="demo.html">Demo</a>
<a class="navbar-item" href="https://github.com/rtfpessoa/diff2html#how-to-use" target="_blank"
<a class="navbar-item" href="https://github.com/rtfpessoa/diff2html#usage" target="_blank"
rel="noopener" rel="noreferrer">Docs</a>
<a class="navbar-item" href="https://github.com/rtfpessoa/diff2html/issues/new" target="_blank"
rel="noopener" rel="noreferrer">Support</a>