Architecture specific change in rpms/nodejs-ecstatic.git
by githook-noreply@fedoraproject.org
The package rpms/nodejs-ecstatic.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-ecstatic.git/commit/?id=25....
Change:
+ExclusiveArch: %{nodejs_arches} noarch
Thanks.
Full change:
============
commit 25725d650534ebdcf86732fd7dd37ecf7d87ad03
Author: Parag A Nemade <pnemade(a)fedoraproject.org>
Date: Thu May 4 09:31:14 2017 +0530
Initial commit (#1447230)
diff --git a/.gitignore b/.gitignore
index e69de29..f91cd7e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/2.1.0.tar.gz
diff --git a/nodejs-ecstatic.spec b/nodejs-ecstatic.spec
new file mode 100644
index 0000000..bbe3de9
--- /dev/null
+++ b/nodejs-ecstatic.spec
@@ -0,0 +1,60 @@
+%{?nodejs_find_provides_and_requires}
+
+#some tests are failing
+%global enable_tests 0
+%global packagename ecstatic
+
+Name: nodejs-%{packagename}
+Version: 2.1.0
+Release: 1%{?dist}
+Summary: A static file server middleware that works with core http, express or on the CLI
+License: MIT
+URL: https://github.com/jfhbrook/node-%{packagename}
+Source0: https://github.com/jfhbrook/node-%{packagename}/archive/%{version}.tar.gz
+
+BuildArch: noarch
+ExclusiveArch: %{nodejs_arches} noarch
+
+BuildRequires: nodejs-packaging
+BuildRequires: npm(url-join)
+BuildRequires: npm(he)
+
+%if 0%{?enable_tests}
+BuildRequires: npm(tap)
+%endif
+
+%description
+A static file server middleware that works with core http, express
+or on the CLI.
+
+%prep
+%autosetup -n node-%{packagename}-%{version}
+
+%nodejs_fixdep he
+%nodejs_fixdep url-join
+
+%build
+#nothing to do
+
+%install
+mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
+cp -pr package.json lib tools \
+ %{buildroot}%{nodejs_sitelib}/%{packagename}
+
+%nodejs_symlink_deps
+
+%check
+%nodejs_symlink_deps --check
+%{__nodejs} -e 'require("./")'
+%if 0%{?enable_tests}
+tap --coverage test/*.js
+%endif
+
+%files
+%doc README.md
+%license LICENSE.txt
+%{nodejs_sitelib}/%{packagename}
+
+%changelog
+* Fri Apr 28 2017 Parag Nemade <pnemade AT redhat DOT com> - 2.1.0-1
+- initial package
diff --git a/sources b/sources
index e69de29..5719201 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (2.1.0.tar.gz) = b4efbd495ac3d53181aae1c1b1b2096558af3bd793bed9bd615a671b5ff2387a459e5ab5e5297359a36acb248985258814fe6391fbc7f74024adae23746961ec
5 years, 10 months
Architecture specific change in rpms/nodejs-p-locate.git
by githook-noreply@fedoraproject.org
The package rpms/nodejs-p-locate.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-locate.git/commit/?id=53....
Change:
+ExclusiveArch: %{nodejs_arches} noarch
Thanks.
Full change:
============
commit 535f1761bdb010bb51e88bce884fc21df7154fe2
Author: Jared K. Smith <jaredsmith(a)jaredsmith.net>
Date: Wed May 3 14:14:54 2017 -0400
Initial packaging
diff --git a/.gitignore b/.gitignore
index e69de29..1acb980 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/p-locate-2.0.0.tgz
diff --git a/nodejs-p-locate.spec b/nodejs-p-locate.spec
new file mode 100644
index 0000000..319f645
--- /dev/null
+++ b/nodejs-p-locate.spec
@@ -0,0 +1,63 @@
+%{?nodejs_find_provides_and_requires}
+
+%global packagename p-locate
+
+# tests missing due to missing npm(ava)
+%global enable_tests 0
+
+Name: nodejs-p-locate
+Version: 2.0.0
+Release: 1%{?dist}
+Summary: Get the first fulfilled promise that satisfies the provided testing function
+
+License: MIT
+URL: https://github.com/sindresorhus/p-locate
+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-locate/v%{version}/test.js
+
+ExclusiveArch: %{nodejs_arches} noarch
+BuildArch: noarch
+
+BuildRequires: nodejs-packaging
+BuildRequires: npm(p-limit)
+%if 0%{?enable_tests}
+BuildRequires: ava
+%endif
+
+%description
+Get the first fulfilled promise that satisfies the provided testing function
+
+
+%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
+* Thu Apr 20 2017 Jared Smith <jsmith(a)fedoraproject.org> - 2.0.0-1
+- Initial packaging
diff --git a/sources b/sources
index e69de29..6689f90 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (p-locate-2.0.0.tgz) = 9d08daee6ee048ab9ec285517a7e390ad55f38347772b377828550d030d9f4ddf21f182992e06166ab1a8a8b52411ac00d4ae77b7e3aa5e63b913dd34800b292
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..5501549
--- /dev/null
+++ b/test.js
@@ -0,0 +1,41 @@
+import {serial as test} from 'ava';
+import delay from 'delay';
+import inRange from 'in-range';
+import timeSpan from 'time-span';
+import m from './';
+
+const input = [
+ [1, 300],
+ [2, 400],
+ [3, 200],
+ Promise.resolve([4, 100]) // ensures promises work in the input
+];
+
+const tester = ([val, ms]) => delay(ms).then(() => val === 2 || val === 3);
+
+test('main', async t => {
+ const end = timeSpan();
+ t.is((await m(input, tester))[0], 2);
+ t.true(inRange(end(), 370, 450), 'should be time of item `2`');
+});
+
+test('option {preserveOrder:false}', async t => {
+ const end = timeSpan();
+ t.is((await m(input, tester, {preserveOrder: false}))[0], 3);
+ t.true(inRange(end(), 170, 250), 'should be time of item `3`');
+});
+
+test('option {concurrency:1}', async t => {
+ const end = timeSpan();
+ t.is((await m(input, tester, {concurrency: 1}))[0], 2);
+ t.true(inRange(end(), 670, 750), 'should be time of items `1` and `2`, since they run serially');
+});
+
+test('returns `undefined` when nothing could be found', async t => {
+ t.is((await m([1, 2, 3], () => false)), undefined);
+});
+
+test('rejected return value in `tester` rejects the promise', async t => {
+ const fixtureErr = new Error('fixture');
+ await t.throws(m([1, 2, 3], () => Promise.reject(fixtureErr)), fixtureErr.message);
+});
5 years, 10 months
Architecture specific change in rpms/nodejs-p-limit.git
by githook-noreply@fedoraproject.org
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);
+});
5 years, 10 months
Architecture specific change in rpms/nodejs-locate-path.git
by githook-noreply@fedoraproject.org
The package rpms/nodejs-locate-path.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-locate-path.git/commit/?id....
Change:
+ExclusiveArch: %{nodejs_arches} noarch
Thanks.
Full change:
============
commit eaa48a34e2118f33557e4ef8b53d5ef34ccfa986
Author: Jared K. Smith <jaredsmith(a)jaredsmith.net>
Date: Wed May 3 14:24:12 2017 -0400
Initial packaging
diff --git a/.gitignore b/.gitignore
index e69de29..f331110 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/fixture-2.0.0.tar.bz2
+/locate-path-2.0.0.tgz
diff --git a/dl-tests.sh b/dl-tests.sh
new file mode 100644
index 0000000..0030a57
--- /dev/null
+++ b/dl-tests.sh
@@ -0,0 +1,119 @@
+#!/bin/bash
+
+tag=$(sed -n 's/^Version:\s\(.*\)$/\1/p' ./*.spec | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
+url=$(sed -n 's/^URL:\s\(.*\)$/\1/p' ./*.spec | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
+pkgdir=$(basename $url | sed -s 's/\.git$//')
+
+echo "tag: $tag"
+echo "URL: $url"
+echo "pkgdir: $pkgdir"
+
+set -e
+
+tmp=$(mktemp -d)
+
+trap cleanup EXIT
+cleanup() {
+ echo Cleaning up...
+ set +e
+ [ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp"
+}
+
+unset CDPATH
+pwd=$(pwd)
+
+pushd "$tmp"
+git clone $url
+cd $pkgdir
+echo Finding git tag
+gittag=$(git show-ref --tags | cut -d' ' -f2 | grep "${tag}$" || git show-ref --tags | cut -d' ' -f2 | sort -Vr | head -n1)
+if [ -z $gittag ]; then
+ gittag=tags/$tag
+fi
+echo "Git Tag: $gittag"
+if [ -d "test" ]; then
+ git archive --prefix='test/' --format=tar ${gittag}:test/ \
+ | bzip2 > "$pwd"/tests-${tag}.tar.bz2
+elif [ -d "tests" ]; then
+ git archive --prefix='tests/' --format=tar ${gittag}:tests/ \
+ | bzip2 > "$pwd"/tests-${tag}.tar.bz2
+elif [ -d "spec" ]; then
+ git archive --prefix='spec/' --format=tar ${gittag}:spec/ \
+ | bzip2 > "$pwd"/tests-${tag}.tar.bz2
+else
+ echo "No test directory found for tag ${gittag}"
+fi
+if [ -d "support" ]; then
+ git archive --prefix='support/' --format=tar ${gittag}:support/ \
+ | bzip2 > "$pwd"/support-${tag}.tar.bz2
+fi
+if [ -d "fixture" ]; then
+ git archive --prefix='fixture/' --format=tar ${gittag}:fixture/ \
+ | bzip2 > "$pwd"/fixture-${tag}.tar.bz2
+fi
+if [ -d "examples" ]; then
+ git archive --prefix='examples/' --format=tar ${gittag}:examples/ \
+ | bzip2 > "$pwd"/examples-${tag}.tar.bz2
+elif [ -d "example" ]; then
+ git archive --prefix='example/' --format=tar ${gittag}:example/ \
+ | bzip2 > "$pwd"/examples-${tag}.tar.bz2
+fi
+if [ -d "tasks" ]; then
+ git archive --prefix='tasks/' --format=tar ${gittag}:tasks/ \
+ | bzip2 > "$pwd"/tasks-${tag}.tar.bz2
+fi
+if [ -d "docs" ]; then
+ git archive --prefix='docs/' --format=tar ${gittag}:docs/ \
+ | bzip2 > "$pwd"/docs-${tag}.tar.bz2
+elif [ -d "doc" ]; then
+ git archive --prefix='doc/' --format=tar ${gittag}:doc/ \
+ | bzip2 > "$pwd"/docs-${tag}.tar.bz2
+fi
+if [ -d "src" ]; then
+ git archive --prefix='src/' --format=tar ${gittag}:src/ \
+ | bzip2 > "$pwd"/src-${tag}.tar.bz2
+elif [ -d "source" ]; then
+ git archive --prefix='source/' --format=tar ${gittag}:source/ \
+ | bzip2 > "$pwd"/source-${tag}.tar.bz2
+fi
+if [ -d "tools" ]; then
+ git archive --prefix='tools/' --format=tar ${gittag}:tools/ \
+ | bzip2 > "$pwd"/tools-${tag}.tar.bz2
+fi
+if [ -d "scripts" ]; then
+ git archive --prefix='scripts/' --format=tar ${gittag}:scripts/ \
+ | bzip2 > "$pwd"/scripts-${tag}.tar.bz2
+fi
+if [ -d "modules" ]; then
+ git archive --prefix='modules/' --format=tar ${gittag}:modules/ \
+ | bzip2 > "$pwd"/modules-${tag}.tar.bz2
+fi
+if [ -d "ts" ]; then
+ git archive --prefix='ts/' --format=tar ${gittag}:ts/ \
+ | bzip2 > "$pwd"/ts-${tag}.tar.bz2
+fi
+if [ -d "build" ]; then
+ git archive --prefix='build/' --format=tar ${gittag}:build/ \
+ | bzip2 > "$pwd"/build-${tag}.tar.bz2
+fi
+if [ -d "fixtures" ]; then
+ git archive --prefix='fixtures/' --format=tar ${gittag}:fixtures/ \
+ | bzip2 > "$pwd"/fixtures-${tag}.tar.bz2
+fi
+if [ -d "mocks" ]; then
+ git archive --prefix='mocks/' --format=tar ${gittag}:mocks/ \
+ | bzip2 > "$pwd"/mocks-${tag}.tar.bz2
+fi
+if [ -d "typings" ]; then
+ git archive --prefix='typings/' --format=tar ${gittag}:typings/ \
+ | bzip2 > "$pwd"/typings-${tag}.tar.bz2
+fi
+if [ -d "templates" ]; then
+ git archive --prefix='templates/' --format=tar ${gittag}:templates/ \
+ | bzip2 > "$pwd"/templates-${tag}.tar.bz2
+fi
+if [ -d "benchmark" ]; then
+ git archive --prefix='benchmark/' --format=tar ${gittag}:benchmark/ \
+ | bzip2 > "$pwd"/benchmark-${tag}.tar.bz2
+fi
+popd
diff --git a/nodejs-locate-path.spec b/nodejs-locate-path.spec
new file mode 100644
index 0000000..0474029
--- /dev/null
+++ b/nodejs-locate-path.spec
@@ -0,0 +1,70 @@
+%{?nodejs_find_provides_and_requires}
+
+%global packagename locate-path
+
+# tests missing due to missing npm(ava)
+%global enable_tests 0
+
+Name: nodejs-locate-path
+Version: 2.0.0
+Release: 1%{?dist}
+Summary: Get the first path that exists on disk of multiple paths
+
+License: MIT
+URL: https://github.com/sindresorhus/locate-path
+Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
+# The test files are not included in the npm tarball.
+# Source1 is generated by running Source10, which pulls from the upstream
+# version control repository.
+Source1: fixture-%{version}.tar.bz2
+Source10: dl-tests.sh
+Source11: https://raw.githubusercontent.com/sindresorhus/locate-path/v%{version}/te...
+
+
+ExclusiveArch: %{nodejs_arches} noarch
+BuildArch: noarch
+
+BuildRequires: nodejs-packaging
+BuildRequires: npm(p-locate)
+BuildRequires: npm(path-exists)
+%if 0%{?enable_tests}
+BuildRequires: npm(ava)
+%endif
+
+%description
+Get the first path that exists on disk of multiple paths
+
+
+%prep
+%autosetup -n package
+# setup the tests
+%autosetup -T -D -a 1 -n package
+cp -p %{SOURCE11} .
+
+%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
+* Thu Apr 20 2017 Jared Smith <jsmith(a)fedoraproject.org> - 2.0.0-1
+- Initial packaging
diff --git a/sources b/sources
index e69de29..1cfb213 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,2 @@
+SHA512 (fixture-2.0.0.tar.bz2) = 4a424f98c2e5342d0f6a9b77f68b2d07ee133325fed5f2948e73fe4d7771c893fa6af9dca73b874b868e2c5e6f3aabec948be5d1c2aabc828329ca88adc7a2ac
+SHA512 (locate-path-2.0.0.tgz) = 3422369220e4c91ed57842a6dbb29d6bf8901f22897b506ed059536d8a770aa26efbd2057bd6cbc808ccc5fe590c36c483e88c3f3079cd8c944d29bcc154ca98
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..bd9d3d4
--- /dev/null
+++ b/test.js
@@ -0,0 +1,21 @@
+import test from 'ava';
+import m from './';
+
+const input = [
+ 'noop.foo',
+ 'unicorn.png',
+ 'index.js',
+ 'test.js'
+];
+
+test('async', async t => {
+ t.is(await m(input), 'index.js');
+ t.is(await m(['nonexistant']), undefined);
+ t.is(await m(['noop', 'unicorn'], {cwd: 'fixture'}), 'unicorn');
+});
+
+test('sync', t => {
+ t.is(m.sync(input), 'index.js');
+ t.is(m.sync(['nonexistant']), undefined);
+ t.is(m.sync(['noop', 'unicorn'], {cwd: 'fixture'}), 'unicorn');
+});
5 years, 10 months
Architecture specific change in rpms/nodejs-p-limit.git
by githook-noreply@fedoraproject.org
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);
+});
5 years, 10 months
Architecture specific change in rpms/nodejs-p-locate.git
by githook-noreply@fedoraproject.org
The package rpms/nodejs-p-locate.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-locate.git/commit/?id=53....
Change:
+ExclusiveArch: %{nodejs_arches} noarch
Thanks.
Full change:
============
commit 535f1761bdb010bb51e88bce884fc21df7154fe2
Author: Jared K. Smith <jaredsmith(a)jaredsmith.net>
Date: Wed May 3 14:14:54 2017 -0400
Initial packaging
diff --git a/.gitignore b/.gitignore
index e69de29..1acb980 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/p-locate-2.0.0.tgz
diff --git a/nodejs-p-locate.spec b/nodejs-p-locate.spec
new file mode 100644
index 0000000..319f645
--- /dev/null
+++ b/nodejs-p-locate.spec
@@ -0,0 +1,63 @@
+%{?nodejs_find_provides_and_requires}
+
+%global packagename p-locate
+
+# tests missing due to missing npm(ava)
+%global enable_tests 0
+
+Name: nodejs-p-locate
+Version: 2.0.0
+Release: 1%{?dist}
+Summary: Get the first fulfilled promise that satisfies the provided testing function
+
+License: MIT
+URL: https://github.com/sindresorhus/p-locate
+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-locate/v%{version}/test.js
+
+ExclusiveArch: %{nodejs_arches} noarch
+BuildArch: noarch
+
+BuildRequires: nodejs-packaging
+BuildRequires: npm(p-limit)
+%if 0%{?enable_tests}
+BuildRequires: ava
+%endif
+
+%description
+Get the first fulfilled promise that satisfies the provided testing function
+
+
+%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
+* Thu Apr 20 2017 Jared Smith <jsmith(a)fedoraproject.org> - 2.0.0-1
+- Initial packaging
diff --git a/sources b/sources
index e69de29..6689f90 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (p-locate-2.0.0.tgz) = 9d08daee6ee048ab9ec285517a7e390ad55f38347772b377828550d030d9f4ddf21f182992e06166ab1a8a8b52411ac00d4ae77b7e3aa5e63b913dd34800b292
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..5501549
--- /dev/null
+++ b/test.js
@@ -0,0 +1,41 @@
+import {serial as test} from 'ava';
+import delay from 'delay';
+import inRange from 'in-range';
+import timeSpan from 'time-span';
+import m from './';
+
+const input = [
+ [1, 300],
+ [2, 400],
+ [3, 200],
+ Promise.resolve([4, 100]) // ensures promises work in the input
+];
+
+const tester = ([val, ms]) => delay(ms).then(() => val === 2 || val === 3);
+
+test('main', async t => {
+ const end = timeSpan();
+ t.is((await m(input, tester))[0], 2);
+ t.true(inRange(end(), 370, 450), 'should be time of item `2`');
+});
+
+test('option {preserveOrder:false}', async t => {
+ const end = timeSpan();
+ t.is((await m(input, tester, {preserveOrder: false}))[0], 3);
+ t.true(inRange(end(), 170, 250), 'should be time of item `3`');
+});
+
+test('option {concurrency:1}', async t => {
+ const end = timeSpan();
+ t.is((await m(input, tester, {concurrency: 1}))[0], 2);
+ t.true(inRange(end(), 670, 750), 'should be time of items `1` and `2`, since they run serially');
+});
+
+test('returns `undefined` when nothing could be found', async t => {
+ t.is((await m([1, 2, 3], () => false)), undefined);
+});
+
+test('rejected return value in `tester` rejects the promise', async t => {
+ const fixtureErr = new Error('fixture');
+ await t.throws(m([1, 2, 3], () => Promise.reject(fixtureErr)), fixtureErr.message);
+});
5 years, 10 months
Architecture specific change in rpms/nodejs-write-json-file.git
by githook-noreply@fedoraproject.org
The package rpms/nodejs-write-json-file.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-write-json-file.git/commit....
Change:
+ExclusiveArch: %{nodejs_arches} noarch
Thanks.
Full change:
============
commit 7c39dded563709f6177deb4ca4228a57413b97ea
Author: Jared K. Smith <jaredsmith(a)jaredsmith.net>
Date: Wed May 3 13:44:20 2017 -0400
Initial packaging
diff --git a/.gitignore b/.gitignore
index e69de29..d3d1e22 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/write-json-file-2.0.0.tgz
diff --git a/nodejs-write-json-file.spec b/nodejs-write-json-file.spec
new file mode 100644
index 0000000..1794737
--- /dev/null
+++ b/nodejs-write-json-file.spec
@@ -0,0 +1,66 @@
+%{?nodejs_find_provides_and_requires}
+
+%global packagename write-json-file
+
+# tests missing due to missing npm(ava)
+%global enable_tests 0
+
+Name: nodejs-write-json-file
+Version: 2.0.0
+Release: 1%{?dist}
+Summary: Stringify and write JSON to a file atomically
+
+License: MIT
+URL: https://github.com/sindresorhus/write-json-file
+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/write-json-file/v%{version...
+
+ExclusiveArch: %{nodejs_arches} noarch
+BuildArch: noarch
+
+BuildRequires: nodejs-packaging
+BuildRequires: npm(mkdirp)
+BuildRequires: npm(pify)
+BuildRequires: npm(sort-keys)
+BuildRequires: npm(write-file-atomic)
+%if 0%{?enable_tests}
+BuildRequires: npm(ava)
+%endif
+
+%description
+Stringify and write JSON to a file atomically
+
+
+%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
+* Thu Apr 20 2017 Jared Smith <jsmith(a)fedoraproject.org> - 2.0.0-1
+- Initial packaging
diff --git a/sources b/sources
index e69de29..8ea7da5 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (write-json-file-2.0.0.tgz) = 7b4f1ef2cc0580d67c7fd3da43f30e7eb2c9b0624ef3ef8d0e807126ad6bc6bb11f2015a7a386674d78ad6fa86c2e21b9d0d0b7467bfee0294cfa34e263c41c6
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..7b6c867
--- /dev/null
+++ b/test.js
@@ -0,0 +1,17 @@
+import path from 'path';
+import fs from 'fs';
+import test from 'ava';
+import tempfile from 'tempfile';
+import m from './';
+
+test('async', async t => {
+ const tmp = path.join(tempfile(), 'foo');
+ await m(tmp, {foo: true}, {indent: 2});
+ t.is(fs.readFileSync(tmp, 'utf8'), '{\n "foo": true\n}\n');
+});
+
+test('sync', t => {
+ const tmp = path.join(tempfile(), 'foo');
+ m.sync(tmp, {foo: true}, {indent: 2});
+ t.is(fs.readFileSync(tmp, 'utf8'), '{\n "foo": true\n}\n');
+});
5 years, 10 months
Architecture specific change in rpms/nodejs-write-pkg.git
by githook-noreply@fedoraproject.org
The package rpms/nodejs-write-pkg.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-write-pkg.git/commit/?id=8....
Change:
+ExclusiveArch: %{nodejs_arches} noarch
Thanks.
Full change:
============
commit 830da8aeb580b8c33bf6b6e1f8556b361b8cf848
Author: Jared K. Smith <jaredsmith(a)jaredsmith.net>
Date: Wed May 3 13:51:07 2017 -0400
Initial packaging
diff --git a/.gitignore b/.gitignore
index e69de29..ef6915f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/write-pkg-3.0.1.tgz
diff --git a/nodejs-write-pkg.spec b/nodejs-write-pkg.spec
new file mode 100644
index 0000000..84667eb
--- /dev/null
+++ b/nodejs-write-pkg.spec
@@ -0,0 +1,63 @@
+%{?nodejs_find_provides_and_requires}
+
+%global packagename write-pkg
+
+# tests missing due to missing npm(ava)
+%global enable_tests 0
+
+Name: nodejs-write-pkg
+Version: 3.0.1
+Release: 1%{?dist}
+Summary: Write a package.json file
+
+License: MIT
+URL: https://github.com/sindresorhus/write-pkg
+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/write-pkg/v%{version}/test.js
+
+ExclusiveArch: %{nodejs_arches} noarch
+BuildArch: noarch
+
+BuildRequires: nodejs-packaging
+BuildRequires: npm(write-json-file)
+%if 0%{?enable_tests}
+BuildRequires: npm(ava)
+%endif
+
+%description
+Write a package.json file
+
+
+%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
+* Thu Apr 20 2017 Jared Smith <jsmith(a)fedoraproject.org> - 3.0.1-1
+- Initial packaging
diff --git a/sources b/sources
index e69de29..34aecf4 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (write-pkg-3.0.1.tgz) = 7e83e8ec85f3af973890390a5c2b0229266ed8508ec6ff2c3ee65ad7357491be163ddcd5fba1e8cee98997a0ec2e689d66a9190cb1a42e955ed21cc5febb97cd
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..0ea7ae2
--- /dev/null
+++ b/test.js
@@ -0,0 +1,83 @@
+'use strict';
+const test = require('ava');
+const tempfile = require('tempfile');
+const readPkg = require('read-pkg');
+const m = require('.');
+
+const fixture = {
+ foo: true,
+ scripts: {
+ b: '1',
+ a: '1'
+ },
+ dependencies: {
+ foo: '1.0.0',
+ bar: '1.0.0'
+ },
+ devDependencies: {
+ foo: '1.0.0',
+ bar: '1.0.0'
+ },
+ optionalDependencies: {
+ foo: '1.0.0',
+ bar: '1.0.0'
+ },
+ peerDependencies: {
+ foo: '1.0.0',
+ bar: '1.0.0'
+ }
+};
+
+test('async', async t => {
+ const tmp = tempfile();
+ await m(tmp, fixture);
+ const x = await readPkg(tmp, {normalize: false});
+ t.true(x.foo);
+ t.deepEqual(Object.keys(x.scripts), ['b', 'a']);
+ t.deepEqual(Object.keys(x.dependencies), ['bar', 'foo']);
+ t.deepEqual(Object.keys(x.devDependencies), ['bar', 'foo']);
+ t.deepEqual(Object.keys(x.optionalDependencies), ['bar', 'foo']);
+ t.deepEqual(Object.keys(x.peerDependencies), ['bar', 'foo']);
+});
+
+test('sync', t => {
+ const tmp = tempfile();
+ m.sync(tmp, fixture);
+ const x = readPkg.sync(tmp, {normalize: false});
+ t.true(x.foo);
+ t.deepEqual(Object.keys(x.scripts), ['b', 'a']);
+ t.deepEqual(Object.keys(x.dependencies), ['bar', 'foo']);
+ t.deepEqual(Object.keys(x.devDependencies), ['bar', 'foo']);
+ t.deepEqual(Object.keys(x.optionalDependencies), ['bar', 'foo']);
+ t.deepEqual(Object.keys(x.peerDependencies), ['bar', 'foo']);
+});
+
+const emptyPropFixture = {
+ foo: true,
+ dependencies: {},
+ devDependencies: {},
+ optionalDependencies: {},
+ peerDependencies: {}
+};
+
+test('removes empty dependency properties', async t => {
+ const tmp = tempfile();
+ await m(tmp, emptyPropFixture);
+ const x = await readPkg(tmp, {normalize: false});
+ t.true(x.foo);
+ t.falsy(x.dependencies);
+ t.falsy(x.devDependencies);
+ t.falsy(x.optionalDependencies);
+ t.falsy(x.peerDependencies);
+});
+
+test('removes empty dependency properties sync', t => {
+ const tmp = tempfile();
+ m.sync(tmp, emptyPropFixture);
+ const x = readPkg.sync(tmp, {normalize: false});
+ t.true(x.foo);
+ t.falsy(x.dependencies);
+ t.falsy(x.devDependencies);
+ t.falsy(x.optionalDependencies);
+ t.falsy(x.peerDependencies);
+});
5 years, 10 months
Architecture specific change in rpms/nodejs-sort-keys.git
by githook-noreply@fedoraproject.org
The package rpms/nodejs-sort-keys.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-sort-keys.git/commit/?id=0....
Change:
+ExclusiveArch: %{nodejs_arches} noarch
Thanks.
Full change:
============
commit 02b4f4d214803aa940e9d6bdece4507bc87caa29
Author: Jared K. Smith <jaredsmith(a)jaredsmith.net>
Date: Wed May 3 13:42:24 2017 -0400
Initial packaging
diff --git a/.gitignore b/.gitignore
index e69de29..ea9fecb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/sort-keys-1.1.2.tgz
diff --git a/nodejs-sort-keys.spec b/nodejs-sort-keys.spec
new file mode 100644
index 0000000..78ecbb3
--- /dev/null
+++ b/nodejs-sort-keys.spec
@@ -0,0 +1,63 @@
+%{?nodejs_find_provides_and_requires}
+
+%global packagename sort-keys
+
+# tests missing due to missing npm(ava)
+%global enable_tests 0
+
+Name: nodejs-sort-keys
+Version: 1.1.2
+Release: 1%{?dist}
+Summary: Sort the keys of an object
+
+License: MIT
+URL: https://github.com/sindresorhus/sort-keys
+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/sort-keys/v%{version}/test.js
+
+ExclusiveArch: %{nodejs_arches} noarch
+BuildArch: noarch
+
+BuildRequires: nodejs-packaging
+BuildRequires: npm(is-plain-obj)
+%if 0%{?enable_tests}
+BuildRequires: npm(ava)
+%endif
+
+%description
+Sort the keys of an object
+
+
+%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
+* Thu Apr 20 2017 Jared Smith <jsmith(a)fedoraproject.org> - 1.1.2-1
+- Initial packaging
diff --git a/sources b/sources
index e69de29..a6b86b1 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (sort-keys-1.1.2.tgz) = bf39fc692a8a832b558a4d22c1d0448becdebdb4d866881ec1350ce9db69986c0471dcdbb9bfd35f86c2cd185e6c30910b74335e026c2d1281d95fcea1fec75e
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..c5e41ea
--- /dev/null
+++ b/test.js
@@ -0,0 +1,78 @@
+'use strict';
+/* eslint-env mocha */
+var assert = require('assert');
+var sortKeys = require('./');
+
+it('should sort the keys of an object', function () {
+ assert.strictEqual(
+ JSON.stringify(sortKeys({c: 0, a: 0, b: 0})),
+ JSON.stringify({a: 0, b: 0, c: 0})
+ );
+});
+
+it('DEPRECATED - should sort the keys of an object with a custom sort function', function () {
+ var sortFn = function (a, b) {
+ return -a.localeCompare(b);
+ };
+
+ assert.strictEqual(
+ JSON.stringify(sortKeys({c: 0, a: 0, b: 0}, sortFn)),
+ JSON.stringify({c: 0, b: 0, a: 0})
+ );
+});
+
+it('custom compare function', function () {
+ var compare = function (a, b) {
+ return -a.localeCompare(b);
+ };
+
+ assert.strictEqual(
+ JSON.stringify(sortKeys({c: 0, a: 0, b: 0}, {compare: compare})),
+ JSON.stringify({c: 0, b: 0, a: 0})
+ );
+});
+
+it('deep option', function () {
+ assert.strictEqual(
+ JSON.stringify(sortKeys({c: {c: 0, a: 0, b: 0}, a: 0, b: 0}, {deep: true})),
+ JSON.stringify({a: 0, b: 0, c: {a: 0, b: 0, c: 0}})
+ );
+
+ assert.doesNotThrow(function () {
+ var obj = {a: 0};
+ obj.circular = obj;
+ sortKeys(obj, {deep: true});
+ });
+
+ var obj = {z: 0};
+ obj.circular = obj;
+ var sortedObj = sortKeys(obj, {deep: true});
+ assert.strictEqual(sortedObj, sortedObj.circular);
+ assert.strictEqual(
+ JSON.stringify(Object.keys(sortedObj)),
+ JSON.stringify(['circular', 'z'])
+ );
+
+ var obj1 = {b: 0};
+ var obj2 = {d: 0};
+ obj1.a = obj2;
+ obj2.c = obj1;
+
+ assert.doesNotThrow(function () {
+ sortKeys(obj1, {deep: true});
+ sortKeys(obj2, {deep: true});
+ });
+
+ var sorted = sortKeys(obj1, {deep: true});
+
+ assert.strictEqual(sorted, sorted.a.c);
+ assert.strictEqual(
+ JSON.stringify(Object.keys(sorted)),
+ JSON.stringify(['a', 'b'])
+ );
+
+ assert.strictEqual(
+ JSON.stringify(sortKeys({c: {c: 0, a: 0, b: 0}, a: 0, b: 0, z: [9, 8, 7, 6, 5]}, {deep: true})),
+ JSON.stringify({a: 0, b: 0, c: {a: 0, b: 0, c: 0}, z: [9, 8, 7, 6, 5]})
+ );
+});
5 years, 10 months
Architecture specific change in rpms/nodejs-write-json-file.git
by githook-noreply@fedoraproject.org
The package rpms/nodejs-write-json-file.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-write-json-file.git/commit....
Change:
+ExclusiveArch: %{nodejs_arches} noarch
Thanks.
Full change:
============
commit 7c39dded563709f6177deb4ca4228a57413b97ea
Author: Jared K. Smith <jaredsmith(a)jaredsmith.net>
Date: Wed May 3 13:44:20 2017 -0400
Initial packaging
diff --git a/.gitignore b/.gitignore
index e69de29..d3d1e22 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/write-json-file-2.0.0.tgz
diff --git a/nodejs-write-json-file.spec b/nodejs-write-json-file.spec
new file mode 100644
index 0000000..1794737
--- /dev/null
+++ b/nodejs-write-json-file.spec
@@ -0,0 +1,66 @@
+%{?nodejs_find_provides_and_requires}
+
+%global packagename write-json-file
+
+# tests missing due to missing npm(ava)
+%global enable_tests 0
+
+Name: nodejs-write-json-file
+Version: 2.0.0
+Release: 1%{?dist}
+Summary: Stringify and write JSON to a file atomically
+
+License: MIT
+URL: https://github.com/sindresorhus/write-json-file
+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/write-json-file/v%{version...
+
+ExclusiveArch: %{nodejs_arches} noarch
+BuildArch: noarch
+
+BuildRequires: nodejs-packaging
+BuildRequires: npm(mkdirp)
+BuildRequires: npm(pify)
+BuildRequires: npm(sort-keys)
+BuildRequires: npm(write-file-atomic)
+%if 0%{?enable_tests}
+BuildRequires: npm(ava)
+%endif
+
+%description
+Stringify and write JSON to a file atomically
+
+
+%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
+* Thu Apr 20 2017 Jared Smith <jsmith(a)fedoraproject.org> - 2.0.0-1
+- Initial packaging
diff --git a/sources b/sources
index e69de29..8ea7da5 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (write-json-file-2.0.0.tgz) = 7b4f1ef2cc0580d67c7fd3da43f30e7eb2c9b0624ef3ef8d0e807126ad6bc6bb11f2015a7a386674d78ad6fa86c2e21b9d0d0b7467bfee0294cfa34e263c41c6
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..7b6c867
--- /dev/null
+++ b/test.js
@@ -0,0 +1,17 @@
+import path from 'path';
+import fs from 'fs';
+import test from 'ava';
+import tempfile from 'tempfile';
+import m from './';
+
+test('async', async t => {
+ const tmp = path.join(tempfile(), 'foo');
+ await m(tmp, {foo: true}, {indent: 2});
+ t.is(fs.readFileSync(tmp, 'utf8'), '{\n "foo": true\n}\n');
+});
+
+test('sync', t => {
+ const tmp = path.join(tempfile(), 'foo');
+ m.sync(tmp, {foo: true}, {indent: 2});
+ t.is(fs.readFileSync(tmp, 'utf8'), '{\n "foo": true\n}\n');
+});
5 years, 10 months