From 35c531927c0150026fab1de426ced4489acc63ee Mon Sep 17 00:00:00 2001 From: aoife cassidy Date: Mon, 18 Nov 2024 14:44:37 +0200 Subject: [PATCH] move to one dir again to fix dts errors --- packages/javascript/package.json | 12 +++++------ packages/javascript/src/gen/dts/version.d.ts | 1 - packages/javascript/src/index.cjs | 22 ++++++++++---------- packages/javascript/src/index.d.ts | 22 ++++++++++---------- packages/javascript/src/index.js | 22 ++++++++++---------- 5 files changed, 39 insertions(+), 40 deletions(-) delete mode 100644 packages/javascript/src/gen/dts/version.d.ts diff --git a/packages/javascript/package.json b/packages/javascript/package.json index 9f572a6c..721027f8 100644 --- a/packages/javascript/package.json +++ b/packages/javascript/package.json @@ -22,13 +22,13 @@ } }, "scripts": { - "generate:version:esm": "genversion --esm --semi src/gen/esm/version.js", - "generate:version:cjs": "genversion --semi src/gen/cjs/version.js", + "generate:version:esm": "genversion --esm --semi src/gen/version.mjs", + "generate:version:cjs": "genversion --semi src/gen/version.cjs", "generate:version": "pnpm generate:version:esm && pnpm generate:version:cjs", - "generate:proto:esm": "mkdir -p src/gen/esm && protoc --es_out src/gen/esm --es_opt target=js -I=../../protobufs ../../protobufs/livekit_*.proto", - "generate:proto:cjs": "mkdir -p src/gen/cjs && protoc --es_out src/gen/cjs --es_opt target=js,js_import_style=legacy_commonjs -I=../../protobufs ../../protobufs/livekit_*.proto && rename \"s/js$/cjs/\" src/gen/cjs/*.js && sed -i 's/\\.js\")/.cjs\")/' src/gen/cjs/*.cjs", - "generate:proto:dts": "protoc --es_out src/gen/dts --es_opt target=dts -I=../../protobufs ../../protobufs/livekit_*.proto", - "generate:proto": "pnpm generate:proto:esm && pnpm generate:proto:cjs && pnpm generate:proto:dts", + "generate:proto:esm": "protoc --es_out src/gen --es_opt target=js -I=../../protobufs ../../protobufs/livekit_*.proto", + "generate:proto:cjs": "protoc --es_out src/gen --es_opt target=js,js_import_style=legacy_commonjs -I=../../protobufs ../../protobufs/livekit_*.proto && rename \"s/js$/cjs/\" src/gen/*.js && sed -i 's/\\.js\")/.cjs\")/' src/gen/*.cjs", + "generate:proto:dts": "protoc --es_out src/gen --es_opt target=dts -I=../../protobufs ../../protobufs/livekit_*.proto", + "generate:proto": "pnpm generate:proto:cjs && pnpm generate:proto:esm && pnpm generate:proto:dts", "build": "pnpm generate:version && pnpm generate:proto" }, "keywords": [], diff --git a/packages/javascript/src/gen/dts/version.d.ts b/packages/javascript/src/gen/dts/version.d.ts deleted file mode 100644 index baaee2fd..00000000 --- a/packages/javascript/src/gen/dts/version.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const version: string; diff --git a/packages/javascript/src/index.cjs b/packages/javascript/src/index.cjs index e378245d..b75138b5 100644 --- a/packages/javascript/src/index.cjs +++ b/packages/javascript/src/index.cjs @@ -1,16 +1,16 @@ // @ts-check const { protoInt64 } = require("@bufbuild/protobuf"); -const agentDispatch = require("./gen/cjs/livekit_agent_dispatch_pb.cjs"); -const agent = require("./gen/cjs/livekit_agent_pb.cjs"); -const egress = require("./gen/cjs/livekit_egress_pb.cjs"); -const ingress = require("./gen/cjs/livekit_ingress_pb.cjs"); -const metrics = require("./gen/cjs/livekit_metrics_pb.cjs"); -const models = require("./gen/cjs/livekit_models_pb.cjs"); -const room = require("./gen/cjs/livekit_room_pb.cjs"); -const rtc = require("./gen/cjs/livekit_rtc_pb.cjs"); -const sip = require("./gen/cjs/livekit_sip_pb.cjs"); -const webhook = require("./gen/cjs/livekit_webhook_pb.cjs"); -const version = require("./gen/cjs/version.cjs"); +const agentDispatch = require("./gen/livekit_agent_dispatch_pb.cjs"); +const agent = require("./gen/livekit_agent_pb.cjs"); +const egress = require("./gen/livekit_egress_pb.cjs"); +const ingress = require("./gen/livekit_ingress_pb.cjs"); +const metrics = require("./gen/livekit_metrics_pb.cjs"); +const models = require("./gen/livekit_models_pb.cjs"); +const room = require("./gen/livekit_room_pb.cjs"); +const rtc = require("./gen/livekit_rtc_pb.cjs"); +const sip = require("./gen/livekit_sip_pb.cjs"); +const webhook = require("./gen/livekit_webhook_pb.cjs"); +const version = require("./gen/version.cjs"); module.exports = { protoInt64, diff --git a/packages/javascript/src/index.d.ts b/packages/javascript/src/index.d.ts index 8d0a96cb..094183bb 100644 --- a/packages/javascript/src/index.d.ts +++ b/packages/javascript/src/index.d.ts @@ -1,12 +1,12 @@ export { protoInt64 } from "@bufbuild/protobuf"; -export type * from "./gen/dts/livekit_agent_dispatch_pb.d.ts"; -export type * from "./gen/dts/livekit_agent_pb.d.ts"; -export type * from "./gen/dts/livekit_egress_pb.d.ts"; -export type * from "./gen/dts/livekit_ingress_pb.d.ts"; -export type * from "./gen/dts/livekit_metrics_pb.d.ts"; -export type * from "./gen/dts/livekit_models_pb.d.ts"; -export type * from "./gen/dts/livekit_room_pb.d.ts"; -export type * from "./gen/dts/livekit_rtc_pb.d.ts"; -export type * from "./gen/dts/livekit_sip_pb.d.ts"; -export type * from "./gen/dts/livekit_webhook_pb.d.ts"; -export type * from "./gen/dts/version.d.ts"; +export * from "./gen/livekit_agent_dispatch_pb.js"; +export * from "./gen/livekit_agent_pb.js"; +export * from "./gen/livekit_egress_pb.js"; +export * from "./gen/livekit_ingress_pb.js"; +export * from "./gen/livekit_metrics_pb.js"; +export * from "./gen/livekit_models_pb.js"; +export * from "./gen/livekit_room_pb.js"; +export * from "./gen/livekit_rtc_pb.js"; +export * from "./gen/livekit_sip_pb.js"; +export * from "./gen/livekit_webhook_pb.js"; +export * from "./gen/version.js"; diff --git a/packages/javascript/src/index.js b/packages/javascript/src/index.js index d377cabe..e1d9ba90 100644 --- a/packages/javascript/src/index.js +++ b/packages/javascript/src/index.js @@ -1,13 +1,13 @@ // @ts-check export { protoInt64 } from "@bufbuild/protobuf"; -export * from "./gen/esm/livekit_agent_dispatch_pb.js"; -export * from "./gen/esm/livekit_agent_pb.js"; -export * from "./gen/esm/livekit_egress_pb.js"; -export * from "./gen/esm/livekit_ingress_pb.js"; -export * from "./gen/esm/livekit_metrics_pb.js"; -export * from "./gen/esm/livekit_models_pb.js"; -export * from "./gen/esm/livekit_room_pb.js"; -export * from "./gen/esm/livekit_rtc_pb.js"; -export * from "./gen/esm/livekit_sip_pb.js"; -export * from "./gen/esm/livekit_webhook_pb.js"; -export * from "./gen/esm/version.js"; +export * from "./gen/livekit_agent_dispatch_pb.js"; +export * from "./gen/livekit_agent_pb.js"; +export * from "./gen/livekit_egress_pb.js"; +export * from "./gen/livekit_ingress_pb.js"; +export * from "./gen/livekit_metrics_pb.js"; +export * from "./gen/livekit_models_pb.js"; +export * from "./gen/livekit_room_pb.js"; +export * from "./gen/livekit_rtc_pb.js"; +export * from "./gen/livekit_sip_pb.js"; +export * from "./gen/livekit_webhook_pb.js"; +export * from "./gen/version.mjs";