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

@pnpm/workspace.read-manifest

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/workspace.read-manifest - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

lib/catalogs.d.ts

12

lib/index.d.ts

@@ -0,4 +1,16 @@

import { type WorkspaceCatalog, type WorkspaceNamedCatalogs } from './catalogs';
export interface WorkspaceManifest {
packages: string[];
/**
* The default catalog. Package manifests may refer to dependencies in this
* definition through the `catalog:default` specifier or the `catalog:`
* shorthand.
*/
catalog?: WorkspaceCatalog;
/**
* A dictionary of named catalogs. Package manifests may refer to dependencies
* in this definition through the `catalog:<name>` specifier.
*/
catalogs?: WorkspaceNamedCatalogs;
}
export declare function readWorkspaceManifest(dir: string): Promise<WorkspaceManifest | undefined>;

22

lib/index.js

@@ -9,5 +9,6 @@ "use strict";

const constants_1 = require("@pnpm/constants");
const error_1 = require("@pnpm/error");
const node_path_1 = __importDefault(require("node:path"));
const read_yaml_file_1 = __importDefault(require("read-yaml-file"));
const catalogs_1 = require("./catalogs");
const InvalidWorkspaceManifestError_1 = require("./errors/InvalidWorkspaceManifestError");
async function readWorkspaceManifest(dir) {

@@ -38,6 +39,6 @@ const manifest = await readManifestRaw(dir);

if (typeof manifest !== 'object') {
throw new InvalidWorkspaceManifestError(`Expected object but found - ${typeof manifest}`);
throw new InvalidWorkspaceManifestError_1.InvalidWorkspaceManifestError(`Expected object but found - ${typeof manifest}`);
}
if (Array.isArray(manifest)) {
throw new InvalidWorkspaceManifestError('Expected object but found - array');
throw new InvalidWorkspaceManifestError_1.InvalidWorkspaceManifestError('Expected object but found - array');
}

@@ -49,2 +50,4 @@ if (Object.keys(manifest).length === 0) {

assertValidWorkspaceManifestPackages(manifest);
(0, catalogs_1.assertValidWorkspaceManifestCatalog)(manifest);
(0, catalogs_1.assertValidWorkspaceManifestCatalogs)(manifest);
checkWorkspaceManifestAssignability(manifest);

@@ -54,14 +57,14 @@ }

if (!manifest.packages) {
throw new InvalidWorkspaceManifestError('packages field missing or empty');
throw new InvalidWorkspaceManifestError_1.InvalidWorkspaceManifestError('packages field missing or empty');
}
if (!Array.isArray(manifest.packages)) {
throw new InvalidWorkspaceManifestError('packages field is not an array');
throw new InvalidWorkspaceManifestError_1.InvalidWorkspaceManifestError('packages field is not an array');
}
for (const pkg of manifest.packages) {
if (!pkg) {
throw new InvalidWorkspaceManifestError('Missing or empty package');
throw new InvalidWorkspaceManifestError_1.InvalidWorkspaceManifestError('Missing or empty package');
}
const type = typeof pkg;
if (type !== 'string') {
throw new InvalidWorkspaceManifestError(`Invalid package type - ${type}`);
throw new InvalidWorkspaceManifestError_1.InvalidWorkspaceManifestError(`Invalid package type - ${type}`);
}

@@ -77,7 +80,2 @@ }

function checkWorkspaceManifestAssignability(_manifest) { }
class InvalidWorkspaceManifestError extends error_1.PnpmError {
constructor(message) {
super('INVALID_WORKSPACE_CONFIGURATION', message);
}
}
//# sourceMappingURL=index.js.map
{
"name": "@pnpm/workspace.read-manifest",
"version": "2.1.0",
"version": "2.2.0",
"description": "Reads a workspace manifest file",

@@ -31,3 +31,3 @@ "main": "lib/index.js",

"devDependencies": {
"@pnpm/workspace.read-manifest": "2.1.0"
"@pnpm/workspace.read-manifest": "2.2.0"
},

@@ -34,0 +34,0 @@ "exports": {

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