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- The OpenAPI generator has been broken for quite some years, and does not properly handle some models, particularly with the bulk API. Be extremely careful about these changes and don't blindly accept what the generator suggests.
- Don't stage the MarkDown docs. We should figure out how to stop generating these. And be sure to remove these lines from the OpenAPI manifest.
This ensures consistency of code formatting.
npx prettier . --writeThe 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 testTo 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
Finally, you can do a dist build as you might expect:
npm run buildGitHub 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.