Skip to content

Commit

Permalink
updates based on comments. also updates to tests. fails locally but i…
Browse files Browse the repository at this point in the history
… think will pass on gh

Signed-off-by: Amber Torrise <[email protected]>
  • Loading branch information
Amber Torrise committed Mar 15, 2024
1 parent fea3044 commit 18ef0c0
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ describe("profile-args Handler", () => {
rejectUnauthorized: true
},
environment: {
usingTeamConfig: true,
sampleProfileName: "fakeSample",
baseProfileName: "fakeBase"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Object {
"environment": Object {
"baseProfileName": "fakeBase",
"sampleProfileName": "fakeSample",
"usingTeamConfig": true,
},
},
}
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/list-typicode-todo/ListTypicodeTodoPlugin.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -83,7 +83,7 @@
"uuid": "^3.4.0"
},
"peerDependencies": {
"@zowe/imperative": "^5.0.0-next"
"@zowe/imperative": "^8.0.0-next"
},
"jest": {
"modulePathIgnorePatterns": [
Expand Down
10 changes: 3 additions & 7 deletions src/cli/list/profile-args/ProfileArgs.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export default class ProfileArgsHandler extends ListBaseHandler {
*/
public async processWithSession(params: IHandlerParameters, session: Session): Promise<void> {
// Build an output object for command response
const usingTeamConfig = ImperativeConfig.instance.config?.exists || false;
const output: any = {
arguments: {
// Load connection info from session object
Expand All @@ -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);
Expand Down

0 comments on commit 18ef0c0

Please sign in to comment.