Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 1.3 KB

DEVELOPING.md

File metadata and controls

50 lines (34 loc) · 1.3 KB

Development Guide

OpenAPI Code Generation

Much of the code in this project is generated by the OpenAPI generator. Regenerating the generated portions of the codebase can be done simply with this command (run this whenever new features / changes to the OpenAPI spec are released).

openapi-generator generate -i https://api.stadiamaps.com/openapi.yaml -g typescript-fetch --strict-spec true -o src/generated

Run prettier

This ensures consistency of code formatting.

npx prettier . --write

Tests

The project includes some unit tests as a sanity check, utilizing mocks and real API responses, as well as integration tests. The test suites are specified using Jest and are fairly straightforward.

npm run test

To run integration tests, you need to set the environment variable RUN_INTEGRATION_TESTS=true. You'll also need an API key (with access to all services, or else some tests will fail!). You can store one or both of these in .env in the repo root.

API_KEY=YOUR-API-KEY
RUN_INTEGRATION_TESTS=true

Build

Finally, you can do a dist build as you might expect:

npm run build

Release

GitHub releases drive everything automatically except bumping the version number. Create one and if all goes well, you'll have a release up on npm shortly.