From 10f093e76ce2a3d917e6217b10c8c607437412f6 Mon Sep 17 00:00:00 2001 From: wang_yue111 <648774160@qq.com> Date: Fri, 28 Aug 2020 15:16:33 +0800 Subject: [PATCH] package init --- license | 21 +++++++++++++++ nodejs-require-uncached.spec | 51 +++++++++++++++++++++++++++++++++++ nodejs-require-uncached.yaml | 5 ++++ require-uncached-1.0.3.tgz | Bin 0 -> 1855 bytes test.js | 12 +++++++++ 5 files changed, 89 insertions(+) create mode 100644 license create mode 100644 nodejs-require-uncached.spec create mode 100644 nodejs-require-uncached.yaml create mode 100644 require-uncached-1.0.3.tgz create mode 100644 test.js diff --git a/license b/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/nodejs-require-uncached.spec b/nodejs-require-uncached.spec new file mode 100644 index 0000000..268ae97 --- /dev/null +++ b/nodejs-require-uncached.spec @@ -0,0 +1,51 @@ +%global enable_tests 0 +%global module_name require-uncached +Name: nodejs-%{module_name} +Version: 1.0.3 +Release: 1 +Summary: Require a module bypassing the cache +License: MIT +URL: https://github.com/sindresorhus/require-uncached +Source0: http://registry.npmjs.org/require-uncached/-/require-uncached-%{version}.tgz +Source1: https://raw.githubusercontent.com/sindresorhus/import-fresh/v%{version}/license +Source2: https://raw.githubusercontent.com/sindresorhus/import-fresh/v%{version}/test.js +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch +BuildRequires: nodejs-packaging npm(caller-path) npm(resolve-from) +%if 0%{?enable_tests} +BuildRequires: npm(ava) +%endif +%description +Useful for testing purposes when you need to freshly require a module. + +%prep +%autosetup -n package +rm -rf node_modules +cp -p %{SOURCE1} %{SOURCE2} . +%nodejs_fixdep caller-path +%nodejs_fixdep resolve-from + +%build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/%{module_name} +cp -pr package.json *.js %{buildroot}%{nodejs_sitelib}/%{module_name} +%nodejs_symlink_deps + +%check +%nodejs_symlink_deps --check +%{__nodejs} -e 'require("./")' +%if 0%{?enable_tests} +node test.js +%else +%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" +%endif + +%files +%doc readme.md +%license license +%{nodejs_sitelib}/%{module_name} + +%changelog +* Fri Aug 14 2020 wangyue - 1.0.3-1 +- Package init diff --git a/nodejs-require-uncached.yaml b/nodejs-require-uncached.yaml new file mode 100644 index 0000000..9ebfd50 --- /dev/null +++ b/nodejs-require-uncached.yaml @@ -0,0 +1,5 @@ +git_url: https://github.com/sindresorhus/require-uncached +version_control: github +src_repo: sindresorhus/require-uncached +tag_prefix: "^v" +seperator: "." diff --git a/require-uncached-1.0.3.tgz b/require-uncached-1.0.3.tgz new file mode 100644 index 0000000000000000000000000000000000000000..d8fef8f897f3c672200ba81104d5683b9a3e5f02 GIT binary patch literal 1855 zcmV-F2f+9riwFP!000001MOJ!H?BQUs`|V-@d@&AktJT@t1N!cFUYKudC+}lx@9nqXS$h`;TWwU>d)C5EoAf?+AP==nr=G%4 z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ZgJ?17H~G1N>$gwb-EE;b* z5^yhKA~tML4#5I>MP@{u`FjX4>d4=Ilm!$+IUI?(C_ET4p)6^Jp!kxin>fuAK}_k( z&9sv2G7>thLm&wHGD}gYNobN@r+GB70O127LjFz!#%<=hj?U;%=m{k>EmEXOvIq-a zTg^mhHpL4ty3ET~ATede;|F{Sk%ZKzGK%DariLXW5HutGk}=v5-lfE1<*znDEK>|M z4}lgSS+8m_q(iE5m%K+P7@31)POq zVdM^fc8=|1*y@h4zg34f&g67>J^|ElyMxJF7@k0P@D_e@2FG=<|2A^%@fe0KbIwM6 z$3~em==IN!oxy83Lc75b_q&4|9YH5UAcqB%V~+{!%yxUH*zF!UeP{Bv&Q6@kfG|&n zE_7kkbtg{myx($%P{bL)2M>a;*J?h)JE1XoX-*wLFaNIrXzP63k5K&x4YI$_<=F}z; z`Rn3eZ{iFGG>zVHFmbV4$630QmFXL2Y}cXdI%7)6i90;2GfF2~3=Ig{4eT6+QVq9O t1XZYiKDJkYaBO$`h=t2DxV3!N*Ipf;+EaUKPwmg!{sYObxLg1p000H?n{ogE literal 0 HcmV?d00001 diff --git a/test.js b/test.js new file mode 100644 index 0000000..f3dd21a --- /dev/null +++ b/test.js @@ -0,0 +1,12 @@ +import test from 'ava'; +import m from './'; + +test(t => { + const id = './fixture'; + t.is(require(id)(), 1); + t.is(require(id)(), 2); + t.is(require(id)(), 3); + t.is(m(id)(), 1); + t.is(m(id)(), 1); + t.is(m(id)(), 1); +});