From 2978a54a73cee3188ebde4e661f932c6df415f26 Mon Sep 17 00:00:00 2001 From: Ben <3447705+bcabanes@users.noreply.github.com> Date: Fri, 20 Jan 2023 12:17:32 -0500 Subject: [PATCH] feat(nx-dev): display additional porperties before internal & deprecated --- .../src/lib/schema-viewer.tsx | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/nx-dev/feature-package-schema-viewer/src/lib/schema-viewer.tsx b/nx-dev/feature-package-schema-viewer/src/lib/schema-viewer.tsx index 4eb3da902846a1..36002c14a0b23e 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/schema-viewer.tsx +++ b/nx-dev/feature-package-schema-viewer/src/lib/schema-viewer.tsx @@ -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; @@ -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}; }