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

feat(cli): wing gen-docs #7056

Merged
merged 19 commits into from
Aug 30, 2024
Merged

feat(cli): wing gen-docs #7056

merged 19 commits into from
Aug 30, 2024

Conversation

Chriscbr
Copy link
Contributor

@Chriscbr Chriscbr commented Aug 28, 2024

Adds a new gen-docs subcommand that generates API documentation for your Wing library. Running wing gen-docs will generate an API.md file in your current directory.

Closes #6905

Checklist

  • Title matches Winglang's style guide
  • Description explains motivation and solution
  • Tests added (always)
  • Docs updated (only required for features)
  • Added pr/e2e-full label if this feature requires end-to-end testing

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

Copy link

Thanks for opening this pull request! 🎉
Please consult the contributing guidelines for details on how to contribute to this project.
If you need any assistance, don't hesitate to ping the relevant owner over Discord.

Topic Owner
Wing SDK and standard library @chriscbr
Wing Console @skyrpex
Wing compiler and language design @chriscbr
VSCode extension and language server @chriscbr
Wing CLI @chriscbr
Documentation @boyney123
Examples @boyney123
Wing Playground @skyrpex

@monadabot
Copy link
Contributor

monadabot commented Aug 28, 2024

Console preview environment is available at https://wing-console-pr-7056.fly.dev 🚀

Last Updated (UTC) 2024-08-30 04:04

@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Aug 28, 2024
@Chriscbr Chriscbr removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Aug 30, 2024
@Chriscbr Chriscbr changed the title WIP: generate docs feat(cli): wing gen-docs Aug 30, 2024
@Chriscbr Chriscbr marked this pull request as ready for review August 30, 2024 03:23
@Chriscbr Chriscbr requested a review from a team as a code owner August 30, 2024 03:23
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Aug 30, 2024
@Chriscbr Chriscbr removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Aug 30, 2024
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Aug 30, 2024
@monadabot
Copy link
Contributor

Benchmarks

Comparison to Baseline ⬜🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
Benchmark Before After Change
version 58ms±0.65 58ms±0.87 0ms (-0.72%)⬜
hello_world.test.w -t sim 418ms±6.12 438ms±20.52 +20ms (+4.73%)🟥
hello_world.test.w -t tf-aws 1531ms±8.9 1536ms±11.67 +5ms (+0.33%)⬜
jsii_big.test.w -t sim 2988ms±13.26 3018ms±16.15 +31ms (+1.03%)⬜
jsii_big.test.w -t tf-aws 3200ms±14.13 3249ms±14.5 +48ms (+1.51%)⬜
functions_1.test.w -t sim 414ms±7.15 418ms±4.96 +4ms (+1.05%)⬜
functions_1.test.w -t tf-aws 877ms±5.29 883ms±12.29 +7ms (+0.74%)⬜
empty.test.w -t sim 377ms±3.92 380ms±3.42 +3ms (+0.75%)⬜
empty.test.w -t tf-aws 621ms±7.23 632ms±5.12 +11ms (+1.83%)⬜
functions_10.test.w -t sim 507ms±16.1 506ms±15.36 -1ms (-0.17%)⬜
functions_10.test.w -t tf-aws 2205ms±19.8 2252ms±10.99 +47ms (+2.13%)⬜
jsii_small.test.w -t sim 384ms±3.5 392ms±4.74 +8ms (+1.97%)⬜
jsii_small.test.w -t tf-aws 631ms±5.37 644ms±5.35 +14ms (+2.2%)⬜

⬜ Within 1.5 standard deviations
🟩 Faster, Above 1.5 standard deviations
🟥 Slower, Above 1.5 standard deviations

Benchmarks may vary outside of normal expectations, especially when running in GitHub Actions CI.

Results
name mean min max moe sd
version 58ms 56ms 60ms 1ms 1ms
hello_world.test.w -t sim 438ms 420ms 514ms 21ms 29ms
hello_world.test.w -t tf-aws 1536ms 1514ms 1564ms 12ms 16ms
jsii_big.test.w -t sim 3018ms 2983ms 3052ms 16ms 23ms
jsii_big.test.w -t tf-aws 3249ms 3224ms 3279ms 15ms 20ms
functions_1.test.w -t sim 418ms 404ms 427ms 5ms 7ms
functions_1.test.w -t tf-aws 883ms 868ms 924ms 12ms 17ms
empty.test.w -t sim 380ms 373ms 387ms 3ms 5ms
empty.test.w -t tf-aws 632ms 619ms 640ms 5ms 7ms
functions_10.test.w -t sim 506ms 462ms 530ms 15ms 21ms
functions_10.test.w -t tf-aws 2252ms 2233ms 2279ms 11ms 15ms
jsii_small.test.w -t sim 392ms 378ms 403ms 5ms 7ms
jsii_small.test.w -t tf-aws 644ms 631ms 654ms 5ms 7ms
Last Updated (UTC) 2024-08-30 04:09

@Chriscbr Chriscbr removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Aug 30, 2024
@Chriscbr Chriscbr merged commit b976493 into main Aug 30, 2024
13 checks passed
@Chriscbr Chriscbr deleted the rybickic/generate-docs branch August 30, 2024 05:12
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.83.8.

@@ -164,6 +164,12 @@ async function main() {
.hook("preAction", collectAnalyticsHook)
.action(runSubCommand("lsp"));

program
.command("generate-docs")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.command("generate-docs")
.command("docs")

I think wing docs is enough unless you are reserving it for something in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have a wing docs command which opens your browser to winglang.io/docs 🤷

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see...

Is it useful? Maybe we can deprecate it and reuse it for doc generation, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate API documentation for Wing libraries
3 participants