diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a7fd3fe5..77ea3cc1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,14 @@ ## Testing in a real terminal -The recommended way to test node-pty during development is to clone the xterm.js repository and link's node-pty module to this directory. +The recommended way to test node-pty during development is via the electron example: + +```sh +cd examples/electron +npm ci +npm start +``` + +Alternatively, clone the xterm.js repository and link's node-pty module to this directory. 1. Clone xterm.js in a separate folder: ```sh diff --git a/examples/electron/index.html b/examples/electron/index.html index 07af52a1..500f8a0c 100644 --- a/examples/electron/index.html +++ b/examples/electron/index.html @@ -3,11 +3,11 @@ node-pty Electron example - +
- + diff --git a/examples/electron/main.js b/examples/electron/main.js index 1fedc7c1..07806a01 100644 --- a/examples/electron/main.js +++ b/examples/electron/main.js @@ -1,7 +1,7 @@ const { app, BrowserWindow, ipcMain } = require('electron'); const path = require('path'); const os = require('os'); -const pty = require('node-pty'); +const pty = require('../..'); let mainWindow; let ptyProcess; diff --git a/examples/electron/package-lock.json b/examples/electron/package-lock.json index 9230f859..7a8a248f 100644 --- a/examples/electron/package-lock.json +++ b/examples/electron/package-lock.json @@ -8,9 +8,8 @@ "name": "node-pty-electron-example", "version": "1.0.0", "dependencies": { - "electron": "^35.7.5", - "node-pty": "^1.0.0", - "xterm": "^5.0.0" + "@xterm/xterm": "^6.0.0", + "electron": "^35.7.5" } }, "node_modules/@electron/get": { @@ -113,6 +112,15 @@ "@types/node": "*" } }, + "node_modules/@xterm/xterm": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-6.0.0.tgz", + "integrity": "sha512-TQwDdQGtwwDt+2cgKDLn0IRaSxYu1tSUjgKarSDkUM0ZNiSRXFpjxEsvc/Zgc5kq5omJ+V0a8/kIM2WD3sMOYg==", + "license": "MIT", + "workspaces": [ + "addons/*" + ] + }, "node_modules/boolean": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz", @@ -591,22 +599,6 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, - "node_modules/node-addon-api": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", - "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", - "license": "MIT" - }, - "node_modules/node-pty": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/node-pty/-/node-pty-1.1.0.tgz", - "integrity": "sha512-20JqtutY6JPXTUnL0ij1uad7Qe1baT46lyolh2sSENDd4sTzKZ4nmAFkeAARDKwmlLjPx6XKRlwRUxwjOy+lUg==", - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "node-addon-api": "^7.1.0" - } - }, "node_modules/normalize-url": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", @@ -805,13 +797,6 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "license": "ISC" }, - "node_modules/xterm": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/xterm/-/xterm-5.3.0.tgz", - "integrity": "sha512-8QqjlekLUFTrU6x7xck1MsPzPA571K5zNqWm0M0oroYEWVOptZ0+ubQSkQ3uxIEhcIHRujJy6emDWX4A7qyFzg==", - "deprecated": "This package is now deprecated. Move to @xterm/xterm instead.", - "license": "MIT" - }, "node_modules/yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", diff --git a/examples/electron/package.json b/examples/electron/package.json index 3407bd1f..2cf2e1be 100644 --- a/examples/electron/package.json +++ b/examples/electron/package.json @@ -9,8 +9,7 @@ "repository": "https://github.com/microsoft/node-pty", "author": "Tyriar", "dependencies": { - "electron": "^35.7.5", - "node-pty": "^1.0.0", - "xterm": "^5.0.0" + "@xterm/xterm": "^6.0.0", + "electron": "^35.7.5" } }