release: WRNexusJS 0.6.0
This commit is contained in:
@@ -95,6 +95,10 @@ function words(name) {
|
||||
return name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLowerCase();
|
||||
}
|
||||
|
||||
function compareText(left, right) {
|
||||
return left < right ? -1 : left > right ? 1 : 0;
|
||||
}
|
||||
|
||||
const sourceEntries = readdirSync(componentsDir)
|
||||
.filter((file) => file.endsWith(".wrn"))
|
||||
.map((file) => {
|
||||
@@ -150,7 +154,7 @@ const components = [...sourceByName.values()]
|
||||
source: `components/${file}`,
|
||||
};
|
||||
})
|
||||
.sort((left, right) => left.name.localeCompare(right.name));
|
||||
.sort((left, right) => compareText(left.name, right.name));
|
||||
|
||||
const catalogComponents = components.map((component) => ({
|
||||
name: component.name,
|
||||
@@ -180,7 +184,9 @@ const lines = [
|
||||
`This reference is generated from the ${components.length} packaged \`.wrn\` component sources. Props marked required have no default; all others show their runtime default.`,
|
||||
"",
|
||||
];
|
||||
for (const category of [...new Set(components.map((component) => component.category))].sort()) {
|
||||
for (const category of [...new Set(components.map((component) => component.category))].sort(
|
||||
compareText,
|
||||
)) {
|
||||
lines.push(`## ${category[0].toUpperCase()}${category.slice(1)}`, "");
|
||||
for (const component of components.filter((item) => item.category === category)) {
|
||||
const props = component.props.length
|
||||
|
||||
Reference in New Issue
Block a user