TiLied.CSTOJS_CLI
0.1.4
dotnet tool install --global TiLied.CSTOJS_CLI --version 0.1.4
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
dotnet tool install --local TiLied.CSTOJS_CLI --version 0.1.4
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=TiLied.CSTOJS_CLI&version=0.1.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package TiLied.CSTOJS_CLI --version 0.1.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
CSTOJS_CLI
Dotnet tool | Core library | Website | Try it online!
This dotnet tool/CLI is a "front-end" that implements a "core" library CSharpToJavaScript translator, converter, transpiler, transcompiler, compiler, source-to-source compiler, you name it. CLI inspired (a little) by Meson, but it should behave like the dotnet cli and tsc cli.
Quick start
To install:
dotnet tool install --global TiLied.CSTOJS_CLI
To use:
cstojs-cli setup "Output"
cstojs-cli translate
To update:
dotnet tool update --global TiLied.CSTOJS_CLI
To delete:
dotnet tool uninstall --global TiLied.CSTOJS_CLI
In-depth start
- Dotnet 10 required.
- To install dotnet tool globally run:
dotnet tool install --global TiLied.CSTOJS_CLI
-
- To install locally, follow this tutorial
-
- For linux update PATH, see documentation
- Make a new directory "Test". Inside that directory, run:
cstojs-cli setup "Output"
-
- The command executes:
-
-
- dotnet new console -f net10.0
-
-
-
- dotnet add package CSharpToJavaScript
-
-
-
- Creating "Output" folder
-
-
-
- Creating "cstojs_options.xml"
-
-
- Structure will be:
- obj
- Output
- cstojs_options.xml
- Program.cs
- Test.csproj
-
- "Output" folder is where the translated JS files will be.
-
- "cstojs_options.xml" is project options, see below for an example.
- To translate "Program.cs", run:
cstojs-cli translate
-
- The "Output" folder will contain a translated "Program.js" file.
- To add a new CS file, add
<File Source="./Test.cs" />to "cstojs_options.xml" and run "cstojs-cli translate" again. - To update, run:
dotnet tool update --global TiLied.CSTOJS_CLI
- To delete, run:
dotnet tool uninstall --global TiLied.CSTOJS_CLI
cstojs_options.xml
<ProjectOptions>
<Output Folder="Output" />
<DefaultOptions>
<Option NormalizeWhitespace="true" />
</DefaultOptions>
<File Source="./Program.cs" />
<File Source="./Test.cs">
<Option Debug="true" />
</File>
</ProjectOptions>
Tutorials/Examples
Commands
Run subcommands with -h to get more information.
setup <folder> Setup cstojs project.
translate Translate specified files in 'cstojs_options.xml'.
Related Repository
- Core library: https://github.com/TiLied/CSharpToJavaScript
- Tests: https://github.com/TiLied/CSTOJS_Tests
- Library for generating various stuff: https://github.com/TiLied/CSTOJS_GenLib
- Website/documentation: https://github.com/TiLied/CSTOJS_Pages
- Blazor WebAssembly app: https://github.com/TiLied/CSTOJS_BWA
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
- [Updated CSharpToJavaScript to 0.1.4](https://github.com/TiLied/CSTOJS_CLI/commit/932ece6d0862c6a47ba840bd4bc2af9512d329a7)
**Full Changelog**: https://github.com/TiLied/CSTOJS_CLI/compare/0.1.3...0.1.4