mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 19:47:46 -07:00
- Replace the custom Node packaging script with a flat inline step (cp the .proto glob, cp the static files, npm version) so the workflow speaks the same shell idiom as the other workflows. - Promote package.json and README.md to static files under libcockatrice_protocol/npm/ so contributors edit them in-place. - Re-format libcockatrice_protocol/CMakeLists.txt per .cmake-format.json. - Add workflow_dispatch (manual run; optional version input) and timeout-minutes: 10. - Drop --provenance from npm publish: GitHub Packages doesn't attest Sigstore provenance.
1 KiB
1 KiB
@cockatrice/protocol
Network protocol artifacts for Cockatrice: the .proto
definitions used by the desktop client, Servatrice, and the webclient, plus the
authoritative protocol version constant they all share.
Install
npm install @cockatrice/protocol
The package is published to GitHub Packages under the @cockatrice scope; consumers
need an .npmrc entry pointing the scope at https://npm.pkg.github.com and a
GITHUB_TOKEN with read:packages.
Contents
pb/*.proto— every protobuf schema file fromlibcockatrice_protocol.protocol_version.json—{ "protocolVersion": <int> }. Identical to the file the C++ build reads viaconfigure_file().
Usage (TypeScript)
import protocolVersionInfo from "@cockatrice/protocol/protocol_version.json" with { type: "json" };
export const PROTOCOL_VERSION = protocolVersionInfo.protocolVersion;
Point your protobuf code-generator (e.g. buf) at node_modules/@cockatrice/protocol/pb.