{"id":13810716,"url":"https://github.com/bazel-contrib/rules_jsonnet","last_synced_at":"2025-05-14T15:31:05.761Z","repository":{"id":5830685,"uuid":"53970542","full_name":"bazel-contrib/rules_jsonnet","owner":"bazel-contrib","description":"Jsonnet rules for Bazel","archived":false,"fork":false,"pushed_at":"2025-03-14T10:50:49.000Z","size":219,"stargazers_count":69,"open_issues_count":17,"forks_count":77,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-05-08T06:02:52.733Z","etag":null,"topics":["bazel","bazel-rules","jsonnet","jsonnet-rules"],"latest_commit_sha":null,"homepage":"https://bazelbuild.github.io/rules_jsonnet/","language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bazel-contrib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null},"funding":{"open_collective":"bazel-rules-authors-sig"}},"created_at":"2016-03-15T18:56:06.000Z","updated_at":"2025-04-25T10:20:22.000Z","dependencies_parsed_at":"2023-10-12T00:45:20.617Z","dependency_job_id":"39ad83a4-1513-43fb-9434-06c96f3e5616","html_url":"https://github.com/bazel-contrib/rules_jsonnet","commit_stats":null,"previous_names":["bazel-contrib/rules_jsonnet"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazel-contrib%2Frules_jsonnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazel-contrib%2Frules_jsonnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazel-contrib%2Frules_jsonnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazel-contrib%2Frules_jsonnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bazel-contrib","download_url":"https://codeload.github.com/bazel-contrib/rules_jsonnet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254171692,"owners_count":22026493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bazel","bazel-rules","jsonnet","jsonnet-rules"],"created_at":"2024-08-04T03:00:24.064Z","updated_at":"2025-05-14T15:31:01.240Z","avatar_url":"https://github.com/bazel-contrib.png","language":"Starlark","readme":"[![Build status](https://badge.buildkite.com/c3449aba989713394a3237070971eb59b92ad19d6f69555a25.svg)](https://buildkite.com/bazel/rules-jsonnet-postsubmit)\n\n# Jsonnet Rules\n\n\u003cdiv class=\"toc\"\u003e\n  \u003ch2\u003eRules\u003c/h2\u003e\n  \u003cul\u003e\n    \u003cli\u003e\u003ca href=\"#jsonnet_library\"\u003ejsonnet_library\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#jsonnet_to_json\"\u003ejsonnet_to_json\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#jsonnet_to_json_test\"\u003ejsonnet_to_json_test\u003c/a\u003e\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/div\u003e\n\n## Overview\n\nThese are build rules for working with [Jsonnet][jsonnet] files with Bazel.\n\n[jsonnet]: https://jsonnet.org\n\n## Setup\n\nTo use the Jsonnet rules as part of your Bazel project, please follow the\ninstructions on [the releases page](https://github.com/bazelbuild/rules_jsonnet/releases).\n\n## Jsonnet Compiler Selection\n\nBy default for Bzlmod, Bazel will use the [Go\ncompiler](https://github.com/google/go-jsonnet). Note that the\nprimary development focus of the Jsonnet project is now with the Go compiler.\nThis repository's support for using the C++ compiler is deprecated, and may be\nremoved in a future release.\n\nTo use [the\nC++](https://github.com/google/jsonnet) or\n[Rust](https://github.com/CertainLach/jrsonnet) compiler of Jsonnet instead,\nregister a different compiler:\n\n| Jsonnet compiler | MODULE.bazel directive            |\n| ---------------- | --------------------------------- |\n| Go               | `jsonnet.compiler(name = \"go\")`   |\n| cpp              | `jsonnet.compiler(name = \"cpp\")`  |\n| Rust             | `jsonnet.compiler(name = \"rust\")` |\n\n### Rust Jsonnet Compiler\n\nTo use the Rust Jsonnet compiler a `Nightly` Rust version for the host tools is\nrequired because `-Z bindeps` is needed to compile the Jrsonnet binary.\n\nAdd the following snippet to the `MODULE.bazel` file:\n\n```Starlark\nbazel_dep(name = \"rules_rust\", version = \"0.45.1\")\n\nrust_host = use_extension(\"@rules_rust//rust:extensions.bzl\", \"rust_host_tools\")\nrust_host.host_tools(\n    version = \"nightly/2024-05-02\",\n)\n```\n\n### CLI\n\nUse the `--extra_toolchains` flag to pass the preferred toolchain to the bazel\ninvocation:\n\n```bash\nbazel build //... --extra_toolchains=@rules_jsonnet//jsonnet:cpp_jsonnet_toolchain\n\nbazel test //... --extra_toolchains=@rules_jsonnet//jsonnet:rust_jsonnet_toolchain\n\nbazel run //... --extra_toolchains=@rules_jsonnet//jsonnet:go_jsonnet_toolchain\n```\n\n## Rule usage\n\nPlease refer to [the StarDoc generated documentation](docs/jsonnet.md)\nfor instructions on how to use these rules.\n","funding_links":["https://opencollective.com/bazel-rules-authors-sig"],"categories":["Additional language support"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbazel-contrib%2Frules_jsonnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbazel-contrib%2Frules_jsonnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbazel-contrib%2Frules_jsonnet/lists"}