diff --git a/custom-elements-manifest.config.js b/custom-elements-manifest.config.js index 5a444d3a1..303f036ed 100644 --- a/custom-elements-manifest.config.js +++ b/custom-elements-manifest.config.js @@ -38,6 +38,7 @@ export default { customElementsManifest.package = { name, description, version, author, homepage, license }; } }, + // Infer tag names because we no longer use @customElement decorators. { name: 'wa-infer-tag-names', @@ -66,6 +67,7 @@ export default { } } }, + // Parse custom jsDoc tags { name: 'wa-custom-tags', @@ -137,6 +139,7 @@ export default { } } }, + { name: 'wa-react-event-names', analyzePhase({ ts, node, moduleDoc }) { @@ -155,6 +158,7 @@ export default { } } }, + { name: 'wa-translate-module-paths', packageLinkPhase({ customElementsManifest }) { @@ -191,6 +195,7 @@ export default { }); } }, + // Generate custom VS Code data customElementVsCodePlugin({ outdir, @@ -202,6 +207,7 @@ export default { } ] }), + customElementJetBrainsPlugin({ outdir: './dist', excludeCss: true, diff --git a/docs/_includes/component.njk b/docs/_includes/component.njk index d2153d54a..7d74a7fb9 100644 --- a/docs/_includes/component.njk +++ b/docs/_includes/component.njk @@ -160,7 +160,7 @@
{{ prop.type.text | markdownInline | safe }}
+ {{ prop.type.text | trimPipes | markdownInline | safe }}
{% else %}
-
{% endif %}
@@ -211,7 +211,7 @@
{{ event.type.text }}
+ {{ event.type.text | trimPipes }}
{% else %}
-
{% endif %}
@@ -245,7 +245,7 @@
{% if method.parameters.length %}
{% for param in method.parameters %}
- {{ param.name }}: {{ param.type.text }}{% if not loop.last %},{% endif %}
+ {{ param.name }}: {{ param.type.text | trimPipes }}{% if not loop.last %},{% endif %}
{% endfor %}
{% else %}
diff --git a/docs/eleventy.config.cjs b/docs/eleventy.config.cjs
index 138c121da..8c671afb4 100644
--- a/docs/eleventy.config.cjs
+++ b/docs/eleventy.config.cjs
@@ -96,6 +96,12 @@ module.exports = function (eleventyConfig) {
return webAwesomeFlavoredMarkdown.renderInline(content);
});
+ // Trims whitespace and pipes from the start and end of a string. Useful for CEM types, which can be pipe-delimited.
+ // With Prettier 3, this means a leading pipe will exist if the line wraps.
+ eleventyConfig.addFilter('trimPipes', content => {
+ return content.replace(/^(\s|\|)/g, '').replace(/(\s|\|)$/g, '');
+ });
+
eleventyConfig.addFilter('classNameToComponentName', className => {
let name = capitalCase(className.replace(/^Wa/, ''));
if (name === 'Qr Code') name = 'QR Code'; // manual override