Update lit-starter-ts to lit-next
* Upgrades the source to work with lit-next * Aligns the linting and formatting rules/settings & ignores with the monorepo * Upgrades to the same version of typescript and tsconfig settings as the monorepo * Upgrades the test runner from karma to web-test-runner * Upgrades the dev server from es-dev-server to @web/dev-server
This commit is contained in:
@@ -15,7 +15,9 @@ module.exports = class Docs {
|
||||
const tags = customElements.tags;
|
||||
return `
|
||||
<h1>API</h1>
|
||||
${tags.map((tag) => `
|
||||
${tags
|
||||
.map(
|
||||
(tag) => `
|
||||
<h2><${tag.name}></h2>
|
||||
<div>
|
||||
${tag.description}
|
||||
@@ -23,41 +25,40 @@ module.exports = class Docs {
|
||||
${renderTable(
|
||||
'Attributes',
|
||||
['name', 'description', 'type', 'default'],
|
||||
tag.attributes)}
|
||||
tag.attributes
|
||||
)}
|
||||
${renderTable(
|
||||
'Properties',
|
||||
['name', 'attribute', 'description', 'type', 'default'],
|
||||
tag.properties)}
|
||||
${/*
|
||||
tag.properties
|
||||
)}
|
||||
${
|
||||
/*
|
||||
* Methods are not output by web-component-analyzer yet (a bug), so
|
||||
* this is a placeholder so that at least _something_ will be output
|
||||
* when that is fixed, and element maintainers will hopefully have a
|
||||
* signal to update this file to add the neccessary columns.
|
||||
*/
|
||||
renderTable(
|
||||
'Methods',
|
||||
['name', 'description'],
|
||||
tag.methods)}
|
||||
${renderTable(
|
||||
'Events',
|
||||
['name', 'description'],
|
||||
tag.events)}
|
||||
${renderTable(
|
||||
'Slots',
|
||||
['name', 'description'],
|
||||
tag.slots)}
|
||||
renderTable('Methods', ['name', 'description'], tag.methods)
|
||||
}
|
||||
${renderTable('Events', ['name', 'description'], tag.events)}
|
||||
${renderTable('Slots', ['name', 'description'], tag.slots)}
|
||||
${renderTable(
|
||||
'CSS Shadow Parts',
|
||||
['name', 'description'],
|
||||
tag.cssParts)}
|
||||
tag.cssParts
|
||||
)}
|
||||
${renderTable(
|
||||
'CSS Custom Properties',
|
||||
['name', 'description'],
|
||||
tag.cssProperties)}
|
||||
`).join('')}
|
||||
tag.cssProperties
|
||||
)}
|
||||
`
|
||||
)
|
||||
.join('')}
|
||||
`;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Renders a table of data, plucking the given properties from each item in
|
||||
@@ -65,7 +66,7 @@ module.exports = class Docs {
|
||||
*/
|
||||
const renderTable = (name, properties, data) => {
|
||||
if (data === undefined) {
|
||||
return ''
|
||||
return '';
|
||||
}
|
||||
return `
|
||||
<h3>${name}</h3>
|
||||
@@ -73,13 +74,17 @@ const renderTable = (name, properties, data) => {
|
||||
<tr>
|
||||
${properties.map((p) => `<th>${capitalize(p)}</th>`).join('')}
|
||||
</tr>
|
||||
${data.map((i) => `
|
||||
${data
|
||||
.map(
|
||||
(i) => `
|
||||
<tr>
|
||||
${properties.map((p) => `<td>${i[p]}</td>`).join('')}
|
||||
</tr>
|
||||
`).join('')}
|
||||
`
|
||||
)
|
||||
.join('')}
|
||||
</table>
|
||||
`
|
||||
`;
|
||||
};
|
||||
|
||||
const capitalize = (s) => s[0].toUpperCase() + s.substring(1);
|
||||
|
||||
Reference in New Issue
Block a user