package init

This commit is contained in:
wang_yue111 2020-09-08 16:01:10 +08:00
parent 2b2e88562a
commit 22fe098689
4 changed files with 2 additions and 16 deletions

View File

@ -7,8 +7,7 @@ Release: 1
Summary: Resolve the path of a package regardless of it having an entry
License: MIT
URL: https://github.com/sindresorhus/resolve-pkg
Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
Source1: https://raw.githubusercontent.com/sindresorhus/resolve-pkg/v%{version}/test.js
Source0: https://github.com/sindresorhus/resolve-pkg/archive/v%{version}.tar.gz
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
BuildRequires: nodejs-packaging npm(resolve-from)
@ -20,8 +19,7 @@ BuildRequires: npm(ava)
Resolve the path of a package regardless of it having an entry
%prep
%autosetup -n package
cp -p %{SOURCE1} .
%autosetup -n resolve-pkg-%{version}
%nodejs_fixdep resolve-from
%build

Binary file not shown.

12
test.js
View File

@ -1,12 +0,0 @@
import path from 'path';
import test from 'ava';
import m from './';
test(t => {
t.is(m('nonexistent'), null);
t.is(m('nonexistent/foo'), null);
t.is(path.relative('.', m('grunt-svgmin')), 'node_modules/grunt-svgmin');
t.is(path.relative('.', m('grunt-svgmin/tasks')), 'node_modules/grunt-svgmin/tasks');
t.is(path.relative('.', m('@someprivate/module-test')), 'node_modules/@someprivate/module-test');
t.is(path.relative('.', m('@someprivate/module-test/subdir')), 'node_modules/@someprivate/module-test/subdir');
});

BIN
v1.0.0.tar.gz Normal file

Binary file not shown.