-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
jsdoc: document all top-level schemas #3124
Conversation
…ail, Accounts. add @namespace for Schema to hold all methods and constants for schemas.
@aaronjudd Here's a stab at creating a template for documenting Schemas. @spencern Added you as a reviewer so you can look at how I documented Schemas in the |
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.
This looks good to me. I like that you're finding ways to organize Schemas together like this, feels like a straightforward and clean way to do this.
Only question that I've got so far is how could we link schemas that are connected when a property for a schema is a the other schema's type
* @property {String} settings.password Shopify API password | ||
* @property {String} settings.sharedSecret Shopify API shared secret | ||
* @property {String} settings.shopName Shop slug | ||
* @property {Array} settings.webhooks Array of registered Shopify webhooks |
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.
For properties that are arrays of other schemas, is there a good way to link to the other schema from the description of this property?
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.
This is possible!
Looks like this in the code:
* @property {Metafield[]} metafields optional
And if jsdoc
finds a Metafield
symbol, it will link to the symbol accordingly.
So that line could be rewritten like:
* @property {Webhooks[]} webhooks Array of registered Shopify webhooks
and that will link to the Webhooks Schema
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 less automagical way to link from one symbol to another in the code is like this:
@see {@link foo} for further information.
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 automagical way is pretty cool
WIP - Will have this done by end of day. |
362ae49
to
11e60cc
Compare
Updated + finished documenting all top-level schemas. |
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.
Will wait a bit to see if there is a fix for the commas, but ok with merging anytime.
@aaronjudd Fixes all the |
What this PR does:
@typedef
for theSimpleSchema
class. This does not need to be defined anywhere else.SimpleSchema
classes in Core (e.g.TaxSettings
,Profile
,Email
...)SimpleSchema
classes in plugins, using theconnectors-shopify
as an example.How that renders:
The Type Definition: Anytime someone adds
{SimpleSchema}
, it will create a link to here:Core schemas and schema helper methods in the sidebar:
Core schemas defined, all on one
Schema
page: TheSimpleSchema
will link to Type Definition from 1.Schema helper methods at the bottom of the
Schema
page:Package schemas defined in its own package page, example:
connectors-shopify
:How to do it:
@type {SimpleSchema}
@type {SimpleSchema}
along with@memberof schemas
💡 ProTip: Specify an Array of Strings with this syntax:⚠️
{String[]}
.{[String]}
will break!