Skip to content

Commit

Permalink
chore: migrate to TypeScript
Browse files Browse the repository at this point in the history
This change introduces an ESM build which will allow tree shaking. A
CJS build is also provided for backward compatibility.
  • Loading branch information
darrachequesne committed Oct 4, 2021
1 parent c7e27b0 commit 7245b80
Show file tree
Hide file tree
Showing 34 changed files with 603 additions and 1,042 deletions.
8 changes: 0 additions & 8 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion lib/globalThis.browser.js → lib/globalThis.browser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = (() => {
export default (() => {
if (typeof self !== "undefined") {
return self;
} else if (typeof window !== "undefined") {
Expand Down
1 change: 0 additions & 1 deletion lib/globalThis.js

This file was deleted.

1 change: 1 addition & 0 deletions lib/globalThis.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default global;
14 changes: 0 additions & 14 deletions lib/index.js

This file was deleted.

14 changes: 14 additions & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Socket } from "./socket.js";

export default (uri, opts) => new Socket(uri, opts);

/**
* Expose deps for legacy compatibility
* and standalone browser access.
*/
export { Socket };
export { SocketOptions } from "./socket.js";
export const protocol = Socket.protocol;
export { Transport } from "./transport.js";
export { transports } from "./transports/index.js";
export { installTimerFunctions } from "./util.js";
Loading

0 comments on commit 7245b80

Please sign in to comment.