Skip to content

Commit b4d2735

Browse files
Add buf.lock support (SchemaStore#5297)
* Add `buf.lock` support Ref: https://buf.build/docs/configuration/v2/buf-lock * Fix lint
1 parent e3c27e2 commit b4d2735

4 files changed

Lines changed: 70 additions & 0 deletions

File tree

src/api/json/catalog.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,12 @@
646646
"fileMatch": ["buf.gen.yaml"],
647647
"url": "https://www.schemastore.org/buf.gen.json"
648648
},
649+
{
650+
"name": "buf.lock",
651+
"description": "buf.lock is a dependency lock file generated by buf via 'buf dep update'. It represents a single, reproducible build of the workspace's external dependencies and should never be hand-edited",
652+
"fileMatch": ["buf.lock"],
653+
"url": "https://www.schemastore.org/buf.lock.json"
654+
},
649655
{
650656
"name": "buf.plugin.yaml",
651657
"description": "A `buf.plugin.yaml` file captures metadata about the plugin. It includes mandatory and optional fields that are displayed on the individual plugin page and the BSR plugin. Documentation: https://buf.build/plugins",

src/schemas/json/buf.lock.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://json.schemastore.org/buf.lock.json",
4+
"$comment": "https://buf.build/docs/configuration/v2/buf-lock",
5+
"title": "buf.lock",
6+
"description": "buf.lock is a dependency lock file generated by buf via 'buf dep update'. It represents a single, reproducible build of the workspace's external dependencies and should never be hand-edited.",
7+
"type": "object",
8+
"readOnly": true,
9+
"required": ["version"],
10+
"properties": {
11+
"version": {
12+
"description": "Buf configuration version.",
13+
"type": "string",
14+
"enum": ["v2", "v1", "v1beta1"]
15+
},
16+
"deps": {
17+
"description": "Module pins, each uniquely representing a specific snapshot of a module, protected with a cryptographic digest.",
18+
"type": "array",
19+
"items": {
20+
"type": "object",
21+
"required": ["name", "commit", "digest"],
22+
"additionalProperties": false,
23+
"properties": {
24+
"name": {
25+
"description": "Module name.",
26+
"type": "string",
27+
"pattern": "^[a-z0-9.-]+/[a-z0-9-]+/[a-z0-9-]+$",
28+
"examples": [
29+
"buf.build/googleapis/googleapis",
30+
"buf.build/grpc/grpc"
31+
]
32+
},
33+
"commit": {
34+
"description": "Commit that uniquely identifies this snapshot of the module.",
35+
"type": "string",
36+
"pattern": "^[a-f0-9]{32}$",
37+
"examples": ["7a6bc1e3207144b38e9066861e1de0ff"]
38+
},
39+
"digest": {
40+
"description": "Digest of the module contents.",
41+
"type": "string",
42+
"pattern": "^b[0-9]+:[a-f0-9]+$",
43+
"examples": [
44+
"b5:6d05bde5ed4cd22531d7ca6467feb828d2dc45cc9de12ce3345fbddd64ddb1bf0db756558c32ca49e6bc7de4426ada8960d5590e8446854b81f5f36f0916dc48"
45+
]
46+
}
47+
}
48+
}
49+
}
50+
}
51+
}

src/test/buf.lock/buf.lock.v1.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# yaml-language-server: $schema=../../schemas/json/buf.lock.json
2+
# Generated by buf. DO NOT EDIT.
3+
version: v1

src/test/buf.lock/buf.lock.v2.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# yaml-language-server: $schema=../../schemas/json/buf.lock.json
2+
# Generated by buf. DO NOT EDIT.
3+
version: v2
4+
deps:
5+
- name: buf.build/bufbuild/bufplugin
6+
commit: e35f9b6674434a41aea0359ee056d083
7+
digest: b5:0d2579c1953b5b20bfa5c9d183f17af030bd3e594e2de5ba11d12a12091e64257cb2d82ca0f2234a01085b26d7b9905a472723e40db94b6c925b1360d1a7b44a
8+
- name: buf.build/bufbuild/protovalidate
9+
commit: 6c6e0d3c608e4549802254a2eee81bc8
10+
digest: b5:a7ca081f38656fc0f5aaa685cc111d3342876723851b47ca6b80cbb810cbb2380f8c444115c495ada58fa1f85eff44e68dc54a445761c195acdb5e8d9af675b6

0 commit comments

Comments
 (0)