Skip to content

Commit

Permalink
Merge branch 'release/v2.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkGriffiths committed Jul 17, 2020
2 parents 4c0dff6 + 648012f commit c45f107
Show file tree
Hide file tree
Showing 17 changed files with 3,709 additions and 3,687 deletions.
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,23 @@ branches:
only:
- master
- develop
- /^greenkeeper/.*$/
- /^feature/.*$/
language: node_js
node_js:
- stable
- 12
- 11
- 10
env:
global:
- CC_TEST_REPORTER_ID=ba42fc27c58fe141f19793fa5acb42d4d229da491a4c7a1568ba50a69a009e1f
before_install:
- npm i -g npm
- npm install -g greenkeeper-lockfile
install: npm ci --no-optional
before_script:
- greenkeeper-lockfile-update
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
after_script:
- greenkeeper-lockfile-upload
- "[ $TRAVIS_NODE_VERSION = stable ] && nyc report --reporter=lcov && ./cc-test-reporter
after-build --debug -t lcov --exit-code $TRAVIS_TEST_RESULT || echo 'Coverage skipped'"
notifications:
Expand Down
87 changes: 46 additions & 41 deletions bin/truwrap
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ var getStdin = _interopDefault(require('get-stdin'));
var updateNotifier = _interopDefault(require('update-notifier'));
var commonTags = require('common-tags');
var string = require('@thebespokepixel/string');
var _merge = _interopDefault(require('lodash/merge'));
var trucolor = require('trucolor');
var deepAssign = _interopDefault(require('deep-assign'));
var path = require('path');
var terminalFeatures = _interopDefault(require('term-ng'));
var columnify = _interopDefault(require('columnify'));
var osLocale = _interopDefault(require('os-locale'));
Expand All @@ -19,14 +20,13 @@ var meta = _interopDefault(require('@thebespokepixel/meta'));
var nSelector = require('@thebespokepixel/n-selector');
var ansiRegex = _interopDefault(require('ansi-regex'));
var fs = require('fs');
var path = require('path');
var _min = _interopDefault(require('lodash/min'));
var _max = _interopDefault(require('lodash/max'));
var _split = _interopDefault(require('lodash/split'));
var _forEach = _interopDefault(require('lodash/forEach'));

