@cap-js/cds-typer 0.18.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
6
6
 
7
7
  ## Version 0.19.0 - TBD
8
8
 
9
+
10
+ ## Version 0.18.1 - 2024-03-13
11
+ ### Fix
12
+ - Remove faulty plural for CDS `type` definitions from the generated _index.js_ files
13
+
9
14
  ## Version 0.18.0 - 2024-03-12
10
15
  ### Added
11
16
  - Improved support for projections, including projections on inline definitions, and on views, as well as support for explicit exclusion and selection of properties
package/lib/file.js CHANGED
@@ -403,12 +403,12 @@ class SourceFile extends File {
403
403
  // or when plural4 produced weird inflection.
404
404
  .flatMap(([singular, plural, original]) => Array.from(new Set([
405
405
  `module.exports.${singular} = csn.${original}`,
406
- `module.exports.${plural} = csn.${original}`,
406
+ /Array<.*>/.test(plural) ? undefined : `module.exports.${plural} = csn.${original}`,
407
407
  // FIXME: we currently produce at most 3 entries.
408
408
  // This could be an issue when the user re-used the original name in a @singular/@plural annotation.
409
409
  // Seems unlikely, but we have to eliminate the original entry if users start running into this.
410
410
  `module.exports.${original} = csn.${original}`
411
- ])))
411
+ ].filter(Boolean)))) // FIXME: this is a hack to support CDS types that will produce "Array<MyType>" as plural, which we do not want as export in the index.js files
412
412
  ) // singular -> plural aliases
413
413
  .concat(['// events'])
414
414
  .concat(this.events.fqs.map(({fq, name}) => `module.exports.${name} = '${fq}'`))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cap-js/cds-typer",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "Generates .ts files for a CDS model to receive code completion in VS Code",
5
5
  "main": "index.js",
6
6
  "repository": "github:cap-js/cds-typer",