{"id":30112564,"url":"https://github.com/71/capnp-diff","last_synced_at":"2025-08-10T06:48:02.485Z","repository":{"id":287644122,"uuid":"949451461","full_name":"71/capnp-diff","owner":"71","description":"[WIP] Compute breaking changes between two Cap'n Proto schemas.","archived":false,"fork":false,"pushed_at":"2025-04-13T02:50:00.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-02T11:04:56.898Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/71.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-16T13:52:38.000Z","updated_at":"2025-04-13T02:50:03.000Z","dependencies_parsed_at":"2025-04-13T03:30:23.098Z","dependency_job_id":"5528cbea-d348-4a15-9b50-052ab8592f3e","html_url":"https://github.com/71/capnp-diff","commit_stats":null,"previous_names":["71/capnp-diff"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/71/capnp-diff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/71%2Fcapnp-diff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/71%2Fcapnp-diff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/71%2Fcapnp-diff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/71%2Fcapnp-diff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/71","download_url":"https://codeload.github.com/71/capnp-diff/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/71%2Fcapnp-diff/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269688021,"owners_count":24459399,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-08-10T06:47:58.674Z","updated_at":"2025-08-10T06:48:02.416Z","avatar_url":"https://github.com/71.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# capnp-diff\n\n[Deno](https://deno.com) tools for comparing two sets of\n[Cap'n Proto](https://capnproto.org) schemas and displaying the changes between\nthem.\n\n\u003e [!WARNING]\n\u003e\n\u003e This is a proof of concept. Many checks are not yet implemented and interfaces\n\u003e may break without warning.\n\nAll supported rules are available in\n[`schema-diff.capnp`](lib/capnp/schema-diff.capnp), under \"Possible changes\".\n\n\u003e [!NOTE]\n\u003e\n\u003e A fork of `capnp` is currently recommended for improved diagnostics:\n\u003e https://github.com/capnproto/capnproto/pull/2275.\n\u003e\n\u003e To use it, run the following:\n\u003e\n\u003e ```sh\n\u003e git clone https://github.com/71/capnproto.git --branch v2 --depth 1\n\u003e cd capnproto\n\u003e cmake -B build -S .\n\u003e cmake --build build --target capnp_tool capnpc_cpp\n\u003e export PATH=\"$PWD/build/c++/src/capnp:$PATH\"\n\u003e ```\n\n## Quick start\n\nCompare changes between two directories:\n\n```sh\n$ ./main.ts --old-files tests/remove-struct/old.capnp --new-files tests/remove-struct/new.capnp\n[C02] Code breakage: struct Person @0xa09745d0bf68d96a removed\n\n  \u003e tests/remove-struct/old.capnp:3:1:\n2 |\n3 | struct Person {\n4 |   id @0 :UInt32;\n\n1 change found.\n```\n\nCompare changes between two Git revisions:\n\n```sh\n$ git clone https://github.com/capnproto/capnproto.git\n$ cd capnproto\n$ ../tools/git.ts --old-rev eb7da61572a7cc8688d12b82f80f55546417e6b5 --files c++/src/capnp/c++.capnp --breakage none\n[C07] No breakage: Target union added to annotation name @0xf264a779fef191ce\n\n   \u003e c++/src/capnp/c++.capnp:26:1:\n25 | annotation namespace(file): Text;\n26 | annotation name(field, enumerant, struct, enum, interface, method, param, group, union): Text;\n27 |\n\n[C01] No breakage: annotation allowCancellation @0xac7096ff8cfc9dce added\n\n   \u003e c++/src/capnp/c++.capnp:28:1:\n27 |\n28 | annotation allowCancellation(interface, method, file) :Void;\n29 | # Indicates that the server-side implementation of a method is allowed to be canceled when the\n\n2 changes found.\n```\n\nDump changes as a Cap'n Proto message:\n\n```sh\n$ ./main.ts --old-files tests/u16-to-u32/old.capnp --new-files tests/u16-to-u32/new.capnp --format binary \\\n  | capnp convert binary:text lib/capnp/schema-diff.capnp SchemaDiff\n( changes = [\n    ( breakage = wire,\n      fileId = 15995657890504460412,\n      startByte = 40,\n      endByte = 54,\n      sourceInfo = (\n        startPosition = (line = 4, column = 3),\n        endPosition = (line = 5, column = 17) ),\n      nodeTypeChanged = (\n        changedNode = (\n          kind = field,\n          id = 11571794530418612586,\n          ordinal = 0,\n          shortName = \"id\" ) ) ) ],\n  files = [\n    ( id = 15995657890504460412,\n      path = \"tests/u16-to-u32/new.capnp\" ) ] )\n```\n\nDump changes as JSON:\n\n```sh\n$ ./main.ts --old-files tests/u16-to-u32/old.capnp --new-files tests/u16-to-u32/new.capnp --format json\n[\n  {\n    \"breakage\": \"wire\",\n    \"fileId\": \"@0xddfbfe1a5031487c\",\n    \"which\": \"nodeTypeChanged\",\n    \"nodeTypeChanged\": {\n      \"changedNode\": {\n        \"which\": \"field\",\n        \"id\": \"@0\",\n        \"structId\": \"@0xa09745d0bf68d96a\",\n        \"shortName\": \"id\"\n      }\n    },\n    \"file\": \"tests/u16-to-u32/new.capnp\",\n    \"start\": {\n      \"offset\": 40,\n      \"line\": 4,\n      \"column\": 3\n    },\n    \"end\": {\n      \"offset\": 54,\n      \"line\": 5,\n      \"column\": 17\n    }\n  }\n]\n```\n\n\u003c!-- spell-checker: ignore capnpc --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F71%2Fcapnp-diff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F71%2Fcapnp-diff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F71%2Fcapnp-diff/lists"}