diff --git a/nodejs-callsites.spec b/nodejs-callsites.spec new file mode 100644 index 0000000..2adc11d --- /dev/null +++ b/nodejs-callsites.spec @@ -0,0 +1,47 @@ +%global enable_tests 0 +%global module_name callsites +Name: nodejs-%{module_name} +Version: 2.0.0 +Release: 1 +Summary: Get callsites from the V8 stack trace API +License: MIT +URL: https://github.com/sindresorhus/callsites +Source0: https://github.com/sindresorhus/callsites/archive/v%{version}.tar.gz +Source1: https://github.com/sindresorhus/callsites/v%{version}/test.js +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch +BuildRequires: nodejs-packaging +%if 0%{?enable_tests} +BuildRequires: npm(xo) npm(ava) +%endif + +%description +%{summary}. + +%prep +%autosetup -n callsites-%{version} +rm -rf node_modules +cp -p %{SOURCE1} . + +%build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/%{module_name} +cp -pr package.json *.js %{buildroot}%{nodejs_sitelib}/%{module_name} +%nodejs_symlink_deps +%if 0%{?enable_tests} + +%check +%nodejs_symlink_deps --check +%{__nodejs} -e 'require("./")' +xo && ava +%endif + +%files +%doc readme.md +%license license +%{nodejs_sitelib}/%{module_name} + +%changelog +* Fri Aug 21 2020 leiju - 2.0.0-1 +- Package init diff --git a/nodejs-callsites.yaml b/nodejs-callsites.yaml new file mode 100644 index 0000000..16c194b --- /dev/null +++ b/nodejs-callsites.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: sindresorhus/callsites +tag_prefix: "^v" +seperator: "." diff --git a/test.js b/test.js new file mode 100644 index 0000000..254dfda --- /dev/null +++ b/test.js @@ -0,0 +1,7 @@ +import path from 'path'; +import test from 'ava'; +import m from './'; + +test(t => { + t.is(path.basename(m()[0].getFileName()), 'test.js'); +}); diff --git a/v2.0.0.tar.gz b/v2.0.0.tar.gz new file mode 100644 index 0000000..48b1132 Binary files /dev/null and b/v2.0.0.tar.gz differ