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

docs: revised generating typescript interfaces section #4504

Closed
wants to merge 2 commits into from

Conversation

davidruvolo51
Copy link
Contributor

What are the main changes you did

  • Updated section on generating typescript interfaces: added information on how to generate types from a schema, the requirements, and added some examples.

How to test

  • explain here what to do to test this (or point to unit tests)

Checklist

  • updated docs in case of new feature
  • added/updated tests
  • added/updated testplan to include a test for this fix, including ref to bug using # notation

@davidruvolo51 davidruvolo51 added the documentation Improvements or additions to documentation label Nov 19, 2024
Comment on lines +407 to +409
### Generating interfaces and types for use in MOLGENIS fontend apps

To generate the typescript interfaces for a given schema, run:
`./gradlew generateTypes --args=[schemaName] [full-path+file-name]`
Throughout the EMX2 frontend, we use typescript for stronger typing and validation in our frontend components. To make things easier for developers, we've include a command for autogenerating typescript interfaces and types from an EMX2 schema. This process is outlined in the steps below.
Copy link
Contributor

Choose a reason for hiding this comment

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

somewhat verbose, prefer more direct style of current doc

Comment on lines +415 to +427
```terminal
./gradlew run
```

#### 2. Import your schema

Once your instance is live -

1. Navigate to the local emx2 instance at [http://localhost:8080/](http://localhost:8080/)
2. Sign in as admin or as another user that can create databases
3. Create a new database (e.g., `My new database`)
4. Import your EMX2 file into the new database

Copy link
Contributor

Choose a reason for hiding this comment

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

do not have to use this run command of create an new database to generate the types


#### 3. Generate the interfaces and types

In your application folder (`apps/*`), create a directory to store the types (e.g., "types", "interfaces", etc.). The command is `generateTypes`. The syntax to generate the file is described below.
Copy link
Contributor

Choose a reason for hiding this comment

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

does not have to be in the apps folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants