[Pkg-javascript-commits] [node-mocha] 07/10: Bundle support-color

Leo Iannacone l3on-guest at moszumanska.debian.org
Sat May 30 15:58:25 UTC 2015


This is an automated email from the git hooks/post-receive script.

l3on-guest pushed a commit to branch master
in repository node-mocha.

commit a606e6a9328b93e8d00189d6fe94c52235746474
Author: Leo Iannacone <info at leoiannacone.com>
Date:   Sat May 30 17:39:21 2015 +0200

    Bundle support-color
---
 debian/patches/0006_bundle_supports-color.patch | 279 ++++++++++++++++++++++++
 debian/patches/series                           |   1 +
 2 files changed, 280 insertions(+)

diff --git a/debian/patches/0006_bundle_supports-color.patch b/debian/patches/0006_bundle_supports-color.patch
new file mode 100644
index 0000000..4c187f6
--- /dev/null
+++ b/debian/patches/0006_bundle_supports-color.patch
@@ -0,0 +1,279 @@
+Description: Bundle supports-color - right now it is too small and
+ really only reverse depends on mocha.
+ Origin: https://github.com/sindresorhus/supports-color
+ Version: 1.3.1
+Author: Leo Iannacone <l3on at ubuntu.com>
+Forwarded: not-needed
+---
+ node_modules/supports-color/cli.js       |   15 +++++++
+ node_modules/supports-color/index.js     |   43 ++++++++++++++++++++
+ node_modules/supports-color/license      |   21 ++++++++++
+ node_modules/supports-color/package.json |   57 +++++++++++++++++++++++++++
+ node_modules/supports-color/readme.md    |   46 ++++++++++++++++++++++
+ node_modules/supports-color/test.js      |   64 +++++++++++++++++++++++++++++++
+ 6 files changed, 246 insertions(+)
+
+--- /dev/null
++++ b/node_modules/supports-color/cli.js
+@@ -0,0 +1,15 @@
++#!/usr/bin/env node
++'use strict';
++var meow = require('meow');
++var supportsColor = require('./');
++
++meow({
++	help: [
++		'Usage',
++		'  supports-color',
++		'',
++		'Exits with code 0 if color is supported and 1 if not'
++	].join('\n')
++});
++
++process.exit(supportsColor ? 0 : 1);
+--- /dev/null
++++ b/node_modules/supports-color/index.js
+@@ -0,0 +1,43 @@
++'use strict';
++var argv = process.argv;
++
++module.exports = (function () {
++	if ('FORCE_COLOR' in process.env) {
++		return true;
++	}
++
++	if (argv.indexOf('--no-color') !== -1 ||
++		argv.indexOf('--no-colors') !== -1 ||
++		argv.indexOf('--color=false') !== -1) {
++		return false;
++	}
++
++	if (argv.indexOf('--color') !== -1 ||
++		argv.indexOf('--colors') !== -1 ||
++		argv.indexOf('--color=true') !== -1 ||
++		argv.indexOf('--color=always') !== -1) {
++		return true;
++	}
++
++	if (process.stdout && !process.stdout.isTTY) {
++		return false;
++	}
++
++	if (process.platform === 'win32') {
++		return true;
++	}
++
++	if ('COLORTERM' in process.env) {
++		return true;
++	}
++
++	if (process.env.TERM === 'dumb') {
++		return false;
++	}
++
++	if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
++		return true;
++	}
++
++	return false;
++})();
+--- /dev/null
++++ b/node_modules/supports-color/license
+@@ -0,0 +1,21 @@
++The MIT License (MIT)
++
++Copyright (c) Sindre Sorhus <sindresorhus at gmail.com> (sindresorhus.com)
++
++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.
+--- /dev/null
++++ b/node_modules/supports-color/package.json
+@@ -0,0 +1,57 @@
++{
++  "name": "supports-color",
++  "version": "1.3.1",
++  "description": "Detect whether a terminal supports color",
++  "license": "MIT",
++  "repository": "sindresorhus/supports-color",
++  "author": {
++    "name": "Sindre Sorhus",
++    "email": "sindresorhus at gmail.com",
++    "url": "sindresorhus.com"
++  },
++  "maintainers": [
++    "Sindre Sorhus <sindresorhus at gmail.com> (sindresorhus.com)",
++    "Joshua Appelman <jappelman at xebia.com> (jbnicolai.com)"
++  ],
++  "bin": "cli.js",
++  "engines": {
++    "node": ">=0.8.0"
++  },
++  "scripts": {
++    "test": "mocha"
++  },
++  "files": [
++    "index.js",
++    "cli.js"
++  ],
++  "keywords": [
++    "cli-app",
++    "cli",
++    "bin",
++    "color",
++    "colour",
++    "colors",
++    "terminal",
++    "console",
++    "cli",
++    "ansi",
++    "styles",
++    "tty",
++    "rgb",
++    "256",
++    "shell",
++    "xterm",
++    "command-line",
++    "support",
++    "supports",
++    "capability",
++    "detect"
++  ],
++  "dependencies": {
++    "meow": "^3.1.0"
++  },
++  "devDependencies": {
++    "mocha": "*",
++    "require-uncached": "^1.0.2"
++  }
++}
+--- /dev/null
++++ b/node_modules/supports-color/readme.md
+@@ -0,0 +1,46 @@
++# supports-color [![Build Status](https://travis-ci.org/sindresorhus/supports-color.svg?branch=master)](https://travis-ci.org/sindresorhus/supports-color)
++
++> Detect whether a terminal supports color
++
++
++## Install
++
++```
++$ npm install --save supports-color
++```
++
++
++## Usage
++
++```js
++var supportsColor = require('supports-color');
++
++if (supportsColor) {
++	console.log('Terminal supports color');
++}
++```
++
++It obeys the `--color` and `--no-color` CLI flags.
++
++For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.
++
++
++## CLI
++
++```
++$ npm install --global supports-color
++```
++
++```
++$ supports-color --help
++
++  Usage
++    supports-color
++
++  Exits with code 0 if color is supported and 1 if not
++```
++
++
++## License
++
++MIT © [Sindre Sorhus](http://sindresorhus.com)
+--- /dev/null
++++ b/node_modules/supports-color/test.js
+@@ -0,0 +1,64 @@
++'use strict';
++var assert = require('assert');
++var requireUncached = require('require-uncached');
++
++beforeEach(function () {
++	process.stdout.isTTY = true;
++	process.argv = [];
++	process.env = {};
++});
++
++it('should return true if `FORCE_COLOR` is in env', function () {
++	process.env.FORCE_COLOR = true;
++	assert.equal(requireUncached('./'), true);
++});
++
++it('should return false if not TTY', function () {
++	process.stdout.isTTY = false;
++	assert.equal(requireUncached('./'), false);
++});
++
++it('should return false if --no-color flag is used', function () {
++	process.argv = ['--no-color'];
++	assert.equal(requireUncached('./'), false);
++});
++
++it('should return false if --no-colors flag is used', function () {
++	process.argv = ['--no-colors'];
++	assert.equal(requireUncached('./'), false);
++});
++
++it('should return true if --color flag is used', function () {
++	process.argv = ['--color'];
++	assert.equal(requireUncached('./'), true);
++});
++
++it('should return true if --colors flag is used', function () {
++	process.argv = ['--colors'];
++	assert.equal(requireUncached('./'), true);
++});
++
++it('should return false if `UPSTART_JOB` is in env', function () {
++	process.env.UPSTART_JOB = true;
++	assert.equal(requireUncached('./'), false);
++});
++
++it('should return true if `COLORTERM` is in env', function () {
++	process.env.COLORTERM = true;
++	assert.equal(requireUncached('./'), true);
++});
++
++it('should support `--color=true` flag', function () {
++	process.argv = ['--color=true'];
++	assert.equal(requireUncached('./'), true);
++});
++
++it('should support `--color=always` flag', function () {
++	process.argv = ['--color=always'];
++	assert.equal(requireUncached('./'), true);
++});
++
++it('should support `--color=false` flag', function () {
++	process.argv = ['--color=false'];
++	assert.equal(requireUncached('./'), false);
++});
diff --git a/debian/patches/series b/debian/patches/series
index a601ad5..763558a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@
 0003_image_and_css_in_usr_share.patch
 0004-bundle_escape-string-regexp.patch
 0005-test-ports.patch
+0006_bundle_supports-color.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-mocha.git



More information about the Pkg-javascript-commits mailing list