@pnpm/local-resolver
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -25,7 +25,8 @@ "use strict"; | ||
if (pref.startsWith('path:')) { | ||
const err = new Error('Local dependencies via `path:` prefix are not supported. ' + | ||
'Use the `link:` prefix for folder dependencies and `file:` for local tarballs'); | ||
const err = new Error('Local dependencies via `path:` protocol are not supported. ' + | ||
'Use the `link:` protocol for folder dependencies and `file:` for local tarballs'); | ||
// tslint:disable:no-string-literal | ||
err['code'] = 'INVALID_PREF'; | ||
err['code'] = 'EUNSUPPORTEDPROTOCOL'; | ||
err['pref'] = pref; | ||
err['protocol'] = 'path:'; | ||
// tslint:enable:no-string-literal | ||
@@ -44,3 +45,3 @@ throw err; | ||
// TODO: always use link: for directory dependencies | ||
const prefPrefix = pref.startsWith('link:') ? 'link:' : 'file:'; | ||
const protocol = pref.startsWith('link:') ? 'link:' : 'file:'; | ||
let fetchSpec; | ||
@@ -51,3 +52,3 @@ let normalizedPref; | ||
fetchSpec = resolvePath(osenv.home(), spec.slice(2)); | ||
normalizedPref = `${prefPrefix}${spec}`; | ||
normalizedPref = `${protocol}${spec}`; | ||
} | ||
@@ -57,10 +58,10 @@ else { | ||
if (isAbsolute(spec)) { | ||
normalizedPref = `${prefPrefix}${spec}`; | ||
normalizedPref = `${protocol}${spec}`; | ||
} | ||
else { | ||
normalizedPref = `${prefPrefix}${path.relative(where, fetchSpec)}`; | ||
normalizedPref = `${protocol}${path.relative(where, fetchSpec)}`; | ||
} | ||
} | ||
const dependencyPath = normalize(path.relative(where, fetchSpec)); | ||
const id = `${prefPrefix}${dependencyPath}`; | ||
const id = `${protocol}${dependencyPath}`; | ||
return { | ||
@@ -67,0 +68,0 @@ dependencyPath, |
{ | ||
"name": "@pnpm/local-resolver", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Resolver for local packages", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13510
166