const name = "truwrap";
const version = "2.0.2";
const version = "2.0.3";
const description = "Smarter terminal text wrapping (handles 24bit color)";
const author = "Mark Griffiths <[email protected]> (http://thebespokepixel.com/)";
const main = "index.js";
Expand Down Expand Up @@ -57,42 +57,42 @@ const scripts = {
};
const devDependencies = {
"@ava/babel": "^1.0.1",
"@babel/core": "^7.8.4",
"@babel/preset-env": "^7.8.4",
ava: "^3.3.0",
"@babel/core": "^7.10.5",
"@babel/preset-env": "^7.10.4",
ava: "^3.10.1",
"babel-plugin-lodash": "^3.3.4",
"documentation-theme-bespoke": "^1.1.3",
"documentation-theme-bespoke": "^1.1.6",
gulp: "^4.0.2",
"gulp-better-rollup": "^4.0.1",
"gulp-chmod": "^3.0.0",
"gulp-rename": "^2.0.0",
nyc: "^15.0.0",
rollup: "^1.31.1",
"rollup-plugin-babel": "^4.3.3",
nyc: "^15.1.0",
rollup: "^2.21.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"semver-regex": "^3.1.1",
xo: "^0.26.1"
xo: "^0.32.1"
};
const dependencies = {
"@thebespokepixel/meta": "^2.0.2",
"@thebespokepixel/n-selector": "^2.0.1",
"@thebespokepixel/string": "^1.0.1",
"@thebespokepixel/meta": "^2.0.4",
"@thebespokepixel/n-selector": "^2.0.2",
"@thebespokepixel/string": "^1.0.3",
"ansi-regex": "^5.0.0",
columnify: "^1.5.4",
"common-tags": "^1.8.0",
"deep-assign": "^3.0.0",
"es6-promisify": "^6.0.2",
"get-stdin": "^7.0.0",
lodash: "^4.17.15",
"os-locale": "^4.0.0",
"es6-promisify": "^6.1.1",
"get-stdin": "^8.0.0",
lodash: "^4.17.19",
"os-locale": "^5.0.0",
"read-pkg-up": "^7.0.1",
"term-ng": "^2.0.1",
trucolor: "^2.0.1",
"term-ng": "^2.0.2",
trucolor: "^2.0.2",
"update-notifier": "^4.1.0",
verbosity: "^2.0.1",
yargs: "^15.1.0"
verbosity: "^2.0.2",
yargs: "^15.4.1"
};
const engines = {
node: ">=10.0"
Expand Down Expand Up @@ -157,10 +157,7 @@ const badges = {
],
"Development Status": [
[
"greenkeeper",
"travis-com-dev"
],
[
"travis-com-dev",
"david-dev",
"david-devdeps-dev"
],
Expand Down Expand Up @@ -214,14 +211,14 @@ var pkg = {
badges: badges
};

const clr = deepAssign(trucolor.simple({
const clr = _merge(trucolor.simple({
format: 'sgr'
}), trucolor.palette({
format: 'sgr'
}, {
}), {
bright: 'bold rgb(255,255,255)',
dark: '#333'
}));
});
const colorReplacer = new commonTags.TemplateTag(commonTags.replaceSubstitutionTransformer(/([a-zA-Z]+?)[:/|](.+)/, (match, colorName, content) => `${clr[colorName]}${content}${clr[colorName].out}`));

const tabRegex = /\t/g;
Expand All @@ -232,7 +229,7 @@ class Tokeniser {
this.tokenisingRegex = tokenisingRegex || function () {
switch (renderMode.selected) {
case 'keep':
return /^.*$/mg;
return /^.*$/gm;

default:
return /\S+\s+/g;
Expand All @@ -250,7 +247,9 @@ class Tokeniser {

}

var createTokeniser = (tokenisingRegex => new Tokeniser(tokenisingRegex));
function createTokeniser(tokenisingRegex) {
return new Tokeniser(tokenisingRegex);
}

const newlineRegex$1 = /^>\/\\\/\/__<$/;
const tabRegex$1 = /^>T\/\\B<$/;
Expand Down Expand Up @@ -333,7 +332,9 @@ class LineFitter {

}

var createLineFitter = ((margin, width, tabWidth) => new LineFitter([margin, width, tabWidth]));
function createLineFitter(margin, width, tabWidth) {
return new LineFitter([margin, width, tabWidth]);
}

class WrapTool {
constructor({
Expand Down Expand Up @@ -369,16 +370,18 @@ class WrapTool {
}

this.lines.push(currentLine.toString());
return this.lines.map(this.tokeniser.restore).join('\n');
return this.lines.map(line => this.tokeniser.restore(line)).join('\n');
}

}

var createWrapTool = (options => new WrapTool(options));
function createWrapTool(options) {
return new WrapTool(options);
}

const prefix = '\u001B]1337;File=inline=1;';
const suffix = '\u0007';
const broken = `${__dirname}/../media/broken.png`;
const broken = path.join(__dirname, '/../media/broken.png');

class Image {
constructor({
Expand Down Expand Up @@ -427,9 +430,11 @@ class Image {

}

var createImage = (source => new Image(source));
function createImage(source) {
return new Image(source);
}

function parsePanel (buffer_, delimiter_, width_) {
function panel(buffer_, delimiter_, width_) {
let longIdx = 0;
let maxCols = 0;
const spacerCols = [];
Expand Down Expand Up @@ -616,7 +621,7 @@ const images = function () {
space: '\t',
cc: createImage({
name: 'logo',
file: `${__dirname}/../media/CCLogo.png`,
file: path.join(__dirname, '/../media/CCLogo.png'),
height: 3
})
};
Expand Down Expand Up @@ -841,12 +846,12 @@ if (argv.stamp) {

getStdin().then(input => {
if (argv.panel) {
const panel = parsePanel(input, argv.delimiter, renderer.getWidth());
renderer.panel(panel.content, {
const panel$1 = panel(input, argv.delimiter, renderer.getWidth());
renderer.panel(panel$1.content, {
maxLineWidth: renderer.getWidth(),
showHeaders: false,
truncate: argv.truncate,
config: panel.configuration
config: panel$1.configuration
});
} else {
renderer.write(input);
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/js/site.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c45f107

Please sign in to comment.