-
Notifications
You must be signed in to change notification settings - Fork 221
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
Fix and refactor the generate-docs subcommand #788
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! We already merged this new command, hence, this might be a breaking change for folks. However, I don't believe this might be utilized yet as we have not updated our *-starter repos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package
and publish
commands use a positional argument for this, should we align the doc command with those. E.g. from the publish
command:
devcontainer features publish <target>
Package and publish Features
Positionals:
target
Package and publish features at provided [target] (default is cwd), where [target] is either:
1. A path
to the src folder of the collection with [1..n] features.
2. A path to a single feature that contains a d
evcontainer-feature.json.
[string] [required] [default: "."]
Options:
--help Show help [boolean]
--version Show version number [boolean]
-r, --registry Name of the OCI registry. [string] [default: "ghcr.io"]
-n, --namespace Unique indentifier for the collection of features. Example: <owner>/<repo> [string] [required]
--log-level Log level. [choices: "info", "debug", "trace"] [default: "info"]
You're right, it's better, I'll switch to this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, left a few comments.
@@ -191,8 +186,36 @@ async function _generateDocumentation( | |||
} | |||
|
|||
// Write new readme | |||
fs.writeFileSync(readmePath, newReadme); | |||
} | |||
fs.writeFileSync(readmePath, newReadme); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use async variant to allow other code to make progress while this is waiting for completion.
|
||
export function GenerateDocsOptions(y: Argv, collectionType: GenerateDocsCollectionType) { | ||
return y | ||
.options({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we keep --project-folder
and -p
as a hidden option with a warning message in the log when used for compatibility? Since this has been available for a few weeks users might have picked it up and removing it could break things locally or in CIs.
Related to #759
Sorry it should not be the
project-folder
, but thesrc
folder directly, for example:should be
./src/test/container-templates/example-templates-sets/simple/src
not./src/test/container-templates/example-templates-sets/simple
So I rename it in order to avoid the confusing.