glean-client
v1.0.2
Published
This is the client for the Glean API.
Downloads
27
Readme
glean-client
This is the client for the Glean API.
Generating the client locally
To generate the client types locally, you need to have the Glean API running on your local machine.
Start the Glean API server. Make sure the OpenAPI specification is available at
http://localhost:3000/spec.Generate the types. Run the following command to generate the TypeScript types for the client:
npm run generate:types:localThis will use
openapi-typescriptto generate the types and save them insrc/types.ts.
TODO: Automated Client Generation
Currently, the client generation is a manual process. To improve this, we should automate the generation of the client whenever the API is updated.
Here's a plan to achieve this:
- Triggering the generation: When the API is built and a new OpenAPI spec is generated, a trigger should be sent to this repository to start the client generation process. This could be a webhook or another CI/CD job.
- Workflow for generation: A GitHub Actions workflow in this repository will be responsible for:
- Receiving the trigger.
- Running the
npm run generate:typescommand. - Committing the newly generated
src/types.tsfile to the repository. - Version bump, creating a new release and publishing the updated client to npm.
