diff --git a/figures-1.7.0.tgz b/figures-1.7.0.tgz new file mode 100644 index 0000000..8df1cf9 Binary files /dev/null and b/figures-1.7.0.tgz differ diff --git a/nodejs-figures.spec b/nodejs-figures.spec new file mode 100644 index 0000000..a67ce6f --- /dev/null +++ b/nodejs-figures.spec @@ -0,0 +1,49 @@ +%{?nodejs_find_provides_and_requires} +%global packagename figures +%global enable_tests 0 +Name: nodejs-figures +Version: 1.7.0 +Release: 1 +Summary: Unicode symbols with Windows CMD fallbacks +License: MIT +URL: https://github.com/sindresorhus/figures.git +Source0: https://registry.npmjs.org/figures/-/figures-%{version}.tgz +Source1: https://raw.githubusercontent.com/sindresorhus/figures/v%{version}/test.js +ExclusiveArch: %{nodejs_arches} noarch +BuildArch: noarch +BuildRequires: nodejs-packaging npm(object-assign) npm(escape-string-regexp) +%if 0%{?enable_tests} +BuildRequires: npm(ava) +%endif + +%description +Unicode symbols with Windows CMD fallbacks + +%prep +%setup -q -n package +cp -p %{SOURCE1} . + +%build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} +cp -pr package.json index.js \ + %{buildroot}%{nodejs_sitelib}/%{packagename} +%nodejs_symlink_deps + +%check +%nodejs_symlink_deps --check +%{__nodejs} -e 'require("./")' +%if 0%{?enable_tests} +%{_bindir}/ava +%endif + +%files +%{!?_licensedir:%global license %doc} +%doc *.md +%license license +%{nodejs_sitelib}/%{packagename} + +%changelog +* Tue Aug 18 2020 leiju - 1.7.0-1 +- Package init diff --git a/nodejs-figures.yaml b/nodejs-figures.yaml new file mode 100644 index 0000000..0eb755d --- /dev/null +++ b/nodejs-figures.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: sindresorhus/figures +tag_prefix: "^v" +seperator: "." diff --git a/test.js b/test.js new file mode 100644 index 0000000..1fd1fa2 --- /dev/null +++ b/test.js @@ -0,0 +1,18 @@ +import test from 'ava'; +import m from './'; + +const result = (main, win) => process.platform === 'win32' ? win : main; + +console.log(' ' + Object.keys(m).map(x => m[x]).join(' ') + '\n'); + +test('figures', t => { + t.is(m.tick, result('✔', '√')); +}); + +test('fallbacks', t => { + t.is(m('foo'), 'foo'); + t.is(m('?bar?'), '?bar?'); + t.is(m('✔ ✔ ✔'), result('✔ ✔ ✔', '√ √ √')); + t.is(m('✔ ✖\n★ ▇'), result('✔ ✖\n★ ▇', '√ ×\n* █')); + t.is(m('✔ ✖ ★ ▇'), result('✔ ✖ ★ ▇', '√ × * █')); +});