Skip to content

Commit

Permalink
Separate exports again
Browse files Browse the repository at this point in the history
  • Loading branch information
Wundero committed Dec 7, 2024
1 parent 3613cd6 commit 35ff79d
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 54 deletions.
6 changes: 4 additions & 2 deletions packages/core/jsr.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"name": "@sinkr/core",
"license": "MIT",
"version": "0.3.9",
"version": "0.3.10",
"exports": {
".": "./src/index.ts"
".": "./src/index.ts",
"./client": "./src/index.browser.ts",
"./server": "./src/index.server.ts"
}
}
6 changes: 4 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "@sinkr/core",
"version": "0.3.9",
"version": "0.3.10",
"type": "module",
"main": "src/index.ts",
"exports": {
".": "./src/index.ts"
".": "./src/index.ts",
"./client": "./src/index.browser.ts",
"./server": "./src/index.server.ts"
},
"license": "MIT",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/index.browser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./browser";
export * from "./types";
2 changes: 2 additions & 0 deletions packages/core/src/index.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./server";
export * from "./types";
51 changes: 1 addition & 50 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,52 +1,3 @@
/**
* Event map for customizing which events can be sent or received.
*
* Override this with module augmentation to specify your own types.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface EventMap {}

/**
* User information for presence channels.
*
* Override this with module augmentation to specify your own types.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface UserInfo {}

/**
* Built-in event for initializing a connection.
*/
export const initEventSymbol: unique symbol = Symbol("sinkr-init");
/**
* Built-in event for updating a channel's connected member count.
*/
export const countEventSymbol: unique symbol = Symbol("sinkr-count");
/**
* Built-in event for a client connecting to a channel.
*/
export const joinEventSymbol: unique symbol = Symbol("sinkr-join");
/**
* Built-in event for a client disconnecting from a channel.
*/
export const leaveEventSymbol: unique symbol = Symbol("sinkr-leave");
/**
* Built-in event for a client to be informed of another client joining a presence channel.
*/
export const memberJoinEventSymbol: unique symbol = Symbol("sinkr-member-join");
/**
* Built-in event for a client to be informed of another client leaving a presence channel.
*/
export const memberLeaveEventSymbol: unique symbol =
Symbol("sinkr-member-leave");
/**
* Built-in event for when the client connects to Sinkr.
*/
export const connectSymbol: unique symbol = Symbol("sinkr-connect");
/**
* Built-in event for when the client disconnects from Sinkr.
*/
export const disconnectSymbol: unique symbol = Symbol("sinkr-disconnect");

export * from "./browser";
export * from "./server";
export * from "./types";
49 changes: 49 additions & 0 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* Event map for customizing which events can be sent or received.
*
* Override this with module augmentation to specify your own types.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface EventMap {}

/**
* User information for presence channels.
*
* Override this with module augmentation to specify your own types.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface UserInfo {}

/**
* Built-in event for initializing a connection.
*/
export const initEventSymbol: unique symbol = Symbol("sinkr-init");
/**
* Built-in event for updating a channel's connected member count.
*/
export const countEventSymbol: unique symbol = Symbol("sinkr-count");
/**
* Built-in event for a client connecting to a channel.
*/
export const joinEventSymbol: unique symbol = Symbol("sinkr-join");
/**
* Built-in event for a client disconnecting from a channel.
*/
export const leaveEventSymbol: unique symbol = Symbol("sinkr-leave");
/**
* Built-in event for a client to be informed of another client joining a presence channel.
*/
export const memberJoinEventSymbol: unique symbol = Symbol("sinkr-member-join");
/**
* Built-in event for a client to be informed of another client leaving a presence channel.
*/
export const memberLeaveEventSymbol: unique symbol =
Symbol("sinkr-member-leave");
/**
* Built-in event for when the client connects to Sinkr.
*/
export const connectSymbol: unique symbol = Symbol("sinkr-connect");
/**
* Built-in event for when the client disconnects from Sinkr.
*/
export const disconnectSymbol: unique symbol = Symbol("sinkr-disconnect");

0 comments on commit 35ff79d

Please sign in to comment.