Skip to content

Releases: cap-js/cds-typer

v0.38.0

24 Sep 13:07
82d5f92

Choose a tag to compare

Added

  • Added (experimental) flag cds.env.typer.output_d_ts_files for generating output *.d.ts files instead of *.ts ones

Changed

  • unbound actions will now assume the self type of never, instead of the former null

Deprecated

Removed

Fixed

Security

v0.37.0

10 Sep 05:59
f581ee0

Choose a tag to compare

Added

Changed

Deprecated

Removed

Fixed

  • Added declare statement on type definitions
  • Explicitly add an any[] type in generated boilerplate to avoid issues with noImplicitAny
  • Entities included via cds import now have their properties properly generated

Security

v0.36.0

04 Jul 07:20
66ddc68

Choose a tag to compare

Added

Changed

Deprecated

Removed

Fixed

  • targeting aspects in compositions now properly resolves them.
  • transitive references to property types of other entities now also work for enums.

Security

v0.35.0

23 May 07:15
23b14f6

Choose a tag to compare

Added

Changed

  • action parameters annotated with @mandatory are no longer nullable
  • base definitions now properly import the default export of @sap/cds

Deprecated

Removed

Fixed

  • Using cds.Map as type will no longer result in the property not being printed at all.

Security

v0.34.0

02 Apr 06:36
89452ff

Choose a tag to compare

Added

  • Improved performance of repeated cds-typer runs by introducing an option to cache CDS model between runs. By default, typer will only regenerate the files if the model has changed between runs, using blake2s256 as algorithm. The used version of cds-typer is included in the hash and will therefore be version-specific.

Changed

  • [breaking] The config use_entities_proxy (allowing for static imports) is now set to true as default. You can set it to false to revert to the old behaviour.
  • Running cds watch will trigger cds-typer "*" before the initial startup

Deprecated

Removed

Fixed

Security

v0.33.1

07 Mar 09:14
5d8c867

Choose a tag to compare

Added

Changed

Deprecated

Removed

Fixed

  • Enums are now exported in ESM style in ESM projects

Security

v0.33.0

10 Feb 07:23

Choose a tag to compare

Added

  • Support new cds.Map type, which is emitted as {[key:string]: unknown}. The most appropriate type would in fact be {[key:string]: any}, which would also allow any and all keys. But would also cause issues with strict project configurations. Therefore, to effectively use cds.Map, users will have to cast the unknowns to the effective type they expect.
  • Introduce cds.env.typer.build_task to allow disabling the typescript build task shipped with cds-typer by setting it to false

Changed

  • [breaking] The types cds.Binary and cds.LargeBinary are now generated as Buffer and Readable respectively to reflect the behaviour of the new database packages @cap-js/hana and @cap-js/sqlite. You can switch back to the old behaviour by adding legacy_binary_types: true to your project configuration.
  • CHANGELOG.md and LICENSE files are no longer part of the npm package.

Deprecated

Removed

Fixed

Security

v0.32.1

20 Jan 11:51
6e4015f

Choose a tag to compare

Added

Changed

Deprecated

Removed

Fixed

  • default value for inline_declarations in help command
  • entity scope and namespace are now added in the correct order to inflected type names

Security

v0.31.0

16 Dec 14:26

Choose a tag to compare

Fixed

  • type-referencing a property that is a key no longer breaks the referring property
  • when targeting ESM, all imports within the generated types now add a /index.js-suffix to conform to modern module resolution mechanisms
  • leaving target_module_type at 'auto' now properly acts on a detected "type":"module"

Added

  • cds aspects now generate a synthetic plural type too, to be used in composition of many

v0.30.0

02 Dec 19:36
60c4793

Choose a tag to compare

Changed

  • [breaking] when running cds-typer in a CAP project, the default for the outputDirectory option will be ./@cds-models instead of ./. This default takes the lowest precedence after setting it in the project's cds.env, or explicitly as CLI argument.

Fixed

  • cds-typer no longer ignores the selected outputDirectory, which would also cause an issue during build