next-ws 0.1.5-next.78595a2 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ declare const WebSocketContext: import("react").Context<WebSocket | null>;
3
+ /**
4
+ * Provides a WebSocket instance to its children via context,
5
+ * allowing for easy access to the websocket from anywhere in the app
6
+ * @param props WebSocket parameters and children
7
+ * @returns JSX Element
8
+ */
9
+ declare function WebSocketProvider({ children, url, protocols, }: {
10
+ children: React.ReactNode;
11
+ url: string;
12
+ protocols?: string[] | string;
13
+ }): import("react/jsx-runtime").JSX.Element;
14
+ declare const WebSocketConsumer: import("react").Consumer<WebSocket | null>;
15
+ /**
16
+ * Access the websocket from anywhere in the app, so long as it's wrapped in a WebSocketProvider
17
+ * @returns WebSocket on the client, null on the server
18
+ */
19
+ declare function useWebSocket(): WebSocket | null;
20
+ export { WebSocketContext, WebSocketProvider, WebSocketConsumer, useWebSocket };
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useWebSocket = exports.WebSocketConsumer = exports.WebSocketProvider = exports.WebSocketContext = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const WebSocketContext = (0, react_1.createContext)(null);
7
+ exports.WebSocketContext = WebSocketContext;
8
+ WebSocketContext.displayName = 'WebSocketContext';
9
+ /**
10
+ * Provides a WebSocket instance to its children via context,
11
+ * allowing for easy access to the websocket from anywhere in the app
12
+ * @param props WebSocket parameters and children
13
+ * @returns JSX Element
14
+ */
15
+ function WebSocketProvider({ children, url, protocols, }) {
16
+ const isBrowser = typeof window !== 'undefined';
17
+ const ws = (0, react_1.useMemo)(() => (isBrowser ? new WebSocket(url, protocols) : null), [isBrowser, url, protocols]);
18
+ (0, react_1.useEffect)(() => {
19
+ return () => {
20
+ if (ws && ws.readyState !== WebSocket.CLOSED)
21
+ ws.close();
22
+ };
23
+ }, []);
24
+ return (0, jsx_runtime_1.jsx)(WebSocketContext.Provider, { value: ws, children: children });
25
+ }
26
+ exports.WebSocketProvider = WebSocketProvider;
27
+ const WebSocketConsumer = WebSocketContext.Consumer;
28
+ exports.WebSocketConsumer = WebSocketConsumer;
29
+ /**
30
+ * Access the websocket from anywhere in the app, so long as it's wrapped in a WebSocketProvider
31
+ * @returns WebSocket on the client, null on the server
32
+ */
33
+ function useWebSocket() {
34
+ const context = (0, react_1.useContext)(WebSocketContext);
35
+ if (context === undefined)
36
+ throw new Error('useWebSocket must be used within a WebSocketProvider');
37
+ return context;
38
+ }
39
+ exports.useWebSocket = useWebSocket;
40
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/client/context.tsx"],"names":[],"mappings":";;;;AAAA,iCAAsE;AAEtE,MAAM,gBAAgB,GAAG,IAAA,qBAAa,EAAmB,IAAI,CAAC,CAAC;AAgDtD,4CAAgB;AA/CzB,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAElD;;;;;GAKG;AACH,SAAS,iBAAiB,CAAC,EACvB,QAAQ,EACR,GAAG,EACH,SAAS,GAKZ;IACG,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC;IAChD,MAAM,EAAE,GAAG,IAAA,eAAO,EACd,GAAG,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EACxD,CAAC,SAAS,EAAE,GAAG,EAAE,SAAS,CAAC,CAC9B,CAAC;IAEF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACX,OAAO,GAAG,EAAE;YACR,IAAI,EAAE,IAAI,EAAE,CAAC,UAAU,KAAK,SAAS,CAAC,MAAM;gBAAE,EAAE,CAAC,KAAK,EAAE,CAAC;QAC7D,CAAC,CAAC;IACN,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,uBAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,YACtC,QAAQ,GACe,CAAC;AACjC,CAAC;AAe0B,8CAAiB;AAb5C,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,QAAQ,CAAC;AAaN,8CAAiB;AAX/D;;;GAGG;AACH,SAAS,YAAY;IACjB,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,gBAAgB,CAAC,CAAC;IAC7C,IAAI,OAAO,KAAK,SAAS;QACrB,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC5E,OAAO,OAAO,CAAC;AACnB,CAAC;AAEgE,oCAAY"}
@@ -0,0 +1 @@
1
+ export * from './context';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./context"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/client/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ /* eslint-disable no-template-curly-in-string */
5
+ const fs = tslib_1.__importStar(require("node:fs/promises"));
6
+ const generator_1 = tslib_1.__importDefault(require("@babel/generator"));
7
+ const parser = tslib_1.__importStar(require("@babel/parser"));
8
+ const template_1 = tslib_1.__importDefault(require("@babel/template"));
9
+ void main();
10
+ async function main() {
11
+ await patchNextNodeServer();
12
+ await patchNextTypesPlugin();
13
+ }
14
+ const mod = template_1.default.expression.ast `require("next-ws/server")`;
15
+ // Add `require('next-ws/server').hookNextNodeServer.call(this)` to the
16
+ // constructor of `NextNodeServer` in `next/dist/server/next-server.js`
17
+ async function patchNextNodeServer() {
18
+ const filePath = require.resolve('next/dist/server/next-server');
19
+ const content = await fs.readFile(filePath, 'utf8');
20
+ const ast = parser.parse(content);
21
+ const classDeclaration = ast.program.body.find(node => node.type === 'ClassDeclaration' &&
22
+ node.id.name === 'NextNodeServer');
23
+ if (!classDeclaration)
24
+ return;
25
+ const constructorMethod = classDeclaration.body.body.find(node => node.type === 'ClassMethod' && node.kind === 'constructor');
26
+ if (!constructorMethod)
27
+ return;
28
+ const statement = template_1.default.statement
29
+ .ast `${mod}.hookNextNodeServer.call(this)`;
30
+ const expression = (0, generator_1.default)(statement).code;
31
+ // Ensure the statement is not already in the constructor
32
+ const existingStatement = constructorMethod.body.body //
33
+ .some(state => (0, generator_1.default)(state).code === expression);
34
+ if (!existingStatement)
35
+ constructorMethod.body.body.push(statement);
36
+ await fs.writeFile(filePath, (0, generator_1.default)(ast).code);
37
+ }
38
+ // Add `SOCKET?: Function` to the page module interface check field thing in
39
+ // `next/dist/build/webpack/plugins/next-types-plugin.js`
40
+ async function patchNextTypesPlugin() {
41
+ const filePath = require.resolve('next/dist/build/webpack/plugins/next-types-plugin.js');
42
+ const content = await fs.readFile(filePath, 'utf8');
43
+ if (content.includes('SOCKET?: Function'))
44
+ return;
45
+ const toFind = '.map((method)=>`${method}?: Function`).join("\\n ")';
46
+ const replaceWith = `${toFind} + "; SOCKET?: Function"`;
47
+ const newContent = content.replace(toFind, replaceWith);
48
+ await fs.writeFile(filePath, newContent);
49
+ }
50
+ //# sourceMappingURL=patch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch.js","sourceRoot":"","sources":["../src/common/patch.ts"],"names":[],"mappings":";;;AAAA,gDAAgD;AAChD,6DAAuC;AACvC,yEAAwC;AACxC,8DAAwC;AACxC,uEAAuC;AAGvC,KAAK,IAAI,EAAE,CAAC;AACZ,KAAK,UAAU,IAAI;IACf,MAAM,mBAAmB,EAAE,CAAC;IAC5B,MAAM,oBAAoB,EAAE,CAAC;AACjC,CAAC;AAED,MAAM,GA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AAI,CAAC,SAAS,CAAC,CAAC;IAEpE,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAA,mBAAQ,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;AACrD,CAAC;AAED,4EAA4E;AAC5E,yDAAyD;AACzD,KAAK,UAAU,oBAAoB;IAC/B,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAC5B,sDAAsD,CACzD,CAAC;IACF,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACpD,IAAI,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC;QAAE,OAAO;IAElD,MAAM,MAAM,GAAG,sDAAsD,CAAC;IACtE,MAAM,WAAW,GAAG,GAAG,MAAM,0BAA0B,CAAC;IAExD,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACxD,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AAC7C,CAAC"}
package/package.json CHANGED
@@ -1,75 +1,66 @@
1
- {
2
- "name": "next-ws",
3
- "version": "0.1.5-next.78595a2",
4
- "description": "Add support for WebSockets in Next.js 13 app directory",
5
- "packageManager": "yarn@3.6.0",
6
- "license": "MIT",
7
- "keywords": [
8
- "next",
9
- "websocket",
10
- "ws",
11
- "server",
12
- "client"
13
- ],
14
- "homepage": "https://github.com/apteryxxyz/next-ws#readme",
15
- "repository": {
16
- "type": "git",
17
- "url": "git+https://github.com/apteryxxyz/next-ws.git"
18
- },
19
- "bugs": {
20
- "url": "https://github.com/apteryxxyz/next-ws/issues"
21
- },
22
- "files": [
23
- "*.js",
24
- "*.d.ts"
25
- ],
26
- "scripts": {
27
- "build": "tsc",
28
- "clean": "rimraf client server common",
29
- "lint": "eslint --ext .ts,.tsx src",
30
- "format": "prettier --write src/**/*.{ts,tsx} && eslint --fix --ext .ts,.tsx src/",
31
- "postinstall": "node -e \"try{require('./common/patch.js')}catch{}\""
32
- },
33
- "dependencies": {
34
- "@babel/generator": "^7.22.5",
35
- "@babel/parser": "^7.22.5",
36
- "@babel/template": "^7.22.5"
37
- },
38
- "peerDependencies": {
39
- "next": "*",
40
- "react": "*",
41
- "ws": "*"
42
- },
43
- "devDependencies": {
44
- "@babel/types": "^7.22.4",
45
- "@rushstack/eslint-patch": "^1.3.0",
46
- "@types/babel__generator": "^7",
47
- "@types/babel__template": "^7",
48
- "@types/eslint": "^8",
49
- "@types/node": "^20.2.5",
50
- "@types/prettier": "^2",
51
- "@types/react": "^18",
52
- "@types/ws": "^8",
53
- "@typescript-eslint/eslint-plugin": "^5.59.8",
54
- "@typescript-eslint/parser": "^5.59.8",
55
- "eslint": "^8.41.0",
56
- "eslint-config-apteryx": "^2.1.7",
57
- "eslint-config-prettier": "^8.8.0",
58
- "eslint-plugin-import": "^2.27.5",
59
- "eslint-plugin-jsdoc": "^46.1.0",
60
- "eslint-plugin-n": "^16.0.0",
61
- "eslint-plugin-prettier": "^4.2.1",
62
- "eslint-plugin-promise": "^6.1.1",
63
- "eslint-plugin-sonarjs": "^0.19.0",
64
- "eslint-plugin-unicorn": "^47.0.0",
65
- "next": "^13.4.4",
66
- "prettier": "^2.8.8",
67
- "prettier-config-apteryx": "^2.1.0",
68
- "react": "^18.2.0",
69
- "rimraf": "^5.0.1",
70
- "ts-config-apteryx": "^2.1.0",
71
- "typescript": "<5.1.0",
72
- "ws": "^8.13.0"
73
- },
74
- "prettier": "prettier-config-apteryx"
75
- }
1
+ {
2
+ "name": "next-ws",
3
+ "version": "0.1.5",
4
+ "description": "Add support for WebSockets in Next.js 13 app directory",
5
+ "packageManager": "yarn@3.6.0",
6
+ "license": "MIT",
7
+ "keywords": ["next", "websocket", "ws", "server", "client"],
8
+ "homepage": "https://github.com/apteryxxyz/next-ws#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/apteryxxyz/next-ws.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/apteryxxyz/next-ws/issues"
15
+ },
16
+ "files": ["client", "common", "server"],
17
+ "scripts": {
18
+ "build": "tsc",
19
+ "clean": "rimraf client server common",
20
+ "lint": "eslint --ext .ts,.tsx src",
21
+ "format": "prettier --write src/**/*.{ts,tsx} && eslint --fix --ext .ts,.tsx src/",
22
+ "postinstall": "node -e \"try{require('./common/patch.js')}catch{}\""
23
+ },
24
+ "dependencies": {
25
+ "@babel/generator": "^7.22.5",
26
+ "@babel/parser": "^7.22.5",
27
+ "@babel/template": "^7.22.5"
28
+ },
29
+ "peerDependencies": {
30
+ "next": "*",
31
+ "react": "*",
32
+ "ws": "*"
33
+ },
34
+ "devDependencies": {
35
+ "@babel/types": "^7.22.4",
36
+ "@rushstack/eslint-patch": "^1.3.0",
37
+ "@types/babel__generator": "^7",
38
+ "@types/babel__template": "^7",
39
+ "@types/eslint": "^8",
40
+ "@types/node": "^20.2.5",
41
+ "@types/prettier": "^2",
42
+ "@types/react": "^18",
43
+ "@types/ws": "^8",
44
+ "@typescript-eslint/eslint-plugin": "^5.59.8",
45
+ "@typescript-eslint/parser": "^5.59.8",
46
+ "eslint": "^8.41.0",
47
+ "eslint-config-apteryx": "^2.1.7",
48
+ "eslint-config-prettier": "^8.8.0",
49
+ "eslint-plugin-import": "^2.27.5",
50
+ "eslint-plugin-jsdoc": "^46.1.0",
51
+ "eslint-plugin-n": "^16.0.0",
52
+ "eslint-plugin-prettier": "^4.2.1",
53
+ "eslint-plugin-promise": "^6.1.1",
54
+ "eslint-plugin-sonarjs": "^0.19.0",
55
+ "eslint-plugin-unicorn": "^47.0.0",
56
+ "next": "^13.4.4",
57
+ "prettier": "^2.8.8",
58
+ "prettier-config-apteryx": "^2.1.0",
59
+ "react": "^18.2.0",
60
+ "rimraf": "^5.0.1",
61
+ "ts-config-apteryx": "^2.1.0",
62
+ "typescript": "<5.1.0",
63
+ "ws": "^8.13.0"
64
+ },
65
+ "prettier": "prettier-config-apteryx"
66
+ }
@@ -0,0 +1,3 @@
1
+ import NextNodeServer from 'next/dist/server/next-server';
2
+ export type SocketHandler = (client: import('ws').WebSocket, request: import('http').IncomingMessage, server: import('ws').WebSocketServer) => any;
3
+ export declare function hookNextNodeServer(this: NextNodeServer): void;
package/server/hook.js ADDED
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hookNextNodeServer = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const node_http_1 = require("node:http");
6
+ const path = tslib_1.__importStar(require("node:path"));
7
+ const Log = tslib_1.__importStar(require("next/dist/build/output/log"));
8
+ const next_server_1 = tslib_1.__importDefault(require("next/dist/server/next-server"));
9
+ const is_dynamic_1 = require("next/dist/shared/lib/router/utils/is-dynamic");
10
+ const ws_1 = require("ws");
11
+ let existingWebSocketServer;
12
+ function hookNextNodeServer() {
13
+ if (!this || !(this instanceof next_server_1.default))
14
+ throw new Error("[next-ws] 'this' of hookNextNodeServer is not a NextNodeServer");
15
+ const server = this.serverOptions?.httpServer;
16
+ if (!server || !(server instanceof node_http_1.Server))
17
+ throw new Error("[next-ws] Failed to find NextNodeServer's HTTP server");
18
+ if (existingWebSocketServer)
19
+ return;
20
+ const wss = new ws_1.WebSocketServer({ noServer: true });
21
+ Log.ready('[next-ws] websocket server started successfully');
22
+ existingWebSocketServer = wss;
23
+ server.on('upgrade', async (request, socket, head) => {
24
+ const url = new URL(request.url ?? '', 'http://next-ws');
25
+ // Ignore requests to Next.js' own internal files
26
+ if (url.pathname.startsWith('/_next'))
27
+ return;
28
+ // Attempt to find a matching page
29
+ const pathname = await isPageFound.call(this, url.pathname);
30
+ if (!pathname)
31
+ return;
32
+ const internalPathname = path
33
+ .join(pathname, 'route')
34
+ .replaceAll(path.sep, '/');
35
+ // Ensure the page is built
36
+ // @ts-expect-error HotReloader is private
37
+ await this.hotReloader.ensurePage({
38
+ page: internalPathname,
39
+ clientOnly: false,
40
+ });
41
+ let builtPagePath;
42
+ try {
43
+ builtPagePath = this.getPagePath(internalPathname);
44
+ }
45
+ catch {
46
+ return Log.error(`[next-ws] failed to get page ${pathname}`);
47
+ }
48
+ const pageModule = await require(builtPagePath);
49
+ // Equates to the exported "SOCKET" function in the route file
50
+ const socketHandler = pageModule.routeModule.userland.SOCKET;
51
+ if (!socketHandler || typeof socketHandler !== 'function')
52
+ return Log.error(`[next-ws] failed to find SOCKET handler for page ${pathname}`);
53
+ wss.handleUpgrade(request, socket, head, (client, request) => {
54
+ socketHandler(client, request, wss);
55
+ });
56
+ });
57
+ }
58
+ exports.hookNextNodeServer = hookNextNodeServer;
59
+ async function isPageFound(pathname) {
60
+ if (!(0, is_dynamic_1.isDynamicRoute)(pathname) && (await this.hasPage(pathname)))
61
+ return pathname;
62
+ for (const route of this.dynamicRoutes ?? []) {
63
+ const params = route.match(pathname) || undefined;
64
+ if (params)
65
+ return route.page;
66
+ }
67
+ return false;
68
+ }
69
+ //# sourceMappingURL=hook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hook.js","sourceRoot":"","sources":["../src/server/hook.ts"],"names":[],"mappings":";;;;AAAA,yCAAmC;AACnC,wDAAkC;AAClC,wEAAkD;AAClD,uFAA0D;AAC1D,6EAA8E;AAC9E,2BAAqC;AAQrC,IAAI,uBAAoD,CAAC;AAEzD,SAAgB,kBAAkB;IAC9B,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,YAAY,qBAAc,CAAC;QAC1C,MAAM,IAAI,KAAK,CACX,gEAAgE,CACnE,CAAC;IAEN,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC;IAC9C,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,YAAY,kBAAM,CAAC;QACtC,MAAM,IAAI,KAAK,CACX,uDAAuD,CAC1D,CAAC;IAEN,IAAI,uBAAuB;QAAE,OAAO;IACpC,MAAM,GAAG,GAAG,IAAI,oBAAe,CAAC,EAAE,QAAQ,EAA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rD,OAAO,GAAG,CAAC,KAAK,CACZ,oDAAoD,QAAQ,EAAE,CACjE,CAAC;QAEN,GAAG,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;YACzD,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AAzDD,gDAyDC;AAED,KAAK,UAAU,WAAW,CAAuB,QAAgB;IAC7D,IAAI,CAAC,IAAA,2BAAc,EAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC3D,OAAO,QAAQ,CAAC;IAEpB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,aAAa,IAAI,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;QAClD,IAAI,MAAM;YAAE,OAAO,KAAK,CAAC,IAAI,CAAC;KACjC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './hook';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./hook"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/server/index.ts"],"names":[],"mappings":";;;AAAA,iDAAuB"}