-
-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Hello,
Linking in the following related conversations / docs / issues:
- typescript: consider using "cwl-ts-auto" instead of rabix-cwl-ts umccr/cwl-ica#116
- Add TypeScript to the user guide common-workflow-language/user_guide#227
- CWL-ICA TypeScript Wiki Page
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:
- class_ vs class (see https://github.com/umccr/cwl-ica/blob/main/expressions/get-bam-file-from-directory/1.0.1/typescript-expressions/get-bam-file-from-directory__1.0.1.ts#L41 vs https://github.com/umccr/cwl-ica/blob/main/expressions/get-bam-file-from-directory/1.0.1-rabix/typescript-expressions/get-bam-file-from-directory__1.0.1-rabix.ts#L58
- Line comparison above can also show difference between comparisons of class attributes, File_class.FILE vs just "File"
- Allowing recursive listing on File / Directory objects
- Compare https://github.com/umccr/cwl-ica/blob/main/expressions/get-bam-file-from-directory/1.0.1/typescript-expressions/tests/summary.txt with https://github.com/umccr/cwl-ica/blob/main/expressions/get-bam-file-from-directory/1.0.1-rabix/typescript-expressions/tests/summary.txt
- cwl-ts-auto TS tests fails due to recursive listing of directory error (JS passes)
- rabix-cwlts passes both TS and JS tests.
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