check-dependency-version-consistency
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -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", |
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
36359
575
+ Addedcommander@9.5.0(transitive)
- Removedcommander@8.3.0(transitive)
Updatedcommander@^9.0.0