Skip to content

Commit

Permalink
move to mjs by default
Browse files Browse the repository at this point in the history
  • Loading branch information
nbsp committed Nov 13, 2024
1 parent ba8969e commit 0873f17
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 43 deletions.
7 changes: 4 additions & 3 deletions packages/javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
"name": "@livekit/protocol",
"version": "1.27.1",
"description": "",
"type": "module",
"main": "src/index.js",
"module": "src/index.mjs",
"import": "src/index.cjs",
"types": "src/index.d.ts",
"files": [
"src"
],
"exports": {
".": {
"types": "./src/index.d.ts",
"import": "./src/index.mjs",
"require": "./src/index.js"
"import": "./src/index.js",
"require": "./src/index.cjs"
},
"./*": {
"types": "./src/gen/dts/livekit_*_pb.d.ts",
Expand Down
28 changes: 28 additions & 0 deletions packages/javascript/src/index.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// @ts-check
const { protoInt64 } = require("@bufbuild/protobuf");
const agentDispatch = require("./gen/cjs/livekit_agent_dispatch_pb.js");
const agent = require("./gen/cjs/livekit_agent_pb.js");
const egress = require("./gen/cjs/livekit_egress_pb.js");
const ingress = require("./gen/cjs/livekit_ingress_pb.js");
const metrics = require("./gen/cjs/livekit_metrics_pb.js");
const models = require("./gen/cjs/livekit_models_pb.js");
const room = require("./gen/cjs/livekit_room_pb.js");
const rtc = require("./gen/cjs/livekit_rtc_pb.js");
const sip = require("./gen/cjs/livekit_sip_pb.js");
const webhook = require("./gen/cjs/livekit_webhook_pb.js");
const version = require("./gen/cjs/version.js");

module.exports = {
protoInt64,
...agentDispatch,
...agent,
...egress,
...ingress,
...metrics,
...models,
...room,
...rtc,
...sip,
...webhook,
version,
}
39 changes: 12 additions & 27 deletions packages/javascript/src/index.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
// @ts-check
const { protoInt64 } = require("@bufbuild/protobuf");
const agentDispatch = require("./gen/esm/livekit_agent_dispatch_pb.js");
const agent = require("./gen/esm/livekit_agent_pb.js");
const egress = require("./gen/esm/livekit_egress_pb.js");
const ingress = require("./gen/esm/livekit_ingress_pb.js");
const metrics = require("./gen/esm/livekit_metrics_pb.js");
const models = require("./gen/esm/livekit_models_pb.js");
const room = require("./gen/esm/livekit_room_pb.js");
const rtc = require("./gen/esm/livekit_rtc_pb.js");
const sip = require("./gen/esm/livekit_sip_pb.js");
const webhook = require("./gen/esm/livekit_webhook_pb.js");
const version = require("./gen/esm/version.js");

module.exports = {
protoInt64,
...agentDispatch,
...agent,
...egress,
...ingress,
...metrics,
...models,
...room,
...rtc,
...sip,
...webhook,
...version,
}
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";
13 changes: 0 additions & 13 deletions packages/javascript/src/index.mjs

This file was deleted.

0 comments on commit 0873f17

Please sign in to comment.