MCPcopy Index your code
hub / github.com/fabien0102/go2dts

github.com/fabien0102/go2dts @v0.4.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.4.0 ↗ · + Follow
117 symbols 218 edges 19 files 77 documented · 66%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Go2dts

logo

A simple cli-tools to transform golang struct and const to typescript interface and type

Installation

npm i -g go2dts

Usage

go2dts <goLangDirs ...> <typescriptFile>

Testing and developing

Just put your golang file into __tests__/inputs and it will be parse each time you execute npm test or npm start.

npm start is more quick, so perfect to add some console.log and improve the parsing.

npm test --watch generate a snapshot, so you can just update this one to the expecting state and start coding to have everything green #TDDStyle

Know issues

  • The type mapping is incomplete (I'm not a golang developper, so I add types when I discover them)
  • This library will not follow the import dependencies, so the output types can be broken

Extension points exported contracts — how you extend this code

HTTPClient (Interface)
HTTPClient interface to represents the minimal required http client interface [2 implementers]
__tests__/inputs/client/labsClient.go
BundleClient (Interface)
BundleClient wraps all functionality needed to interact with the labserver as an enduser [1 implementers]
__tests__/inputs/client/bundle.go

Core symbols most depended-on inside this repo

String
called by 11
__tests__/inputs/client/jobs.go
Do
called by 9
__tests__/inputs/client/labsClient.go
getURL
called by 9
__tests__/inputs/client/labsClient.go
getValue
called by 4
__tests__/inputs/client/editor.go
Sync
called by 3
__tests__/inputs/client/bundle.go
IsNonEmpty
called by 3
__tests__/inputs/client/bundle.go
New
called by 3
__tests__/inputs/client/labsClient.go
go2dts
called by 2
src/index.js

Shape

Method 47
Struct 46
Function 18
TypeAlias 4
Interface 2

Languages

Go97%
TypeScript3%

Modules by API surface

__tests__/inputs/client/bundle.go29 symbols
__tests__/inputs/client/labsClient.go18 symbols
__tests__/inputs/client/jobs.go16 symbols
__tests__/inputs/types/bundle.go13 symbols
__tests__/inputs/client/editor.go12 symbols
__tests__/inputs/labsserver/httputils/response_writers.go6 symbols
__tests__/inputs/client/client.go5 symbols
__tests__/inputs/client/secrets.go4 symbols
src/index.js3 symbols
__tests__/inputs/client/functions.go3 symbols
__tests__/inputs/client/bundle_test.go2 symbols
__tests__/inputs/types/withprotobuf.pb.go1 symbols

For agents

$ claude mcp add go2dts \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page