v0 to v1.0
Version 1.0 introduced updated defaults that align with modern Angular practices (standalone components, tree-shakeable APIs). If you’re upgrading from an older version, review these changes.
Changed defaults
| Setting | Old default | New default |
|---|---|---|
module | "ApiModule" | false |
services | true | false |
apiService | "" (not generated) | "Api" |
enumStyle | "pascal" | "alias" |
enumArray | false | true |
promises | false (Observables) | true (Promises) |
What changed and why
module: false
NgModules are no longer needed since Angular 14 introduced standalone components. All generated @Injectable classes use providedIn: 'root', so no module is required. Set "module": "ApiModule" if you need the old behavior.
services: false
Functions are now the default. Each API operation generates a standalone function, keeping your bundle small — only the functions you import are included. Services wrap all operations in a tag, pulling in unused code. Set "services": true if you prefer the service-based API.
apiService: "Api"
With functions as the default, you need the Api service to invoke them. It was not generated by default before. Set "apiService": false to skip it (if you generate services instead).
enumStyle: "alias"
TypeScript enums emit JavaScript code that increases bundle size. The alias style generates a union type with zero runtime cost. Set "enumStyle": "pascal" to restore the old behavior.
enumArray: true
The alias enum style cannot be iterated at runtime. The enumArray option generates an array export alongside the type, making iteration possible. Set "enumArray": false to skip it.
promises: true
Promises are simpler for most use cases and align with modern async/await patterns. Set "promises": false to use RxJS Observables.
Restoring old behavior
To generate code identical to v0.x defaults, use:
{
"module": "ApiModule",
"services": true,
"apiService": false,
"enumStyle": "pascal",
"enumArray": false,
"promises": false
}