Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pnpm/catalogs.resolver

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/catalogs.resolver - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

3

lib/matchCatalogResolveResult.js
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc