@pnpm/catalogs.resolver
Advanced tools
Comparing version 0.1.0 to 0.1.1
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.matchCatalogResolveResult = void 0; | ||
exports.matchCatalogResolveResult = matchCatalogResolveResult; | ||
function matchCatalogResolveResult(result, matcher) { | ||
@@ -11,3 +11,2 @@ switch (result.type) { | ||
} | ||
exports.matchCatalogResolveResult = matchCatalogResolveResult; | ||
//# sourceMappingURL=matchCatalogResolveResult.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.resolveFromCatalog = void 0; | ||
exports.resolveFromCatalog = resolveFromCatalog; | ||
const error_1 = require("@pnpm/error"); | ||
@@ -26,2 +26,28 @@ const catalogs_protocol_parser_1 = require("@pnpm/catalogs.protocol-parser"); | ||
} | ||
// Ban catalog entries that use the workspace protocol for a few reasons: | ||
// | ||
// 1. It's kind of silly. It'd be better to encourage users to use the | ||
// workspace protocol directly. | ||
// 2. Catalogs cache the resolved version of a dependency specifier in | ||
// pnpm-lock.yaml for more consistent resolution across importers. The | ||
// link: resolutions can't be shared between importers. | ||
const protocolOfLookup = catalogLookup.split(':')[0]; | ||
if (protocolOfLookup === 'workspace') { | ||
return { | ||
type: 'misconfiguration', | ||
catalogName, | ||
error: new error_1.PnpmError('CATALOG_ENTRY_INVALID_WORKSPACE_SPEC', `The workspace protocol cannot be used as a catalog value. The entry for '${wantedDependency.alias}' in catalog '${catalogName}' is invalid.`), | ||
}; | ||
} | ||
// A future version of pnpm will try to support this. These protocols aren't | ||
// supported today since these are often relative file paths that users expect | ||
// to be relative to the repo root rather than the location of the pnpm | ||
// workspace package. | ||
if (['link', 'file'].includes(protocolOfLookup)) { | ||
return { | ||
type: 'misconfiguration', | ||
catalogName, | ||
error: new error_1.PnpmError('CATALOG_ENTRY_INVALID_SPEC', `The entry for '${wantedDependency.alias}' in catalog '${catalogName}' declares a dependency using the '${protocolOfLookup}' protocol. This is not yet supported, but may be in a future version of pnpm.`), | ||
}; | ||
} | ||
return { | ||
@@ -35,3 +61,2 @@ type: 'found', | ||
} | ||
exports.resolveFromCatalog = resolveFromCatalog; | ||
//# sourceMappingURL=resolveFromCatalog.js.map |
{ | ||
"name": "@pnpm/catalogs.resolver", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Dereferences catalog protocol specifiers into usable specifiers.", | ||
@@ -31,6 +31,6 @@ "main": "lib/index.js", | ||
"@pnpm/catalogs.protocol-parser": "^0.1.0", | ||
"@pnpm/error": "^6.0.1" | ||
"@pnpm/error": "^6.0.2" | ||
}, | ||
"devDependencies": { | ||
"@pnpm/catalogs.resolver": "0.1.0", | ||
"@pnpm/catalogs.resolver": "0.1.1", | ||
"@pnpm/catalogs.types": "0.1.0" | ||
@@ -37,0 +37,0 @@ }, |
Sorry, the diff of this file is not supported yet
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
11242
135
Updated@pnpm/error@^6.0.2