@orbitalhq/taxiql-codegen
v0.1.1
Published
A tool for generating types from taxiql tags and for typing the responses of queries executed using the @orbitalhq/orbital-client SDK
Readme
@orbitalhq/taxiql-codegen
A tool for generating types from taxiql tags and for typing the responses of queries executed using the @orbitalhq/orbital-client SDK.
Installation
You can install @orbitalhq/taxiql-codegen via npm:
npm install @orbitalhq/taxiql-codegen --save-devUsage
Running the Code Generator
Once installed, you can run the code generator using:
npx taxiql-codegenBy default, the tool looks for a configuration file named codegen.config.ts in the root of your project.
Specifying a Custom Configuration File
If you need to provide a custom configuration file, you can specify it using the --config flag:
npx taxiql-codegen --config path/to/custom-config.tsScripts
Building the Project
npm run buildThis bundles the TypeScript source files using esbuild and outputs the result to dist/build.js.
Running Test Queries
npm run run:test-queriesThis compiles and executes the test queries.
Running Tests
npm testThis runs unit tests using vitest.
Publishing
Before publishing the package, the prepublishOnly script ensures the project is built:
npm run prepublishOnlyDependencies
Peer Dependencies
@orbitalhq/taxiql-client: The client library required for executing TaxiQL queries.
Optional Dependencies
[!WARNING] Running npm install without optional depdency install (
--no-optional) will mean the binaries required to generate the codegen will be missing.
Platform-specific CLI binaries:
@orbitalhq/taxiql-codegen-cli-darwin(macOS)@orbitalhq/taxiql-codegen-cli-linux(Linux)@orbitalhq/taxiql-codegen-cli-win32(Windows)
TODO
- [ ] Ensure commented out
taxiQltags aren't extracted for type generation
License
This project is licensed under the Apache-2.0 License.
