From f8d17b11ddeef02713388a7b36b21251859c0461 Mon Sep 17 00:00:00 2001 From: Rodrigo Fernandes Date: Sun, 19 Jan 2020 01:46:13 +0000 Subject: [PATCH 1/4] release: New major refactor of diff2html to Typescript :breaking: --- .circleci/config.yml | 11 +- README.md | 32 ++--- package.json | 25 +++- src/yargs.ts | 272 +++++++++++++++++++++---------------------- 4 files changed, 175 insertions(+), 165 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f02b047..8579cf1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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" @@ -110,7 +109,7 @@ jobs: docker: - image: node:13 - publish_library: + publish_cli: docker: - image: node:13 working_directory: ~/workdir @@ -188,7 +187,7 @@ workflows: - build-node-11 - build-node-12 - build-node-13 - - publish_library: + - publish_cli: requires: - publish_approval \ No newline at end of file diff --git a/README.md b/README.md index 1f9f4a4..96a1ac1 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ Diff to Html generates pretty HTML diffs from unified and git diff output in you - [Setup](#setup) - [Usage](#usage) - [Custom HTML wrapper template](#custom-html-wrapper-template) - - [Examples:](#examples) -- [Contributions](#contributions) + - [Examples](#examples) +- [Contribute](#contribute) - [Developing](#developing) - [License](#license) - [Thanks](#thanks) @@ -61,11 +61,13 @@ Diff to Html generates pretty HTML diffs from unified and git diff output in you ## Setup - npm install -g diff2html-cli +```sh +npm install -g diff2html-cli +``` ## Usage -Usage: diff2html [options] -- [diff args] +Usage: diff2html [ flags and/or options ] -- [git diff passthrough flags and options] | flag | alias | description | choices | default | | ----- | ------------------------ | -------------------------------------------------------------------------- | ---------------------------- | --------- | @@ -73,17 +75,17 @@ Usage: diff2html [options] -- [diff args] | --sc | --synchronisedScroll | Synchronised horizontal scroll | `true`, `false` | `true` | | --hc | --highlightCode | Highlight code | `true`, `false` | `true` | | --su | --summary | Show files summary | `closed`, `open`, `hidden` | `closed` | -| --d | --diffStyle | Diff style | `word`, `char` | `word` | +| -d | --diffStyle | Diff style | `word`, `char` | `word` | | --lm | --matching | Diff line matching type | `lines`, `words`, `none` | `none` | | --lmt | --matchWordsThreshold | Diff line matching word threshold | | `0.25` | | --lmm | --matchingMaxComparisons | Diff line matching maximum line comparisons of a block of changes | `2500` | -| --hwt | --htmlWrapperTemplate | Path to custom template to be rendered when using the `html` output format | _[string]_ | +| --hwt | --htmlWrapperTemplate | Path to custom template to be rendered when using the `html` output format | `[string]` | | -f | --format | Output format | `html`, `json` | `html` | | -i | --input | Diff input source | `file`, `command`, `stdin` | `command` | | -o | --output | Output destination | `preview`, `stdout` | `preview` | | -u | --diffy | Upload to diffy.org | `browser`, `pbcopy`, `print` | | -| -F | --file | Send output to file (overrides output option) | _[string]_ | | -| --ig | --ignore | Ignore particular files from the diff | _[string]_ | | +| -F | --file | Send output to file (overrides output option) | `[string]` | | +| --ig | --ignore | Ignore particular files from the diff | `[string]` | | | -v | --version | Show version number | | | | -h | --help | Show help | | | @@ -97,13 +99,13 @@ they are here: - Inside the `` tag -``` +```html