Overriding Compile Commands for SDK Generation
1. Remove package.json
from .genignore
The .genignore
file is used to signal which files are manually managed rather than handled by the SDK generator. It functions similarly to .gitignore
but for SDK generation purposes.
Update your .genignore
file to remove package.json
. It no longer needs to be ignored as the generation process will manage it automatically.
2. Create a Compile Script
Create a file named openapi/scripts/compile.sh
and add the following script:
#!/usr/bin/env bashset -enpm installnpm run build
Ensure the script is executable by running the following command:
chmod +x openapi/scripts/compile.sh
3. Update gen.yaml
Modify your .speakeasy/gen.yaml
file to include the compileCommand
under the TypeScript section. Add the following configuration:
typescript:compileCommand:- bash- -c- ./openapi/scripts/compile.sh
4. Verify the Configuration
Run the following command to test that the setup is working as expected:
speakeasy run --force