From 5726c611cb3bdf36bd9704c3f6bb7bc7fd65bc67 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Mon, 11 Mar 2024 11:17:58 +0100 Subject: [PATCH] Export livekit_room stubs for protocol package (#640) * export livekit_room stubs for protocol package * changeset * forgot ingress --- .changeset/yellow-avocados-juggle.md | 5 ++ packages/javascript/package.json | 37 ++++++++++++++- packages/javascript/src/index.d.ts | 1 + packages/javascript/src/index.js | 2 + pnpm-lock.yaml | 71 ---------------------------- 5 files changed, 43 insertions(+), 73 deletions(-) create mode 100644 .changeset/yellow-avocados-juggle.md diff --git a/.changeset/yellow-avocados-juggle.md b/.changeset/yellow-avocados-juggle.md new file mode 100644 index 00000000..b0c3c75b --- /dev/null +++ b/.changeset/yellow-avocados-juggle.md @@ -0,0 +1,5 @@ +--- +"@livekit/protocol": patch +--- + +Export room stubs from package diff --git a/packages/javascript/package.json b/packages/javascript/package.json index 9abbbb8f..83a74760 100644 --- a/packages/javascript/package.json +++ b/packages/javascript/package.json @@ -8,16 +8,49 @@ "files": [ "src" ], + "exports": { + ".": { + "types": "./src/index.d.ts", + "default": "./src/index.js" + }, + "./models": { + "types": "./src/gen/livekit_models.pb.d.ts", + "default": "./src/gen/livekit_models.pb.js" + }, + "./room": { + "types": "./src/gen/livekit_room.pb.d.ts", + "default": "./src/gen/livekit_room.pb.js" + }, + "./sip": { + "types": "./src/gen/livekit_sip.pb.d.ts", + "default": "./src/gen/livekit_sip.pb.js" + }, + "./egress": { + "types": "./src/gen/livekit_egress.pb.d.ts", + "default": "./src/gen/livekit_egress.pb.js" + }, + "./ingress": { + "types": "./src/gen/livekit_ingress.pb.d.ts", + "default": "./src/gen/livekit_ingress.pb.js" + }, + "./agent": { + "types": "./src/gen/livekit_agent.pb.d.ts", + "default": "./src/gen/livekit_agent.pb.js" + }, + "./webhook": { + "types": "./src/gen/livekit_webhook.pb.d.ts", + "default": "./src/gen/livekit_webhook.pb.js" + } + }, "scripts": { "generate:version": "genversion --esm --semi src/gen/version.js", - "generate:proto": "protoc --es_out src/gen --es_opt target=js+dts -I=../../protobufs ../../protobufs/livekit_rtc.proto ../../protobufs/livekit_models.proto ../../protobufs/livekit_agent.proto ../../protobufs/livekit_webhook.proto ../../protobufs/livekit_egress.proto ../../protobufs/livekit_ingress.proto ../../protobufs/livekit_sip.proto", + "generate:proto": "protoc --es_out src/gen --es_opt target=js+dts -I=../../protobufs ../../protobufs/livekit_room.proto ../../protobufs/livekit_rtc.proto ../../protobufs/livekit_models.proto ../../protobufs/livekit_agent.proto ../../protobufs/livekit_webhook.proto ../../protobufs/livekit_egress.proto ../../protobufs/livekit_ingress.proto ../../protobufs/livekit_sip.proto", "build": "pnpm generate:version && pnpm generate:proto" }, "keywords": [], "author": "LiveKit", "license": "Apache-2.0", "devDependencies": { - "@bufbuild/buf": "^1.29.0", "@bufbuild/protoc-gen-es": "^1.7.2", "genversion": "^3.2.0" }, diff --git a/packages/javascript/src/index.d.ts b/packages/javascript/src/index.d.ts index fc1c0ee4..0d873a60 100644 --- a/packages/javascript/src/index.d.ts +++ b/packages/javascript/src/index.d.ts @@ -1,4 +1,5 @@ export * from "./gen/version.js"; +export * from "./gen/livekit_room_pb.js"; export * from "./gen/livekit_agent_pb.js"; export * from "./gen/livekit_models_pb.js"; export * from "./gen/livekit_rtc_pb.js"; diff --git a/packages/javascript/src/index.js b/packages/javascript/src/index.js index fc1c0ee4..192be2ad 100644 --- a/packages/javascript/src/index.js +++ b/packages/javascript/src/index.js @@ -1,4 +1,6 @@ +// @ts-check export * from "./gen/version.js"; +export * from "./gen/livekit_room_pb.js"; export * from "./gen/livekit_agent_pb.js"; export * from "./gen/livekit_models_pb.js"; export * from "./gen/livekit_rtc_pb.js"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 75c231b6..dc0dc308 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,9 +21,6 @@ importers: specifier: ^1.7.2 version: 1.7.2 devDependencies: - '@bufbuild/buf': - specifier: ^1.29.0 - version: 1.29.0 '@bufbuild/protoc-gen-es': specifier: ^1.7.2 version: 1.7.2(@bufbuild/protobuf@1.7.2) @@ -62,74 +59,6 @@ packages: regenerator-runtime: 0.14.1 dev: true - /@bufbuild/buf-darwin-arm64@1.29.0: - resolution: {integrity: sha512-5hKxsARoY2WpWq1n5ONFqqGuauHb4yILKXCy37KRYCKiRLWmIP5yI3gWvWHKoH7sUJWTQmBqdJoCvYQr6ahQnw==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@bufbuild/buf-darwin-x64@1.29.0: - resolution: {integrity: sha512-wOAPxbPLBns4AHiComWtdO1sx1J1p6mDYTbqmloHuI+B5U2rDbMsoHoe4nBcoMF8+RHxoqjypha29wVo6yzbZg==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@bufbuild/buf-linux-aarch64@1.29.0: - resolution: {integrity: sha512-jLk2J/wyyM7KNJ/DkLfhy3eS2/Bdb70e/56adMkapSoLJmghnpgxW+oFznMxxQUX5I9BU5hTn1UhDFxgLwhP7g==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@bufbuild/buf-linux-x64@1.29.0: - resolution: {integrity: sha512-heLOywj3Oaoh69RnTx7tHsuz6rEnvz77bghLEOghsrjBR6Jcpcwc137EZR4kRTIWJNrE8Kmo3RVeXlv144qQIQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@bufbuild/buf-win32-arm64@1.29.0: - resolution: {integrity: sha512-Eglyvr3PLqVucuHBcQ61conyBgH9BRaoLpKWcce1gYBVlxMQM1NxjVjGOWihxQ1dXXw5qZXmYfVODf3gSwPMuQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@bufbuild/buf-win32-x64@1.29.0: - resolution: {integrity: sha512-wRk6co+nqHqEq4iLolXgej0jUVlWlTtGHjKaq54lTbKZrwxrBgql6qS06abgNPRASX0++XT9m3QRZ97qEIC/HQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@bufbuild/buf@1.29.0: - resolution: {integrity: sha512-euksXeFtvlvAV5j94LqXb69qQcJvFfo8vN1d3cx+IzhOKoipykuQQTq7mOWVo2R0kdk6yIMBLBofOYOsh0Df8g==} - engines: {node: '>=12'} - hasBin: true - requiresBuild: true - optionalDependencies: - '@bufbuild/buf-darwin-arm64': 1.29.0 - '@bufbuild/buf-darwin-x64': 1.29.0 - '@bufbuild/buf-linux-aarch64': 1.29.0 - '@bufbuild/buf-linux-x64': 1.29.0 - '@bufbuild/buf-win32-arm64': 1.29.0 - '@bufbuild/buf-win32-x64': 1.29.0 - dev: true - /@bufbuild/protobuf@1.7.2: resolution: {integrity: sha512-i5GE2Dk5ekdlK1TR7SugY4LWRrKSfb5T1Qn4unpIMbfxoeGKERKQ59HG3iYewacGD10SR7UzevfPnh6my4tNmQ==}