-
Notifications
You must be signed in to change notification settings - Fork 421
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
chore: add docgen script #7387
chore: add docgen script #7387
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
No changes to documentation |
Component Testing Report Updated Aug 20, 2024 9:25 AM (UTC)
|
{ | ||
_type: 'span', | ||
marks: [], | ||
text: lorem(options.size / 2), |
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.
going to be honest the names of these functions felt a bit cryptic initially 😄
I think we could benefit from having a small comment / a slight renaming over on lorem-bytes.ts ?
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.
what was cryptic about them? what would be a better name?
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.
I think that in terms of naming it could be something related more to getSampleText
or something along those lines (though I'm not married to the name, the name lorem
does invoke sample / placeholder text)
However, my first gut feeling was: why do I have to pass the options.size
into this, and what does it have to do with the sampling. Just to confirm that I understood it, this is more about making sure that the content in this PTE is not all the same text so that there is some variation between the docs generated, right?
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.
Renamed lorem
to loremString
and added some tsdocs here – hopefully that made things a bit clearer :)
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.
getSampleText would be ok, but loremText feels more specific (it is generating lorem-ipsum text after all).
Just to confirm that I understood it, this is more about making sure that the content in this PTE is not all the same text so that there is some variation between the docs generated, right?
Yep! Sometimes you might want to generate large documents, so this provides the ability to specify the desired byte size of the documents you're generating.
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.
Just a small comment, otherwise this is really nice :)
I was thinking while reviewing if this isn't something that would be useful to have directly on next
though. Sure it wouldn't have the bundle things but it is a pretty useful thing overall.
Excellent point - will make it towards next. |
7d1379a
to
7802e15
Compare
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.
✅
* chore: add docgen script * fixup! chore: add docgen script * fixup! chore: add docgen script
Description
Adds a script to the monorepo that allows generating documents based on a template. Useful for testing.
Can also be run via
pnpm run generate:docs
, e.g.pnpm run generate:docs --template book
Requires an environment variable in
.env.local
that points at a valid write token for the test project:What to review
Does it make sense?
Testing
n/a internal dev tooling
Notes for release
n/a