Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing imperative.ts file #3582

Closed
rkeahey opened this issue Apr 2, 2024 · 8 comments · Fixed by #3587 or #3606
Closed

Missing imperative.ts file #3582

rkeahey opened this issue Apr 2, 2024 · 8 comments · Fixed by #3587 or #3606
Assignees
Labels
area: cli This issue is related to Zowe Command Line Interface (CLI)

Comments

@rkeahey
Copy link

rkeahey commented Apr 2, 2024

URL: https://docs.zowe.org/v2.13.x/extend/extend-cli/cli-developing-a-plugin

In the step "Adjusting Imperative CLI Framework configuration" the instructions indicate to

"Change the src/imperative.ts file to contain the following configurations:"

However, there is no imperative.ts file in the src directory for the zip archive. Therefore one must be created from scratch.

@anaxceron anaxceron self-assigned this Apr 3, 2024
@anaxceron anaxceron added the area: cli This issue is related to Zowe Command Line Interface (CLI) label Apr 3, 2024
@github-project-automation github-project-automation bot moved this to New Issues in Zowe CLI Squad Apr 3, 2024
@anaxceron anaxceron linked a pull request Apr 3, 2024 that will close this issue
@anaxceron
Copy link
Collaborator

Hi @rkeahey -- I'm updating the correct file name in the Developing a new Zowe CLI plug-in article with PR 3587. Once the pull request is merged, you should be able to find this file in the source code zip file and be good to go.
If you encounter any problems, give us a shout.

@rkeahey
Copy link
Author

rkeahey commented Apr 3, 2024

Thanks!

I'm not sure how to report this (could be a problem on my end...), but when I follow the instructions as written I get an error when doing "zowe plugins install files-util"

The message is:
Command Error:
Install Failed
Error Details:
Imperative requires configuration before it can be used. No configuration was passed to init(), and no configuration was present in package.json. Please provide configuration.

Have followed the steps several times with the same result.

Sorry if I'm reporting this at the wrong place. I'm very new to the ZOWE/CLI environment. Any guidance would be appreciated!

@github-project-automation github-project-automation bot moved this from New Issues to Closed in Zowe CLI Squad Apr 3, 2024
@anaxceron
Copy link
Collaborator

Thanks!

I'm not sure how to report this (could be a problem on my end...), but when I follow the instructions as written I get an error when doing "zowe plugins install files-util"

The message is: Command Error: Install Failed Error Details: Imperative requires configuration before it can be used. No configuration was passed to init(), and no configuration was present in package.json. Please provide configuration.

Have followed the steps several times with the same result.

Sorry if I'm reporting this at the wrong place. I'm very new to the ZOWE/CLI environment. Any guidance would be appreciated!

@rkeahey -- will be discussing this w/ the devs. something else might've changed on our end. not sure yet. even though the PR has been merged and the file name has been updated, I'm leaving your issue open so that we can keep track of it. expect a response soon. also, know that you can also use Slack to reach out -- https://openmainframeproject.slack.com/archives/CC08782AG

@anaxceron anaxceron reopened this Apr 3, 2024
@github-project-automation github-project-automation bot moved this from Closed to New Issues in Zowe CLI Squad Apr 3, 2024
@zFernand0
Copy link
Member

zFernand0 commented Apr 3, 2024

Hey @rkeahey,

The command you want to use is zowe plugins install <path/to/zowe-tutorial/files-util> since you are developing a plugin which has not been published yet. Since you are likely inside (or cd into) the files-util directory on your terminal, the command may just be zowe plugins install . which indicates that you want to install from the current working directory.

There may be other small issues you might be running into, even after running the correct CLI command. We will be updating the steps to make sure the process is smoother going forward 😋

In the meantime, here are some steps that might help you in case you need to start working on this right away.

  1. Remove the src/index.ts file
  2. Fix the license headers by running the command: npm run lint -- --fix

Oh, and make sure to run npm run build before installing the plugin with zowe plugins install .

@rkeahey
Copy link
Author

rkeahey commented Apr 3, 2024

Thanks! I did all the steps you outlined above and then ran npm run build, then zowe plugins install .

I god a couple of "CmdErrors" shown in the following log snippet. Don't know if they will be useful for you, but thought I would pass them on.

C:\Users\rhkea\Documents\QuickRef_Data\zowe-tutorial\files-util>zowe plugins install .
Plug-ins within the Imperative CLI Framework can legitimately gain
control of the zowe CLI application during the execution of every command.
Install 3rd party plug-ins at your own risk.

Registry = https://registry.npmjs.org/


[2024/04/03 14:15:44.784] [WARN] [LifeCycleForSample.js:63] Something weird happened in the sample plugin's postInstall function. However, things should still work ok.
Installed plugin name = '@zowe/files-util'

_____ Validation results for plugin '@zowe/files-util' _____

*** CmdError: The plugin named 'compare-files' attempted to add a group of command with the alias 'zcsp', which conflicts with another alias of the same name for group 'zowe-cli-sample'.

*** CmdError: The plugin's profile type = 'sample' already exists within existing profiles.

This plugin has command errors. No plugin commands will be available.

@rkeahey
Copy link
Author

rkeahey commented Apr 3, 2024

If it helps, I ran the Developing for Zowe CLI steps in sequence (https://docs.zowe.org/v2.13.x/extend/extend-cli/cli-devtutorials/). I think this is causing some of the conflicts shown above. I changed the pluginDef: pluginAliases: to "zscp2" in pluginDef.ts and the first error went away. I changed the profiles:type to "sample2" in pluginDef.ts and the second error went away. I think the issue is that the samples are all using the same sample-plugin-master source files.

After I made these changes and ran npm run build again and then zowe plugins install . again, the plugin worked!

@zFernand0
Copy link
Member

zFernand0 commented Apr 4, 2024

Hey @rkeahey, 👋🏽

Yeah, it's likely that you already had the sample plugin installed and it had reserved the profile types and group alias😅

You could uninstall the sample plug-in if you truly want to use the original aliases with your files-util package 😁

Either way, I'm glad to hear you were able to get the plug-in working. 🎉

And thanks for sharing the snippet, we might be able to include it as part of the Zowe Docs once we update it 😋

We can close this issue after updating the steps to mention the few things that helped you get it to work. 🥳

Cheers! 🥂

@anaxceron
Copy link
Collaborator

@rkeahey -- I'm updating the extending content in PR 3606. Please review and let me know if we're missing anything.

@JTonda JTonda moved this from New Issues to In Progress in Zowe CLI Squad Apr 15, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Closed in Zowe CLI Squad Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cli This issue is related to Zowe Command Line Interface (CLI)
Projects
None yet
3 participants