clr2ts 0.1.7

Transpiler that takes CLR assemblies and outputs corresponding typescript definitions.

dotnet tool install --global clr2ts --version 0.1.7
This package contains a .NET Core Global Tool you can call from the shell/command line.

clr2ts

Build Status
GitHub
Nuget (with prereleases)

Transpiler that takes CLR assemblies and outputs corresponding typescript definitions.

Note: Under development

Please note that this tool is still in an early phase of development and missing many important features. There is already a version available on nuget.org that can be installed and used for very simple examples. Future changes should only affect the configuration file, so that you can update to a better version later and just change that file accordingly.

Installation

Get clr2ts by installing it as a dotnet tool from nuget.org.

dotnet tool install -g clr2ts

More information about installing dotnet tools can be found here.

Usage

Run clr2ts by calling the dotnet tool with the configuration file you would like to use.

clr2ts your.config.json

If you call clr2ts without specifying a configuration file, it will automatically look for one in the current working directory and its parent directories using the search pattern *clr2ts.json. If you use relative paths in your configuration, they are always relative to the configuration file.

Configuration

A configuration file may look like this:

{
    "input": { 
        "assemblyFiles": [
            "./Path/To/Your/Assembly.dll"
        ],
        "typeFilters": [
            // Define multiple filters for OR-semantics.
            {
                // Multiple values in a single filter for AND-semantics.
                "hasAttribute": ["AttributeName"],
                "subTypeOf": "BaseType",
                "namespace": "Namespace.SubNamespace"
            }
        ]
    },
    "output": {
        "bundledFile": "./Path/To/Your/TypeScriptCodeBase/bundle.ts",
        "files": {
            "directory": "./Path/To/Your/TypeScriptCodeBase/directory",
            "mimicNamespacesWithSubdirectories": true
        }
    }
}

Future plans

You can find some of the ideas for future releases in the github projects of this repository as well as in the draft for a more complex configuration file located under docs in the source code. Those plans include better translation features (like support of generics and collection types or converting to camelCase naming conventions) and better handling of clr2ts (logging, custom type maps or type filters).

clr2ts

Build Status
GitHub
Nuget (with prereleases)

Transpiler that takes CLR assemblies and outputs corresponding typescript definitions.

Note: Under development

Please note that this tool is still in an early phase of development and missing many important features. There is already a version available on nuget.org that can be installed and used for very simple examples. Future changes should only affect the configuration file, so that you can update to a better version later and just change that file accordingly.

Installation

Get clr2ts by installing it as a dotnet tool from nuget.org.

dotnet tool install -g clr2ts

More information about installing dotnet tools can be found here.

Usage

Run clr2ts by calling the dotnet tool with the configuration file you would like to use.

clr2ts your.config.json

If you call clr2ts without specifying a configuration file, it will automatically look for one in the current working directory and its parent directories using the search pattern *clr2ts.json. If you use relative paths in your configuration, they are always relative to the configuration file.

Configuration

A configuration file may look like this:

{
    "input": { 
        "assemblyFiles": [
            "./Path/To/Your/Assembly.dll"
        ],
        "typeFilters": [
            // Define multiple filters for OR-semantics.
            {
                // Multiple values in a single filter for AND-semantics.
                "hasAttribute": ["AttributeName"],
                "subTypeOf": "BaseType",
                "namespace": "Namespace.SubNamespace"
            }
        ]
    },
    "output": {
        "bundledFile": "./Path/To/Your/TypeScriptCodeBase/bundle.ts",
        "files": {
            "directory": "./Path/To/Your/TypeScriptCodeBase/directory",
            "mimicNamespacesWithSubdirectories": true
        }
    }
}

Future plans

You can find some of the ideas for future releases in the github projects of this repository as well as in the draft for a more complex configuration file located under docs in the source code. Those plans include better translation features (like support of generics and collection types or converting to camelCase naming conventions) and better handling of clr2ts (logging, custom type maps or type filters).

Release Notes

BugFix for self-recursive type definitions.

Dependencies

This package has no dependencies.

Version History

Version Downloads Last updated
0.1.7 51 8/25/2019
0.1.6 111 5/19/2019
0.1.5 105 5/1/2019
0.1.4 94 4/27/2019
0.1.3 169 4/20/2019
0.1.2 105 4/19/2019
0.1.0 94 4/16/2019