Skip to content

TypeScript implementation makes FileTypes and DirectoryTypes difficult to work with #23

@alexiswl

Description

@alexiswl

Hello,

Linking in the following related conversations / docs / issues:

Tagging
@mr-c , @ZimmerA, @kinow as active participants in the issues linked above

Feature Request Summary

Comparing cwl-ts-auto to rabix-cwlts, I have found that the rabix-cwlts repo to be more user friendly for my use case by having File and Directories as simple interfaces.

I wonder if it's possible we could have similar interfaces in the cwl-ts-auto TypeScript module?

cwl-ts-auto example

Typescript using the cwl-ts-auto module can be found here.

https://github.com/umccr/cwl-ica/tree/main/expressions/get-bam-file-from-directory/1.0.1

rabix-cwl-ts example

The equivalent typescript expressions using the rabix-cwl-ts module can be found here.

https://github.com/umccr/cwl-ica/tree/main/expressions/get-bam-file-from-directory/1.0.1-rabix

Differences

Differences include:

Other nuisances

We currently use the sed command to somewhat hack our output JS to a CWL-compatible JS.

The expressions required are shown below (and are described here)

/^exports\.*/d;
/^var\ .*\ =\ require(.*)*/d;
/^Object\.defineProperty(exports*)*/d;
s%//(.*)%/* \1 */%;
s%class_%class%g;
s%:\ %:%g;
s%cwl_ts_auto_1.File_class.FILE%"File"%g;
s%cwl_ts_auto_1.Directory_class.DIRECTORY%"Directory"%g;

Of these expressions, the following are related to cwl-ts-auto specifically

  • /^var\ .*\ =\ require(.*)*/d;
  • s%class_%class%g;
  • s%cwl_ts_auto_1.File_class.FILE%"File"%g;
  • s%cwl_ts_auto_1.Directory_class.%"Directory"%g;

I think there's a lot of potential in the TypeScript in CWL front and would be keen to use this repository more.
However, these discrepancies I've pointed out above do make it harder for CWL users to overcome the learning curve of using TypeScript in their JS expressions. Would be keen to scope out what can be done to improve this!

Alexis

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions