check-dependency-version-consistency
Advanced tools
Comparing version 0.1.0 to 0.1.1
# check-dependency-version-consistency | ||
## 0.1.1 (2020-12-28) | ||
#### :bug: Bug Fix | ||
* [#2](https://github.com/bmish/check-dependency-version-consistency/pull/2) Remove unused js-yaml dependency ([@bmish](https://github.com/bmish)) | ||
#### :memo: Documentation | ||
* [#6](https://github.com/bmish/check-dependency-version-consistency/pull/6) Add MIT license ([@bmish](https://github.com/bmish)) | ||
* [#5](https://github.com/bmish/check-dependency-version-consistency/pull/5) Add some package.json keywords ([@bmish](https://github.com/bmish)) | ||
* [#4](https://github.com/bmish/check-dependency-version-consistency/pull/4) Clarify a few aspects of the README ([@bmish](https://github.com/bmish)) | ||
#### Committers: 1 | ||
- Bryan Mishkin ([@bmish](https://github.com/bmish)) | ||
## 0.1.0 (2020-12-25) | ||
* Initial version |
@@ -1,1 +0,1 @@ | ||
export declare function flatMap(array: any[], callback: (item: any, index: number) => any): any; | ||
export declare function flatMap(array: any[], callback: (item: any, index: number) => any): any[]; |
@@ -9,5 +9,7 @@ "use strict"; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
callback) { | ||
callback | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
) { | ||
return array.reduce((result, item, index) => result.concat(callback(item, index)), []); | ||
} | ||
exports.flatMap = flatMap; |
import { readdirSync } from 'fs'; | ||
export function getDirectoriesInPath(path: string) { | ||
export function getDirectoriesInPath(path: string): string[] { | ||
return readdirSync(path, { withFileTypes: true }) | ||
@@ -5,0 +5,0 @@ .filter((dirent) => dirent.isDirectory()) |
@@ -7,3 +7,4 @@ // TODO: remove this and switch to native JavaScript `flatMap` once Node 12 is the minimum version we need to support. | ||
callback: (item: any, index: number) => any | ||
) { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
): any[] { | ||
return array.reduce( | ||
@@ -10,0 +11,0 @@ (result, item, index) => result.concat(callback(item, index)), |
@@ -5,3 +5,3 @@ import type { MismatchingDependencyVersions } from './dependency-versions'; | ||
mismatchingDependencyVersions: MismatchingDependencyVersions | ||
) { | ||
): string[] { | ||
return mismatchingDependencyVersions.map( | ||
@@ -8,0 +8,0 @@ (obj) => |
{ | ||
"name": "check-dependency-version-consistency", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Ensures dependencies are on consistent versions across a monorepo.", | ||
"keywords": [ | ||
"dependencies", | ||
"linter", | ||
"monorepo", | ||
"package.json", | ||
"packages", | ||
"workspace" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/bmish/check-dependency-version-consistency.git" | ||
}, | ||
"license": "MIT", | ||
"bin": { | ||
@@ -22,2 +29,3 @@ "check-dependency-version-consistency": "./dist/bin/check-dependency-version-consistency.js" | ||
"prepublishOnly": "tsc", | ||
"release": "release-it", | ||
"test": "nyc mocha -r ts-node/register 'test/**/*.ts'" | ||
@@ -33,4 +41,3 @@ }, | ||
"commander": "^6.2.1", | ||
"globby": "^11.0.0", | ||
"js-yaml": "^3.10.0" | ||
"globby": "^11.0.0" | ||
}, | ||
@@ -45,6 +52,8 @@ "devDependencies": { | ||
"eslint-plugin-square": "^17.0.0", | ||
"markdownlint-cli": "^0.23.2", | ||
"markdownlint-cli": "^0.26.0", | ||
"mocha": "^8.1.3", | ||
"npm-run-all": "^4.1.5", | ||
"nyc": "^15.1.0", | ||
"release-it": "^14.2.2", | ||
"release-it-lerna-changelog": "^3.1.0", | ||
"sort-package-json": "^1.44.0", | ||
@@ -56,3 +65,13 @@ "ts-node": "^9.1.1", | ||
"node": "10.x || 12.x || >= 14" | ||
}, | ||
"publishConfig": { | ||
"registry": "https://registry.npmjs.org" | ||
}, | ||
"release-it": { | ||
"plugins": { | ||
"release-it-lerna-changelog": { | ||
"infile": "CHANGELOG.md" | ||
} | ||
} | ||
} | ||
} |
# check-dependency-version-consistency | ||
This plugin checks to ensure that dependencies are on consistent versions across a monorepo / yarn workspace. | ||
[![npm version](https://badge.fury.io/js/check-dependency-version-consistency.svg)](https://badge.fury.io/js/check-dependency-version-consistency) | ||
![CI](https://github.com/bmish/check-dependency-version-consistency/workflows/CI/badge.svg) | ||
This plugin checks to ensure that dependencies are on consistent versions across a monorepo / yarn workspace. For example, every package in a workspace that has a dependency on `eslint` should specify the same version for it. | ||
## Usage | ||
To install: | ||
```sh | ||
yarn add --dev check-dependency-version-consistency | ||
``` | ||
To run, pass the path to the workspace root: | ||
@@ -13,3 +22,3 @@ | ||
This can be incorporated as one of your lint scripts like this: | ||
This can be incorporated as one of your package.json lint scripts like this: | ||
@@ -22,4 +31,6 @@ ```json | ||
Example output: | ||
If there are no dependency mismatches, the program will exit with success. | ||
If there are any dependency mismatches, the program will exit with failure and output the mismatching versions: | ||
```pt | ||
@@ -26,0 +37,0 @@ eslint has more than one version: ^7.0.0, ^7.1.0 |
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
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
21380
2
0
472
44
4
16
- Removedjs-yaml@^3.10.0
- Removedargparse@1.0.10(transitive)
- Removedesprima@4.0.1(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedsprintf-js@1.0.3(transitive)