Skip to content

Commit

Permalink
feat(nx-dev): display additional porperties before internal & deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
bcabanes committed Jan 20, 2023
1 parent 88dc1fe commit 2978a54
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions nx-dev/feature-package-schema-viewer/src/lib/schema-viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ function extractPropertiesByImportance(properties: PropertyModel[]): {
rest: [],
};
for (const property of properties) {
if (property.isRequired) {
result.required.push(property);
continue;
}
if (isPropertyDeprecated(property.initialSchema)) {
result.deprecated.push(property);
continue;
Expand Down Expand Up @@ -259,15 +263,19 @@ export function SchemaViewer({
}

let allRenderedProperties = <></>;
const renderedProps = renderProps([
...categorizedProperties.required,
...categorizedProperties.important,
...categorizedProperties.rest,
const renderedProps = [
renderProps([
...categorizedProperties.required,
...categorizedProperties.important,
...categorizedProperties.rest,
]),
...renderedPatternProperties,
...additionalProperties,
...categorizedProperties.internal,
...categorizedProperties.deprecated,
]);
renderProps([
...categorizedProperties.internal,
...categorizedProperties.deprecated,
]),
];
if (hasProperties) {
allRenderedProperties = <>{renderedProps}</>;
}
Expand Down

0 comments on commit 2978a54

Please sign in to comment.