Skip to content

Commit

Permalink
ci(custom-checks): fix dependencies being inconsistent phase 5
Browse files Browse the repository at this point in the history
Primary Changes
---------------
1. Fixed dependencies on targeted packages:
packages/cactus-plugin-keychain-azure-kv
packages/cactus-plugin-keychain-google-sm
packages/cactus-plugin-keychain-memory
packages/cactus-plugin-keychain-memory-wasm
packages/cactus-plugin-keychain-vault

Fixes:

Signed-off-by: ruzell22 <[email protected]>
  • Loading branch information
ruzell22 committed Jan 8, 2025
1 parent d2fac8a commit cf19857
Show file tree
Hide file tree
Showing 9 changed files with 169 additions and 36 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"ccid",
"ccmodel",
"cctx",
"CDVC",
"celo",
"cids",
"clazz",
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -91,7 +92,7 @@
"resolutions": {
"@babel/traverse": ">=7.23.2",
"ansi-html": ">=0.0.8",
"axios": ">=0.27.2",
"axios": "1.7.7",
"body-parser": ">=1.20.3",
"braces": ">=3.0.3",
"x-dicer": ">0.3.1",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/cactus-plugin-keychain-azure-kv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@hyperledger/cactus-core": "2.1.0",
"@hyperledger/cactus-core-api": "2.1.0",
"axios": "1.7.7",
"http-status-codes": "2.1.4",
"http-status-codes": "2.3.0",
"typescript-optional": "2.0.1"
},
"devDependencies": {
Expand All @@ -76,7 +76,7 @@
"@types/express": "5.0.0",
"@types/request": "2.48.7",
"body-parser": "1.20.3",
"express": "4.21.1",
"express": "4.21.2",
"internal-ip": "6.2.0",
"openapi-types": "12.1.3",
"uuid": "10.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/cactus-plugin-keychain-google-sm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@hyperledger/cactus-core": "2.1.0",
"@hyperledger/cactus-core-api": "2.1.0",
"axios": "1.7.7",
"http-status-codes": "2.1.4",
"http-status-codes": "2.3.0",
"typescript-optional": "2.0.1",
"uuid": "10.0.0"
},
Expand All @@ -72,7 +72,7 @@
"@types/request": "2.48.7",
"@types/uuid": "10.0.0",
"body-parser": "1.20.3",
"express": "4.21.1",
"express": "4.21.2",
"google-gax": "4.0.5",
"internal-ip": "6.2.0",
"openapi-types": "12.1.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/cactus-plugin-keychain-memory-wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@hyperledger/cactus-core": "2.1.0",
"@hyperledger/cactus-core-api": "2.1.0",
"axios": "1.7.7",
"express": "4.21.1",
"express": "4.21.2",
"prom-client": "15.1.3",
"uuid": "10.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cactus-plugin-keychain-memory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@hyperledger/cactus-core": "2.1.0",
"@hyperledger/cactus-core-api": "2.1.0",
"axios": "1.7.7",
"express": "4.21.1",
"express": "4.21.2",
"prom-client": "15.1.3",
"rxjs": "7.8.1",
"uuid": "10.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/cactus-plugin-keychain-vault/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,21 @@
"@hyperledger/cactus-core": "2.1.0",
"@hyperledger/cactus-core-api": "2.1.0",
"axios": "1.7.7",
"http-status-codes": "2.1.4",
"http-status-codes": "2.3.0",
"node-vault": "0.9.22",
"prom-client": "15.1.3",
"typescript-optional": "2.0.1"
},
"devDependencies": {
"@hyperledger/cactus-test-tooling": "2.1.0",
"@types/body-parser": "1.19.3",
"@types/body-parser": "1.19.4",
"@types/express": "5.0.0",
"@types/internal-ip": "4.1.0",
"@types/request": "2.48.7",
"@types/tape-promise": "4.0.1",
"@types/uuid": "10.0.0",
"body-parser": "1.20.3",
"express": "4.21.1",
"express": "4.21.2",
"internal-ip": "6.2.0",
"openapi-types": "12.1.3",
"uuid": "10.0.0"
Expand Down
26 changes: 26 additions & 0 deletions tools/custom-checks/check-dependency-version-consistency.ts
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);
}
Loading

0 comments on commit cf19857

Please sign in to comment.