The package rpms/nodejs-p-limit.git has added or updated architecture specific content in
its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/nodejs-p-limit.git/commit/?id=e93....
Change:
+ExclusiveArch: %{nodejs_arches} noarch
Thanks.
Full change:
============
commit e9323ec4f76dab3332b40726059a4f92c282431f
Author: Jared K. Smith <jaredsmith(a)jaredsmith.net>
Date: Wed May 3 14:13:21 2017 -0400
Initial packaging
diff --git a/.gitignore b/.gitignore
index e69de29..2e29c0f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/p-limit-1.1.0.tgz
diff --git a/nodejs-p-limit.spec b/nodejs-p-limit.spec
new file mode 100644
index 0000000..7e1e834
--- /dev/null
+++ b/nodejs-p-limit.spec
@@ -0,0 +1,62 @@
+%{?nodejs_find_provides_and_requires}
+
+%global packagename p-limit
+
+# tests missing due to missing npm(ava)
+%global enable_tests 0
+
+Name: nodejs-p-limit
+Version: 1.1.0
+Release: 1%{?dist}
+Summary: Run multiple promise-returning & async functions with limited concurrency
+
+License: MIT
+URL:
https://github.com/sindresorhus/p-limit
+Source0:
https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
+# The test files are not included in the npm tarball.
+Source1:
https://raw.githubusercontent.com/sindresorhus/p-limit/v%{version}/test.js
+
+ExclusiveArch: %{nodejs_arches} noarch
+BuildArch: noarch
+
+BuildRequires: nodejs-packaging
+%if 0%{?enable_tests}
+BuildRequires: npm(ava)
+%endif
+
+%description
+Run multiple promise-returning & async functions with limited concurrency
+
+
+%prep
+%autosetup -n package
+# setup the tests
+cp -p %{SOURCE1} .
+
+%build
+# nothing to do!
+
+%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
+%else
+%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
+%endif
+
+%files
+%doc readme.md
+%license license
+%{nodejs_sitelib}/%{packagename}
+
+%changelog
+* Sat Apr 22 2017 Jared Smith <jsmith(a)fedoraproject.org> - 1.1.0-1
+- Initial packaging
diff --git a/sources b/sources
index e69de29..1b21473 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (p-limit-1.1.0.tgz) =
b054859ac19c561a3574dcec3c6ca22f5c6ce0ac5994cd909739d5c420e0d25a0b79f4e14ac56464fc816447a1412722d272f09203d9ce2258a4c19ae7d573ab
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..79582a5
--- /dev/null
+++ b/test.js
@@ -0,0 +1,37 @@
+import test from 'ava';
+import delay from 'delay';
+import inRange from 'in-range';
+import timeSpan from 'time-span';
+import randomInt from 'random-int';
+import m from './';
+
+test('concurrency: 1', async t => {
+ const input = [
+ [10, 300],
+ [20, 200],
+ [30, 100]
+ ];
+
+ const end = timeSpan();
+ const limit = m(1);
+ const mapper = ([val, ms]) => limit(() => delay(ms).then(() => val));
+
+ t.deepEqual(await Promise.all(input.map(mapper)), [10, 20, 30]);
+ t.true(inRange(end(), 590, 650));
+});
+
+test('concurrency: 4', async t => {
+ const concurrency = 5;
+ let running = 0;
+
+ const limit = m(concurrency);
+
+ const input = Array(100).fill(0).map(() => limit(async () => {
+ running++;
+ t.true(running <= concurrency);
+ await delay(randomInt(30, 200));
+ running--;
+ }));
+
+ await Promise.all(input);
+});