-
Notifications
You must be signed in to change notification settings - Fork 787
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(docs): provide docs-custom-elements output targets #2354
Conversation
Thanks for the PR. Unfortunately, it's just a self-called standard, we have never been asked for feedback even though our docs-json came first. In the meantime, stencil supports We can leave this PR open after there is some traction |
I guess we could merge it, i am just not sure |
.map((style) => ({ | ||
name: style.name, | ||
description: style.docs, | ||
})), |
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.
We can add cssShadowParts
too
c22e08b
to
c471830
Compare
@manucorporat I am indeed using the |
description: style.docs, | ||
})), | ||
|
||
cssShadowParts: component.docsTags |
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.
We already have component
parts
c471830
to
1a508a1
Compare
Follows the draft outlined in webcomponents/custom-elements-manifest#8 Closes: ionic-team#2048
1a508a1
to
8114c6c
Compare
Hello @runarberg can you share you |
@dmartinjs sure: Note that storybook uses experimental field names compatible with web-component-analizer ( import { promises as fs } from 'fs';
import { Config } from '@stencil/core';
import { JsonDocs } from '@stencil/core/internal';
async function generateCustomElementsJson(docsData: JsonDocs) {
const jsonData = {
version: 1.2,
tags: docsData.components.map((component) => ({
name: component.tag,
path: component.filePath,
description: component.docs,
attributes: component.props
.filter((prop) => prop.attr)
.map((prop) => ({
name: prop.attr,
type: prop.type,
description: prop.docs,
defaultValue: prop.default,
required: prop.required,
})),
properties: component.props.map((prop) => ({
name: prop.name,
type: prop.type,
description: prop.docs,
defaultValue: prop.default,
required: prop.required,
})),
events: component.events.map((event) => ({
name: event.event,
description: event.docs,
})),
methods: component.methods.map((method) => ({
name: method.name,
description: method.docs,
signature: method.signature,
})),
slots: component.slots.map((slot) => ({
name: slot.name,
description: slot.docs,
})),
cssProperties: component.styles
.filter((style) => style.annotation === 'prop')
.map((style) => ({
name: style.name,
description: style.docs,
})),
cssParts: component.parts.map((part) => ({
name: part.name,
description: part.docs,
})),
})),
};
await fs.writeFile(
'./custom-elements.json',
JSON.stringify(jsonData, null, 2),
);
}
export const config: Config = {
// ...
outputTargets: [
// ...
{
type: 'docs-custom',
generator: generateCustomElementsJson,
},
],
}; |
Is there some news on this feature ? |
@manucorporat This pull request has been open since April 2020... please can you add this feature?? We have also been waiting on this for a long time, and would rather have this built in than using a third-party dependency. It is also not great if people invest time an effort in creating PRs to add new functionality and they are not merged fairly quickly or given suggestions for improvement. There is even a further question above from October 2020, asking if there is any news on this feature, and absolutely no response from anyone. If it takes this long for them to be merged, people will simply stop contributing :-} |
@LeeBurton I think this PR is obsolete. The standard in question has changed a little since I opened this PR almost a year ago (see current schema). E.g. now they use This PR would need some work before it could be merged. |
Thanks @runarberg for raising the PR. I will go ahead and close this and propose for anyone interested in this to upvote #2048 so we can gauge interest. |
Follows the draft outlined in webcomponents/custom-elements-manifest#8
Closes: #2048