Configuration
Targo projects are usually controlled by a small set of configuration files.
Main Files
| File | Role |
|---|---|
targo.json | Targo compiler and binder configuration |
tsconfig.json | TypeScript-facing editor and project configuration |
tsconfig.targo.json | generated declaration include config |
go.mod | Go module identity and dependencies |
types/** | optional local declaration output for project-local Go code |
targo.json
Use targo.json for Targo-specific behavior such as:
- compiler output settings
- binder-related options
- project-wide Targo semantics and generation choices
If behavior changes at compile time even though TypeScript still looks valid, inspect targo.json.
tsconfig.json
Use tsconfig.json for:
- editor and TS project settings
- declaration inclusion model
- no-emit type-checking behavior in the source tree
Do not assume tsconfig.json alone defines Targo compile behavior.
tsconfig.targo.json
- generated by the toolchain
- usually gitignored
- reflects current declaration state, including global cache entries
- should not be hand-edited
Optional Generated Trees
types/**may be generated for local Go directory bindings- vendored
.targo/**may exist in compatibility or explicit--vendorworkflows - should not be hand-edited
- may need regeneration after dependency or config changes
Practical Rules
- Source of truth is
src/, not generated artifacts. - If config-related errors look misleading, rerun
targo initbefore deeper debugging. - Treat
targo.jsonandgo.modchanges as potentially declaration-affecting.