Skip to content

Commit 16de5a3

Browse files
committed
Add type generation
1 parent 4403b60 commit 16de5a3

15 files changed

Lines changed: 138 additions & 1 deletion

.github/workflows/build.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ jobs:
5050
- name: Restore local tools
5151
run: dotnet tool restore
5252

53+
- name: Generate TypeScript
54+
run: dotnet dotnet-typegen generate -p OpenVROverlayPipe
55+
56+
- name: Upload artifact
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: Types
60+
path: Types
61+
5362
release:
5463
name: Upload Release
5564
runs-on: ubuntu-latest
@@ -69,3 +78,31 @@ jobs:
6978
with:
7079
files: |
7180
**/*.zip
81+
82+
publishNPM:
83+
name: Publish NPM Package
84+
runs-on: ubuntu-latest
85+
needs: build
86+
87+
steps:
88+
- name: Download artifact
89+
uses: actions/download-artifact@v4
90+
with:
91+
name: Types
92+
93+
- uses: actions/setup-node@v4
94+
with:
95+
node-version: '20.x'
96+
registry-url: 'https://registry.npmjs.org'
97+
98+
- name: Install TypeScript
99+
run: npm install -g typescript
100+
101+
- name: Build TypeScript
102+
run: tsc
103+
104+
- run: |
105+
cd ./dist
106+
npm publish --access public
107+
env:
108+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# TypeScript
22
*.js.map
3+
Types/**/*.ts
4+
Types/**/*.js
5+
Types/**/*.js.map
6+
Types/**/*.d.ts
7+
Types/**/*.d.ts.map
38

49
## Ignore Visual Studio temporary files, build results, and
510
## files generated by popular Visual Studio add-ons.

OpenVROverlayPipe/Input/DataNotification.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
using TypeGen.Core.TypeAnnotations;
2+
13
namespace OpenVROverlayPipe.Input;
24

5+
[ExportTsInterface]
36
public class DataNotification
47
{
58
public string Title = "OpenVROverlayPipe";

OpenVROverlayPipe/Input/DataOverlay.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
using OpenVROverlayPipe.Notification;
2+
using TypeGen.Core.TypeAnnotations;
23
using static EasyOpenVR.Utils.EasingUtils;
34

45
namespace OpenVROverlayPipe.Input;
56

7+
[ExportTsInterface]
68
public class DataOverlay
79
{
810
public string ImageData = "";

OpenVROverlayPipe/Input/InputMessage.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
using TypeGen.Core.TypeAnnotations;
2+
13
namespace OpenVROverlayPipe.Input;
24

5+
[ExportTsInterface]
36
internal class InputMessage
47
{
58
public InputMessageKeyEnum Key = InputMessageKeyEnum.None;

OpenVROverlayPipe/OpenVROverlayPipe.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
<PackageReference Include="OpenTK.GLWpfControl" Version="4.3.1" />
3838
<PackageReference Include="Microsoft.AspNetCore.SystemWebAdapters" Version="1.3.0" />
3939
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
40+
<PackageReference Include="TypeGen" Version="5.0.1" />
4041
</ItemGroup>
4142
<ItemGroup>
4243
<ProjectReference Include="..\EasyOpenVR\EasyOpenVR.csproj" />

OpenVROverlayPipe/Output/OutputDataButton.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
using TypeGen.Core.TypeAnnotations;
12
using Valve.VR;
23

34
namespace OpenVROverlayPipe.Output;
45

6+
[ExportTsInterface]
57
public class OutputDataButton(EVRMouseButton button = 0)
68
{
79
public EVRMouseButton Button = button;

OpenVROverlayPipe/Output/OutputDataPosition.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
using TypeGen.Core.TypeAnnotations;
2+
13
namespace OpenVROverlayPipe.Output;
24

5+
[ExportTsInterface]
36
public class OutputDataPosition(float x = 0, float y = 0)
47
{
58
public float X = x;

OpenVROverlayPipe/Output/OutputMessage.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using OpenVROverlayPipe.Input;
2+
using TypeGen.Core.TypeAnnotations;
23

34
namespace OpenVROverlayPipe.Output;
45

6+
[ExportTsInterface]
57
internal class OutputMessage
68
{
79
public OutputMessageTypeEnum Type = OutputMessageTypeEnum.Undefined;

OpenVROverlayPipe/Properties/Resources.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,6 @@
125125
<value>..\resources\logo.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
126126
</data>
127127
<data name="Version" xml:space="preserve">
128-
<value>v4.1.0</value>
128+
<value>v4.1.1</value>
129129
</data>
130130
</root>

0 commit comments

Comments
 (0)