UI5 / UI5/typescript

[ts-interface-generator] Generate fully qualified module names in interface for seamless use with tsc declarations

Open
#431 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ts-interface-generator
Dominant language
TypeScript
Stars
213
Forks
35
Avg merge
37m
Merged PRs (30d)
1

Description

Description:
The current behavior of the @ui5/ts-interface-generator package generates interface declarations with relative module names. This leads to issues when attempting to use these interfaces alongside declarations generated by tsc, as relative paths cannot be resolved in such scenarios.

Desired Behavior:
It would be desired that the generated interfaces can be used and placed along with declarations generated by tsc (perhaps by using fully qualified module names)

Note: The tooling task ui5-transpile-task already transforms the generated interfaces accordingly, but it would be nice if one can use the native tsc cli for the type generation as well.

A workflow to generate declarations for a TS-based ui5 library project could be:

  1. Generate declarations for TS files
tsc --emitDeclarationOnly --declarationMap --outFile index.d.ts
  1. Copy over the generated interfaces (*.gen.d.ts) in a post build step (tsc output generation does not consider d.ts)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the @ui5/ts-interface-generator package and compare its generated interface declarations with declarations emitted by the tsc workflow described in the issue. Verify the result by placing the generated *.gen.d.ts files alongside tsc output and confirming that native tsc can resolve the module names without ui5-transpile-task.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.