Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: basic schema viewer able to be deployed #254

Closed
wants to merge 3 commits into from

Conversation

jamdelion
Copy link
Contributor

@jamdelion jamdelion commented Oct 9, 2024

In this PR:

  • Added the /docs folder containing a create-react-app project featuring @stoplight/json-schema-viewer
  • Turned /schemas into its own package so it can be imported into the /docs project.
  • Adjusted ESLint config so that it is happy with the modules structure and flags no TS errors.

Comment on lines +54 to +55
// const _applicationTypeProperty =
// '$data.application.type.description' || '$applicationType';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eslint complained that this was an unused variable so have commented out for now.

@@ -309,7 +309,7 @@ interface GLAGainedUnit extends GLALostUnit {
/**
* TypeMap of PrimaryApplicationTypes to their specific Proposal models
*/
type ProposalVariants = {};
type ProposalVariants = object;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another eslint complaint:

Don't use `{}` as a type. `{}` actually means "any non-nullish value".
- If you want a type meaning "any object", you probably want `object` instead.
- If you want a type meaning "any value", you probably want `unknown` instead.
- If you want a type meaning "empty object", you probably want `Record<string, never>` instead.
- If you really want a type meaning "any non-nullish value", you probably want `NonNullable<unknown>` instead.

@@ -2729,6 +2729,7 @@ export type PropertyType =
| CommercialUtilityWaterTreatmentWater
| CommercialUtilityWaterWaste
| DualUse
// eslint-disable-next-line @typescript-eslint/ban-types
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESLint was complaining about (I think) the keyword 'object' even though Object is defined as its own custom type further up the file.

<MosaicProvider>
<Box mx="auto" py={20} px={8} style={{maxWidth: 800}}>
<JsonSchemaViewer
// name="Digital planning data schemas"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attributes commented out because causing type errors

@jamdelion jamdelion marked this pull request as draft October 14, 2024 09:27
@jamdelion jamdelion closed this Oct 15, 2024
@jessicamcinchak jessicamcinchak deleted the jh/schema-viewer branch October 30, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant