From 18ef0c0ea01043e18cbd37db87bbbb2eacd4ec55 Mon Sep 17 00:00:00 2001 From: Amber Torrise Date: Fri, 15 Mar 2024 11:49:58 -0400 Subject: [PATCH] updates based on comments. also updates to tests. fails locally but i think will pass on gh Signed-off-by: Amber Torrise --- CHANGELOG.md | 2 +- CONTRIBUTING.md | 4 ++-- README.md | 2 +- .../cli.list.profile-args.integration.test.ts.snap | 1 - .../cli/list/cli.list.profile-args.integration.test.ts | 3 +-- .../cli/list/profile-args/ProfileArgs.handler.test.ts | 1 - .../__snapshots__/ProfileArgs.handler.test.ts.snap | 1 - .../list-typicode-todo/ListTypicodeTodoPlugin.md | 4 ++-- package.json | 4 ++-- src/cli/list/profile-args/ProfileArgs.handler.ts | 10 +++------- 10 files changed, 12 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dd1cb8..48652e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -All notable changes to the Sample plug-in for Zowe CLI will be documented in this file. +All notable changes to the sample plug-in for Zowe CLI will be documented in this file. ## Recent Changes diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f1cfca4..cdc15d2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,5 @@ # Contribution guidelines -This document is intended to be a living summary of conventions & best practices for development within Sample plug-infor Zowe CLI. +This document is intended to be a living summary of conventions & best practices for development within Sample plug-in for Zowe CLI. ## Changelog update guidelines @@ -28,6 +28,6 @@ We provide guidelines for developing Zowe CLI plug-ins in the [Zowe CLI GitHub r Versioning conventions for Zowe CLI and plug-ins| [Versioning Guidelines](https://github.com/zowe/zowe-cli/blob/master/docs/MaintainerVersioning.md) | ## Contribution guidelines specific to the CICS plug-in -The following guidelines apply specifically to the Sample plug-infor Zowe CLI: +The following guidelines apply specifically to the Sample plug-in for Zowe CLI: - None at this time. diff --git a/README.md b/README.md index c0f298e..bb2c760 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Zowe CLI sample plug-in -This repository contains a sample Zowe CLI plug-in that adheres to the contribution guidelines for the project. Use this project and the associated tutorials as a starting point for creating Zowe CLI Plug-ins. +This repository contains a sample Zowe CLI plug-in that adheres to the contribution guidelines for the project. Use this project and the associated tutorials as a starting point for creating Zowe CLI plug-ins. - [Zowe CLI sample plug-in](#zowe-cli-sample-plug-in) - [Sample plug-in overview](#sample-plug-in-overview) diff --git a/__tests__/__integration__/cli/list/__snapshots__/cli.list.profile-args.integration.test.ts.snap b/__tests__/__integration__/cli/list/__snapshots__/cli.list.profile-args.integration.test.ts.snap index c2c748e..55c6b44 100644 --- a/__tests__/__integration__/cli/list/__snapshots__/cli.list.profile-args.integration.test.ts.snap +++ b/__tests__/__integration__/cli/list/__snapshots__/cli.list.profile-args.integration.test.ts.snap @@ -9,7 +9,6 @@ exports[`zowe-cli-sample list profile-args command should list profile args from rejectUnauthorized: true tshirtSize: M environment: - usingTeamConfig: true sampleProfileName: my_sample baseProfileName: my_base " diff --git a/__tests__/__integration__/cli/list/cli.list.profile-args.integration.test.ts b/__tests__/__integration__/cli/list/cli.list.profile-args.integration.test.ts index 50c53a3..8ea40aa 100644 --- a/__tests__/__integration__/cli/list/cli.list.profile-args.integration.test.ts +++ b/__tests__/__integration__/cli/list/cli.list.profile-args.integration.test.ts @@ -10,7 +10,7 @@ import * as fs from "fs"; import * as path from "path"; -import { ITestEnvironment, TestEnvironment, runCliScript, isStderrEmptyForProfilesCommand } from "@zowe/cli-test-utils"; +import { ITestEnvironment, TestEnvironment, runCliScript } from "@zowe/cli-test-utils"; import { ITestPropertiesSchema } from "../../../__src__/environment/doc/ITestPropertiesSchema"; // Test environment will be populated in the "beforeAll" @@ -45,7 +45,6 @@ describe("zowe-cli-sample list profile-args command", () => { expect(output).toMatch(/port:\s+1337/); expect(output).toMatch(/user:\s+user1/); expect(output).toMatch(/password:\s+123456/); - expect(output).toMatch(/usingTeamConfig:\s+true/); expect(output).toMatch(/sampleProfileName:\s+my_sample/); expect(output).toMatch(/baseProfileName:\s+my_base/); expect(output).toMatchSnapshot(); diff --git a/__tests__/cli/list/profile-args/ProfileArgs.handler.test.ts b/__tests__/cli/list/profile-args/ProfileArgs.handler.test.ts index 778043d..f3f63eb 100644 --- a/__tests__/cli/list/profile-args/ProfileArgs.handler.test.ts +++ b/__tests__/cli/list/profile-args/ProfileArgs.handler.test.ts @@ -67,7 +67,6 @@ describe("profile-args Handler", () => { rejectUnauthorized: true }, environment: { - usingTeamConfig: true, sampleProfileName: "fakeSample", baseProfileName: "fakeBase" } diff --git a/__tests__/cli/list/profile-args/__snapshots__/ProfileArgs.handler.test.ts.snap b/__tests__/cli/list/profile-args/__snapshots__/ProfileArgs.handler.test.ts.snap index 517076c..a5f324d 100644 --- a/__tests__/cli/list/profile-args/__snapshots__/ProfileArgs.handler.test.ts.snap +++ b/__tests__/cli/list/profile-args/__snapshots__/ProfileArgs.handler.test.ts.snap @@ -15,7 +15,6 @@ Object { "environment": Object { "baseProfileName": "fakeBase", "sampleProfileName": "fakeSample", - "usingTeamConfig": true, }, }, } diff --git a/docs/tutorials/list-typicode-todo/ListTypicodeTodoPlugin.md b/docs/tutorials/list-typicode-todo/ListTypicodeTodoPlugin.md index 182898a..793709a 100644 --- a/docs/tutorials/list-typicode-todo/ListTypicodeTodoPlugin.md +++ b/docs/tutorials/list-typicode-todo/ListTypicodeTodoPlugin.md @@ -1,4 +1,4 @@ -# Extending a plug-in +# Extending a plug-in Before you begin, be sure to complete the [Installing the sample plug-in]() tutorial. ## Overview @@ -161,7 +161,7 @@ is presented. You can also see how to use your optional `--id` flag: ![output](images/completedSample.png) # Summary -You extended an existing Zowe CLI plug-inby introducing a Node.js programmatic API, and you created a command definition with a handler. +You extended an existing Zowe CLI plug-in by introducing a Node.js programmatic API, and you created a command definition with a handler. For an official plugin, you would also add [JSDoc](http://usejsdoc.org/) to your code and create tests. Completed source can be found on the `typicode-todos` branch of this repo. diff --git a/package.json b/package.json index c78ccf8..e801ba6 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "@typescript-eslint/parser": "^5.59.5", "@zowe/cli": "^7.23.2", "@zowe/cli-test-utils": "^7.23.2", - "@zowe/imperative": "^5.0.0-next", + "@zowe/imperative": "^8.0.0-next", "env-cmd": "^8.0.2", "eslint": "^8.40.0", "eslint-plugin-jest": "^27.2.1", @@ -83,7 +83,7 @@ "uuid": "^3.4.0" }, "peerDependencies": { - "@zowe/imperative": "^5.0.0-next" + "@zowe/imperative": "^8.0.0-next" }, "jest": { "modulePathIgnorePatterns": [ diff --git a/src/cli/list/profile-args/ProfileArgs.handler.ts b/src/cli/list/profile-args/ProfileArgs.handler.ts index 18cef66..82d38d4 100644 --- a/src/cli/list/profile-args/ProfileArgs.handler.ts +++ b/src/cli/list/profile-args/ProfileArgs.handler.ts @@ -26,7 +26,6 @@ export default class ProfileArgsHandler extends ListBaseHandler { */ public async processWithSession(params: IHandlerParameters, session: Session): Promise { // Build an output object for command response - const usingTeamConfig = ImperativeConfig.instance.config?.exists || false; const output: any = { arguments: { // Load connection info from session object @@ -39,15 +38,12 @@ export default class ProfileArgsHandler extends ListBaseHandler { tshirtSize: params.arguments.tshirtSize }, environment: { - usingTeamConfig } }; - // Show names of base and sample profiles if they exist - if (usingTeamConfig) { - output.environment.sampleProfileName = ImperativeConfig.instance.config.properties.defaults.sample; - output.environment.baseProfileName = ImperativeConfig.instance.config.properties.defaults.base; - } + // Show names of base and sample profiles + output.environment.sampleProfileName = ImperativeConfig.instance.config.properties.defaults.sample; + output.environment.baseProfileName = ImperativeConfig.instance.config.properties.defaults.base; // Set output for --rfj response and print it to console params.response.data.setObj(output);