ui5-tooling icon indicating copy to clipboard operation
ui5-tooling copied to clipboard

Publish types for custom middleware and task developers

Open tobiasqueck opened this issue 3 years ago • 8 comments

Is your feature request related to a problem? Please describe.

We as the maintainer of the in SAP Fiori tools and the Open UX tools (https://github.com/SAP/open-ux-tools) develop multiple custom tasks and middlewares. Our development language of choice is typescript, however, there are no types available for the API that is to be implemented by custom tasks and middlewares.

Describe the solution you'd like

It would be great if all the required types are part of the UI5 tooling packages @ui5/fs, @ui5/builder and so on, so that I can import the types in my modules and have all the comforts of using a fully typed language.

Describe alternatives you've considered

The best alternative so far is to read your documentation and manually define the types in a separate .d.ts file e.g.

declare module '@ui5/fs' {
    /**
     * https://sap.github.io/ui5-tooling/api/module-@ui5_fs.Resource.html
     */
    export class Resource {
        /**
         * Gets the resources path
         */
        getPath(): string;

        /**
         * Gets a buffer with the resource content.
         */
        getBuffer(): Promise<Buffer>;
    }

    /**
     * https://sap.github.io/ui5-tooling/api/module-@ui5_fs.DuplexCollection.html
     */
    export class DuplexCollection {
        /**
         *
         */
        byGlob(virPattern: string | string[], options?: object): Promise<Resource[]>;
    }
}

but that is of course not a good solution since we now need to make sure that our types stay in sync with your development.

Additional context

No.

tobiasqueck avatar Sep 23 '22 10:09 tobiasqueck

Thanks a lot @tobiasqueck. This enhancement request will be covered in backlog item CPOUI5FOUNDATION-547.

flovogt avatar Jun 27 '23 15:06 flovogt

Thanks a lot @tobiasqueck. This enhancement request will be covered in backlog item CPOUI5FOUNDATION-547.

Happy to hear that. Do you also have a rough timeline?

tobiasqueck avatar Jun 28 '23 07:06 tobiasqueck

@ecker

RandomByte avatar Jun 28 '23 10:06 RandomByte

Hi @tobiasqueck, we don't have a timeline, yet. Back then, it was clear to only be a target after UI5 Tooling 3.0 and some larger (ongoing) topics. Once we revised your topic, maybe in context of other TS enablements, we'll get back to you, thanks.

ecker avatar Jun 28 '23 10:06 ecker

Hi! It would be really nice to have UI5 tooling covered with types. TypeScript is more than code suggestion. Moreover I see you spend quite some time in JSDoc. Using Typescript will help you to write much simpler and cleaner code and code suggestion will be only one of the features available out of the box. But since you have JSDoc - you may consider Types generation out of them.

ThePlenkov avatar Aug 01 '23 16:08 ThePlenkov

@ThePlenkov We have this feature already in our backlog CPOUI5FOUNDATION-547. But no timeline yet when it will be available.

flovogt avatar Aug 02 '23 08:08 flovogt

@flovogt thanks for a quick reply, Florian. This ticket you're referencing to - is it a public backlog or internal? Thanks!

ThePlenkov avatar Aug 02 '23 08:08 ThePlenkov

You're welcome. Its an internal backlog managing system. Putting the backlog reference here makes our life easier to identify features are not yet prepared and planned in our internal system.

flovogt avatar Aug 02 '23 08:08 flovogt