Skip to content

Commit

Permalink
Reimplement terminal drivers in a native helper library.
Browse files Browse the repository at this point in the history
* Implemented a new native helper library, Vezel.Cathode.Native, using
  Vezel.Zig.Sdk.
* Moved all Unix/Win32 interop to the native helper library.
* Removed CsWin32 and Unix P/Invoke declarations from Vezel.Cathode.
* Removed Vezel.Cathode.Hosting as the native helper library cleans up terminal
  configuration much more reliably.
* Removed Vezel.Cathode.Analyzers since Vezel.Cathode.Hosting was removed.
* Lots of cleanup on the C# side as a result of these changes.
* Some minor optimizations throughout Vezel.Cathode.

Closes #43.
  • Loading branch information
alexrp committed Jan 7, 2024
1 parent 69f1c65 commit d76fb8c
Show file tree
Hide file tree
Showing 65 changed files with 1,399 additions and 1,819 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/out
*.user
.clangd
.idea
.vs
node_modules
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"github.vscode-github-actions",
"github.vscode-pull-request-github",
"jock.svg",
"llvm-vs-code-extensions.vscode-clangd",
"ms-dotnettools.csharp",
"redhat.vscode-xml",
"redhat.vscode-yaml",
Expand Down
1 change: 0 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"control",
"cursor",
"extensions",
"hosting",
"processes",
"raw",
"resize",
Expand Down
4 changes: 3 additions & 1 deletion Directory.Build.rsp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-err
# TODO: https://github.com/ziglang/zig/issues/13385
# TODO: https://github.com/ziglang/zig/issues/15398
#-err
-nr:false
-tl
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<Using Include="System.Text" />
</ItemGroup>

<ItemGroup>
<ItemGroup Condition="'$(UsingVezelZigSdk)' != 'true'">
<AdditionalFiles Include="$(MSBuildThisFileDirectory).stylecop.json" />
</ItemGroup>

Expand Down
9 changes: 3 additions & 6 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<ItemGroup>
<GlobalPackageReference Include="DotNet.ReproducibleBuilds"
Version="1.1.1" />
</ItemGroup>

<ItemGroup Condition="'$(UsingVezelZigSdk)' != 'true'">
<GlobalPackageReference Include="Microsoft.VisualStudio.Threading.Analyzers"
Version="17.8.14" />
<GlobalPackageReference Include="Nerdbank.GitVersioning"
Expand All @@ -25,12 +28,6 @@
Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Systemd"
Version="8.0.0" />
<PackageVersion Include="Microsoft.Windows.CsWin32"
Version="0.3.49-beta" />
<PackageVersion Include="Microsoft.Windows.SDK.Win32Docs"
Version="0.1.42-alpha" />
<PackageVersion Include="Microsoft.Windows.SDK.Win32Metadata"
Version="56.0.13-preview" />
<PackageVersion Include="System.IO.Pipelines"
Version="8.0.0" />
<PackageVersion Include="Wcwidth"
Expand Down
2 changes: 0 additions & 2 deletions PACKAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ This project offers the following packages:

* [Vezel.Cathode](https://www.nuget.org/packages/Vezel.Cathode): Provides the
core terminal API.
* [Vezel.Cathode.Hosting](https://www.nuget.org/packages/Vezel.Cathode.Hosting):
Provides the terminal hosting model.
* [Vezel.Cathode.Extensions](https://www.nuget.org/packages/Vezel.Cathode.Extensions):
Provides terminal hosting and logging for the .NET Generic Host.

Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,15 @@ This project offers the following packages:
| Package | Description | Downloads |
| -: | - | :- |
| [![Vezel.Cathode][core-img]][core-pkg] | Provides the core terminal API. | ![Downloads][core-dls] |
| [![Vezel.Cathode.Hosting][hosting-img]][hosting-pkg] | Provides the terminal hosting model. | ![Downloads][hosting-dls] |
| [![Vezel.Cathode.Extensions][extensions-img]][extensions-pkg] | Provides terminal hosting and logging for the .NET Generic Host. | ![Downloads][extensions-dls] |

[core-pkg]: https://www.nuget.org/packages/Vezel.Cathode
[hosting-pkg]: https://www.nuget.org/packages/Vezel.Cathode.Hosting
[extensions-pkg]: https://www.nuget.org/packages/Vezel.Cathode.Extensions

[core-img]: https://img.shields.io/nuget/v/Vezel.Cathode?label=Vezel.Cathode
[hosting-img]: https://img.shields.io/nuget/v/Vezel.Cathode.Hosting?label=Vezel.Cathode.Hosting
[extensions-img]: https://img.shields.io/nuget/v/Vezel.Cathode.Extensions?label=Vezel.Cathode.Extensions

[core-dls]: https://img.shields.io/nuget/dt/Vezel.Cathode?label=
[hosting-dls]: https://img.shields.io/nuget/dt/Vezel.Cathode.Hosting?label=
[extensions-dls]: https://img.shields.io/nuget/dt/Vezel.Cathode.Extensions?label=

To install a package, run `dotnet add package <name>`.
Expand Down
233 changes: 106 additions & 127 deletions cathode.sln

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"allowPrelease": false
},
"msbuild-sdks": {
"Microsoft.Build.Traversal": "4.1.0"
"Microsoft.Build.Traversal": "4.1.0",
"Vezel.Zig.Sdk": "4.2.16"
}
}
52 changes: 0 additions & 52 deletions src/analyzers/DiagnosticDescriptors.cs

This file was deleted.

72 changes: 0 additions & 72 deletions src/analyzers/Hosting/EntryPointGenerator.cs

This file was deleted.

2 changes: 0 additions & 2 deletions src/analyzers/analyzers.cs

This file was deleted.

18 changes: 0 additions & 18 deletions src/analyzers/analyzers.csproj

This file was deleted.

1 change: 0 additions & 1 deletion src/common/common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ This package provides common functionality used by all Cathode packages.</Packag
<ItemGroup>
<InternalsVisibleTo Include="Vezel.Cathode" />
<InternalsVisibleTo Include="Vezel.Cathode.Extensions" />
<InternalsVisibleTo Include="Vezel.Cathode.Hosting" />
</ItemGroup>
</Project>
Loading

0 comments on commit d76fb8c

Please sign in to comment.