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

check-dependency-version-consistency

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

check-dependency-version-consistency - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

2

dist/lib/cli.js

@@ -10,3 +10,3 @@ import { Command, Argument } from 'commander';

function getCurrentPackageVersion() {
const packageJson = JSON.parse(readFileSync(join(__dirname, '..', '..', 'package.json'), 'utf-8') // Relative to compiled version of this file in the dist folder.
const packageJson = JSON.parse(readFileSync(join(__dirname, '..', '..', 'package.json'), 'utf8') // Relative to compiled version of this file in the dist folder.
);

@@ -13,0 +13,0 @@ if (!packageJson.version) {

@@ -9,3 +9,3 @@ import { existsSync, readFileSync } from 'node:fs';

this.pathPackageJson = join(path, 'package.json');
const packageJsonContents = readFileSync(this.pathPackageJson, 'utf-8');
const packageJsonContents = readFileSync(this.pathPackageJson, 'utf8');
this.packageJsonEndsInNewline = packageJsonContents.endsWith('\n');

@@ -12,0 +12,0 @@ this.packageJson = JSON.parse(packageJsonContents);

@@ -63,3 +63,3 @@ import { join } from 'node:path';

}
const workspacePackageJson = JSON.parse(readFileSync(join(root, 'package.json'), 'utf-8'));
const workspacePackageJson = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8'));
if (!workspacePackageJson.workspaces) {

@@ -69,2 +69,10 @@ throw new Error('package.json at provided path does not specify `workspaces`.');

if (!Array.isArray(workspacePackageJson.workspaces)) {
if (workspacePackageJson.workspaces.packages) {
if (Array.isArray(workspacePackageJson.workspaces.packages)) {
return workspacePackageJson.workspaces.packages;
}
else {
throw new TypeError('package.json `workspaces.packages` is not a string array.');
}
}
throw new TypeError('package.json `workspaces` is not a string array.');

@@ -71,0 +79,0 @@ }

{
"name": "check-dependency-version-consistency",
"version": "2.0.3",
"version": "2.0.4",
"description": "Ensures dependencies are on consistent versions across a monorepo.",

@@ -41,3 +41,3 @@ "keywords": [

"chalk": "^4.1.2",
"commander": "^8.1.0",
"commander": "^9.0.0",
"edit-json-file": "^1.7.0",

@@ -58,7 +58,7 @@ "globby": "^13.1.1",

"eslint": "^8.1.0",
"eslint-plugin-jest": "^25.3.4",
"eslint-plugin-jest": "^26.1.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-square": "^21.0.0",
"eslint-plugin-square": "^22.1.0",
"jest": "^27.4.7",
"markdownlint-cli": "^0.30.0",
"markdownlint-cli": "^0.31.1",
"mock-fs": "^5.0.0",

@@ -65,0 +65,0 @@ "npm-package-json-lint": "^5.2.3",

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