From d9dae1353fa3c8576a14055c296f583ae93ec856 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 20 Aug 2020 17:05:48 +0800 Subject: [PATCH] package init --- ansi-styles-2.1.0.tgz | Bin 0 -> 2443 bytes nodejs-ansi-styles.spec | 50 ++++++++++++++++++++++++++++++++++++++++ nodejs-ansi-styles.yaml | 4 ++++ test.js | 42 +++++++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+) create mode 100644 ansi-styles-2.1.0.tgz create mode 100644 nodejs-ansi-styles.spec create mode 100644 nodejs-ansi-styles.yaml create mode 100644 test.js diff --git a/ansi-styles-2.1.0.tgz b/ansi-styles-2.1.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..0d920898ea6d34a15ec3c28f02760f18600eaaa7 GIT binary patch literal 2443 zcmV;633T=!iwFP!000001MOIQQ`^`T-+$4kI3b(rNw3}qxL6hKn&pq$^IFHzNZtc0)jrFhjUPj?J zzwy^-H1<0k;@^Y)J@wmY={dgUegorXYp>J6YIE=4n?|$UXzyeFw^rm+UnWyKfhzwk zA8ibkzyBlOKMbPH&<@1rE84U}>FvmL=?l48=Y>0wNG}R`tz|aNhK9OAI*Avj`AWAx zvIrnM7UV=&q*;^@v+=??eiQsi@MzLUTFK8lkYhqluGuwHP*01#F6yUC|NSt zS=j#V?jyzQEL}ti5Lo|;1tTwX6G5XWS!5a&iz2W+pI4JPUPF3CI;<|Qc8q#Xe2AHz!tC_uYYKm%?9?Y)L-vf1vM2iWz-;on^$-<&leR7 zp}2U!!?2QhE0*_B;#P2Yg9?Kx`-B;E#zs{p+1e~A5!X(JS`B67i*o8$1n`k6>C$Dn z(drNuGn~S}PSXl%GM^U1*4}=}ZXx_q>I17$O#EnG8O|%5um{*6cLzsYtPFTaS3YvZ z-LZ%Td>1-ib$_(8;q@2F?W9}Z8OAIN9e&rzmQn;$UyRgcrrI`+@5Y_2-*o_f;Q2-nx!%mfd-zIC zH}JrT6puoqP7PcGK&FxJ0?@2et94VS-Cb%m$&=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w(ODe(T@zasu8!gd2;2JUB&@eA>Pf3NYV{%^OQ>i;kDJ*P@yN{Z(ro5Z~X^N=sEPe=VnTlllSJNU%cum)jn#h_S z6Z&Wliid%927hV%xLpo0@dEkd})mHREs& z>y78n$qI1{5&VtGWMce*!Z?7Y3Pd|Q(!LYbZBj^z>{8Q9(lJ#qnf%GEsGM~Uw~y{IAK zc+@)De!)0p^G8$Yo{t*qR*xF4b$EV;pHfdBDy5rh_e`{wS~cYtHPQ_otvD)RHOQMc zYRoMgHBgP3oY-DYw2(tE=8_p6b1L$5YeqBWhD<(sQ%WtGFOvd2ms~bl^4U=#J#VTM z`{&-_z9Lb}^dUN2A}yZTnV<5hC6v-gy8}Ds6s;)uk-6&5oPI7;3hqlJ?RO{wxDrP; zuFHRE5)#R!LJ6aAXH~2t6=fcf7I7C47vY|=n6eNYr4nsB4iAA85GsD`yO;V)W{A`? zux}w58L+S=4h|=?+!a9S5{1}8Tcw%M9T(kRzsCA{n##NCV3*y?NeR*$u$mYBGVL?| zsP|w8v0vW0M>lHKh{`Wk_0r^JmSJ$s^{;=@^;&6FzIl%esjnR;p1!B=>HGit{tfEA JLref7005`}zRUms literal 0 HcmV?d00001 diff --git a/nodejs-ansi-styles.spec b/nodejs-ansi-styles.spec new file mode 100644 index 0000000..be19482 --- /dev/null +++ b/nodejs-ansi-styles.spec @@ -0,0 +1,50 @@ +%{?nodejs_find_provides_and_requires} +%global enable_tests 1 +Name: nodejs-ansi-styles +Version: 2.1.0 +Release: 1 +Summary: ANSI escape codes for colorizing strings in the terminal +License: MIT +URL: https://github.com/sindresorhus/ansi-styles +Source0: http://registry.npmjs.org/ansi-styles/-/ansi-styles-%{version}.tgz +Source1: https://raw.githubusercontent.com/chalk/ansi-styles/v%{version}/test.js +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch +BuildRequires: nodejs-packaging +%if 0%{?enable_tests} +BuildRequires: npm(mocha) npm(chalk) npm(require-uncached) +%endif +%description +%{summary}. + +%prep +%setup -q -n package +cp -p %{SOURCE1} . + +%build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/ansi-styles +cp -pr package.json index.js \ + %{buildroot}%{nodejs_sitelib}/ansi-styles +%nodejs_symlink_deps + +%check +%nodejs_symlink_deps --check +%{__nodejs} -e 'require("./")' +%if 0%{?enable_tests} +ln -s %{nodejs_sitelib}/chalk node_modules/chalk +%{_bindir}/mocha -R spec +%else +%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" +%endif + +%files +%{!?_licensedir:%global license %doc} +%doc readme.md +%license license +%{nodejs_sitelib}/ansi-styles + +%changelog +* Mon Aug 17 2020 Shaoqiang Kang - 2.1.0-1 +- Package init diff --git a/nodejs-ansi-styles.yaml b/nodejs-ansi-styles.yaml new file mode 100644 index 0000000..dc8e52f --- /dev/null +++ b/nodejs-ansi-styles.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: sindresorhus/ansi-styles +tag_prefix: "v" +seperator: "." diff --git a/test.js b/test.js new file mode 100644 index 0000000..5e17462 --- /dev/null +++ b/test.js @@ -0,0 +1,42 @@ +'use strict'; +var assert = require('assert'); +var ansi = require('./'); + +// generates the screenshot +Object.keys(ansi).forEach(function (el) { + var style = ansi[el].open; + + if (el === 'reset' || el === 'hidden') { + return; + } + + if (/^bg[^B]/.test(el)) { + style = ansi.black.open + style; + } + + process.stdout.write(style + el + ansi.reset.open + ansi.reset.close + ' '); +}); + +it('should return ANSI escape codes', function () { + assert.equal(ansi.green.open, '\u001b[32m'); + assert.equal(ansi.bgGreen.open, '\u001b[42m'); + assert.equal(ansi.green.close, '\u001b[39m'); + assert.equal(ansi.gray.open, ansi.grey.open); +}); + +it('should group related codes into categories', function () { + assert.equal(ansi.colors.magenta, ansi.magenta); + assert.equal(ansi.bgColors.bgYellow, ansi.bgYellow); + assert.equal(ansi.modifiers.bold, ansi.bold); +}); + +it('groups should not be enumerable', function () { + assert.equal(Object.keys(ansi).indexOf('modifiers'), -1); +}); + +it('should not pollute other objects', function () { + var obj1 = require('./'); + var obj2 = require('./'); + obj1.foo = true; + assert.notEqual(obj1.foo, obj2.foo); +});