[Pkg-javascript-commits] [node-string-width] 02/09: Import Debian changes 2.0.0-1
Paolo Greppi
paolog-guest at moszumanska.debian.org
Mon Oct 30 09:48:28 UTC 2017
This is an automated email from the git hooks/post-receive script.
paolog-guest pushed a commit to branch master
in repository node-string-width.
commit c16d949951b1be2a001b2fceedeb3e6c63eb7d38
Author: Paolo Greppi <paolo.greppi at libpf.com>
Date: Tue Nov 22 11:01:22 2016 +0000
Import Debian changes 2.0.0-1
node-string-width (2.0.0-1) unstable; urgency=low
* Initial release (Closes: #845240, #842191)
* Add a patch to use mocha as test runner rather than ava and to
skip the xo style linter test step.
* Patch it to replace the dependency on is-fullwidth-code-point with
node-wcwidth.js.
* Add tests for zero-width non-joiners (ZWNJ) and zero-width joiners
(ZWJ) Unicode codepoints.
---
debian/changelog | 12 ++++++
debian/compat | 1 +
debian/control | 32 ++++++++++++++++
debian/copyright | 51 +++++++++++++++++++++++++
debian/docs | 1 +
debian/install | 2 +
debian/patches/00-mocha.diff | 73 ++++++++++++++++++++++++++++++++++++
debian/patches/01-wcwidth.diff | 43 +++++++++++++++++++++
debian/patches/02-test_zwj_zwnj.diff | 39 +++++++++++++++++++
debian/patches/series | 3 ++
debian/rules | 13 +++++++
debian/source/format | 1 +
debian/tests/control | 5 +++
debian/tests/require | 3 ++
debian/watch | 5 +++
15 files changed, 284 insertions(+)
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..0c2b1bd
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,12 @@
+node-string-width (2.0.0-1) unstable; urgency=low
+
+ * Initial release (Closes: #845240, #842191)
+ * Add a patch to use mocha as test runner rather than ava and to
+ skip the xo style linter test step.
+ * Patch it to replace the dependency on is-fullwidth-code-point with
+ node-wcwidth.js.
+ * Add tests for zero-width non-joiners (ZWNJ) and zero-width joiners
+ (ZWJ) Unicode codepoints.
+
+ -- Paolo Greppi <paolo.greppi at libpf.com> Tue, 22 Nov 2016 11:01:22 +0000
+
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..6d090d6
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,32 @@
+Source: node-string-width
+Section: web
+Priority: optional
+Maintainer: Debian Javascript Maintainers <pkg-javascript-devel at lists.alioth.debian.org>
+Uploaders: Paolo Greppi <paolo.greppi at libpf.com>
+Build-Depends:
+ debhelper (>= 9)
+ , dh-buildinfo
+ , nodejs,
+ mocha,
+ node-strip-ansi,
+ node-wcwidth.js
+Standards-Version: 3.9.8
+Homepage: https://github.com/sindresorhus/string-width#readme
+Vcs-Git: https://anonscm.debian.org/git/pkg-javascript/node-string-width.git
+Vcs-Browser: https://anonscm.debian.org/cgit/pkg-javascript/node-string-width.git
+
+Package: node-string-width
+Architecture: all
+Depends:
+ ${misc:Depends}
+ , nodejs
+ , node-wcwidth.js (>= 1.0.0)
+ , node-strip-ansi (>= 3.0.0)
+Description: Get the visual width of a string
+ Some Unicode characters are use more or less than the normal width when
+ output to the command-line.
+ .
+ This nodejs module gets the visual width of a string i.e. the actual
+ number of columns required to display it.
+ .
+ Node.js is an event-based server-side JavaScript engine.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..a4602b5
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,51 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: string-width
+Upstream-Contact: https://github.com/sindresorhus/string-width/issues
+Source: https://github.com/sindresorhus/string-width#readme
+
+Files: *
+Copyright: 2016 Sindre Sorhus <sindresorhus at gmail.com> (sindresorhus.com)
+License: Expat
+
+License: Expat
+ 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.
+
+Files: debian/*
+Copyright: 2016 Paolo Greppi <paolo.greppi at libpf.com>
+License: GPL-3.0+
+
+License: GPL-3.0+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
+
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..cdb5f04
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1 @@
+readme.md
diff --git a/debian/install b/debian/install
new file mode 100644
index 0000000..c92b8ea
--- /dev/null
+++ b/debian/install
@@ -0,0 +1,2 @@
+index.js usr/lib/nodejs/string-width/
+package.json usr/lib/nodejs/string-width/
diff --git a/debian/patches/00-mocha.diff b/debian/patches/00-mocha.diff
new file mode 100644
index 0000000..8fd5a21
--- /dev/null
+++ b/debian/patches/00-mocha.diff
@@ -0,0 +1,73 @@
+Description: Change from ava to mocha as test runner (ava is not yet
+ available as a Debian package). Skip the xo style linter test step
+ (xo is not available as a Debian package).
+Forwarded: not-needed
+Author: Paolo Greppi <paolo.greppi at libpf.com>
+
+Index: node-string-width/test.js
+===================================================================
+--- node-string-width.orig/test.js
++++ node-string-width/test.js
+@@ -1,22 +1,21 @@
+-import test from 'ava';
+-import m from './';
++var m = require('./');
++var assert = require('assert');
+
+-test('main', t => {
+- t.is(m('abcde'), 5);
+- t.is(m('古池や'), 6);
+- t.is(m('あいうabc'), 9);
+- t.is(m('ノード.js'), 9);
+- t.is(m('你好'), 4);
+- t.is(m('안녕하세요'), 10);
+- t.is(m('A\ud83c\ude00BC'), 5, 'surrogate');
+- t.is(m('\u001b[31m\u001b[39m'), 0);
++test('main', function() {
++ assert.equal(m('abcde'), 5);
++ assert.equal(m('古池や'), 6);
++ assert.equal(m('あいうabc'), 9);
++ assert.equal(m('ノード.js'), 9);
++ assert.equal(m('你好'), 4);
++ assert.equal(m('안녕하세요'), 10);
++ assert.equal(m('\u001b[31m\u001b[39m'), 0);
+ });
+
+-test('ignores control characters', t => {
+- t.is(m(String.fromCharCode(0)), 0);
+- t.is(m(String.fromCharCode(31)), 0);
+- t.is(m(String.fromCharCode(127)), 0);
+- t.is(m(String.fromCharCode(134)), 0);
+- t.is(m(String.fromCharCode(159)), 0);
+- t.is(m('\u001b'), 0);
++test('ignores control characters', function() {
++ assert.equal(m(String.fromCharCode(0)), 0);
++ assert.equal(m(String.fromCharCode(31)), 0);
++ assert.equal(m(String.fromCharCode(127)), 0);
++ assert.equal(m(String.fromCharCode(134)), 0);
++ assert.equal(m(String.fromCharCode(159)), 0);
++ assert.equal(m('\u001b'), 0);
+ });
+Index: node-string-width/package.json
+===================================================================
+--- node-string-width.orig/package.json
++++ node-string-width/package.json
+@@ -13,7 +13,7 @@
+ "node": ">=4"
+ },
+ "scripts": {
+- "test": "xo && ava"
++ "test": "mocha -u tdd"
+ },
+ "files": [
+ "index.js"
+@@ -49,8 +49,7 @@
+ "strip-ansi": "^3.0.0"
+ },
+ "devDependencies": {
+- "ava": "*",
+- "xo": "*"
++ "mocha": "*"
+ },
+ "xo": {
+ "esnext": true
diff --git a/debian/patches/01-wcwidth.diff b/debian/patches/01-wcwidth.diff
new file mode 100644
index 0000000..1a84794
--- /dev/null
+++ b/debian/patches/01-wcwidth.diff
@@ -0,0 +1,43 @@
+Description: Replace dependency on is-fullwidth-code-point with wcwidth.js.
+Forwarded: https://github.com/sindresorhus/string-width/issues/4
+Origin: vendor, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=842191#10
+Author: Paolo Greppi <paolo.greppi at libpf.com>
+
+Index: node-string-width/index.js
+===================================================================
+--- node-string-width.orig/index.js
++++ node-string-width/index.js
+@@ -1,6 +1,6 @@
+ 'use strict';
+ const stripAnsi = require('strip-ansi');
+-const isFullwidthCodePoint = require('is-fullwidth-code-point');
++const wcwidth = require('wcwidth.js');
+
+ module.exports = str => {
+ if (typeof str !== 'string' || str.length === 0) {
+@@ -24,11 +24,7 @@ module.exports = str => {
+ i++;
+ }
+
+- if (isFullwidthCodePoint(code)) {
+- width += 2;
+- } else {
+- width++;
+- }
++ width += wcwidth(code);
+ }
+
+ return width;
+Index: node-string-width/package.json
+===================================================================
+--- node-string-width.orig/package.json
++++ node-string-width/package.json
+@@ -45,7 +45,7 @@
+ "fixed-width"
+ ],
+ "dependencies": {
+- "is-fullwidth-code-point": "^2.0.0",
++ "wcwidth.js": "^1.0.0",
+ "strip-ansi": "^3.0.0"
+ },
+ "devDependencies": {
diff --git a/debian/patches/02-test_zwj_zwnj.diff b/debian/patches/02-test_zwj_zwnj.diff
new file mode 100644
index 0000000..315e9d5
--- /dev/null
+++ b/debian/patches/02-test_zwj_zwnj.diff
@@ -0,0 +1,39 @@
+Index: node-string-width/test.js
+===================================================================
+--- node-string-width.orig/test.js
++++ node-string-width/test.js
+@@ -19,3 +19,34 @@ test('ignores control characters', funct
+ assert.equal(m(String.fromCharCode(159)), 0);
+ assert.equal(m('\u001b'), 0);
+ });
++
++test('test zero-width non-joiner (ZWNJ) unicode codepoints', function() {
++ // all samples from https://en.wikipedia.org/wiki/Zero-width_non-joiner
++ assert.equal(m('می\u200cخواه'), 6);
++ assert.equal(m('עֲו\u200cנֹת'), 4);
++ assert.equal(m('Auf\u200clage'), 7);
++ assert.equal(m('Brot\u200czeit'), 8);
++ assert.equal(m('deaf\u200cly'), 6);
++ assert.equal(m('श्रीमान्\u200cको'), 8);
++});
++
++test('test zero-width joiner (ZWJ) unicode codepoints', function() {
++ // all samples from https://en.wikipedia.org/wiki/Zero-width_joiner
++ assert.equal(m('क्'), 1);
++ assert.equal(m('क्'), 1);
++ assert.equal(m('क्ष'), 2);
++ assert.equal(m('क्ष'), 2);
++ assert.equal(m('ನ್'), 1);
++ assert.equal(m('ನ್ನ'), 2);
++ assert.equal(m('ನ್ನ'), 2);
++ assert.equal(m('ರ್ಕ'), 2);
++ assert.equal(m('ರ್ಕ'), 2);
++ assert.equal(m('ണ്'), 1);
++ assert.equal(m('ന്'), 1);
++ assert.equal(m('ര്'), 1);
++ assert.equal(m('ല്'), 1);
++ assert.equal(m('ള്'), 1);
++ // random samples from http://unicode.org/emoji/charts/emoji-zwj-sequences.html
++ assert.equal(m('\u{1F468}\u{200D}\u{1F469}\u{200D}\u{1F466}'), 3); // family: man, woman, boy
++ assert.equal(m('\u{1F469}\u{200D}\u{2764}\u{FE0F}\u{200D}\u{1F48B}\u{200D}\u{1F468}'), 4); // kiss: woman, man
++});
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..2524292
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,3 @@
+00-mocha.diff
+01-wcwidth.diff
+02-test_zwj_zwnj.diff
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..b549f43
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,13 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+ dh $@
+
+#override_dh_auto_build:
+
+override_dh_auto_test:
+ mocha -u tdd
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..4fa0c4e
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,5 @@
+Tests: require
+Depends: node-string-width
+
+Test-Command: mocha -u tdd
+Depends: @, @builddeps@
diff --git a/debian/tests/require b/debian/tests/require
new file mode 100644
index 0000000..a27cfbc
--- /dev/null
+++ b/debian/tests/require
@@ -0,0 +1,3 @@
+#!/bin/sh
+set -e
+nodejs -e "require('string-width');"
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..fb6b94c
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,5 @@
+version=3
+opts=\
+dversionmangle=s/\+(debian|dfsg|ds|deb)(\.\d+)?$//,\
+filenamemangle=s/.*\/v?([\d\.-]+)\.tar\.gz/node-string-width-$1.tar.gz/ \
+ https://github.com/sindresorhus/string-width/tags .*/archive/v?([\d\.]+).tar.gz
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-string-width.git
More information about the Pkg-javascript-commits
mailing list