forked from hyperledger-cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(custom-checks): fix dependencies being inconsistent phase 5
test Signed-off-by: ruzell22 <[email protected]>
- Loading branch information
Showing
9 changed files
with
175 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ | |
"ccid", | ||
"ccmodel", | ||
"cctx", | ||
"CDVC", | ||
"celo", | ||
"cids", | ||
"clazz", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ | |
"tools:uninstall-pre-commit-secret-detection": "pre-commit uninstall", | ||
"tools:validate-bundle-names": "TS_NODE_PROJECT=./tools/tsconfig.json node --trace-deprecation --experimental-modules --abort-on-uncaught-exception --loader ts-node/esm --experimental-specifier-resolution=node ./tools/validate-bundle-names.js", | ||
"tools:bump-openapi-spec-dep-versions": "TS_NODE_PROJECT=./tools/tsconfig.json node --trace-deprecation --experimental-modules --abort-on-uncaught-exception --loader ts-node/esm --experimental-specifier-resolution=node ./tools/bump-openapi-spec-dep-versions.ts", | ||
"tools:check-dependency-version-consistency": "TS_NODE_PROJECT=./tools/tsconfig.json node --trace-deprecation --experimental-modules --abort-on-uncaught-exception --loader ts-node/esm --experimental-specifier-resolution=node ./tools/custom-checks/check-dependency-version-consistency.ts", | ||
"tools:bundle-open-api-tpl-files": "TS_NODE_PROJECT=./tools/tsconfig.json node --trace-deprecation --experimental-modules --abort-on-uncaught-exception --loader ts-node/esm --experimental-specifier-resolution=node ./tools/bundle-open-api-tpl-files.ts", | ||
"tools:create-production-only-archive": "TS_NODE_PROJECT=./tools/tsconfig.json node --trace-deprecation --experimental-modules --abort-on-uncaught-exception --loader ts-node/esm --experimental-specifier-resolution=node ./tools/create-production-only-archive.ts", | ||
"tools:download-file-to-disk": "TS_NODE_PROJECT=./tools/tsconfig.json node --trace-deprecation --experimental-modules --abort-on-uncaught-exception --loader ts-node/esm --experimental-specifier-resolution=node ./tools/download-file-to-disk.ts", | ||
|
@@ -91,34 +92,34 @@ | |
"resolutions": { | ||
"@babel/traverse": ">=7.23.2", | ||
"ansi-html": ">=0.0.8", | ||
"axios": ">=0.27.2", | ||
"body-parser": ">=1.20.3", | ||
"axios": ">=1.7.7", | ||
"body-parser": "1.20.3", | ||
"braces": ">=3.0.3", | ||
"x-dicer": ">0.3.1", | ||
"elliptic": ">=6.5.7", | ||
"elliptic": "6.5.7", | ||
"engine.io": ">=6.4.2", | ||
"get-func-name": ">=2.0.1", | ||
"glob-parent": ">=5.1.2", | ||
"x-hoek": ">6.1.3", | ||
"http-cache-semantics": ">=4.1.1", | ||
"http-cache-semantics": "4.1.1", | ||
"[email protected]": "2.0.7", | ||
"http-proxy-middleware@^2.0.3": "2.0.7", | ||
"x-ip": ">2.0.1", | ||
"jsonwebtoken": ">=9.0.0", | ||
"jsrsasign": ">=11.0.0", | ||
"lodash": ">=4.17.21", | ||
"jsonwebtoken": ">=9.0.2", | ||
"jsrsasign": "11.0.0", | ||
"lodash": "4.17.21", | ||
"x-minimatch": ">=3.0.5", | ||
"minimist": ">=1.2.6", | ||
"minimist": ">=1.2.8", | ||
"nano": ">=10.0.0", | ||
"node-forge": ">=1.3.0", | ||
"node-forge": "1.3.0", | ||
"nth-check": ">=2.0.1", | ||
"postcss": ">=8.4.31", | ||
"protobufjs": ">=7.2.5", | ||
"semver": ">=7.5.2", | ||
"protobufjs": ">=7.4.0", | ||
"semver": ">=7.6.2", | ||
"socket.io-parser": ">=4.2.3", | ||
"tough-cookie": ">=4.1.3", | ||
"underscore": ">=1.13.2", | ||
"vite": ">4.5.1", | ||
"vite": ">5.4.9", | ||
"webpack-dev-middleware": ">=6.1.2", | ||
"word-wrap": ">=1.2.5", | ||
"ws": ">=1.1.5", | ||
|
@@ -152,7 +153,7 @@ | |
"@types/fs-extra": "11.0.4", | ||
"@types/jest": "29.5.3", | ||
"@types/madge": "5.0.3", | ||
"@types/node": "18.11.9", | ||
"@types/node": "18.19.0", | ||
"@types/node-fetch": "2.6.4", | ||
"@types/tape": "4.13.4", | ||
"@types/tape-promise": "4.0.1", | ||
|
@@ -163,6 +164,7 @@ | |
"adm-zip": "0.5.10", | ||
"benchmark": "2.1.4", | ||
"buffer": "6.0.3", | ||
"check-dependency-version-consistency": "^5.0.0", | ||
"cpy-cli": "4.2.0", | ||
"cross-env": "7.0.3", | ||
"crypto-browserify": "3.12.0", | ||
|
@@ -219,9 +221,9 @@ | |
"ts-node": "10.9.1", | ||
"tsx": "4.16.2", | ||
"typescript": "5.5.2", | ||
"web3": "4.1.1", | ||
"web3": "4.4.0", | ||
"web3-core": "4.1.1", | ||
"web3-eth": "4.1.1", | ||
"web3-eth": "4.4.0", | ||
"web3-utils": "4.3.0", | ||
"webpack": "5.95.0", | ||
"webpack-cli": "4.10.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
tools/custom-checks/check-dependency-version-consistency.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { CDVC } from "check-dependency-version-consistency"; | ||
import esMain from "es-main"; | ||
import { exit } from "process"; | ||
const PACKAGES_TO_BE_IGNORED_FOR_DEP_CONSISTENCY_CHECK: string[] = []; | ||
export async function checkDependencyVersionConsistency(): Promise< | ||
[boolean, string[]] | ||
> { | ||
const errors: string[] = []; | ||
const cdvc = new CDVC(process.cwd(), { | ||
ignorePackage: PACKAGES_TO_BE_IGNORED_FOR_DEP_CONSISTENCY_CHECK, | ||
fix: true, | ||
}); | ||
if (cdvc.hasMismatchingDependencies) { | ||
errors.push(cdvc.toMismatchSummary()); | ||
} | ||
return [errors.length === 0, errors]; | ||
} | ||
if (esMain(import.meta)) { | ||
const [success, dependencyMismatchSummary] = | ||
await checkDependencyVersionConsistency(); | ||
if (!success) { | ||
console.log(`${dependencyMismatchSummary}`); | ||
exit(1); | ||
} | ||
exit(0); | ||
} |
Oops, something went wrong.