Skip to content

Commit

Permalink
add typescript "support" for generated file
Browse files Browse the repository at this point in the history
  • Loading branch information
aewering committed Dec 19, 2023
1 parent 77af8ea commit ead4163
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "protoc-gen-elm",
"version": "3.4.1",
"version": "3.4.2",
"description": "Elm protoc plugin",
"keywords": [
"elm",
Expand Down
2 changes: 1 addition & 1 deletion src/Generator.elm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ requestToResponse versions options req =

devToolsFiles =
if options.grpcDevTools then
[ Generator.DevToolsWorker.devToolsJsFile versions ]
[ Generator.DevToolsWorker.devToolsJsFile versions, Generator.DevToolsWorker.devToolsDTsFile ]

else
[]
Expand Down
7 changes: 6 additions & 1 deletion src/Generator/DevToolsWorker.elm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Generator.DevToolsWorker exposing (devToolsJsFile, generateDevToolsWorker)
module Generator.DevToolsWorker exposing (devToolsJsFile, generateDevToolsWorker, devToolsDTsFile)

import Elm.CodeGen as C
import Generator.Common as Common
Expand Down Expand Up @@ -161,6 +161,11 @@ devToolsJsFile versions =
{ name = "Proto/dev-tools.mjs", content = devToolsJsFileContent versions, insertionPoint = "", generatedCodeInfo = Nothing }


devToolsDTsFile : CodeGeneratorResponse.File
devToolsDTsFile =
{ name = "Proto/dev-tools.d.mts", content = "export {}", insertionPoint = "", generatedCodeInfo = Nothing }


devToolsJsFileContent : AllVersions -> String
devToolsJsFileContent versions =
"""/**
Expand Down

0 comments on commit ead4163

Please sign in to comment.