From b6203b4001216cbc996ef60445b6cdc1e57451fd Mon Sep 17 00:00:00 2001 From: Grzegorz Zdunek Date: Fri, 26 Jul 2024 11:13:09 +0200 Subject: [PATCH] Update xterm (#44594) (cherry picked from commit e6ff70667f87c09c18a898efd1546931057915b1) --- pnpm-lock.yaml | 129 +++++++++--------- web/packages/teleport/package.json | 12 +- .../Console/DocumentSsh/Terminal/Terminal.tsx | 2 +- .../src/Console/StyledXterm/StyledXterm.tsx | 2 +- .../teleport/src/lib/term/terminal.ts | 12 +- web/packages/teleterm/package.json | 4 +- .../src/ui/DocumentTerminal/Terminal/ctrl.ts | 6 +- 7 files changed, 81 insertions(+), 86 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fd95be8a0c03e..aa1e48dc003da 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -348,27 +348,27 @@ importers: '@opentelemetry/semantic-conventions': specifier: 1.25.1 version: 1.25.1 + '@xterm/addon-canvas': + specifier: ^0.7.0 + version: 0.7.0(@xterm/xterm@5.5.0) + '@xterm/addon-fit': + specifier: ^0.10.0 + version: 0.10.0(@xterm/xterm@5.5.0) + '@xterm/addon-web-links': + specifier: ^0.11.0 + version: 0.11.0(@xterm/xterm@5.5.0) + '@xterm/addon-webgl': + specifier: ^0.18.0 + version: 0.18.0(@xterm/xterm@5.5.0) + '@xterm/xterm': + specifier: ^5.5.0 + version: 5.5.0 create-react-class: specifier: ^15.6.3 version: 15.7.0 events: specifier: 3.3.0 version: 3.3.0 - xterm: - specifier: ^5.3.0 - version: 5.3.0 - xterm-addon-canvas: - specifier: ^0.5.0 - version: 0.5.0(xterm@5.3.0) - xterm-addon-fit: - specifier: ^0.8.0 - version: 0.8.0(xterm@5.3.0) - xterm-addon-web-links: - specifier: ^0.9.0 - version: 0.9.0(xterm@5.3.0) - xterm-addon-webgl: - specifier: ^0.16.0 - version: 0.16.0(xterm@5.3.0) devDependencies: '@gravitational/build': specifier: workspace:* @@ -446,6 +446,12 @@ importers: '@types/whatwg-url': specifier: ^11.0.5 version: 11.0.5 + '@xterm/addon-fit': + specifier: ^0.10.0 + version: 0.10.0(@xterm/xterm@5.5.0) + '@xterm/xterm': + specifier: ^5.5.0 + version: 5.5.0 electron: specifier: 31.1.0 version: 31.1.0 @@ -476,12 +482,6 @@ importers: whatwg-url: specifier: ^13.0.0 version: 13.0.0 - xterm: - specifier: ^5.3.0 - version: 5.3.0 - xterm-addon-fit: - specifier: ^0.8.0 - version: 0.8.0(xterm@5.3.0) zod: specifier: ^3.23.8 version: 3.23.8 @@ -2899,6 +2899,29 @@ packages: resolution: {integrity: sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==} engines: {node: '>=10.0.0'} + '@xterm/addon-canvas@0.7.0': + resolution: {integrity: sha512-LF5LYcfvefJuJ7QotNRdRSPc9YASAVDeoT5uyXS/nZshZXjYplGXRECBGiznwvhNL2I8bq1Lf5MzRwstsYQ2Iw==} + peerDependencies: + '@xterm/xterm': ^5.0.0 + + '@xterm/addon-fit@0.10.0': + resolution: {integrity: sha512-UFYkDm4HUahf2lnEyHvio51TNGiLK66mqP2JoATy7hRZeXaGMRDr00JiSF7m63vR5WKATF605yEggJKsw0JpMQ==} + peerDependencies: + '@xterm/xterm': ^5.0.0 + + '@xterm/addon-web-links@0.11.0': + resolution: {integrity: sha512-nIHQ38pQI+a5kXnRaTgwqSHnX7KE6+4SVoceompgHL26unAxdfP6IPqUTSYPQgSwM56hsElfoNrrW5V7BUED/Q==} + peerDependencies: + '@xterm/xterm': ^5.0.0 + + '@xterm/addon-webgl@0.18.0': + resolution: {integrity: sha512-xCnfMBTI+/HKPdRnSOHaJDRqEpq2Ugy8LEj9GiY4J3zJObo3joylIFaMvzBwbYRg8zLtkO0KQaStCeSfoaI2/w==} + peerDependencies: + '@xterm/xterm': ^5.0.0 + + '@xterm/xterm@5.5.0': + resolution: {integrity: sha512-hqJHYaQb5OptNunnyAnkHyM8aCjZ1MEIDTQu1iIbbTD/xops91NB5yq1ZK/dC2JDbVWtF23zUtl9JE2NqwT87A==} + '@xtuc/ieee754@1.2.0': resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} @@ -8264,34 +8287,6 @@ packages: resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} engines: {node: '>=0.4'} - xterm-addon-canvas@0.5.0: - resolution: {integrity: sha512-QOo/eZCMrCleAgMimfdbaZCgmQRWOml63Ued6RwQ+UTPvQj3Av9QKx3xksmyYrDGRO/AVRXa9oNuzlYvLdmoLQ==} - deprecated: This package is now deprecated. Move to @xterm/addon-canvas instead. - peerDependencies: - xterm: ^5.0.0 - - xterm-addon-fit@0.8.0: - resolution: {integrity: sha512-yj3Np7XlvxxhYF/EJ7p3KHaMt6OdwQ+HDu573Vx1lRXsVxOcnVJs51RgjZOouIZOczTsskaS+CpXspK81/DLqw==} - deprecated: This package is now deprecated. Move to @xterm/addon-fit instead. - peerDependencies: - xterm: ^5.0.0 - - xterm-addon-web-links@0.9.0: - resolution: {integrity: sha512-LIzi4jBbPlrKMZF3ihoyqayWyTXAwGfu4yprz1aK2p71e9UKXN6RRzVONR0L+Zd+Ik5tPVI9bwp9e8fDTQh49Q==} - deprecated: This package is now deprecated. Move to @xterm/addon-web-links instead. - peerDependencies: - xterm: ^5.0.0 - - xterm-addon-webgl@0.16.0: - resolution: {integrity: sha512-E8cq1AiqNOv0M/FghPT+zPAEnvIQRDbAbkb04rRYSxUym69elPWVJ4sv22FCLBqM/3LcrmBLl/pELnBebVFKgA==} - deprecated: This package is now deprecated. Move to @xterm/addon-webgl instead. - peerDependencies: - xterm: ^5.0.0 - - xterm@5.3.0: - resolution: {integrity: sha512-8QqjlekLUFTrU6x7xck1MsPzPA571K5zNqWm0M0oroYEWVOptZ0+ubQSkQ3uxIEhcIHRujJy6emDWX4A7qyFzg==} - deprecated: This package is now deprecated. Move to @xterm/xterm instead. - y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} @@ -11846,6 +11841,24 @@ snapshots: '@xmldom/xmldom@0.8.10': {} + '@xterm/addon-canvas@0.7.0(@xterm/xterm@5.5.0)': + dependencies: + '@xterm/xterm': 5.5.0 + + '@xterm/addon-fit@0.10.0(@xterm/xterm@5.5.0)': + dependencies: + '@xterm/xterm': 5.5.0 + + '@xterm/addon-web-links@0.11.0(@xterm/xterm@5.5.0)': + dependencies: + '@xterm/xterm': 5.5.0 + + '@xterm/addon-webgl@0.18.0(@xterm/xterm@5.5.0)': + dependencies: + '@xterm/xterm': 5.5.0 + + '@xterm/xterm@5.5.0': {} + '@xtuc/ieee754@1.2.0': {} '@xtuc/long@4.2.2': {} @@ -18379,24 +18392,6 @@ snapshots: xtend@4.0.2: {} - xterm-addon-canvas@0.5.0(xterm@5.3.0): - dependencies: - xterm: 5.3.0 - - xterm-addon-fit@0.8.0(xterm@5.3.0): - dependencies: - xterm: 5.3.0 - - xterm-addon-web-links@0.9.0(xterm@5.3.0): - dependencies: - xterm: 5.3.0 - - xterm-addon-webgl@0.16.0(xterm@5.3.0): - dependencies: - xterm: 5.3.0 - - xterm@5.3.0: {} - y18n@5.0.8: {} yallist@2.1.2: {} diff --git a/web/packages/teleport/package.json b/web/packages/teleport/package.json index 3f4aa00aee9a1..cf7bbcafc55d9 100644 --- a/web/packages/teleport/package.json +++ b/web/packages/teleport/package.json @@ -32,13 +32,13 @@ "@opentelemetry/sdk-trace-base": "1.25.1", "@opentelemetry/sdk-trace-web": "1.25.1", "@opentelemetry/semantic-conventions": "1.25.1", + "@xterm/xterm": "^5.5.0", + "@xterm/addon-canvas": "^0.7.0", + "@xterm/addon-fit": "^0.10.0", + "@xterm/addon-web-links": "^0.11.0", + "@xterm/addon-webgl": "^0.18.0", "create-react-class": "^15.6.3", - "events": "3.3.0", - "xterm": "^5.3.0", - "xterm-addon-canvas": "^0.5.0", - "xterm-addon-fit": "^0.8.0", - "xterm-addon-web-links": "^0.9.0", - "xterm-addon-webgl": "^0.16.0" + "events": "3.3.0" }, "devDependencies": { "@gravitational/build": "workspace:*", diff --git a/web/packages/teleport/src/Console/DocumentSsh/Terminal/Terminal.tsx b/web/packages/teleport/src/Console/DocumentSsh/Terminal/Terminal.tsx index c832e7c625460..027a756aaae5c 100644 --- a/web/packages/teleport/src/Console/DocumentSsh/Terminal/Terminal.tsx +++ b/web/packages/teleport/src/Console/DocumentSsh/Terminal/Terminal.tsx @@ -23,7 +23,7 @@ import React, { useRef, } from 'react'; import { Flex } from 'design'; -import { ITheme } from 'xterm'; +import { ITheme } from '@xterm/xterm'; import { getPlatformType } from 'design/platform'; diff --git a/web/packages/teleport/src/Console/StyledXterm/StyledXterm.tsx b/web/packages/teleport/src/Console/StyledXterm/StyledXterm.tsx index 7c20e10b45356..07f0aba027f99 100644 --- a/web/packages/teleport/src/Console/StyledXterm/StyledXterm.tsx +++ b/web/packages/teleport/src/Console/StyledXterm/StyledXterm.tsx @@ -19,7 +19,7 @@ import styled from 'styled-components'; import { Box } from 'design'; -import 'xterm/css/xterm.css'; +import '@xterm/xterm/css/xterm.css'; const StyledXterm = styled(Box)( () => ` diff --git a/web/packages/teleport/src/lib/term/terminal.ts b/web/packages/teleport/src/lib/term/terminal.ts index 7816a78f92f2c..cc8f68a2ff12b 100644 --- a/web/packages/teleport/src/lib/term/terminal.ts +++ b/web/packages/teleport/src/lib/term/terminal.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -import 'xterm/css/xterm.css'; -import { ITheme, Terminal } from 'xterm'; -import { FitAddon } from 'xterm-addon-fit'; -import { WebglAddon } from 'xterm-addon-webgl'; +import '@xterm/xterm/css/xterm.css'; +import { ITheme, Terminal } from '@xterm/xterm'; +import { FitAddon } from '@xterm/addon-fit'; +import { WebglAddon } from '@xterm/addon-webgl'; +import { WebLinksAddon } from '@xterm/addon-web-links'; +import { CanvasAddon } from '@xterm/addon-canvas'; import { debounce, isInteger } from 'shared/utils/highbar'; -import { WebLinksAddon } from 'xterm-addon-web-links'; -import { CanvasAddon } from 'xterm-addon-canvas'; import Logger from 'shared/libs/logger'; import cfg from 'teleport/config'; diff --git a/web/packages/teleterm/package.json b/web/packages/teleterm/package.json index 8a81331e986d1..760d33cec8c16 100644 --- a/web/packages/teleterm/package.json +++ b/web/packages/teleterm/package.json @@ -42,6 +42,8 @@ "@types/node-forge": "^1.3.11", "@types/tar-fs": "^2.0.4", "@types/whatwg-url": "^11.0.5", + "@xterm/xterm": "^5.5.0", + "@xterm/addon-fit": "^0.10.0", "electron": "31.1.0", "electron-builder": "^25.0.1", "electron-notarize": "^1.2.2", @@ -52,8 +54,6 @@ "react-dnd": "^14.0.4", "react-dnd-html5-backend": "^14.0.2", "whatwg-url": "^13.0.0", - "xterm": "^5.3.0", - "xterm-addon-fit": "^0.8.0", "zod": "^3.23.8", "zod-to-json-schema": "^3.23.1" }, diff --git a/web/packages/teleterm/src/ui/DocumentTerminal/Terminal/ctrl.ts b/web/packages/teleterm/src/ui/DocumentTerminal/Terminal/ctrl.ts index fdae12dcad53e..1c95eee44a554 100644 --- a/web/packages/teleterm/src/ui/DocumentTerminal/Terminal/ctrl.ts +++ b/web/packages/teleterm/src/ui/DocumentTerminal/Terminal/ctrl.ts @@ -16,9 +16,9 @@ * along with this program. If not, see . */ -import 'xterm/css/xterm.css'; -import { IDisposable, ITheme, Terminal } from 'xterm'; -import { FitAddon } from 'xterm-addon-fit'; +import '@xterm/xterm/css/xterm.css'; +import { IDisposable, ITheme, Terminal } from '@xterm/xterm'; +import { FitAddon } from '@xterm/addon-fit'; import { debounce } from 'shared/utils/highbar'; import { IPtyProcess } from 'teleterm/sharedProcess/ptyHost';