LinuxmacOSWindows

Where Does Jsonnet Keep Project Files?

Jsonnet projects track deps in jsonnetfile.json with libraries under lib and vendored code in vendor.

Last updated

Jsonnet organizes dependencies through a jsonnetfile.json file at the project root. The file names versioned libraries for jsonnet-bundler to fetch. Imported code lands in the vendor folder it manages.

Local helpers live in lib beside project files by convention. Main entry points import from both paths the same way. Keep generated vendor output committed or ignored per team policy, but stay consistent.

Where Jsonnet stores this, by platform

Linux
[ProjectDir]/jsonnetfile.json

Dependency versions for jb install live here. Libraries land in vendor, helpers in lib. Commit the lock file with sources.

macOS
[ProjectDir]/jsonnetfile.json

Same root file on Mac. Tanka and Kapitan read the same layout. Editor plugins resolve imports through these folders.

Windows
[ProjectDir]\jsonnetfile.json

Same file on Windows. Import paths inside use forward slashes. Exact lock filename may vary by bundler version.

Frequently asked questions

Where do Jsonnet libraries install?

Into vendor under the project root through jsonnet-bundler. Imports reference them by package path. Never hand edit inside vendor.

How do I share Jsonnet code between repos?

Publish it as a versioned jsonnet package and reference it in jsonnetfile.json. Local lib folders suit single repo helpers. Pin versions for reproducible builds.

Notice an outdated path? Let us know.