From ba48994009f55a05a88743f7a56c3cad39594f7c Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 28 May 2024 15:58:13 -0400 Subject: [PATCH 01/14] Make initial linter changes Signed-off-by: Andrew W. Harn --- .eslintrc.js | 6 +- .../{test-tsconfig.json => tsconfig.json} | 5 +- npm-shrinkwrap.json | 345 +++++++++++++++++- package.json | 12 +- packages/.madgerc | 7 + ....zowe.daemon.integration.suite.subtest.ts} | 8 +- ...on.ts => cli.zowe.exe.integration.test.ts} | 0 ...cli.daemon.disable.integration.subtest.ts} | 0 ... cli.daemon.enable.integration.subtest.ts} | 0 ...cli.daemon.restart.integration.subtest.ts} | 0 packages/cli/__tests__/tsconfig.json | 28 ++ packages/core/__tests__/tsconfig.json | 12 + packages/imperative/.eslintrc.js | 12 + packages/imperative/__tests__/tsconfig.json | 28 ++ packages/imperative/package.json | 6 +- packages/imperative/tsconfig-tests.json | 7 +- packages/provisioning/__tests__/tsconfig.json | 12 + packages/secrets/package.json | 1 + packages/workflows/__tests__/tsconfig.json | 12 + packages/zosconsole/__tests__/tsconfig.json | 12 + packages/zosfiles/__tests__/tsconfig.json | 12 + packages/zosjobs/__tests__/tsconfig.json | 12 + packages/zoslogs/__tests__/tsconfig.json | 12 + packages/zosmf/__tests__/tsconfig.json | 12 + packages/zostso/__tests__/tsconfig.json | 12 + packages/zosuss/__tests__/tsconfig.json | 12 + 26 files changed, 554 insertions(+), 31 deletions(-) rename __tests__/{test-tsconfig.json => tsconfig.json} (88%) create mode 100644 packages/.madgerc rename packages/cli/__tests__/daemon/__integration__/{cli.zowe.daemon.integration.suite.test.ts => cli.zowe.daemon.integration.suite.subtest.ts} (93%) rename packages/cli/__tests__/daemon/__integration__/{cli.zowe.exe.integration.ts => cli.zowe.exe.integration.test.ts} (100%) rename packages/cli/__tests__/daemon/__integration__/disable/{cli.daemon.disable.integration.ts => cli.daemon.disable.integration.subtest.ts} (100%) rename packages/cli/__tests__/daemon/__integration__/enable/{cli.daemon.enable.integration.ts => cli.daemon.enable.integration.subtest.ts} (100%) rename packages/cli/__tests__/daemon/__integration__/restart/{cli.daemon.restart.integration.ts => cli.daemon.restart.integration.subtest.ts} (100%) create mode 100644 packages/cli/__tests__/tsconfig.json create mode 100644 packages/core/__tests__/tsconfig.json create mode 100644 packages/imperative/.eslintrc.js create mode 100644 packages/imperative/__tests__/tsconfig.json create mode 100644 packages/provisioning/__tests__/tsconfig.json create mode 100644 packages/workflows/__tests__/tsconfig.json create mode 100644 packages/zosconsole/__tests__/tsconfig.json create mode 100644 packages/zosfiles/__tests__/tsconfig.json create mode 100644 packages/zosjobs/__tests__/tsconfig.json create mode 100644 packages/zoslogs/__tests__/tsconfig.json create mode 100644 packages/zosmf/__tests__/tsconfig.json create mode 100644 packages/zostso/__tests__/tsconfig.json create mode 100644 packages/zosuss/__tests__/tsconfig.json diff --git a/.eslintrc.js b/.eslintrc.js index 925a75dbb3..3b4488bdb1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -5,7 +5,8 @@ module.exports = { }, "extends": [ "eslint:recommended", - "plugin:@typescript-eslint/recommended" + "plugin:@typescript-eslint/recommended", + "plugin:deprecation/recommended" ], "ignorePatterns": [ "**/*.js", @@ -37,7 +38,8 @@ module.exports = { "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": 12, - "sourceType": "module" + "sourceType": "module", + "project": ["./tsconfig.json", "./__tests__/tsconfig.json"] }, "plugins": [ "@typescript-eslint", diff --git a/__tests__/test-tsconfig.json b/__tests__/tsconfig.json similarity index 88% rename from __tests__/test-tsconfig.json rename to __tests__/tsconfig.json index c3a54d9081..d40bd8139b 100644 --- a/__tests__/test-tsconfig.json +++ b/__tests__/tsconfig.json @@ -17,8 +17,9 @@ "newLine": "lf" }, "include": [ - "./**/*.ts", - "../packages/**/__tests__/**/*.ts" + "**/*.test.ts", + "**/*.subtest.ts", + "**/__tests__/**/*" ], "files": [ "../__types__/wontache.d.ts" diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index bbdac367c1..eca5d414b1 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -25,6 +25,7 @@ "chalk": "^4.1.0", "env-cmd": "^10.1.0", "eslint": "^8.22.0", + "eslint-plugin-deprecation": "^2.0.0", "eslint-plugin-jest": "^26.8.0", "eslint-plugin-unused-imports": "^2.0.0", "fancy-log": "^1.3.3", @@ -821,6 +822,33 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@eslint/eslintrc": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", @@ -5768,9 +5796,9 @@ "dev": true }, "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "node_modules/@types/jsonfile": { @@ -5906,9 +5934,9 @@ } }, "node_modules/@types/semver": { - "version": "7.3.12", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.12.tgz", - "integrity": "sha512-WwA1MW0++RfXmCr12xeYOOC5baSC9mSb0ZqCquFzKhcoF4TvHu5MKOuXsncgZcpVFhB1pXd5hZmM0ryAoCp12A==", + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "dev": true }, "node_modules/@types/sizzle": { @@ -10049,6 +10077,163 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-plugin-deprecation": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-deprecation/-/eslint-plugin-deprecation-2.0.0.tgz", + "integrity": "sha512-OAm9Ohzbj11/ZFyICyR5N6LbOIvQMp7ZU2zI7Ej0jIc8kiGUERXPNMfw2QqqHD1ZHtjMub3yPZILovYEYucgoQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/utils": "^6.0.0", + "tslib": "^2.3.1", + "tsutils": "^3.21.0" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0", + "typescript": "^4.2.4 || ^5.0.0" + } + }, + "node_modules/eslint-plugin-deprecation/node_modules/@typescript-eslint/scope-manager": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-plugin-deprecation/node_modules/@typescript-eslint/types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-plugin-deprecation/node_modules/@typescript-eslint/typescript-estree": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-deprecation/node_modules/@typescript-eslint/utils": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", + "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/eslint-plugin-deprecation/node_modules/@typescript-eslint/visitor-keys": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-plugin-deprecation/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/eslint-plugin-deprecation/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-plugin-deprecation/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/eslint-plugin-deprecation/node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, "node_modules/eslint-plugin-jest": { "version": "26.9.0", "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-26.9.0.tgz", @@ -19411,6 +19596,18 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, "node_modules/ts-jest": { "version": "29.1.1", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz", @@ -21646,6 +21843,23 @@ } } }, + "@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^3.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true + } + } + }, "@eslint/eslintrc": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", @@ -25286,9 +25500,9 @@ "dev": true }, "@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "@types/jsonfile": { @@ -25424,9 +25638,9 @@ } }, "@types/semver": { - "version": "7.3.12", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.12.tgz", - "integrity": "sha512-WwA1MW0++RfXmCr12xeYOOC5baSC9mSb0ZqCquFzKhcoF4TvHu5MKOuXsncgZcpVFhB1pXd5hZmM0ryAoCp12A==", + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "dev": true }, "@types/sizzle": { @@ -28862,6 +29076,106 @@ } } }, + "eslint-plugin-deprecation": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-deprecation/-/eslint-plugin-deprecation-2.0.0.tgz", + "integrity": "sha512-OAm9Ohzbj11/ZFyICyR5N6LbOIvQMp7ZU2zI7Ej0jIc8kiGUERXPNMfw2QqqHD1ZHtjMub3yPZILovYEYucgoQ==", + "dev": true, + "requires": { + "@typescript-eslint/utils": "^6.0.0", + "tslib": "^2.3.1", + "tsutils": "^3.21.0" + }, + "dependencies": { + "@typescript-eslint/scope-manager": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" + } + }, + "@typescript-eslint/types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + } + }, + "@typescript-eslint/utils": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", + "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "semver": "^7.5.4" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "dev": true, + "requires": { + "@typescript-eslint/types": "6.21.0", + "eslint-visitor-keys": "^3.4.1" + } + }, + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true + }, + "minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + } + } + }, "eslint-plugin-jest": { "version": "26.9.0", "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-26.9.0.tgz", @@ -35881,6 +36195,13 @@ "integrity": "sha512-N5gJCkLu1aXccpOTtqV6ddSEi6ZmGkh3hjmbu1IjcavJK4qyOVQmi0myQKM7z5jVGmD68SJoliaVrMmVObhj6A==", "dev": true }, + "ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "dev": true, + "requires": {} + }, "ts-jest": { "version": "29.1.1", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz", diff --git a/package.json b/package.json index ddcc2984df..5352d87e3d 100644 --- a/package.json +++ b/package.json @@ -15,11 +15,12 @@ "clean": "lerna run --parallel clean", "clean:exe": "cd zowex && cargo clean", "installWithBuild": "npm install && npm run build", - "checkTestsCompile": "echo \"Checking that test source compiles...\" && tsc --project __tests__/test-tsconfig.json --noEmit", - "circularDependencyCheck": "lerna run --parallel circularDependencyCheck -- -- --warning --no-spinner", - "lint": "eslint \"packages/**/*.ts\" \"**/__tests__/**/*.ts\"", - "lint:packages": "eslint \"packages/**/*.ts\" --ignore-pattern \"**/__tests__/**/*.ts\"", - "lint:tests": "eslint \"**/__tests__/**/*.ts\"", + "checkTestsCompile": "echo \"Checking that test source compiles...\" && tsc --project __tests__/tsconfig.json --noEmit", + "circularDependencyCheck": "lerna run --parallel circularDependencyCheck -- --warning --no-spinner", + "lint": "lerna run lint --parallel --no-bail", + "lint:packages": "lerna run lint:packages --parallel --no-bail", + "lint:series": "lerna run lint --no-bail", + "lint:tests": "lerna run lint:tests --parallel --no-bail", "test": "npm run test:unit && npm run test:integration && npm run test:system", "test:act": "node scripts/testCliWorkflow.js", "test:cleanResults": "rimraf __tests__/__results__", @@ -56,6 +57,7 @@ "chalk": "^4.1.0", "env-cmd": "^10.1.0", "eslint": "^8.22.0", + "eslint-plugin-deprecation": "^2.0.0", "eslint-plugin-jest": "^26.8.0", "eslint-plugin-unused-imports": "^2.0.0", "fancy-log": "^1.3.3", diff --git a/packages/.madgerc b/packages/.madgerc new file mode 100644 index 0000000000..99ddc7266e --- /dev/null +++ b/packages/.madgerc @@ -0,0 +1,7 @@ +{ + "detectiveOptions": { + "ts": { + "skipTypeImports": true + } + } +} \ No newline at end of file diff --git a/packages/cli/__tests__/daemon/__integration__/cli.zowe.daemon.integration.suite.test.ts b/packages/cli/__tests__/daemon/__integration__/cli.zowe.daemon.integration.suite.subtest.ts similarity index 93% rename from packages/cli/__tests__/daemon/__integration__/cli.zowe.daemon.integration.suite.test.ts rename to packages/cli/__tests__/daemon/__integration__/cli.zowe.daemon.integration.suite.subtest.ts index 586bfbc873..313f1f3a8d 100644 --- a/packages/cli/__tests__/daemon/__integration__/cli.zowe.daemon.integration.suite.test.ts +++ b/packages/cli/__tests__/daemon/__integration__/cli.zowe.daemon.integration.suite.subtest.ts @@ -90,8 +90,8 @@ describe("Zowe daemon suite", () => { }); // run all of our daemon-related tests - require("./cli.zowe.exe.integration"); - require("./enable/cli.daemon.enable.integration"); - require("./disable/cli.daemon.disable.integration"); - require("./restart/cli.daemon.restart.integration"); + require("./cli.zowe.exe.integration.subtest"); + require("./enable/cli.daemon.enable.integration.subtest"); + require("./disable/cli.daemon.disable.integration.subtest"); + require("./restart/cli.daemon.restart.integration.subtest"); }); diff --git a/packages/cli/__tests__/daemon/__integration__/cli.zowe.exe.integration.ts b/packages/cli/__tests__/daemon/__integration__/cli.zowe.exe.integration.test.ts similarity index 100% rename from packages/cli/__tests__/daemon/__integration__/cli.zowe.exe.integration.ts rename to packages/cli/__tests__/daemon/__integration__/cli.zowe.exe.integration.test.ts diff --git a/packages/cli/__tests__/daemon/__integration__/disable/cli.daemon.disable.integration.ts b/packages/cli/__tests__/daemon/__integration__/disable/cli.daemon.disable.integration.subtest.ts similarity index 100% rename from packages/cli/__tests__/daemon/__integration__/disable/cli.daemon.disable.integration.ts rename to packages/cli/__tests__/daemon/__integration__/disable/cli.daemon.disable.integration.subtest.ts diff --git a/packages/cli/__tests__/daemon/__integration__/enable/cli.daemon.enable.integration.ts b/packages/cli/__tests__/daemon/__integration__/enable/cli.daemon.enable.integration.subtest.ts similarity index 100% rename from packages/cli/__tests__/daemon/__integration__/enable/cli.daemon.enable.integration.ts rename to packages/cli/__tests__/daemon/__integration__/enable/cli.daemon.enable.integration.subtest.ts diff --git a/packages/cli/__tests__/daemon/__integration__/restart/cli.daemon.restart.integration.ts b/packages/cli/__tests__/daemon/__integration__/restart/cli.daemon.restart.integration.subtest.ts similarity index 100% rename from packages/cli/__tests__/daemon/__integration__/restart/cli.daemon.restart.integration.ts rename to packages/cli/__tests__/daemon/__integration__/restart/cli.daemon.restart.integration.subtest.ts diff --git a/packages/cli/__tests__/tsconfig.json b/packages/cli/__tests__/tsconfig.json new file mode 100644 index 0000000000..c4d748311b --- /dev/null +++ b/packages/cli/__tests__/tsconfig.json @@ -0,0 +1,28 @@ +{ + // tsconfig for test files // + "compilerOptions": { + "types": ["node", "jest"], + "lib": ["esnext"], + "target": "es2015", + "module": "commonjs", + "declaration": true, + "moduleResolution": "node", + "noImplicitAny": true, + "preserveConstEnums": true, + "experimentalDecorators": true, + "removeComments": false, + "pretty": true, + "sourceMap": true, + "newLine": "lf", + "esModuleInterop": true + }, + "include": [ + "**/*.test.ts", + "**/*.subtest.ts", + "**/__tests__/**/*" + ], + "exclude": [ + "lib", + "node_modules" + ] +} \ No newline at end of file diff --git a/packages/core/__tests__/tsconfig.json b/packages/core/__tests__/tsconfig.json new file mode 100644 index 0000000000..434259e064 --- /dev/null +++ b/packages/core/__tests__/tsconfig.json @@ -0,0 +1,12 @@ +{ + // tsconfig for test files // + "extends": "../../../__tests__/tsconfig.json", + "include": [ + "**/*.test.ts", + "**/__tests__/**/*" + ], + "exclude": [ + "lib", + "node_modules" + ] +} diff --git a/packages/imperative/.eslintrc.js b/packages/imperative/.eslintrc.js new file mode 100644 index 0000000000..fa630b127c --- /dev/null +++ b/packages/imperative/.eslintrc.js @@ -0,0 +1,12 @@ +module.exports = { + ...require("../../.eslintrc.js"), + "parserOptions": { + "ecmaVersion": 12, + "sourceType": "module", + "project": [ + "./tsconfig.json", + "./__tests__/tsconfig.json", + "./tsconfig-tests.json" + ] + } +} \ No newline at end of file diff --git a/packages/imperative/__tests__/tsconfig.json b/packages/imperative/__tests__/tsconfig.json new file mode 100644 index 0000000000..c4d748311b --- /dev/null +++ b/packages/imperative/__tests__/tsconfig.json @@ -0,0 +1,28 @@ +{ + // tsconfig for test files // + "compilerOptions": { + "types": ["node", "jest"], + "lib": ["esnext"], + "target": "es2015", + "module": "commonjs", + "declaration": true, + "moduleResolution": "node", + "noImplicitAny": true, + "preserveConstEnums": true, + "experimentalDecorators": true, + "removeComments": false, + "pretty": true, + "sourceMap": true, + "newLine": "lf", + "esModuleInterop": true + }, + "include": [ + "**/*.test.ts", + "**/*.subtest.ts", + "**/__tests__/**/*" + ], + "exclude": [ + "lib", + "node_modules" + ] +} \ No newline at end of file diff --git a/packages/imperative/package.json b/packages/imperative/package.json index 20feed5dad..cf9ee079c3 100644 --- a/packages/imperative/package.json +++ b/packages/imperative/package.json @@ -30,9 +30,9 @@ "scripts": { "build:packages": "tsc --pretty", "build": "npm run build:packages && npm run build:webHelp", - "lint": "eslint \"packages/**/*.ts\" \"**/__tests__/**/*.ts\"", - "lint:packages": "eslint \"packages/**/*.ts\" --ignore-pattern \"**/__tests__/**/*.ts\"", - "lint:tests": "eslint \"**/__tests__/**/*.ts\"", + "lint": "eslint \"src/**/*.ts\" \"**/__tests__/**/*.ts\"", + "lint:packages": "eslint \"src/**/*.ts\" --ignore-pattern \"**/__tests__/**/*.ts\"", + "lint:tests": "eslint \"./__tests__/**/*.ts\"", "circularDependencyCheck": "madge -c lib", "watch": "concurrently \"tsc --pretty --watch\" \"npm run watch:webHelp\"", "build:webHelp": "cd web-help && npm run build", diff --git a/packages/imperative/tsconfig-tests.json b/packages/imperative/tsconfig-tests.json index 6bd842eb0f..3485999e7b 100644 --- a/packages/imperative/tsconfig-tests.json +++ b/packages/imperative/tsconfig-tests.json @@ -25,12 +25,13 @@ "./node_modules/@types" ], "include": [ - "**/__tests__/*" + "**/__tests__/*", + "**/__tests__/**/*", + "**/__mocks__/*" ], "exclude": [ "lib", - "node_modules", - "**/__mocks__/*" + "node_modules" ], "files": [ "../../__types__/wontache.d.ts" diff --git a/packages/provisioning/__tests__/tsconfig.json b/packages/provisioning/__tests__/tsconfig.json new file mode 100644 index 0000000000..434259e064 --- /dev/null +++ b/packages/provisioning/__tests__/tsconfig.json @@ -0,0 +1,12 @@ +{ + // tsconfig for test files // + "extends": "../../../__tests__/tsconfig.json", + "include": [ + "**/*.test.ts", + "**/__tests__/**/*" + ], + "exclude": [ + "lib", + "node_modules" + ] +} diff --git a/packages/secrets/package.json b/packages/secrets/package.json index 95c57aa814..dfe705f8cc 100644 --- a/packages/secrets/package.json +++ b/packages/secrets/package.json @@ -40,6 +40,7 @@ "build:debug": "cd src/keyring && napi build --config napi.json --js false --platform", "build:ts": "tsc --pretty", "install": "node scripts/prebuildCheck.js || npm run rebuild", + "lint": "echo 'Nothing to Lint'", "prepack": "node ../../scripts/prepareLicenses.js", "prepublishOnly": "bash scripts/prebuildify.sh", "rebuild": "npx --yes --package=@napi-rs/cli@2.16.2 -- napi build --config src/keyring/napi.json --cargo-cwd src/keyring --platform --release --js=false src/keyring", diff --git a/packages/workflows/__tests__/tsconfig.json b/packages/workflows/__tests__/tsconfig.json new file mode 100644 index 0000000000..434259e064 --- /dev/null +++ b/packages/workflows/__tests__/tsconfig.json @@ -0,0 +1,12 @@ +{ + // tsconfig for test files // + "extends": "../../../__tests__/tsconfig.json", + "include": [ + "**/*.test.ts", + "**/__tests__/**/*" + ], + "exclude": [ + "lib", + "node_modules" + ] +} diff --git a/packages/zosconsole/__tests__/tsconfig.json b/packages/zosconsole/__tests__/tsconfig.json new file mode 100644 index 0000000000..d4253ffe43 --- /dev/null +++ b/packages/zosconsole/__tests__/tsconfig.json @@ -0,0 +1,12 @@ +{ + // tsconfig for test files // + "extends": "../../../__tests__/tsconfig.json", + "include": [ + "**/*.test.ts", + "**/__tests__/**/*" + ], + "exclude": [ + "lib", + "node_modules" + ] +} \ No newline at end of file diff --git a/packages/zosfiles/__tests__/tsconfig.json b/packages/zosfiles/__tests__/tsconfig.json new file mode 100644 index 0000000000..434259e064 --- /dev/null +++ b/packages/zosfiles/__tests__/tsconfig.json @@ -0,0 +1,12 @@ +{ + // tsconfig for test files // + "extends": "../../../__tests__/tsconfig.json", + "include": [ + "**/*.test.ts", + "**/__tests__/**/*" + ], + "exclude": [ + "lib", + "node_modules" + ] +} diff --git a/packages/zosjobs/__tests__/tsconfig.json b/packages/zosjobs/__tests__/tsconfig.json new file mode 100644 index 0000000000..d4253ffe43 --- /dev/null +++ b/packages/zosjobs/__tests__/tsconfig.json @@ -0,0 +1,12 @@ +{ + // tsconfig for test files // + "extends": "../../../__tests__/tsconfig.json", + "include": [ + "**/*.test.ts", + "**/__tests__/**/*" + ], + "exclude": [ + "lib", + "node_modules" + ] +} \ No newline at end of file diff --git a/packages/zoslogs/__tests__/tsconfig.json b/packages/zoslogs/__tests__/tsconfig.json new file mode 100644 index 0000000000..434259e064 --- /dev/null +++ b/packages/zoslogs/__tests__/tsconfig.json @@ -0,0 +1,12 @@ +{ + // tsconfig for test files // + "extends": "../../../__tests__/tsconfig.json", + "include": [ + "**/*.test.ts", + "**/__tests__/**/*" + ], + "exclude": [ + "lib", + "node_modules" + ] +} diff --git a/packages/zosmf/__tests__/tsconfig.json b/packages/zosmf/__tests__/tsconfig.json new file mode 100644 index 0000000000..d4253ffe43 --- /dev/null +++ b/packages/zosmf/__tests__/tsconfig.json @@ -0,0 +1,12 @@ +{ + // tsconfig for test files // + "extends": "../../../__tests__/tsconfig.json", + "include": [ + "**/*.test.ts", + "**/__tests__/**/*" + ], + "exclude": [ + "lib", + "node_modules" + ] +} \ No newline at end of file diff --git a/packages/zostso/__tests__/tsconfig.json b/packages/zostso/__tests__/tsconfig.json new file mode 100644 index 0000000000..d4253ffe43 --- /dev/null +++ b/packages/zostso/__tests__/tsconfig.json @@ -0,0 +1,12 @@ +{ + // tsconfig for test files // + "extends": "../../../__tests__/tsconfig.json", + "include": [ + "**/*.test.ts", + "**/__tests__/**/*" + ], + "exclude": [ + "lib", + "node_modules" + ] +} \ No newline at end of file diff --git a/packages/zosuss/__tests__/tsconfig.json b/packages/zosuss/__tests__/tsconfig.json new file mode 100644 index 0000000000..d4253ffe43 --- /dev/null +++ b/packages/zosuss/__tests__/tsconfig.json @@ -0,0 +1,12 @@ +{ + // tsconfig for test files // + "extends": "../../../__tests__/tsconfig.json", + "include": [ + "**/*.test.ts", + "**/__tests__/**/*" + ], + "exclude": [ + "lib", + "node_modules" + ] +} \ No newline at end of file From 2de65e22a5cd70fdb7869823d41f779ef3974640 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 6 Aug 2024 11:15:49 -0400 Subject: [PATCH 02/14] Fix packages except Imperative Signed-off-by: Andrew W. Harn --- .../cli-test-utils/src/TestUtils.ts | 1 + .../src/environment/TempTestProfiles.ts | 2 +- .../view/uss/View.uss.system.test.ts | 8 ++++---- .../dsclp/TargetProfile.handler.unit.test.ts | 1 + .../cli.zos-jobs.list.jobs.system.test.ts | 2 +- ...s.list.spool-files-by-jobid.system.test.ts | 2 +- .../issue/cli.issue.ssh.system.test.ts | 4 ++-- .../delete/instance/DeleteInstance.handler.ts | 3 +-- .../list/instanceInfo/InstanceInfo.handler.ts | 5 ++--- .../InstanceVariables.handler.ts | 3 +-- .../registry/RegistryInstances.handler.ts | 3 +-- .../perform/action/Action.handler.ts | 3 +-- .../provision/template/Template.handler.ts | 9 ++------- .../issue/command/Command.handler.ts | 7 +++---- .../copy/dsclp/TargetProfile.handler.ts | 1 + .../cli/src/zosfiles/create/Create.options.ts | 1 + .../src/cmd/src/yargs/CommandYargs.ts | 2 +- .../PluginRequireProvider.unit.test.ts | 6 +++--- .../src/plugins/PluginRequireProvider.ts | 2 +- .../utilities/npm-interface/install.ts | 2 +- .../imperative/src/utilities/src/CliUtils.ts | 4 ++-- .../provisioning/src/ListRegistryInstances.ts | 5 ++--- packages/workflows/src/Create.ts | 11 +++++----- packages/workflows/src/Start.ts | 3 +-- packages/zosconsole/src/CollectCommand.ts | 9 ++++----- .../zosconsole/src/ConsoleResponseService.ts | 16 +++++++-------- packages/zosconsole/src/IssueCommand.ts | 9 ++++----- .../methods/download/Download.unit.test.ts | 18 ++++++++--------- .../methods/utilities/Utilities.unit.test.ts | 14 ++++++------- .../src/constants/ZosFiles.messages.ts | 5 +++++ packages/zosfiles/src/methods/mount/Mount.ts | 3 +-- .../zosfiles/src/methods/upload/Upload.ts | 4 ++-- packages/zosfiles/src/utils/ZosFilesUtils.ts | 2 +- .../__system__/DownloadJobs.system.test.ts | 20 ++++++++++++++++--- .../__system__/MonitorJobs.system.test.ts | 4 ++-- packages/zoslogs/src/GetZosLog.ts | 3 +-- packages/zosmf/src/ZosmfBaseHandler.ts | 6 ++++++ packages/zostso/src/SendTso.ts | 3 +-- packages/zosuss/src/SshBaseHandler.ts | 3 +++ 39 files changed, 111 insertions(+), 98 deletions(-) diff --git a/__tests__/__packages__/cli-test-utils/src/TestUtils.ts b/__tests__/__packages__/cli-test-utils/src/TestUtils.ts index 91b6b54034..5b0c702ff6 100644 --- a/__tests__/__packages__/cli-test-utils/src/TestUtils.ts +++ b/__tests__/__packages__/cli-test-utils/src/TestUtils.ts @@ -155,6 +155,7 @@ export function mockHandlerParameters(params: PartialHandlerParameters): IHandle ...(params.arguments || {}) }, positionals: params.positionals || [], + // eslint-disable-next-line deprecation/deprecation profiles: params.profiles || new CommandProfiles(new Map()), definition: params.definition, fullDefinition: params.definition, diff --git a/__tests__/__packages__/cli-test-utils/src/environment/TempTestProfiles.ts b/__tests__/__packages__/cli-test-utils/src/environment/TempTestProfiles.ts index 74cb912ff4..1812f0e8c6 100644 --- a/__tests__/__packages__/cli-test-utils/src/environment/TempTestProfiles.ts +++ b/__tests__/__packages__/cli-test-utils/src/environment/TempTestProfiles.ts @@ -216,7 +216,7 @@ export class TempTestProfiles { config.api.layers.activate(false, true); // Remove profile from config JSON - config.delete(config.api.profiles.expandPath(profileName)); + config.delete(config.api.profiles.getProfilePathFromName(profileName)); if (config.api.layers.get().properties.defaults[profileType] === profileName) { config.delete(`defaults.${profileType}`); } diff --git a/packages/cli/__tests__/zosfiles/__system__/view/uss/View.uss.system.test.ts b/packages/cli/__tests__/zosfiles/__system__/view/uss/View.uss.system.test.ts index 9db8f91935..c36f5ab897 100644 --- a/packages/cli/__tests__/zosfiles/__system__/view/uss/View.uss.system.test.ts +++ b/packages/cli/__tests__/zosfiles/__system__/view/uss/View.uss.system.test.ts @@ -78,7 +78,7 @@ describe("View uss file", () => { await ZosmfRestClient.putExpectString(REAL_SESSION, endpoint, [], data); const shellScript = path.join(__dirname, "__scripts__", "command", "command_view_uss_file.sh"); - const response = runCliScript(shellScript, testEnvironment, [ussname.substr(1, ussname.length)]); + const response = runCliScript(shellScript, testEnvironment, [ussname.substring(1, ussname.length)]); expect(response.stderr.toString()).toBe(""); expect(response.status).toBe(0); @@ -90,7 +90,7 @@ describe("View uss file", () => { await ZosmfRestClient.putExpectString(REAL_SESSION, endpoint, [ZosmfHeaders.X_IBM_BINARY], data); const shellScript = path.join(__dirname, "__scripts__", "command", "command_view_uss_file.sh"); - const response = runCliScript(shellScript, testEnvironment, [ussname.substr(1, ussname.length), "--binary"]); + const response = runCliScript(shellScript, testEnvironment, [ussname.substring(1, ussname.length), "--binary"]); expect(response.stderr.toString()).toBe(""); expect(response.status).toBe(0); @@ -102,7 +102,7 @@ describe("View uss file", () => { await Upload.bufferToUssFile(REAL_SESSION, ussname, Buffer.from(data), { binary: true }); const shellScript = path.join(__dirname, "__scripts__", "command", "command_view_uss_file.sh"); - const response = runCliScript(shellScript, testEnvironment, [ussname.substr(1, ussname.length), "--binary"]); + const response = runCliScript(shellScript, testEnvironment, [ussname.substring(1, ussname.length), "--binary"]); const respdata = response.stdout.toLocaleString(); expect(response.stderr.toString()).toBe(""); @@ -115,7 +115,7 @@ describe("View uss file", () => { await ZosmfRestClient.putExpectString(REAL_SESSION, endpoint, [], data); const shellScript = path.join(__dirname, "__scripts__", "command", "command_view_uss_file.sh"); - const response = runCliScript(shellScript, testEnvironment, [ussname.substr(1, ussname.length), "--range", "0,1"]); + const response = runCliScript(shellScript, testEnvironment, [ussname.substring(1, ussname.length), "--range", "0,1"]); expect(response.stderr.toString()).toBe(""); expect(response.status).toBe(0); diff --git a/packages/cli/__tests__/zosfiles/__unit__/copy/dsclp/TargetProfile.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/copy/dsclp/TargetProfile.handler.unit.test.ts index 556f605d23..a31b176399 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/copy/dsclp/TargetProfile.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/copy/dsclp/TargetProfile.handler.unit.test.ts @@ -98,6 +98,7 @@ describe("TargetProfileHandler", () => { password: "password2", port: 123 }); + // eslint-disable-next-line deprecation/deprecation commandParameters.profiles.get = getProfileMock; jest.spyOn(ImperativeConfig, "instance", "get").mockReturnValue({ config: { exists: false } diff --git a/packages/cli/__tests__/zosjobs/__system__/list/cli.zos-jobs.list.jobs.system.test.ts b/packages/cli/__tests__/zosjobs/__system__/list/cli.zos-jobs.list.jobs.system.test.ts index 980349b35f..54327bf0da 100644 --- a/packages/cli/__tests__/zosjobs/__system__/list/cli.zos-jobs.list.jobs.system.test.ts +++ b/packages/cli/__tests__/zosjobs/__system__/list/cli.zos-jobs.list.jobs.system.test.ts @@ -45,7 +45,7 @@ describe("zos-jobs list jobs command", () => { ACCOUNT = systemProps.tso.account; const JOB_LENGTH = 6; - JOB_NAME = REAL_SESSION.ISession.user.substr(0, JOB_LENGTH).toUpperCase() + "SF"; + JOB_NAME = REAL_SESSION.ISession.user.substring(0, JOB_LENGTH).toUpperCase() + "SF"; NON_HELD_JOBCLASS = TEST_ENVIRONMENT.systemTestProperties.zosjobs.jobclass; }); diff --git a/packages/cli/__tests__/zosjobs/__system__/list/cli.zos-jobs.list.spool-files-by-jobid.system.test.ts b/packages/cli/__tests__/zosjobs/__system__/list/cli.zos-jobs.list.spool-files-by-jobid.system.test.ts index a65285f780..b13ca31764 100644 --- a/packages/cli/__tests__/zosjobs/__system__/list/cli.zos-jobs.list.spool-files-by-jobid.system.test.ts +++ b/packages/cli/__tests__/zosjobs/__system__/list/cli.zos-jobs.list.spool-files-by-jobid.system.test.ts @@ -49,7 +49,7 @@ describe("zos-jobs list spool-files-by-jobid command", () => { ACCOUNT = defaultSystem.tso.account; const JOB_LENGTH = 6; - JOB_NAME = REAL_SESSION.ISession.user.substr(0, JOB_LENGTH).toUpperCase() + "SF"; + JOB_NAME = REAL_SESSION.ISession.user.substring(0, JOB_LENGTH).toUpperCase() + "SF"; NON_HELD_JOBCLASS = TEST_ENVIRONMENT.systemTestProperties.zosjobs.jobclass; }); diff --git a/packages/cli/__tests__/zosuss/__system__/issue/cli.issue.ssh.system.test.ts b/packages/cli/__tests__/zosuss/__system__/issue/cli.issue.ssh.system.test.ts index bc4a83c0bc..fce953a4e2 100644 --- a/packages/cli/__tests__/zosuss/__system__/issue/cli.issue.ssh.system.test.ts +++ b/packages/cli/__tests__/zosuss/__system__/issue/cli.issue.ssh.system.test.ts @@ -16,7 +16,7 @@ import { TestEnvironment } from "../../../../../../__tests__/__src__/environment import { ITestPropertiesSchema } from "../../../../../../__tests__/__src__/properties/ITestPropertiesSchema"; import { ZosFilesConstants } from "@zowe/zos-files-for-zowe-sdk"; import { ZosmfRestClient } from "@zowe/core-for-zowe-sdk"; -import { startCmdFlag } from "@zowe/zos-uss-for-zowe-sdk"; +import { Shell } from "@zowe/zos-uss-for-zowe-sdk"; // Test environment will be populated in the "beforeAll" @@ -35,7 +35,7 @@ let keyPassphrase: string; function checkResponse(response: any, expectStatus: number) { expect(response.stderr.toString()).toBe(""); expect(response.status).toBe(expectStatus); - expect(response.stdout.toString()).not.toMatch(startCmdFlag); + expect(response.stdout.toString()).not.toMatch(Shell.startCmdFlag); } function generateRandomString(j: number) { diff --git a/packages/cli/src/provisioning/delete/instance/DeleteInstance.handler.ts b/packages/cli/src/provisioning/delete/instance/DeleteInstance.handler.ts index 11ee412517..f283a67b83 100644 --- a/packages/cli/src/provisioning/delete/instance/DeleteInstance.handler.ts +++ b/packages/cli/src/provisioning/delete/instance/DeleteInstance.handler.ts @@ -9,7 +9,6 @@ * */ -import { isNullOrUndefined } from "util"; import { IHandlerParameters } from "@zowe/imperative"; import { IProvisionedInstance, @@ -28,7 +27,7 @@ export default class Handler extends ZosmfBaseHandler { commandParameters.arguments.name ); const instances: IProvisionedInstance[] = registry["scr-list"]; - if (isNullOrUndefined(instances)) { + if (instances == null) { commandParameters.response.console.error( "No instance with name " + commandParameters.arguments.name + diff --git a/packages/cli/src/provisioning/list/instanceInfo/InstanceInfo.handler.ts b/packages/cli/src/provisioning/list/instanceInfo/InstanceInfo.handler.ts index 9b027ef161..1905a19da8 100644 --- a/packages/cli/src/provisioning/list/instanceInfo/InstanceInfo.handler.ts +++ b/packages/cli/src/provisioning/list/instanceInfo/InstanceInfo.handler.ts @@ -21,7 +21,6 @@ import { ProvisioningConstants, ListInstanceInfo } from "@zowe/provisioning-for-zowe-sdk"; -import { isNullOrUndefined } from "util"; import { ZosmfBaseHandler } from "@zowe/zosmf-for-zowe-sdk"; /** @@ -36,7 +35,7 @@ export default class InstanceInfoHandler extends ZosmfBaseHandler { const registry = await ListRegistryInstances.listFilteredRegistry(this.mSession, ProvisioningConstants.ZOSMF_VERSION, null, commandParameters.arguments.name); const instances: IProvisionedInstance[] = registry["scr-list"]; - if (isNullOrUndefined(instances)) { + if (instances == null) { commandParameters.response.console.error("No instance with name " + commandParameters.arguments.name + " was found"); } else if (instances.length === 1) { const id = instances.pop()["object-id"]; @@ -57,7 +56,7 @@ export default class InstanceInfoHandler extends ZosmfBaseHandler { private formatProvisionedInstanceSummaryOutput(instance: IProvisionedInstance, option: string): any[] { let prettifiedInstance: any = {}; - option = isNullOrUndefined(option) ? "ACTIONS" : option.toUpperCase(); + option = option == null ? "ACTIONS" : option.toUpperCase(); // Prettify the output switch (option) { diff --git a/packages/cli/src/provisioning/list/instanceVariables/InstanceVariables.handler.ts b/packages/cli/src/provisioning/list/instanceVariables/InstanceVariables.handler.ts index 79d4218378..0a483b17a1 100644 --- a/packages/cli/src/provisioning/list/instanceVariables/InstanceVariables.handler.ts +++ b/packages/cli/src/provisioning/list/instanceVariables/InstanceVariables.handler.ts @@ -9,7 +9,6 @@ * */ -import { isNullOrUndefined } from "util"; import { IHandlerParameters } from "@zowe/imperative"; import { ListInstanceVariables, @@ -35,7 +34,7 @@ export default class InstanceVariablesHandler extends ZosmfBaseHandler { commandParameters.arguments.name ); const instances: IProvisionedInstance[] = registry["scr-list"]; - if (isNullOrUndefined(instances)) { + if (instances == null) { commandParameters.response.console.error( "No instance with name " + commandParameters.arguments.name + diff --git a/packages/cli/src/provisioning/list/registry/RegistryInstances.handler.ts b/packages/cli/src/provisioning/list/registry/RegistryInstances.handler.ts index 45f1a08c7b..2adec99ffc 100644 --- a/packages/cli/src/provisioning/list/registry/RegistryInstances.handler.ts +++ b/packages/cli/src/provisioning/list/registry/RegistryInstances.handler.ts @@ -18,7 +18,6 @@ import { ProvisioningConstants, ListRegistryInstances } from "@zowe/provisioning-for-zowe-sdk"; -import { isNullOrUndefined } from "util"; import { ZosmfBaseHandler } from "@zowe/zosmf-for-zowe-sdk"; /** @@ -44,7 +43,7 @@ export default class RegistryInstancesHandler extends ZosmfBaseHandler { commandParameters.response.console.log(TextUtils.prettyJson(unique)); } else { commandParameters.response.console.log("z/OSMF Service Registry"); - if (!isNullOrUndefined(commandParameters.arguments.filterByType)) { + if (!(commandParameters.arguments.filterByType == null)) { commandParameters.response.console.log("\nShowing ONLY \"" + commandParameters.arguments.filterByType.toUpperCase() + "\" instance types."); } diff --git a/packages/cli/src/provisioning/perform/action/Action.handler.ts b/packages/cli/src/provisioning/perform/action/Action.handler.ts index 8eb05684d1..33e7480a26 100644 --- a/packages/cli/src/provisioning/perform/action/Action.handler.ts +++ b/packages/cli/src/provisioning/perform/action/Action.handler.ts @@ -17,7 +17,6 @@ import { IProvisionedInstance, ListRegistryInstances } from "@zowe/provisioning-for-zowe-sdk"; -import { isNullOrUndefined } from "util"; import { ZosmfBaseHandler } from "@zowe/zosmf-for-zowe-sdk"; /** @@ -35,7 +34,7 @@ export default class ActionHandler extends ZosmfBaseHandler { commandParameters.arguments.name ); const instances: IProvisionedInstance[] = registry["scr-list"]; - if (isNullOrUndefined(instances)) { + if (instances == null) { commandParameters.response.console.error( "No instance with name " + commandParameters.arguments.name + diff --git a/packages/cli/src/provisioning/provision/template/Template.handler.ts b/packages/cli/src/provisioning/provision/template/Template.handler.ts index a7c5623a58..979c59d0c9 100644 --- a/packages/cli/src/provisioning/provision/template/Template.handler.ts +++ b/packages/cli/src/provisioning/provision/template/Template.handler.ts @@ -9,7 +9,6 @@ * */ -import { isNullOrUndefined } from "util"; import { IHandlerParameters, TextUtils } from "@zowe/imperative"; import { explainProvisionTemplateResponse, @@ -27,7 +26,7 @@ export default class Handler extends ZosmfBaseHandler { let usedOptionalParms: boolean = false; let arrayOfSystemNickNames: string[]; - if (!isNullOrUndefined(commandParameters.arguments.systemNickNames)) { + if (!(commandParameters.arguments.systemNickNames == null)) { arrayOfSystemNickNames = commandParameters.arguments.systemNickNames .split(",") .map((systemName: string) => { @@ -48,11 +47,7 @@ export default class Handler extends ZosmfBaseHandler { for (const property in provisionOptionalParams) { if ( - !isNullOrUndefined( - provisionOptionalParams[ - property as keyof IProvisionOptionals - ] - ) + !(provisionOptionalParams[property as keyof IProvisionOptionals] == null) ) { usedOptionalParms = true; } diff --git a/packages/cli/src/zosconsole/issue/command/Command.handler.ts b/packages/cli/src/zosconsole/issue/command/Command.handler.ts index d442bd45a4..45e8d093d0 100644 --- a/packages/cli/src/zosconsole/issue/command/Command.handler.ts +++ b/packages/cli/src/zosconsole/issue/command/Command.handler.ts @@ -11,7 +11,6 @@ import { IHandlerParameters, TextUtils } from "@zowe/imperative"; import { ICollectParms, IConsoleResponse, IIssueParms, IssueCommand } from "@zowe/zos-console-for-zowe-sdk"; -import { isNullOrUndefined } from "util"; import { ZosmfBaseHandler } from "@zowe/zosmf-for-zowe-sdk"; /** @@ -34,7 +33,7 @@ export default class Handler extends ZosmfBaseHandler { async: commandParameters.arguments["key-only"] === true ? "Y" : "N" }; - if (isNullOrUndefined(commandParameters.arguments["wait-to-collect"])) { + if (commandParameters.arguments["wait-to-collect"] == null) { response = await IssueCommand.issue(this.mSession, issueParms); } else { const collectParms: ICollectParms = { @@ -48,7 +47,7 @@ export default class Handler extends ZosmfBaseHandler { // Print out the response if (commandParameters.arguments["key-only"]) { - if (!isNullOrUndefined(response.lastResponseKey)) { + if (!(response.lastResponseKey == null)) { commandParameters.response.console.log(response.lastResponseKey); } } else { @@ -58,7 +57,7 @@ export default class Handler extends ZosmfBaseHandler { responseKey: response.lastResponseKey, cmdResponseUrl: response.cmdResponseUrl || undefined, keywordDetected: response.keywordDetected || - ((!isNullOrUndefined(commandParameters.arguments["solicited-keyword"])) ? false : undefined) + ((!(commandParameters.arguments["solicited-keyword"] == null)) ? false : undefined) }; commandParameters.response.console.log("Additional details:"); commandParameters.response.console.log("-------------------"); diff --git a/packages/cli/src/zosfiles/copy/dsclp/TargetProfile.handler.ts b/packages/cli/src/zosfiles/copy/dsclp/TargetProfile.handler.ts index 14f16f86fc..601122e863 100644 --- a/packages/cli/src/zosfiles/copy/dsclp/TargetProfile.handler.ts +++ b/packages/cli/src/zosfiles/copy/dsclp/TargetProfile.handler.ts @@ -31,6 +31,7 @@ export default class TargetProfileHandler extends ZosFilesBaseHandler { if (ImperativeConfig.instance.config?.exists) { targetCmdArgs = ImperativeConfig.instance.config.api.profiles.get(targetProfileName); } else { + // eslint-disable-next-line deprecation/deprecation targetCmdArgs = params.profiles.get("zosmf", false, targetProfileName); } } diff --git a/packages/cli/src/zosfiles/create/Create.options.ts b/packages/cli/src/zosfiles/create/Create.options.ts index fbc22b1195..66abe8cde3 100644 --- a/packages/cli/src/zosfiles/create/Create.options.ts +++ b/packages/cli/src/zosfiles/create/Create.options.ts @@ -36,6 +36,7 @@ export const ZosFilesCreateExtraOptions: { [key: string]: ICommandOptionDefiniti * @type {ICommandOptionDefinition} * @deprecated */ + // eslint-disable-next-line deprecation/deprecation showAttributes: { name: "show-attributes", aliases: ["pa"], diff --git a/packages/imperative/src/cmd/src/yargs/CommandYargs.ts b/packages/imperative/src/cmd/src/yargs/CommandYargs.ts index fb5909a284..ea39340989 100644 --- a/packages/imperative/src/cmd/src/yargs/CommandYargs.ts +++ b/packages/imperative/src/cmd/src/yargs/CommandYargs.ts @@ -180,7 +180,7 @@ export class CommandYargs extends AbstractCommandYargs { this.definition.positionals.forEach((positional) => { yargPositionalSyntax += ("[" + positional.name + "] "); }); - const posString: string = yargPositionalSyntax.substr(0, yargPositionalSyntax.lastIndexOf(" ")); + const posString: string = yargPositionalSyntax.substring(0, yargPositionalSyntax.lastIndexOf(" ")); this.log.debug("Positional String: " + posString); return posString; } else { diff --git a/packages/imperative/src/imperative/__tests__/plugins/PluginRequireProvider.unit.test.ts b/packages/imperative/src/imperative/__tests__/plugins/PluginRequireProvider.unit.test.ts index 7a2c307a99..171732b90a 100644 --- a/packages/imperative/src/imperative/__tests__/plugins/PluginRequireProvider.unit.test.ts +++ b/packages/imperative/src/imperative/__tests__/plugins/PluginRequireProvider.unit.test.ts @@ -349,9 +349,9 @@ describe("PluginRequireProvider", () => { modules: randomModuleMaxLength, shouldRequireDirectly: [ "./anything/goes/here", - randomModuleMaxLength[0].substr(15), - randomModuleMaxLength[1].substr(200), - randomModuleMaxLength[2].substr(59) + randomModuleMaxLength[0].substring(15), + randomModuleMaxLength[1].substring(200), + randomModuleMaxLength[2].substring(59) ] }, "1 module with periods": { diff --git a/packages/imperative/src/imperative/src/plugins/PluginRequireProvider.ts b/packages/imperative/src/imperative/src/plugins/PluginRequireProvider.ts index 7bc6b90f29..be062c62dd 100644 --- a/packages/imperative/src/imperative/src/plugins/PluginRequireProvider.ts +++ b/packages/imperative/src/imperative/src/plugins/PluginRequireProvider.ts @@ -175,7 +175,7 @@ export class PluginRequireProvider { if (request === ImperativeConfig.instance.hostPackageName) { args[0] = "./"; } else { - args[0] = `${hostPackageRoot}${request.substr(hostPackageNameLength)}`; + args[0] = `${hostPackageRoot}${request.substring(hostPackageNameLength)}`; } } diff --git a/packages/imperative/src/imperative/src/plugins/utilities/npm-interface/install.ts b/packages/imperative/src/imperative/src/plugins/utilities/npm-interface/install.ts index c627ac4dcc..40f6e95a0e 100644 --- a/packages/imperative/src/imperative/src/plugins/utilities/npm-interface/install.ts +++ b/packages/imperative/src/imperative/src/plugins/utilities/npm-interface/install.ts @@ -142,7 +142,7 @@ export async function install(packageLocation: string, registry: string, install const passedVersionIdx = packageLocation.indexOf("@"); if (passedVersionIdx !== -1) { - packageVersion = packageLocation.substr(passedVersionIdx + 1); + packageVersion = packageLocation.substring(passedVersionIdx + 1); } } diff --git a/packages/imperative/src/utilities/src/CliUtils.ts b/packages/imperative/src/utilities/src/CliUtils.ts index 70820af93d..a3b492c770 100644 --- a/packages/imperative/src/utilities/src/CliUtils.ts +++ b/packages/imperative/src/utilities/src/CliUtils.ts @@ -702,7 +702,7 @@ export class CliUtils { * - hello--------world -> helloWorld * - hello-World- -> helloWorld */ - const returnChar = p1.substr(-1).toUpperCase(); + const returnChar = p1.substring(-1).toUpperCase(); return returnChar !== "-" ? returnChar : ""; }), kebabCase: key.replace(/(-*[A-Z]|-{2,}|-$)/g, (match, p1, offset, inputString) => { @@ -747,7 +747,7 @@ export class CliUtils { return "-" + p1.toLowerCase(); } } else { // 2 - const returnChar = p1.substr(-1); // Get the last character of the sequence + const returnChar = p1.substring(-1); // Get the last character of the sequence if (returnChar === "-") { // 2.1 if (offset + p1.length === inputString.length) { // 2.1.1 diff --git a/packages/provisioning/src/ListRegistryInstances.ts b/packages/provisioning/src/ListRegistryInstances.ts index bccb77c3da..8e08a5b8a7 100644 --- a/packages/provisioning/src/ListRegistryInstances.ts +++ b/packages/provisioning/src/ListRegistryInstances.ts @@ -9,7 +9,6 @@ * */ -import { isNullOrUndefined } from "util"; import { ZosmfRestClient, nozOSMFVersion } from "@zowe/core-for-zowe-sdk"; import { AbstractSession } from "@zowe/imperative"; import { ProvisioningValidator } from "./ProvisioningValidator"; @@ -65,10 +64,10 @@ export class ListRegistryInstances { */ public static getResourcesQuery(zOSMFVersion: string, type?: string, externalName?: string) { let query = `${ProvisioningConstants.RESOURCE}/${zOSMFVersion}/${ProvisioningConstants.INSTANCES_RESOURCE}`; - if (!isNullOrUndefined(type)) { + if (!(type == null)) { query += `?${ProvisioningConstants.RESOURCE_TYPE}=${type}`; } - if (!isNullOrUndefined(externalName)) { + if (!(externalName == null)) { query += type ? "&" : "?"; query += `${ProvisioningConstants.RESOURCE_EXTERNAL_NAME}=${externalName}`; } diff --git a/packages/workflows/src/Create.ts b/packages/workflows/src/Create.ts index f4294311cb..d3edd09072 100644 --- a/packages/workflows/src/Create.ts +++ b/packages/workflows/src/Create.ts @@ -21,7 +21,6 @@ import { wrongOwner } from "./WorkflowConstants"; import { WorkflowValidator } from "./WorkflowValidator"; -import { isNullOrUndefined } from "util"; import { ICreateWorkflow, accessT } from "./doc/ICreateWorkflow"; import { ICreatedWorkflow } from "./doc/ICreatedWorkflow"; import { ICreatedWorkflowLocal } from "./doc/ICreatedWorkflowLocal"; @@ -96,22 +95,22 @@ export class CreateWorkflow{ accessType: AccessType, deleteCompletedJobs: DeleteCompletedJobs }; - if (!isNullOrUndefined(VariableInputFile)){ + if (!(VariableInputFile == null)){ if (VariableInputFile.charAt(0) === "/" && VariableInputFile.charAt(1) === "/") { VariableInputFile = VariableInputFile.substring(1); } data.variableInputFile = VariableInputFile; } - if (!isNullOrUndefined(Variables)){ + if (!(Variables == null)){ data.variables = this.parseProperties(Variables); } - if (isNullOrUndefined(AssignToOwner)){ + if (AssignToOwner == null){ data.assignToOwner = true; } - if (isNullOrUndefined(AccessType)){ + if (AccessType == null){ data.accessType = "Public"; } - if (isNullOrUndefined(DeleteCompletedJobs)){ + if (DeleteCompletedJobs == null){ data.deleteCompletedJobs = false; } diff --git a/packages/workflows/src/Start.ts b/packages/workflows/src/Start.ts index cfa0147afd..e1866c2d58 100644 --- a/packages/workflows/src/Start.ts +++ b/packages/workflows/src/Start.ts @@ -15,7 +15,6 @@ import { ZosmfRestClient, nozOSMFVersion } from "@zowe/core-for-zowe-sdk"; import { WorkflowConstants, noWorkflowKey } from "./WorkflowConstants"; import { WorkflowValidator } from "./WorkflowValidator"; import { IStartWorkflow, startT } from "./doc/IStartWorkflow"; -import { isNullOrUndefined } from "util"; /** * Class to handle starting of zOSMF workflow instance @@ -51,7 +50,7 @@ export class StartWorkflow{ // TODO error if stepName doesn't exist + add to unit and system tests data.stepName = step; } - if (!isNullOrUndefined(subsequent)) { + if (!(subsequent == null)) { data.performSubsequent = subsequent; } diff --git a/packages/zosconsole/src/CollectCommand.ts b/packages/zosconsole/src/CollectCommand.ts index 850e82adcc..47f7ac5d1d 100644 --- a/packages/zosconsole/src/CollectCommand.ts +++ b/packages/zosconsole/src/CollectCommand.ts @@ -12,7 +12,6 @@ import { AbstractSession, Logger, TextUtils } from "@zowe/imperative"; import { ZosmfRestClient } from "@zowe/core-for-zowe-sdk"; -import { isNullOrUndefined } from "util"; import { ConsoleValidator } from "./ConsoleValidator"; import { IZosmfCollectResponse } from "./doc/zosmf/IZosmfCollectResponse"; import { collectProcessingDetails, ConsoleConstants, decreaseCounter, resetCounter } from "./ConsoleConstants"; @@ -70,11 +69,11 @@ export class CollectCommand { public static async collect(session: AbstractSession, parms: ICollectParms, response?: IConsoleResponse) { ConsoleValidator.validateCollectParms(session, parms); - if (isNullOrUndefined(response)) { + if (response == null) { response = ConsoleResponseService.getEmptyConsoleResponse(); } - const consoleName: string = isNullOrUndefined(parms.consoleName) ? ConsoleConstants.RES_DEF_CN : parms.consoleName; + const consoleName: string = parms.consoleName == null ? ConsoleConstants.RES_DEF_CN : parms.consoleName; const maxFollowUpAttempts: number = CollectCommand.getFollowUpAttempts(parms); const timeout = CollectCommand.getTimeout(parms); let collectResponse: IZosmfCollectResponse; @@ -127,7 +126,7 @@ export class CollectCommand { * @return {number} */ private static getFollowUpAttempts(parms: ICollectParms): number { - return isNullOrUndefined(parms) || isNullOrUndefined(parms.followUpAttempts) ? ConsoleConstants.DEFAULT_FOLLOWUP_ATTEMPTS + return parms == null || parms.followUpAttempts == null ? ConsoleConstants.DEFAULT_FOLLOWUP_ATTEMPTS : parms.followUpAttempts; } @@ -138,7 +137,7 @@ export class CollectCommand { * @memberof CollectCommand */ private static getTimeout(parms: ICollectParms): number { - return isNullOrUndefined(parms) || isNullOrUndefined(parms.waitToCollect) ? ConsoleConstants.DEFAULT_TIMEOUT + return parms == null || parms.waitToCollect == null ? ConsoleConstants.DEFAULT_TIMEOUT : parms.waitToCollect * CollectCommand.TO_SECONDS; } diff --git a/packages/zosconsole/src/ConsoleResponseService.ts b/packages/zosconsole/src/ConsoleResponseService.ts index b3a2b1d57f..5318342395 100644 --- a/packages/zosconsole/src/ConsoleResponseService.ts +++ b/packages/zosconsole/src/ConsoleResponseService.ts @@ -10,7 +10,7 @@ */ import { ImperativeError, Logger, TextUtils } from "@zowe/imperative"; -import { inspect, isNullOrUndefined } from "util"; +import { inspect } from "util"; import { IZosmfIssueResponse } from "./doc/zosmf/IZosmfIssueResponse"; import { IConsoleResponse } from "./doc/IConsoleResponse"; import { displayError, displayResponse } from "./ConsoleConstants"; @@ -44,13 +44,13 @@ export class ConsoleResponseService { response.success = true; // If this request specified a solicited keyword, indicate if the keyword was found in the console response. - if (!isNullOrUndefined(zosmfResponse["sol-key-detected"])) { + if (!(zosmfResponse["sol-key-detected"] == null)) { response.keywordDetected = zosmfResponse["sol-key-detected"]; } // Append the command response string to the console response. - if (!isNullOrUndefined(zosmfResponse["cmd-response"]) && zosmfResponse["cmd-response"].length > 0 - && (isNullOrUndefined(processResponses) || processResponses !== false)) { + if (!(zosmfResponse["cmd-response"] == null) && zosmfResponse["cmd-response"].length > 0 + && (processResponses == null || processResponses !== false)) { // the IBM responses sometimes have \r and sometimes \r\n, we will process them our here and hopefully // return them with just \n. response.commandResponse += zosmfResponse["cmd-response"].replace(/\r\n/g, "\n").replace(/\r/g, "\n"); @@ -64,12 +64,12 @@ export class ConsoleResponseService { } // If the response key is present, set the last response key value in the response. - if (!isNullOrUndefined(zosmfResponse["cmd-response-key"])) { + if (!(zosmfResponse["cmd-response-key"] == null)) { response.lastResponseKey = zosmfResponse["cmd-response-key"]; } // Collect the response url. - if (!isNullOrUndefined(zosmfResponse["cmd-response-url"])) { + if (!(zosmfResponse["cmd-response-url"] == null)) { response.cmdResponseUrl = zosmfResponse["cmd-response-url"]; } @@ -120,9 +120,9 @@ export class ConsoleResponseService { */ public static isLastZosmfResponseEmpty(response: IConsoleResponse): boolean { let result: boolean = true; - if (!isNullOrUndefined(response) && response.zosmfResponse.length > 0) { + if (!(response == null) && response.zosmfResponse.length > 0) { const lastResponse: IZosmfIssueResponse = response.zosmfResponse[response.zosmfResponse.length - 1]; - result = isNullOrUndefined(lastResponse["cmd-response"]) || lastResponse["cmd-response"] === ""; + result = lastResponse["cmd-response"] == null || lastResponse["cmd-response"] === ""; } return result; } diff --git a/packages/zosconsole/src/IssueCommand.ts b/packages/zosconsole/src/IssueCommand.ts index 41b8d3d831..bf127664d3 100644 --- a/packages/zosconsole/src/IssueCommand.ts +++ b/packages/zosconsole/src/IssueCommand.ts @@ -12,7 +12,6 @@ import { AbstractSession, Headers } from "@zowe/imperative"; import { ZosmfRestClient } from "@zowe/core-for-zowe-sdk"; -import { isNullOrUndefined } from "util"; import { IZosmfIssueParms } from "./doc/zosmf/IZosmfIssueParms"; import { ConsoleValidator } from "./ConsoleValidator"; import { IZosmfIssueResponse } from "./doc/zosmf/IZosmfIssueResponse"; @@ -70,7 +69,7 @@ export class IssueCommand { public static async issue(session: AbstractSession, parms: IIssueParms) { ConsoleValidator.validateIssueParms(session, parms); - const consoleName: string = isNullOrUndefined(parms.consoleName) ? ConsoleConstants.RES_DEF_CN : parms.consoleName; + const consoleName: string = parms.consoleName == null ? ConsoleConstants.RES_DEF_CN : parms.consoleName; const commandParms: IZosmfIssueParms = IssueCommand.buildZosmfConsoleApiParameters(parms); let response: IConsoleResponse = ConsoleResponseService.getEmptyConsoleResponse(); @@ -146,13 +145,13 @@ export class IssueCommand { ConsoleValidator.validateIssueParm(parms); const zosmfParms: IZosmfIssueParms = {cmd: parms.command}; - if (!isNullOrUndefined(parms.solicitedKeyword)) { + if (!(parms.solicitedKeyword == null)) { zosmfParms["sol-key"] = parms.solicitedKeyword; } - if (!isNullOrUndefined(parms.sysplexSystem)) { + if (!(parms.sysplexSystem == null)) { zosmfParms.system = parms.sysplexSystem; } - if (!isNullOrUndefined(parms.async)) { + if (!(parms.async == null)) { zosmfParms.async = parms.async; } return zosmfParms; diff --git a/packages/zosfiles/__tests__/__unit__/methods/download/Download.unit.test.ts b/packages/zosfiles/__tests__/__unit__/methods/download/Download.unit.test.ts index 671b2a7deb..a7648237dc 100644 --- a/packages/zosfiles/__tests__/__unit__/methods/download/Download.unit.test.ts +++ b/packages/zosfiles/__tests__/__unit__/methods/download/Download.unit.test.ts @@ -1844,7 +1844,7 @@ describe("z/OS Files - Download", () => { caughtError = e; } - const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(ussname.substr(1))); + const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(ussname.substring(1))); expect(caughtError).toBeUndefined(); expect(response).toEqual({ @@ -1878,7 +1878,7 @@ describe("z/OS Files - Download", () => { caughtError = e; } - const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(ussname.substr(1))); + const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(ussname.substring(1))); expect(caughtError).toBeUndefined(); expect(response).toEqual({ @@ -1916,7 +1916,7 @@ describe("z/OS Files - Download", () => { caughtError = e; } - const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(ussname.substr(1))); + const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(ussname.substring(1))); expect(caughtError).toBeUndefined(); expect(response).toEqual({ @@ -1954,7 +1954,7 @@ describe("z/OS Files - Download", () => { caughtError = e; } - const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(ussname.substr(1))); + const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(ussname.substring(1))); expect(caughtError).toBeUndefined(); expect(response).toEqual({ @@ -1995,7 +1995,7 @@ describe("z/OS Files - Download", () => { caughtError = e; } - const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(ussname.substr(1))); + const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(ussname.substring(1))); expect(caughtError).toBeUndefined(); expect(response).toEqual({ @@ -2031,7 +2031,7 @@ describe("z/OS Files - Download", () => { caughtError = e; } - const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(ussname.substr(1))); + const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(ussname.substring(1))); expect(caughtError).toBeUndefined(); expect(response).toEqual({ @@ -2064,7 +2064,7 @@ describe("z/OS Files - Download", () => { caughtError = e; } - const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(ussname.substr(1))); + const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(ussname.substring(1))); expect(caughtError).toBeUndefined(); expect(response).toEqual({ @@ -2100,7 +2100,7 @@ describe("z/OS Files - Download", () => { caughtError = e; } - const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(ussname.substr(1))); + const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(ussname.substring(1))); expect(caughtError).toBeUndefined(); expect(response).toEqual({ @@ -2134,7 +2134,7 @@ describe("z/OS Files - Download", () => { caughtError = e; } - const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(ussname.substr(1))); + const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(ussname.substring(1))); expect(caughtError).toBeUndefined(); expect(response).toEqual({ diff --git a/packages/zosfiles/__tests__/__unit__/methods/utilities/Utilities.unit.test.ts b/packages/zosfiles/__tests__/__unit__/methods/utilities/Utilities.unit.test.ts index ab030d7d1c..d0f65e09f7 100644 --- a/packages/zosfiles/__tests__/__unit__/methods/utilities/Utilities.unit.test.ts +++ b/packages/zosfiles/__tests__/__unit__/methods/utilities/Utilities.unit.test.ts @@ -179,7 +179,7 @@ describe("Utilities.putUSSPayload", () => { caughtError = e; } - const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(filename.substr(1))); + const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(filename.substring(1))); expect(response).toBeUndefined(); expect(caughtError).toBeDefined(); @@ -213,7 +213,7 @@ describe("Utilities.putUSSPayload", () => { caughtError = e; } - const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(filename.substr(1))); + const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(filename.substring(1))); expect(caughtError).toBeUndefined(); expect(response).toEqual(content); @@ -273,7 +273,7 @@ describe("Utilities.putUSSPayload", () => { caughtError = e; } - const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(filename.substr(1))); + const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(filename.substring(1))); expect(caughtError).toBeUndefined(); expect(response).toEqual(true); @@ -296,7 +296,7 @@ describe("Utilities.putUSSPayload", () => { caughtError = e; } - const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(filename.substr(1))); + const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(filename.substring(1))); expect(caughtError).toBeUndefined(); expect(response).toEqual(true); @@ -317,7 +317,7 @@ describe("Utilities.putUSSPayload", () => { caughtError = e; } - const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(filename.substr(1))); + const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(filename.substring(1))); expect(caughtError).toBeUndefined(); expect(response).toEqual(true); @@ -338,7 +338,7 @@ describe("Utilities.putUSSPayload", () => { caughtError = e; } - const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(filename.substr(1))); + const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(filename.substring(1))); expect(caughtError).toBeUndefined(); expect(response).toEqual(false); @@ -359,7 +359,7 @@ describe("Utilities.putUSSPayload", () => { caughtError = e; } - const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(filename.substr(1))); + const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(filename.substring(1))); expect(caughtError).toBeUndefined(); expect(response).toEqual(false); diff --git a/packages/zosfiles/src/constants/ZosFiles.messages.ts b/packages/zosfiles/src/constants/ZosFiles.messages.ts index 0aae6fb6ab..a6ad5b3e40 100644 --- a/packages/zosfiles/src/constants/ZosFiles.messages.ts +++ b/packages/zosfiles/src/constants/ZosFiles.messages.ts @@ -212,6 +212,7 @@ export const ZosFilesMessages: { [key: string]: IMessageDefinition } = { * @type {IMessageDefinition} * @deprecated */ + // eslint-disable-next-line deprecation/deprecation datasetsDownloadedSuccessfully: { message: "Data sets matching pattern downloaded successfully.\nDestination: %s" }, @@ -413,6 +414,7 @@ export const ZosFilesMessages: { [key: string]: IMessageDefinition } = { * @type {IMessageDefinition} * @deprecated */ + // eslint-disable-next-line deprecation/deprecation allDataSetsArchived: { message: "All data sets matching the selected pattern(s) were archived." }, @@ -422,6 +424,7 @@ export const ZosFilesMessages: { [key: string]: IMessageDefinition } = { * @type {IMessageDefinition} * @deprecated */ + // eslint-disable-next-line deprecation/deprecation noDataSetsInList: { message: "No data sets left after excluded pattern(s) were filtered out." }, @@ -439,6 +442,7 @@ export const ZosFilesMessages: { [key: string]: IMessageDefinition } = { * @type {IMessageDefinition} * @deprecated */ + // eslint-disable-next-line deprecation/deprecation noDataSetsMatchingPatternRemain: { message: "After filtering out the archived files and files that match the exclusion-parameters, no data sets matching" + " the supported organization type remain." @@ -449,6 +453,7 @@ export const ZosFilesMessages: { [key: string]: IMessageDefinition } = { * @type {IMessageDefinition} * @deprecated */ + // eslint-disable-next-line deprecation/deprecation onlyEmptyPartitionedDataSets: { message: "Only empty partitioned data sets match the provided patterns." }, diff --git a/packages/zosfiles/src/methods/mount/Mount.ts b/packages/zosfiles/src/methods/mount/Mount.ts index ea1a565cb5..1bc3acdbd5 100644 --- a/packages/zosfiles/src/methods/mount/Mount.ts +++ b/packages/zosfiles/src/methods/mount/Mount.ts @@ -12,7 +12,6 @@ import { AbstractSession, ImperativeExpect, ImperativeError } from "@zowe/imperative"; import { IMountFsOptions } from "./doc/IMountFsOptions"; -import { isNullOrUndefined } from "util"; import { ZosmfRestClient, ZosmfHeaders } from "@zowe/core-for-zowe-sdk"; import { ZosFilesConstants } from "../../constants/ZosFiles.constants"; import { ZosFilesMessages } from "../../constants/ZosFiles.messages"; @@ -48,7 +47,7 @@ export class Mount { ImperativeExpect.toBeDefinedAndNonBlank(mountPoint, ZosFilesMessages.missingMountPoint.message); // Removes undefined properties - const tempOptions = !isNullOrUndefined(options) ? JSON.parse(JSON.stringify(options)) : {}; + const tempOptions = !(options == null) ? JSON.parse(JSON.stringify(options)) : {}; this.fsValidateOptions(tempOptions); tempOptions.action = "mount"; diff --git a/packages/zosfiles/src/methods/upload/Upload.ts b/packages/zosfiles/src/methods/upload/Upload.ts index 70ff04fc2c..220c0c21bc 100644 --- a/packages/zosfiles/src/methods/upload/Upload.ts +++ b/packages/zosfiles/src/methods/upload/Upload.ts @@ -319,8 +319,8 @@ export class Upload { }); } - memberName = dataSetName.substr(dataSetName.indexOf("(")).replace(/[()]/g, ""); - dataSetName = dataSetName.substr(0, dataSetName.indexOf("(")); + memberName = dataSetName.substring(dataSetName.indexOf("(")).replace(/[()]/g, ""); + dataSetName = dataSetName.substring(0, dataSetName.indexOf("(")); } diff --git a/packages/zosfiles/src/utils/ZosFilesUtils.ts b/packages/zosfiles/src/utils/ZosFilesUtils.ts index eb73f879a4..9397084aba 100644 --- a/packages/zosfiles/src/utils/ZosFilesUtils.ts +++ b/packages/zosfiles/src/utils/ZosFilesUtils.ts @@ -171,7 +171,7 @@ export class ZosFilesUtils { memberName = memberName.replace(/[\d]/gy, ""); // Trunkage lenght to max lenght allowed - memberName = memberName.substr(0, this.MAX_MEMBER_LENGTH); + memberName = memberName.substring(0, this.MAX_MEMBER_LENGTH); return memberName; } diff --git a/packages/zosjobs/__tests__/__system__/DownloadJobs.system.test.ts b/packages/zosjobs/__tests__/__system__/DownloadJobs.system.test.ts index 3f34387884..dbe67218e6 100644 --- a/packages/zosjobs/__tests__/__system__/DownloadJobs.system.test.ts +++ b/packages/zosjobs/__tests__/__system__/DownloadJobs.system.test.ts @@ -68,7 +68,7 @@ describe("Download Jobs - System tests", () => { ACCOUNT = defaultSystem.tso.account; const JOB_LENGTH = 6; - DOWNLOAD_JOB_NAME = REAL_SESSION.ISession.user?.substr(0, JOB_LENGTH).toUpperCase() + "DJ"; + DOWNLOAD_JOB_NAME = REAL_SESSION.ISession.user?.substring(0, JOB_LENGTH).toUpperCase() + "DJ"; JOBCLASS = testEnvironment.systemTestProperties.zosjobs.jobclass; SYSAFF = testEnvironment.systemTestProperties.zosjobs.sysaff; }); @@ -105,7 +105,7 @@ describe("Download Jobs - System tests", () => { ACCOUNT = defaultSystem.tso.account; const JOB_LENGTH = 6; - DOWNLOAD_JOB_NAME = REAL_SESSION.ISession.user?.substr(0, JOB_LENGTH).toUpperCase() + "DJ"; + DOWNLOAD_JOB_NAME = REAL_SESSION.ISession.user?.substring(0, JOB_LENGTH).toUpperCase() + "DJ"; JOBCLASS = testEnvironment.systemTestProperties.zosjobs.jobclass; SYSAFF = testEnvironment.systemTestProperties.zosjobs.sysaff; }); @@ -118,6 +118,7 @@ describe("Download Jobs - System tests", () => { encoding: "IBM-037" }); + // eslint-disable-next-line deprecation/deprecation const expectedFile = DownloadJobs.getSpoolDownloadFile(alteredjesJCLJobFile, false, downloadDir); expect(IO.existsSync(expectedFile)).toEqual(true); expect(IO.readFileSync(expectedFile).toString()).toContain("¬"); @@ -134,6 +135,7 @@ describe("Download Jobs - System tests", () => { }); for (const file of alteredjobFiles) { + // eslint-disable-next-line deprecation/deprecation const expectedFile = DownloadJobs.getSpoolDownloadFile(file, false, downloadDir); expect(IO.existsSync(expectedFile)).toEqual(true); if (file.ddname === "JESJCL") { @@ -153,6 +155,7 @@ describe("Download Jobs - System tests", () => { jobFile: jesJCLJobFile }); expect(IO.existsSync(downloadDir)).toEqual(true); + // eslint-disable-next-line deprecation/deprecation const expectedFile = DownloadJobs.getSpoolDownloadFile(jesJCLJobFile, false, downloadDir); expect(IO.existsSync(expectedFile)).toEqual(true); expect(IO.readFileSync(expectedFile).toString()).toContain("EXEC PGM=IEFBR14"); @@ -162,6 +165,7 @@ describe("Download Jobs - System tests", () => { await DownloadJobs.downloadSpoolContent(REAL_SESSION, jesJCLJobFile ); + // eslint-disable-next-line deprecation/deprecation const expectedFile = DownloadJobs.getSpoolDownloadFile(jesJCLJobFile, false); expect(IO.existsSync(expectedFile)).toEqual(true); expect(IO.readFileSync(expectedFile).toString()).toContain("EXEC PGM=IEFBR14"); @@ -176,6 +180,7 @@ describe("Download Jobs - System tests", () => { }); for (const file of jobFiles) { + // eslint-disable-next-line deprecation/deprecation const expectedFile = DownloadJobs.getSpoolDownloadFile(file, false, downloadDir); expect(IO.existsSync(expectedFile)).toEqual(true); } @@ -191,6 +196,7 @@ describe("Download Jobs - System tests", () => { }); for (const file of jobFiles) { + // eslint-disable-next-line deprecation/deprecation const expectedFile = DownloadJobs.getSpoolDownloadFile(file, false, downloadDir); expect(IO.existsSync(expectedFile)).toEqual(true); if (file.ddname === "JESJCL") { @@ -212,6 +218,7 @@ describe("Download Jobs - System tests", () => { }); for (const file of jobFiles) { + // eslint-disable-next-line deprecation/deprecation const expectedFile = DownloadJobs.getSpoolDownloadFile(file, false, downloadDir); expect(IO.existsSync(expectedFile)).toEqual(true); if (file.ddname === "JESJCL") { @@ -242,6 +249,7 @@ describe("Download Jobs - System tests", () => { const expectedExt = DownloadJobs.DEFAULT_JOBS_OUTPUT_FILE_EXT; for (const file of await GetJobs.getSpoolFilesForJob(REAL_SESSION, job)) { + // eslint-disable-next-line deprecation/deprecation const expectedFile = DownloadJobs.getSpoolDownloadFile(file, false, downloadDir); expect(IO.existsSync(expectedFile)).toEqual(true); @@ -350,7 +358,7 @@ describe("Download Jobs - System tests - Encoded", () => { } const JOB_LENGTH = 5; - DOWNLOAD_JOB_NAME = REAL_SESSION.ISession.user?.substr(0, JOB_LENGTH).toUpperCase() + "#DJ"; + DOWNLOAD_JOB_NAME = REAL_SESSION.ISession.user?.substring(0, JOB_LENGTH).toUpperCase() + "#DJ"; JOBCLASS = testEnvironment.systemTestProperties.zosjobs.jobclass; SYSAFF = testEnvironment.systemTestProperties.zosjobs.sysaff; }); @@ -374,6 +382,7 @@ describe("Download Jobs - System tests - Encoded", () => { jobFile: jesJCLJobFile }); expect(IO.existsSync(downloadDir)).toEqual(true); + // eslint-disable-next-line deprecation/deprecation const expectedFile = DownloadJobs.getSpoolDownloadFile(jesJCLJobFile, false, downloadDir); expect(IO.existsSync(expectedFile)).toEqual(true); expect(IO.readFileSync(expectedFile).toString()).toContain("EXEC PGM=IEFBR14"); @@ -383,6 +392,7 @@ describe("Download Jobs - System tests - Encoded", () => { await DownloadJobs.downloadSpoolContent(REAL_SESSION, jesJCLJobFile ); + // eslint-disable-next-line deprecation/deprecation const expectedFile = DownloadJobs.getSpoolDownloadFile(jesJCLJobFile, false); expect(IO.existsSync(expectedFile)).toEqual(true); expect(IO.readFileSync(expectedFile).toString()).toContain("EXEC PGM=IEFBR14"); @@ -397,6 +407,7 @@ describe("Download Jobs - System tests - Encoded", () => { }); for (const file of jobFiles) { + // eslint-disable-next-line deprecation/deprecation const expectedFile = DownloadJobs.getSpoolDownloadFile(file, false, downloadDir); expect(IO.existsSync(expectedFile)).toEqual(true); } @@ -412,6 +423,7 @@ describe("Download Jobs - System tests - Encoded", () => { }); for (const file of jobFiles) { + // eslint-disable-next-line deprecation/deprecation const expectedFile = DownloadJobs.getSpoolDownloadFile(file, false, downloadDir); expect(IO.existsSync(expectedFile)).toEqual(true); if (file.ddname === "JESJCL") { @@ -433,6 +445,7 @@ describe("Download Jobs - System tests - Encoded", () => { }); for (const file of jobFiles) { + // eslint-disable-next-line deprecation/deprecation const expectedFile = DownloadJobs.getSpoolDownloadFile(file, false, downloadDir); expect(IO.existsSync(expectedFile)).toEqual(true); if (file.ddname === "JESJCL") { @@ -463,6 +476,7 @@ describe("Download Jobs - System tests - Encoded", () => { const expectedExt = DownloadJobs.DEFAULT_JOBS_OUTPUT_FILE_EXT; for (const file of await GetJobs.getSpoolFilesForJob(REAL_SESSION, job)) { + // eslint-disable-next-line deprecation/deprecation const expectedFile = DownloadJobs.getSpoolDownloadFile(file, false, downloadDir); expect(IO.existsSync(expectedFile)).toEqual(true); diff --git a/packages/zosjobs/__tests__/__system__/MonitorJobs.system.test.ts b/packages/zosjobs/__tests__/__system__/MonitorJobs.system.test.ts index e84c1eb85c..55999d62fa 100644 --- a/packages/zosjobs/__tests__/__system__/MonitorJobs.system.test.ts +++ b/packages/zosjobs/__tests__/__system__/MonitorJobs.system.test.ts @@ -78,7 +78,7 @@ describe("System Tests - Monitor Jobs", () => { ACCOUNT = defaultSystem.tso.account; const JOB_LENGTH = 6; - MONITOR_JOB_NAME = REAL_SESSION.ISession.user.substr(0, JOB_LENGTH).toUpperCase() + "MJ"; + MONITOR_JOB_NAME = REAL_SESSION.ISession.user.substring(0, JOB_LENGTH).toUpperCase() + "MJ"; JOBCLASS = testEnvironment.systemTestProperties.zosjobs.jobclass; SYSAFF = testEnvironment.systemTestProperties.zosjobs.sysaff; @@ -687,7 +687,7 @@ describe("System Tests - Monitor Jobs - Encoded", () => { ACCOUNT = defaultSystem.tso.account; const JOB_LENGTH = 5; - MONITOR_JOB_NAME = REAL_SESSION.ISession.user?.substr(0, JOB_LENGTH).toUpperCase() + "#MJ"; + MONITOR_JOB_NAME = REAL_SESSION.ISession.user?.substring(0, JOB_LENGTH).toUpperCase() + "#MJ"; JOBCLASS = testEnvironment.systemTestProperties.zosjobs.jobclass; SYSAFF = testEnvironment.systemTestProperties.zosjobs.sysaff; diff --git a/packages/zoslogs/src/GetZosLog.ts b/packages/zoslogs/src/GetZosLog.ts index 3cfb362ee2..b003a9a5d5 100644 --- a/packages/zoslogs/src/GetZosLog.ts +++ b/packages/zoslogs/src/GetZosLog.ts @@ -15,7 +15,6 @@ import { IZosLogType } from "./doc/IZosLogType"; import { IZosLogParms } from "./doc/IZosLogParms"; import { GetZosLogValidator } from "./GetZosLogValidator"; import { ZosLogConstants } from "./ZosLogConstants"; -import { isNullOrUndefined } from "util"; /** @@ -37,7 +36,7 @@ export class GetZosLog { let resp: IZosLogType = await ZosmfRestClient.getExpectJSON(session, GetZosLog.getResourcePath(commandParms), [ZosmfHeaders.X_CSRF_ZOSMF_HEADER]); - if (isNullOrUndefined(commandParms.processResponses) || commandParms.processResponses !== false) { + if (commandParms.processResponses == null || commandParms.processResponses !== false) { // the IBM responses sometimes have \r and sometimes \r\n, we will process them our here and hopefully // return them with just \n. resp = JSON.parse(JSON.stringify(resp).replace(/\\r\\n/g, "\\n").replace(/\\r/g, "\\n")); diff --git a/packages/zosmf/src/ZosmfBaseHandler.ts b/packages/zosmf/src/ZosmfBaseHandler.ts index b7a5dcbe3a..2d41100378 100644 --- a/packages/zosmf/src/ZosmfBaseHandler.ts +++ b/packages/zosmf/src/ZosmfBaseHandler.ts @@ -40,11 +40,13 @@ export abstract class ZosmfBaseHandler implements ICommandHandler { /** * Loaded z/OSMF profile if needed + * @deprecated */ protected mZosmfProfile: IProfile; /** * Loaded z/OSMF profile with meta information + * @deprecated */ protected mZosmfLoadedProfile: IProfileLoaded; @@ -69,7 +71,11 @@ export abstract class ZosmfBaseHandler implements ICommandHandler { public async process(commandParameters: IHandlerParameters) { this.mHandlerParams = commandParameters; + // Nothing uses this, but extenders might... -awharn + // eslint-disable-next-line deprecation/deprecation this.mZosmfProfile = commandParameters.profiles.get("zosmf", false); + // This one too... -awharn + // eslint-disable-next-line deprecation/deprecation this.mZosmfLoadedProfile = commandParameters.profiles.getMeta("zosmf", false); const sessCfg: ISession = ZosmfSession.createSessCfgFromArgs( diff --git a/packages/zostso/src/SendTso.ts b/packages/zostso/src/SendTso.ts index fc9a46c7e2..a0b37ce4f0 100644 --- a/packages/zostso/src/SendTso.ts +++ b/packages/zostso/src/SendTso.ts @@ -12,7 +12,6 @@ import { AbstractSession, Headers } from "@zowe/imperative"; import { ZosmfRestClient } from "@zowe/core-for-zowe-sdk"; -import { isNullOrUndefined } from "util"; import { TsoValidator } from "./TsoValidator"; import { noDataInput, noServletKeyInput, TsoConstants } from "./TsoConstants"; import { ISendTsoParms } from "./doc/input/ISendTsoParms"; @@ -88,7 +87,7 @@ export class SendTso { tsos.push(tso); let messages: string = ""; while (!done) { - if (!isNullOrUndefined(tso.tsoData)) { + if (!(tso.tsoData == null)) { tso.tsoData.forEach((data) => { if (data[TsoConstants.TSO_MESSAGE]) { messages += (data[TsoConstants.TSO_MESSAGE].DATA + "\n"); diff --git a/packages/zosuss/src/SshBaseHandler.ts b/packages/zosuss/src/SshBaseHandler.ts index 3028e1b2ab..b824d2a13f 100644 --- a/packages/zosuss/src/SshBaseHandler.ts +++ b/packages/zosuss/src/SshBaseHandler.ts @@ -41,6 +41,7 @@ export abstract class SshBaseHandler implements ICommandHandler { /** * Loaded z/OS SSH profile if needed + * @deprecated */ protected mSshProfile: IProfile; @@ -64,6 +65,8 @@ export abstract class SshBaseHandler implements ICommandHandler { */ public async process(commandParameters: IHandlerParameters) { this.mHandlerParams = commandParameters; + // Why is this here? NOTHING uses it, but I suppose an extender MIGHT be... -awharn + // eslint-disable-next-line deprecation/deprecation this.mSshProfile = commandParameters.profiles.get("ssh", false); const sshSessCfgOverride: IOverridePromptConnProps[] = [{ From 7d10b5948e5715240994637cd85df654667eae57 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 6 Aug 2024 12:21:01 -0400 Subject: [PATCH 03/14] Implement CLI fixes Signed-off-by: Andrew W. Harn --- ...md.cli.chainedhandlers.integration.test.ts | 3 ++ .../profile-spec/ProfileSpec.handler.ts | 1 + .../src/cli/read/profile/Profile.handler.ts | 1 + ...mentalVariableSettings.integration.test.ts | 3 ++ .../imperative/__tests__/src/TestLogger.ts | 5 +- packages/imperative/__tests__/src/TestUtil.ts | 18 +++---- .../imperative/__tests__/src/UnitTestUtils.ts | 3 +- .../handlers/OptionalProfileCHandler.ts | 1 + .../handlers/UseDependentProfileHandler.ts | 2 + .../handlers/UseProfileAHandler.ts | 1 + .../handlers/UseProfileBHandler.ts | 1 + .../plans/ManyFieldValidationPlan.ts | 3 +- .../SyntaxValidator.integration.test.ts | 6 ++- .../ConfigLoading.integration.test.ts | 3 ++ .../BasicProfileManager.integration.test.ts | 3 ++ .../ProfileCommandExample.integration.test.ts | 3 +- .../profiles/src/handler/SampleHandler.ts | 4 +- .../handlers/DisplayProfileHandler.ts | 1 + .../help/WebHelpGenerator.unit.test.ts | 3 ++ .../help/WebHelpManager.unit.test.ts | 3 ++ .../CommandProfileLoader.unit.test.ts | 13 +++++ .../profiles/CommandProfiles.unit.test.ts | 10 ++++ .../__tests__/utils/CommandUtils.unit.test.ts | 2 +- .../help/abstract/AbstractHelpGenerator.ts | 20 +++---- .../abstract/AbstractHelpGeneratorFactory.ts | 3 +- .../cmd/src/profiles/CommandProfileLoader.ts | 14 ++--- .../src/cmd/src/syntax/SyntaxValidator.ts | 48 ++++++++--------- .../__tests__/SyntaxValidator.unit.test.ts | 4 +- .../src/cmd/src/utils/CommandUtils.ts | 11 ++-- .../src/cmd/src/utils/SharedOptions.ts | 3 +- .../src/cmd/src/yargs/CommandYargs.ts | 8 +-- .../config/__tests__/Config.api.unit.test.ts | 2 + .../imperative/src/config/src/ProfileInfo.ts | 1 + .../src/expect/src/ImperativeExpect.ts | 12 ++--- .../__tests__/Imperative.unit.test.ts | 3 ++ .../__tests__/OverridesLoader.unit.test.ts | 4 ++ .../PluginManagementFacility.unit.test.ts | 2 + .../PluginRequireProvider.unit.test.ts | 4 ++ .../utilities/runValidatePlugin.unit.test.ts | 3 ++ .../imperative/src/ConfigurationValidator.ts | 21 ++++---- .../src/imperative/src/Imperative.ts | 1 + .../src/imperative/src/LoggingConfigurer.ts | 17 +++--- .../src/imperative/src/OverridesLoader.ts | 1 + .../src/auth/handlers/AbstractAuthHandler.ts | 1 + .../src/auth/handlers/BaseAuthHandler.ts | 2 + .../convert-profiles.handler.ts | 2 + .../help/ImperativeHelpGeneratorFactory.ts | 3 +- .../src/plugins/PluginRequireProvider.ts | 1 + .../builders/ProfilesCommandBuilder.ts | 9 ++-- .../builders/ProfilesUpdateCommandBuilder.ts | 7 ++- .../ProfilesValidateCommandBuilder.ts | 3 +- .../handlers/ValidateProfileHandler.ts | 3 +- packages/imperative/src/logger/src/Logger.ts | 14 ++--- .../Operations.integration.spec.ts | 5 +- .../src/operations/src/Operations.ts | 7 ++- .../src/profiles/src/BasicProfileManager.ts | 5 +- .../src/abstract/AbstractProfileManager.ts | 52 +++++++++---------- .../src/profiles/src/utils/ProfileUtils.ts | 5 +- .../src/validation/api/ProfileValidator.ts | 13 +++-- .../client/__model__/CustomRestClient.ts | 3 +- .../__model__/MockHttpRequestResponse.ts | 3 +- .../DefaultCredentialManager.unit.test.ts | 6 +++ .../security/src/DefaultCredentialManager.ts | 2 + .../src/abstract/AbstractCredentialManager.ts | 3 +- .../utilities/__tests__/CliUtils.unit.test.ts | 5 ++ .../__tests__/ProcessUtils.unit.test.ts | 1 + .../diff/WebDiffManager.unit.test.ts | 3 ++ .../imperative/src/utilities/src/CliUtils.ts | 1 + .../imperative/src/utilities/src/JSONUtils.ts | 3 +- .../imperative/src/utilities/src/TextUtils.ts | 16 +++--- 70 files changed, 263 insertions(+), 190 deletions(-) diff --git a/packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/chained/Cmd.cli.chainedhandlers.integration.test.ts b/packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/chained/Cmd.cli.chainedhandlers.integration.test.ts index 1cc5e5ff90..27f8ce6960 100644 --- a/packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/chained/Cmd.cli.chainedhandlers.integration.test.ts +++ b/packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/chained/Cmd.cli.chainedhandlers.integration.test.ts @@ -27,15 +27,18 @@ describe("cmd-cli chained handlers", () => { }); }); + // eslint-disable-next-line deprecation/deprecation const mainModule = process.mainModule; beforeEach(() => { + // eslint-disable-next-line deprecation/deprecation (process.mainModule as any) = { filename: __filename }; }); afterEach(() => { + // eslint-disable-next-line deprecation/deprecation process.mainModule = mainModule; }); diff --git a/packages/imperative/__tests__/__integration__/cmd/src/cli/invalid/profile-spec/ProfileSpec.handler.ts b/packages/imperative/__tests__/__integration__/cmd/src/cli/invalid/profile-spec/ProfileSpec.handler.ts index c5b0d5430e..750248d6c4 100644 --- a/packages/imperative/__tests__/__integration__/cmd/src/cli/invalid/profile-spec/ProfileSpec.handler.ts +++ b/packages/imperative/__tests__/__integration__/cmd/src/cli/invalid/profile-spec/ProfileSpec.handler.ts @@ -13,6 +13,7 @@ import { ICommandHandler, IHandlerParameters } from "../../../../../../../lib"; export default class ProfileSpecHandler implements ICommandHandler { public async process(params: IHandlerParameters): Promise { + // eslint-disable-next-line deprecation/deprecation params.profiles.get("blah"); } } diff --git a/packages/imperative/__tests__/__integration__/cmd/src/cli/read/profile/Profile.handler.ts b/packages/imperative/__tests__/__integration__/cmd/src/cli/read/profile/Profile.handler.ts index b3b229760e..18da0fe758 100644 --- a/packages/imperative/__tests__/__integration__/cmd/src/cli/read/profile/Profile.handler.ts +++ b/packages/imperative/__tests__/__integration__/cmd/src/cli/read/profile/Profile.handler.ts @@ -13,6 +13,7 @@ import { IHandlerParameters, ICommandHandler, TextUtils } from "../../../../../. export default class FirstGroupCommandOneHandler implements ICommandHandler { public async process(params: IHandlerParameters): Promise { + // eslint-disable-next-line deprecation/deprecation const prof = params.profiles.get("insecure"); params.response.console.log(TextUtils.prettyJson(prof)); } diff --git a/packages/imperative/__tests__/__integration__/imperative/__tests__/__integration__/api/env/EnvironmentalVariableSettings.integration.test.ts b/packages/imperative/__tests__/__integration__/imperative/__tests__/__integration__/api/env/EnvironmentalVariableSettings.integration.test.ts index 64e8e6cd83..cccf8207b3 100644 --- a/packages/imperative/__tests__/__integration__/imperative/__tests__/__integration__/api/env/EnvironmentalVariableSettings.integration.test.ts +++ b/packages/imperative/__tests__/__integration__/imperative/__tests__/__integration__/api/env/EnvironmentalVariableSettings.integration.test.ts @@ -15,15 +15,18 @@ import { EnvironmentalVariableSettings, Imperative } from "../../../../../../../src"; describe("environmental variable integration", () => { + // eslint-disable-next-line deprecation/deprecation const mainModule = process.mainModule; beforeEach(() => { + // eslint-disable-next-line deprecation/deprecation (process.mainModule as any) = { filename: __filename }; }); afterEach(() => { + // eslint-disable-next-line deprecation/deprecation process.mainModule = mainModule; }); diff --git a/packages/imperative/__tests__/src/TestLogger.ts b/packages/imperative/__tests__/src/TestLogger.ts index 2654508971..009d3e0366 100644 --- a/packages/imperative/__tests__/src/TestLogger.ts +++ b/packages/imperative/__tests__/src/TestLogger.ts @@ -11,7 +11,6 @@ import { LoggerConfigBuilder } from "../../src/logger/src/LoggerConfigBuilder"; import { Logger } from "../../src/logger/src/Logger"; -import { isNullOrUndefined } from "util"; import { IConfigLogging } from "../../src/logger/src/doc/IConfigLogging"; import * as path from "path"; @@ -82,10 +81,10 @@ export class TestLogger { * @memberof TestLogger */ public static getTestLogger(loggerFileName = TestLogger.getCallersFile()): Logger { - if (!isNullOrUndefined(TestLogger.testLogger)) { + if (!(TestLogger.testLogger == null)) { const categoryLogger: Logger = Logger.getLoggerCategory(loggerFileName); categoryLogger.level = "trace"; - if (isNullOrUndefined(categoryLogger)) { + if (categoryLogger == null) { const logFile: string = TestLogger.constructTestLogFile(loggerFileName); LoggerConfigBuilder.addFileAppender(LoggerConfigBuilder.getDefaultIConfigLogging(), loggerFileName, loggerFileName, logFile); diff --git a/packages/imperative/__tests__/src/TestUtil.ts b/packages/imperative/__tests__/src/TestUtil.ts index d2070b831b..78cb6d909a 100644 --- a/packages/imperative/__tests__/src/TestUtil.ts +++ b/packages/imperative/__tests__/src/TestUtil.ts @@ -18,7 +18,7 @@ * Module imports for TestUtils and testing infrastructure */ import { SpawnSyncReturns } from "child_process"; -import { inspect, isArray, isNullOrUndefined, isString } from "util"; +import { inspect } from "util"; import { Constants } from "../../src/constants"; import { ICommandResponse } from "../../src/cmd"; import { ICompareParms } from "./doc/ICompareParms"; @@ -178,7 +178,7 @@ export function executeTestCLICommand(cliBinModule: string, testContext: any, ar const commandExecutionMessage = "Executing " + nodeCommand + " " + args.join(" "); testLogger.info(commandExecutionMessage); - if (!isNullOrUndefined(testContext)) { + if (!(testContext == null)) { TestLogger.getTestLogger().debug(testContext, commandExecutionMessage); } const childEnv = JSON.parse(JSON.stringify(env)); // copy current env @@ -199,7 +199,7 @@ export function executeTestCLICommand(cliBinModule: string, testContext: any, ar const commandResultMessage = "Command output: \n" + child.output.join(" ") + "\nexit code: " + child.status; - if (!isNullOrUndefined(testContext)) { + if (!(testContext == null)) { TestLogger.getTestLogger().debug(commandResultMessage); } @@ -263,7 +263,7 @@ export function findExpectedOutputInCommand(cliBinModule: string, } dataObjectParser = new DataObjectParser(jsonOutput); // verify the dot-notation object passed in exists in the output JSON - if (isNullOrUndefined(dataObjectParser.get(jsonFieldForContent))) { + if (dataObjectParser.get(jsonFieldForContent) == null) { throw new Error("Requested field " + jsonFieldForContent + " was not available in the JSON response"); } } @@ -303,7 +303,7 @@ export function findExpectedOutputInCommand(cliBinModule: string, expectedContent = expectedContent || ""; - if (!isArray(expectedContent)) { + if (!(Array.isArray(expectedContent))) { // convert single expected content to an array expectedContent = [expectedContent]; } @@ -326,7 +326,7 @@ export function findExpectedOutputInCommand(cliBinModule: string, } if (variationsToRun === CMD_TYPE.ALL || variationsToRun === CMD_TYPE.JSON) { let objectSummary = dataObjectParser.get(jsonFieldForContent); - if (!isString(objectSummary)) { + if (!(typeof objectSummary === 'string')) { objectSummary = inspect(objectSummary); } if (compareOptions.ignoreCase) { @@ -357,8 +357,8 @@ export function compareJsonObjects(actual: any, expected: any, parms?: ICompareP if (parms) { diffs.forEach((difference: any) => { const path = difference.path.join("."); - if (isNullOrUndefined(parms.ignorePaths) || (parms.ignorePaths.indexOf(path) < 0)) { - if (!isNullOrUndefined(parms.pathRegex)) { + if (parms.ignorePaths == null || (parms.ignorePaths.indexOf(path) < 0)) { + if (!(parms.pathRegex == null)) { let regexPathMatch: boolean = false; for (const reg of parms.pathRegex) { if (path === reg.path) { @@ -386,7 +386,7 @@ export function compareJsonObjects(actual: any, expected: any, parms?: ICompareP } }); } else { - if (!isNullOrUndefined(diffs)) { + if (!(diffs == null)) { returnDiffs = returnDiffs.concat(diffs); } } diff --git a/packages/imperative/__tests__/src/UnitTestUtils.ts b/packages/imperative/__tests__/src/UnitTestUtils.ts index 608a9e660e..a1f8033184 100644 --- a/packages/imperative/__tests__/src/UnitTestUtils.ts +++ b/packages/imperative/__tests__/src/UnitTestUtils.ts @@ -10,7 +10,6 @@ */ import { TestLogger } from "./TestLogger"; -import { isNullOrUndefined } from "util"; const fnArgs = require("get-function-arguments"); const cowsay = require("cowsay"); @@ -84,7 +83,7 @@ export class UnitTestUtils { // eslint-disable-next-line no-global-assign (it as any) = function (description: string, testFunc: (done?: any) => void) { const log = TestLogger.getTestLogger(); - if (isNullOrUndefined(testDetailHandler)) { + if (testDetailHandler == null) { testDetailHandler = function (details: any) { log.info("\n" + cowsay.say({ text: (details as any).description, diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/OptionalProfileCHandler.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/OptionalProfileCHandler.ts index d1569f9b0b..6122fd06a4 100644 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/OptionalProfileCHandler.ts +++ b/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/OptionalProfileCHandler.ts @@ -13,6 +13,7 @@ import { ICommandHandler, IHandlerParameters } from "../../../../../src/cmd"; export default class OptionalProfileCHandler implements ICommandHandler { public async process(params: IHandlerParameters) { + // eslint-disable-next-line deprecation/deprecation const profile = params.profiles.get("profile-c", false); params.response.console.log(`Profile Cs loaded: ${profile}`); } diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseDependentProfileHandler.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseDependentProfileHandler.ts index 6226127a15..94722840a3 100644 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseDependentProfileHandler.ts +++ b/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseDependentProfileHandler.ts @@ -13,8 +13,10 @@ import { ICommandHandler, IHandlerParameters } from "../../../../../src/cmd"; export default class UseDependentProfile implements ICommandHandler { public async process(params: IHandlerParameters) { + // eslint-disable-next-line deprecation/deprecation const dependencyProfile = params.profiles.get("profile-a"); params.response.console.log("Loaded profile dependency of type profile-a"); + // eslint-disable-next-line deprecation/deprecation const mainProfile = params.profiles.get("profile-with-dependency"); params.response.console.log("Loaded main profile of type profile-with-dependency"); } diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseProfileAHandler.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseProfileAHandler.ts index ac7c8dcc26..1745880c01 100644 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseProfileAHandler.ts +++ b/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseProfileAHandler.ts @@ -13,6 +13,7 @@ import { ICommandHandler, IHandlerParameters } from "../../../../../src/cmd"; export default class UseProfileAHandler implements ICommandHandler { public async process(params: IHandlerParameters) { + // eslint-disable-next-line deprecation/deprecation const profile = params.profiles.get("profile-a"); params.response.console.log("Loaded profile {{name}} of type {{type}}", {name: profile.name, type: profile.type}); diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseProfileBHandler.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseProfileBHandler.ts index ad65f364e9..246abae3c1 100644 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseProfileBHandler.ts +++ b/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseProfileBHandler.ts @@ -13,6 +13,7 @@ import { ICommandHandler, IHandlerParameters } from "../../../../../src/cmd"; export default class UseProfileAHandler implements ICommandHandler { public async process(params: IHandlerParameters): Promise { + // eslint-disable-next-line deprecation/deprecation const profile = params.profiles.get("profile-b"); params.response.console.log("Loaded profile {{name}} of type {{type}}", {name: profile.name, type: profile.type}); diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/plans/ManyFieldValidationPlan.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/plans/ManyFieldValidationPlan.ts index 8de8fcc66a..8e8b8d9d74 100644 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/plans/ManyFieldValidationPlan.ts +++ b/packages/imperative/__tests__/src/example_clis/with_profiles/plans/ManyFieldValidationPlan.ts @@ -11,7 +11,6 @@ import { IProfileValidationPlan, IProfileValidationTask } from "../../../../../src/profiles"; import { IProfileValidationTaskResult } from "../../../../../src/profiles/src/validation/doc/IProfileValidationTaskResult"; -import { isNullOrUndefined } from "util"; export = class ManyFieldValidationPlan implements IProfileValidationPlan { @@ -22,7 +21,7 @@ export = class ManyFieldValidationPlan implements IProfileValidationPlan { name: "Tea color", taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { let result: IProfileValidationTaskResult; - if (isNullOrUndefined(profile.tea) || profile.tea !== "earl_grey") { + if (profile.tea == null || profile.tea !== "earl_grey") { result = { outcome: "Failed", resultDescription: "Tea was not earl_grey" diff --git a/packages/imperative/__tests__/src/packages/cmd/__integration__/SyntaxValidator.integration.test.ts b/packages/imperative/__tests__/src/packages/cmd/__integration__/SyntaxValidator.integration.test.ts index 1352a30dd7..a88c6a85df 100644 --- a/packages/imperative/__tests__/src/packages/cmd/__integration__/SyntaxValidator.integration.test.ts +++ b/packages/imperative/__tests__/src/packages/cmd/__integration__/SyntaxValidator.integration.test.ts @@ -10,7 +10,6 @@ */ /* eslint-disable jest/expect-expect */ -import { isNullOrUndefined } from "util"; import { CommandProcessor, ICommandDefinition, ICommandResponse } from "../../../../../src/cmd/index"; import { ValidationTestCommand } from "../ValidationTestCommand"; import { Constants } from "../../../../../src/constants/index"; @@ -44,9 +43,11 @@ const DUMMY_PROFILE_TYPE_CONFIG: IProfileTypeConfiguration[] = [ ]; describe("Imperative should provide advanced syntax validation rules", function () { const home = __dirname + "/validationtests"; + // eslint-disable-next-line deprecation/deprecation const mainModule = process.mainModule; beforeAll(function () { + // eslint-disable-next-line deprecation/deprecation (process.mainModule as any) = { filename: __filename }; @@ -61,6 +62,7 @@ describe("Imperative should provide advanced syntax validation rules", function }); }); afterAll(() => { + // eslint-disable-next-line deprecation/deprecation process.mainModule = mainModule; rimraf(home); }); @@ -106,7 +108,7 @@ describe("Imperative should provide advanced syntax validation rules", function } else { expect(completedResponse.success).toEqual(false); } - if (!isNullOrUndefined(expectedText) && expectedText.length > 0) { + if (!(expectedText == null) && expectedText.length > 0) { (completedResponse.stderr as any) = completedResponse.stderr.toString(); (completedResponse.stdout as any) = completedResponse.stdout.toString(); for (const text of expectedText) { diff --git a/packages/imperative/__tests__/src/packages/imperative/__integration__/ConfigLoading.integration.test.ts b/packages/imperative/__tests__/src/packages/imperative/__integration__/ConfigLoading.integration.test.ts index d6694e4b1f..22044b80cb 100644 --- a/packages/imperative/__tests__/src/packages/imperative/__integration__/ConfigLoading.integration.test.ts +++ b/packages/imperative/__tests__/src/packages/imperative/__integration__/ConfigLoading.integration.test.ts @@ -16,16 +16,19 @@ import { ImperativeConfig } from "../../../../../src/utilities"; describe("Imperative should validate config provided by the consumer", function () { const testDir = T.createUniqueTestDataDir("config-loading"); const packageJsonPath = testDir + "/package.json"; + // eslint-disable-next-line deprecation/deprecation const mainModule = process.mainModule; beforeAll(() => { // Temporarily change the main module filename so that the test can work. + // eslint-disable-next-line deprecation/deprecation (process.mainModule as any) = { filename: packageJsonPath }; }); afterAll(() => { + // eslint-disable-next-line deprecation/deprecation process.mainModule = mainModule; T.unlinkSync(packageJsonPath); }); diff --git a/packages/imperative/__tests__/src/packages/profiles/__integration__/BasicProfileManager.integration.test.ts b/packages/imperative/__tests__/src/packages/profiles/__integration__/BasicProfileManager.integration.test.ts index 1d629a28cc..20119d45c4 100644 --- a/packages/imperative/__tests__/src/packages/profiles/__integration__/BasicProfileManager.integration.test.ts +++ b/packages/imperative/__tests__/src/packages/profiles/__integration__/BasicProfileManager.integration.test.ts @@ -16,6 +16,7 @@ import { ProfileUtils } from "../../../../../src/profiles"; import { BANANA_AGE, getConfig, PROFILE_TYPE } from "../src/constants/BasicProfileManagerTestConstants"; describe("Imperative should allow CLI implementations to configure their own profiles and types", function () { + // eslint-disable-next-line deprecation/deprecation const mainModule = process.mainModule; const loadChangingDependencies = () => { return { @@ -34,12 +35,14 @@ describe("Imperative should allow CLI implementations to configure their own pro }); beforeAll(() => { + // eslint-disable-next-line deprecation/deprecation (process.mainModule as any) = { filename: __filename }; }); afterAll(() => { + // eslint-disable-next-line deprecation/deprecation process.mainModule = mainModule; }); diff --git a/packages/imperative/__tests__/src/packages/profiles/__integration__/ProfileCommandExample.integration.test.ts b/packages/imperative/__tests__/src/packages/profiles/__integration__/ProfileCommandExample.integration.test.ts index 3fe4ee4905..287d3fb8f4 100644 --- a/packages/imperative/__tests__/src/packages/profiles/__integration__/ProfileCommandExample.integration.test.ts +++ b/packages/imperative/__tests__/src/packages/profiles/__integration__/ProfileCommandExample.integration.test.ts @@ -15,7 +15,6 @@ import * as yargs from "yargs"; import { Constants } from "../../../../../src/constants"; import { CommandProcessor, ICommandDefinition, ICommandProfileTypeConfiguration, ICommandResponse } from "../../../../../src/cmd"; import { ICommandProcessorParms } from "../../../../../src/cmd/src/doc/processor/ICommandProcessorParms"; -import { isNullOrUndefined } from "util"; import { TestLogger } from "../../../../src/TestLogger"; import { AbstractHelpGenerator } from "../../../../../src/cmd/src/help/abstract/AbstractHelpGenerator"; import { DefaultHelpGenerator } from "../../../../../src/cmd/src/help/DefaultHelpGenerator"; @@ -117,7 +116,7 @@ describe("Imperative should allow CLI implementations to configure their own pro // "Command should have failed" expect(completedResponse.success).toEqual(false); } - if (!isNullOrUndefined(expectedText) && expectedText.length > 0) { + if (!(expectedText == null) && expectedText.length > 0) { const fullText = completedResponse.stdout.toString() + completedResponse.stderr.toString(); for (const text of expectedText) { diff --git a/packages/imperative/__tests__/src/packages/profiles/src/handler/SampleHandler.ts b/packages/imperative/__tests__/src/packages/profiles/src/handler/SampleHandler.ts index b7972b09be..6f5235a569 100644 --- a/packages/imperative/__tests__/src/packages/profiles/src/handler/SampleHandler.ts +++ b/packages/imperative/__tests__/src/packages/profiles/src/handler/SampleHandler.ts @@ -10,13 +10,13 @@ */ import { ICommandHandler, IHandlerParameters } from "../../../../../../src/cmd"; -import { isNullOrUndefined } from "util"; import { ImperativeError } from "../../../../../../src/error"; export default class SampleHandler implements ICommandHandler { public async process(commandParameters: IHandlerParameters) { + // eslint-disable-next-line deprecation/deprecation const profile: any = commandParameters.profiles.get("banana"); - if (isNullOrUndefined(profile)) { + if (profile == null) { const errMsg = commandParameters.response.console.error("Failed to load a profile of type banana"); throw new ImperativeError({msg: errMsg}); } diff --git a/packages/imperative/__tests__/src/packages/profiles/test_cli/handlers/DisplayProfileHandler.ts b/packages/imperative/__tests__/src/packages/profiles/test_cli/handlers/DisplayProfileHandler.ts index 57b88a797b..0f9ab9fce6 100644 --- a/packages/imperative/__tests__/src/packages/profiles/test_cli/handlers/DisplayProfileHandler.ts +++ b/packages/imperative/__tests__/src/packages/profiles/test_cli/handlers/DisplayProfileHandler.ts @@ -13,6 +13,7 @@ import { ICommandHandler, IHandlerParameters } from "../../../../../../src/cmd"; export default class DisplayProfileHandler implements ICommandHandler { public async process(params: IHandlerParameters): Promise { + // eslint-disable-next-line deprecation/deprecation const profile = params.profiles.get("username-password"); params.response.console.log(JSON.stringify(profile)); } diff --git a/packages/imperative/src/cmd/__tests__/help/WebHelpGenerator.unit.test.ts b/packages/imperative/src/cmd/__tests__/help/WebHelpGenerator.unit.test.ts index 18a153e089..07f565ce90 100644 --- a/packages/imperative/src/cmd/__tests__/help/WebHelpGenerator.unit.test.ts +++ b/packages/imperative/src/cmd/__tests__/help/WebHelpGenerator.unit.test.ts @@ -23,6 +23,7 @@ import { ICommandDefinition } from "../../../cmd/src/doc/ICommandDefinition"; describe("WebHelpGenerator", () => { describe("buildHelp", () => { + // eslint-disable-next-line deprecation/deprecation const mainModule = process.mainModule; let moduleFileNm: string; let cliHome: string; @@ -104,6 +105,7 @@ describe("WebHelpGenerator", () => { /* process.mainModule.filename was null, so we must give it a value. * mainModule is a getter of a property, so we mock the property. */ + // eslint-disable-next-line deprecation/deprecation (process.mainModule as any) = { filename: moduleFileNm }; @@ -113,6 +115,7 @@ describe("WebHelpGenerator", () => { }); afterAll(() => { + // eslint-disable-next-line deprecation/deprecation process.mainModule = mainModule; rimraf.sync(cliHome); }); diff --git a/packages/imperative/src/cmd/__tests__/help/WebHelpManager.unit.test.ts b/packages/imperative/src/cmd/__tests__/help/WebHelpManager.unit.test.ts index c49cbfe41a..111465a9bc 100644 --- a/packages/imperative/src/cmd/__tests__/help/WebHelpManager.unit.test.ts +++ b/packages/imperative/src/cmd/__tests__/help/WebHelpManager.unit.test.ts @@ -41,6 +41,7 @@ describe("WebHelpManager", () => { const webHelpDirNm = path.join(mockCliHome, "web-help"); const impCfg: ImperativeConfig = ImperativeConfig.instance; const cmdReponse = new CommandResponse({ silent: false }); + // eslint-disable-next-line deprecation/deprecation const mainModule = process.mainModule; let opener: any; let instPluginsFileNm: string; @@ -55,6 +56,7 @@ describe("WebHelpManager", () => { /* getResolvedCmdTree calls getCallerLocation, and we need it to return some string. * getCallerLocation is a getter of a property, so we mock the property. */ + // eslint-disable-next-line deprecation/deprecation (process.mainModule as any) = { filename: "FakeCli" }; @@ -81,6 +83,7 @@ describe("WebHelpManager", () => { }); afterAll(() => { + // eslint-disable-next-line deprecation/deprecation process.mainModule = mainModule; rimraf.sync(mockCliHome); }); diff --git a/packages/imperative/src/cmd/__tests__/profiles/CommandProfileLoader.unit.test.ts b/packages/imperative/src/cmd/__tests__/profiles/CommandProfileLoader.unit.test.ts index 13852e998d..339040e297 100644 --- a/packages/imperative/src/cmd/__tests__/profiles/CommandProfileLoader.unit.test.ts +++ b/packages/imperative/src/cmd/__tests__/profiles/CommandProfileLoader.unit.test.ts @@ -221,6 +221,7 @@ describe("Command Profile Loader", () => { logger: TestLogger.getTestLogger() }) .loadProfiles({ _: undefined as any, $0: undefined as any }); + // eslint-disable-next-line deprecation/deprecation expect(response.get(PROFILE_BANANA_TYPE)).toMatchSnapshot(); }); @@ -333,6 +334,7 @@ describe("Command Profile Loader", () => { logger: TestLogger.getTestLogger() }) .loadProfiles({"_": undefined as any, "$0": undefined as any, "banana-profile": "tasty"}); + // eslint-disable-next-line deprecation/deprecation expect(response.get(PROFILE_BANANA_TYPE)).toMatchSnapshot(); }); @@ -375,7 +377,9 @@ describe("Command Profile Loader", () => { logger: TestLogger.getTestLogger() }) .loadProfiles({"_": undefined as any, "$0": undefined as any, "banana-profile": "tasty"}); + // eslint-disable-next-line deprecation/deprecation expect(response.get(PROFILE_BANANA_TYPE)).toMatchSnapshot(); + // eslint-disable-next-line deprecation/deprecation expect(response.get(STRAWBERRY_PROFILE_TYPE)).toMatchSnapshot(); }); @@ -426,7 +430,9 @@ describe("Command Profile Loader", () => { logger: TestLogger.getTestLogger() }) .loadProfiles({"_": undefined as any, "$0": undefined as any, "banana-profile": "tasty", "strawberry-profile": "red"}); + // eslint-disable-next-line deprecation/deprecation expect(response.get(PROFILE_BANANA_TYPE)).toMatchSnapshot(); + // eslint-disable-next-line deprecation/deprecation expect(response.get(STRAWBERRY_PROFILE_TYPE)).toMatchSnapshot(); }); @@ -535,10 +541,15 @@ describe("Command Profile Loader", () => { profileManagerFactory: manager, logger: TestLogger.getTestLogger() }).loadProfiles({"_": undefined as any, "$0": undefined as any, "banana-profile": "tasty"}); + // eslint-disable-next-line deprecation/deprecation expect(response.getAll(PROFILE_BANANA_TYPE)[0]).toMatchSnapshot(); + // eslint-disable-next-line deprecation/deprecation expect(response.getAll(PROFILE_BANANA_TYPE)[1]).toMatchSnapshot(); + // eslint-disable-next-line deprecation/deprecation expect(response.getAll(PROFILE_BANANA_TYPE)[2]).toMatchSnapshot(); + // eslint-disable-next-line deprecation/deprecation expect(response.get(PROFILE_BANANA_TYPE)).toMatchSnapshot(); + // eslint-disable-next-line deprecation/deprecation expect(response.getAll(PROFILE_BANANA_TYPE)).toMatchSnapshot(); }); @@ -589,7 +600,9 @@ describe("Command Profile Loader", () => { profileManagerFactory: manager, logger: TestLogger.getTestLogger() }).loadProfiles({"_": undefined as any, "$0": undefined as any, "banana-profile": "tasty", "strawberry-profile": "red"}); + // eslint-disable-next-line deprecation/deprecation expect(response.get(PROFILE_BANANA_TYPE)).toMatchSnapshot(); + // eslint-disable-next-line deprecation/deprecation expect(response.get(STRAWBERRY_PROFILE_TYPE)).toMatchSnapshot(); }); }); diff --git a/packages/imperative/src/cmd/__tests__/profiles/CommandProfiles.unit.test.ts b/packages/imperative/src/cmd/__tests__/profiles/CommandProfiles.unit.test.ts index bf683a2eaa..6b681bc2fd 100644 --- a/packages/imperative/src/cmd/__tests__/profiles/CommandProfiles.unit.test.ts +++ b/packages/imperative/src/cmd/__tests__/profiles/CommandProfiles.unit.test.ts @@ -69,9 +69,13 @@ describe("Command Profiles", () => { age: 2 }]); const profiles = new CommandProfiles(map); + // eslint-disable-next-line deprecation/deprecation expect(profiles.getAll(BANANA_PROFILE_TYPE)).toMatchSnapshot(); + // eslint-disable-next-line deprecation/deprecation expect(profiles.getAll(STRAWBERRY_PROFILE_TYPE)).toMatchSnapshot(); + // eslint-disable-next-line deprecation/deprecation expect(profiles.get(STRAWBERRY_PROFILE_TYPE)).toMatchSnapshot(); + // eslint-disable-next-line deprecation/deprecation expect(profiles.get(BANANA_PROFILE_TYPE)).toMatchSnapshot(); }); @@ -85,6 +89,7 @@ describe("Command Profiles", () => { let error; try { const profiles = new CommandProfiles(map); + // eslint-disable-next-line deprecation/deprecation profiles.get(STRAWBERRY_PROFILE_TYPE); } catch (e) { error = e; @@ -106,6 +111,7 @@ describe("Command Profiles", () => { let response; try { const profiles = new CommandProfiles(map); + // eslint-disable-next-line deprecation/deprecation response = profiles.get(STRAWBERRY_PROFILE_TYPE, false); } catch (e) { error = e; @@ -126,6 +132,7 @@ describe("Command Profiles", () => { age: 2 }]); const profiles = new CommandProfiles(map); + // eslint-disable-next-line deprecation/deprecation const awesome = profiles.get(STRAWBERRY_PROFILE_TYPE, true, "awesome"); expect(awesome).toMatchSnapshot(); }); @@ -161,6 +168,7 @@ describe("Command Profiles", () => { failNotFound: false }]); const profiles = new CommandProfiles(map, metaMap); + // eslint-disable-next-line deprecation/deprecation const awesome = profiles.getMeta(STRAWBERRY_PROFILE_TYPE, false, "great"); expect(awesome).toMatchSnapshot(); }); @@ -196,6 +204,7 @@ describe("Command Profiles", () => { failNotFound: false }]); const profiles = new CommandProfiles(map, metaMap); + // eslint-disable-next-line deprecation/deprecation const awesome = profiles.getMeta(STRAWBERRY_PROFILE_TYPE, false, null); expect(awesome).toMatchSnapshot(); }); @@ -234,6 +243,7 @@ describe("Command Profiles", () => { let err; try { + // eslint-disable-next-line deprecation/deprecation const awesome = profiles.getMeta("unknown", true, "tasty"); } catch (thrownError) { err = thrownError; diff --git a/packages/imperative/src/cmd/__tests__/utils/CommandUtils.unit.test.ts b/packages/imperative/src/cmd/__tests__/utils/CommandUtils.unit.test.ts index 37c067546f..c92e854337 100644 --- a/packages/imperative/src/cmd/__tests__/utils/CommandUtils.unit.test.ts +++ b/packages/imperative/src/cmd/__tests__/utils/CommandUtils.unit.test.ts @@ -89,7 +89,7 @@ describe("Command Utils", () => { }); it("We should be able to flatten a nested command tree with aliases for display and searching purposes", () => { - const flatten: ICommandTreeEntry[] = CommandUtils.flattenCommandTreeWithAliases(COMPLEX_COMMAND_WITH_ALIASES); + const flatten: ICommandTreeEntry[] = CommandUtils.flattenCommandTree(COMPLEX_COMMAND_WITH_ALIASES); TestLogger.info("Flattened Command Tree:\n" + inspect(flatten)); expect(flatten).toMatchSnapshot(); }); diff --git a/packages/imperative/src/cmd/src/help/abstract/AbstractHelpGenerator.ts b/packages/imperative/src/cmd/src/help/abstract/AbstractHelpGenerator.ts index e2dc6ead07..f3ca75bf57 100644 --- a/packages/imperative/src/cmd/src/help/abstract/AbstractHelpGenerator.ts +++ b/packages/imperative/src/cmd/src/help/abstract/AbstractHelpGenerator.ts @@ -10,7 +10,7 @@ */ import { TextUtils } from "../../../../utilities"; -import { format, isNullOrUndefined } from "util"; +import { format } from "util"; import { ImperativeError } from "../../../../error/src/ImperativeError"; import { Logger } from "../../../../logger/src/Logger"; import { IHelpGeneratorParms } from "../doc/IHelpGeneratorParms"; @@ -33,7 +33,7 @@ export abstract class AbstractHelpGenerator implements IHelpGenerator { * @returns {string} the formatted/colored header */ public static formatHelpHeader(header: string, indent: string = " ", color: string): string { - if (isNullOrUndefined(header) || header.trim().length === 0) { + if (header == null || header.trim().length === 0) { throw new ImperativeError({ msg: "Null or empty header provided; could not be formatted." }); @@ -102,7 +102,7 @@ export abstract class AbstractHelpGenerator implements IHelpGenerator { // TODO - rework these parameter (and possible the help generator scheme) constructor(defaultParms: IHelpGeneratorFactoryParms, commandParms: IHelpGeneratorParms) { - if (isNullOrUndefined(commandParms.commandDefinition) || isNullOrUndefined(commandParms.fullCommandTree)) { + if (commandParms.commandDefinition == null || commandParms.fullCommandTree == null) { throw new ImperativeError({ msg: "Error initializing help generator. The command definition or command definition tree was null or undefined.", additionalDetails: JSON.stringify(commandParms.commandDefinition) + "\n\n" + JSON.stringify(commandParms.fullCommandTree) @@ -124,13 +124,13 @@ export abstract class AbstractHelpGenerator implements IHelpGenerator { public getOptionAndAliasesString(option: ICommandOptionDefinition, caseSensitive?: boolean): string { let aliasString = ""; - if (!isNullOrUndefined(option.aliases) && option.aliases.length > 0 && + if (!(option.aliases == null) && option.aliases.length > 0 && (option.aliases.join("").trim().length !== 0)) { const formattedOptAliases = []; aliasString += " | "; for (const alias of option.aliases) { - if (!isNullOrUndefined(alias) && alias.length > 0) { + if (!(alias == null) && alias.length > 0) { formattedOptAliases.push("{{codeBegin}}" + (alias.length === 1 ? "-" : "--") + alias + "{{codeEnd}}"); } @@ -160,7 +160,7 @@ export abstract class AbstractHelpGenerator implements IHelpGenerator { this.groupToOption = {}; this.optionToDescription = {}; - if (isNullOrUndefined(this.mCommandDefinition.options)) { + if (this.mCommandDefinition.options == null) { return; } for (const option of this.mCommandDefinition.options.filter(opt => !opt.hidden)) { @@ -188,9 +188,9 @@ export abstract class AbstractHelpGenerator implements IHelpGenerator { } protected getCaseSensitiveFlagByOptionName(optionName: string): boolean { - if (!isNullOrUndefined(this.mCommandDefinition.customize) && - !isNullOrUndefined(this.mCommandDefinition.customize.commandStatement) && - !isNullOrUndefined(this.mCommandDefinition.customize.commandStatement.children)) { + if (!(this.mCommandDefinition.customize == null) && + !(this.mCommandDefinition.customize.commandStatement == null) && + !(this.mCommandDefinition.customize.commandStatement.children == null)) { for (const child of this.mCommandDefinition.customize.commandStatement.children) { if (child.name.toUpperCase() === optionName.toUpperCase()) { return child.caseSensitive; @@ -201,7 +201,7 @@ export abstract class AbstractHelpGenerator implements IHelpGenerator { } protected renderHelp(help: string): string { - if (isNullOrUndefined(help)) { + if (help == null) { throw new ImperativeError({ msg: "Help unable to be rendered - the supplied help text was null or undefined." }); diff --git a/packages/imperative/src/cmd/src/help/abstract/AbstractHelpGeneratorFactory.ts b/packages/imperative/src/cmd/src/help/abstract/AbstractHelpGeneratorFactory.ts index dc522c3367..6d1ae689db 100644 --- a/packages/imperative/src/cmd/src/help/abstract/AbstractHelpGeneratorFactory.ts +++ b/packages/imperative/src/cmd/src/help/abstract/AbstractHelpGeneratorFactory.ts @@ -11,7 +11,6 @@ import { IHelpGeneratorFactoryParms } from "../doc/IHelpGeneratorFactoryParms"; import { IHelpGeneratorFactory } from "../doc/IHelpGeneratorFactory"; -import { isNullOrUndefined } from "util"; import { IHelpGeneratorParms } from "../doc/IHelpGeneratorParms"; import { IHelpGenerator } from "../doc/IHelpGenerator"; import { ImperativeExpect } from "../../../../expect"; @@ -69,7 +68,7 @@ export abstract class AbstractHelpGeneratorFactory implements IHelpGeneratorFact this.mRootCommandName = parms.rootCommandName; // TODO - what is the default color for imperative? this.mPrimaryHighlightColor = parms.primaryHighlightColor || "yellow"; - this.mProduceMarkdown = isNullOrUndefined(parms.produceMarkdown) ? false : parms.produceMarkdown; + this.mProduceMarkdown = parms.produceMarkdown == null ? false : parms.produceMarkdown; } /** diff --git a/packages/imperative/src/cmd/src/profiles/CommandProfileLoader.ts b/packages/imperative/src/cmd/src/profiles/CommandProfileLoader.ts index b990ad8952..df0aee3220 100644 --- a/packages/imperative/src/cmd/src/profiles/CommandProfileLoader.ts +++ b/packages/imperative/src/cmd/src/profiles/CommandProfileLoader.ts @@ -14,7 +14,7 @@ import { ICommandDefinition } from "../doc/ICommandDefinition"; import { IProfile, IProfileLoaded, IProfileManagerFactory, ProfileUtils } from "../../../profiles"; import { ICommandProfileTypeConfiguration } from "../doc/profiles/definition/ICommandProfileTypeConfiguration"; import { CommandProfiles } from "./CommandProfiles"; -import { inspect, isNullOrUndefined } from "util"; +import { inspect } from "util"; import { ICommandLoadProfile } from "../doc/profiles/parms/ICommandLoadProfile"; import { ICommandProfileLoaderParms } from "../doc/profiles/parms/ICommandProfileLoaderParms"; import { Logger } from "../../../logger"; @@ -116,7 +116,7 @@ export class CommandProfileLoader { // If there are no profile specifications on this command definition document node, then // we can immediately exit with an empty map - if (!isNullOrUndefined(this.definition.profile)) { + if (!(this.definition.profile == null)) { this.log.trace(`Loading profiles for command: ${this.definition.name}...`); const loadList: ICommandLoadProfile[] = this.constructLoadList(commandArguments); const responses: IProfileLoaded[] = await this.loadAll(loadList); @@ -141,7 +141,7 @@ export class CommandProfileLoader { private buildCommandMap(responses: IProfileLoaded[], map: Map) { for (const resp of responses) { if (resp.profile) { - if (isNullOrUndefined(map.get(resp.type))) { + if (map.get(resp.type) == null) { this.log.trace(`Adding first profile "${resp.name}" of type "${resp.type}" to the map.`); map.set(resp.type, [resp.profile]); } else { @@ -165,7 +165,7 @@ export class CommandProfileLoader { private buildCommandMetaMap(responses: IProfileLoaded[], map: Map) { for (const resp of responses) { if (resp.profile) { - if (isNullOrUndefined(map.get(resp.type))) { + if (map.get(resp.type) == null) { this.log.trace(`Adding first profile "${resp.name}" of type "${resp.type}" to the map.`); map.set(resp.type, [resp]); } else { @@ -205,7 +205,7 @@ export class CommandProfileLoader { */ private buildLoad(optional: boolean, types: string[], commandArguments: Arguments): ICommandLoadProfile[] { const loadProfiles: ICommandLoadProfile[] = []; - if (!isNullOrUndefined(types)) { + if (!(types == null)) { // Construct the load control parameters for each required type types.forEach((type) => { @@ -221,7 +221,7 @@ export class CommandProfileLoader { // If the argument is specified, indicate that this is a user specified load and if not // assume that the default should be loaded (but still required on the command) const profOpt = ProfileUtils.getProfileOptionAndAlias(type)[0]; - if (!isNullOrUndefined(commandArguments[profOpt])) { + if (!(commandArguments[profOpt] == null)) { load.userSpecified = true; load.name = commandArguments[profOpt] as string; } else { @@ -260,7 +260,7 @@ export class CommandProfileLoader { // This is an exceptional case - the manager did not do it's job properly, but we will ensure // that if a profile was required (not optional), that it was loaded. - if (!load.optional && (isNullOrUndefined(response) || isNullOrUndefined(response.profile))) { + if (!load.optional && (response == null || response.profile == null)) { throw new ImperativeError({ msg: `Unexpected internal load error: The profile ` + `"${(load.loadDefault) ? "default requested" : load.name}" was not loaded by the profile manager.` diff --git a/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts b/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts index 448f7b295f..5da6f410a0 100644 --- a/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts +++ b/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts @@ -10,7 +10,7 @@ */ import * as fs from "fs"; -import { inspect, isNullOrUndefined } from "util"; +import { inspect } from "util"; import { syntaxErrorHeader } from "../../../messages"; import { CliUtils } from "../../../utilities/src/CliUtils"; import { Constants } from "../../../constants"; @@ -124,9 +124,9 @@ export class SyntaxValidator { * Prevent empty string options, regardless of if they are * required or not e.g. --bright-zosmf-profile (without a value) */ - if (!isNullOrUndefined(this.mCommandDefinition.options)) { + if (!(this.mCommandDefinition.options == null)) { for (const option of this.mCommandDefinition.options) { - if (!isNullOrUndefined(commandArguments[option.name]) && + if (!(commandArguments[option.name] == null) && (option.type !== "stringOrEmpty" && commandArguments[option.name] === "") || (option.type !== "boolean" && commandArguments[option.name] === true)) { valid = false; @@ -143,7 +143,7 @@ export class SyntaxValidator { * Imperative gets a chance to detect them. */ if (this.mCommandDefinition.type === "command" && - !isNullOrUndefined(this.mCommandDefinition.name) && + !(this.mCommandDefinition.name == null) && commandArguments._.length > expectedUnderscoreLength) { valid = false; this.unknownPositionalError(responseObject, commandArguments, expectedUnderscoreLength); @@ -202,7 +202,7 @@ export class SyntaxValidator { * we would like to have more syntax validation and control over the error message. Therefore, the mark them * as "optional" to yargs and enforce the required here. */ - if (!isNullOrUndefined(this.mCommandDefinition.positionals) && this.mCommandDefinition.positionals.length > 0) { + if (!(this.mCommandDefinition.positionals == null) && this.mCommandDefinition.positionals.length > 0) { const missingPositionals: ICommandPositionalDefinition[] = []; for (const positional of this.mCommandDefinition.positionals) { if (positional.required) { @@ -223,10 +223,10 @@ export class SyntaxValidator { * Validate that the positional parameter matches the supplied regex. */ for (const positional of this.mCommandDefinition.positionals) { - if (!isNullOrUndefined(commandArguments[positional.name])) { + if (!(commandArguments[positional.name] == null)) { if (positional.regex) { - if (isNullOrUndefined(commandArguments[positional.name] - .toString().match(new RegExp(positional.regex)))) { + if (commandArguments[positional.name] + .toString().match(new RegExp(positional.regex)) == null) { valid = false; this.positionalParameterInvalid(positional, commandArguments[positional.name], responseObject); @@ -236,9 +236,9 @@ export class SyntaxValidator { valid = this.validateNumeric(commandArguments[positional.name], positional, responseObject, true) && valid; } - if (!isNullOrUndefined(positional.stringLengthRange) && - !isNullOrUndefined(positional.stringLengthRange[0]) && - !isNullOrUndefined(positional.stringLengthRange[1])) { + if (!(positional.stringLengthRange == null) && + !(positional.stringLengthRange[0] == null) && + !(positional.stringLengthRange[1] == null)) { valid = this.validateOptionValueLength(positional, commandArguments[positional.name], responseObject, true) && valid; } } @@ -261,7 +261,7 @@ export class SyntaxValidator { * If omitting an option implies that some other option must be specified, * validate that with any missing options */ - if (!isNullOrUndefined(optionDef.absenceImplications) && optionDef.absenceImplications.length > 0) { + if (!(optionDef.absenceImplications == null) && optionDef.absenceImplications.length > 0) { for (const implication of optionDef.absenceImplications) { if (!util.optionWasSpecified(optionName, this.mCommandDefinition, commandArguments) && !util.optionWasSpecified(implication, this.mCommandDefinition, commandArguments)) { @@ -293,7 +293,7 @@ export class SyntaxValidator { } // check if the value of the option conforms to the allowableValues (if any) - if (!isNullOrUndefined(optionDef.allowableValues)) { + if (!(optionDef.allowableValues == null)) { // Make a copy of optionDef, so that modifications below are only used in this place const optionDefCopy: ICommandOptionDefinition = JSON.parse(JSON.stringify(optionDef)); // Use modified regular expressions for allowable values to check and to generate error @@ -320,7 +320,7 @@ export class SyntaxValidator { }); } - if (!isNullOrUndefined(optionDef.conflictsWith) && optionDef.conflictsWith.length > 0) { + if (!(optionDef.conflictsWith == null) && optionDef.conflictsWith.length > 0) { for (const conflict of optionDef.conflictsWith) { if (util.optionWasSpecified(conflict, this.mCommandDefinition, commandArguments)) { this.optionCombinationInvalidError(optionDef, @@ -333,7 +333,7 @@ export class SyntaxValidator { /** * Check validity of implications */ - if (!isNullOrUndefined(optionDef.implies) && optionDef.implies.length > 0) { + if (!(optionDef.implies == null) && optionDef.implies.length > 0) { for (const implication of optionDef.implies) { if (!util.optionWasSpecified(implication, this.mCommandDefinition, commandArguments)) { this.optionDependencyError(optionDef, this.mOptionDefinitionsMap[implication], @@ -346,7 +346,7 @@ export class SyntaxValidator { /** * Check validity of 'implication alternatives' (.impliesOneOf()) */ - if (!isNullOrUndefined(optionDef.impliesOneOf) && optionDef.impliesOneOf.length > 0) { + if (!(optionDef.impliesOneOf == null) && optionDef.impliesOneOf.length > 0) { let implicationSatisfied = false; for (const implication of optionDef.impliesOneOf) { if (util.optionWasSpecified(implication, this.mCommandDefinition, commandArguments)) { @@ -395,9 +395,9 @@ export class SyntaxValidator { /** * Validate option values */ - if (!isNullOrUndefined(optionDef.numericValueRange) && - !isNullOrUndefined(optionDef.numericValueRange[0]) && - !isNullOrUndefined(optionDef.numericValueRange[1])) { + if (!(optionDef.numericValueRange == null) && + !(optionDef.numericValueRange[0] == null) && + !(optionDef.numericValueRange[1] == null)) { valid = this.validateOptionValueRange(optionDef, commandArguments[optionDef.name], responseObject) && valid; } @@ -405,9 +405,9 @@ export class SyntaxValidator { /** * Validate option lengths */ - if (!isNullOrUndefined(optionDef.stringLengthRange) && - !isNullOrUndefined(optionDef.stringLengthRange[0]) && - !isNullOrUndefined(optionDef.stringLengthRange[1])) { + if (!(optionDef.stringLengthRange == null) && + !(optionDef.stringLengthRange[0] == null) && + !(optionDef.stringLengthRange[1] == null)) { valid = this.validateOptionValueLength(optionDef, commandArguments[optionDef.name], responseObject) && valid; } @@ -422,7 +422,7 @@ export class SyntaxValidator { } } - if (!isNullOrUndefined(optionDef.valueImplications) && Object.keys(optionDef.valueImplications).length > 0) { + if (!(optionDef.valueImplications == null) && Object.keys(optionDef.valueImplications).length > 0) { for (const value of Object.keys(optionDef.valueImplications)) { const implicationObject: ICommandOptionValueImplications = optionDef.valueImplications[value]; @@ -504,7 +504,7 @@ export class SyntaxValidator { if (!isPositional) { const def = optionDefinition as ICommandOptionDefinition; - aliasString = (!isNullOrUndefined(def.aliases) && def.aliases.length > 0) ? + aliasString = (!(def.aliases == null) && def.aliases.length > 0) ? "(" + def.aliases.map((alias: string) => { return this.getDashFormOfOption(alias); }).join(",") + ")" : ""; diff --git a/packages/imperative/src/cmd/src/syntax/__tests__/SyntaxValidator.unit.test.ts b/packages/imperative/src/cmd/src/syntax/__tests__/SyntaxValidator.unit.test.ts index 1619a3fa51..2d8c31330c 100644 --- a/packages/imperative/src/cmd/src/syntax/__tests__/SyntaxValidator.unit.test.ts +++ b/packages/imperative/src/cmd/src/syntax/__tests__/SyntaxValidator.unit.test.ts @@ -13,7 +13,7 @@ import { TextUtils } from "../../../../utilities"; jest.mock("../../../../imperative/src/Imperative"); -import { inspect, isNullOrUndefined } from "util"; +import { inspect } from "util"; import { TestLogger } from "../../../../../__tests__/src/TestLogger"; import { CommandResponse, ICommandDefinition, ICommandValidatorResponse } from "../../../"; import { ValidationTestCommand } from "../../../../../__tests__/src/packages/cmd/ValidationTestCommand"; @@ -52,7 +52,7 @@ describe("Imperative should provide advanced syntax validation rules", () => { } else { expect(validationResponse.valid).toEqual(false); } - if (!isNullOrUndefined(expectedText) && expectedText.length > 0) { + if (!(expectedText == null) && expectedText.length > 0) { const fullText = response.buildJsonResponse().stdout.toString() + response.buildJsonResponse().stderr.toString(); for (const text of expectedText) { expect(fullText).toContain(text); diff --git a/packages/imperative/src/cmd/src/utils/CommandUtils.ts b/packages/imperative/src/cmd/src/utils/CommandUtils.ts index 8b3dbf75f2..d36cac17de 100644 --- a/packages/imperative/src/cmd/src/utils/CommandUtils.ts +++ b/packages/imperative/src/cmd/src/utils/CommandUtils.ts @@ -10,7 +10,6 @@ */ import { Arguments } from "yargs"; -import { isNullOrUndefined } from "util"; import { ICommandDefinition } from "../doc/ICommandDefinition"; import { ICommandOptionDefinition } from "../doc/option/ICommandOptionDefinition"; import { CliUtils } from "../../../utilities/src/CliUtils"; @@ -56,9 +55,9 @@ export class CommandUtils { for (const option of options) { aliases.push(...option.aliases); } - if (!isNullOrUndefined(commandDefinition.positionals)) { + if (!(commandDefinition.positionals == null)) { for (const positional of commandDefinition.positionals) { - if (!isNullOrUndefined(commandArguments[positional.name])) { + if (!(commandArguments[positional.name] == null)) { command += " \"" + commandArguments[positional.name] + "\""; } } @@ -84,7 +83,7 @@ export class CommandUtils { */ public static optionWasSpecified(optionName: string, commandDefinition: ICommandDefinition, args: ICommandArguments["args"]): boolean { const optionDef = CommandUtils.getOptionDefinitionFromName(optionName, commandDefinition); - if (isNullOrUndefined(optionDef)) { + if (optionDef == null) { // if it's not an option, it's not specified return false; } @@ -92,7 +91,7 @@ export class CommandUtils { return args[optionName] !== undefined; } else { - return !isNullOrUndefined(args[optionName]); + return !(args[optionName] == null); } } @@ -106,7 +105,7 @@ export class CommandUtils { public static getOptionDefinitionFromName(optionName: string, commandDefinition: ICommandDefinition) { let optionDef: ICommandOptionDefinition; - if (!isNullOrUndefined(commandDefinition.options)) { + if (!(commandDefinition.options == null)) { for (const option of commandDefinition.options) { if (option.name === optionName) { optionDef = option; diff --git a/packages/imperative/src/cmd/src/utils/SharedOptions.ts b/packages/imperative/src/cmd/src/utils/SharedOptions.ts index 8ef5b81ff5..f23e96696d 100644 --- a/packages/imperative/src/cmd/src/utils/SharedOptions.ts +++ b/packages/imperative/src/cmd/src/utils/SharedOptions.ts @@ -13,7 +13,6 @@ import { Arguments } from "yargs"; import { ICommandNodeType } from "../doc/ICommandDefinition"; import { IImperativeError, ImperativeError } from "../../../error"; import { Constants } from "../../../constants"; -import { isNullOrUndefined } from "util"; import { CommandResponse } from "../response/CommandResponse"; import { Logger } from "../../../logger"; @@ -97,7 +96,7 @@ export class SharedOptions { const stdinReadError: IImperativeError = { msg: "Error encountered while reading from stdin", causeErrors: error, - additionalDetails: (isNullOrUndefined(error)) ? undefined : error.message + additionalDetails: (error == null) ? undefined : error.message }; done(stdinReadError, true); // don't call done, we don't want to continue on an error diff --git a/packages/imperative/src/cmd/src/yargs/CommandYargs.ts b/packages/imperative/src/cmd/src/yargs/CommandYargs.ts index ea39340989..5483a36956 100644 --- a/packages/imperative/src/cmd/src/yargs/CommandYargs.ts +++ b/packages/imperative/src/cmd/src/yargs/CommandYargs.ts @@ -10,7 +10,7 @@ */ import { Arguments, Argv, Options } from "yargs"; -import { isNullOrUndefined, inspect } from "util"; +import { inspect } from "util"; import { Constants } from "../../../constants"; import { IYargsResponse } from "./doc/IYargsResponse"; import { AbstractCommandYargs, YargsCommandCompleted } from "./AbstractCommandYargs"; @@ -32,13 +32,13 @@ export class CommandYargs extends AbstractCommandYargs { * @param {ICommandOptionDefinition[]} brightOptions: The option definition document array. */ public static defineOptionsToYargs(yargsInstance: Argv, brightOptions: ICommandOptionDefinition[]): void { - if (!isNullOrUndefined(brightOptions)) { + if (!(brightOptions == null)) { for (const option of brightOptions) { const definition: Options = { alias: option.aliases, description: option.description }; - if (!isNullOrUndefined(option.type)) { + if (!(option.type == null)) { // don't let yargs handle any types that we are validating ourselves // and don't use custom types as the yargs type since yargs won't understand if (option.type !== "number" && @@ -119,7 +119,7 @@ export class CommandYargs extends AbstractCommandYargs { const handlerDefinition: any[] = []; for (const parent of this.parents) { const definition: any = parent.definition; - if (!isNullOrUndefined(definition.handler)) { + if (!(definition.handler == null)) { handlerDefinition.push(definition); } } diff --git a/packages/imperative/src/config/__tests__/Config.api.unit.test.ts b/packages/imperative/src/config/__tests__/Config.api.unit.test.ts index 120166a7df..d543a981ea 100644 --- a/packages/imperative/src/config/__tests__/Config.api.unit.test.ts +++ b/packages/imperative/src/config/__tests__/Config.api.unit.test.ts @@ -220,11 +220,13 @@ describe("Config API tests", () => { it("should expand a short proeprty path", async () => { const config = await Config.load(MY_APP); const profilePath = "lpar1.zosmf"; + // eslint-disable-next-line deprecation/deprecation expect(config.api.profiles.expandPath(profilePath)).toEqual("profiles.lpar1.profiles.zosmf"); }); it("should expand a path with the keyword profiles", async () => { const config = await Config.load(MY_APP); const profilePath = "profiles.zosmf"; + // eslint-disable-next-line deprecation/deprecation expect(config.api.profiles.expandPath(profilePath)).toEqual("profiles.profiles.profiles.zosmf"); }); }); diff --git a/packages/imperative/src/config/src/ProfileInfo.ts b/packages/imperative/src/config/src/ProfileInfo.ts index 9011272c99..ec35a9f5d6 100644 --- a/packages/imperative/src/config/src/ProfileInfo.ts +++ b/packages/imperative/src/config/src/ProfileInfo.ts @@ -190,6 +190,7 @@ export class ProfileInfo { this.mOverrideWithEnv = profInfoOpts.overrideWithEnv; } + // eslint-disable-next-line deprecation/deprecation this.mCredentials = new ProfileCredentials(this, profInfoOpts?.requireKeytar ?? profInfoOpts); // do enough Imperative stuff to let imperative utilities work diff --git a/packages/imperative/src/expect/src/ImperativeExpect.ts b/packages/imperative/src/expect/src/ImperativeExpect.ts index 4aab004e5b..5e3cdf5e79 100644 --- a/packages/imperative/src/expect/src/ImperativeExpect.ts +++ b/packages/imperative/src/expect/src/ImperativeExpect.ts @@ -10,7 +10,7 @@ */ import { ImperativeError } from "../../error"; -import { inspect, isNullOrUndefined } from "util"; +import { inspect } from "util"; const DataObjectParser = require("dataobject-parser"); @@ -101,7 +101,7 @@ export class ImperativeExpect { * @memberof ImperativeExpect */ public static toNotBeNullOrUndefined(obj: any, msg?: string) { - if (isNullOrUndefined(obj)) { + if (obj == null) { throw new ImperativeError({msg: msg || "Required object must be defined"}, {tag: ImperativeExpect.ERROR_TAG}); } @@ -127,7 +127,7 @@ export class ImperativeExpect { break; } } - if (isNullOrUndefined(foundEntry)) { + if (foundEntry == null) { throw new ImperativeError({ msg: msg || "The required entry was NOT found within the input array: " + arr.map((entry) => inspect(entry)) @@ -182,7 +182,7 @@ export class ImperativeExpect { ImperativeExpect.toNotBeNullOrUndefined(obj, msg); const objParser = new DataObjectParser(obj); keys.forEach((key) => { - if (isNullOrUndefined(objParser.get(key))) { + if (objParser.get(key) == null) { throw new ImperativeError({msg: msg || "Required parameter '" + key + "' must be defined"}, {tag: ImperativeExpect.ERROR_TAG}); } @@ -209,7 +209,7 @@ export class ImperativeExpect { ImperativeExpect.toNotBeNullOrUndefined(obj, msg); const objParser = new DataObjectParser(obj); keys.forEach((key) => { - if (isNullOrUndefined(objParser.get(key))) { + if (objParser.get(key) == null) { throw new ImperativeError({msg: msg || "Required parameter '" + key + "' must be defined"}, {tag: ImperativeExpect.ERROR_TAG}); } @@ -290,7 +290,7 @@ export class ImperativeExpect { public static keysToBeUndefined(obj: { [key: string]: any }, keys: string[], msg?: string) { ImperativeExpect.toNotBeNullOrUndefined(obj, msg); keys.forEach((key) => { - if (!isNullOrUndefined(obj[key])) { + if (!(obj[key] == null)) { throw new ImperativeError({msg: "Required parameter '" + key + "' must be undefined"}, {tag: ImperativeExpect.ERROR_TAG}); } diff --git a/packages/imperative/src/imperative/__tests__/Imperative.unit.test.ts b/packages/imperative/src/imperative/__tests__/Imperative.unit.test.ts index a35f520902..e54322d645 100644 --- a/packages/imperative/src/imperative/__tests__/Imperative.unit.test.ts +++ b/packages/imperative/src/imperative/__tests__/Imperative.unit.test.ts @@ -21,6 +21,7 @@ import * as yargs from "yargs"; import { ImperativeError } from "../../error/src/ImperativeError"; describe("Imperative", () => { + // eslint-disable-next-line deprecation/deprecation const mainModule = process.mainModule; const loadImperative = () => { @@ -133,6 +134,7 @@ describe("Imperative", () => { }; beforeEach(() => { + // eslint-disable-next-line deprecation/deprecation (process.mainModule as any) = { filename: __filename }; @@ -151,6 +153,7 @@ describe("Imperative", () => { }); afterEach(() => { + // eslint-disable-next-line deprecation/deprecation process.mainModule = mainModule; }); diff --git a/packages/imperative/src/imperative/__tests__/OverridesLoader.unit.test.ts b/packages/imperative/src/imperative/__tests__/OverridesLoader.unit.test.ts index 1bc0f3ae2e..73870fe00a 100644 --- a/packages/imperative/src/imperative/__tests__/OverridesLoader.unit.test.ts +++ b/packages/imperative/src/imperative/__tests__/OverridesLoader.unit.test.ts @@ -23,6 +23,7 @@ import { AppSettings } from "../../settings"; const TEST_MANAGER_NAME = "test manager"; describe("OverridesLoader", () => { + // eslint-disable-next-line deprecation/deprecation const mainModule = process.mainModule; const mockCredMgrInitialized = jest.fn().mockReturnValue(false); @@ -33,12 +34,14 @@ describe("OverridesLoader", () => { beforeEach(() => { jest.restoreAllMocks(); jest.resetAllMocks(); + // eslint-disable-next-line deprecation/deprecation (process.mainModule as any) = { filename: __filename }; }); afterEach(() => { + // eslint-disable-next-line deprecation/deprecation process.mainModule = mainModule; }); @@ -215,6 +218,7 @@ describe("OverridesLoader", () => { // DON'T YOU EVER DO THIS AFTER THE SPY, IT WILL CAUSE YOU MASSIVE PROBLEMS // I suspect that process.mainModule.filename somehow uses path.resolve (25 times when I ran this) + // eslint-disable-next-line deprecation/deprecation const expectedArgs = [process.mainModule.filename, "../", config.overrides.CredentialManager]; const expectedLocation = "/some/random/dummy/location/DummyFile.ts"; diff --git a/packages/imperative/src/imperative/__tests__/plugins/PluginManagementFacility.unit.test.ts b/packages/imperative/src/imperative/__tests__/plugins/PluginManagementFacility.unit.test.ts index ea9ef295ef..09bf320951 100644 --- a/packages/imperative/src/imperative/__tests__/plugins/PluginManagementFacility.unit.test.ts +++ b/packages/imperative/src/imperative/__tests__/plugins/PluginManagementFacility.unit.test.ts @@ -738,6 +738,7 @@ describe("Plugin Management Facility", () => { it("should not record warning if pluginHealthCheck property does not exist", () => { // remove pluginHealthCheck property from config badPluginConfig = JSON.parse(JSON.stringify(basePluginConfig)); + // eslint-disable-next-line deprecation/deprecation delete badPluginConfig.pluginHealthCheck; badPluginCfgProps = JSON.parse(JSON.stringify(basePluginCfgProps)); badPluginCfgProps.impConfig = badPluginConfig; @@ -759,6 +760,7 @@ describe("Plugin Management Facility", () => { it("should not record error if pluginHealthCheck file does not exist", () => { // set pluginHealthCheck property to a bogus file badPluginConfig = JSON.parse(JSON.stringify(basePluginConfig)); + // eslint-disable-next-line deprecation/deprecation badPluginConfig.pluginHealthCheck = "./This/File/Does/Not/Exist"; badPluginCfgProps = JSON.parse(JSON.stringify(basePluginCfgProps)); badPluginCfgProps.impConfig = badPluginConfig; diff --git a/packages/imperative/src/imperative/__tests__/plugins/PluginRequireProvider.unit.test.ts b/packages/imperative/src/imperative/__tests__/plugins/PluginRequireProvider.unit.test.ts index 171732b90a..a1933be968 100644 --- a/packages/imperative/src/imperative/__tests__/plugins/PluginRequireProvider.unit.test.ts +++ b/packages/imperative/src/imperative/__tests__/plugins/PluginRequireProvider.unit.test.ts @@ -429,6 +429,7 @@ describe("PluginRequireProvider", () => { try { // The return should be the main module as that is what the module loader does. + // eslint-disable-next-line deprecation/deprecation expect(modulePrototype.require.call(thisObject, module, testRequireIndicator)).toBe(process.mainModule); // Expect that the require was just called with the module @@ -442,6 +443,7 @@ describe("PluginRequireProvider", () => { const submodule = `${module}/submodule/import`; expect(modulePrototype.require.call( thisObject, submodule, testRequireIndicator + // eslint-disable-next-line deprecation/deprecation )).toBe(process.mainModule); // Expect that the require was just called with the submodule @@ -475,6 +477,7 @@ describe("PluginRequireProvider", () => { try { expect(modulePrototype.require.call( thisObject, module, testRequireIndicator + // eslint-disable-next-line deprecation/deprecation )).toBe(process.mainModule); expect(mockedRequire).toHaveBeenCalledTimes(1); @@ -506,6 +509,7 @@ describe("PluginRequireProvider", () => { try { expect(modulePrototype.require.call( thisObject, module + submoduleImport, testRequireIndicator + // eslint-disable-next-line deprecation/deprecation )).toBe(process.mainModule); expect(mockedRequire).toHaveBeenCalledTimes(1); diff --git a/packages/imperative/src/imperative/__tests__/plugins/utilities/runValidatePlugin.unit.test.ts b/packages/imperative/src/imperative/__tests__/plugins/utilities/runValidatePlugin.unit.test.ts index 1f5ae7e922..bd05515633 100644 --- a/packages/imperative/src/imperative/__tests__/plugins/utilities/runValidatePlugin.unit.test.ts +++ b/packages/imperative/src/imperative/__tests__/plugins/utilities/runValidatePlugin.unit.test.ts @@ -31,15 +31,18 @@ const spawnSyncOutput = { }; describe("runValidatePlugin", () => { + // eslint-disable-next-line deprecation/deprecation const mainModule = process.mainModule; beforeEach(() => { + // eslint-disable-next-line deprecation/deprecation (process.mainModule as any) = { filename: __filename }; }); afterEach(() => { + // eslint-disable-next-line deprecation/deprecation process.mainModule = mainModule; mocks.spawnSync.mockReset(); }); diff --git a/packages/imperative/src/imperative/src/ConfigurationValidator.ts b/packages/imperative/src/imperative/src/ConfigurationValidator.ts index e4054d6da3..701d748e96 100644 --- a/packages/imperative/src/imperative/src/ConfigurationValidator.ts +++ b/packages/imperative/src/imperative/src/ConfigurationValidator.ts @@ -10,7 +10,6 @@ */ import { IImperativeConfig } from "./doc/IImperativeConfig"; -import { isNullOrUndefined } from "util"; import { TextUtils } from "../../utilities"; import { ImperativeError } from "../../error"; import { ICommandProfileProperty } from "../../cmd/src/doc/profiles/definition/ICommandProfileProperty"; @@ -34,10 +33,10 @@ export class ConfigurationValidator { + fieldName + ". Please provide this field in order to use Imperative" }); }; - if (isNullOrUndefined(config.productDisplayName)) { + if (config.productDisplayName == null) { throw getMissingFieldError("productDisplayName"); } - if (isNullOrUndefined(config.commandModuleGlobs) && isNullOrUndefined(config.definitions)) { + if (config.commandModuleGlobs == null && config.definitions == null) { throw new ImperativeError({ msg: "Your Imperative configuration had neither \"definitions\"" + " nor \"commandModuleGlobs\". At least one of these fields is required so that the syntax for " + @@ -45,31 +44,31 @@ export class ConfigurationValidator { }); } - if (isNullOrUndefined(config.primaryTextColor)) { + if (config.primaryTextColor == null) { config.primaryTextColor = "yellow"; } else { // if the user specified a color, test to make sure it works ConfigurationValidator.verifyChalkColor(config, "primaryTextColor", "primary text highlighting"); } - if (isNullOrUndefined(config.secondaryTextColor)) { + if (config.secondaryTextColor == null) { config.secondaryTextColor = "blue"; } else { // if the user specified a color, test to make sure it works ConfigurationValidator.verifyChalkColor(config, "secondaryTextColor", "secondary text highlighting"); } - if (isNullOrUndefined(config.allowConfigGroup)) { + if (config.allowConfigGroup == null) { // default allowConfigGroup to true config.allowConfigGroup = true; } - if (isNullOrUndefined(config.allowPlugins)) { + if (config.allowPlugins == null) { // default allowPlugins to true config.allowPlugins = true; } // validate profile configurations - if (!isNullOrUndefined(config.profiles)) { + if (!(config.profiles == null)) { for (const profileConfig of config.profiles) { - if (isNullOrUndefined(profileConfig.schema)) { + if (profileConfig.schema == null) { throw new ImperativeError({ msg: "Your Imperative profile configuration of type \"" + profileConfig.type + "\" has no schema. Please provide a schema for your profile so that it can be used to " + @@ -80,9 +79,9 @@ export class ConfigurationValidator { for (const propertyName of Object.keys(profileConfig.schema.properties)) { const property: ICommandProfileProperty = profileConfig.schema.properties[propertyName]; - if (!isNullOrUndefined(property.optionDefinitions) && + if (!(property.optionDefinitions == null) && property.optionDefinitions.length > 1 && - isNullOrUndefined(profileConfig.createProfileFromArgumentsHandler)) { + profileConfig.createProfileFromArgumentsHandler == null) { throw new ImperativeError({ msg: TextUtils.formatMessage( "Your Imperative profile configuration of type \"{{type}}\"" + diff --git a/packages/imperative/src/imperative/src/Imperative.ts b/packages/imperative/src/imperative/src/Imperative.ts index 4eafe5ee27..673b43c142 100644 --- a/packages/imperative/src/imperative/src/Imperative.ts +++ b/packages/imperative/src/imperative/src/Imperative.ts @@ -133,6 +133,7 @@ export class Imperative { /** * Identify caller's location on the system */ + // eslint-disable-next-line deprecation/deprecation ImperativeConfig.instance.callerLocation = process.mainModule.filename; /** diff --git a/packages/imperative/src/imperative/src/LoggingConfigurer.ts b/packages/imperative/src/imperative/src/LoggingConfigurer.ts index 6e5a1db3c0..bdd526d22c 100644 --- a/packages/imperative/src/imperative/src/LoggingConfigurer.ts +++ b/packages/imperative/src/imperative/src/LoggingConfigurer.ts @@ -14,7 +14,6 @@ import { Logger } from "../../logger/src/Logger"; import { LoggerConfigBuilder } from "../../logger/src/LoggerConfigBuilder"; import { IImperativeConfig } from "./doc/IImperativeConfig"; import { Console } from "../../console"; -import { isNullOrUndefined } from "util"; import { IO } from "../../io/src/IO"; import { IImperativeLoggingConfig } from "./doc/IImperativeLoggingConfig"; import { ImperativeError } from "../../error/src/ImperativeError"; @@ -89,9 +88,9 @@ export class LoggingConfigurer { /** * All remaining logs are created here */ - if (!isNullOrUndefined(imperativeConfig.logging.additionalLogging)) { + if (!(imperativeConfig.logging.additionalLogging == null)) { imperativeConfig.logging.additionalLogging.forEach((logConfig) => { - if (isNullOrUndefined(logConfig.apiName)) { + if (logConfig.apiName == null) { throw new ImperativeError({ msg: "apiName is required for additionalLoggers", }); @@ -160,8 +159,8 @@ export class LoggingConfigurer { */ private static configureLoggerByKey( home: string, imperativeConfig: IImperativeConfig, loggingConfig: IConfigLogging, entryKey: string, configKey: string) { - if (!isNullOrUndefined(imperativeConfig.logging)) { - if (!isNullOrUndefined(imperativeConfig.logging[configKey])) { + if (!(imperativeConfig.logging == null)) { + if (!(imperativeConfig.logging[configKey] == null)) { loggingConfig = LoggingConfigurer.configureLoggerByKeyHelper( home, imperativeConfig.logging[configKey], loggingConfig, entryKey, configKey); } @@ -184,12 +183,12 @@ export class LoggingConfigurer { */ private static configureLoggerByKeyHelper(home: string, impLogConfig: IImperativeLoggingConfig, loggingConfig: IConfigLogging, entryKey: string, configKey: string) { - if (!isNullOrUndefined(impLogConfig.logFile)) { + if (!(impLogConfig.logFile == null)) { const fullLogFilePath = home + LoggingConfigurer.normalizeDir(impLogConfig.logFile); loggingConfig.log4jsConfig.appenders[entryKey].filename = fullLogFilePath as any; } - if (!isNullOrUndefined(impLogConfig.level)) { + if (!(impLogConfig.level == null)) { Console.validateLevel(impLogConfig.level); loggingConfig.log4jsConfig.categories[entryKey].level = impLogConfig.level; } @@ -269,11 +268,11 @@ export class LoggingConfigurer { */ private static buildLoggingDefaultsByKey( imperativeConfig: IImperativeConfig, key: string, apiName: string, category = apiName): IImperativeConfig { - if (isNullOrUndefined(imperativeConfig.logging)) { + if (imperativeConfig.logging == null) { imperativeConfig.logging = {}; imperativeConfig.logging[key] = {apiName, category}; } else { - if (isNullOrUndefined(imperativeConfig.logging[key])) { + if (imperativeConfig.logging[key] == null) { imperativeConfig.logging[key] = {apiName, category}; } else { imperativeConfig.logging[key].apiName = apiName; diff --git a/packages/imperative/src/imperative/src/OverridesLoader.ts b/packages/imperative/src/imperative/src/OverridesLoader.ts index 1e72675441..0cc865bed3 100644 --- a/packages/imperative/src/imperative/src/OverridesLoader.ts +++ b/packages/imperative/src/imperative/src/OverridesLoader.ts @@ -82,6 +82,7 @@ export class OverridesLoader { if (overrides.CredentialManager != null || this.shouldUseKeytar(packageJson, useTeamConfig)) { let Manager = overrides.CredentialManager; if (typeof overrides.CredentialManager === "string" && !isAbsolute(overrides.CredentialManager)) { + // eslint-disable-next-line deprecation/deprecation Manager = resolve(process.mainModule.filename, "../", overrides.CredentialManager); } diff --git a/packages/imperative/src/imperative/src/auth/handlers/AbstractAuthHandler.ts b/packages/imperative/src/imperative/src/auth/handlers/AbstractAuthHandler.ts index 107ebf2bda..9192694a52 100644 --- a/packages/imperative/src/imperative/src/auth/handlers/AbstractAuthHandler.ts +++ b/packages/imperative/src/imperative/src/auth/handlers/AbstractAuthHandler.ts @@ -68,6 +68,7 @@ export abstract class AbstractAuthHandler implements ICommandHandler { * - Options for adding connection properties * - The login handler */ + // eslint-disable-next-line deprecation/deprecation public abstract getPromptParams(): [IOptionsForAddConnProps, (session: AbstractSession) => Promise]; /** diff --git a/packages/imperative/src/imperative/src/auth/handlers/BaseAuthHandler.ts b/packages/imperative/src/imperative/src/auth/handlers/BaseAuthHandler.ts index e0d1ff13fd..d7115b4ad2 100644 --- a/packages/imperative/src/imperative/src/auth/handlers/BaseAuthHandler.ts +++ b/packages/imperative/src/imperative/src/auth/handlers/BaseAuthHandler.ts @@ -288,6 +288,7 @@ export abstract class BaseAuthHandler extends AbstractAuthHandler { /* Methods for old-school profiles below */ private async processLoginOld(params: IHandlerParameters, tokenValue: string) { + // eslint-disable-next-line deprecation/deprecation const loadedProfile = params.profiles.getMeta(this.mProfileType, false); let profileWithToken: string = null; @@ -345,6 +346,7 @@ export abstract class BaseAuthHandler extends AbstractAuthHandler { } private async processLogoutOld(params: IHandlerParameters) { + // eslint-disable-next-line deprecation/deprecation const loadedProfile = params.profiles.getMeta(this.mProfileType, false); // If you specified a token on the command line, then don't delete the one in the profile if it doesn't match diff --git a/packages/imperative/src/imperative/src/config/cmd/convert-profiles/convert-profiles.handler.ts b/packages/imperative/src/imperative/src/config/cmd/convert-profiles/convert-profiles.handler.ts index 966ff24249..df0bf06fcc 100644 --- a/packages/imperative/src/imperative/src/config/cmd/convert-profiles/convert-profiles.handler.ts +++ b/packages/imperative/src/imperative/src/config/cmd/convert-profiles/convert-profiles.handler.ts @@ -259,7 +259,9 @@ export default class ConvertProfilesHandler implements ICommandHandler { private async checkKeytarAvailable(): Promise { let success: boolean = false; const requireOpts: any = {}; + // eslint-disable-next-line deprecation/deprecation if (process.mainModule?.filename != null) { + // eslint-disable-next-line deprecation/deprecation requireOpts.paths = [process.mainModule.filename]; } try { diff --git a/packages/imperative/src/imperative/src/help/ImperativeHelpGeneratorFactory.ts b/packages/imperative/src/imperative/src/help/ImperativeHelpGeneratorFactory.ts index 1443d098ea..3b3d585f30 100644 --- a/packages/imperative/src/imperative/src/help/ImperativeHelpGeneratorFactory.ts +++ b/packages/imperative/src/imperative/src/help/ImperativeHelpGeneratorFactory.ts @@ -9,7 +9,6 @@ * */ -import { isNullOrUndefined } from "util"; import { IHelpGenerator, HelpGeneratorFactory, IHelpGeneratorParms, @@ -57,7 +56,7 @@ export class ImperativeHelpGeneratorFactory extends AbstractHelpGeneratorFactory fullCommandTree: parms.fullCommandTree, experimentalCommandsDescription: parms.experimentalCommandsDescription }; - if (isNullOrUndefined(this.config)) { + if (this.config == null) { return new HelpGeneratorFactory({ produceMarkdown: this.produceMarkdown, primaryHighlightColor: this.primaryHighlightColor, diff --git a/packages/imperative/src/imperative/src/plugins/PluginRequireProvider.ts b/packages/imperative/src/imperative/src/plugins/PluginRequireProvider.ts index be062c62dd..2b756ccd32 100644 --- a/packages/imperative/src/imperative/src/plugins/PluginRequireProvider.ts +++ b/packages/imperative/src/imperative/src/plugins/PluginRequireProvider.ts @@ -180,6 +180,7 @@ export class PluginRequireProvider { } // Inject it from the main module dependencies + // eslint-disable-next-line deprecation/deprecation return origRequire.apply(process.mainModule, args); } else { // Otherwise use the package dependencies diff --git a/packages/imperative/src/imperative/src/profiles/builders/ProfilesCommandBuilder.ts b/packages/imperative/src/imperative/src/profiles/builders/ProfilesCommandBuilder.ts index afe358d5e3..0f2e8ee24e 100644 --- a/packages/imperative/src/imperative/src/profiles/builders/ProfilesCommandBuilder.ts +++ b/packages/imperative/src/imperative/src/profiles/builders/ProfilesCommandBuilder.ts @@ -10,7 +10,6 @@ */ import { AbstractCommandBuilder } from "../../../../cmd/src/builders/AbstractCommandBuilder"; -import { isNullOrUndefined } from "util"; import { ICommandDefinition, ICommandOptionDefinition, ICommandProfileTypeConfiguration } from "../../../../cmd"; import { Logger } from "../../../../logger"; import { IProfileSchema, ProfileUtils } from "../../../../profiles"; @@ -37,7 +36,7 @@ export abstract class ProfilesCommandBuilder implements AbstractCommandBuilder { protected mProfileConfig: ICommandProfileTypeConfiguration) { this.mSchema = mProfileConfig.schema; - if (isNullOrUndefined(this.mSchema)) { + if (this.mSchema == null) { throw new Error(`Profile Builder Error: No profile schema was supplied.`); } } @@ -81,10 +80,10 @@ export abstract class ProfilesCommandBuilder implements AbstractCommandBuilder { // helper to recursively add any nested option definitions const findAndAddOptions = (propertiesObject: any, propertyName: string) => { const field: ICommandProfileProperty = propertiesObject[propertyName]; - if (!isNullOrUndefined(field.optionDefinition)) { + if (!(field.optionDefinition == null)) { options.push(field.optionDefinition); } - if (!isNullOrUndefined(field.optionDefinitions)) { + if (!(field.optionDefinitions == null)) { options = options.concat(field.optionDefinitions); } if (field.properties != null) { @@ -95,7 +94,7 @@ export abstract class ProfilesCommandBuilder implements AbstractCommandBuilder { }; findAndAddOptions(properties, propName); } - if (!isNullOrUndefined(this.mProfileConfig.dependencies)) { + if (!(this.mProfileConfig.dependencies == null)) { for (const dependency of this.mProfileConfig.dependencies) { const description = dependency.description || "The name of a " + dependency.type + " profile to associate with this profile."; diff --git a/packages/imperative/src/imperative/src/profiles/builders/ProfilesUpdateCommandBuilder.ts b/packages/imperative/src/imperative/src/profiles/builders/ProfilesUpdateCommandBuilder.ts index fb4bccd8c7..947fbb5daa 100644 --- a/packages/imperative/src/imperative/src/profiles/builders/ProfilesUpdateCommandBuilder.ts +++ b/packages/imperative/src/imperative/src/profiles/builders/ProfilesUpdateCommandBuilder.ts @@ -10,7 +10,6 @@ */ import { ProfilesCommandBuilder } from "./ProfilesCommandBuilder"; -import { isNullOrUndefined } from "util"; import { Constants } from "../../../../constants"; import { ICommandDefinition } from "../../../../cmd"; import { createProfileOptionDesc, updateProfileCommandDesc } from "../../../../messages"; @@ -55,14 +54,14 @@ export class ProfilesUpdateCommandBuilder extends ProfilesCommandBuilder { // optional in case the user does not wish to update them) const processFieldsForUpdate = (properties: any, propertyName: string) => { const field: ICommandProfileProperty = properties[propertyName]; - if (!isNullOrUndefined(field.optionDefinition)) { + if (!(field.optionDefinition == null)) { field.optionDefinition.required = false; field.optionDefinition.absenceImplications = null; field.optionDefinition.implies = null; } - if (!isNullOrUndefined(field.optionDefinitions)) { + if (!(field.optionDefinitions == null)) { for (const anOption of field.optionDefinitions) { - if (!isNullOrUndefined(anOption.required)) { + if (!(anOption.required == null)) { anOption.required = false; anOption.absenceImplications = null; anOption.implies = null; diff --git a/packages/imperative/src/imperative/src/profiles/builders/ProfilesValidateCommandBuilder.ts b/packages/imperative/src/imperative/src/profiles/builders/ProfilesValidateCommandBuilder.ts index c8f6113f78..871cbc9217 100644 --- a/packages/imperative/src/imperative/src/profiles/builders/ProfilesValidateCommandBuilder.ts +++ b/packages/imperative/src/imperative/src/profiles/builders/ProfilesValidateCommandBuilder.ts @@ -15,7 +15,6 @@ import { Constants } from "../../../../constants"; import { deleteProfileNameDesc, validateProfileCommandDesc } from "../../../../messages"; import { ImperativeConfig, TextUtils } from "../../../../utilities"; import { Logger } from "../../../../logger/index"; -import { isNullOrUndefined } from "util"; import { ProfilesConstants, ProfileUtils, ProfileValidator } from "../../../../profiles"; /** @@ -55,7 +54,7 @@ export class ProfilesValidateCommandBuilder extends ProfilesCommandBuilder { * @return {ICommandDefinition} */ protected buildProfileSegmentFromSchema(): ICommandDefinition { - if (isNullOrUndefined(this.mProfileConfig.validationPlanModule)) { + if (this.mProfileConfig.validationPlanModule == null) { return undefined; } const profileCommand: ICommandDefinition = { diff --git a/packages/imperative/src/imperative/src/profiles/handlers/ValidateProfileHandler.ts b/packages/imperative/src/imperative/src/profiles/handlers/ValidateProfileHandler.ts index 656000fdba..9900f66c9f 100644 --- a/packages/imperative/src/imperative/src/profiles/handlers/ValidateProfileHandler.ts +++ b/packages/imperative/src/imperative/src/profiles/handlers/ValidateProfileHandler.ts @@ -9,7 +9,6 @@ * */ -import { isNullOrUndefined } from "util"; import { CliProfileManager, ICommandHandler, IHandlerParameters } from "../../../../cmd"; import { IImperativeError, ImperativeError } from "../../../../error"; import { Imperative } from "../../../index"; @@ -85,7 +84,7 @@ export default class ValidateProfileHandler implements ICommandHandler { const cleanTaskForJSONOutput = (task: IProfileValidationTask) => { delete task.taskFunction; - if (!isNullOrUndefined(task.dependentTasks)) { + if (!(task.dependentTasks == null)) { for (const dependent of task.dependentTasks) { cleanTaskForJSONOutput(dependent); } diff --git a/packages/imperative/src/logger/src/Logger.ts b/packages/imperative/src/logger/src/Logger.ts index ce34216391..ffa1011896 100644 --- a/packages/imperative/src/logger/src/Logger.ts +++ b/packages/imperative/src/logger/src/Logger.ts @@ -9,7 +9,7 @@ * */ -import { format, inspect, isNullOrUndefined } from "util"; +import { format, inspect } from "util"; import { ImperativeError } from "../../error/src/ImperativeError"; import * as StackTrace from "stack-trace"; import * as path from "path"; @@ -113,15 +113,15 @@ export class Logger { * @return {[type]} [description] */ public static initLogger(loggingConfig: IConfigLogging) { - if (isNullOrUndefined(loggingConfig)) { + if (loggingConfig == null) { throw new ImperativeError({msg: "Input logging config document is required"}); } - if (isNullOrUndefined(loggingConfig.log4jsConfig)) { + if (loggingConfig.log4jsConfig == null) { throw new ImperativeError({msg: "Input logging config is incomplete, does not contain log4jsConfig"}); } - if (isNullOrUndefined(loggingConfig.log4jsConfig.appenders)) { + if (loggingConfig.log4jsConfig.appenders == null) { throw new ImperativeError({msg: "Input logging config is incomplete, does not contain log4jsConfig.appenders"}); } @@ -297,13 +297,13 @@ export class Logger { public logError(err: ImperativeError): void { this.debug("Stack at time of error logging: %s", new Error().stack); - if (!isNullOrUndefined(err.details.additionalDetails)) { + if (!(err.details.additionalDetails == null)) { this.error(err.details.additionalDetails); } - if (!isNullOrUndefined(err.stack)) { + if (!(err.stack == null)) { this.error(err.stack); } - if (!isNullOrUndefined(err.details.causeErrors) && !isNullOrUndefined(err.details.causeErrors.length) + if (!(err.details.causeErrors == null) && !(err.details.causeErrors.length == null) && err.details.causeErrors.length > 0) { for (const cause of err.details.causeErrors) { this.error("Cause error:\n%s", inspect(cause)); diff --git a/packages/imperative/src/operations/__tests__/__integration__/Operations.integration.spec.ts b/packages/imperative/src/operations/__tests__/__integration__/Operations.integration.spec.ts index b5273a15e6..be637f6505 100644 --- a/packages/imperative/src/operations/__tests__/__integration__/Operations.integration.spec.ts +++ b/packages/imperative/src/operations/__tests__/__integration__/Operations.integration.spec.ts @@ -13,7 +13,6 @@ import { TestOperations1 } from "../operation/TestOperations1"; import { TestOperations4 } from "../operation/TestOperations4"; -import { isNullOrUndefined } from "util"; import { TestOperations3 } from "../operation/TestOperations3"; import { IOperationResult, Operation, Operations } from "../../index"; @@ -305,7 +304,7 @@ describe("Operation Infrastructure", () => { function checkResults(operationActualResults: IOperationResult, operationExpectedResults: Array>) { - if (isNullOrUndefined(operationActualResults)) { + if (operationActualResults == null) { expect(0).toEqual(1); let currentOperationResults: IOperationResult = operationActualResults; for (const result of operationExpectedResults) { @@ -327,7 +326,7 @@ function checkResults(operationActualResults: IOperationResult, currentOperationResults = currentOperationResults.nextOperationResult; } - if (!isNullOrUndefined(currentOperationResults)) { + if (!(currentOperationResults == null)) { // more results than expected - fail expect(0).toEqual(1); } diff --git a/packages/imperative/src/operations/src/Operations.ts b/packages/imperative/src/operations/src/Operations.ts index 4ea02bf2a4..c95f30f6ef 100644 --- a/packages/imperative/src/operations/src/Operations.ts +++ b/packages/imperative/src/operations/src/Operations.ts @@ -11,7 +11,6 @@ import { IOperationResultReady, Operation } from "./Operation"; import { IOperationResult } from "./doc/IOperationResult"; -import { isNullOrUndefined } from "util"; import { TextUtils } from "../../utilities"; import { TaskProgress } from "./TaskProgress"; @@ -109,7 +108,7 @@ export abstract class Operations extends Operation { } public get statusMessage(): string { - if (isNullOrUndefined(this.mOverallStatusMessage)) { + if (this.mOverallStatusMessage == null) { return this.mOperationList[this.mCurrentOperation].statusMessage; } else { @@ -124,7 +123,7 @@ export abstract class Operations extends Operation { */ public get percentComplete(): number { const percentPerOp: number = (TaskProgress.ONE_HUNDRED_PERCENT / this.mOperationList.length); - const currentOpPercentComplete = isNullOrUndefined(this.mOperationList[this.mCurrentOperation].percentComplete) + const currentOpPercentComplete = this.mOperationList[this.mCurrentOperation].percentComplete == null ? 0 : this.mOperationList[this.mCurrentOperation].percentComplete; return Math.ceil(percentPerOp * this.mCurrentOperation + // how many operations completed so far (each 100%) @@ -269,7 +268,7 @@ export abstract class Operations extends Operation { private prepareForUndo(): void { this.log.debug("Building list of undo operation actions"); let currentOperationResult: IOperationResult = this.mOperationResults; - while (!isNullOrUndefined(currentOperationResult)) { + while (!(currentOperationResult == null)) { if (currentOperationResult.operationUndoPossible && !currentOperationResult.operationUndoAttempted) { this.log.debug("Adding operation (" + currentOperationResult.operationName + ") to undo list."); diff --git a/packages/imperative/src/profiles/src/BasicProfileManager.ts b/packages/imperative/src/profiles/src/BasicProfileManager.ts index 75859ef234..1a705a1094 100644 --- a/packages/imperative/src/profiles/src/BasicProfileManager.ts +++ b/packages/imperative/src/profiles/src/BasicProfileManager.ts @@ -29,7 +29,6 @@ import { } from "./doc"; import { ImperativeExpect } from "../../expect"; -import { isNullOrUndefined } from "util"; import { ImperativeError } from "../../error"; import { ProfileIO } from "./utils"; @@ -83,7 +82,7 @@ export class BasicProfileManager extends Ab ); // Set any defaults - parms.reinitialize = (isNullOrUndefined(parms.reinitialize)) ? false : parms.reinitialize; + parms.reinitialize = (parms.reinitialize == null) ? false : parms.reinitialize; // Create the profile root directory (if necessary) ProfileIO.createProfileDirs(parms.profileRootDirectory); @@ -190,7 +189,7 @@ export class BasicProfileManager extends Ab // Construct a list of promises to load all profiles const promises: Array> = []; const responses: IProfileLoaded[] = []; - if (!isNullOrUndefined(profile.dependencies)) { + if (!(profile.dependencies == null)) { this.log.debug(`Loading dependencies for profile of "${this.profileType}".`); let list: string = ""; for (const dependency of profile.dependencies) { diff --git a/packages/imperative/src/profiles/src/abstract/AbstractProfileManager.ts b/packages/imperative/src/profiles/src/abstract/AbstractProfileManager.ts index 50eaa93ff9..b1240cfd3c 100644 --- a/packages/imperative/src/profiles/src/abstract/AbstractProfileManager.ts +++ b/packages/imperative/src/profiles/src/abstract/AbstractProfileManager.ts @@ -10,7 +10,7 @@ */ import { ImperativeExpect } from "../../../expect"; -import { inspect, isNullOrUndefined, isString } from "util"; +import { inspect } from "util"; import { Logger } from "../../../logger"; import { ImperativeError } from "../../../error"; import * as nodePath from "path"; @@ -200,12 +200,12 @@ export abstract class AbstractProfileManager 0) { const markForDeletionKey = "markedForDelete"; for (const newDependency of newProfile.dependencies) { @@ -606,16 +606,16 @@ export abstract class AbstractProfileManager { - if (Array.isArray(property) && !isString(property)) { + if (Array.isArray(property) && !(typeof property === 'string')) { const newProfileProperty = new DataObjectParser(newProfile).get(propertyPath); // does the array type property appear on the newer profile - if (!isNullOrUndefined(newProfileProperty)) { + if (!(newProfileProperty == null)) { // if so, wipe out the merged array with the value from the newer profile this.log.debug("Replacing array type profile field \"%s\" with new value", propertyPath); new DataObjectParser(mergedProfile).set(propertyPath, newProfileProperty); } - } else if (!isString(property)) { + } else if (!(typeof property === 'string')) { for (const childPropertyName of Object.keys(property)) { // object.keys returns array indices as well, // so we won't recursively call our helper if @@ -654,13 +654,13 @@ export abstract class AbstractProfileManager 0) { + if (!(loadDependenciesResponse == null) && loadDependenciesResponse.length > 0) { loadResponse.dependenciesLoaded = true; loadResponse.dependencyLoadResponses = loadDependenciesResponse; } @@ -1166,7 +1166,7 @@ export abstract class AbstractProfileManager 0) { + if (!(this.profileTypeConfiguration.dependencies == null) && this.profileTypeConfiguration.dependencies.length > 0) { const specifiedDependencies = profile.dependencies || []; for (const dependencyConfig of this.profileTypeConfiguration.dependencies) { // are required dependencies present in the profile? @@ -1202,7 +1202,7 @@ export abstract class AbstractProfileManager { numTasksToComplete++; - if (!isNullOrUndefined(task.dependentTasks)) { + if (!(task.dependentTasks == null)) { for (const dependent of task.dependentTasks) { countTasks(dependent); } @@ -116,7 +115,7 @@ export class ProfileValidator { }; report.taskResults.push(skippedResult); tasksCompleted++; - if (!isNullOrUndefined(dependentTask.dependentTasks)) { + if (!(dependentTask.dependentTasks == null)) { for (const grandDependent of dependentTask.dependentTasks) { skipDependentTask(grandDependent, result); } @@ -136,7 +135,7 @@ export class ProfileValidator { report.taskResults.push(result); log.debug("Profile validation task result: task name: %s, outcome %s, description %s, associated endpoints: %s", result.taskName, this.outcomeToString(result.outcome), result.resultDescription, - (isNullOrUndefined(result.associatedEndpoints) ? "none" : result.associatedEndpoints.join(", "))); + (result.associatedEndpoints == null ? "none" : result.associatedEndpoints.join(", "))); // set the overall status of the validation based on this outcome // only 100% success is considered a successful validation @@ -147,7 +146,7 @@ export class ProfileValidator { // mark the validation failed if any task fails report.overallResult = "Failed"; } - if (!isNullOrUndefined(currentTask.dependentTasks)) { + if (!(currentTask.dependentTasks == null)) { if (result.outcome === "Failed" || result.outcome === "Warning") { log.warn("Parent task %s failed, skipping dependent tasks", currentTask.name); @@ -277,7 +276,7 @@ export class ProfileValidator { Description: description, Endpoint: taskResult.associatedEndpoints ? taskResult.associatedEndpoints.join(", ") : undefined }; - if (isNullOrUndefined(result.Endpoint)) { + if (result.Endpoint == null) { // this prevents the endpoint column from showing up // if there are no endpoints specified delete result.Endpoint; @@ -337,7 +336,7 @@ export class ProfileValidator { const allTasks: IProfileValidationTask[] = []; const addTasks = (task: IProfileValidationTask) => { allTasks.push(task); - if (!isNullOrUndefined(task.dependentTasks)) { + if (!(task.dependentTasks == null)) { for (const dependent of task.dependentTasks) { addTasks(dependent); } diff --git a/packages/imperative/src/rest/__tests__/client/__model__/CustomRestClient.ts b/packages/imperative/src/rest/__tests__/client/__model__/CustomRestClient.ts index e43dea2642..d76e08f1f2 100644 --- a/packages/imperative/src/rest/__tests__/client/__model__/CustomRestClient.ts +++ b/packages/imperative/src/rest/__tests__/client/__model__/CustomRestClient.ts @@ -9,7 +9,6 @@ * */ -import { isNullOrUndefined } from "util"; import { RestClient } from "../../../src/client/RestClient"; import { Headers } from "../../../src/client/Headers"; @@ -29,7 +28,7 @@ export class CustomRestClient extends RestClient { * @memberof ZosmfRestClient */ protected appendHeaders(headers: any[] | undefined): any[] { - if (isNullOrUndefined(headers)) { + if (headers == null) { return [Headers.APPLICATION_JSON]; } else { headers.push(Headers.APPLICATION_JSON); diff --git a/packages/imperative/src/rest/__tests__/client/__model__/MockHttpRequestResponse.ts b/packages/imperative/src/rest/__tests__/client/__model__/MockHttpRequestResponse.ts index 67181c76e1..defc34175d 100644 --- a/packages/imperative/src/rest/__tests__/client/__model__/MockHttpRequestResponse.ts +++ b/packages/imperative/src/rest/__tests__/client/__model__/MockHttpRequestResponse.ts @@ -10,7 +10,6 @@ */ import { EventEmitter } from "events"; -import { isNullOrUndefined } from "util"; /** * Simulate http(s).clientRequest or http(s).clientRequest callback invoked @@ -48,7 +47,7 @@ export class MockHttpRequestResponse extends EventEmitter { * @memberof RequestOrResponse */ get statusCode() { - if (isNullOrUndefined(this.mStatus)) { + if (this.mStatus == null) { this.mStatus = "200"; } return this.mStatus; diff --git a/packages/imperative/src/security/__tests__/DefaultCredentialManager.unit.test.ts b/packages/imperative/src/security/__tests__/DefaultCredentialManager.unit.test.ts index ea415ba2a2..ca4ad370c7 100644 --- a/packages/imperative/src/security/__tests__/DefaultCredentialManager.unit.test.ts +++ b/packages/imperative/src/security/__tests__/DefaultCredentialManager.unit.test.ts @@ -76,7 +76,9 @@ describe("DefaultCredentialManager", () => { // Jest doesn't let us mock require.resolve, so instead we purposely // fail the import and look for module path in the error message const fakeCliPath = "/root/fakeCli"; + // eslint-disable-next-line deprecation/deprecation const mainModule = process.mainModule; + // eslint-disable-next-line deprecation/deprecation process.mainModule = { filename: fakeCliPath } as any; const resolveSpy = jest.spyOn(path, "resolve").mockReturnValue(fakeCliPath); @@ -95,13 +97,16 @@ describe("DefaultCredentialManager", () => { expect(error.message).toContain("Cannot resolve module"); expect(error.message).toContain(fakeCliPath); } finally { + // eslint-disable-next-line deprecation/deprecation process.mainModule = mainModule; resolveSpy.mockRestore(); } }); it("should look for keytar in local node_modules folder", async () => { + // eslint-disable-next-line deprecation/deprecation const mainModule = process.mainModule; + // eslint-disable-next-line deprecation/deprecation process.mainModule = { filename: "/root/fakeCli" } as any; // Force enter the try catch @@ -118,6 +123,7 @@ describe("DefaultCredentialManager", () => { expect(error).toBeDefined(); expect(error.message).toContain("Cannot assign to read only property"); } finally { + // eslint-disable-next-line deprecation/deprecation process.mainModule = mainModule; } }); diff --git a/packages/imperative/src/security/src/DefaultCredentialManager.ts b/packages/imperative/src/security/src/DefaultCredentialManager.ts index 8a2b9e43ea..3d2e511c32 100644 --- a/packages/imperative/src/security/src/DefaultCredentialManager.ts +++ b/packages/imperative/src/security/src/DefaultCredentialManager.ts @@ -120,7 +120,9 @@ export class DefaultCredentialManager extends AbstractCredentialManager { // our calling CLI. Since our caller must supply keytar, we search for keytar // within our caller's path. const requireOpts: any = {}; + // eslint-disable-next-line deprecation/deprecation if (process.mainModule?.filename != null) { + // eslint-disable-next-line deprecation/deprecation requireOpts.paths = [process.mainModule.filename, ...require.resolve.paths("@zowe/secrets-for-zowe-sdk")]; } // use helper function for require.resolve so it can be mocked in jest tests diff --git a/packages/imperative/src/security/src/abstract/AbstractCredentialManager.ts b/packages/imperative/src/security/src/abstract/AbstractCredentialManager.ts index a01ec4af0b..e647e61f9e 100644 --- a/packages/imperative/src/security/src/abstract/AbstractCredentialManager.ts +++ b/packages/imperative/src/security/src/abstract/AbstractCredentialManager.ts @@ -10,7 +10,6 @@ */ import { ImperativeError } from "../../../error"; -import { isNullOrUndefined } from "util"; /** * String credential @@ -121,7 +120,7 @@ export abstract class AbstractCredentialManager { */ public async save(account: string, secureValue: string): Promise { // Check both username and password are set and are not empty strings. Ah, the magic of JavaScript - if (!isNullOrUndefined(secureValue) && secureValue !== "") { + if (!(secureValue == null) && secureValue !== "") { const encodedString = Buffer.from(`${secureValue}`).toString("base64"); await this.saveCredentials(account, encodedString); } else { diff --git a/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts b/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts index c0b2b6ae22..f31a6dc883 100644 --- a/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts +++ b/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts @@ -131,6 +131,7 @@ describe("CliUtils", () => { (prompt as any).question = jest.fn(() => { return mockedPromptValue; }); + // eslint-disable-next-line deprecation/deprecation const value = CliUtils.promptForInput("my message goes here:"); expect(value).toEqual(mockedPromptValue); }); @@ -188,17 +189,20 @@ describe("CliUtils", () => { }); it("should return the user's answer", async () => { + // eslint-disable-next-line deprecation/deprecation const answer = await CliUtils.promptWithTimeout("Question to be asked: "); expect(answer).toEqual(mockedAnswer); }); it("should accept a hideText parameter", async () => { + // eslint-disable-next-line deprecation/deprecation const answer = await CliUtils.promptWithTimeout("Should we hide your answer: ", true); expect(answer).toEqual(mockedAnswer); }); it("should accept a secToWait parameter", async () => { const secToWait = 15; + // eslint-disable-next-line deprecation/deprecation const answer = await CliUtils.promptWithTimeout("Should wait your amount of time: ", false, secToWait ); @@ -207,6 +211,7 @@ describe("CliUtils", () => { it("should limit to a max secToWait", async () => { const tooLong = 1000; + // eslint-disable-next-line deprecation/deprecation const answer = await CliUtils.promptWithTimeout("Should wait your amount of time: ", false, tooLong ); diff --git a/packages/imperative/src/utilities/__tests__/ProcessUtils.unit.test.ts b/packages/imperative/src/utilities/__tests__/ProcessUtils.unit.test.ts index c1a68617e7..3db03339f4 100644 --- a/packages/imperative/src/utilities/__tests__/ProcessUtils.unit.test.ts +++ b/packages/imperative/src/utilities/__tests__/ProcessUtils.unit.test.ts @@ -304,6 +304,7 @@ describe("ProcessUtils tests", () => { const options: any = { cwd: __dirname }; const stdoutBuffer = Buffer.from(message + "\n"); const spawnSpy = jest.spyOn(ExecUtils, "spawnAndGetOutput").mockReturnValueOnce(stdoutBuffer as any); + // eslint-disable-next-line deprecation/deprecation const execOutput = ProcessUtils.execAndCheckOutput("echo", [message], options); expect(spawnSpy).toHaveBeenCalledWith("echo", [message], options); expect(execOutput).toBe(stdoutBuffer); diff --git a/packages/imperative/src/utilities/__tests__/diff/WebDiffManager.unit.test.ts b/packages/imperative/src/utilities/__tests__/diff/WebDiffManager.unit.test.ts index 76a1884b5f..397e6169f6 100644 --- a/packages/imperative/src/utilities/__tests__/diff/WebDiffManager.unit.test.ts +++ b/packages/imperative/src/utilities/__tests__/diff/WebDiffManager.unit.test.ts @@ -26,6 +26,7 @@ describe("WebDiffManager", () => { const fakePatchDiff = "test"; const cliHome: string = "packages/__tests__/fakeCliHome"; const webDiffDir: string = path.join(cliHome, 'web-diff'); + // eslint-disable-next-line deprecation/deprecation const mainModule = process.mainModule; beforeAll(async () => { @@ -36,6 +37,7 @@ describe("WebDiffManager", () => { }; + // eslint-disable-next-line deprecation/deprecation (process.mainModule as any) = { filename: "fakeCliCmd" }; @@ -51,6 +53,7 @@ describe("WebDiffManager", () => { await Imperative.init(configs); }); afterAll(() => { + // eslint-disable-next-line deprecation/deprecation process.mainModule = mainModule; // removing test dir generated by the test const rimraf = require('rimraf'); diff --git a/packages/imperative/src/utilities/src/CliUtils.ts b/packages/imperative/src/utilities/src/CliUtils.ts index a3b492c770..ea93754d7b 100644 --- a/packages/imperative/src/utilities/src/CliUtils.ts +++ b/packages/imperative/src/utilities/src/CliUtils.ts @@ -133,6 +133,7 @@ export class CliUtils { profileOrder.forEach((profileType: string) => { // Get the first profile loaded - for now, we won't worry about profiles and double-type loading for dependencies + // eslint-disable-next-line deprecation/deprecation const profile: IProfile = profiles.get(profileType, false); if (profile == null && definitions.required != null && definitions.required.indexOf(profileType) >= 0) { throw new ImperativeError({ diff --git a/packages/imperative/src/utilities/src/JSONUtils.ts b/packages/imperative/src/utilities/src/JSONUtils.ts index e8aa97d7c8..babd013da0 100644 --- a/packages/imperative/src/utilities/src/JSONUtils.ts +++ b/packages/imperative/src/utilities/src/JSONUtils.ts @@ -10,7 +10,6 @@ */ import { ImperativeError } from "../../error"; -import { isNullOrUndefined } from "util"; /** * JSON utility to wrap and throw ImperativeErrors @@ -30,7 +29,7 @@ export class JSONUtils { * @throws {ImperativeError} When there was a failure trying to parse a non-zero length data string. */ public static parse(data: string, failMessage?: string): T { - if (isNullOrUndefined(failMessage)) { + if (failMessage == null) { failMessage = "Parse of " + data + " failed"; } try { diff --git a/packages/imperative/src/utilities/src/TextUtils.ts b/packages/imperative/src/utilities/src/TextUtils.ts index 91af27f12f..3cbbc7c3a4 100644 --- a/packages/imperative/src/utilities/src/TextUtils.ts +++ b/packages/imperative/src/utilities/src/TextUtils.ts @@ -9,7 +9,7 @@ * */ -import { format, isArray, isNullOrUndefined, isNumber, isString } from "util"; +import { format } from "util"; /** * Interface of an explanation map object @@ -39,7 +39,7 @@ export class TextUtils { public static getRecommendedWidth(preferredWidth: number = TextUtils.DEFAULT_WRAP_WIDTH): number { const widthSafeGuard = 8; // prevent partial words from continuing over lines const yargs = require("yargs"); - const maxWidth = !isNullOrUndefined(yargs.terminalWidth() && yargs.terminalWidth() > 0) ? + const maxWidth = !((yargs.terminalWidth() && yargs.terminalWidth() > 0) == null) ? (yargs.terminalWidth() - widthSafeGuard) : preferredWidth; return Math.min(preferredWidth, maxWidth); } @@ -66,11 +66,11 @@ export class TextUtils { includeUnexplainedKeys: boolean = true): any { // no object to explain, return null - if (isNullOrUndefined(original)) { + if (original == null) { return null; } // no explanation map, return original - if (isNullOrUndefined(explanationMap)) { + if (explanationMap == null) { return original; } @@ -163,7 +163,7 @@ export class TextUtils { if (!headers) { headers = this.buildHeaders(objects); } - if (isNullOrUndefined(maxColumnWidth)) { + if (maxColumnWidth == null) { maxColumnWidth = this.getRecommendedWidth() / headers.length; } const borderChars = includeBorders ? @@ -274,7 +274,7 @@ export class TextUtils { * @returns {string} - a formatted string with the variables inserted */ public static formatMessage(message: string, ...values: any[]): string { - if (!isNullOrUndefined(values)) { + if (!(values == null)) { const isPrintfValue = (value: any) => { let isJson = false; try { @@ -283,9 +283,9 @@ export class TextUtils { } catch (e) { // not json } - return isString(value) || isNumber(value) || isJson; + return (typeof value === 'string') || (typeof value === 'number') || isJson; }; - if (isArray(values) && values.filter(isPrintfValue).length === values.length) { + if (Array.isArray(values) && values.filter(isPrintfValue).length === values.length) { message = format.apply(this, [message].concat(values)); } else { From 64f9973d930be9b0e32697b57ef1e97d1b576d15 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 6 Aug 2024 13:18:25 -0400 Subject: [PATCH 04/14] Fix issues from resolving deprecated functions Signed-off-by: Andrew W. Harn --- .../cli-test-utils/src/environment/TempTestProfiles.ts | 3 ++- .../src/cmd/__tests__/utils/CommandUtils.unit.test.ts | 3 ++- packages/imperative/src/utilities/src/CliUtils.ts | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/__tests__/__packages__/cli-test-utils/src/environment/TempTestProfiles.ts b/__tests__/__packages__/cli-test-utils/src/environment/TempTestProfiles.ts index 1812f0e8c6..8596401a92 100644 --- a/__tests__/__packages__/cli-test-utils/src/environment/TempTestProfiles.ts +++ b/__tests__/__packages__/cli-test-utils/src/environment/TempTestProfiles.ts @@ -216,7 +216,8 @@ export class TempTestProfiles { config.api.layers.activate(false, true); // Remove profile from config JSON - config.delete(config.api.profiles.getProfilePathFromName(profileName)); + // eslint-disable-next-line deprecation/deprecation + config.delete(config.api.profiles.expandPath(profileName)); if (config.api.layers.get().properties.defaults[profileType] === profileName) { config.delete(`defaults.${profileType}`); } diff --git a/packages/imperative/src/cmd/__tests__/utils/CommandUtils.unit.test.ts b/packages/imperative/src/cmd/__tests__/utils/CommandUtils.unit.test.ts index c92e854337..8286d543d4 100644 --- a/packages/imperative/src/cmd/__tests__/utils/CommandUtils.unit.test.ts +++ b/packages/imperative/src/cmd/__tests__/utils/CommandUtils.unit.test.ts @@ -89,7 +89,8 @@ describe("Command Utils", () => { }); it("We should be able to flatten a nested command tree with aliases for display and searching purposes", () => { - const flatten: ICommandTreeEntry[] = CommandUtils.flattenCommandTree(COMPLEX_COMMAND_WITH_ALIASES); + // eslint-disable-next-line deprecation/deprecation + const flatten: ICommandTreeEntry[] = CommandUtils.flattenCommandTreeWithAliases(COMPLEX_COMMAND_WITH_ALIASES); TestLogger.info("Flattened Command Tree:\n" + inspect(flatten)); expect(flatten).toMatchSnapshot(); }); diff --git a/packages/imperative/src/utilities/src/CliUtils.ts b/packages/imperative/src/utilities/src/CliUtils.ts index ea93754d7b..a6cf89c362 100644 --- a/packages/imperative/src/utilities/src/CliUtils.ts +++ b/packages/imperative/src/utilities/src/CliUtils.ts @@ -703,7 +703,7 @@ export class CliUtils { * - hello--------world -> helloWorld * - hello-World- -> helloWorld */ - const returnChar = p1.substring(-1).toUpperCase(); + const returnChar = p1.slice(-1).toUpperCase(); return returnChar !== "-" ? returnChar : ""; }), kebabCase: key.replace(/(-*[A-Z]|-{2,}|-$)/g, (match, p1, offset, inputString) => { @@ -748,7 +748,7 @@ export class CliUtils { return "-" + p1.toLowerCase(); } } else { // 2 - const returnChar = p1.substring(-1); // Get the last character of the sequence + const returnChar = p1.slice(-1); // Get the last character of the sequence if (returnChar === "-") { // 2.1 if (offset + p1.length === inputString.length) { // 2.1.1 From 1ee1b9771acf7cb065224351d61b46749b2f4854 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 6 Aug 2024 13:52:16 -0400 Subject: [PATCH 05/14] Update changelogs Signed-off-by: Andrew W. Harn --- __tests__/__packages__/cli-test-utils/CHANGELOG.md | 4 ++++ packages/cli/CHANGELOG.md | 4 ++++ packages/imperative/CHANGELOG.md | 4 ++++ packages/provisioning/CHANGELOG.md | 4 ++++ packages/workflows/CHANGELOG.md | 4 ++++ packages/zosconsole/CHANGELOG.md | 4 ++++ packages/zosfiles/CHANGELOG.md | 4 ++++ packages/zoslogs/CHANGELOG.md | 4 ++++ packages/zosmf/CHANGELOG.md | 5 +++++ packages/zostso/CHANGELOG.md | 4 ++++ packages/zosuss/CHANGELOG.md | 4 ++++ 11 files changed, 45 insertions(+) diff --git a/__tests__/__packages__/cli-test-utils/CHANGELOG.md b/__tests__/__packages__/cli-test-utils/CHANGELOG.md index 531be6aef0..509f258bac 100644 --- a/__tests__/__packages__/cli-test-utils/CHANGELOG.md +++ b/__tests__/__packages__/cli-test-utils/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Zowe CLI test utils package will be documented in this file. +## Recent Changes + +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) + ## `7.28.2` - BugFix: Improved the error message shown on Windows when `runCliScript` method cannot find `sh` executable on PATH. [#2208](https://github.com/zowe/zowe-cli/issues/2208) diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 5b9f81d21c..1e10b1d785 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Zowe CLI package will be documented in this file. +## Recent Changes + +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) + ## `7.25.1` - BugFix: Updated `braces` dependency for technical currency. [#2157](https://github.com/zowe/zowe-cli/pull/2157) diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 72e995d43c..8192cdd58f 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Imperative package will be documented in this file. +## Recent Changes + +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) + ## `5.26.1` - Bugfix: Export new Proxy class from Zowe imperative package. [#2205](https://github.com/zowe/zowe-cli/pull/2205) diff --git a/packages/provisioning/CHANGELOG.md b/packages/provisioning/CHANGELOG.md index c7bb00e438..7293dafc00 100644 --- a/packages/provisioning/CHANGELOG.md +++ b/packages/provisioning/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Zowe provisioning SDK package will be documented in this file. +## Recent Changes + +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) + ## `7.6.2` - BugFix: Updated `js-yaml` dependency for technical currency. diff --git a/packages/workflows/CHANGELOG.md b/packages/workflows/CHANGELOG.md index 7ede439b31..3c9d860628 100644 --- a/packages/workflows/CHANGELOG.md +++ b/packages/workflows/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Zowe z/OS workflows SDK package will be documented in this file. +## Recent Changes + +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) + ## `7.0.0` - Major: Introduced Team Profiles, Daemon mode, and more. See the prerelease items (if any) below for more details. diff --git a/packages/zosconsole/CHANGELOG.md b/packages/zosconsole/CHANGELOG.md index 95886e86fb..f23f07858b 100644 --- a/packages/zosconsole/CHANGELOG.md +++ b/packages/zosconsole/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Zowe z/OS console SDK package will be documented in this file. +## Recent Changes + +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) + ## `7.0.0` - Major: Introduced Team Profiles, Daemon mode, and more. See the prerelease items (if any) below for more details. diff --git a/packages/zosfiles/CHANGELOG.md b/packages/zosfiles/CHANGELOG.md index 5579345ebc..a289c69f48 100644 --- a/packages/zosfiles/CHANGELOG.md +++ b/packages/zosfiles/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Zowe z/OS files SDK package will be documented in this file. +## Recent Changes + +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) + ## `7.26.1` - BugFix: Fixed `Get.dataSet` and `Get.USSFile` methods so that they return an empty buffer instead of null for empty files. [#2173](https://github.com/zowe/zowe-cli/pull/2173) diff --git a/packages/zoslogs/CHANGELOG.md b/packages/zoslogs/CHANGELOG.md index 7e83addfe0..d3bcf891ac 100644 --- a/packages/zoslogs/CHANGELOG.md +++ b/packages/zoslogs/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Zowe z/OS logs SDK package will be documented in this file. +## Recent Changes + +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) + ## `7.0.0` - Major: Introduced Team Profiles, Daemon mode, and more. See the prerelease items (if any) below for more details. diff --git a/packages/zosmf/CHANGELOG.md b/packages/zosmf/CHANGELOG.md index 52cf9c629e..65be7d633c 100644 --- a/packages/zosmf/CHANGELOG.md +++ b/packages/zosmf/CHANGELOG.md @@ -2,7 +2,12 @@ All notable changes to the Zowe z/OSMF SDK package will be documented in this file. +## Recent Changes + +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) + ## `7.6.2` + - BugFix: Updated example for `zowe profiles create zosmf-profile` command. [#1152](https://github.com/zowe/zowe-cli/issues/1152) ## `7.1.0` diff --git a/packages/zostso/CHANGELOG.md b/packages/zostso/CHANGELOG.md index 428c948a96..e6db93235a 100644 --- a/packages/zostso/CHANGELOG.md +++ b/packages/zostso/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Zowe z/OS TSO SDK package will be documented in this file. +## Recent Changes + +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) + ## `7.1.0` - Enhancement: Exposed `tso` profile type configuration. diff --git a/packages/zosuss/CHANGELOG.md b/packages/zosuss/CHANGELOG.md index 41b4cf8810..00fc80bf9a 100644 --- a/packages/zosuss/CHANGELOG.md +++ b/packages/zosuss/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Zowe z/OS USS SDK package will be documented in this file. +## Recent Changes + +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) + ## `7.24.0` - Enhancement: Provide legible errors to users when they are missing user/password credentials while From 5054bcf56e4dbc9998df753d3ce160bb89373980 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 6 Aug 2024 14:19:42 -0400 Subject: [PATCH 06/14] Try to fix integration tests Signed-off-by: Andrew W. Harn --- ...xe.integration.test.ts => cli.zowe.exe.integration.subtest.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/cli/__tests__/daemon/__integration__/{cli.zowe.exe.integration.test.ts => cli.zowe.exe.integration.subtest.ts} (100%) diff --git a/packages/cli/__tests__/daemon/__integration__/cli.zowe.exe.integration.test.ts b/packages/cli/__tests__/daemon/__integration__/cli.zowe.exe.integration.subtest.ts similarity index 100% rename from packages/cli/__tests__/daemon/__integration__/cli.zowe.exe.integration.test.ts rename to packages/cli/__tests__/daemon/__integration__/cli.zowe.exe.integration.subtest.ts From d413383963d9afebc2cd52c284dd5bb080c84857 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 6 Aug 2024 14:52:46 -0400 Subject: [PATCH 07/14] Remove unused line in test Signed-off-by: Andrew W. Harn --- .../__tests__/__unit__/methods/utilities/Utilities.unit.test.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/zosfiles/__tests__/__unit__/methods/utilities/Utilities.unit.test.ts b/packages/zosfiles/__tests__/__unit__/methods/utilities/Utilities.unit.test.ts index d0f65e09f7..b70e440eb6 100644 --- a/packages/zosfiles/__tests__/__unit__/methods/utilities/Utilities.unit.test.ts +++ b/packages/zosfiles/__tests__/__unit__/methods/utilities/Utilities.unit.test.ts @@ -179,8 +179,6 @@ describe("Utilities.putUSSPayload", () => { caughtError = e; } - const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, encodeURIComponent(filename.substring(1))); - expect(response).toBeUndefined(); expect(caughtError).toBeDefined(); From a2106eacf27db58295fa3642169395bd79f9b3e4 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Tue, 6 Aug 2024 16:45:35 -0400 Subject: [PATCH 08/14] Fix error using session with auth type "none" Signed-off-by: Timothy Johnson --- .../client/AbstractRestClient.unit.test.ts | 54 +++++++++++++++++-- .../src/rest/src/client/AbstractRestClient.ts | 2 +- 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/packages/imperative/src/rest/__tests__/client/AbstractRestClient.unit.test.ts b/packages/imperative/src/rest/__tests__/client/AbstractRestClient.unit.test.ts index 3e480ec45b..b898a3d0ae 100644 --- a/packages/imperative/src/rest/__tests__/client/AbstractRestClient.unit.test.ts +++ b/packages/imperative/src/rest/__tests__/client/AbstractRestClient.unit.test.ts @@ -14,7 +14,7 @@ import * as https from "https"; import * as http from "http"; import { Session } from "../../src/session/Session"; import { - AUTH_TYPE_BASIC, AUTH_TYPE_BEARER, AUTH_TYPE_CERT_PEM, AUTH_TYPE_TOKEN + AUTH_TYPE_BASIC, AUTH_TYPE_BEARER, AUTH_TYPE_CERT_PEM, AUTH_TYPE_NONE, AUTH_TYPE_TOKEN } from "../../src/session/SessConstants"; import { RestClient } from "../../src/client/RestClient"; import { Headers } from "../../src/client/Headers"; @@ -83,15 +83,19 @@ describe("AbstractRestClient tests", () => { expect(error.message).toMatchSnapshot(); }); - it("should throw an error when when no creds are in the session", async () => { + it("should throw an error when session type is basic and no creds are in the session", async () => { // restore setPasswordAuth spy to its original implementation setPasswordAuthSpy.mockRestore(); let caughtError; try { - await RestClient.getExpectString(new Session({ - hostname: "test" - }), "/resource"); + const sessWithoutCreds = new Session({ + hostname: "test", + type: AUTH_TYPE_BASIC, + base64EncodedAuth: "FakeBase64EncodedCred" + }); + delete sessWithoutCreds.ISession.base64EncodedAuth; + await RestClient.getExpectString(sessWithoutCreds, "/resource"); } catch (error) { caughtError = error; } @@ -100,6 +104,46 @@ describe("AbstractRestClient tests", () => { expect(caughtError.message).toContain("No credentials for a BASIC or TOKEN type of session"); }); + it("should not error when session type is none and no creds are in the session", async () => { + const emitter = new MockHttpRequestResponse(); + const requestFnc = jest.fn((options, callback) => { + ProcessUtils.nextTick(async () => { + + const newEmit = new MockHttpRequestResponse(); + callback(newEmit); + + await ProcessUtils.nextTick(() => { + newEmit.emit("data", Buffer.from("{\"newData\":", "utf8")); + }); + + await ProcessUtils.nextTick(() => { + newEmit.emit("data", Buffer.from("\"response data\"}", "utf8")); + }); + + await ProcessUtils.nextTick(() => { + newEmit.emit("end"); + }); + }); + + return emitter; + }); + + (https.request as any) = requestFnc; + + let caughtError; + try { + await RestClient.getExpectString(new Session({ + hostname: "test", + type: AUTH_TYPE_NONE + }), "/resource"); + } catch (error) { + caughtError = error; + } + + expect(caughtError).toBeUndefined(); + expect(requestFnc).toHaveBeenCalledTimes(1); + }); + it("should not error when chunking data and payload data are present in outgoing request", async () => { interface IPayload { diff --git a/packages/imperative/src/rest/src/client/AbstractRestClient.ts b/packages/imperative/src/rest/src/client/AbstractRestClient.ts index b3d37dd2c2..fa1e663d15 100644 --- a/packages/imperative/src/rest/src/client/AbstractRestClient.ts +++ b/packages/imperative/src/rest/src/client/AbstractRestClient.ts @@ -538,7 +538,7 @@ export abstract class AbstractRestClient { /* There is probably a better way report this kind of problem and a better message, * but we do it this way to maintain backward compatibility. */ - if (!credsAreSet) { + if (!credsAreSet && this.session.ISession.type !== SessConstants.AUTH_TYPE_NONE) { throw new ImperativeError({ msg: "No credentials for a BASIC or TOKEN type of session." }); } From bb5b89474ff598cc34e8c9c842d7c41949bc06a0 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Wed, 7 Aug 2024 09:53:04 -0400 Subject: [PATCH 09/14] Remove deprecated buffer slice and replace with subarray Signed-off-by: Andrew W. Harn --- packages/cli/src/daemon/DaemonClient.ts | 6 +++--- .../rest/__tests__/client/AbstractRestClient.unit.test.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/cli/src/daemon/DaemonClient.ts b/packages/cli/src/daemon/DaemonClient.ts index 04f99dadec..27cc89b7c3 100644 --- a/packages/cli/src/daemon/DaemonClient.ts +++ b/packages/cli/src/daemon/DaemonClient.ts @@ -142,15 +142,15 @@ export class DaemonClient { let stdinData: Buffer; try { - jsonData = JSON.parse((jsonEndIdx !== -1 ? data.slice(0, jsonEndIdx + 1) : data).toString()); - stdinData = jsonEndIdx !== -1 ? data.slice(jsonEndIdx + 2) : undefined; + jsonData = JSON.parse((jsonEndIdx !== -1 ? data.subarray(0, jsonEndIdx + 1) : data).toString()); + stdinData = jsonEndIdx !== -1 ? data.subarray(jsonEndIdx + 2) : undefined; } catch (error) { Imperative.api.appLogger.logError(new ImperativeError({ msg: "Failed to parse data received from daemon client", causeErrors: error })); // eslint-disable-next-line @typescript-eslint/no-magic-numbers - Imperative.api.appLogger.trace("First 1024 bytes of daemon request:\n", data.slice(0, 1024).toString()); + Imperative.api.appLogger.trace("First 1024 bytes of daemon request:\n", data.subarray(0, 1024).toString()); const responsePayload: string = DaemonRequest.create({ stderr: "Failed to parse data received from daemon client:\n" + error.stack, exitCode: 1 diff --git a/packages/imperative/src/rest/__tests__/client/AbstractRestClient.unit.test.ts b/packages/imperative/src/rest/__tests__/client/AbstractRestClient.unit.test.ts index 3e480ec45b..d9f7933188 100644 --- a/packages/imperative/src/rest/__tests__/client/AbstractRestClient.unit.test.ts +++ b/packages/imperative/src/rest/__tests__/client/AbstractRestClient.unit.test.ts @@ -1006,7 +1006,7 @@ describe("AbstractRestClient tests", () => { callback(newEmit); await ProcessUtils.nextTick(() => { - newEmit.emit("data", gzipBuffer.slice(0, -10)); + newEmit.emit("data", gzipBuffer.subarray(0, -10)); }); await ProcessUtils.nextTick(() => { @@ -1114,7 +1114,7 @@ describe("AbstractRestClient tests", () => { callback(newEmit); await ProcessUtils.nextTick(() => { - newEmit.emit("data", gzipBuffer.slice(0, -10)); + newEmit.emit("data", gzipBuffer.subarray(0, -10)); }); await ProcessUtils.nextTick(() => { From 11a1830d52c2fc9516f49cea95dd1aa45e4274eb Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Wed, 7 Aug 2024 10:06:32 -0400 Subject: [PATCH 10/14] Update changelog Signed-off-by: Timothy Johnson --- packages/imperative/CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 72e995d43c..a5f31230bd 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -2,9 +2,13 @@ All notable changes to the Imperative package will be documented in this file. +## Recent Changes + +- BugFix: Fixed error in REST client when making requests with session type of `SessConstants.AUTH_TYPE_NONE`. [#2219](https://github.com/zowe/zowe-cli/issues/2219) + ## `5.26.1` -- Bugfix: Export new Proxy class from Zowe imperative package. [#2205](https://github.com/zowe/zowe-cli/pull/2205) +- BugFix: Fixed missing export for `Proxy` class in Imperative package. [#2205](https://github.com/zowe/zowe-cli/pull/2205) ## `5.26.0` From ec84fc8c5ea0aa3ac789731bd9fdf0e586195694 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Wed, 7 Aug 2024 13:41:59 -0400 Subject: [PATCH 11/14] Update changelogs Signed-off-by: Andrew W. Harn --- __tests__/__packages__/cli-test-utils/CHANGELOG.md | 2 +- packages/cli/CHANGELOG.md | 2 +- packages/imperative/CHANGELOG.md | 2 +- packages/provisioning/CHANGELOG.md | 2 +- packages/workflows/CHANGELOG.md | 2 +- packages/zosconsole/CHANGELOG.md | 2 +- packages/zosfiles/CHANGELOG.md | 2 +- packages/zoslogs/CHANGELOG.md | 2 +- packages/zosmf/CHANGELOG.md | 2 +- packages/zostso/CHANGELOG.md | 2 +- packages/zosuss/CHANGELOG.md | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/__tests__/__packages__/cli-test-utils/CHANGELOG.md b/__tests__/__packages__/cli-test-utils/CHANGELOG.md index 509f258bac..aad5e27ec1 100644 --- a/__tests__/__packages__/cli-test-utils/CHANGELOG.md +++ b/__tests__/__packages__/cli-test-utils/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to the Zowe CLI test utils package will be documented in thi ## Recent Changes -- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) ## `7.28.2` diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 1e10b1d785..99a7897a30 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to the Zowe CLI package will be documented in this file. ## Recent Changes -- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) ## `7.25.1` diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 8192cdd58f..b969019d35 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to the Imperative package will be documented in this file. ## Recent Changes -- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) ## `5.26.1` diff --git a/packages/provisioning/CHANGELOG.md b/packages/provisioning/CHANGELOG.md index 7293dafc00..3d997e13b7 100644 --- a/packages/provisioning/CHANGELOG.md +++ b/packages/provisioning/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to the Zowe provisioning SDK package will be documented in t ## Recent Changes -- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) ## `7.6.2` diff --git a/packages/workflows/CHANGELOG.md b/packages/workflows/CHANGELOG.md index 3c9d860628..8a7618dbc2 100644 --- a/packages/workflows/CHANGELOG.md +++ b/packages/workflows/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to the Zowe z/OS workflows SDK package will be documented in ## Recent Changes -- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) ## `7.0.0` diff --git a/packages/zosconsole/CHANGELOG.md b/packages/zosconsole/CHANGELOG.md index f23f07858b..53d96c9252 100644 --- a/packages/zosconsole/CHANGELOG.md +++ b/packages/zosconsole/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to the Zowe z/OS console SDK package will be documented in t ## Recent Changes -- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) ## `7.0.0` diff --git a/packages/zosfiles/CHANGELOG.md b/packages/zosfiles/CHANGELOG.md index a289c69f48..32e557b8ee 100644 --- a/packages/zosfiles/CHANGELOG.md +++ b/packages/zosfiles/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to the Zowe z/OS files SDK package will be documented in thi ## Recent Changes -- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) ## `7.26.1` diff --git a/packages/zoslogs/CHANGELOG.md b/packages/zoslogs/CHANGELOG.md index d3bcf891ac..eb9294b1f3 100644 --- a/packages/zoslogs/CHANGELOG.md +++ b/packages/zoslogs/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to the Zowe z/OS logs SDK package will be documented in this ## Recent Changes -- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) ## `7.0.0` diff --git a/packages/zosmf/CHANGELOG.md b/packages/zosmf/CHANGELOG.md index 65be7d633c..5475aa5776 100644 --- a/packages/zosmf/CHANGELOG.md +++ b/packages/zosmf/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to the Zowe z/OSMF SDK package will be documented in this fi ## Recent Changes -- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) ## `7.6.2` diff --git a/packages/zostso/CHANGELOG.md b/packages/zostso/CHANGELOG.md index e6db93235a..df9360c235 100644 --- a/packages/zostso/CHANGELOG.md +++ b/packages/zostso/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to the Zowe z/OS TSO SDK package will be documented in this ## Recent Changes -- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) ## `7.1.0` diff --git a/packages/zosuss/CHANGELOG.md b/packages/zosuss/CHANGELOG.md index 00fc80bf9a..6e3fd74388 100644 --- a/packages/zosuss/CHANGELOG.md +++ b/packages/zosuss/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to the Zowe z/OS USS SDK package will be documented in this ## Recent Changes -- BugFix: Refactored code to reduce the use of deprecated functions to prepare for Node 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) +- BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) ## `7.24.0` From 7919322f9c4c7d559134ae844ec6917135e8a930 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Thu, 8 Aug 2024 09:27:43 -0400 Subject: [PATCH 12/14] Make requested changes Signed-off-by: Andrew W. Harn --- packages/imperative/.eslintrc.js | 3 +- .../__tests__/config/jest.preset.json | 2 +- packages/imperative/__tests__/tsconfig.json | 11 ++++- packages/imperative/package.json | 6 +-- .../imperative/src/utilities/src/TextUtils.ts | 2 +- packages/imperative/tsconfig-tests.json | 40 ------------------- 6 files changed, 15 insertions(+), 49 deletions(-) delete mode 100644 packages/imperative/tsconfig-tests.json diff --git a/packages/imperative/.eslintrc.js b/packages/imperative/.eslintrc.js index fa630b127c..01fe3c5774 100644 --- a/packages/imperative/.eslintrc.js +++ b/packages/imperative/.eslintrc.js @@ -5,8 +5,7 @@ module.exports = { "sourceType": "module", "project": [ "./tsconfig.json", - "./__tests__/tsconfig.json", - "./tsconfig-tests.json" + "./__tests__/tsconfig.json" ] } } \ No newline at end of file diff --git a/packages/imperative/__tests__/config/jest.preset.json b/packages/imperative/__tests__/config/jest.preset.json index 80286a736d..e718090405 100644 --- a/packages/imperative/__tests__/config/jest.preset.json +++ b/packages/imperative/__tests__/config/jest.preset.json @@ -2,7 +2,7 @@ "globals": { "ts-jest": { "diagnostics": false, - "tsconfig": "tsconfig-tests.json" + "tsconfig": "./__tests__/tsconfig.json" } }, "moduleFileExtensions": ["ts","js"], diff --git a/packages/imperative/__tests__/tsconfig.json b/packages/imperative/__tests__/tsconfig.json index c4d748311b..e15ba062f9 100644 --- a/packages/imperative/__tests__/tsconfig.json +++ b/packages/imperative/__tests__/tsconfig.json @@ -19,10 +19,17 @@ "include": [ "**/*.test.ts", "**/*.subtest.ts", - "**/__tests__/**/*" + "**/__tests__/**/*", + "../**/*.test.ts", + "../**/*.subtest.ts", + "../**/__tests__/**/*" ], "exclude": [ "lib", "node_modules" - ] + ], + "files": [ + "../../__types__/wontache.d.ts" + ], + "allowJs": true } \ No newline at end of file diff --git a/packages/imperative/package.json b/packages/imperative/package.json index cf9ee079c3..5da51d73d5 100644 --- a/packages/imperative/package.json +++ b/packages/imperative/package.json @@ -30,9 +30,9 @@ "scripts": { "build:packages": "tsc --pretty", "build": "npm run build:packages && npm run build:webHelp", - "lint": "eslint \"src/**/*.ts\" \"**/__tests__/**/*.ts\"", - "lint:packages": "eslint \"src/**/*.ts\" --ignore-pattern \"**/__tests__/**/*.ts\"", - "lint:tests": "eslint \"./__tests__/**/*.ts\"", + "lint": "eslint \"src/**/*.ts\" \"**/__tests__/**/*.ts\" --ignore-pattern \"**/__mocks__/*.ts\"", + "lint:packages": "eslint \"src/**/*.ts\" --ignore-pattern \"**/__tests__/**/*.ts\" --ignore-pattern \"**/__mocks__/*.ts\"", + "lint:tests": "eslint \"**/__tests__/**/*.ts\"", "circularDependencyCheck": "madge -c lib", "watch": "concurrently \"tsc --pretty --watch\" \"npm run watch:webHelp\"", "build:webHelp": "cd web-help && npm run build", diff --git a/packages/imperative/src/utilities/src/TextUtils.ts b/packages/imperative/src/utilities/src/TextUtils.ts index 3cbbc7c3a4..dd59bc4631 100644 --- a/packages/imperative/src/utilities/src/TextUtils.ts +++ b/packages/imperative/src/utilities/src/TextUtils.ts @@ -39,7 +39,7 @@ export class TextUtils { public static getRecommendedWidth(preferredWidth: number = TextUtils.DEFAULT_WRAP_WIDTH): number { const widthSafeGuard = 8; // prevent partial words from continuing over lines const yargs = require("yargs"); - const maxWidth = !((yargs.terminalWidth() && yargs.terminalWidth() > 0) == null) ? + const maxWidth = (!(yargs.terminalWidth() == null) && yargs.terminalWidth() > 0) ? (yargs.terminalWidth() - widthSafeGuard) : preferredWidth; return Math.min(preferredWidth, maxWidth); } diff --git a/packages/imperative/tsconfig-tests.json b/packages/imperative/tsconfig-tests.json deleted file mode 100644 index 3485999e7b..0000000000 --- a/packages/imperative/tsconfig-tests.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "compilerOptions": { - "types": [ - "node", - "jest" - ], - "lib": [ - "esnext" - ], - "experimentalDecorators": true, - "target": "es2015", - "module": "commonjs", - "noEmit": true, - "declaration": true, - "moduleResolution": "node", - "noImplicitAny": true, - "outDir": "./lib", - "preserveConstEnums": true, - "removeComments": false, - "pretty": true, - "sourceMap": true, - "newLine": "lf" - }, - "typeRoots": [ - "./node_modules/@types" - ], - "include": [ - "**/__tests__/*", - "**/__tests__/**/*", - "**/__mocks__/*" - ], - "exclude": [ - "lib", - "node_modules" - ], - "files": [ - "../../__types__/wontache.d.ts" - ], - "allowJs": true -} From bd6d84c932dc440ae56264c2d6321dc64e362255 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Thu, 8 Aug 2024 09:29:22 -0400 Subject: [PATCH 13/14] Move .madgerc Signed-off-by: Andrew W. Harn --- packages/.madgerc => .madgerc | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/.madgerc => .madgerc (100%) diff --git a/packages/.madgerc b/.madgerc similarity index 100% rename from packages/.madgerc rename to .madgerc From 0eb09332c6ec2c4969530ab9a12c21ca3e5bc237 Mon Sep 17 00:00:00 2001 From: zowe-robot Date: Thu, 8 Aug 2024 17:16:57 +0000 Subject: [PATCH 14/14] Bump version to 7.28.3 [ci skip] Signed-off-by: zowe-robot --- .../__packages__/cli-test-utils/CHANGELOG.md | 2 +- .../__packages__/cli-test-utils/package.json | 4 +- lerna.json | 2 +- npm-shrinkwrap.json | 229 ++++++++++-------- packages/cli/CHANGELOG.md | 2 +- packages/cli/package.json | 26 +- packages/core/package.json | 6 +- packages/imperative/CHANGELOG.md | 2 +- packages/imperative/package.json | 4 +- packages/provisioning/CHANGELOG.md | 2 +- packages/provisioning/package.json | 8 +- packages/secrets/package.json | 2 +- packages/workflows/CHANGELOG.md | 2 +- packages/workflows/package.json | 10 +- packages/zosconsole/CHANGELOG.md | 2 +- packages/zosconsole/package.json | 8 +- packages/zosfiles/CHANGELOG.md | 2 +- packages/zosfiles/package.json | 10 +- packages/zosjobs/package.json | 10 +- packages/zoslogs/CHANGELOG.md | 2 +- packages/zoslogs/package.json | 8 +- packages/zosmf/CHANGELOG.md | 2 +- packages/zosmf/package.json | 8 +- packages/zostso/CHANGELOG.md | 2 +- packages/zostso/package.json | 10 +- packages/zosuss/CHANGELOG.md | 2 +- packages/zosuss/package.json | 6 +- 27 files changed, 195 insertions(+), 178 deletions(-) diff --git a/__tests__/__packages__/cli-test-utils/CHANGELOG.md b/__tests__/__packages__/cli-test-utils/CHANGELOG.md index aad5e27ec1..0ec6f57a65 100644 --- a/__tests__/__packages__/cli-test-utils/CHANGELOG.md +++ b/__tests__/__packages__/cli-test-utils/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the Zowe CLI test utils package will be documented in this file. -## Recent Changes +## `7.28.3` - BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) diff --git a/__tests__/__packages__/cli-test-utils/package.json b/__tests__/__packages__/cli-test-utils/package.json index 83e901cdb7..5676a4e4e3 100644 --- a/__tests__/__packages__/cli-test-utils/package.json +++ b/__tests__/__packages__/cli-test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/cli-test-utils", - "version": "7.28.2", + "version": "7.28.3", "description": "Test utilities package for Zowe CLI plug-ins", "author": "Zowe", "license": "EPL-2.0", @@ -43,7 +43,7 @@ "devDependencies": { "@types/js-yaml": "^4.0.0", "@types/uuid": "^8.3.0", - "@zowe/imperative": "5.26.1" + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/imperative": "^5.0.0" diff --git a/lerna.json b/lerna.json index 28bf670e2c..168b9a1770 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "7.28.2", + "version": "7.28.3", "command": { "publish": { "ignoreChanges": [ diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index eca5d414b1..355fcdb3ac 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -54,7 +54,7 @@ }, "__tests__/__packages__/cli-test-utils": { "name": "@zowe/cli-test-utils", - "version": "7.28.2", + "version": "7.28.3", "license": "EPL-2.0", "dependencies": { "find-up": "^5.0.0", @@ -65,7 +65,7 @@ "devDependencies": { "@types/js-yaml": "^4.0.0", "@types/uuid": "^8.3.0", - "@zowe/imperative": "5.26.1" + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/imperative": "^5.0.0" @@ -20648,21 +20648,21 @@ }, "packages/cli": { "name": "@zowe/cli", - "version": "7.28.2", + "version": "7.28.3", "hasInstallScript": true, "license": "EPL-2.0", "dependencies": { - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1", - "@zowe/provisioning-for-zowe-sdk": "7.28.2", - "@zowe/zos-console-for-zowe-sdk": "7.28.2", - "@zowe/zos-files-for-zowe-sdk": "7.28.2", - "@zowe/zos-jobs-for-zowe-sdk": "7.28.2", - "@zowe/zos-logs-for-zowe-sdk": "7.28.2", - "@zowe/zos-tso-for-zowe-sdk": "7.28.2", - "@zowe/zos-uss-for-zowe-sdk": "7.28.2", - "@zowe/zos-workflows-for-zowe-sdk": "7.28.2", - "@zowe/zosmf-for-zowe-sdk": "7.28.2", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2", + "@zowe/provisioning-for-zowe-sdk": "7.28.3", + "@zowe/zos-console-for-zowe-sdk": "7.28.3", + "@zowe/zos-files-for-zowe-sdk": "7.28.3", + "@zowe/zos-jobs-for-zowe-sdk": "7.28.3", + "@zowe/zos-logs-for-zowe-sdk": "7.28.3", + "@zowe/zos-tso-for-zowe-sdk": "7.28.3", + "@zowe/zos-uss-for-zowe-sdk": "7.28.3", + "@zowe/zos-workflows-for-zowe-sdk": "7.28.3", + "@zowe/zosmf-for-zowe-sdk": "7.28.3", "find-process": "1.4.7", "get-stream": "6.0.1", "lodash": "4.17.21", @@ -20677,7 +20677,7 @@ "@types/diff": "^5.0.2", "@types/lodash": "^4.14.175", "@types/tar": "^6.1.2", - "@zowe/cli-test-utils": "7.28.2", + "@zowe/cli-test-utils": "7.28.3", "comment-json": "^4.1.1", "strip-ansi": "^6.0.1", "which": "^2.0.2" @@ -20689,6 +20689,17 @@ "@zowe/secrets-for-zowe-sdk": "7.18.6" } }, + "packages/cli/node_modules/@zowe/secrets-for-zowe-sdk": { + "version": "7.18.6", + "resolved": "https://zowe.jfrog.io/zowe/api/npm/npm-local-release/@zowe/secrets-for-zowe-sdk/-/@zowe/secrets-for-zowe-sdk-7.18.6.tgz", + "integrity": "sha512-3ElVUd5VYWUxVjXRCeM/jmXh9u1rnWtxobQEpgEZ2iNt+PTt3QajIxUH9MxriELVCp7u39AeAG4lfxs3wnrGzA==", + "hasInstallScript": true, + "license": "EPL-2.0", + "optional": true, + "engines": { + "node": ">= 14" + } + }, "packages/cli/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -20710,15 +20721,15 @@ }, "packages/core": { "name": "@zowe/core-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "license": "EPL-2.0", "dependencies": { "comment-json": "4.1.1", "string-width": "4.2.3" }, "devDependencies": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/imperative": "^5.0.0" @@ -20726,7 +20737,7 @@ }, "packages/imperative": { "name": "@zowe/imperative", - "version": "5.26.1", + "version": "5.26.2", "license": "EPL-2.0", "dependencies": { "@types/yargs": "13.0.4", @@ -20784,7 +20795,7 @@ "@types/readline-sync": "^1.4.3", "@types/rimraf": "^3.0.2", "@types/stack-trace": "^0.0.29", - "@zowe/secrets-for-zowe-sdk": "^7.18.0", + "@zowe/secrets-for-zowe-sdk": "^7.28.3", "concurrently": "^7.5.0", "cowsay": "^1.2.1", "deep-diff": "^0.3.8", @@ -21108,16 +21119,16 @@ }, "packages/provisioning": { "name": "@zowe/provisioning-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "license": "EPL-2.0", "dependencies": { "js-yaml": "4.1.0" }, "devDependencies": { "@types/js-yaml": "^4.0.5", - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^7.0.0", @@ -21126,7 +21137,7 @@ }, "packages/secrets": { "name": "@zowe/secrets-for-zowe-sdk", - "version": "7.18.6", + "version": "7.28.3", "hasInstallScript": true, "license": "EPL-2.0", "devDependencies": { @@ -21139,15 +21150,15 @@ }, "packages/workflows": { "name": "@zowe/zos-workflows-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "license": "EPL-2.0", "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "7.28.2" + "@zowe/zos-files-for-zowe-sdk": "7.28.3" }, "devDependencies": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^7.0.0", @@ -21156,12 +21167,12 @@ }, "packages/zosconsole": { "name": "@zowe/zos-console-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^7.0.0", @@ -21170,16 +21181,16 @@ }, "packages/zosfiles": { "name": "@zowe/zos-files-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "license": "EPL-2.0", "dependencies": { "minimatch": "5.0.1" }, "devDependencies": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1", - "@zowe/zos-uss-for-zowe-sdk": "7.28.2" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2", + "@zowe/zos-uss-for-zowe-sdk": "7.28.3" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^7.0.0", @@ -21207,15 +21218,15 @@ }, "packages/zosjobs": { "name": "@zowe/zos-jobs-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "license": "EPL-2.0", "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "7.28.2" + "@zowe/zos-files-for-zowe-sdk": "7.28.3" }, "devDependencies": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^7.0.0", @@ -21224,12 +21235,12 @@ }, "packages/zoslogs": { "name": "@zowe/zos-logs-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^7.0.0", @@ -21238,12 +21249,12 @@ }, "packages/zosmf": { "name": "@zowe/zosmf-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^7.0.0", @@ -21252,15 +21263,15 @@ }, "packages/zostso": { "name": "@zowe/zos-tso-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "license": "EPL-2.0", "dependencies": { - "@zowe/zosmf-for-zowe-sdk": "7.28.2" + "@zowe/zosmf-for-zowe-sdk": "7.28.3" }, "devDependencies": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^7.0.0", @@ -21269,15 +21280,15 @@ }, "packages/zosuss": { "name": "@zowe/zos-uss-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "license": "EPL-2.0", "dependencies": { "ssh2": "1.15.0" }, "devDependencies": { "@types/ssh2": "^1.11.0", - "@zowe/cli-test-utils": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/imperative": "^5.2.0" @@ -25984,19 +25995,19 @@ "@types/diff": "^5.0.2", "@types/lodash": "^4.14.175", "@types/tar": "^6.1.2", - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1", - "@zowe/provisioning-for-zowe-sdk": "7.28.2", + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2", + "@zowe/provisioning-for-zowe-sdk": "7.28.3", "@zowe/secrets-for-zowe-sdk": "7.18.6", - "@zowe/zos-console-for-zowe-sdk": "7.28.2", - "@zowe/zos-files-for-zowe-sdk": "7.28.2", - "@zowe/zos-jobs-for-zowe-sdk": "7.28.2", - "@zowe/zos-logs-for-zowe-sdk": "7.28.2", - "@zowe/zos-tso-for-zowe-sdk": "7.28.2", - "@zowe/zos-uss-for-zowe-sdk": "7.28.2", - "@zowe/zos-workflows-for-zowe-sdk": "7.28.2", - "@zowe/zosmf-for-zowe-sdk": "7.28.2", + "@zowe/zos-console-for-zowe-sdk": "7.28.3", + "@zowe/zos-files-for-zowe-sdk": "7.28.3", + "@zowe/zos-jobs-for-zowe-sdk": "7.28.3", + "@zowe/zos-logs-for-zowe-sdk": "7.28.3", + "@zowe/zos-tso-for-zowe-sdk": "7.28.3", + "@zowe/zos-uss-for-zowe-sdk": "7.28.3", + "@zowe/zos-workflows-for-zowe-sdk": "7.28.3", + "@zowe/zosmf-for-zowe-sdk": "7.28.3", "comment-json": "^4.1.1", "find-process": "1.4.7", "get-stream": "6.0.1", @@ -26007,6 +26018,12 @@ "which": "^2.0.2" }, "dependencies": { + "@zowe/secrets-for-zowe-sdk": { + "version": "7.18.6", + "resolved": "https://zowe.jfrog.io/zowe/api/npm/npm-local-release/@zowe/secrets-for-zowe-sdk/-/@zowe/secrets-for-zowe-sdk-7.18.6.tgz", + "integrity": "sha512-3ElVUd5VYWUxVjXRCeM/jmXh9u1rnWtxobQEpgEZ2iNt+PTt3QajIxUH9MxriELVCp7u39AeAG4lfxs3wnrGzA==", + "optional": true + }, "brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -26030,7 +26047,7 @@ "requires": { "@types/js-yaml": "^4.0.0", "@types/uuid": "^8.3.0", - "@zowe/imperative": "5.26.1", + "@zowe/imperative": "5.26.2", "find-up": "^5.0.0", "js-yaml": "^4.0.0", "rimraf": "^3.0.2", @@ -26050,8 +26067,8 @@ "@zowe/core-for-zowe-sdk": { "version": "file:packages/core", "requires": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/imperative": "5.26.1", + "@zowe/cli-test-utils": "7.28.3", + "@zowe/imperative": "5.26.2", "comment-json": "4.1.1", "string-width": "4.2.3" } @@ -26075,7 +26092,7 @@ "@types/rimraf": "^3.0.2", "@types/stack-trace": "^0.0.29", "@types/yargs": "13.0.4", - "@zowe/secrets-for-zowe-sdk": "^7.18.0", + "@zowe/secrets-for-zowe-sdk": "^7.28.3", "chalk": "2.4.2", "cli-table3": "0.6.2", "comment-json": "4.1.1", @@ -26338,9 +26355,9 @@ "version": "file:packages/provisioning", "requires": { "@types/js-yaml": "^4.0.5", - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1", + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2", "js-yaml": "4.1.0" } }, @@ -26354,18 +26371,18 @@ "@zowe/zos-console-for-zowe-sdk": { "version": "file:packages/zosconsole", "requires": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2" } }, "@zowe/zos-files-for-zowe-sdk": { "version": "file:packages/zosfiles", "requires": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1", - "@zowe/zos-uss-for-zowe-sdk": "7.28.2", + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2", + "@zowe/zos-uss-for-zowe-sdk": "7.28.3", "minimatch": "5.0.1" }, "dependencies": { @@ -26390,53 +26407,53 @@ "@zowe/zos-jobs-for-zowe-sdk": { "version": "file:packages/zosjobs", "requires": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1", - "@zowe/zos-files-for-zowe-sdk": "7.28.2" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2", + "@zowe/zos-files-for-zowe-sdk": "7.28.3" } }, "@zowe/zos-logs-for-zowe-sdk": { "version": "file:packages/zoslogs", "requires": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2" } }, "@zowe/zos-tso-for-zowe-sdk": { "version": "file:packages/zostso", "requires": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1", - "@zowe/zosmf-for-zowe-sdk": "7.28.2" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2", + "@zowe/zosmf-for-zowe-sdk": "7.28.3" } }, "@zowe/zos-uss-for-zowe-sdk": { "version": "file:packages/zosuss", "requires": { "@types/ssh2": "^1.11.0", - "@zowe/cli-test-utils": "7.28.2", - "@zowe/imperative": "5.26.1", + "@zowe/cli-test-utils": "7.28.3", + "@zowe/imperative": "5.26.2", "ssh2": "1.15.0" } }, "@zowe/zos-workflows-for-zowe-sdk": { "version": "file:packages/workflows", "requires": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1", - "@zowe/zos-files-for-zowe-sdk": "7.28.2" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2", + "@zowe/zos-files-for-zowe-sdk": "7.28.3" } }, "@zowe/zosmf-for-zowe-sdk": { "version": "file:packages/zosmf", "requires": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2" } }, "abbrev": { diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 99a7897a30..e265fbf4ee 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the Zowe CLI package will be documented in this file. -## Recent Changes +## `7.28.3` - BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) diff --git a/packages/cli/package.json b/packages/cli/package.json index aeae52f39e..79f315dab9 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/cli", - "version": "7.28.2", + "version": "7.28.3", "description": "Zowe CLI is a command line interface (CLI) that provides a simple and streamlined way to interact with IBM z/OS.", "author": "Zowe", "license": "EPL-2.0", @@ -58,17 +58,17 @@ "preshrinkwrap": "node ../../scripts/rewriteShrinkwrap.js" }, "dependencies": { - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1", - "@zowe/provisioning-for-zowe-sdk": "7.28.2", - "@zowe/zos-console-for-zowe-sdk": "7.28.2", - "@zowe/zos-files-for-zowe-sdk": "7.28.2", - "@zowe/zos-jobs-for-zowe-sdk": "7.28.2", - "@zowe/zos-logs-for-zowe-sdk": "7.28.2", - "@zowe/zos-tso-for-zowe-sdk": "7.28.2", - "@zowe/zos-uss-for-zowe-sdk": "7.28.2", - "@zowe/zos-workflows-for-zowe-sdk": "7.28.2", - "@zowe/zosmf-for-zowe-sdk": "7.28.2", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2", + "@zowe/provisioning-for-zowe-sdk": "7.28.3", + "@zowe/zos-console-for-zowe-sdk": "7.28.3", + "@zowe/zos-files-for-zowe-sdk": "7.28.3", + "@zowe/zos-jobs-for-zowe-sdk": "7.28.3", + "@zowe/zos-logs-for-zowe-sdk": "7.28.3", + "@zowe/zos-tso-for-zowe-sdk": "7.28.3", + "@zowe/zos-uss-for-zowe-sdk": "7.28.3", + "@zowe/zos-workflows-for-zowe-sdk": "7.28.3", + "@zowe/zosmf-for-zowe-sdk": "7.28.3", "find-process": "1.4.7", "get-stream": "6.0.1", "lodash": "4.17.21", @@ -79,7 +79,7 @@ "@types/diff": "^5.0.2", "@types/lodash": "^4.14.175", "@types/tar": "^6.1.2", - "@zowe/cli-test-utils": "7.28.2", + "@zowe/cli-test-utils": "7.28.3", "comment-json": "^4.1.1", "strip-ansi": "^6.0.1", "which": "^2.0.2" diff --git a/packages/core/package.json b/packages/core/package.json index 178f3f2ccb..7357687166 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/core-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "description": "Core libraries shared by Zowe SDK packages", "author": "Zowe", "license": "EPL-2.0", @@ -49,8 +49,8 @@ "string-width": "4.2.3" }, "devDependencies": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/imperative": "^5.0.0" diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 60660a6cc4..33ae7bfd6f 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the Imperative package will be documented in this file. -## Recent Changes +## `5.26.2` - BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) - BugFix: Fixed error in REST client when making requests with session type of `SessConstants.AUTH_TYPE_NONE`. [#2219](https://github.com/zowe/zowe-cli/issues/2219) diff --git a/packages/imperative/package.json b/packages/imperative/package.json index 5da51d73d5..df7441b17e 100644 --- a/packages/imperative/package.json +++ b/packages/imperative/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/imperative", - "version": "5.26.1", + "version": "5.26.2", "description": "framework for building configurable CLIs", "author": "Zowe", "license": "EPL-2.0", @@ -98,7 +98,7 @@ "@types/readline-sync": "^1.4.3", "@types/rimraf": "^3.0.2", "@types/stack-trace": "^0.0.29", - "@zowe/secrets-for-zowe-sdk": "^7.18.0", + "@zowe/secrets-for-zowe-sdk": "^7.28.3", "concurrently": "^7.5.0", "cowsay": "^1.2.1", "deep-diff": "^0.3.8", diff --git a/packages/provisioning/CHANGELOG.md b/packages/provisioning/CHANGELOG.md index 3d997e13b7..da89c6c8ef 100644 --- a/packages/provisioning/CHANGELOG.md +++ b/packages/provisioning/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the Zowe provisioning SDK package will be documented in this file. -## Recent Changes +## `7.28.3` - BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) diff --git a/packages/provisioning/package.json b/packages/provisioning/package.json index 8a4b2e43da..b9e6a7ff85 100644 --- a/packages/provisioning/package.json +++ b/packages/provisioning/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/provisioning-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "description": "Zowe SDK to interact with the z/OS provisioning APIs", "author": "Zowe", "license": "EPL-2.0", @@ -49,9 +49,9 @@ }, "devDependencies": { "@types/js-yaml": "^4.0.5", - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^7.0.0", diff --git a/packages/secrets/package.json b/packages/secrets/package.json index dfe705f8cc..efcebdbbcc 100644 --- a/packages/secrets/package.json +++ b/packages/secrets/package.json @@ -3,7 +3,7 @@ "description": "Credential management facilities for Imperative, Zowe CLI, and extenders.", "repository": "https://github.com/zowe/zowe-cli.git", "author": "Zowe", - "version": "7.18.6", + "version": "7.28.3", "homepage": "https://github.com/zowe/zowe-cli/tree/master/packages/secrets#readme", "bugs": { "url": "https://github.com/zowe/zowe-cli/issues" diff --git a/packages/workflows/CHANGELOG.md b/packages/workflows/CHANGELOG.md index 8a7618dbc2..a7aa3f2085 100644 --- a/packages/workflows/CHANGELOG.md +++ b/packages/workflows/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the Zowe z/OS workflows SDK package will be documented in this file. -## Recent Changes +## `7.28.3` - BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) diff --git a/packages/workflows/package.json b/packages/workflows/package.json index 81b9fce498..25f2f61495 100644 --- a/packages/workflows/package.json +++ b/packages/workflows/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zos-workflows-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "description": "Zowe SDK to interact with the z/OS workflows APIs", "author": "Zowe", "license": "EPL-2.0", @@ -45,12 +45,12 @@ "prepack": "node ../../scripts/prepareLicenses.js" }, "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "7.28.2" + "@zowe/zos-files-for-zowe-sdk": "7.28.3" }, "devDependencies": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^7.0.0", diff --git a/packages/zosconsole/CHANGELOG.md b/packages/zosconsole/CHANGELOG.md index 53d96c9252..7a98994933 100644 --- a/packages/zosconsole/CHANGELOG.md +++ b/packages/zosconsole/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the Zowe z/OS console SDK package will be documented in this file. -## Recent Changes +## `7.28.3` - BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) diff --git a/packages/zosconsole/package.json b/packages/zosconsole/package.json index 0c7cd6d689..2e79a9d287 100644 --- a/packages/zosconsole/package.json +++ b/packages/zosconsole/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zos-console-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "description": "Zowe SDK to interact with the z/OS console", "author": "Zowe", "license": "EPL-2.0", @@ -45,9 +45,9 @@ "prepack": "node ../../scripts/prepareLicenses.js" }, "devDependencies": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^7.0.0", diff --git a/packages/zosfiles/CHANGELOG.md b/packages/zosfiles/CHANGELOG.md index 32e557b8ee..fe59a322f8 100644 --- a/packages/zosfiles/CHANGELOG.md +++ b/packages/zosfiles/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the Zowe z/OS files SDK package will be documented in this file. -## Recent Changes +## `7.28.3` - BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) diff --git a/packages/zosfiles/package.json b/packages/zosfiles/package.json index a57258e5ff..0c413b82a5 100644 --- a/packages/zosfiles/package.json +++ b/packages/zosfiles/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zos-files-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "description": "Zowe SDK to interact with files and data sets on z/OS", "author": "Zowe", "license": "EPL-2.0", @@ -49,10 +49,10 @@ "minimatch": "5.0.1" }, "devDependencies": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1", - "@zowe/zos-uss-for-zowe-sdk": "7.28.2" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2", + "@zowe/zos-uss-for-zowe-sdk": "7.28.3" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^7.0.0", diff --git a/packages/zosjobs/package.json b/packages/zosjobs/package.json index 7d879b9cb7..fe50c2eba6 100644 --- a/packages/zosjobs/package.json +++ b/packages/zosjobs/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zos-jobs-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "description": "Zowe SDK to interact with jobs on z/OS", "author": "Zowe", "license": "EPL-2.0", @@ -46,12 +46,12 @@ "prepack": "node ../../scripts/prepareLicenses.js" }, "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "7.28.2" + "@zowe/zos-files-for-zowe-sdk": "7.28.3" }, "devDependencies": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^7.0.0", diff --git a/packages/zoslogs/CHANGELOG.md b/packages/zoslogs/CHANGELOG.md index eb9294b1f3..9b46e411ae 100644 --- a/packages/zoslogs/CHANGELOG.md +++ b/packages/zoslogs/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the Zowe z/OS logs SDK package will be documented in this file. -## Recent Changes +## `7.28.3` - BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) diff --git a/packages/zoslogs/package.json b/packages/zoslogs/package.json index b9ba5d5a67..0b5197caca 100644 --- a/packages/zoslogs/package.json +++ b/packages/zoslogs/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zos-logs-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "description": "Zowe SDK to interact with the z/OS logs", "author": "Zowe", "license": "EPL-2.0", @@ -45,9 +45,9 @@ "prepack": "node ../../scripts/prepareLicenses.js" }, "devDependencies": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^7.0.0", diff --git a/packages/zosmf/CHANGELOG.md b/packages/zosmf/CHANGELOG.md index 5475aa5776..9ac9cfa48c 100644 --- a/packages/zosmf/CHANGELOG.md +++ b/packages/zosmf/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the Zowe z/OSMF SDK package will be documented in this file. -## Recent Changes +## `7.28.3` - BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) diff --git a/packages/zosmf/package.json b/packages/zosmf/package.json index c460dece8f..a6953dc90b 100644 --- a/packages/zosmf/package.json +++ b/packages/zosmf/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zosmf-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "description": "Zowe SDK to interact with the z/OS Management Facility", "author": "Zowe", "license": "EPL-2.0", @@ -44,9 +44,9 @@ "prepack": "node ../../scripts/prepareLicenses.js" }, "devDependencies": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^7.0.0", diff --git a/packages/zostso/CHANGELOG.md b/packages/zostso/CHANGELOG.md index df9360c235..a36471796b 100644 --- a/packages/zostso/CHANGELOG.md +++ b/packages/zostso/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the Zowe z/OS TSO SDK package will be documented in this file. -## Recent Changes +## `7.28.3` - BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) diff --git a/packages/zostso/package.json b/packages/zostso/package.json index df9c88d588..491d846e55 100644 --- a/packages/zostso/package.json +++ b/packages/zostso/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zos-tso-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "description": "Zowe SDK to interact with TSO on z/OS", "author": "Zowe", "license": "EPL-2.0", @@ -45,12 +45,12 @@ "prepack": "node ../../scripts/prepareLicenses.js" }, "dependencies": { - "@zowe/zosmf-for-zowe-sdk": "7.28.2" + "@zowe/zosmf-for-zowe-sdk": "7.28.3" }, "devDependencies": { - "@zowe/cli-test-utils": "7.28.2", - "@zowe/core-for-zowe-sdk": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/core-for-zowe-sdk": "7.28.3", + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^7.0.0", diff --git a/packages/zosuss/CHANGELOG.md b/packages/zosuss/CHANGELOG.md index 6e3fd74388..f302fecf37 100644 --- a/packages/zosuss/CHANGELOG.md +++ b/packages/zosuss/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the Zowe z/OS USS SDK package will be documented in this file. -## Recent Changes +## `7.28.3` - BugFix: Refactored code to reduce the use of deprecated functions to prepare for upcoming Node.js 22 support. [#2191](https://github.com/zowe/zowe-cli/issues/2191) diff --git a/packages/zosuss/package.json b/packages/zosuss/package.json index 1ab17781ab..685f05bdc1 100644 --- a/packages/zosuss/package.json +++ b/packages/zosuss/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zos-uss-for-zowe-sdk", - "version": "7.28.2", + "version": "7.28.3", "description": "Zowe SDK to interact with USS on z/OS", "author": "Zowe", "license": "EPL-2.0", @@ -49,8 +49,8 @@ }, "devDependencies": { "@types/ssh2": "^1.11.0", - "@zowe/cli-test-utils": "7.28.2", - "@zowe/imperative": "5.26.1" + "@zowe/cli-test-utils": "7.28.3", + "@zowe/imperative": "5.26.2" }, "peerDependencies": { "@zowe/imperative": "^5.2.0"