-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
readme is missing documentation for the new commands #123
Comments
Yeah, just watch out that it might generate documentation of commands separated by colons ( |
Hi @Souvikns 👋, automating this would be really interesting so that when we add new commands, the docs on the I'd like to help with this issue if no one is working on it 🙂. I messed around with Usage$ npm install -g @asyncapi/cli
$ asyncapi COMMAND
running command...
$ asyncapi (-v|--version|version)
@asyncapi/cli/0.12.7 linux-x64 node-v16.13.0
$ asyncapi --help [COMMAND]
USAGE
$ asyncapi COMMAND
... Commands
|
Awesome @BOLT04 the generated docs are correct 👍🏻. No one is working on this issue as of now so you can take it up. Yeah the CLI is kinda breaking in production but it works fine in the development and you can just clone the repo and run |
the only problem with the generated stuff is |
The new version has some inbuilt support for topic separators maybe this would help. |
ok, then for this issue we'll wait on #203 👍 . Then setup the Is there a better way to run this script what does everyone think? |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
@BOLT04, cli documentation was a part of GSoD, but don't know what is the status. asyncapi/website#602, #232 were planned for this. I don't know if anyone is working on CLI documentation right now. Give me some time, I will check on the status and update you. |
@Souvikns we can continue on the CLI command reference using this tool |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
I think this one is still valid |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
this is still valid, although I'm not sure what the solution is |
Ok, looks like thanks to the fact that we recently upgraded to almost latest oclif version, we can use So the scope for this one is:
I will add this issue to trial of AsyncAPI Bounty -> https://github.com/orgs/asyncapi/discussions/541#discussioncomment-5532370 |
This issue is part of the AsyncAPI Bounty Program, interested contributors need to follow the guidelines below to ensure fairness and timely completion of assigned tasks: Task AssignmentThe assignment of tasks will be prioritized in the following order:
We encouraged everyone to apply as long as the task is for you (falls under your skill set). We will not be using the first comment - get assigned method for assignments. Instead, we will provide 3 days to consider all individuals interested before assigning any bounty task. DeadlineTo maintain accountability and ensure the timely completion of the deadline for this task will be 4- 6 weeks from the date of assignment. If a contributor requires an extension on their task, it should be communicated and approved by the maintainer. Issue Tracking and UpdatesContributors must provide weekly updates on the task they are working on to help maintainers stay informed of progress. If a contributor fails to provide an update, they will be reminded via a ping. If a contributor fails to provide an update after three pings over three weeks, we will assume they have silently dropped the issue, and it will be reassigned to someone else. Issue Drop-outsAny contributor who drops an assigned issue will be penalized and will not be eligible to participate in the bounty program for 6 months. We understand that unforeseen circumstances can arise, and dropping an assigned issue may be unavoidable in some cases. However, we believe that enforcing this penalty is necessary to ensure the effectiveness of the bounty program, respect maintainer time, and honor the efforts of other contributors who could have solved the issue but were unable to do so due to the drop-out. We encourage all contributors to follow these guidelines to ensure a fair and timely completion of tasks assigned through our bounty program. |
I would like to work on this issue. |
@mhmohona I just assigned this issue to you to make it clear for others you work on it @mediba123 we actually have automation that updates table of contents in readme and also a contribution guide. Did you check it before making that comment? 😄 |
@mhmohona how is the task going so far?? |
Hello @thulieblack, I am alsmot done with the task. |
@mhmohona I'm pretty sure it is because of some delay on can you open a followup PR with fix like below: /* eslint-disable @typescript-eslint/no-var-requires */
const {writeFile, readFile} = require('fs').promises;
// Define the paths to the README and usage files
const README_PATH = './scripts/README.md'; // File path for the generated README file
const USAGE_PATH = './docs/usage.md'; // File path for the usage documentation file
const header = `---
title: 'Usage'
weight: 40
---
<!--
This file is automatically generated from updateUsageDocs.js script. In package.json in line 158-161 lines the following steps has been executed in order to run this script successfully -
* generate:readme:create: It creates the initial content for the README file by printing the usage and commands tags using printf and redirects the output to scripts/README.md file.
* generate:readme:commands: It changes the directory to the scripts folder and executes the oclif readme command. This command generates the usage and commands sections based on the CLI commands and updates the content in the scripts/README.md file.
* generate:assets: This script combines the two previously mentioned scripts (generate:readme:toc and generate:commands) to generate the necessary assets, such as the README file and usage documentation.
* generate:commands: This script executes the following steps:
- Runs the generate:readme:create script to create the initial content for the README file.
- Executes the generate:readme:commands script to generate the usage and commands sections based on the CLI commands.
- Runs the updateUsageDocs.js script using Node.js to update the usage documentation file with the contents of the generated README file.
- Deletes the scripts/README.md file using the rimraf command.
-->
The AsyncAPI CLI makes it easier to work with AsyncAPI documents.
`;
// Define an async function to write the header and the README contents to the usage documentation file
async function run() {
try {
await writeFile(USAGE_PATH, header);
const readmeContents = await readContents();
// Append the contents of the README file to the usage documentation file
await writeFile(USAGE_PATH, readmeContents, { flag: 'a' });
} catch (e) {
console.error(e);
}
}
run();
async function readContents() {
let readmeContents;
let commandsContent = '';
while (commandsContent.length === 0) {
readmeContents = await readFile(README_PATH, 'utf8');
// Check if the content between <!-- commands --> and <!-- commandsstop --> is empty
const commandsStartText = '<!-- commands -->';
const commandStartIndex = readmeContents.indexOf(commandsStartText);
const commandStopIndex = readmeContents.indexOf('<!-- commandsstop -->');
//cutting the content between the above mentioned tags, removing white spaces and checking if there is some text as it will mean text was added by oclif
commandsContent = readmeContents.slice(commandStartIndex + commandsStartText.length, commandStopIndex).trim();
if (commandsContent.length === 0) {
console.log('No content between <!-- commands --> and <!-- commandsstop -->. Trying again...');
} else {
console.log('Content found!');
}
await delay(3000); // 3-second delay
}
return readmeContents;
}
function delay(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
} |
Thank you so much for pointing this @derberg! I have updated the code and created new PR. I thought of adding it but then thought it might be unnecessary but it seems it is needed. :3 |
ok, so 😄 it didn't work workflow was running for over 3min and below was just logged out
I don't think it is normal so I cancelled the run. Not sure yet what is the solution |
I can't figure from their code what might be wrong, but we can log more things in the GitHub Action so please open another PR with change in the so basically make sure it says this will give us a lot of insights and info where it stucks with commands generation |
🎉 This issue has been resolved in version 0.45.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@mhmohona is still doesn't work, logs show
while on local I get
so looks like oclif cannot figure what commands are available, but I do not know why |
we could add a step in CI that checks |
@mhmohona congrats, topic completed. Look what we got on the website thanks to your work ❤️ -> https://www.asyncapi.com/docs/tools/cli/usage @thulieblack another bounty issue completed, over to you cc @Souvikns fyi usage docs are not automatically updated 💪🏼 |
Hey, @mhmohona, congratulations on completing your issue!! This is how'll claim your bounty:
|
Oclif has a way to generate command help documentation if we are going with that we just need to set it up.
The text was updated successfully, but these errors were encountered: