Skip to content

Commit 8a1790d

Browse files
committed
Merge remote-tracking branch 'upstream/master' into pr/tisilent/4801
2 parents da26871 + 86074c9 commit 8a1790d

File tree

291 files changed

+1159
-630
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+1159
-630
lines changed

.eslintrc.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,29 @@
1414
"test/api/tsconfig.json",
1515
"test/benchmark/tsconfig.json",
1616
"test/playwright/tsconfig.json",
17-
"addons/xterm-addon-attach/src/tsconfig.json",
18-
"addons/xterm-addon-attach/test/tsconfig.json",
19-
"addons/xterm-addon-canvas/src/tsconfig.json",
20-
"addons/xterm-addon-canvas/test/tsconfig.json",
21-
"addons/xterm-addon-fit/src/tsconfig.json",
22-
"addons/xterm-addon-fit/test/tsconfig.json",
23-
"addons/xterm-addon-image/src/tsconfig.json",
24-
"addons/xterm-addon-image/test/tsconfig.json",
25-
"addons/xterm-addon-ligatures/src/tsconfig.json",
26-
"addons/xterm-addon-search/src/tsconfig.json",
27-
"addons/xterm-addon-search/test/tsconfig.json",
28-
"addons/xterm-addon-serialize/src/tsconfig.json",
29-
"addons/xterm-addon-serialize/test/tsconfig.json",
30-
"addons/xterm-addon-serialize/benchmark/tsconfig.json",
31-
"addons/xterm-addon-unicode11/src/tsconfig.json",
32-
"addons/xterm-addon-unicode11/test/tsconfig.json",
33-
"addons/xterm-addon-unicode-graphemes/src/tsconfig.json",
34-
"addons/xterm-addon-unicode-graphemes/test/tsconfig.json",
35-
"addons/xterm-addon-unicode-graphemes/benchmark/tsconfig.json",
36-
"addons/xterm-addon-web-links/src/tsconfig.json",
37-
"addons/xterm-addon-web-links/test/tsconfig.json",
38-
"addons/xterm-addon-webgl/src/tsconfig.json",
39-
"addons/xterm-addon-webgl/test/tsconfig.json"
17+
"addons/addon-attach/src/tsconfig.json",
18+
"addons/addon-attach/test/tsconfig.json",
19+
"addons/addon-canvas/src/tsconfig.json",
20+
"addons/addon-canvas/test/tsconfig.json",
21+
"addons/addon-fit/src/tsconfig.json",
22+
"addons/addon-fit/test/tsconfig.json",
23+
"addons/addon-image/src/tsconfig.json",
24+
"addons/addon-image/test/tsconfig.json",
25+
"addons/addon-ligatures/src/tsconfig.json",
26+
"addons/addon-search/src/tsconfig.json",
27+
"addons/addon-search/test/tsconfig.json",
28+
"addons/addon-serialize/src/tsconfig.json",
29+
"addons/addon-serialize/test/tsconfig.json",
30+
"addons/addon-serialize/benchmark/tsconfig.json",
31+
"addons/addon-unicode11/src/tsconfig.json",
32+
"addons/addon-unicode11/test/tsconfig.json",
33+
"addons/addon-unicode-graphemes/src/tsconfig.json",
34+
"addons/addon-unicode-graphemes/test/tsconfig.json",
35+
"addons/addon-unicode-graphemes/benchmark/tsconfig.json",
36+
"addons/addon-web-links/src/tsconfig.json",
37+
"addons/addon-web-links/test/tsconfig.json",
38+
"addons/addon-webgl/src/tsconfig.json",
39+
"addons/addon-webgl/test/tsconfig.json"
4040
],
4141
"sourceType": "module"
4242
},

.github/workflows/ci.yml

Lines changed: 64 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,28 @@ jobs:
2626
zip -r compressed-build \
2727
./out/* \
2828
./out-test/* \
29-
./addons/xterm-addon-attach/out/* \
30-
./addons/xterm-addon-attach/out-test/* \
31-
./addons/xterm-addon-canvas/out/* \
32-
./addons/xterm-addon-canvas/out-test/* \
33-
./addons/xterm-addon-fit/out/* \
34-
./addons/xterm-addon-fit/out-test/* \
35-
./addons/xterm-addon-image/out/* \
36-
./addons/xterm-addon-image/out-test/* \
37-
./addons/xterm-addon-ligatures/out/* \
38-
./addons/xterm-addon-ligatures/out-test/* \
39-
./addons/xterm-addon-search/out/* \
40-
./addons/xterm-addon-search/out-test/* \
41-
./addons/xterm-addon-serialize/out/* \
42-
./addons/xterm-addon-serialize/out-test/* \
43-
./addons/xterm-addon-unicode11/out/* \
44-
./addons/xterm-addon-unicode11/out-test/* \
45-
./addons/xterm-addon-unicode-graphemes/out/* \
46-
./addons/xterm-addon-unicode-graphemes/out-test/* \
47-
./addons/xterm-addon-web-links/out/* \
48-
./addons/xterm-addon-web-links/out-test/* \
49-
./addons/xterm-addon-webgl/out/* \
50-
./addons/xterm-addon-webgl/out-test/*
29+
./addons/addon-attach/out/* \
30+
./addons/addon-attach/out-test/* \
31+
./addons/addon-canvas/out/* \
32+
./addons/addon-canvas/out-test/* \
33+
./addons/addon-fit/out/* \
34+
./addons/addon-fit/out-test/* \
35+
./addons/addon-image/out/* \
36+
./addons/addon-image/out-test/* \
37+
./addons/addon-ligatures/out/* \
38+
./addons/addon-ligatures/out-test/* \
39+
./addons/addon-search/out/* \
40+
./addons/addon-search/out-test/* \
41+
./addons/addon-serialize/out/* \
42+
./addons/addon-serialize/out-test/* \
43+
./addons/addon-unicode11/out/* \
44+
./addons/addon-unicode11/out-test/* \
45+
./addons/addon-unicode-graphemes/out/* \
46+
./addons/addon-unicode-graphemes/out-test/* \
47+
./addons/addon-web-links/out/* \
48+
./addons/addon-web-links/out-test/* \
49+
./addons/addon-webgl/out/* \
50+
./addons/addon-webgl/out-test/*
5151
- name: Upload artifacts
5252
uses: actions/upload-artifact@v3
5353
with:
@@ -265,10 +265,10 @@ jobs:
265265
run: yarn build-demo
266266
- name: Integration tests (core) # Tests use 50% workers to reduce flakiness
267267
run: yarn test-playwright-${{ matrix.browser }} --workers=50% --forbid-only --suite=core
268-
- name: Integration tests (xterm-addon-canvas)
269-
run: yarn test-playwright-${{ matrix.browser }} --workers=50% --forbid-only --suite=xterm-addon-canvas
270-
- name: Integration tests (xterm-addon-webgl)
271-
run: yarn test-playwright-${{ matrix.browser }} --workers=50% --forbid-only --suite=xterm-addon-webgl
268+
- name: Integration tests (addon-canvas)
269+
run: yarn test-playwright-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-canvas
270+
- name: Integration tests (addon-webgl)
271+
run: yarn test-playwright-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-webgl
272272

273273
test-api:
274274
needs: build
@@ -306,3 +306,41 @@ jobs:
306306
ls -R
307307
- name: Integration tests (${{ matrix.browser }})
308308
run: yarn test-api-${{ matrix.browser }} --headless --forbid-only
309+
310+
release-dry-run:
311+
needs: build
312+
runs-on: ubuntu-latest
313+
strategy:
314+
matrix:
315+
node-version: [18]
316+
steps:
317+
- uses: actions/checkout@v3
318+
- name: Use Node.js ${{ matrix.node-version }}.x
319+
uses: actions/setup-node@v3
320+
with:
321+
node-version: ${{ matrix.node-version }}.x
322+
cache: 'yarn'
323+
- name: Install dependencies
324+
run: |
325+
yarn --frozen-lockfile
326+
yarn install-addons
327+
- name: Install playwright
328+
run: npx playwright install
329+
- uses: actions/download-artifact@v3
330+
with:
331+
name: build-artifacts
332+
- name: Unzip artifacts
333+
shell: bash
334+
run: |
335+
if [ "$RUNNER_OS" == "Windows" ]; then
336+
pwsh -Command "7z x compressed-build.zip -aoa -o${{ github.workspace }}"
337+
else
338+
unzip -o compressed-build.zip
339+
fi
340+
ls -R
341+
- name: Package headless
342+
run: |
343+
yarn package-headless
344+
node ./bin/package_headless.js
345+
- name: Publish to npm (dry run)
346+
run: node ./bin/publish.js --dry

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ To start using xterm.js on your browser, add the `xterm.js` and `xterm.css` to t
4949
The recommended way to load xterm.js is via the ES6 module syntax:
5050

5151
```javascript
52-
import { Terminal } from 'xterm';
52+
import { Terminal } from '@xterm/xterm';
5353
```
5454

5555
### Addons
@@ -59,14 +59,14 @@ import { Terminal } from 'xterm';
5959
Addons are separate modules that extend the `Terminal` by building on the [xterm.js API](https://github.com/xtermjs/xterm.js/blob/master/typings/xterm.d.ts). To use an addon, you first need to install it in your project:
6060

6161
```bash
62-
npm i -S xterm-addon-web-links
62+
npm i -S @xterm/addon-web-links
6363
```
6464

6565
Then import the addon, instantiate it and call `Terminal.loadAddon`:
6666

6767
```ts
68-
import { Terminal } from 'xterm';
69-
import { WebLinksAddon } from 'xterm-addon-web-links';
68+
import { Terminal } from '@xterm/xterm';
69+
import { WebLinksAddon } from '@xterm/addon-web-links';
7070

7171
const terminal = new Terminal();
7272
// Load WebLinksAddon on terminal, this is all that's needed to get web links
@@ -76,10 +76,15 @@ terminal.loadAddon(new WebLinksAddon());
7676

7777
The xterm.js team maintains the following addons, but anyone can build them:
7878

79-
- [`xterm-addon-attach`](https://github.com/xtermjs/xterm.js/tree/master/addons/xterm-addon-attach): Attaches to a server running a process via a websocket
80-
- [`xterm-addon-fit`](https://github.com/xtermjs/xterm.js/tree/master/addons/xterm-addon-fit): Fits the terminal to the containing element
81-
- [`xterm-addon-search`](https://github.com/xtermjs/xterm.js/tree/master/addons/xterm-addon-search): Adds search functionality
82-
- [`xterm-addon-web-links`](https://github.com/xtermjs/xterm.js/tree/master/addons/xterm-addon-web-links): Adds web link detection and interaction
79+
- [`@xterm/addon-attach`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-attach): Attaches to a server running a process via a websocket
80+
- [`@xterm/addon-canvas`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-canvas): Renders xterm.js using a `canvas` element's 2d context
81+
- [`@xterm/addon-fit`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-fit): Fits the terminal to the containing element
82+
- [`@xterm/addon-image`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-image): Adds image support
83+
- [`@xterm/addon-search`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-search): Adds search functionality
84+
- [`@xterm/addon-serialize`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-serialize): Serializes the terminal's buffer to a VT sequences or HTML
85+
- [`@xterm/addon-unicode11`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-unicode11): Updates character widths to their unicode11 values
86+
- [`@xterm/addon-web-links`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-web-links): Adds web link detection and interaction
87+
- [`@xterm/addon-webgl`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-webgl): Renders xterm.js using a `canvas` element's webgl2 context
8388

8489
## Browser Support
8590

File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
## xterm-addon-attach
1+
## @xterm/addon-attach
22

33
An addon for [xterm.js](https://github.com/xtermjs/xterm.js) that enables attaching to a web socket. This addon requires xterm.js v4+.
44

55
### Install
66

77
```bash
8-
npm install --save xterm-addon-attach
8+
npm install --save @xterm/addon-attach
99
```
1010

1111
### Usage
1212

1313
```ts
14-
import { Terminal } from 'xterm';
15-
import { AttachAddon } from 'xterm-addon-attach';
14+
import { Terminal } from '@xterm/xterm';
15+
import { AttachAddon } from '@xterm/addon-attach';
1616

1717
const terminal = new Terminal();
1818
const attachAddon = new AttachAddon(webSocket);
1919
terminal.loadAddon(attachAddon);
2020
```
2121

22-
See the full [API](https://github.com/xtermjs/xterm.js/blob/master/addons/xterm-addon-attach/typings/xterm-addon-attach.d.ts) for more advanced usage.
22+
See the full [API](https://github.com/xtermjs/xterm.js/blob/master/addons/addon-attach/typings/addon-attach.d.ts) for more advanced usage.

addons/xterm-addon-attach/package.json renamed to addons/addon-attach/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"name": "xterm-addon-attach",
2+
"name": "@xterm/addon-attach",
33
"version": "0.9.0",
44
"author": {
55
"name": "The xterm.js authors",
66
"url": "https://xtermjs.org/"
77
},
8-
"main": "lib/xterm-addon-attach.js",
9-
"types": "typings/xterm-addon-attach.d.ts",
10-
"repository": "https://github.com/xtermjs/xterm.js/tree/master/addons/xterm-addon-attach",
8+
"main": "lib/addon-attach.js",
9+
"types": "typings/addon-attach.d.ts",
10+
"repository": "https://github.com/xtermjs/xterm.js/tree/master/addons/addon-attach",
1111
"license": "MIT",
1212
"keywords": [
1313
"terminal",
@@ -21,6 +21,6 @@
2121
"prepublishOnly": "npm run package"
2222
},
2323
"peerDependencies": {
24-
"xterm": "^5.0.0"
24+
"@xterm/xterm": "^5.0.0"
2525
}
2626
}

addons/xterm-addon-attach/src/AttachAddon.ts renamed to addons/addon-attach/src/AttachAddon.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
* Implements the attach method, that attaches the terminal to a WebSocket stream.
66
*/
77

8-
import { Terminal, IDisposable, ITerminalAddon } from 'xterm';
8+
import type { Terminal, IDisposable, ITerminalAddon } from '@xterm/xterm';
9+
import type { AttachAddon as IAttachApi } from '@xterm/addon-attach';
910

1011
interface IAttachOptions {
1112
bidirectional?: boolean;
1213
}
1314

14-
export class AttachAddon implements ITerminalAddon {
15+
export class AttachAddon implements ITerminalAddon , IAttachApi {
1516
private _socket: WebSocket;
1617
private _bidirectional: boolean;
1718
private _disposables: IDisposable[] = [];

addons/xterm-addon-attach/src/tsconfig.json renamed to addons/addon-attach/src/tsconfig.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313
"strict": true,
1414
"types": [
1515
"../../../node_modules/@types/mocha"
16-
]
16+
],
17+
"paths": {
18+
"@xterm/addon-attach": [
19+
"../typings/addon-attach.d.ts"
20+
]
21+
}
1722
},
1823
"include": [
1924
"./**/*",

0 commit comments

Comments
 (0)